From 13e7a115015570375528574b058c846d469fd3a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Feb 2021 20:52:09 +0100 Subject: [PATCH 0001/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.11.0 (#1140) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.10.0` -> `0.11.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.0/compatibility-slim/0.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.0/confidence-slim/0.10.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v0.11.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​0110-httpswwwgithubcomgoogleapisjava-shared-configcomparev0100v0110-2021-02-25) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.10.0...v0.11.0) ##### Features - migrate releases to the new Google Sonatype endpoint to address Sonatype errors. ([#​230](https://www.github.com/googleapis/java-shared-config/issues/230)) ([ff6a95f](https://www.github.com/googleapis/java-shared-config/commit/ff6a95f7b0d24a1c37c38ba8ac6c6624ee97cc15)) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v8.40 ([#​221](https://www.github.com/googleapis/java-shared-config/issues/221)) ([d9b2d4a](https://www.github.com/googleapis/java-shared-config/commit/d9b2d4aab9a9bba1c2df6fcb52ac96ee8b001ad6)) - update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.1.2 ([#​219](https://www.github.com/googleapis/java-shared-config/issues/219)) ([f7c3f79](https://www.github.com/googleapis/java-shared-config/commit/f7c3f798ef8ad1bc59ae673c84fbdd9f93ee2413))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4cd778c24a..2b7c8afbf3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.10.0 + 0.11.0 From b5c90db802d19d1d3426cc4228061f7b6aafa28e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Feb 2021 23:14:39 +0100 Subject: [PATCH 0002/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 (#1141) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `0.19.0` -> `0.20.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.0/compatibility-slim/0.19.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.0/confidence-slim/0.19.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v0.20.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​0200-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0190v0200-2021-02-25) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.19.0...v0.20.0) ##### Dependencies - update dependency com.google.auth:google-auth-library-bom to v0.24.0 ([#​284](https://www.github.com/googleapis/java-shared-dependencies/issues/284)) ([5e4914c](https://www.github.com/googleapis/java-shared-dependencies/commit/5e4914cc4a8ccd41a219f150a7455da116d1594b)) - update dependency com.google.http-client:google-http-client-bom to v1.39.0 ([#​288](https://www.github.com/googleapis/java-shared-dependencies/issues/288)) ([70bb862](https://www.github.com/googleapis/java-shared-dependencies/commit/70bb862029b840fbd99ba0109fa2b8f585812793)) - update dependency com.google.protobuf:protobuf-bom to v3.15.1 ([#​282](https://www.github.com/googleapis/java-shared-dependencies/issues/282)) ([44283bd](https://www.github.com/googleapis/java-shared-dependencies/commit/44283bdfdc9288b4a8d16b6ed3a61541792d147e)) - update dependency com.google.protobuf:protobuf-bom to v3.15.2 ([#​287](https://www.github.com/googleapis/java-shared-dependencies/issues/287)) ([bdae560](https://www.github.com/googleapis/java-shared-dependencies/commit/bdae5600f9033219ef8beb6c4d1c521fb062eaec)) - update dependency io.grpc:grpc-bom to v1.36.0 ([#​285](https://www.github.com/googleapis/java-shared-dependencies/issues/285)) ([c59771b](https://www.github.com/googleapis/java-shared-dependencies/commit/c59771b2436ac1a4fbc92b48049900472dd6d3ff)) - update gax.version to v1.62.0 ([#​291](https://www.github.com/googleapis/java-shared-dependencies/issues/291)) ([66bd070](https://www.github.com/googleapis/java-shared-dependencies/commit/66bd0702bd3deb64e0f6c73635e0ffd51a4d637e)) - update google.common-protos.version to v2.1.0 ([#​289](https://www.github.com/googleapis/java-shared-dependencies/issues/289)) ([43c9f02](https://www.github.com/googleapis/java-shared-dependencies/commit/43c9f026b1fa82f38dcb93b902281c2559e82d8e)) - update iam.version to v1.0.9 ([#​281](https://www.github.com/googleapis/java-shared-dependencies/issues/281)) ([ee44d0b](https://www.github.com/googleapis/java-shared-dependencies/commit/ee44d0b41e101931ccf5de2561dfcfcc9ff88b88))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2b7c8afbf3..0c17330028 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210215-1.31.0 - 0.19.0 + 0.20.0 From 7007482e72d301d5c44b6c8c58e04c725f340c09 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 22:40:11 +0000 Subject: [PATCH 0003/2268] chore(master): release 1.127.5 (#1142) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.5](https://www.github.com/googleapis/java-bigquery/compare/v1.127.4...v1.127.5) (2021-02-25) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#1141](https://www.github.com/googleapis/java-bigquery/issues/1141)) ([b5c90db](https://www.github.com/googleapis/java-bigquery/commit/b5c90db802d19d1d3426cc4228061f7b6aafa28e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6088cfe2e9..03d2a7717a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.127.5](https://www.github.com/googleapis/java-bigquery/compare/v1.127.4...v1.127.5) (2021-02-25) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#1141](https://www.github.com/googleapis/java-bigquery/issues/1141)) ([b5c90db](https://www.github.com/googleapis/java-bigquery/commit/b5c90db802d19d1d3426cc4228061f7b6aafa28e)) + ### [1.127.4](https://www.github.com/googleapis/java-bigquery/compare/v1.127.3...v1.127.4) (2021-02-23) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 43262bd161..268c1e3b9c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.5-SNAPSHOT + 1.127.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1e5b150576..065ee0b387 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.5-SNAPSHOT + 1.127.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.5-SNAPSHOT + 1.127.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0c17330028..23bcf20925 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.5-SNAPSHOT + 1.127.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.5-SNAPSHOT + 1.127.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fb193c9b52..69e687aa93 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.5-SNAPSHOT + 1.127.5 diff --git a/versions.txt b/versions.txt index 3089393371..4e25d163df 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.4:1.127.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.5:1.127.5 \ No newline at end of file From bbac808dd26a2c3ce219265f740eff62db3e295e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 22:56:10 +0000 Subject: [PATCH 0004/2268] chore(master): release 1.127.6-SNAPSHOT (#1143) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 268c1e3b9c..5fe82cee30 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.5 + 1.127.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 065ee0b387..7d3d80aecf 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.5 + 1.127.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.5 + 1.127.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 23bcf20925..5d78029406 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.5 + 1.127.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.5 + 1.127.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 69e687aa93..cd6835f33c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.5 + 1.127.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4e25d163df..bf333665a3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.5:1.127.5 \ No newline at end of file +google-cloud-bigquery:1.127.5:1.127.6-SNAPSHOT \ No newline at end of file From fdf865ef13541d4bc6ed7f4f1393506f31ae494d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Feb 2021 02:18:25 +0100 Subject: [PATCH 0005/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.10 (#1144) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `1.0.9` -> `1.0.10` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.0.10/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.0.10/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.0.10/compatibility-slim/1.0.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.0.10/confidence-slim/1.0.9)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigqueryconnection ### [`v1.0.10`](https://togithub.com/googleapis/java-bigqueryconnection/blob/master/CHANGELOG.md#​1010-httpswwwgithubcomgoogleapisjava-bigqueryconnectioncomparev109v1010-2021-02-25) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v1.0.9...v1.0.10)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2033fca532..1334f17a5d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.9 + 1.0.10 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cd6835f33c..33f5ed8153 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.9 + 1.0.10 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 95f303a00d..95729daf8f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -82,7 +82,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.9 + 1.0.10 test From 77790cda6941624eae0d56e1933f445c615193f9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Feb 2021 02:20:09 +0100 Subject: [PATCH 0006/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.5 (#1145) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.127.4` -> `1.127.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.5/compatibility-slim/1.127.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.5/confidence-slim/1.127.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1334f17a5d..bcf06f96f8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.4 + 1.127.5 From a66aae1d6712d5b67f7d34e81ecddc51c3a68b04 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 25 Feb 2021 17:36:10 -0800 Subject: [PATCH 0007/2268] chore: regenerate README (#1146) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-02-26 01:22:04,870 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-02-26 01:22:06,494 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/7f00400f-3e73-4526-9ce5-d2a6e8d0e07a/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index c8dc51757a..fe59aa2762 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "512994faf521e8374da743406e0cb5e366a9d57c" + "sha": "77790cda6941624eae0d56e1933f445c615193f9" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79ab0b44a2cc7d803d07c107f9faf07729fc4012" + "sha": "8c5628b86cfa8386de7b8fc1675e6b528b552d57" } } ] diff --git a/README.md b/README.md index 92b0437ea6..7717c93e6a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.4 + 1.127.5 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.4' +compile 'com.google.cloud:google-cloud-bigquery:1.127.5' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.5" ``` ## Authentication From 2c46002011405de68cdbd84c4eb99b8014e1fb82 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Feb 2021 23:16:33 +0100 Subject: [PATCH 0008/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.11 (#1148) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index bcf06f96f8..5e3519149a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.10 + 1.0.11 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 33f5ed8153..7ebe9509ec 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.10 + 1.0.11 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 95729daf8f..dd4e001c4a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -82,7 +82,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.10 + 1.0.11 test From 4cafa863f2bcc1ae36c493c616aea6c699242015 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 1 Mar 2021 19:26:31 +0100 Subject: [PATCH 0009/2268] deps: update jmh.version to v1.28 (#1151) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5fe82cee30..3152e833c2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.26 + 1.28 benchmark From 5c7e32f890bb1fa5cc25641f8a73afb775eeb0a8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 1 Mar 2021 23:54:44 +0100 Subject: [PATCH 0010/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210219-1.31.0 (#1149) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d78029406..60537c6e5e 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210215-1.31.0 + v2-rev20210219-1.31.0 0.20.0
From 9a058a746a27d34829e12e4e3ff4a838560181b1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Mar 2021 21:37:23 +0100 Subject: [PATCH 0011/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.12 (#1153) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 60537c6e5e..75413c5a06 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.11 + 1.113.12 test From 60c78e3ed43f33867442589932cbb48dd5de50d6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 20:50:03 +0000 Subject: [PATCH 0012/2268] chore(master): release 1.127.6 (#1152) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.6](https://www.github.com/googleapis/java-bigquery/compare/v1.127.5...v1.127.6) (2021-03-02) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210219-1.31.0 ([#1149](https://www.github.com/googleapis/java-bigquery/issues/1149)) ([5c7e32f](https://www.github.com/googleapis/java-bigquery/commit/5c7e32f890bb1fa5cc25641f8a73afb775eeb0a8)) * update dependency com.google.cloud:google-cloud-storage to v1.113.12 ([#1153](https://www.github.com/googleapis/java-bigquery/issues/1153)) ([9a058a7](https://www.github.com/googleapis/java-bigquery/commit/9a058a746a27d34829e12e4e3ff4a838560181b1)) * update jmh.version to v1.28 ([#1151](https://www.github.com/googleapis/java-bigquery/issues/1151)) ([4cafa86](https://www.github.com/googleapis/java-bigquery/commit/4cafa863f2bcc1ae36c493c616aea6c699242015)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03d2a7717a..6bcb97384f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### [1.127.6](https://www.github.com/googleapis/java-bigquery/compare/v1.127.5...v1.127.6) (2021-03-02) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210219-1.31.0 ([#1149](https://www.github.com/googleapis/java-bigquery/issues/1149)) ([5c7e32f](https://www.github.com/googleapis/java-bigquery/commit/5c7e32f890bb1fa5cc25641f8a73afb775eeb0a8)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.12 ([#1153](https://www.github.com/googleapis/java-bigquery/issues/1153)) ([9a058a7](https://www.github.com/googleapis/java-bigquery/commit/9a058a746a27d34829e12e4e3ff4a838560181b1)) +* update jmh.version to v1.28 ([#1151](https://www.github.com/googleapis/java-bigquery/issues/1151)) ([4cafa86](https://www.github.com/googleapis/java-bigquery/commit/4cafa863f2bcc1ae36c493c616aea6c699242015)) + ### [1.127.5](https://www.github.com/googleapis/java-bigquery/compare/v1.127.4...v1.127.5) (2021-02-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3152e833c2..1092364c24 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.6-SNAPSHOT + 1.127.6 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7d3d80aecf..9d7e2490f8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.6-SNAPSHOT + 1.127.6 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.6-SNAPSHOT + 1.127.6 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 75413c5a06..8f48c2a625 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.6-SNAPSHOT + 1.127.6 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.6-SNAPSHOT + 1.127.6 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7ebe9509ec..91d9175f5c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.6-SNAPSHOT + 1.127.6 diff --git a/versions.txt b/versions.txt index bf333665a3..fb4db57838 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.5:1.127.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.6:1.127.6 \ No newline at end of file From 7cb21503b44b2225d52c298d6cc698a1335542fa Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 21:02:03 +0000 Subject: [PATCH 0013/2268] chore(master): release 1.127.7-SNAPSHOT (#1154) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1092364c24..62391aaa20 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.6 + 1.127.7-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9d7e2490f8..9805cc6de5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.6 + 1.127.7-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.6 + 1.127.7-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8f48c2a625..7a008e8686 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.6 + 1.127.7-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.6 + 1.127.7-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 91d9175f5c..d90ff09e74 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.6 + 1.127.7-SNAPSHOT diff --git a/versions.txt b/versions.txt index fb4db57838..b1741c22b3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.6:1.127.6 \ No newline at end of file +google-cloud-bigquery:1.127.6:1.127.7-SNAPSHOT \ No newline at end of file From efe50ecf78fc1a3abc41f2f5ffa935b3f7406342 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 2 Mar 2021 15:28:10 -0800 Subject: [PATCH 0014/2268] chore: remove docLava v2 doc generation (#1155) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/0d794d04-cd8c-4499-82a0-751efac2bdce/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/21da7d9fa02f6916d9f87cf4072b3547b5c72eb5 --- .kokoro/release/publish_javadoc.cfg | 8 +------- .kokoro/release/publish_javadoc.sh | 19 ------------------- synth.metadata | 4 ++-- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index 31a5528191..eedb45d591 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,12 +7,6 @@ env_vars: { value: "docs-staging" } -# cloud-rad staging -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2-staging" -} - env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/java-bigquery/.kokoro/release/publish_javadoc.sh" @@ -26,4 +20,4 @@ before_action { keyname: "docuploader_service_account" } } -} \ No newline at end of file +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index f0be47d224..0a093ea597 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -56,22 +56,3 @@ python3 -m docuploader create-metadata \ python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET} - -popd - -# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates. - -mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" - -pushd target/devsite/reference - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs to staging bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} diff --git a/synth.metadata b/synth.metadata index f445777bbe..100a226277 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "5ab251eed173bd3554c444c394d088923255b29a" + "sha": "7cb21503b44b2225d52c298d6cc698a1335542fa" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" + "sha": "21da7d9fa02f6916d9f87cf4072b3547b5c72eb5" } } ], From 4dbcc0e362cd65a45cf5b2cfb63ed9db5ad0cac2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Mar 2021 20:36:28 +0100 Subject: [PATCH 0015/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v18.1.0 (#1157) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `18.0.0` -> `18.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/18.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/18.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/18.1.0/compatibility-slim/18.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/18.1.0/confidence-slim/18.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index dd4e001c4a..f90083b710 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,7 +44,7 @@ com.google.cloud libraries-bom - 18.0.0 + 18.1.0 pom import From 894d081d9ba61101cc55b1e4e484d84e20891c4b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 3 Mar 2021 20:38:21 +0100 Subject: [PATCH 0016/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.6 (#1156) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.127.5` -> `1.127.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.6/compatibility-slim/1.127.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.6/confidence-slim/1.127.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v1.127.6`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​11276-httpswwwgithubcomgoogleapisjava-bigquerycomparev11275v11276-2021-03-02) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.127.5...v1.127.6)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5e3519149a..a1993084fb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.5 + 1.127.6 From a53a6857807975c645d339f80a1c84ff3a8d5b9e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Mar 2021 12:16:11 -0800 Subject: [PATCH 0017/2268] chore: regenerate README (#1158) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-03 19:41:47,780 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-03 19:41:48,894 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/e6de9a8c-c364-40ad-a6e5-f62ca0624a37/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index fe59aa2762..d484d39369 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "77790cda6941624eae0d56e1933f445c615193f9" + "sha": "894d081d9ba61101cc55b1e4e484d84e20891c4b" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8c5628b86cfa8386de7b8fc1675e6b528b552d57" + "sha": "2e7bd5cc66a3f0b90ce1c150eb35c89eeb9872d6" } } ] diff --git a/README.md b/README.md index 7717c93e6a..5fc284ec84 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 18.0.0 + 18.1.0 pom import @@ -40,25 +40,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.5 + 1.127.6 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:18.0.0') +implementation platform('com.google.cloud:libraries-bom:18.1.0') compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.5' +compile 'com.google.cloud:google-cloud-bigquery:1.127.6' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.6" ``` ## Authentication From 8ab0a071cb076baaf59069ca4d31e13feb28a2dd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Mar 2021 20:36:21 +0100 Subject: [PATCH 0018/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v19 (#1160) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `18.1.0` -> `19.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.0.0/compatibility-slim/18.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.0.0/confidence-slim/18.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f90083b710..73db6149c6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,7 +44,7 @@ com.google.cloud libraries-bom - 18.1.0 + 19.0.0 pom import From 4e781017adc4f4ce574250baba3e30349aaf5d75 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 4 Mar 2021 11:56:14 -0800 Subject: [PATCH 0019/2268] chore: regenerate README (#1162) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-04 19:39:22,261 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-04 19:39:23,268 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/8951d3c1-8c47-4c29-8339-6334f9eda8b8/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index d484d39369..7d6c25a7c5 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "894d081d9ba61101cc55b1e4e484d84e20891c4b" + "sha": "8ab0a071cb076baaf59069ca4d31e13feb28a2dd" } }, { diff --git a/README.md b/README.md index 5fc284ec84..6dd5b17d58 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 18.1.0 + 19.0.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:18.1.0') +implementation platform('com.google.cloud:libraries-bom:19.0.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From b7b9fc4622f74dab9f985fedfc53e6f46caac90a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 5 Mar 2021 08:55:02 -0800 Subject: [PATCH 0020/2268] chore: copy README to docfx-yml dir (#1163) * chore: copy README to docfx-yml dir - also cleaning up uneccessary dash in destination_prefix * chore: update path Source-Author: Emily Ball Source-Date: Thu Mar 4 11:56:04 2021 -0800 Source-Repo: googleapis/synthtool Source-Sha: d0bdade9a962042dc0f770cf631086f3db59b5b0 Source-Link: https://github.com/googleapis/synthtool/commit/d0bdade9a962042dc0f770cf631086f3db59b5b0 --- .kokoro/release/publish_javadoc11.sh | 5 ++++- synth.metadata | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index 7e59c0f9ca..b519341e0e 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -40,6 +40,9 @@ export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # generate yml mvn clean site -B -q -P docFX +# copy README to docfx-yml dir and rename index.md +cp README.md target/docfx-yml/index.md + pushd target/docfx-yml # create metadata @@ -52,4 +55,4 @@ python3 -m docuploader create-metadata \ python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx- + --destination-prefix docfx diff --git a/synth.metadata b/synth.metadata index 100a226277..f99025f540 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "7cb21503b44b2225d52c298d6cc698a1335542fa" + "sha": "4e781017adc4f4ce574250baba3e30349aaf5d75" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21da7d9fa02f6916d9f87cf4072b3547b5c72eb5" + "sha": "d0bdade9a962042dc0f770cf631086f3db59b5b0" } } ], From 624cefc8e658f5fc47c4a29d1dd71a76c46edfa9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 9 Mar 2021 17:10:16 +0100 Subject: [PATCH 0021/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.21.0 (#1159) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a1993084fb..b2d654a80e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.20.1 + 1.21.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d90ff09e74..d0088a7d57 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.20.1 + 1.21.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 73db6149c6..463f18e331 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigtable - 1.20.1 + 1.21.0 test From 58e2ddf2250d135a8e16afc98bbed9bb62ba38cf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 9 Mar 2021 21:42:27 +0100 Subject: [PATCH 0022/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 (#1166) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `0.20.0` -> `0.20.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.1/compatibility-slim/0.20.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.20.1/confidence-slim/0.20.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v0.20.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​0201-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0200v0201-2021-03-09) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.20.0...v0.20.1)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a008e8686..a96d5160be 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210219-1.31.0 - 0.20.0 + 0.20.1
From 34c684397cf4ddb1fb2e7b7cac68ef5c12dc8b92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Mar 2021 19:08:03 +0100 Subject: [PATCH 0023/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.13 (#1164) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `1.113.12` -> `1.113.13` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.13/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.13/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.13/compatibility-slim/1.113.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.13/confidence-slim/1.113.12)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v1.113.13`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​111313-httpswwwgithubcomgoogleapisjava-storagecomparev111312v111313-2021-03-08) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v1.113.12...v1.113.13)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a96d5160be..4c091a037f 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.12 + 1.113.13 test From b7857788302e176b646ea21b3c55d1bcc01a08c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 10 Mar 2021 18:24:03 +0000 Subject: [PATCH 0024/2268] chore: release 1.127.7 (#1165) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.7](https://www.github.com/googleapis/java-bigquery/compare/v1.127.6...v1.127.7) (2021-03-10) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.21.0 ([#1159](https://www.github.com/googleapis/java-bigquery/issues/1159)) ([624cefc](https://www.github.com/googleapis/java-bigquery/commit/624cefc8e658f5fc47c4a29d1dd71a76c46edfa9)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#1166](https://www.github.com/googleapis/java-bigquery/issues/1166)) ([58e2ddf](https://www.github.com/googleapis/java-bigquery/commit/58e2ddf2250d135a8e16afc98bbed9bb62ba38cf)) * update dependency com.google.cloud:google-cloud-storage to v1.113.13 ([#1164](https://www.github.com/googleapis/java-bigquery/issues/1164)) ([34c6843](https://www.github.com/googleapis/java-bigquery/commit/34c684397cf4ddb1fb2e7b7cac68ef5c12dc8b92)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bcb97384f..fbf83919ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### [1.127.7](https://www.github.com/googleapis/java-bigquery/compare/v1.127.6...v1.127.7) (2021-03-10) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.21.0 ([#1159](https://www.github.com/googleapis/java-bigquery/issues/1159)) ([624cefc](https://www.github.com/googleapis/java-bigquery/commit/624cefc8e658f5fc47c4a29d1dd71a76c46edfa9)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#1166](https://www.github.com/googleapis/java-bigquery/issues/1166)) ([58e2ddf](https://www.github.com/googleapis/java-bigquery/commit/58e2ddf2250d135a8e16afc98bbed9bb62ba38cf)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.13 ([#1164](https://www.github.com/googleapis/java-bigquery/issues/1164)) ([34c6843](https://www.github.com/googleapis/java-bigquery/commit/34c684397cf4ddb1fb2e7b7cac68ef5c12dc8b92)) + ### [1.127.6](https://www.github.com/googleapis/java-bigquery/compare/v1.127.5...v1.127.6) (2021-03-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 62391aaa20..bc40d62d51 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.7-SNAPSHOT + 1.127.7 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9805cc6de5..d02d96828f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.7-SNAPSHOT + 1.127.7 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.7-SNAPSHOT + 1.127.7 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4c091a037f..2ed68da5f7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.7-SNAPSHOT + 1.127.7 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.7-SNAPSHOT + 1.127.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d0088a7d57..c5a49f8ca1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.7-SNAPSHOT + 1.127.7 diff --git a/versions.txt b/versions.txt index b1741c22b3..686acae516 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.6:1.127.7-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.7:1.127.7 \ No newline at end of file From 4ffc66836bab9b3a3fd88222bec778e6bcec81cd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Mar 2021 20:52:50 +0100 Subject: [PATCH 0025/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.12 (#1169) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b2d654a80e..37a889745e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.11 + 1.0.12 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c5a49f8ca1..e79ad95511 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.11 + 1.0.12 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 463f18e331..5c750b4810 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -82,7 +82,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.11 + 1.0.12 test From e4d801d92a9dacaeddfc16211b0b762ab36f49cc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Mar 2021 20:53:00 +0100 Subject: [PATCH 0026/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.7 (#1168) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 37a889745e..cbe067f5db 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.6 + 1.127.7 From 1ba4890539059c944c3b49d21faa7c7c829979c2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 10 Mar 2021 20:04:04 +0000 Subject: [PATCH 0027/2268] chore: release 1.127.8-SNAPSHOT (#1167) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bc40d62d51..0f2888dc6d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.7 + 1.127.8-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d02d96828f..24d84212b2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.7 + 1.127.8-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.7 + 1.127.8-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2ed68da5f7..3152324b1c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.7 + 1.127.8-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.7 + 1.127.8-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e79ad95511..00192fe4e1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.7 + 1.127.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index 686acae516..e0654cae10 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.7:1.127.7 \ No newline at end of file +google-cloud-bigquery:1.127.7:1.127.8-SNAPSHOT \ No newline at end of file From 9f2a4f1904a43910ec8a7286a58ad260da749111 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 10 Mar 2021 12:06:03 -0800 Subject: [PATCH 0028/2268] chore: regenerate README (#1170) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-10 19:55:03,219 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-10 19:55:04,290 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/6c58ff73-302c-40ad-ac50-aa278b23f3d9/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 7d6c25a7c5..b2e0927680 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "8ab0a071cb076baaf59069ca4d31e13feb28a2dd" + "sha": "e4d801d92a9dacaeddfc16211b0b762ab36f49cc" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "2e7bd5cc66a3f0b90ce1c150eb35c89eeb9872d6" + "sha": "0b064d767537e0675fc053e53fca473c5c701fb8" } } ] diff --git a/README.md b/README.md index 6dd5b17d58..fc623c9ee4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.6 + 1.127.7 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.6' +compile 'com.google.cloud:google-cloud-bigquery:1.127.7' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.6" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.7" ``` ## Authentication From 7e521a83b5613060aaa15e78506b4ac46ba477c9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 10 Mar 2021 16:10:35 -0800 Subject: [PATCH 0029/2268] build(java): update autorelease title check in response to the new multi release branch changes (#1172) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/bb67d652-85f5-42a7-8b9c-b92117ee6252/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/0b064d767537e0675fc053e53fca473c5c701fb8 --- .github/workflows/auto-release.yaml | 4 ++-- synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 7c8816a7d7..9b4fd4d834 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -16,8 +16,8 @@ jobs: return; } - // only approve PRs like "chore(master): release " - if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { return; } diff --git a/synth.metadata b/synth.metadata index f99025f540..d8a19c075e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "4e781017adc4f4ce574250baba3e30349aaf5d75" + "sha": "9f2a4f1904a43910ec8a7286a58ad260da749111" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d0bdade9a962042dc0f770cf631086f3db59b5b0" + "sha": "0b064d767537e0675fc053e53fca473c5c701fb8" } } ], From ba27951225418b49635607a7e9a913f6b2328575 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Mar 2021 18:31:56 +0100 Subject: [PATCH 0030/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210303-1.31.0 (#1171) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3152324b1c..32911e0ff6 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210219-1.31.0 + v2-rev20210303-1.31.0 0.20.1
From 0c05faa2bbf34595b78a45f564960baf006536ac Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 11 Mar 2021 17:48:03 +0000 Subject: [PATCH 0031/2268] chore: release 1.127.8 (#1173) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.8](https://www.github.com/googleapis/java-bigquery/compare/v1.127.7...v1.127.8) (2021-03-11) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210303-1.31.0 ([#1171](https://www.github.com/googleapis/java-bigquery/issues/1171)) ([ba27951](https://www.github.com/googleapis/java-bigquery/commit/ba27951225418b49635607a7e9a913f6b2328575)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbf83919ae..055bfe8a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.127.8](https://www.github.com/googleapis/java-bigquery/compare/v1.127.7...v1.127.8) (2021-03-11) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210303-1.31.0 ([#1171](https://www.github.com/googleapis/java-bigquery/issues/1171)) ([ba27951](https://www.github.com/googleapis/java-bigquery/commit/ba27951225418b49635607a7e9a913f6b2328575)) + ### [1.127.7](https://www.github.com/googleapis/java-bigquery/compare/v1.127.6...v1.127.7) (2021-03-10) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0f2888dc6d..d1bdf62462 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.8-SNAPSHOT + 1.127.8 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 24d84212b2..3e29a65466 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.8-SNAPSHOT + 1.127.8 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.8-SNAPSHOT + 1.127.8 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 32911e0ff6..14ad5d179a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.8-SNAPSHOT + 1.127.8 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8-SNAPSHOT + 1.127.8 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 00192fe4e1..62aeb46a55 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8-SNAPSHOT + 1.127.8 diff --git a/versions.txt b/versions.txt index e0654cae10..81e82cadbd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.7:1.127.8-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.8:1.127.8 \ No newline at end of file From 0e33a56bae86c1b2295f5dc540170fd51e2d089d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 11 Mar 2021 18:00:06 +0000 Subject: [PATCH 0032/2268] chore: release 1.127.9-SNAPSHOT (#1174) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d1bdf62462..69ff1dcc3d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.8 + 1.127.9-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3e29a65466..886d6efa2f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.8 + 1.127.9-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 14ad5d179a..1aafb3915f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.8 + 1.127.9-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 62aeb46a55..e8133a9a7c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9-SNAPSHOT diff --git a/versions.txt b/versions.txt index 81e82cadbd..b2e7d4210d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.8:1.127.8 \ No newline at end of file +google-cloud-bigquery:1.127.8:1.127.9-SNAPSHOT \ No newline at end of file From 6cbbb4824fa64da23a9a60413f1407e563f3276f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Mar 2021 17:55:37 +0100 Subject: [PATCH 0033/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.8 (#1175) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cbe067f5db..40d93e4dcd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.7 + 1.127.8 From c84fc5c5f7f9b5d30e0dae921542a53cb20b8f37 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Mar 2021 17:56:24 +0100 Subject: [PATCH 0034/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.14 (#1176) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1aafb3915f..436e3bd0cc 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.13 + 1.113.14 test From ba0cfc2cf76d9fa16c2b75870338414d38e1722b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Mar 2021 10:16:03 -0700 Subject: [PATCH 0035/2268] chore: regenerate README (#1179) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-15 17:02:27,799 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-15 17:02:28,809 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/8f394944-784f-42eb-af28-9c325481c0d5/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b2e0927680..184ce3ef3b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "e4d801d92a9dacaeddfc16211b0b762ab36f49cc" + "sha": "c84fc5c5f7f9b5d30e0dae921542a53cb20b8f37" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0b064d767537e0675fc053e53fca473c5c701fb8" + "sha": "2c54c473779ea731128cea61a3a6c975a08a5378" } } ] diff --git a/README.md b/README.md index fc623c9ee4..5a77761c80 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.7 + 1.127.8 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.7' +compile 'com.google.cloud:google-cloud-bigquery:1.127.8' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.7" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.8" ``` ## Authentication From 3a8c51c70755932c478d6a39a736bd84270dfaf9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Mar 2021 17:25:07 +0100 Subject: [PATCH 0036/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.13 (#1180) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 40d93e4dcd..8e8aed3fd2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.12 + 1.0.13 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e8133a9a7c..9e74516837 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.12 + 1.0.13 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5c750b4810..3ffdd42f5f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -82,7 +82,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.12 + 1.0.13 test From fbbf96aecd3b49adb1d180652eff02a562449cce Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Mar 2021 21:28:39 +0100 Subject: [PATCH 0037/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.21.1 (#1181) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8e8aed3fd2..3a1c5a49e6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.21.0 + 1.21.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9e74516837..2f9b268c95 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.21.0 + 1.21.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3ffdd42f5f..ed9f7960da 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigtable - 1.21.0 + 1.21.1 test From 4c1a2453648312809d6ba415f7a8df76e2e93cbb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 17 Mar 2021 19:30:33 +0100 Subject: [PATCH 0038/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v19.1.0 (#1182) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ed9f7960da..f8164586ec 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,7 +44,7 @@ com.google.cloud libraries-bom - 19.0.0 + 19.1.0 pom import From ba9fb0585e0a83cc3e93b8f3c5577de36b29547c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Mar 2021 18:56:04 +0000 Subject: [PATCH 0039/2268] chore: release 1.127.9 (#1178) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.9](https://www.github.com/googleapis/java-bigquery/compare/v1.127.8...v1.127.9) (2021-03-17) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.21.1 ([#1181](https://www.github.com/googleapis/java-bigquery/issues/1181)) ([fbbf96a](https://www.github.com/googleapis/java-bigquery/commit/fbbf96aecd3b49adb1d180652eff02a562449cce)) * update dependency com.google.cloud:google-cloud-storage to v1.113.14 ([#1176](https://www.github.com/googleapis/java-bigquery/issues/1176)) ([c84fc5c](https://www.github.com/googleapis/java-bigquery/commit/c84fc5c5f7f9b5d30e0dae921542a53cb20b8f37)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 055bfe8a3c..c88a3d28a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.127.9](https://www.github.com/googleapis/java-bigquery/compare/v1.127.8...v1.127.9) (2021-03-17) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.21.1 ([#1181](https://www.github.com/googleapis/java-bigquery/issues/1181)) ([fbbf96a](https://www.github.com/googleapis/java-bigquery/commit/fbbf96aecd3b49adb1d180652eff02a562449cce)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.14 ([#1176](https://www.github.com/googleapis/java-bigquery/issues/1176)) ([c84fc5c](https://www.github.com/googleapis/java-bigquery/commit/c84fc5c5f7f9b5d30e0dae921542a53cb20b8f37)) + ### [1.127.8](https://www.github.com/googleapis/java-bigquery/compare/v1.127.7...v1.127.8) (2021-03-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 69ff1dcc3d..c1a54ebacf 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.9-SNAPSHOT + 1.127.9 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 886d6efa2f..84fb5f7903 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.9-SNAPSHOT + 1.127.9 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.9-SNAPSHOT + 1.127.9 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 436e3bd0cc..a591535acb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.9-SNAPSHOT + 1.127.9 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9-SNAPSHOT + 1.127.9 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2f9b268c95..d013e70297 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9-SNAPSHOT + 1.127.9 diff --git a/versions.txt b/versions.txt index b2e7d4210d..78721fc258 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.8:1.127.9-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.9:1.127.9 \ No newline at end of file From ee8e457d7cb20d164ff369cea689169475a42762 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 17 Mar 2021 12:02:05 -0700 Subject: [PATCH 0040/2268] chore: regenerate README (#1183) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-17 18:32:50,121 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-17 18:32:51,357 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/0517871e-17df-4609-bea4-116c5a324c0e/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 184ce3ef3b..5d6fa67ca2 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "c84fc5c5f7f9b5d30e0dae921542a53cb20b8f37" + "sha": "4c1a2453648312809d6ba415f7a8df76e2e93cbb" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "2c54c473779ea731128cea61a3a6c975a08a5378" + "sha": "78437c732a60c64895778697b078497b0988346c" } } ] diff --git a/README.md b/README.md index 5a77761c80..52036cd623 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 19.0.0 + 19.1.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.0.0') +implementation platform('com.google.cloud:libraries-bom:19.1.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From 866b2da1ab57d5a6ccf1581890ff5102f288ad78 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Mar 2021 19:32:04 +0000 Subject: [PATCH 0041/2268] chore: release 1.127.10-SNAPSHOT (#1184) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c1a54ebacf..1dcdd89495 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.9 + 1.127.10-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 84fb5f7903..00e95c6a79 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.9 + 1.127.10-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a591535acb..974ee9d60c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.9 + 1.127.10-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d013e70297..3950912dba 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10-SNAPSHOT diff --git a/versions.txt b/versions.txt index 78721fc258..c94a22c69c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.9:1.127.9 \ No newline at end of file +google-cloud-bigquery:1.127.9:1.127.10-SNAPSHOT \ No newline at end of file From bba71f2f475f6dd8bf2a9d567aaed26377543abe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:34:36 +0100 Subject: [PATCH 0042/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210313-1.31.0 (#1187) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 974ee9d60c..89bbf85f03 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210303-1.31.0 + v2-rev20210313-1.31.0 0.20.1 From 93402b903bb20bf436359fe3a6e034536bf812ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:35:27 +0100 Subject: [PATCH 0043/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v19.2.0 (#1186) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f8164586ec..8fb4dfb36a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,7 +44,7 @@ com.google.cloud libraries-bom - 19.1.0 + 19.2.0 pom import From dbdad37d11dbcad998a35133b6e36321486023fb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Mar 2021 23:36:08 +0100 Subject: [PATCH 0044/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.9 (#1185) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a1c5a49e6..634c3e9d7e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9 From fda8a73e96d0afd2f2c2ab6d7fd6cd6d69808211 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Mar 2021 15:48:03 -0700 Subject: [PATCH 0045/2268] chore: regenerate README (#1189) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-18 22:36:46,865 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-18 22:36:47,837 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/94e54c49-9325-4c8d-b511-a3a6d7332e3b/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 5d6fa67ca2..b620776ce8 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "4c1a2453648312809d6ba415f7a8df76e2e93cbb" + "sha": "dbdad37d11dbcad998a35133b6e36321486023fb" } }, { diff --git a/README.md b/README.md index 52036cd623..74fc6e20d7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 19.1.0 + 19.2.0 pom import @@ -40,25 +40,25 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.8 + 1.127.9 ``` If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.1.0') +implementation platform('com.google.cloud:libraries-bom:19.2.0') compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.8' +compile 'com.google.cloud:google-cloud-bigquery:1.127.9' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.8" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.9" ``` ## Authentication From 1648d5c1f30d0050f4103afcba9373e67efd347e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 19 Mar 2021 19:04:02 +0100 Subject: [PATCH 0046/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v19.2.1 (#1190) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `19.2.0` -> `19.2.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/compatibility-slim/19.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/19.2.1/confidence-slim/19.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8fb4dfb36a..12d7c35d6c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -44,7 +44,7 @@ com.google.cloud libraries-bom - 19.2.0 + 19.2.1 pom import From 4d387569eda20dce13f858e98c399a28fa85a770 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 18:42:03 +0000 Subject: [PATCH 0047/2268] chore: release 1.127.10 (#1188) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.10](https://www.github.com/googleapis/java-bigquery/compare/v1.127.9...v1.127.10) (2021-03-19) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210313-1.31.0 ([#1187](https://www.github.com/googleapis/java-bigquery/issues/1187)) ([bba71f2](https://www.github.com/googleapis/java-bigquery/commit/bba71f2f475f6dd8bf2a9d567aaed26377543abe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88a3d28a3..26cd1622d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.127.10](https://www.github.com/googleapis/java-bigquery/compare/v1.127.9...v1.127.10) (2021-03-19) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210313-1.31.0 ([#1187](https://www.github.com/googleapis/java-bigquery/issues/1187)) ([bba71f2](https://www.github.com/googleapis/java-bigquery/commit/bba71f2f475f6dd8bf2a9d567aaed26377543abe)) + ### [1.127.9](https://www.github.com/googleapis/java-bigquery/compare/v1.127.8...v1.127.9) (2021-03-17) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1dcdd89495..858666323e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.10-SNAPSHOT + 1.127.10 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 00e95c6a79..a604e903e6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.10-SNAPSHOT + 1.127.10 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.10-SNAPSHOT + 1.127.10 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 89bbf85f03..af14a47858 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.10-SNAPSHOT + 1.127.10 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10-SNAPSHOT + 1.127.10 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3950912dba..cd29682df4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10-SNAPSHOT + 1.127.10 diff --git a/versions.txt b/versions.txt index c94a22c69c..ac0078a6cb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.9:1.127.10-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.10:1.127.10 \ No newline at end of file From 9b5de7c8bff82312186c86017f879f2f82fe1d9c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 19 Mar 2021 12:00:07 -0700 Subject: [PATCH 0048/2268] chore: regenerate README (#1191) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-19 18:06:15,376 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-19 18:06:16,403 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/ffcd156c-4bb2-450b-8388-713ec5ba2593/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b620776ce8..5ebc107bcb 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "dbdad37d11dbcad998a35133b6e36321486023fb" + "sha": "1648d5c1f30d0050f4103afcba9373e67efd347e" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "78437c732a60c64895778697b078497b0988346c" + "sha": "8b13da943497f75c5303700bff5aabdd85d939e0" } } ] diff --git a/README.md b/README.md index 74fc6e20d7..b2e5f957b5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 19.2.0 + 19.2.1 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.2.0') +implementation platform('com.google.cloud:libraries-bom:19.2.1') compile 'com.google.cloud:google-cloud-bigquery' ``` From 6a57dd65a8ca51bf4e1a62fe3df7e67abd014b6b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 19:20:06 +0000 Subject: [PATCH 0049/2268] chore: release 1.127.11-SNAPSHOT (#1192) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 858666323e..9d228bde72 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.10 + 1.127.11-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a604e903e6..8eb48b6f13 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.11-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.10 + 1.127.11-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index af14a47858..7343688d76 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.10 + 1.127.11-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.11-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cd29682df4..1307bb9c51 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.11-SNAPSHOT diff --git a/versions.txt b/versions.txt index ac0078a6cb..24db48ddad 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.10:1.127.10 \ No newline at end of file +google-cloud-bigquery:1.127.10:1.127.11-SNAPSHOT \ No newline at end of file From 9cc06838e2eaca5aa6c2a525aa42b8efde31e492 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 22 Mar 2021 16:14:49 +0100 Subject: [PATCH 0050/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.10 (#1193) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 634c3e9d7e..887468ae9e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10 From 87572409767a6d69c1791d4c80a8d948b67c5997 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 22 Mar 2021 08:36:04 -0700 Subject: [PATCH 0051/2268] chore: regenerate README (#1194) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-22 15:17:17,485 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-22 15:17:18,453 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/262011c9-5600-47e4-9c80-83faf6a58c89/targets - [ ] To automatically regenerate this PR, check this box. --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 5ebc107bcb..c704d05ca0 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "1648d5c1f30d0050f4103afcba9373e67efd347e" + "sha": "9cc06838e2eaca5aa6c2a525aa42b8efde31e492" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8b13da943497f75c5303700bff5aabdd85d939e0" + "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" } } ] diff --git a/README.md b/README.md index b2e5f957b5..26ab15b508 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.9 + 1.127.10 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.9' +compile 'com.google.cloud:google-cloud-bigquery:1.127.10' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.9" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.10" ``` ## Authentication From 9b9d3787c99bc6ca57da557e558cf215ce94e820 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 24 Mar 2021 16:08:06 -0700 Subject: [PATCH 0052/2268] chore(java): detect sample-secrets in build.sh (#1198) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/da4ff212-b599-4184-9bb9-741b5a34fe24/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef --- .kokoro/build.sh | 5 +++++ synth.metadata | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 6569c9dd62..8c8119e6a5 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -79,6 +79,11 @@ samples) if [[ -f ${SAMPLES_DIR}/pom.xml ]] then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + pushd ${SAMPLES_DIR} mvn -B \ -Penable-samples \ diff --git a/synth.metadata b/synth.metadata index d8a19c075e..619cd386d5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9f2a4f1904a43910ec8a7286a58ad260da749111" + "sha": "87572409767a6d69c1791d4c80a8d948b67c5997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0b064d767537e0675fc053e53fca473c5c701fb8" + "sha": "bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef" } } ], From a62ee9f769f31f83290835bdb132d93495f63401 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 25 Mar 2021 13:02:42 -0400 Subject: [PATCH 0053/2268] chore(ci): xml namespace declaration in samples/snippets/pom.xml (#1199) * xml namespace declaration in samples/snippets/pom.xml * format --- samples/snippets/pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 12d7c35d6c..4dc2bda986 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -1,3 +1,4 @@ + - + 4.0.0 com.example.bigquery bigquery-google-cloud-samples From 8e3618ec69009712c2616a52efdca4eb0dfbc5d8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Mar 2021 18:03:37 +0100 Subject: [PATCH 0054/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.21.2 (#1195) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 887468ae9e..71610d6165 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.21.1 + 1.21.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1307bb9c51..fe0c0ad8eb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.21.1 + 1.21.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4dc2bda986..ab017157e6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.21.1 + 1.21.2 test From ae00627d1e2812722ebcb1764832b47d9910d204 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:16:03 +0000 Subject: [PATCH 0055/2268] chore: release 1.127.11 (#1201) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.11](https://www.github.com/googleapis/java-bigquery/compare/v1.127.10...v1.127.11) (2021-03-25) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.21.2 ([#1195](https://www.github.com/googleapis/java-bigquery/issues/1195)) ([8e3618e](https://www.github.com/googleapis/java-bigquery/commit/8e3618ec69009712c2616a52efdca4eb0dfbc5d8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26cd1622d3..0b13f594c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.127.11](https://www.github.com/googleapis/java-bigquery/compare/v1.127.10...v1.127.11) (2021-03-25) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.21.2 ([#1195](https://www.github.com/googleapis/java-bigquery/issues/1195)) ([8e3618e](https://www.github.com/googleapis/java-bigquery/commit/8e3618ec69009712c2616a52efdca4eb0dfbc5d8)) + ### [1.127.10](https://www.github.com/googleapis/java-bigquery/compare/v1.127.9...v1.127.10) (2021-03-19) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9d228bde72..e1073ef01b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.11-SNAPSHOT + 1.127.11 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8eb48b6f13..db8b2f163e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.11-SNAPSHOT + 1.127.11 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.11-SNAPSHOT + 1.127.11 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7343688d76..bc1b9265a6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.11-SNAPSHOT + 1.127.11 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.11-SNAPSHOT + 1.127.11 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fe0c0ad8eb..666915ced6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.11-SNAPSHOT + 1.127.11 diff --git a/versions.txt b/versions.txt index 24db48ddad..9686e8e5eb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.10:1.127.11-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.11:1.127.11 \ No newline at end of file From 1aab5d13ebd0908ab733a7e773b5db4276a9074c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 17:34:02 +0000 Subject: [PATCH 0056/2268] chore: release 1.127.12-SNAPSHOT (#1202) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e1073ef01b..3e9669ea22 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.11 + 1.127.12-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index db8b2f163e..902ec2067e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.11 + 1.127.12-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.11 + 1.127.12-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bc1b9265a6..e3132ded0b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.11 + 1.127.12-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.11 + 1.127.12-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 666915ced6..046c935916 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.11 + 1.127.12-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9686e8e5eb..a268632ac2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.11:1.127.11 \ No newline at end of file +google-cloud-bigquery:1.127.11:1.127.12-SNAPSHOT \ No newline at end of file From 4135e4f1a11eb55139fab1008edad803064aefb7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 25 Mar 2021 11:04:02 -0700 Subject: [PATCH 0057/2268] chore: regenerate README (#1203) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-25 17:53:22,220 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-25 17:53:23,506 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/befec425-5b6d-4019-9f51-6f30166a31a7/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index c704d05ca0..ec21e5abf9 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9cc06838e2eaca5aa6c2a525aa42b8efde31e492" + "sha": "1aab5d13ebd0908ab733a7e773b5db4276a9074c" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef" } } ] diff --git a/README.md b/README.md index 26ab15b508..88c749786c 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.10' +compile 'com.google.cloud:google-cloud-bigquery:1.127.11' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.10" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.11" ``` ## Authentication From 32cdb8e0180de13adbc78743ed9e6ac50b254223 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 29 Mar 2021 17:54:04 +0200 Subject: [PATCH 0058/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.11 (#1204) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.127.10` -> `1.127.11` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.11/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.11/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.11/compatibility-slim/1.127.10)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.127.11/confidence-slim/1.127.10)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v1.127.11`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​112711-httpswwwgithubcomgoogleapisjava-bigquerycomparev112710v112711-2021-03-25) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.127.10...v1.127.11)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 71610d6165..b48722d93e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.11 From b69258136bba3481030596107185b846d7a5c0a7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 29 Mar 2021 09:10:04 -0700 Subject: [PATCH 0059/2268] chore: regenerate README (#1205) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-03-29 15:56:23,316 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-03-29 15:56:24,942 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/6cfceb5b-1e08-48d7-8f6e-7f67bcf646b5/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index ec21e5abf9..4fdac01e4f 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "1aab5d13ebd0908ab733a7e773b5db4276a9074c" + "sha": "32cdb8e0180de13adbc78743ed9e6ac50b254223" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef" + "sha": "60fc32cc950c20cfdd774b846a4a7dc5d1e4d0ef" } } ] diff --git a/README.md b/README.md index 88c749786c..374ca44d07 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.10 + 1.127.11 ``` From 2918a5beb5f74bb5fbbfc5b22c24bbad322fd76c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 30 Mar 2021 07:54:16 -0700 Subject: [PATCH 0060/2268] chore: remove staging bucket v2 (#1206) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/05354245-d810-47bd-87b4-aab9376595ae/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/572ef8f70edd9041f5bcfa71511aed6aecfc2098 --- .kokoro/release/publish_javadoc.sh | 5 ----- synth.metadata | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 0a093ea597..ab106db966 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -24,11 +24,6 @@ if [[ -z "${STAGING_BUCKET}" ]]; then exit 1 fi -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - # work from the git root directory pushd $(dirname "$0")/../../ diff --git a/synth.metadata b/synth.metadata index 619cd386d5..11e1664b6a 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "87572409767a6d69c1791d4c80a8d948b67c5997" + "sha": "b69258136bba3481030596107185b846d7a5c0a7" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bb854b6c048619e3be4e8b8ce8ed10aa74ea78ef" + "sha": "572ef8f70edd9041f5bcfa71511aed6aecfc2098" } } ], From 9b4f3ecc248fd6fac2b9542b14d6f343bcb8463c Mon Sep 17 00:00:00 2001 From: ShyamShah11 <33843392+ShyamShah11@users.noreply.github.com> Date: Wed, 31 Mar 2021 18:10:02 -0400 Subject: [PATCH 0061/2268] docs(samples): update querypagination sample (#1209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on feedback from a support case, I've made some changes to make this more clear and more accurate to what the comments indicate Created #1207 to track this Fixes #1207 ☕️ --- .../java/com/example/bigquery/QueryPagination.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java index 190c9bcdef..dc9a6a24f1 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java @@ -59,15 +59,23 @@ public static void queryPagination(String datasetName, String tableName, String // First Page results - .iterateAll() - .forEach(row -> row.forEach(val -> System.out.printf("%s,", val.toString()))); + .getValues() + .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); if (results.hasNextPage()) { // Next Page + results + .getNextPage() + .getValues() + .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); + } + + if (results.hasNextPage()) { + // Remaining Pages results .getNextPage() .iterateAll() - .forEach(row -> row.forEach(val -> System.out.printf("%s,", val.toString()))); + .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); } System.out.println("Query pagination performed successfully."); From bf5d444103f5e6dc3db1751a9e3fd382cf42cb5d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 5 Apr 2021 19:13:09 +0200 Subject: [PATCH 0062/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210327-1.31.0 (#1214) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3132ded0b..7b8ad8fa50 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210313-1.31.0 + v2-rev20210327-1.31.0 0.20.1
From 6b85ab3daddeb490ccb2877a0ce22d1e1c403a07 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 5 Apr 2021 19:24:02 +0200 Subject: [PATCH 0063/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.21.3 (#1211) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.21.2` -> `1.21.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.21.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.21.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.21.3/compatibility-slim/1.21.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.21.3/confidence-slim/1.21.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.21.3`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1213-httpswwwgithubcomgoogleapisjava-bigtablecomparev1212v1213-2021-04-01) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.21.2...v1.21.3)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b48722d93e..a89eeb93d3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.21.2 + 1.21.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 046c935916..6adbcf9215 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.21.2 + 1.21.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ab017157e6..31fd25473f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.21.2 + 1.21.3 test From ada9d828442d00433ea615bc3aeed6c2db71035b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Apr 2021 17:17:42 +0200 Subject: [PATCH 0064/2268] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.22 (#1216) --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a89eeb93d3..a2e8c31612 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.0.22 diff --git a/samples/pom.xml b/samples/pom.xml index b2e32cf3fd..835a13ac22 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -34,7 +34,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.0.22 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6adbcf9215..9972ba9c30 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.0.22 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 31fd25473f..f33097f33a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.0.22 From 503d32bdaede96207203d79eebbf6964a199b8f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 7 Apr 2021 19:44:03 +0200 Subject: [PATCH 0065/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.22.0 (#1217) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.21.3` -> `1.22.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.22.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.22.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.22.0/compatibility-slim/1.21.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.22.0/confidence-slim/1.21.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.22.0`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1220-httpswwwgithubcomgoogleapisjava-bigtablecomparev1213v1220-2021-04-06) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.21.3...v1.22.0) ##### Features - add CMEK Support ([#​656](https://www.github.com/googleapis/java-bigtable/issues/656)) ([2821902](https://www.github.com/googleapis/java-bigtable/commit/2821902b34ae04596771a9fc5e2b62d5c24a7253)) ##### Dependencies - update autovalue.version to v1.8 ([#​703](https://www.github.com/googleapis/java-bigtable/issues/703)) ([13e7796](https://www.github.com/googleapis/java-bigtable/commit/13e7796d96222fe0181771d160d12a3da7f0a7a7)) - update dependency com.google.truth.extensions:truth-proto-extension to v1.1.2 ([#​704](https://www.github.com/googleapis/java-bigtable/issues/704)) ([3fa8b00](https://www.github.com/googleapis/java-bigtable/commit/3fa8b0069d58a5705f11fac481ddcd4ad7d447f4)) ##### [1.21.3](https://www.github.com/googleapis/java-bigtable/compare/v1.21.2...v1.21.3) (2021-04-01) ##### Dependencies - update dependency com.google.errorprone:error_prone_annotations to v2.6.0 ([#​693](https://www.github.com/googleapis/java-bigtable/issues/693)) ([831d044](https://www.github.com/googleapis/java-bigtable/commit/831d044f31c7643b34df4f23765d521e8f68035d)) ##### [1.21.2](https://www.github.com/googleapis/java-bigtable/compare/v1.21.1...v1.21.2) (2021-03-22) ##### Dependencies - update autovalue.version to v1.7.5 ([#​684](https://www.github.com/googleapis/java-bigtable/issues/684)) ([75baa79](https://www.github.com/googleapis/java-bigtable/commit/75baa79e94c31e1694c3e29ea2f1ed42dbc60eb8)) ##### [1.21.1](https://www.github.com/googleapis/java-bigtable/compare/v1.21.0...v1.21.1) (2021-03-15) ##### Bug Fixes - **retry:** restore grpc_service_config for CreateBackup and {Restore,Snapshot}Table ([#​667](https://www.github.com/googleapis/java-bigtable/issues/667)) ([121f071](https://www.github.com/googleapis/java-bigtable/commit/121f07159c2715368cb53753ba39d70d1d25efb8)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#​671](https://www.github.com/googleapis/java-bigtable/issues/671)) ([6ba3bf3](https://www.github.com/googleapis/java-bigtable/commit/6ba3bf3a642bd5b7ecf2a86a821ede0f2bae084f))
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a2e8c31612..8cf73a3119 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.21.3 + 1.22.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9972ba9c30..ad51e83161 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.21.3 + 1.22.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f33097f33a..2331da6d73 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.21.3 + 1.22.0 test From 2aae90b431fc20c8e57e9bf0a56fe03471ef8574 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 15:38:05 +0000 Subject: [PATCH 0066/2268] chore: release 1.127.12 (#1210) :robot: I have created a release \*beep\* \*boop\* --- ### [1.127.12](https://www.github.com/googleapis/java-bigquery/compare/v1.127.11...v1.127.12) (2021-04-07) ### Documentation * **samples:** update querypagination sample ([#1209](https://www.github.com/googleapis/java-bigquery/issues/1209)) ([9b4f3ec](https://www.github.com/googleapis/java-bigquery/commit/9b4f3ecc248fd6fac2b9542b14d6f343bcb8463c)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210327-1.31.0 ([#1214](https://www.github.com/googleapis/java-bigquery/issues/1214)) ([bf5d444](https://www.github.com/googleapis/java-bigquery/commit/bf5d444103f5e6dc3db1751a9e3fd382cf42cb5d)) * update dependency com.google.cloud:google-cloud-bigtable to v1.21.3 ([#1211](https://www.github.com/googleapis/java-bigquery/issues/1211)) ([6b85ab3](https://www.github.com/googleapis/java-bigquery/commit/6b85ab3daddeb490ccb2877a0ce22d1e1c403a07)) * update dependency com.google.cloud:google-cloud-bigtable to v1.22.0 ([#1217](https://www.github.com/googleapis/java-bigquery/issues/1217)) ([503d32b](https://www.github.com/googleapis/java-bigquery/commit/503d32bdaede96207203d79eebbf6964a199b8f8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 14 ++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b13f594c5..ae6a358677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +### [1.127.12](https://www.github.com/googleapis/java-bigquery/compare/v1.127.11...v1.127.12) (2021-04-07) + + +### Documentation + +* **samples:** update querypagination sample ([#1209](https://www.github.com/googleapis/java-bigquery/issues/1209)) ([9b4f3ec](https://www.github.com/googleapis/java-bigquery/commit/9b4f3ecc248fd6fac2b9542b14d6f343bcb8463c)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210327-1.31.0 ([#1214](https://www.github.com/googleapis/java-bigquery/issues/1214)) ([bf5d444](https://www.github.com/googleapis/java-bigquery/commit/bf5d444103f5e6dc3db1751a9e3fd382cf42cb5d)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.21.3 ([#1211](https://www.github.com/googleapis/java-bigquery/issues/1211)) ([6b85ab3](https://www.github.com/googleapis/java-bigquery/commit/6b85ab3daddeb490ccb2877a0ce22d1e1c403a07)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.22.0 ([#1217](https://www.github.com/googleapis/java-bigquery/issues/1217)) ([503d32b](https://www.github.com/googleapis/java-bigquery/commit/503d32bdaede96207203d79eebbf6964a199b8f8)) + ### [1.127.11](https://www.github.com/googleapis/java-bigquery/compare/v1.127.10...v1.127.11) (2021-03-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3e9669ea22..6b1b2ea188 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.12-SNAPSHOT + 1.127.12 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 902ec2067e..f7cbe49048 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.12-SNAPSHOT + 1.127.12 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.12-SNAPSHOT + 1.127.12 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7b8ad8fa50..6df52807e9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.12-SNAPSHOT + 1.127.12 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.12-SNAPSHOT + 1.127.12 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ad51e83161..f83ee6b736 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.12-SNAPSHOT + 1.127.12 diff --git a/versions.txt b/versions.txt index a268632ac2..e4b26e425f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.11:1.127.12-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.127.12:1.127.12 \ No newline at end of file From ae8375c9787cd3dd9b39af804c152466a0dabb83 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Apr 2021 23:35:13 +0200 Subject: [PATCH 0067/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.127.12 (#1219) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8cf73a3119..78e4e7ce3b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.11 + 1.127.12 From 8ddddc1bb876ebc77893f5e2b9bc2646274be4d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:46:04 +0000 Subject: [PATCH 0068/2268] chore: release 1.127.13-SNAPSHOT (#1218) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 6b1b2ea188..009cdb466d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.12 + 1.127.13-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f7cbe49048..c29e4973b2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.12 + 1.127.13-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.12 + 1.127.13-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6df52807e9..927ffa5dec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.12 + 1.127.13-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.12 + 1.127.13-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f83ee6b736..777f6ef0ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.12 + 1.127.13-SNAPSHOT diff --git a/versions.txt b/versions.txt index e4b26e425f..b055919db8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.12:1.127.12 \ No newline at end of file +google-cloud-bigquery:1.127.12:1.127.13-SNAPSHOT \ No newline at end of file From aaffd73db9ff8a49a9c4724804653b5266a59765 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Apr 2021 14:48:03 -0700 Subject: [PATCH 0069/2268] chore: regenerate README (#1220) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-08 21:37:40,916 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-08 21:37:42,272 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/a052e6a0-8dba-49f1-92b1-413fe6d757e3/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 4fdac01e4f..6c01fbe888 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "32cdb8e0180de13adbc78743ed9e6ac50b254223" + "sha": "ae8375c9787cd3dd9b39af804c152466a0dabb83" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "60fc32cc950c20cfdd774b846a4a7dc5d1e4d0ef" + "sha": "0f3469e88a4be9af4d9b1c4b6cf6fd3f8ac15588" } } ] diff --git a/README.md b/README.md index 374ca44d07..0e8f4fb5d9 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.11 + 1.127.12 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.11' +compile 'com.google.cloud:google-cloud-bigquery:1.127.12' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.11" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.12" ``` ## Authentication From d5c5747e74d8c2e1ca0901eea0d82fd94460a639 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Apr 2021 22:54:09 +0200 Subject: [PATCH 0070/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 (#1224) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `0.20.1` -> `0.21.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.0/compatibility-slim/0.20.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.0/confidence-slim/0.20.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v0.21.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​0210-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0201v0210-2021-04-09) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.20.1...v0.21.0) ##### Dependencies - update dependency com.google.auth:google-auth-library-bom to v0.25.0 ([#​310](https://www.github.com/googleapis/java-shared-dependencies/issues/310)) ([8f3a0f0](https://www.github.com/googleapis/java-shared-dependencies/commit/8f3a0f002b787f7b27cfe031654fa20bf342f839)) - update dependency com.google.auth:google-auth-library-bom to v0.25.2 ([#​311](https://www.github.com/googleapis/java-shared-dependencies/issues/311)) ([6c47a3e](https://www.github.com/googleapis/java-shared-dependencies/commit/6c47a3edbd9da04ba255487a66c0f3a41393217d)) - update dependency com.google.errorprone:error_prone_annotations to v2.6.0 ([#​315](https://www.github.com/googleapis/java-shared-dependencies/issues/315)) ([dc254ca](https://www.github.com/googleapis/java-shared-dependencies/commit/dc254ca7359b68fe9411f7b96130ffb416b45c6f)) - update dependency com.google.http-client:google-http-client-bom to v1.39.1 ([#​309](https://www.github.com/googleapis/java-shared-dependencies/issues/309)) ([37225e2](https://www.github.com/googleapis/java-shared-dependencies/commit/37225e2d1b32a618765391720b57ff29e7b8f7f9)) - update dependency com.google.http-client:google-http-client-bom to v1.39.2 ([#​321](https://www.github.com/googleapis/java-shared-dependencies/issues/321)) ([273c66d](https://www.github.com/googleapis/java-shared-dependencies/commit/273c66d374f7cd6040aac2f302fd1c1dc0f4a1c0)) - update dependency com.google.protobuf:protobuf-bom to v3.15.6 ([#​308](https://www.github.com/googleapis/java-shared-dependencies/issues/308)) ([b29dd05](https://www.github.com/googleapis/java-shared-dependencies/commit/b29dd0535f02b56607f64ba69e85d4d468902789)) - update dependency com.google.protobuf:protobuf-bom to v3.15.7 ([#​316](https://www.github.com/googleapis/java-shared-dependencies/issues/316)) ([9c00d77](https://www.github.com/googleapis/java-shared-dependencies/commit/9c00d7753c1f7b963deb9ad69dcfe24ba28da5a2)) - update dependency com.google.protobuf:protobuf-bom to v3.15.8 ([#​319](https://www.github.com/googleapis/java-shared-dependencies/issues/319)) ([15e5ae2](https://www.github.com/googleapis/java-shared-dependencies/commit/15e5ae2ef46eedcd790ffd8644677d36db5c63f9)) - update dependency io.grpc:grpc-bom to v1.37.0 ([#​313](https://www.github.com/googleapis/java-shared-dependencies/issues/313)) ([c599351](https://www.github.com/googleapis/java-shared-dependencies/commit/c5993511c7305e1ced42d73552a93a25dc5e1ac1)) - update gax.version to v1.63.0 ([#​318](https://www.github.com/googleapis/java-shared-dependencies/issues/318)) ([ba709da](https://www.github.com/googleapis/java-shared-dependencies/commit/ba709da6fb0e9bcfc83e663588336598737b46e4)) - update google.core.version to v1.94.4 ([#​305](https://www.github.com/googleapis/java-shared-dependencies/issues/305)) ([0d38f4c](https://www.github.com/googleapis/java-shared-dependencies/commit/0d38f4c9ffadcfd9446712b8bf0729399b0c9e91)) - update google.core.version to v1.94.5 ([#​320](https://www.github.com/googleapis/java-shared-dependencies/issues/320)) ([3439721](https://www.github.com/googleapis/java-shared-dependencies/commit/3439721da83a8b92d9c4b6ecfd158cfb1e1a0503)) - update guava to 30.1.1-android ([#​322](https://www.github.com/googleapis/java-shared-dependencies/issues/322)) ([a6b5d3b](https://www.github.com/googleapis/java-shared-dependencies/commit/a6b5d3b8ccfc352bf0d1678952ce3cd8b7a8361e)) - update iam.version to v1.0.11 ([#​304](https://www.github.com/googleapis/java-shared-dependencies/issues/304)) ([95a5264](https://www.github.com/googleapis/java-shared-dependencies/commit/95a526442b3d24c83782523d38dd3931e828d757)) ##### [0.20.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.20.0...v0.20.1) (2021-03-09) ##### Dependencies - update dependency com.fasterxml.jackson:jackson-bom to v2.12.2 ([#​301](https://www.github.com/googleapis/java-shared-dependencies/issues/301)) ([7c01eba](https://www.github.com/googleapis/java-shared-dependencies/commit/7c01ebabb6fd65b7404e56651b0ba27f505bb033)) - update dependency com.google.api-client:google-api-client-bom to v1.31.3 ([#​295](https://www.github.com/googleapis/java-shared-dependencies/issues/295)) ([a0774e9](https://www.github.com/googleapis/java-shared-dependencies/commit/a0774e9d62d00614142bc4c14214a83dda66d4ad)) - update dependency com.google.api.grpc:grpc-google-iam-v1 to v1.0.10 ([#​292](https://www.github.com/googleapis/java-shared-dependencies/issues/292)) ([b629789](https://www.github.com/googleapis/java-shared-dependencies/commit/b629789e3a1cc9a7308b829c034b09b06e24fc07)) - update dependency com.google.auth:google-auth-library-bom to v0.24.1 ([#​293](https://www.github.com/googleapis/java-shared-dependencies/issues/293)) ([d85ec34](https://www.github.com/googleapis/java-shared-dependencies/commit/d85ec347ccdd14dfdab10d365d2c2f8df3035e4d)) - update dependency com.google.protobuf:protobuf-bom to v3.15.3 ([#​294](https://www.github.com/googleapis/java-shared-dependencies/issues/294)) ([58c01aa](https://www.github.com/googleapis/java-shared-dependencies/commit/58c01aa076e2c4954986185f913bac2c51a1e6fb)) - update dependency com.google.protobuf:protobuf-bom to v3.15.5 ([#​302](https://www.github.com/googleapis/java-shared-dependencies/issues/302)) ([e9d5e6e](https://www.github.com/googleapis/java-shared-dependencies/commit/e9d5e6ee6039915da186315ceada673ac37b88d3)) - update google.core.version to v1.94.2 ([#​296](https://www.github.com/googleapis/java-shared-dependencies/issues/296)) ([af83b90](https://www.github.com/googleapis/java-shared-dependencies/commit/af83b901be0c03d507189999215d35345602fad7)) - update google.core.version to v1.94.3 ([#​300](https://www.github.com/googleapis/java-shared-dependencies/issues/300)) ([3e73176](https://www.github.com/googleapis/java-shared-dependencies/commit/3e73176af0b07dfe621163b301174b5b5820dfa2))
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 927ffa5dec..eb01ccc0ff 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210327-1.31.0 - 0.20.1 + 0.21.0
From 0a271cb363180a093385ed6c5c68e12c6fde6502 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Apr 2021 23:13:45 +0200 Subject: [PATCH 0071/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.31.5 (#1222) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 78e4e7ce3b..eae7982a9b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.4 + 1.31.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 777f6ef0ab..c57288a196 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.4 + 1.31.5 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2331da6d73..958609f85a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.4 + 1.31.5 From 3ce49334478dc0905cdcb476c739a49d296de922 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 9 Apr 2021 17:48:05 -0400 Subject: [PATCH 0072/2268] feat: add support for parameterMode in QueryJobConfiguration to unblock JDBC migration to the Java client library (#1223) --- .../cloud/bigquery/QueryJobConfiguration.java | 21 +++++++++++++++ .../bigquery/QueryJobConfigurationTest.java | 2 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 27 +++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 927ae846cd..7733e48e6f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -47,6 +47,7 @@ public final class QueryJobConfiguration extends JobConfiguration { private final String query; private final ImmutableList positionalParameters; private final ImmutableMap namedParameters; + private final String parameterMode; private final TableId destinationTable; private final Map tableDefinitions; private final List userDefinedFunctions; @@ -98,6 +99,7 @@ public static final class Builder private String query; private List positionalParameters = Lists.newArrayList(); private Map namedParameters = Maps.newHashMap(); + private String parameterMode; private TableId destinationTable; private Map tableDefinitions; private List userDefinedFunctions; @@ -131,6 +133,7 @@ private Builder(QueryJobConfiguration jobConfiguration) { this.query = jobConfiguration.query; this.namedParameters = jobConfiguration.namedParameters; this.positionalParameters = jobConfiguration.positionalParameters; + this.parameterMode = jobConfiguration.parameterMode; this.destinationTable = jobConfiguration.destinationTable; this.tableDefinitions = jobConfiguration.tableDefinitions; this.userDefinedFunctions = jobConfiguration.userDefinedFunctions; @@ -163,11 +166,13 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (queryConfigurationPb.getQueryParameters() != null && !queryConfigurationPb.getQueryParameters().isEmpty()) { if (queryConfigurationPb.getQueryParameters().get(0).getName() == null) { + parameterMode = "POSITIONAL"; setPositionalParameters( Lists.transform( queryConfigurationPb.getQueryParameters(), POSITIONAL_PARAMETER_FROM_PB_FUNCTION)); } else { + parameterMode = "NAMED"; Map values = Maps.newHashMap(); for (QueryParameter queryParameterPb : queryConfigurationPb.getQueryParameters()) { checkNotNull(queryParameterPb.getName()); @@ -277,6 +282,16 @@ public Builder addPositionalParameter(QueryParameterValue value) { return this; } + /** + * Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to + * use named (@myparam) query parameters in this query. + */ + public Builder setParameterMode(String parameterMode) { + checkNotNull(parameterMode); + this.parameterMode = parameterMode; + return this; + } + /** * Sets the query parameters to a list of positional query parameters to use in the query. * @@ -639,6 +654,7 @@ private QueryJobConfiguration(Builder builder) { } positionalParameters = ImmutableList.copyOf(builder.positionalParameters); namedParameters = ImmutableMap.copyOf(builder.namedParameters); + this.parameterMode = builder.parameterMode; this.allowLargeResults = builder.allowLargeResults; this.createDisposition = builder.createDisposition; this.defaultDataset = builder.defaultDataset; @@ -876,6 +892,7 @@ ToStringHelper toStringHelper() { .add("query", query) .add("positionalParameters", positionalParameters) .add("namedParameters", namedParameters) + .add("parameterMode", parameterMode) .add("destinationTable", destinationTable) .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("defaultDataset", defaultDataset) @@ -919,6 +936,7 @@ public int hashCode() { query, positionalParameters, namedParameters, + parameterMode, tableDefinitions, useQueryCache, userDefinedFunctions, @@ -963,6 +981,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { Lists.transform(namedParameters.entrySet().asList(), NAMED_PARAMETER_TO_PB_FUNCTION); queryConfigurationPb.setQueryParameters(queryParametersPb); } + if (parameterMode != null) { + queryConfigurationPb.setParameterMode(parameterMode); + } configurationPb.setDryRun(dryRun()); if (allowLargeResults != null) { queryConfigurationPb.setAllowLargeResults(allowLargeResults); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index 3cd4182049..bcfc723568 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -108,6 +108,7 @@ public class QueryJobConfigurationTest { ImmutableList.of(STRING_PARAMETER, TIMESTAMP_PARAMETER, BIGNUMERIC_PARAMETER); private static final Map NAME_PARAMETER = ImmutableMap.of("string", STRING_PARAMETER, "timestamp", TIMESTAMP_PARAMETER); + private static final String PARAMETER_MODE = "POSITIONAL"; private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -133,6 +134,7 @@ public class QueryJobConfigurationTest { .setRangePartitioning(RANGE_PARTITIONING) .setConnectionProperties(CONNECTION_PROPERTIES) .setPositionalParameters(POSITIONAL_PARAMETER) + .setParameterMode(PARAMETER_MODE) .build(); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_ADD_POSITIONAL_PARAMETER = QUERY_JOB_CONFIGURATION diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index dc8b3c3554..4e8e600f79 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2099,6 +2099,33 @@ public void testScriptStatistics() throws InterruptedException { } } + @Test + public void testQueryParameterModeWithDryRun() { + String query = + "SELECT TimestampField, StringField, BooleanField, BigNumericField, BigNumericField1, BigNumericField2, BigNumericField3, BigNumericField4 FROM " + + TABLE_ID.getTable() + + " WHERE StringField = ?" + + " AND TimestampField > ?" + + " AND IntegerField IN UNNEST(?)" + + " AND IntegerField < ?" + + " AND FloatField > ?" + + " AND NumericField < ?" + + " AND BigNumericField = ?"; + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .setParameterMode("POSITIONAL") + .setUseLegacySql(false) + .setDryRun(true) + .build(); + + Job job = bigquery.create(JobInfo.of(queryConfig)); + JobStatistics.QueryStatistics statistics = job.getStatistics(); + + assertNotNull(statistics.getTotalBytesProcessed()); + } + @Test public void testPositionalQueryParameters() throws InterruptedException { String query = From f7cdb36c1f9e513e78e390ae5319c70f7c454536 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Apr 2021 23:48:48 +0200 Subject: [PATCH 0073/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.31.5 (#1221) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index eae7982a9b..7afa132a18 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.2 + 1.31.5 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c57288a196..f66fc5611d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.2 + 1.31.5 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 958609f85a..37fa527d8c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.2 + 1.31.5 com.google.oauth-client From 8ea26fcedf1f34565d287daab388c2a93d7ac6ea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Apr 2021 23:54:07 +0200 Subject: [PATCH 0074/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210404-1.31.0 (#1226) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | com.google.apis:google-api-services-bigquery | `v2-rev20210327-1.31.0` -> `v2-rev20210404-1.31.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20210404-1.31.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20210404-1.31.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20210404-1.31.0/compatibility-slim/v2-rev20210327-1.31.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20210404-1.31.0/confidence-slim/v2-rev20210327-1.31.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb01ccc0ff..71a2ff6ff1 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210327-1.31.0 + v2-rev20210404-1.31.0 0.21.0
From 112a384307ce6b6773d1b1a1f191e65e9cca951a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 02:58:03 +0000 Subject: [PATCH 0075/2268] chore: release 1.128.0 (#1225) :robot: I have created a release \*beep\* \*boop\* --- ## [1.128.0](https://www.github.com/googleapis/java-bigquery/compare/v1.127.12...v1.128.0) (2021-04-09) ### Features * add support for parameterMode in QueryJobConfiguration to unblock JDBC migration to the Java client library ([#1223](https://www.github.com/googleapis/java-bigquery/issues/1223)) ([3ce4933](https://www.github.com/googleapis/java-bigquery/commit/3ce49334478dc0905cdcb476c739a49d296de922)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210404-1.31.0 ([#1226](https://www.github.com/googleapis/java-bigquery/issues/1226)) ([8ea26fc](https://www.github.com/googleapis/java-bigquery/commit/8ea26fcedf1f34565d287daab388c2a93d7ac6ea)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#1224](https://www.github.com/googleapis/java-bigquery/issues/1224)) ([d5c5747](https://www.github.com/googleapis/java-bigquery/commit/d5c5747e74d8c2e1ca0901eea0d82fd94460a639)) * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.31.5 ([#1221](https://www.github.com/googleapis/java-bigquery/issues/1221)) ([f7cdb36](https://www.github.com/googleapis/java-bigquery/commit/f7cdb36c1f9e513e78e390ae5319c70f7c454536)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.31.5 ([#1222](https://www.github.com/googleapis/java-bigquery/issues/1222)) ([0a271cb](https://www.github.com/googleapis/java-bigquery/commit/0a271cb363180a093385ed6c5c68e12c6fde6502)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae6a358677..b1edede75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [1.128.0](https://www.github.com/googleapis/java-bigquery/compare/v1.127.12...v1.128.0) (2021-04-09) + + +### Features + +* add support for parameterMode in QueryJobConfiguration to unblock JDBC migration to the Java client library ([#1223](https://www.github.com/googleapis/java-bigquery/issues/1223)) ([3ce4933](https://www.github.com/googleapis/java-bigquery/commit/3ce49334478dc0905cdcb476c739a49d296de922)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210404-1.31.0 ([#1226](https://www.github.com/googleapis/java-bigquery/issues/1226)) ([8ea26fc](https://www.github.com/googleapis/java-bigquery/commit/8ea26fcedf1f34565d287daab388c2a93d7ac6ea)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#1224](https://www.github.com/googleapis/java-bigquery/issues/1224)) ([d5c5747](https://www.github.com/googleapis/java-bigquery/commit/d5c5747e74d8c2e1ca0901eea0d82fd94460a639)) +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.31.5 ([#1221](https://www.github.com/googleapis/java-bigquery/issues/1221)) ([f7cdb36](https://www.github.com/googleapis/java-bigquery/commit/f7cdb36c1f9e513e78e390ae5319c70f7c454536)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.31.5 ([#1222](https://www.github.com/googleapis/java-bigquery/issues/1222)) ([0a271cb](https://www.github.com/googleapis/java-bigquery/commit/0a271cb363180a093385ed6c5c68e12c6fde6502)) + ### [1.127.12](https://www.github.com/googleapis/java-bigquery/compare/v1.127.11...v1.127.12) (2021-04-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 009cdb466d..50855414ac 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.127.13-SNAPSHOT + 1.128.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c29e4973b2..34ca24d09e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.127.13-SNAPSHOT + 1.128.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.127.13-SNAPSHOT + 1.128.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 71a2ff6ff1..c8ca49bc83 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.127.13-SNAPSHOT + 1.128.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.127.13-SNAPSHOT + 1.128.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f66fc5611d..422a3c8d03 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.127.13-SNAPSHOT + 1.128.0 diff --git a/versions.txt b/versions.txt index b055919db8..cde9017e3c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.127.12:1.127.13-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.128.0:1.128.0 \ No newline at end of file From 93b486eb4751f602aaf55e49313152f2e8c5fb09 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 9 Apr 2021 19:58:07 -0700 Subject: [PATCH 0076/2268] build(java): skip javadoc tests during dependencies test (#1229) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/dd324abd-aeaa-4d76-b929-9d570ba79778/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/5b0e1592dd7d70b485e157ea4b3eb1704ecbd015 --- .kokoro/dependencies.sh | 1 + synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 0fb8c8436c..59d2aafc79 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -33,6 +33,7 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" retry_with_backoff 3 10 \ mvn install -B -V -ntp \ -DskipTests=true \ + -Dmaven.javadoc.skip=true \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true diff --git a/synth.metadata b/synth.metadata index 11e1664b6a..fcb9ef30d0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "b69258136bba3481030596107185b846d7a5c0a7" + "sha": "8ea26fcedf1f34565d287daab388c2a93d7ac6ea" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "572ef8f70edd9041f5bcfa71511aed6aecfc2098" + "sha": "5b0e1592dd7d70b485e157ea4b3eb1704ecbd015" } } ], From aaa9adbe359f0eb2b44b635bb888ce55d4ebf82c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 10 Apr 2021 03:08:04 +0000 Subject: [PATCH 0077/2268] chore: release 1.128.1-SNAPSHOT (#1230) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 50855414ac..4323bc623b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.0 + 1.128.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 34ca24d09e..113c8c0644 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.0 + 1.128.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.0 + 1.128.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c8ca49bc83..fde1a0617f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.0 + 1.128.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.0 + 1.128.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 422a3c8d03..fa14464f56 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.0 + 1.128.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index cde9017e3c..4642c4fc5b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.0:1.128.0 \ No newline at end of file +google-cloud-bigquery:1.128.0:1.128.1-SNAPSHOT \ No newline at end of file From 21f922128419da78a8be765b45ce6bdd0f9c2472 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 10 Apr 2021 16:06:50 +0200 Subject: [PATCH 0078/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.128.0 (#1231) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7afa132a18..3c40a898bf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.127.12 + 1.128.0 From cb0579f39926514ad11bdd49af92504d7b94f2e6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 10 Apr 2021 07:20:02 -0700 Subject: [PATCH 0079/2268] chore: regenerate README (#1232) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-10 14:09:07,556 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-10 14:09:08,839 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/89aad432-ded3-46bd-bb08-782612180906/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 6c01fbe888..f174e84516 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "ae8375c9787cd3dd9b39af804c152466a0dabb83" + "sha": "21f922128419da78a8be765b45ce6bdd0f9c2472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0f3469e88a4be9af4d9b1c4b6cf6fd3f8ac15588" + "sha": "0a071b3460344886297a304253bf924aa68ddb7e" } } ] diff --git a/README.md b/README.md index 0e8f4fb5d9..da1710eb3b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.127.12 + 1.128.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.127.12' +compile 'com.google.cloud:google-cloud-bigquery:1.128.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.127.12" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.0" ``` ## Authentication From f082628ea36eb90d0fac31336499da003b89f30a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Apr 2021 17:28:20 +0200 Subject: [PATCH 0080/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20 (#1233) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `19.2.1` -> `20.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.0.0/compatibility-slim/19.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.0.0/confidence-slim/19.2.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 37fa527d8c..213f0edf91 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 19.2.1 + 20.0.0 pom import From c668f09d065a82538ac025c189f213b28f2bc3ea Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 12 Apr 2021 08:48:38 -0700 Subject: [PATCH 0081/2268] chore: regenerate README (#1234) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-12 15:30:42,513 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-12 15:30:43,819 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/997306e0-3d44-4e2d-ba32-9da6f2aa536e/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index f174e84516..79a58c3a9b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "21f922128419da78a8be765b45ce6bdd0f9c2472" + "sha": "f082628ea36eb90d0fac31336499da003b89f30a" } }, { diff --git a/README.md b/README.md index da1710eb3b..df8649d810 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 19.2.1 + 20.0.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:19.2.1') +implementation platform('com.google.cloud:libraries-bom:20.0.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From e2e7f900db11c513818339208eee28cccc5aa76f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 13 Apr 2021 08:38:17 -0700 Subject: [PATCH 0082/2268] fix: typo (#1236) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/188dabe1-9388-4624-88b8-fe2e7ac2d961/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/082e1ca0863b13ada8594fe91845380765da5b70 --- .kokoro/build.sh | 2 +- synth.metadata | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 8c8119e6a5..0f37b1e020 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -37,7 +37,7 @@ retry_with_backoff 3 10 \ -Dgcloud.download.skip=true \ -T 1C -# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) fi diff --git a/synth.metadata b/synth.metadata index fcb9ef30d0..e8764cd551 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "8ea26fcedf1f34565d287daab388c2a93d7ac6ea" + "sha": "c668f09d065a82538ac025c189f213b28f2bc3ea" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5b0e1592dd7d70b485e157ea4b3eb1704ecbd015" + "sha": "082e1ca0863b13ada8594fe91845380765da5b70" } } ], @@ -26,6 +26,7 @@ ".github/readme/synth.py", ".github/release-please.yml", ".github/snippet-bot.yml", + ".github/sync-repo-settings.yaml", ".github/trusted-contribution.yml", ".github/workflows/approve-readme.yaml", ".github/workflows/auto-release.yaml", From 9e1a873c3b29afa733ac0f6abf8363f73c5a3419 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 13 Apr 2021 18:13:43 +0200 Subject: [PATCH 0083/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.14 (#1235) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3c40a898bf..6e7ccd4843 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.13 + 1.0.14 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fa14464f56..601035622f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.13 + 1.0.14 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 213f0edf91..8b6dba48fc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.13 + 1.0.14 test From 18c17ab30e893763d4075f40242aceec4c1d14d4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 14:01:24 +0200 Subject: [PATCH 0084/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.23.0 (#1239) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6e7ccd4843..6778499148 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.22.0 + 1.23.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 601035622f..6af022f82b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.22.0 + 1.23.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8b6dba48fc..67a0a79ca7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.22.0 + 1.23.0 test From b9fd26f2a887ed371c7974d6a48e36d03a95e088 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:12:19 +0200 Subject: [PATCH 0085/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.11.1 (#1240) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.11.0` -> `0.11.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.1/compatibility-slim/0.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.1/confidence-slim/0.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v0.11.1`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​0111-httpswwwgithubcomgoogleapisjava-shared-configcomparev0110v0111-2021-04-14) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.11.0...v0.11.1)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fde1a0617f..b24d84d0da 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.11.0 + 0.11.1 From b2bbc90d968573e4e2e7c0785da3b5ae4c1ac0d7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 15 Apr 2021 08:32:28 -0700 Subject: [PATCH 0086/2268] fix: release scripts from issuing overlapping phases (#1241) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/f801d6e1-7607-45e4-94e5-d42084e06fc7/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/8285c2b4cdbc3771d031ad91e1c4ec9e55fff45d --- .kokoro/release/snapshot.sh | 2 +- .kokoro/release/stage.sh | 2 +- synth.metadata | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh index 098168a737..1f55b77024 100755 --- a/.kokoro/release/snapshot.sh +++ b/.kokoro/release/snapshot.sh @@ -25,7 +25,7 @@ grep SNAPSHOT versions.txt setup_environment_secrets create_settings_xml_file "settings.xml" -mvn clean install deploy -B \ +mvn clean deploy -B \ --settings ${MAVEN_SETTINGS_FILE} \ -DperformRelease=true \ -Dgpg.executable=gpg \ diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 16126d2eb5..8a1033843c 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -29,7 +29,7 @@ create_settings_xml_file "settings.xml" # attempt to stage 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn clean install deploy -B \ + mvn clean deploy -B \ --settings ${MAVEN_SETTINGS_FILE} \ -DskipTests=true \ -DperformRelease=true \ diff --git a/synth.metadata b/synth.metadata index e8764cd551..834585a7fb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "c668f09d065a82538ac025c189f213b28f2bc3ea" + "sha": "b9fd26f2a887ed371c7974d6a48e36d03a95e088" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "082e1ca0863b13ada8594fe91845380765da5b70" + "sha": "8285c2b4cdbc3771d031ad91e1c4ec9e55fff45d" } } ], From 9b445423a213309ad8dea9b149c3511c82174f6d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Apr 2021 20:17:39 +0200 Subject: [PATCH 0087/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.1.0 (#1242) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 67a0a79ca7..de361183aa 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.0.0 + 20.1.0 pom import From ba37b69be1e54b53d395fa5925afd67873e7e888 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 15 Apr 2021 11:30:06 -0700 Subject: [PATCH 0088/2268] chore: regenerate README (#1243) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-15 18:20:00,355 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-15 18:20:01,878 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/65a4b277-8d55-4f74-bc78-aa7b1e5f0fcd/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 79a58c3a9b..cd30688c35 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "f082628ea36eb90d0fac31336499da003b89f30a" + "sha": "9b445423a213309ad8dea9b149c3511c82174f6d" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0a071b3460344886297a304253bf924aa68ddb7e" + "sha": "043cc620d6a6111816d9e09f2a97208565fde958" } } ] diff --git a/README.md b/README.md index df8649d810..1808b5c8f2 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.0.0 + 20.1.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.0.0') +implementation platform('com.google.cloud:libraries-bom:20.1.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From b00ded92dfe553f9cf06624606717729f1103d6b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 17 Apr 2021 18:36:45 +0200 Subject: [PATCH 0089/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210410-1.31.0 (#1245) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b24d84d0da..e982861120 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210404-1.31.0 + v2-rev20210410-1.31.0 0.21.0
From 119a378d6619098b4e123475c2ac7657e26c52e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 17:28:23 +0200 Subject: [PATCH 0090/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 (#1246) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `0.21.0` -> `0.21.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.1/compatibility-slim/0.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/0.21.1/confidence-slim/0.21.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v0.21.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​0211-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0210v0211-2021-04-19) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.21.0...v0.21.1)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e982861120..094887cb6f 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210410-1.31.0 - 0.21.0 + 0.21.1
From 69974342628d1718ae79d810f9a89c264f77b878 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 21:10:12 +0200 Subject: [PATCH 0091/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.15 (#1238) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `1.113.14` -> `1.113.15` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.15/compatibility-slim/1.113.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.15/confidence-slim/1.113.14)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v1.113.15`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​111315-httpswwwgithubcomgoogleapisjava-storagecomparev111314v111315-2021-04-13) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v1.113.14...v1.113.15)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 094887cb6f..b63eca2854 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.14 + 1.113.15 test From 7b97233f3645deb52d6db2e63c50ad2349b1e46b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 23 Apr 2021 03:48:06 +0200 Subject: [PATCH 0092/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.11.2 (#1251) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.11.1` -> `0.11.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.2/compatibility-slim/0.11.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.11.2/confidence-slim/0.11.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v0.11.2`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​0112-httpswwwgithubcomgoogleapisjava-shared-configcomparev0111v0112-2021-04-22) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.11.1...v0.11.2)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b63eca2854..693c500c3b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.11.1 + 0.11.2 From 80e63b4bec2eaf3d53f900b8b226c156d095f262 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 23 Apr 2021 23:10:20 +0200 Subject: [PATCH 0093/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1 (#1252) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `0.21.1` -> `1.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.0.0/compatibility-slim/0.21.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/1.0.0/confidence-slim/0.21.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v1.0.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​100-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare0211v100-2021-04-23) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v0.21.1...v1.0.0) ##### Features - promote to 1.0.0 ([#​341](https://www.github.com/googleapis/java-shared-dependencies/issues/341)) ([eddce7b](https://www.github.com/googleapis/java-shared-dependencies/commit/eddce7bda196d757c0bb93a05574cc742e3d7ff6)) ##### Dependencies - update dependency com.google.api:api-common to v1.10.3 ([#​340](https://www.github.com/googleapis/java-shared-dependencies/issues/340)) ([6a7fc33](https://www.github.com/googleapis/java-shared-dependencies/commit/6a7fc33548c199d5f310b3ee5024907882d22726)) - update dependency com.google.auth:google-auth-library-bom to v0.25.4 ([#​334](https://www.github.com/googleapis/java-shared-dependencies/issues/334)) ([e5c747d](https://www.github.com/googleapis/java-shared-dependencies/commit/e5c747d245194effc258ae706e7764153010cd53)) - update dependency com.google.auth:google-auth-library-bom to v0.25.5 ([#​338](https://www.github.com/googleapis/java-shared-dependencies/issues/338)) ([ffa1df5](https://www.github.com/googleapis/java-shared-dependencies/commit/ffa1df5497b5365f520b665a202b8caf6521fc9d)) - update dependency org.threeten:threetenbp to v1.5.1 ([#​335](https://www.github.com/googleapis/java-shared-dependencies/issues/335)) ([c8c6df4](https://www.github.com/googleapis/java-shared-dependencies/commit/c8c6df48e7f80944544939e502f4f08543af2631)) - update google.core.version to v1.94.8 ([#​342](https://www.github.com/googleapis/java-shared-dependencies/issues/342)) ([d946dd2](https://www.github.com/googleapis/java-shared-dependencies/commit/d946dd2299aac32f969a2226a1391e1e73f00e62)) ##### [0.21.1](https://www.github.com/googleapis/java-shared-dependencies/compare/0.21.0...v0.21.1) (2021-04-19) ##### Bug Fixes - release scripts from issuing overlapping phases ([#​332](https://www.github.com/googleapis/java-shared-dependencies/issues/332)) ([e289825](https://www.github.com/googleapis/java-shared-dependencies/commit/e289825a3bc45b4796db7ce4347f8d9d9251a410)) ##### Dependencies - update dependency com.fasterxml.jackson:jackson-bom to v2.12.3 ([#​329](https://www.github.com/googleapis/java-shared-dependencies/issues/329)) ([a77b4fc](https://www.github.com/googleapis/java-shared-dependencies/commit/a77b4fcc2ea5caf366c76a4698bac6d4c9abc92e)) - update dependency com.google.api-client:google-api-client-bom to v1.31.4 ([#​326](https://www.github.com/googleapis/java-shared-dependencies/issues/326)) ([409d24f](https://www.github.com/googleapis/java-shared-dependencies/commit/409d24f8a0cac30e41ca45eb2711aecb335d70dd)) - update dependency com.google.auth:google-auth-library-bom to v0.25.3 ([#​328](https://www.github.com/googleapis/java-shared-dependencies/issues/328)) ([88cfc08](https://www.github.com/googleapis/java-shared-dependencies/commit/88cfc08952881200e23ed95cfa2eebad85ec7ab3)) - update google.core.version to v1.94.7 ([#​324](https://www.github.com/googleapis/java-shared-dependencies/issues/324)) ([0412c88](https://www.github.com/googleapis/java-shared-dependencies/commit/0412c88468940c1182bc0761bfe269a6688fe7b7)) - update iam.version to v1.0.12 ([#​327](https://www.github.com/googleapis/java-shared-dependencies/issues/327)) ([548d5f5](https://www.github.com/googleapis/java-shared-dependencies/commit/548d5f53c4f264f1cbb9ca72fdfe4608ab16b480))
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 693c500c3b..a1893eb3a7 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210410-1.31.0 - 0.21.1 + 1.0.0
From 5306bf1cd86c6e6bc71374f1a33dcd54b8bcd578 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 26 Apr 2021 17:26:34 +0200 Subject: [PATCH 0094/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.23.1 (#1248) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6778499148..ccd3309e71 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.23.0 + 1.23.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6af022f82b..0708f49a67 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.23.0 + 1.23.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index de361183aa..9d1b9ec212 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.23.0 + 1.23.1 test From 74a8677e22e4f8e446cbd7cab0439c3d6a22f4ba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 20:00:11 +0000 Subject: [PATCH 0095/2268] chore: release 1.128.1 (#1237) :robot: I have created a release \*beep\* \*boop\* --- ### [1.128.1](https://www.github.com/googleapis/java-bigquery/compare/v1.128.0...v1.128.1) (2021-04-26) ### Bug Fixes * release scripts from issuing overlapping phases ([#1241](https://www.github.com/googleapis/java-bigquery/issues/1241)) ([b2bbc90](https://www.github.com/googleapis/java-bigquery/commit/b2bbc90d968573e4e2e7c0785da3b5ae4c1ac0d7)) * typo ([#1236](https://www.github.com/googleapis/java-bigquery/issues/1236)) ([e2e7f90](https://www.github.com/googleapis/java-bigquery/commit/e2e7f900db11c513818339208eee28cccc5aa76f)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210410-1.31.0 ([#1245](https://www.github.com/googleapis/java-bigquery/issues/1245)) ([b00ded9](https://www.github.com/googleapis/java-bigquery/commit/b00ded92dfe553f9cf06624606717729f1103d6b)) * update dependency com.google.cloud:google-cloud-bigtable to v1.23.0 ([#1239](https://www.github.com/googleapis/java-bigquery/issues/1239)) ([18c17ab](https://www.github.com/googleapis/java-bigquery/commit/18c17ab30e893763d4075f40242aceec4c1d14d4)) * update dependency com.google.cloud:google-cloud-bigtable to v1.23.1 ([#1248](https://www.github.com/googleapis/java-bigquery/issues/1248)) ([5306bf1](https://www.github.com/googleapis/java-bigquery/commit/5306bf1cd86c6e6bc71374f1a33dcd54b8bcd578)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#1246](https://www.github.com/googleapis/java-bigquery/issues/1246)) ([119a378](https://www.github.com/googleapis/java-bigquery/commit/119a378d6619098b4e123475c2ac7657e26c52e3)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#1252](https://www.github.com/googleapis/java-bigquery/issues/1252)) ([80e63b4](https://www.github.com/googleapis/java-bigquery/commit/80e63b4bec2eaf3d53f900b8b226c156d095f262)) * update dependency com.google.cloud:google-cloud-storage to v1.113.15 ([#1238](https://www.github.com/googleapis/java-bigquery/issues/1238)) ([6997434](https://www.github.com/googleapis/java-bigquery/commit/69974342628d1718ae79d810f9a89c264f77b878)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1edede75d..cdc26ec21d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +### [1.128.1](https://www.github.com/googleapis/java-bigquery/compare/v1.128.0...v1.128.1) (2021-04-26) + + +### Bug Fixes + +* release scripts from issuing overlapping phases ([#1241](https://www.github.com/googleapis/java-bigquery/issues/1241)) ([b2bbc90](https://www.github.com/googleapis/java-bigquery/commit/b2bbc90d968573e4e2e7c0785da3b5ae4c1ac0d7)) +* typo ([#1236](https://www.github.com/googleapis/java-bigquery/issues/1236)) ([e2e7f90](https://www.github.com/googleapis/java-bigquery/commit/e2e7f900db11c513818339208eee28cccc5aa76f)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210410-1.31.0 ([#1245](https://www.github.com/googleapis/java-bigquery/issues/1245)) ([b00ded9](https://www.github.com/googleapis/java-bigquery/commit/b00ded92dfe553f9cf06624606717729f1103d6b)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.23.0 ([#1239](https://www.github.com/googleapis/java-bigquery/issues/1239)) ([18c17ab](https://www.github.com/googleapis/java-bigquery/commit/18c17ab30e893763d4075f40242aceec4c1d14d4)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.23.1 ([#1248](https://www.github.com/googleapis/java-bigquery/issues/1248)) ([5306bf1](https://www.github.com/googleapis/java-bigquery/commit/5306bf1cd86c6e6bc71374f1a33dcd54b8bcd578)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#1246](https://www.github.com/googleapis/java-bigquery/issues/1246)) ([119a378](https://www.github.com/googleapis/java-bigquery/commit/119a378d6619098b4e123475c2ac7657e26c52e3)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#1252](https://www.github.com/googleapis/java-bigquery/issues/1252)) ([80e63b4](https://www.github.com/googleapis/java-bigquery/commit/80e63b4bec2eaf3d53f900b8b226c156d095f262)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.15 ([#1238](https://www.github.com/googleapis/java-bigquery/issues/1238)) ([6997434](https://www.github.com/googleapis/java-bigquery/commit/69974342628d1718ae79d810f9a89c264f77b878)) + ## [1.128.0](https://www.github.com/googleapis/java-bigquery/compare/v1.127.12...v1.128.0) (2021-04-09) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4323bc623b..f77964c108 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.1-SNAPSHOT + 1.128.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 113c8c0644..8c512d929e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.1-SNAPSHOT + 1.128.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.1-SNAPSHOT + 1.128.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a1893eb3a7..d5a619c908 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.1-SNAPSHOT + 1.128.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.1-SNAPSHOT + 1.128.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0708f49a67..d2920f482f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.1-SNAPSHOT + 1.128.1 diff --git a/versions.txt b/versions.txt index 4642c4fc5b..809ef9037a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.0:1.128.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.128.1:1.128.1 \ No newline at end of file From a8cd1270f5feb63382e430623238ee0bd272ca6d Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 26 Apr 2021 16:00:56 -0400 Subject: [PATCH 0096/2268] build: configure branch 1.127.12-sp as a release branch (#1253) * build: configure branch 1.127.12-sp as a release branch * add synth.py exclusions * remove synth.py exclusions since autosynth only runs on master branch * revert back rebaseMergeAllowed setting --- .github/release-please.yml | 6 +++++- .github/sync-repo-settings.yaml | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index dce2c84509..807174cce1 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,6 @@ releaseType: java-yoshi -bumpMinorPreMajor: true \ No newline at end of file +bumpMinorPreMajor: true +branches: +- releaseType: java-lts + bumpMinorPreMajor: true + branch: 1.127.12-sp \ No newline at end of file diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index d72318bf65..ba8ff8a8dc 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -38,6 +38,22 @@ branchProtectionRules: - "units (11)" - "Kokoro - Test: Integration" - "cla/google" +- pattern: 1.127.12-sp + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - "dependencies (8)" + - "dependencies (11)" + - "linkage-monitor" + - "lint" + - "clirr" + - "units (7)" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" # List of explicit permissions to add (additive only) permissionRules: # Team slug to add to repository permissions From 5ca5e980788cbf8a4094eb678f236536263c3bc1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Apr 2021 20:12:07 +0000 Subject: [PATCH 0097/2268] chore: release 1.128.2-SNAPSHOT (#1256) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f77964c108..56e1c442ed 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.1 + 1.128.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8c512d929e..26f103f792 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.1 + 1.128.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.1 + 1.128.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d5a619c908..792eeed908 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.1 + 1.128.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.1 + 1.128.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d2920f482f..d9cd4c7e80 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.1 + 1.128.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 809ef9037a..14db5c6051 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.1:1.128.1 \ No newline at end of file +google-cloud-bigquery:1.128.1:1.128.2-SNAPSHOT \ No newline at end of file From ca7fdc3669afa5a8175847d45e405b684d542f3f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 27 Apr 2021 01:03:58 +0200 Subject: [PATCH 0098/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.128.1 (#1258) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ccd3309e71..f1152ef3eb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.128.0 + 1.128.1 From bc6075b1eefaf9a65fc5f4d27ab8a7b76d499d35 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 27 Apr 2021 01:14:09 +0200 Subject: [PATCH 0099/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.23.2 (#1255) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.23.1` -> `1.23.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.23.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.23.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.23.2/compatibility-slim/1.23.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.23.2/confidence-slim/1.23.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.23.2`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1232-httpswwwgithubcomgoogleapisjava-bigtablecomparev1231v1232-2021-04-23) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.23.1...v1.23.2)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f1152ef3eb..30587c5ef4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.23.1 + 1.23.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d9cd4c7e80..247fb1d6f0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.23.1 + 1.23.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9d1b9ec212..e1d9b03193 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.23.1 + 1.23.2 test From 8c0b85b5b9a9661b10181587c29e819ee5b6a708 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 27 Apr 2021 01:24:20 +0200 Subject: [PATCH 0100/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.113.16 (#1259) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `1.113.15` -> `1.113.16` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.16/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.16/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.16/compatibility-slim/1.113.15)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.113.16/confidence-slim/1.113.15)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v1.113.16`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​111316-httpswwwgithubcomgoogleapisjava-storagecomparev111315v111316-2021-04-23) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v1.113.15...v1.113.16)
--- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 792eeed908..1d916af474 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.15 + 1.113.16 test From c4fd120ad3c4b64f8f680f9446d79ec08d9a770f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 26 Apr 2021 16:28:10 -0700 Subject: [PATCH 0101/2268] chore: regenerate README (#1262) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-26 23:16:23,258 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-26 23:16:24,680 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/5b42685b-42b6-4e72-85bc-9ea516bfe3ad/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index cd30688c35..22b57b8bae 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9b445423a213309ad8dea9b149c3511c82174f6d" + "sha": "bc6075b1eefaf9a65fc5f4d27ab8a7b76d499d35" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "043cc620d6a6111816d9e09f2a97208565fde958" + "sha": "a648ce0ca3fe122b3186d7e6861cb641437e485e" } } ] diff --git a/README.md b/README.md index 1808b5c8f2..89fe693fe1 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.128.0 + 1.128.1 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.128.0' +compile 'com.google.cloud:google-cloud-bigquery:1.128.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.1" ``` ## Authentication From 85761ccbf19c0be2dcd293756f43d3e682dae68c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 27 Apr 2021 19:20:28 +0200 Subject: [PATCH 0102/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.15 (#1260) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 30587c5ef4..fa88de1478 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.14 + 1.0.15 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 247fb1d6f0..c50ea5d7cf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.14 + 1.0.15 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e1d9b03193..00b6f0920d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.14 + 1.0.15 test From b7ca9cad0ec8af4e65e49593ea57b02aa31bb8be Mon Sep 17 00:00:00 2001 From: "google-cloud-policy-bot[bot]" <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com> Date: Tue, 27 Apr 2021 17:34:40 +0000 Subject: [PATCH 0103/2268] chore: add SECURITY.md (#1263) add a security policy --- SECURITY.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..8b58ae9c01 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. From 45f4a39139c88c3367192920ef774586369afdb4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Apr 2021 16:42:07 +0200 Subject: [PATCH 0104/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.2.0 (#1265) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.1.0` -> `20.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/compatibility-slim/20.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.2.0/confidence-slim/20.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 00b6f0920d..a673300c1d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.1.0 + 20.2.0 pom import From fc3059eaecde25932cf2154affa8cea80a7824ee Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 30 Apr 2021 12:38:02 -0400 Subject: [PATCH 0105/2268] test: add integration test for Column ACLs (#1266) Fixes: #1244 --- .kokoro/dependencies.sh | 4 +- google-cloud-bigquery/pom.xml | 8 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 100 ++++++++++++++---- pom.xml | 12 +++ synth.py | 1 + 5 files changed, 105 insertions(+), 20 deletions(-) diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 59d2aafc79..12f1088d8d 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -50,7 +50,9 @@ function completenessCheck() { # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + # Excluding commons-codec,commons-logging from the comparison as a temp fix + # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 + mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=commons-codec,commons-logging -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt # Compare two dependency lists msg "Comparing dependency lists..." diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 26f103f792..5d939a1115 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -29,6 +29,14 @@ com.google.http-client google-http-client-jackson2 + + com.google.cloud + google-cloud-datacatalog + + + com.google.api.grpc + proto-google-cloud-datacatalog-v1 + com.google.cloud google-cloud-storage diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 4e8e600f79..e123fa4467 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -59,6 +59,7 @@ import com.google.cloud.bigquery.ExternalTableDefinition; import com.google.cloud.bigquery.ExtractJobConfiguration; import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; import com.google.cloud.bigquery.FieldValue; import com.google.cloud.bigquery.FieldValueList; import com.google.cloud.bigquery.FormatOptions; @@ -98,6 +99,12 @@ import com.google.cloud.bigquery.ViewDefinition; import com.google.cloud.bigquery.WriteChannelConfiguration; import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import com.google.cloud.datacatalog.v1.CreatePolicyTagRequest; +import com.google.cloud.datacatalog.v1.CreateTaxonomyRequest; +import com.google.cloud.datacatalog.v1.PolicyTag; +import com.google.cloud.datacatalog.v1.PolicyTagManagerClient; +import com.google.cloud.datacatalog.v1.Taxonomy; +import com.google.cloud.datacatalog.v1.Taxonomy.PolicyType; import com.google.cloud.storage.BlobInfo; import com.google.cloud.storage.BucketInfo; import com.google.cloud.storage.Storage; @@ -155,10 +162,6 @@ public class ITBigQueryTest { ImmutableMap.of( "example-label1", "example-value1", "example-label2", "example-value2"); - private static final String sampleTag = - String.format("projects/%s/locations/us/taxonomies/1/policyTags/2", PROJECT_ID); - private static final PolicyTags POLICY_TAGS = - PolicyTags.newBuilder().setNames(ImmutableList.of(sampleTag)).build(); private static final Field TIMESTAMP_FIELD_SCHEMA = Field.newBuilder("TimestampField", LegacySQLTypeName.TIMESTAMP) .setMode(Field.Mode.NULLABLE) @@ -241,12 +244,6 @@ public class ITBigQueryTest { .setMode(Field.Mode.NULLABLE) .setDescription("BigNumeric4Description") .build(); - private static final Field STRING_FIELD_SCHEMA_WITH_POLICY = - Field.newBuilder("StringFieldWithPolicy", LegacySQLTypeName.STRING) - .setMode(Field.Mode.NULLABLE) - .setDescription("field has a policy") - .setPolicyTags(POLICY_TAGS) - .build(); private static final Schema TABLE_SCHEMA = Schema.of( TIMESTAMP_FIELD_SCHEMA, @@ -297,8 +294,6 @@ public class ITBigQueryTest { .build()); private static final Schema SIMPLE_SCHEMA = Schema.of(STRING_FIELD_SCHEMA); - private static final Schema POLICY_SCHEMA = - Schema.of(STRING_FIELD_SCHEMA, STRING_FIELD_SCHEMA_WITH_POLICY, INTEGER_FIELD_SCHEMA); private static final Schema QUERY_RESULT_SCHEMA = Schema.of( Field.newBuilder("TimestampField", LegacySQLTypeName.TIMESTAMP) @@ -705,18 +700,85 @@ public void testCreateTableWithRangePartitioning() { } } - public void testCreateTableWithPolicyTags() { - String tableName = "test_create_table_policytags"; - TableId tableId = TableId.of(DATASET, tableName); - try { + @Test + public void testCreateAndUpdateTableWithPolicyTags() throws IOException { + // Set up policy tags in the datacatalog service + try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { + CreateTaxonomyRequest createTaxonomyRequest = + CreateTaxonomyRequest.newBuilder() + .setParent(String.format("projects/%s/locations/%s", PROJECT_ID, "us")) + .setTaxonomy( + Taxonomy.newBuilder() + .setDisplayName("testing taxonomy") + .setDescription("taxonomy created for integration tests") + .addActivatedPolicyTypes(PolicyType.FINE_GRAINED_ACCESS_CONTROL) + .build()) + .build(); + Taxonomy taxonomyResponse = policyTagManagerClient.createTaxonomy(createTaxonomyRequest); + String taxonomyId = taxonomyResponse.getName(); + + CreatePolicyTagRequest createPolicyTagRequest = + CreatePolicyTagRequest.newBuilder() + .setParent(taxonomyId) + .setPolicyTag(PolicyTag.newBuilder().setDisplayName("ExamplePolicyTag").build()) + .build(); + PolicyTag policyTagResponse = policyTagManagerClient.createPolicyTag(createPolicyTagRequest); + String policyTagId = policyTagResponse.getName(); + PolicyTags policyTags = + PolicyTags.newBuilder().setNames(ImmutableList.of(policyTagId)).build(); + Field stringFieldWithPolicy = + Field.newBuilder("StringFieldWithPolicy", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("field has a policy") + .setPolicyTags(policyTags) + .build(); + Schema policySchema = + Schema.of(STRING_FIELD_SCHEMA, stringFieldWithPolicy, INTEGER_FIELD_SCHEMA); + + // Test: Amend an existing schema with a policy tag. + String tableNameForUpdate = "test_update_table_policytags"; + TableId tableIdForUpdate = TableId.of(DATASET, tableNameForUpdate); + TableInfo tableInfo = + TableInfo.newBuilder(tableIdForUpdate, StandardTableDefinition.of(TABLE_SCHEMA)) + .setDescription("policy tag update test table") + .build(); + Table createdTableForUpdate = bigquery.create(tableInfo); + assertNotNull(createdTableForUpdate); + Schema schema = createdTableForUpdate.getDefinition().getSchema(); + FieldList fields = schema.getFields(); + // Create a new schema adding the current fields, plus the new policy tag field + List fieldList = new ArrayList<>(); + for (Field field : fields) { + fieldList.add(field); + } + fieldList.add(stringFieldWithPolicy); + Schema updatedSchemaWithPolicyTag = Schema.of(fieldList); + Table updatedTable = + createdTableForUpdate + .toBuilder() + .setDefinition(StandardTableDefinition.of(updatedSchemaWithPolicyTag)) + .build(); + updatedTable.update(); + Table remoteUpdatedTable = bigquery.getTable(DATASET, tableNameForUpdate); + assertEquals( + updatedSchemaWithPolicyTag, + remoteUpdatedTable.getDefinition().getSchema()); + bigquery.delete(tableIdForUpdate); + + // Test: Create a new table with a policy tag defined. + String tableName = "test_create_table_policytags"; + TableId tableId = TableId.of(DATASET, tableName); StandardTableDefinition tableDefinition = - StandardTableDefinition.newBuilder().setSchema(POLICY_SCHEMA).build(); + StandardTableDefinition.newBuilder().setSchema(policySchema).build(); Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); assertNotNull(createdTable); Table remoteTable = bigquery.getTable(DATASET, tableName); - assertEquals(POLICY_SCHEMA, remoteTable.getDefinition().getSchema()); - } finally { + assertEquals(policySchema, remoteTable.getDefinition().getSchema()); bigquery.delete(tableId); + + // Clean up policy tags + policyTagManagerClient.deletePolicyTag(policyTagId); + policyTagManagerClient.deleteTaxonomy(taxonomyId); } } diff --git a/pom.xml b/pom.xml index 1d916af474..6b4813fea2 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,18 @@ 1.113.16 test + + com.google.cloud + google-cloud-datacatalog + 1.3.2 + test + + + com.google.api.grpc + proto-google-cloud-datacatalog-v1 + 1.3.2 + test + org.assertj assertj-core diff --git a/synth.py b/synth.py index 8d5aa0e5b7..381c973f76 100644 --- a/synth.py +++ b/synth.py @@ -26,5 +26,6 @@ '.kokoro/nightly/samples.cfg', '.kokoro/presubmit/java8-samples.cfg', '.kokoro/presubmit/java11-samples.cfg', + '.kokoro/dependencies.sh', 'codecov.yaml' ]) From 956447c4ccd01db382d9b1983d8f63f6c87e9265 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 16:48:06 +0000 Subject: [PATCH 0106/2268] chore: release 1.128.2 (#1261) :robot: I have created a release \*beep\* \*boop\* --- ### [1.128.2](https://www.github.com/googleapis/java-bigquery/compare/v1.128.1...v1.128.2) (2021-04-30) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.23.2 ([#1255](https://www.github.com/googleapis/java-bigquery/issues/1255)) ([bc6075b](https://www.github.com/googleapis/java-bigquery/commit/bc6075b1eefaf9a65fc5f4d27ab8a7b76d499d35)) * update dependency com.google.cloud:google-cloud-storage to v1.113.16 ([#1259](https://www.github.com/googleapis/java-bigquery/issues/1259)) ([8c0b85b](https://www.github.com/googleapis/java-bigquery/commit/8c0b85b5b9a9661b10181587c29e819ee5b6a708)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdc26ec21d..d04399caf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.128.2](https://www.github.com/googleapis/java-bigquery/compare/v1.128.1...v1.128.2) (2021-04-30) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.23.2 ([#1255](https://www.github.com/googleapis/java-bigquery/issues/1255)) ([bc6075b](https://www.github.com/googleapis/java-bigquery/commit/bc6075b1eefaf9a65fc5f4d27ab8a7b76d499d35)) +* update dependency com.google.cloud:google-cloud-storage to v1.113.16 ([#1259](https://www.github.com/googleapis/java-bigquery/issues/1259)) ([8c0b85b](https://www.github.com/googleapis/java-bigquery/commit/8c0b85b5b9a9661b10181587c29e819ee5b6a708)) + ### [1.128.1](https://www.github.com/googleapis/java-bigquery/compare/v1.128.0...v1.128.1) (2021-04-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 56e1c442ed..21b212b143 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.2-SNAPSHOT + 1.128.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5d939a1115..bae500efd7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.2-SNAPSHOT + 1.128.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.2-SNAPSHOT + 1.128.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6b4813fea2..a07e6e8881 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.2-SNAPSHOT + 1.128.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.2-SNAPSHOT + 1.128.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c50ea5d7cf..0d561eb4d8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.2-SNAPSHOT + 1.128.2 diff --git a/versions.txt b/versions.txt index 14db5c6051..c0a859f422 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.1:1.128.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.128.2:1.128.2 \ No newline at end of file From df30af3b2a7b831f77e8c6f3e984460f2b023f70 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 30 Apr 2021 09:52:03 -0700 Subject: [PATCH 0107/2268] chore: regenerate README (#1267) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-30 16:40:12,952 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-30 16:40:14,628 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/f910b79d-d081-435c-b7b6-5b16f1edd814/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 22b57b8bae..110f51e6ad 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "bc6075b1eefaf9a65fc5f4d27ab8a7b76d499d35" + "sha": "fc3059eaecde25932cf2154affa8cea80a7824ee" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a648ce0ca3fe122b3186d7e6861cb641437e485e" + "sha": "06a8cd0ff7e81b05e6c503eab510ec622384caa7" } } ] diff --git a/README.md b/README.md index 89fe693fe1..8e743a4c8b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.1.0 + 20.2.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.1.0') +implementation platform('com.google.cloud:libraries-bom:20.2.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From 3a413cd9f680fbfb68a6f2dc45b28f7cb8098a1c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 17:02:04 +0000 Subject: [PATCH 0108/2268] chore: release 1.128.3-SNAPSHOT (#1268) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 21b212b143..046f3f56d8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.2 + 1.128.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bae500efd7..6b7f97588b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.2 + 1.128.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.2 + 1.128.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a07e6e8881..06ac51ba80 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.2 + 1.128.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.2 + 1.128.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0d561eb4d8..2a175d5d2c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.2 + 1.128.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index c0a859f422..ba8d6839e4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.2:1.128.2 \ No newline at end of file +google-cloud-bigquery:1.128.2:1.128.3-SNAPSHOT \ No newline at end of file From f006fa9b4e5029c6eaa0440308c33f7c6b963b50 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Apr 2021 19:47:54 +0200 Subject: [PATCH 0109/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.24.0 (#1269) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fa88de1478..2ba3364212 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.23.2 + 1.24.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2a175d5d2c..15b55e208b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.23.2 + 1.24.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a673300c1d..02d82b0d03 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.23.2 + 1.24.0 test From 52b7627c906c4ca438c1f72489fa0193ca2a4c8a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:00:04 +0000 Subject: [PATCH 0110/2268] chore: release 1.128.3 (#1270) :robot: I have created a release \*beep\* \*boop\* --- ### [1.128.3](https://www.github.com/googleapis/java-bigquery/compare/v1.128.2...v1.128.3) (2021-04-30) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.24.0 ([#1269](https://www.github.com/googleapis/java-bigquery/issues/1269)) ([f006fa9](https://www.github.com/googleapis/java-bigquery/commit/f006fa9b4e5029c6eaa0440308c33f7c6b963b50)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d04399caf6..00675d5be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.128.3](https://www.github.com/googleapis/java-bigquery/compare/v1.128.2...v1.128.3) (2021-04-30) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.24.0 ([#1269](https://www.github.com/googleapis/java-bigquery/issues/1269)) ([f006fa9](https://www.github.com/googleapis/java-bigquery/commit/f006fa9b4e5029c6eaa0440308c33f7c6b963b50)) + ### [1.128.2](https://www.github.com/googleapis/java-bigquery/compare/v1.128.1...v1.128.2) (2021-04-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 046f3f56d8..307a9718cd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.3-SNAPSHOT + 1.128.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6b7f97588b..3e3c23feec 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.3-SNAPSHOT + 1.128.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.3-SNAPSHOT + 1.128.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 06ac51ba80..2edc074664 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.3-SNAPSHOT + 1.128.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.3-SNAPSHOT + 1.128.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 15b55e208b..43a7a4a2ba 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.3-SNAPSHOT + 1.128.3 diff --git a/versions.txt b/versions.txt index ba8d6839e4..bb467c4869 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.2:1.128.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.128.3:1.128.3 \ No newline at end of file From 380e187e342a124c689ec826a020f4314e086172 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 30 Apr 2021 11:02:04 -0700 Subject: [PATCH 0111/2268] chore: regenerate README (#1271) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-04-30 17:50:05,966 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-04-30 17:50:07,407 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/2855025d-e963-4a23-94bf-a0645fe78cae/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 110f51e6ad..f195d564e4 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "fc3059eaecde25932cf2154affa8cea80a7824ee" + "sha": "f006fa9b4e5029c6eaa0440308c33f7c6b963b50" } }, { diff --git a/README.md b/README.md index 8e743a4c8b..470a3a9f37 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.128.1' +compile 'com.google.cloud:google-cloud-bigquery:1.128.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.2" ``` ## Authentication From 3beb7f7ecbca3945c7dfbee930326a4bef0d2a45 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Apr 2021 18:12:04 +0000 Subject: [PATCH 0112/2268] chore: release 1.128.4-SNAPSHOT (#1272) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 307a9718cd..140992cb19 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.3 + 1.128.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3e3c23feec..5e3a566e3c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.3 + 1.128.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.3 + 1.128.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2edc074664..0d5110c798 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.3 + 1.128.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.3 + 1.128.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 43a7a4a2ba..d513ead76b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.3 + 1.128.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index bb467c4869..d9e9a4af7b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.3:1.128.3 \ No newline at end of file +google-cloud-bigquery:1.128.3:1.128.4-SNAPSHOT \ No newline at end of file From ec2c634f1ea23e72b331852d1ec73b4f72087bc4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 1 May 2021 03:58:03 +0200 Subject: [PATCH 0113/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.1.2 (#1273) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.apache.maven.plugins:maven-project-info-reports-plugin | `3.1.1` -> `3.1.2` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.1.2/compatibility-slim/3.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.1.2/confidence-slim/3.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d5110c798..8173f97159 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.1.1 + 3.1.2 From b5eaf35914c590148fb9a1bef99bee94af4b727a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 30 Apr 2021 19:12:03 -0700 Subject: [PATCH 0114/2268] chore: regenerate README (#1276) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-01 02:00:22,770 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-01 02:00:24,189 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/181be0c3-4475-450e-8cb8-7f03b9e27579/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index f195d564e4..df1add319a 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "f006fa9b4e5029c6eaa0440308c33f7c6b963b50" + "sha": "ec2c634f1ea23e72b331852d1ec73b4f72087bc4" } }, { diff --git a/README.md b/README.md index 470a3a9f37..084512e523 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.128.2' +compile 'com.google.cloud:google-cloud-bigquery:1.128.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.3" ``` ## Authentication From 70ca2652fd5843d9c8107d2317fa699bd0c9fca3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 2 May 2021 01:49:10 +0200 Subject: [PATCH 0115/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.128.3 (#1274) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2ba3364212..b9263fd9ab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.128.1 + 1.128.3 From 2a9c29b9bf4375dfa280e682908c32a13c3394b0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 1 May 2021 17:02:02 -0700 Subject: [PATCH 0116/2268] chore: regenerate README (#1277) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-01 23:51:21,863 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-01 23:51:23,255 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/38bbbe88-fe9d-491a-bbde-1a8833099c5e/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index df1add319a..64bf08ba2f 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "ec2c634f1ea23e72b331852d1ec73b4f72087bc4" + "sha": "70ca2652fd5843d9c8107d2317fa699bd0c9fca3" } }, { diff --git a/README.md b/README.md index 084512e523..f8d02882d2 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.128.1 + 1.128.3 ``` From a58dd7cd8c78104372429563ed35528666b817d7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 3 May 2021 16:36:45 -0700 Subject: [PATCH 0117/2268] build(java): switch to release-please for release tagging (#1279) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/02640c73-50fd-4b43-859f-63635b704c9d/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/release-please.yml | 10 ++++++---- synth.metadata | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index 807174cce1..c7b756e1bf 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,6 +1,8 @@ -releaseType: java-yoshi -bumpMinorPreMajor: true branches: -- releaseType: java-lts +- branch: 1.127.12-sp bumpMinorPreMajor: true - branch: 1.127.12-sp \ No newline at end of file + handleGHRelease: true + releaseType: java-lts +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/synth.metadata b/synth.metadata index 834585a7fb..c6c84502bf 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "b9fd26f2a887ed371c7974d6a48e36d03a95e088" + "sha": "2a9c29b9bf4375dfa280e682908c32a13c3394b0" } }, { @@ -40,7 +40,6 @@ ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", ".kokoro/continuous/readme.cfg", - ".kokoro/dependencies.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", From 89958e9b5e4330b31878aa31b90569d2fd0310f2 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 4 May 2021 11:14:02 -0400 Subject: [PATCH 0118/2268] feat: add support for user defined TVFs (#1278) Allow BigQuery client library users to define table-valued functions (TVFs) that return table data. --- .../clirr-ignored-differences.xml | 2 +- .../com/google/cloud/bigquery/Routine.java | 6 ++ .../google/cloud/bigquery/RoutineInfo.java | 26 +++++++ .../cloud/bigquery/StandardSQLTableType.java | 70 +++++++++++++++++++ .../google/cloud/bigquery/RoutineTest.java | 25 +++++++ .../bigquery/StandardSQLTableTypeTest.java | 60 ++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 30 ++++++++ 7 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTableType.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 6c1fd8cd6c..bebc7e25ca 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -5,6 +5,6 @@ 7013 com/google/cloud/bigquery/RoutineInfo$Builder - com.google.cloud.bigquery.RoutineInfo$Builder setDeterminismLevel(java.lang.String) + com.google.cloud.bigquery.RoutineInfo$Builder setReturnTableType(com.google.cloud.bigquery.StandardSQLTableType) \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java index 2fbf1d67d8..a5232c3f91 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java @@ -111,6 +111,12 @@ public Builder setReturnType(StandardSQLDataType returnType) { return this; } + @Override + public Builder setReturnTableType(StandardSQLTableType returnTableType) { + infoBuilder.setReturnTableType(returnTableType); + return this; + } + @Override public Builder setImportedLibraries(List libraries) { infoBuilder.setImportedLibraries(libraries); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java index 1f9c252d2c..daa7455777 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java @@ -67,6 +67,7 @@ public Routine apply(RoutineInfo routineInfo) { private final String language; private final List argumentList; private final StandardSQLDataType returnType; + private final StandardSQLTableType returnTableType; private final List importedLibrariesList; private final String body; @@ -113,6 +114,9 @@ public abstract static class Builder { */ public abstract Builder setReturnType(StandardSQLDataType returnType); + /** Optional. Set only if Routine is a "TABLE_VALUED_FUNCTION". */ + public abstract Builder setReturnTableType(StandardSQLTableType returnTableType); + /** * Optional. If language = "JAVASCRIPT", this field stores the path of the imported JAVASCRIPT * libraries as a list of gs:// URLs. @@ -159,6 +163,7 @@ static class BuilderImpl extends Builder { private String language; private List argumentList; private StandardSQLDataType returnType; + private StandardSQLTableType returnTableType; private List importedLibrariesList; private String body; @@ -175,6 +180,7 @@ static class BuilderImpl extends Builder { this.language = routineInfo.language; this.argumentList = routineInfo.argumentList; this.returnType = routineInfo.returnType; + this.returnTableType = routineInfo.returnTableType; this.importedLibrariesList = routineInfo.importedLibrariesList; this.body = routineInfo.body; } @@ -195,6 +201,9 @@ static class BuilderImpl extends Builder { if (routinePb.getReturnType() != null) { this.returnType = StandardSQLDataType.fromPb(routinePb.getReturnType()); } + if (routinePb.getReturnTableType() != null) { + this.returnTableType = StandardSQLTableType.fromPb(routinePb.getReturnTableType()); + } if (routinePb.getImportedLibraries() == null) { this.importedLibrariesList = Collections.emptyList(); } else { @@ -263,6 +272,12 @@ public Builder setReturnType(StandardSQLDataType returnType) { return this; } + @Override + public Builder setReturnTableType(StandardSQLTableType returnTableType) { + this.returnTableType = returnTableType; + return this; + } + @Override public Builder setImportedLibraries(List importedLibrariesList) { this.importedLibrariesList = importedLibrariesList; @@ -292,6 +307,7 @@ public RoutineInfo build() { this.language = builder.language; this.argumentList = builder.argumentList; this.returnType = builder.returnType; + this.returnTableType = builder.returnTableType; this.importedLibrariesList = builder.importedLibrariesList; this.body = builder.body; } @@ -350,6 +366,11 @@ public StandardSQLDataType getReturnType() { return returnType; } + /** If specified, returns the table type returned from the routine. */ + public StandardSQLTableType getReturnTableType() { + return returnTableType; + } + /** * Returns the list of imported libraries for the routine. Only relevant for routines implemented * using the JAVASCRIPT language. @@ -381,6 +402,7 @@ public String toString() { .add("language", language) .add("arguments", argumentList) .add("returnType", returnType) + .add("returnTableType", returnTableType) .add("importedLibrariesList", importedLibrariesList) .add("body", body) .toString(); @@ -399,6 +421,7 @@ public int hashCode() { language, argumentList, returnType, + returnTableType, importedLibrariesList, body); } @@ -448,6 +471,9 @@ Routine toPb() { if (getReturnType() != null) { routinePb.setReturnType(getReturnType().toPb()); } + if (getReturnTableType() != null) { + routinePb.setReturnTableType(getReturnTableType().toPb()); + } return routinePb; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTableType.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTableType.java new file mode 100644 index 0000000000..d44f89f922 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTableType.java @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.StandardSqlTableType; +import com.google.auto.value.AutoValue; +import com.google.common.collect.Lists; +import java.io.Serializable; +import java.util.List; + +/** Represents Standard SQL table type information. */ +@AutoValue +public abstract class StandardSQLTableType implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + + /** Sets the columns in this table type. */ + public abstract Builder setColumns(List columns); + + /** Creates a {@code StandardSQLTableType} object. */ + public abstract StandardSQLTableType build(); + } + + /** Returns the columns in this table type. */ + public abstract List getColumns(); + + public abstract Builder toBuilder(); + + /** Returns a builder for a {@code StandardSQLTableType} object. */ + public static Builder newBuilder() { + return new AutoValue_StandardSQLTableType.Builder(); + } + + /** Returns a builder for a {@code StandardSQLTableType} object with the specified columns. */ + public static StandardSQLTableType.Builder newBuilder(List columns) { + return newBuilder().setColumns(columns); + } + + static StandardSQLTableType fromPb( + com.google.api.services.bigquery.model.StandardSqlTableType tableTypePb) { + StandardSQLTableType.Builder builder = newBuilder(); + if (tableTypePb.getColumns() != null) { + builder.setColumns( + Lists.transform(tableTypePb.getColumns(), StandardSQLField.FROM_PB_FUNCTION)); + } + return builder.build(); + } + + StandardSqlTableType toPb() { + StandardSqlTableType tableType = new StandardSqlTableType(); + if (getColumns() != null) { + tableType.setColumns(Lists.transform(getColumns(), StandardSQLField.TO_PB_FUNCTION)); + } + return tableType; + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java index f0e29410db..89bed602ee 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java @@ -38,9 +38,11 @@ public class RoutineTest { private static final RoutineId ROUTINE_ID = RoutineId.of("dataset", "routine"); + private static final RoutineId ROUTINE_ID_TVF = RoutineId.of("dataset", "tvf_routine"); private static final String DETERMINISM_LEVEL = "DETERMINISTIC"; private static final String ETAG = "etag"; private static final String ROUTINE_TYPE = "SCALAR_FUNCTION"; + private static final String ROUTINE_TYPE_TVF = "TABLE_VALUED_FUNCTION"; private static final Long CREATION_TIME = 10L; private static final Long LAST_MODIFIED_TIME = 20L; private static final String LANGUAGE = "SQL"; @@ -56,6 +58,18 @@ public class RoutineTest { private static final StandardSQLDataType RETURN_TYPE = StandardSQLDataType.newBuilder("FLOAT64").build(); + private static final StandardSQLField COLUMN_1 = + StandardSQLField.newBuilder("COLUMN_1", StandardSQLDataType.newBuilder("STRING").build()) + .build(); + private static final StandardSQLField COLUMN_2 = + StandardSQLField.newBuilder("COLUMN_2", StandardSQLDataType.newBuilder("FLOAT64").build()) + .build(); + + private static final List COLUMN_LIST = ImmutableList.of(COLUMN_1, COLUMN_2); + + private static final StandardSQLTableType RETURN_TABLE_TYPE = + StandardSQLTableType.newBuilder(COLUMN_LIST).build(); + private static final List IMPORTED_LIBRARIES = ImmutableList.of("gs://foo", "gs://bar", "gs://baz"); @@ -75,11 +89,19 @@ public class RoutineTest { .setBody(BODY) .build(); + private static final RoutineInfo ROUTINE_INFO_TVF = + RoutineInfo.newBuilder(ROUTINE_ID_TVF) + .setBody(BODY) + .setRoutineType(ROUTINE_TYPE_TVF) + .setReturnTableType(RETURN_TABLE_TYPE) + .build(); + @Rule public MockitoRule rule; private BigQuery bigquery; private BigQueryOptions mockOptions; private Routine expectedRoutine; + private Routine expectedRoutineTvf; private Routine routine; @Before @@ -88,6 +110,7 @@ public void setUp() { mockOptions = mock(BigQueryOptions.class); when(bigquery.getOptions()).thenReturn(mockOptions); expectedRoutine = new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO)); + expectedRoutineTvf = new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO_TVF)); routine = new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO)); } @@ -114,6 +137,7 @@ public void testBuilder() { @Test public void testToBuilder() { compareRoutineInfo(expectedRoutine, expectedRoutine.toBuilder().build()); + compareRoutineInfo(expectedRoutineTvf, expectedRoutineTvf.toBuilder().build()); } @Test @@ -200,6 +224,7 @@ public void compareRoutineInfo(RoutineInfo expected, RoutineInfo value) { assertEquals(expected.getLanguage(), value.getLanguage()); assertEquals(expected.getArguments(), value.getArguments()); assertEquals(expected.getReturnType(), value.getReturnType()); + assertEquals(expected.getReturnTableType(), value.getReturnTableType()); assertEquals(expected.getImportedLibraries(), value.getImportedLibraries()); assertEquals(expected.getBody(), value.getBody()); assertEquals(expected.hashCode(), value.hashCode()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java new file mode 100644 index 0000000000..2ed6e35354 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java @@ -0,0 +1,60 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.*; + +import com.google.common.collect.ImmutableList; +import java.util.List; +import org.junit.Test; + +public class StandardSQLTableTypeTest { + + private static final StandardSQLField COLUMN_1 = + StandardSQLField.newBuilder("COLUMN_1", StandardSQLDataType.newBuilder("STRING").build()) + .build(); + private static final StandardSQLField COLUMN_2 = + StandardSQLField.newBuilder("COLUMN_2", StandardSQLDataType.newBuilder("FLOAT64").build()) + .build(); + + private static final List COLUMN_LIST = ImmutableList.of(COLUMN_1, COLUMN_2); + private static final StandardSQLTableType TABLE_TYPE = + StandardSQLTableType.newBuilder(COLUMN_LIST).build(); + + @Test + public void testToBuilder() { + compareStandardSQLTableType(TABLE_TYPE, TABLE_TYPE.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(COLUMN_1, TABLE_TYPE.getColumns().get(0)); + assertEquals(COLUMN_2, TABLE_TYPE.getColumns().get(1)); + } + + @Test + public void testToAndFromPb() { + compareStandardSQLTableType(TABLE_TYPE, StandardSQLTableType.fromPb(TABLE_TYPE.toPb())); + } + + private void compareStandardSQLTableType( + StandardSQLTableType expected, StandardSQLTableType value) { + assertEquals(expected, value); + assertEquals(expected.getColumns(), value.getColumns()); + assertEquals(expected.hashCode(), value.hashCode()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e123fa4467..9b1374bc15 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -87,6 +87,8 @@ import com.google.cloud.bigquery.RoutineInfo; import com.google.cloud.bigquery.Schema; import com.google.cloud.bigquery.StandardSQLDataType; +import com.google.cloud.bigquery.StandardSQLField; +import com.google.cloud.bigquery.StandardSQLTableType; import com.google.cloud.bigquery.StandardTableDefinition; import com.google.cloud.bigquery.Table; import com.google.cloud.bigquery.TableDataWriteChannel; @@ -1676,6 +1678,34 @@ public void testRoutineAPICreationJavascriptUDF() { assertEquals(routine.getReturnType(), StandardSQLDataType.newBuilder("STRING").build()); } + @Test + public void testRoutineAPICreationTVF() { + String routineName = RemoteBigQueryHelper.generateRoutineName(); + RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); + List columns = + ImmutableList.of( + StandardSQLField.newBuilder("x", StandardSQLDataType.newBuilder("INT64").build()) + .build()); + StandardSQLTableType returnTableType = StandardSQLTableType.newBuilder(columns).build(); + RoutineInfo routineInfo = + RoutineInfo.newBuilder(routineId) + .setRoutineType("TABLE_VALUED_FUNCTION") + .setLanguage("SQL") + .setArguments( + ImmutableList.of( + RoutineArgument.newBuilder() + .setName("filter") + .setDataType(StandardSQLDataType.newBuilder("INT64").build()) + .build())) + .setReturnTableType(returnTableType) + .setBody("SELECT x FROM UNNEST([1,2,3]) x WHERE x = filter") + .build(); + Routine routine = bigquery.create(routineInfo); + assertNotNull(routine); + assertEquals(routine.getRoutineType(), "TABLE_VALUED_FUNCTION"); + assertEquals(routine.getReturnTableType(), returnTableType); + } + @Test public void testAuthorizeRoutine() { String routineName = RemoteBigQueryHelper.generateRoutineName(); From acc88c5de445d166055825bf51d56a031e642675 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 May 2021 17:15:34 +0200 Subject: [PATCH 0119/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210422-1.31.0 (#1275) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8173f97159..6ffe0c3592 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210410-1.31.0 + v2-rev20210422-1.31.0 1.0.0
From 3704a6cc46b84ce3b5ba01466ba39333f1b16886 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 5 May 2021 19:08:07 +0200 Subject: [PATCH 0120/2268] deps: update jmh.version to v1.30 (#1281) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 140992cb19..db571bd4ef 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.28 + 1.30 benchmark From 690d80872650ba7f581123ecd7de0ad280bccc50 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 7 May 2021 08:50:06 -0700 Subject: [PATCH 0121/2268] chore: adding cloud-rad java xrefs (#1284) Source-Author: Emily Ball Source-Date: Thu May 6 11:48:47 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 046994f491c02806aea60118e214a9edd67f5ab7 Source-Link: https://github.com/googleapis/synthtool/commit/046994f491c02806aea60118e214a9edd67f5ab7 --- .kokoro/release/publish_javadoc11.sh | 7 +++++++ synth.metadata | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index b519341e0e..f3031aadf2 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -49,6 +49,13 @@ pushd target/docfx-yml python3 -m docuploader create-metadata \ --name ${NAME} \ --version ${VERSION} \ + --xrefs devsite://java/gax \ + --xrefs devsite://java/google-cloud-core \ + --xrefs devsite://java/api-common \ + --xrefs devsite://java/proto-google-common-protos \ + --xrefs devsite://java/google-api-client \ + --xrefs devsite://java/google-http-client \ + --xrefs devsite://java/protobuf \ --language java # upload yml to production bucket diff --git a/synth.metadata b/synth.metadata index c6c84502bf..589e6cb36d 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "2a9c29b9bf4375dfa280e682908c32a13c3394b0" + "sha": "3704a6cc46b84ce3b5ba01466ba39333f1b16886" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8285c2b4cdbc3771d031ad91e1c4ec9e55fff45d" + "sha": "046994f491c02806aea60118e214a9edd67f5ab7" } } ], From e74ae1c180c8ce27c9c8985c1935a894889b6375 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 May 2021 04:17:44 +0200 Subject: [PATCH 0122/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210430-1.31.0 (#1285) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ffe0c3592..f1d927b7d1 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210422-1.31.0 + v2-rev20210430-1.31.0 1.0.0
From 0fdaab4c8c65cf62e222f3c1bdac5e24049c37ad Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 10 May 2021 19:49:47 +0200 Subject: [PATCH 0123/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.3.0 (#1286) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 02d82b0d03..36b4c9a54a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.2.0 + 20.3.0 pom import From 64b00d8998fd31f5e7dff2d075b93af0a00ff3aa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 May 2021 11:06:05 -0700 Subject: [PATCH 0124/2268] chore: regenerate README (#1287) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-10 17:51:57,320 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-10 17:51:58,637 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/cc61bd79-d786-4237-a791-d0e60a08c582/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 64bf08ba2f..e92490e069 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "70ca2652fd5843d9c8107d2317fa699bd0c9fca3" + "sha": "0fdaab4c8c65cf62e222f3c1bdac5e24049c37ad" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "06a8cd0ff7e81b05e6c503eab510ec622384caa7" + "sha": "6726988c677bb78385868bfc48dbfa2fe981d44a" } } ] diff --git a/README.md b/README.md index f8d02882d2..b3ccf6fadc 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.2.0 + 20.3.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.2.0') +implementation platform('com.google.cloud:libraries-bom:20.3.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From e60f2cd823b1551e43154f87a5157acca51b346c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 May 2021 03:19:21 +0200 Subject: [PATCH 0125/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 (#1290) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1d927b7d1..9dc6df2622 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210430-1.31.0 - 1.0.0 + 1.1.0
From 52f0781c101b5c327b352892b7027157ba7705f0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 01:32:20 +0000 Subject: [PATCH 0126/2268] chore: release 1.129.0 (#1280) :robot: I have created a release \*beep\* \*boop\* --- ## [1.129.0](https://www.github.com/googleapis/java-bigquery/compare/v1.128.3...v1.129.0) (2021-05-11) ### Features * add support for user defined TVFs ([#1278](https://www.github.com/googleapis/java-bigquery/issues/1278)) ([89958e9](https://www.github.com/googleapis/java-bigquery/commit/89958e9b5e4330b31878aa31b90569d2fd0310f2)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210422-1.31.0 ([#1275](https://www.github.com/googleapis/java-bigquery/issues/1275)) ([acc88c5](https://www.github.com/googleapis/java-bigquery/commit/acc88c5de445d166055825bf51d56a031e642675)) * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210430-1.31.0 ([#1285](https://www.github.com/googleapis/java-bigquery/issues/1285)) ([e74ae1c](https://www.github.com/googleapis/java-bigquery/commit/e74ae1c180c8ce27c9c8985c1935a894889b6375)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#1290](https://www.github.com/googleapis/java-bigquery/issues/1290)) ([e60f2cd](https://www.github.com/googleapis/java-bigquery/commit/e60f2cd823b1551e43154f87a5157acca51b346c)) * update jmh.version to v1.30 ([#1281](https://www.github.com/googleapis/java-bigquery/issues/1281)) ([3704a6c](https://www.github.com/googleapis/java-bigquery/commit/3704a6cc46b84ce3b5ba01466ba39333f1b16886)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00675d5be0..8b430e7312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [1.129.0](https://www.github.com/googleapis/java-bigquery/compare/v1.128.3...v1.129.0) (2021-05-11) + + +### Features + +* add support for user defined TVFs ([#1278](https://www.github.com/googleapis/java-bigquery/issues/1278)) ([89958e9](https://www.github.com/googleapis/java-bigquery/commit/89958e9b5e4330b31878aa31b90569d2fd0310f2)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210422-1.31.0 ([#1275](https://www.github.com/googleapis/java-bigquery/issues/1275)) ([acc88c5](https://www.github.com/googleapis/java-bigquery/commit/acc88c5de445d166055825bf51d56a031e642675)) +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210430-1.31.0 ([#1285](https://www.github.com/googleapis/java-bigquery/issues/1285)) ([e74ae1c](https://www.github.com/googleapis/java-bigquery/commit/e74ae1c180c8ce27c9c8985c1935a894889b6375)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#1290](https://www.github.com/googleapis/java-bigquery/issues/1290)) ([e60f2cd](https://www.github.com/googleapis/java-bigquery/commit/e60f2cd823b1551e43154f87a5157acca51b346c)) +* update jmh.version to v1.30 ([#1281](https://www.github.com/googleapis/java-bigquery/issues/1281)) ([3704a6c](https://www.github.com/googleapis/java-bigquery/commit/3704a6cc46b84ce3b5ba01466ba39333f1b16886)) + ### [1.128.3](https://www.github.com/googleapis/java-bigquery/compare/v1.128.2...v1.128.3) (2021-04-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index db571bd4ef..d77b5d700a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.128.4-SNAPSHOT + 1.129.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5e3a566e3c..e3e8796aa0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.128.4-SNAPSHOT + 1.129.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.128.4-SNAPSHOT + 1.129.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9dc6df2622..4b3e5c5b02 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.128.4-SNAPSHOT + 1.129.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.128.4-SNAPSHOT + 1.129.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d513ead76b..4bbc539b02 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.128.4-SNAPSHOT + 1.129.0 diff --git a/versions.txt b/versions.txt index d9e9a4af7b..2342fef0c8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.128.3:1.128.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.129.0:1.129.0 \ No newline at end of file From 9b1a2c8c6a0df3ae5cfd7881c2510e779b58e448 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 01:50:05 +0000 Subject: [PATCH 0127/2268] chore: release 1.129.1-SNAPSHOT (#1291) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d77b5d700a..967dcb1ac3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.129.0 + 1.129.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e3e8796aa0..eb6742bc75 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.129.0 + 1.129.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.129.0 + 1.129.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4b3e5c5b02..129fd4db7c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.129.0 + 1.129.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.129.0 + 1.129.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4bbc539b02..443faed03f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.129.0 + 1.129.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 2342fef0c8..ed9c6aa1bb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.129.0:1.129.0 \ No newline at end of file +google-cloud-bigquery:1.129.0:1.129.1-SNAPSHOT \ No newline at end of file From 0ced50f56c8a3cdf0ffaf49da0046af9e57be52b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 May 2021 05:54:23 +0200 Subject: [PATCH 0128/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.129.0 (#1295) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b9263fd9ab..558f4d7bba 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.128.3 + 1.129.0 From aa32938f22e1252e898f339af12b9f6dbbeabdc0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 May 2021 21:08:03 -0700 Subject: [PATCH 0129/2268] chore: regenerate README (#1298) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-11 03:56:38,311 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-11 03:56:40,045 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/324297b9-0cbe-4a7d-9324-696dbe23a2db/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index e92490e069..b044d00c3d 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "0fdaab4c8c65cf62e222f3c1bdac5e24049c37ad" + "sha": "0ced50f56c8a3cdf0ffaf49da0046af9e57be52b" } }, { diff --git a/README.md b/README.md index b3ccf6fadc..fa85ab0d63 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.128.3 + 1.129.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.128.3' +compile 'com.google.cloud:google-cloud-bigquery:1.129.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.128.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.129.0" ``` ## Authentication From 558cb14a4091c9e44dea766b967ecb78132a46c5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 May 2021 06:23:21 +0200 Subject: [PATCH 0130/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-datacatalog-v1 to v1.3.3 (#1296) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 129fd4db7c..c9abc08391 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.3.2 + 1.3.3 test From b6ebd144d25284838447e00e20e7d1d0ca83c76a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 May 2021 18:05:18 +0200 Subject: [PATCH 0131/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.16 (#1294) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 558f4d7bba..5ba89eadaa 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.15 + 1.0.16 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 443faed03f..626e0ba35a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.15 + 1.0.16 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 36b4c9a54a..c8a2877aa4 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.15 + 1.0.16 test From c49e697086f6aaf8271daf799b985b468496c382 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 May 2021 20:06:02 +0200 Subject: [PATCH 0132/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog to v1.3.3 (#1297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog](https://togithub.com/googleapis/java-datacatalog) | `1.3.2` -> `1.3.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.3.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.3.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.3.3/compatibility-slim/1.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.3.3/confidence-slim/1.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-datacatalog ### [`v1.3.3`](https://togithub.com/googleapis/java-datacatalog/blob/master/CHANGELOG.md#​133-httpswwwgithubcomgoogleapisjava-datacatalogcomparev132v133-2021-05-11) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.3.2...v1.3.3)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c9abc08391..7262c0e127 100644 --- a/pom.xml +++ b/pom.xml @@ -124,7 +124,7 @@ com.google.cloud google-cloud-datacatalog - 1.3.2 + 1.3.3 test From 817cf7bbecc920e9866cd85f2b1689926933c4da Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 May 2021 17:58:00 +0200 Subject: [PATCH 0133/2268] deps: update jmh.version to v1.31 (#1303) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 967dcb1ac3..407bf69304 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.30 + 1.31 benchmark From f5ffd94d37e6de994cf73b20727b27f8d16d67b0 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 12 May 2021 14:37:06 -0400 Subject: [PATCH 0134/2268] chore: group data-catalog test dependencies together (#1304) * chore: group data-catalog test dependencies together To avoid upperbounddependency errors when data-catalog updates come in * Update renovate.json * Update synth.py --- renovate.json | 9 +++++++++ synth.py | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index af11317e23..cc3338a4d2 100644 --- a/renovate.json +++ b/renovate.json @@ -66,6 +66,15 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" + }, + { + "packagePatterns": [ + "^com.google.api.grpc:proto-google-cloud-datacatalog", + "^com.google.cloud:google-cloud-datacatalog" + ], + "groupName": "datacatalog dependencies", + "semanticCommitType": "test", + "semanticCommitScope": "deps" } ], "semanticCommits": true, diff --git a/synth.py b/synth.py index 381c973f76..19fbf6010c 100644 --- a/synth.py +++ b/synth.py @@ -27,5 +27,6 @@ '.kokoro/presubmit/java8-samples.cfg', '.kokoro/presubmit/java11-samples.cfg', '.kokoro/dependencies.sh', - 'codecov.yaml' + 'codecov.yaml', + 'renovate.json', ]) From 96363a969f8ac8ffb3627e8a0da69c030dc9f862 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 13 May 2021 20:46:37 +0200 Subject: [PATCH 0135/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.24.1 (#1305) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5ba89eadaa..673bc3508a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.24.0 + 1.24.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 626e0ba35a..4efe45e239 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.24.0 + 1.24.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c8a2877aa4..4010361cb7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.24.0 + 1.24.1 test From 793e4a9d562d4293102983f78913f18dfe488c2d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 May 2021 16:38:33 -0700 Subject: [PATCH 0136/2268] build(java): remove codecov action (#1307) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/a594ce1c-ecb5-4461-8158-ae9fa7d522af/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1 --- .github/workflows/ci.yaml | 6 +----- synth.metadata | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index def8b3a2c8..0195b32f00 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,10 +19,6 @@ jobs: - run: .kokoro/build.sh env: JOB_TYPE: test - - name: coverage - uses: codecov/codecov-action@v1 - with: - name: actions ${{matrix.java}} windows: runs-on: windows-latest steps: @@ -80,4 +76,4 @@ jobs: - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr \ No newline at end of file + JOB_TYPE: clirr diff --git a/synth.metadata b/synth.metadata index 589e6cb36d..59145c3999 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "3704a6cc46b84ce3b5ba01466ba39333f1b16886" + "sha": "96363a969f8ac8ffb3627e8a0da69c030dc9f862" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "046994f491c02806aea60118e214a9edd67f5ab7" + "sha": "4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1" } } ], @@ -82,7 +82,6 @@ "LICENSE", "java.header", "license-checks.xml", - "renovate.json", "samples/install-without-bom/pom.xml", "samples/pom.xml", "samples/snapshot/pom.xml", From 901b18a6ca271f991f7b19951edbe02a0eb267a3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 14 May 2021 16:58:55 +0200 Subject: [PATCH 0137/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.17 (#1308) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 673bc3508a..e319ac2f6c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.16 + 1.0.17 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4efe45e239..d90d1a89c5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.16 + 1.0.17 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4010361cb7..c8449170b8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.16 + 1.0.17 test From b909754b4c828871c8b360d0ddf69cc488b1d33c Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 14 May 2021 15:06:07 -0400 Subject: [PATCH 0138/2268] feat: add support for partitioning and clustering in MaterializedViewDefinition (#1301) Towards #1300 --- .../clirr-ignored-differences.xml | 29 +++++++++- .../bigquery/MaterializedViewDefinition.java | 58 +++++++++++++++++++ .../MaterializedViewDefinitionTest.java | 11 ++++ 3 files changed, 96 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index bebc7e25ca..d8b1ba813b 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -4,7 +4,32 @@ 7013 - com/google/cloud/bigquery/RoutineInfo$Builder - com.google.cloud.bigquery.RoutineInfo$Builder setReturnTableType(com.google.cloud.bigquery.StandardSQLTableType) + com/google/cloud/bigquery/MaterializedViewDefinition + com.google.cloud.bigquery.Clustering getClustering() + + + 7013 + com/google/cloud/bigquery/MaterializedViewDefinition + com.google.cloud.bigquery.RangePartitioning getRangePartitioning() + + + 7013 + com/google/cloud/bigquery/MaterializedViewDefinition + com.google.cloud.bigquery.TimePartitioning getTimePartitioning() + + + 7013 + com/google/cloud/bigquery/MaterializedViewDefinition$Builder + com.google.cloud.bigquery.MaterializedViewDefinition$Builder setClustering(com.google.cloud.bigquery.Clustering) + + + 7013 + com/google/cloud/bigquery/MaterializedViewDefinition$Builder + com.google.cloud.bigquery.MaterializedViewDefinition$Builder setRangePartitioning(com.google.cloud.bigquery.RangePartitioning) + + + 7013 + com/google/cloud/bigquery/MaterializedViewDefinition$Builder + com.google.cloud.bigquery.MaterializedViewDefinition$Builder setTimePartitioning(com.google.cloud.bigquery.TimePartitioning) \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MaterializedViewDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MaterializedViewDefinition.java index bf3a913a9c..69712bb3dd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MaterializedViewDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MaterializedViewDefinition.java @@ -57,6 +57,25 @@ public abstract static class Builder @Override public abstract Builder setType(Type type); + /** + * Sets the time partitioning configuration for the materialized view. If not set, the + * materialized view is not time-partitioned. + */ + public abstract Builder setTimePartitioning(TimePartitioning timePartitioning); + + /** + * Sets the range partitioning configuration for the materialized view. Only one of + * timePartitioning and rangePartitioning should be specified. + */ + public abstract Builder setRangePartitioning(RangePartitioning rangePartitioning); + + /** + * Set the clustering configuration for the materialized view. If not set, the materialized view + * is not clustered. BigQuery supports clustering for both partitioned and non-partitioned + * materialized views. + */ + public abstract Builder setClustering(Clustering clustering); + /** Creates a {@code MaterializedViewDefinition} object. */ @Override public abstract MaterializedViewDefinition build(); @@ -86,6 +105,27 @@ public abstract static class Builder @Nullable public abstract Long getRefreshIntervalMs(); + /** + * Returns the time partitioning configuration for this table. If {@code null}, the table is not + * time-partitioned. + */ + @Nullable + public abstract TimePartitioning getTimePartitioning(); + + /** + * Returns the range partitioning configuration for this table. If {@code null}, the table is not + * range-partitioned. + */ + @Nullable + public abstract RangePartitioning getRangePartitioning(); + + /** + * Returns the clustering configuration for this table. If {@code null}, the table is not + * clustered. + */ + @Nullable + public abstract Clustering getClustering(); + /** Returns a builder for the {@code MaterializedViewDefinition} object. */ public abstract Builder toBuilder(); @@ -107,6 +147,15 @@ Table toPb() { materializedViewDefinition.setRefreshIntervalMs(getRefreshIntervalMs()); } tablePb.setMaterializedView(materializedViewDefinition); + if (getTimePartitioning() != null) { + tablePb.setTimePartitioning(getTimePartitioning().toPb()); + } + if (getRangePartitioning() != null) { + tablePb.setRangePartitioning(getRangePartitioning().toPb()); + } + if (getClustering() != null) { + tablePb.setClustering(getClustering().toPb()); + } return tablePb; } @@ -149,6 +198,15 @@ static MaterializedViewDefinition fromPb(Table tablePb) { if (materializedViewDefinition.getRefreshIntervalMs() != null) { builder.setRefreshIntervalMs(materializedViewDefinition.getRefreshIntervalMs()); } + if (tablePb.getTimePartitioning() != null) { + builder.setTimePartitioning(TimePartitioning.fromPb(tablePb.getTimePartitioning())); + } + if (tablePb.getRangePartitioning() != null) { + builder.setRangePartitioning(RangePartitioning.fromPb(tablePb.getRangePartitioning())); + } + if (tablePb.getClustering() != null) { + builder.setClustering(Clustering.fromPb(tablePb.getClustering())); + } } return builder.build(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java index ab1caab07e..eef4324a0e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.google.common.collect.ImmutableList; import org.junit.Test; public class MaterializedViewDefinitionTest { @@ -28,6 +29,10 @@ public class MaterializedViewDefinitionTest { private static final Boolean ENABLE_REFRESH = false; private static final Long REFRESH_INTERVAL_MS = 60000L; private static final Schema SCHEMA = Schema.of(); + private static final TimePartitioning TIME_PARTITIONING = + TimePartitioning.of(TimePartitioning.Type.DAY, 42); + private static final Clustering CLUSTERING = + Clustering.newBuilder().setFields(ImmutableList.of("Foo", "Bar")).build(); private static final MaterializedViewDefinition MATERIALIZED_VIEW_DEFINITION = MaterializedViewDefinition.newBuilder() .setSchema(SCHEMA) @@ -35,6 +40,8 @@ public class MaterializedViewDefinitionTest { .setLastRefreshTime(LAST_REFRESH_TIME) .setEnableRefresh(ENABLE_REFRESH) .setRefreshIntervalMs(REFRESH_INTERVAL_MS) + .setClustering(CLUSTERING) + .setTimePartitioning(TIME_PARTITIONING) .build(); @Test @@ -68,6 +75,8 @@ public void testBuilder() { .setLastRefreshTime(LAST_REFRESH_TIME) .setEnableRefresh(ENABLE_REFRESH) .setRefreshIntervalMs(REFRESH_INTERVAL_MS) + .setClustering(CLUSTERING) + .setTimePartitioning(TIME_PARTITIONING) .build(); assertEquals(MATERIALIZED_VIEW_DEFINITION, materializedViewDefinition); } @@ -92,6 +101,8 @@ private void compareMaterializedView( assertEquals(expected.getLastRefreshTime(), actual.getLastRefreshTime()); assertEquals(expected.getEnableRefresh(), actual.getEnableRefresh()); assertEquals(expected.getRefreshIntervalMs(), actual.getRefreshIntervalMs()); + assertEquals(expected.getClustering(), actual.getClustering()); + assertEquals(expected.getTimePartitioning(), actual.getTimePartitioning()); assertEquals(expected.toString(), actual.toString()); assertEquals(expected.hashCode(), actual.hashCode()); assertEquals(expected, actual); From 2d32778f1127d98b3ed25dc229c684fff7530187 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 16 May 2021 00:16:02 +0200 Subject: [PATCH 0139/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.4.0 (#1311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.3.0` -> `20.4.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/compatibility-slim/20.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/20.4.0/confidence-slim/20.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c8449170b8..9d8e613961 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.3.0 + 20.4.0 pom import From e8e9b22f4931610bbc3bf2e4ff84f5d6aaea951f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 15 May 2021 15:28:02 -0700 Subject: [PATCH 0140/2268] chore: regenerate README (#1312) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-15 22:18:15,574 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-15 22:18:16,886 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/376c2ab0-593d-48b9-aac5-12ae81449219/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b044d00c3d..9b557a9344 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "0ced50f56c8a3cdf0ffaf49da0046af9e57be52b" + "sha": "2d32778f1127d98b3ed25dc229c684fff7530187" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6726988c677bb78385868bfc48dbfa2fe981d44a" + "sha": "4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1" } } ] diff --git a/README.md b/README.md index fa85ab0d63..071a2083cf 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.3.0 + 20.4.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.3.0') +implementation platform('com.google.cloud:libraries-bom:20.4.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From b390c7d78d6f53e834d1a63b995c94ad6bffe843 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 15 May 2021 20:23:04 -0400 Subject: [PATCH 0141/2268] chore: release 1.130.0 (#1299) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b430e7312..804e745a3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [1.130.0](https://www.github.com/googleapis/java-bigquery/compare/v1.129.0...v1.130.0) (2021-05-15) + + +### Features + +* add support for partitioning and clustering in MaterializedViewDefinition ([#1301](https://www.github.com/googleapis/java-bigquery/issues/1301)) ([b909754](https://www.github.com/googleapis/java-bigquery/commit/b909754b4c828871c8b360d0ddf69cc488b1d33c)), closes [#1300](https://www.github.com/googleapis/java-bigquery/issues/1300) + + +### Dependencies + +* update dependency com.google.api.grpc:proto-google-cloud-datacatalog-v1 to v1.3.3 ([#1296](https://www.github.com/googleapis/java-bigquery/issues/1296)) ([558cb14](https://www.github.com/googleapis/java-bigquery/commit/558cb14a4091c9e44dea766b967ecb78132a46c5)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.24.1 ([#1305](https://www.github.com/googleapis/java-bigquery/issues/1305)) ([96363a9](https://www.github.com/googleapis/java-bigquery/commit/96363a969f8ac8ffb3627e8a0da69c030dc9f862)) +* update dependency com.google.cloud:google-cloud-datacatalog to v1.3.3 ([#1297](https://www.github.com/googleapis/java-bigquery/issues/1297)) ([c49e697](https://www.github.com/googleapis/java-bigquery/commit/c49e697086f6aaf8271daf799b985b468496c382)) +* update jmh.version to v1.31 ([#1303](https://www.github.com/googleapis/java-bigquery/issues/1303)) ([817cf7b](https://www.github.com/googleapis/java-bigquery/commit/817cf7bbecc920e9866cd85f2b1689926933c4da)) + ## [1.129.0](https://www.github.com/googleapis/java-bigquery/compare/v1.128.3...v1.129.0) (2021-05-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 407bf69304..58e584c594 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.129.1-SNAPSHOT + 1.130.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index eb6742bc75..ebc492e4ae 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.129.1-SNAPSHOT + 1.130.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.129.1-SNAPSHOT + 1.130.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7262c0e127..64d0675b6e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.129.1-SNAPSHOT + 1.130.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.129.1-SNAPSHOT + 1.130.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d90d1a89c5..d79b9922b2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.129.1-SNAPSHOT + 1.130.0 diff --git a/versions.txt b/versions.txt index ed9c6aa1bb..f2233d704b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.129.0:1.129.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.130.0:1.130.0 \ No newline at end of file From 85a9cfb287a12561b8e38c838bb6f20ab0a8e51e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 16 May 2021 00:34:02 +0000 Subject: [PATCH 0142/2268] chore: release 1.130.1-SNAPSHOT (#1313) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 58e584c594..ad56c26aab 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.130.0 + 1.130.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ebc492e4ae..c15b390d88 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.130.0 + 1.130.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.130.0 + 1.130.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 64d0675b6e..c816b3b6a5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.130.0 + 1.130.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.130.0 + 1.130.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d79b9922b2..b16cea7c0a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.130.0 + 1.130.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index f2233d704b..a164b9c420 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.130.0:1.130.0 \ No newline at end of file +google-cloud-bigquery:1.130.0:1.130.1-SNAPSHOT \ No newline at end of file From 0c7a566ee6e88381821bfe0ee195d12b131b0147 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 17 May 2021 17:12:08 +0200 Subject: [PATCH 0143/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.130.0 (#1315) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e319ac2f6c..23eb110de0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.129.0 + 1.130.0 From 72568a031768207a28f5b5727f7af752b4e2a373 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 17 May 2021 08:24:02 -0700 Subject: [PATCH 0144/2268] chore: regenerate README (#1316) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-17 15:14:22,774 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-17 15:14:24,204 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/f2184ffb-5979-4302-a748-5912ceaef803/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 9b557a9344..6061373ff1 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "2d32778f1127d98b3ed25dc229c684fff7530187" + "sha": "0c7a566ee6e88381821bfe0ee195d12b131b0147" } }, { diff --git a/README.md b/README.md index 071a2083cf..8eb1b7d439 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.129.0 + 1.130.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.129.0' +compile 'com.google.cloud:google-cloud-bigquery:1.130.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.129.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.130.0" ``` ## Authentication From 1586b02bce57c599e4db615f131befe0630f3b86 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 17 May 2021 15:16:41 -0700 Subject: [PATCH 0145/2268] chore: add changelog to cloud-rad (#1317) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5ec6b1c0-22fb-4828-9bc0-9523eb988bb2/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/c86c7a60985644eab557949363a38301d40d78d2 --- .kokoro/release/publish_javadoc11.sh | 2 ++ synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index f3031aadf2..10fe72d411 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -42,6 +42,8 @@ mvn clean site -B -q -P docFX # copy README to docfx-yml dir and rename index.md cp README.md target/docfx-yml/index.md +# copy CHANGELOG to docfx-yml dir and rename history.md +cp CHANGELOG.md target/docfx-yml/history.md pushd target/docfx-yml diff --git a/synth.metadata b/synth.metadata index 59145c3999..4761d127af 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "96363a969f8ac8ffb3627e8a0da69c030dc9f862" + "sha": "72568a031768207a28f5b5727f7af752b4e2a373" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1" + "sha": "c86c7a60985644eab557949363a38301d40d78d2" } } ], From 72b17151c4f3c4a3d298d3791e58c3112a14b4f5 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 18 May 2021 14:06:34 -0400 Subject: [PATCH 0146/2268] feat: add ParquetOptions support and expose it in LoadJobConfiguration and ExternalTableDefinition classes (#1318) * feat: add ParquetOptions support and expose it in LoadJobConfiguration and ExternalTableDefinition classes Fixes #1302 * update IT --- .../bigquery/ExternalTableDefinition.java | 8 ++ .../google/cloud/bigquery/FormatOptions.java | 2 + .../cloud/bigquery/LoadJobConfiguration.java | 8 ++ .../google/cloud/bigquery/ParquetOptions.java | 127 ++++++++++++++++++ .../cloud/bigquery/ParquetOptionsTest.java | 67 +++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 7 + 6 files changed, 219 insertions(+) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 5eb0f4c575..1d2cfa2939 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -449,6 +449,10 @@ static ExternalTableDefinition fromPb(Table tablePb) { builder.setFormatOptions( BigtableOptions.fromPb(externalDataConfiguration.getBigtableOptions())); } + if (externalDataConfiguration.getParquetOptions() != null) { + builder.setFormatOptions( + ParquetOptions.fromPb(externalDataConfiguration.getParquetOptions())); + } builder.setMaxBadRecords(externalDataConfiguration.getMaxBadRecords()); builder.setAutodetect(externalDataConfiguration.getAutodetect()); if (externalDataConfiguration.getHivePartitioningOptions() != null) { @@ -491,6 +495,10 @@ static ExternalTableDefinition fromExternalDataConfiguration( builder.setFormatOptions( BigtableOptions.fromPb(externalDataConfiguration.getBigtableOptions())); } + if (externalDataConfiguration.getParquetOptions() != null) { + builder.setFormatOptions( + ParquetOptions.fromPb(externalDataConfiguration.getParquetOptions())); + } if (externalDataConfiguration.getMaxBadRecords() != null) { builder.setMaxBadRecords(externalDataConfiguration.getMaxBadRecords()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java index af1878455c..92a57fc8f0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java @@ -126,6 +126,8 @@ public static FormatOptions of(String format) { return googleSheets(); } else if (format.equals(BIGTABLE)) { return bigtable(); + } else if (format.equals(PARQUET)) { + return parquet(); } return new FormatOptions(format); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 0eae67bd66..a317f1285f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -390,6 +390,10 @@ public CsvOptions getCsvOptions() { return formatOptions instanceof CsvOptions ? (CsvOptions) formatOptions : null; } + public ParquetOptions getParquetOptions() { + return formatOptions instanceof ParquetOptions ? (ParquetOptions) formatOptions : null; + } + @Override public DatastoreBackupOptions getDatastoreBackupOptions() { return formatOptions instanceof DatastoreBackupOptions @@ -545,6 +549,10 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { loadConfigurationPb.setSkipLeadingRows(Ints.checkedCast(csvOptions.getSkipLeadingRows())); } } + if (getParquetOptions() != null) { + ParquetOptions parquetOptions = getParquetOptions(); + loadConfigurationPb.setParquetOptions(parquetOptions.toPb()); + } if (schema != null) { loadConfigurationPb.setSchema(schema.toPb()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java new file mode 100644 index 0000000000..174da41d86 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java @@ -0,0 +1,127 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.common.base.MoreObjects; +import java.util.Objects; + +public class ParquetOptions extends FormatOptions { + + private static final long serialVersionUID = 1992L; + + private final Boolean enableListInference; + private final Boolean enumAsString; + + public Boolean getEnableListInference() { + return enableListInference; + } + + public Boolean getEnumAsString() { + return enumAsString; + } + + /** A builder for {@code ParquetOptions} objects. */ + public static final class Builder { + private Boolean enableListInference; + private Boolean enumAsString; + + private Builder() {} + + private Builder(ParquetOptions parquetOptions) { + this.enableListInference = parquetOptions.enableListInference; + this.enumAsString = parquetOptions.enumAsString; + } + + public Builder setEnableListInference(Boolean enableListInference) { + this.enableListInference = enableListInference; + return this; + } + + public Builder setEnumAsString(Boolean enumAsString) { + this.enumAsString = enumAsString; + return this; + } + + public ParquetOptions build() { + return new ParquetOptions(this); + } + } + /** Returns a builder for the {@link ParquetOptions} object. */ + public Builder toBuilder() { + return new Builder(this); + } + + ParquetOptions(Builder builder) { + super(FormatOptions.PARQUET); + enableListInference = builder.enableListInference; + enumAsString = builder.enumAsString; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("enableListInference", enableListInference) + .add("enumAsString", enumAsString) + .toString(); + } + + @Override + public final int hashCode() { + return Objects.hash(enableListInference, enumAsString); + } + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || !obj.getClass().equals(ParquetOptions.class)) { + return false; + } + ParquetOptions other = (ParquetOptions) obj; + return enableListInference == other.enableListInference && enumAsString == other.enumAsString; + } + + /** Returns a builder for a {@link ParquetOptions} object. */ + public static ParquetOptions.Builder newBuilder() { + return new ParquetOptions.Builder(); + } + + static ParquetOptions fromPb( + com.google.api.services.bigquery.model.ParquetOptions parquetOptions) { + Builder builder = newBuilder(); + if (parquetOptions.getEnableListInference() != null) { + builder.setEnableListInference(parquetOptions.getEnableListInference()); + } + if (parquetOptions.getEnumAsString() != null) { + builder.setEnumAsString(parquetOptions.getEnumAsString()); + } + return builder.build(); + } + + com.google.api.services.bigquery.model.ParquetOptions toPb() { + com.google.api.services.bigquery.model.ParquetOptions parquetOptions = + new com.google.api.services.bigquery.model.ParquetOptions(); + if (enableListInference != null) { + parquetOptions.setEnableListInference(enableListInference); + } + if (enumAsString != null) { + parquetOptions.setEnumAsString(enumAsString); + } + return parquetOptions; + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java new file mode 100644 index 0000000000..8812b2e274 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class ParquetOptionsTest { + + private static final ParquetOptions OPTIONS = + ParquetOptions.newBuilder().setEnableListInference(true).setEnumAsString(true).build(); + + @Test + public void testToBuilder() { + compareParquetOptions(OPTIONS, OPTIONS.toBuilder().build()); + ParquetOptions parquetOptions = OPTIONS.toBuilder().setEnableListInference(true).build(); + assertEquals(true, parquetOptions.getEnableListInference()); + parquetOptions = parquetOptions.toBuilder().setEnumAsString(true).build(); + compareParquetOptions(OPTIONS, parquetOptions); + } + + @Test + public void testToBuilderIncomplete() { + ParquetOptions parquetOptions = + ParquetOptions.newBuilder().setEnableListInference(true).build(); + assertEquals(parquetOptions, parquetOptions.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(FormatOptions.PARQUET, OPTIONS.getType()); + assertEquals(true, OPTIONS.getEnableListInference()); + assertEquals(true, OPTIONS.getEnumAsString()); + } + + @Test + public void testToAndFromPb() { + compareParquetOptions(OPTIONS, ParquetOptions.fromPb(OPTIONS.toPb())); + ParquetOptions parquetOptions = + ParquetOptions.newBuilder().setEnableListInference(true).build(); + compareParquetOptions(parquetOptions, ParquetOptions.fromPb(parquetOptions.toPb())); + } + + private void compareParquetOptions(ParquetOptions expected, ParquetOptions actual) { + assertThat(expected).isEqualTo(actual); + assertThat(expected.getEnableListInference()).isEqualTo(actual.getEnableListInference()); + assertThat(expected.getEnumAsString()).isEqualTo(actual.getEnumAsString()); + assertThat(expected.hashCode()).isEqualTo(actual.hashCode()); + assertThat(expected.toString()).isEqualTo(actual.toString()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9b1374bc15..eae807bf74 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -77,6 +77,7 @@ import com.google.cloud.bigquery.Model; import com.google.cloud.bigquery.ModelId; import com.google.cloud.bigquery.ModelInfo; +import com.google.cloud.bigquery.ParquetOptions; import com.google.cloud.bigquery.PolicyTags; import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.QueryParameterValue; @@ -1840,10 +1841,13 @@ public void testQueryExternalHivePartitioningOptionAutoLayout() throws Interrupt .setSourceUriPrefix(sourceUriPrefix) .build(); TableId tableId = TableId.of(DATASET, tableName); + ParquetOptions parquetOptions = + ParquetOptions.newBuilder().setEnableListInference(true).setEnumAsString(true).build(); ExternalTableDefinition externalTable = ExternalTableDefinition.newBuilder(sourceUri, FormatOptions.parquet()) .setAutodetect(true) .setHivePartitioningOptions(hivePartitioningOptions) + .setFormatOptions(parquetOptions) .build(); assertNotNull(bigquery.create(TableInfo.of(tableId, externalTable))); String query = @@ -1866,6 +1870,8 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/hive-partitioning-samples/customlayout/{pkey:STRING}/"; + ParquetOptions parquetOptions = + ParquetOptions.newBuilder().setEnableListInference(true).setEnumAsString(true).build(); HivePartitioningOptions hivePartitioningOptions = HivePartitioningOptions.newBuilder() .setMode("CUSTOM") @@ -1877,6 +1883,7 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru ExternalTableDefinition.newBuilder(sourceUri, FormatOptions.parquet()) .setAutodetect(true) .setHivePartitioningOptions(hivePartitioningOptions) + .setFormatOptions(parquetOptions) .build(); assertNotNull(bigquery.create(TableInfo.of(tableId, externalTable))); String query = From ac429995f7d142bdf5fef605bb1788df91df0084 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 May 2021 23:30:07 +0000 Subject: [PATCH 0147/2268] chore: release 1.131.0 (#1319) :robot: I have created a release \*beep\* \*boop\* --- ## [1.131.0](https://www.github.com/googleapis/java-bigquery/compare/v1.130.0...v1.131.0) (2021-05-18) ### Features * add ParquetOptions support and expose it in LoadJobConfiguration and ExternalTableDefinition classes ([#1318](https://www.github.com/googleapis/java-bigquery/issues/1318)) ([72b1715](https://www.github.com/googleapis/java-bigquery/commit/72b17151c4f3c4a3d298d3791e58c3112a14b4f5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804e745a3a..0f72ddbb90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.131.0](https://www.github.com/googleapis/java-bigquery/compare/v1.130.0...v1.131.0) (2021-05-18) + + +### Features + +* add ParquetOptions support and expose it in LoadJobConfiguration and ExternalTableDefinition classes ([#1318](https://www.github.com/googleapis/java-bigquery/issues/1318)) ([72b1715](https://www.github.com/googleapis/java-bigquery/commit/72b17151c4f3c4a3d298d3791e58c3112a14b4f5)) + ## [1.130.0](https://www.github.com/googleapis/java-bigquery/compare/v1.129.0...v1.130.0) (2021-05-15) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ad56c26aab..aa9d8e18e0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.130.1-SNAPSHOT + 1.131.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c15b390d88..5dc25db802 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.130.1-SNAPSHOT + 1.131.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.130.1-SNAPSHOT + 1.131.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c816b3b6a5..63498fa20b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.130.1-SNAPSHOT + 1.131.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.130.1-SNAPSHOT + 1.131.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b16cea7c0a..2bf2307f7b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.130.1-SNAPSHOT + 1.131.0 diff --git a/versions.txt b/versions.txt index a164b9c420..072d6096a2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.130.0:1.130.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.131.0:1.131.0 \ No newline at end of file From 2da5ed9ff86e9d1fbc135b3fc244b5dbcf78b8ae Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 May 2021 23:42:04 +0000 Subject: [PATCH 0148/2268] chore: release 1.131.1-SNAPSHOT (#1322) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index aa9d8e18e0..c120b150d9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.131.0 + 1.131.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5dc25db802..c47f3361ab 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.131.0 + 1.131.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.131.0 + 1.131.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 63498fa20b..cce48175f6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.131.0 + 1.131.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.131.0 + 1.131.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2bf2307f7b..c9b3530abb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.131.0 + 1.131.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 072d6096a2..0ac6e26afe 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.131.0:1.131.0 \ No newline at end of file +google-cloud-bigquery:1.131.0:1.131.1-SNAPSHOT \ No newline at end of file From 8e45a5ac0cf1053d7cf9e3f40efe49f68678a287 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 03:14:04 +0200 Subject: [PATCH 0149/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.131.0 (#1323) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.130.0` -> `1.131.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.131.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.131.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.131.0/compatibility-slim/1.130.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.131.0/confidence-slim/1.130.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v1.131.0`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​11310-httpswwwgithubcomgoogleapisjava-bigquerycomparev11300v11310-2021-05-18) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.130.0...v1.131.0) ##### Features - add ParquetOptions support and expose it in LoadJobConfiguration and ExternalTableDefinition classes ([#​1318](https://www.github.com/googleapis/java-bigquery/issues/1318)) ([72b1715](https://www.github.com/googleapis/java-bigquery/commit/72b17151c4f3c4a3d298d3791e58c3112a14b4f5))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 23eb110de0..0e54a56064 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.130.0 + 1.131.0 From dd238db05664e588aca00e4f10e368d3a574d605 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 03:31:31 +0200 Subject: [PATCH 0150/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 (#1324) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cce48175f6..35d1912277 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210430-1.31.0 - 1.1.0 + 1.2.0
From 8a804753e0a44abe7e504cccdedcad82dbc4e36a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 18 May 2021 18:44:08 -0700 Subject: [PATCH 0151/2268] chore: regenerate README (#1325) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-19 01:17:42,767 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-19 01:17:44,112 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/277031e4-31c7-450c-9fba-18c262b8da9c/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 6061373ff1..eb58f0236b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "0c7a566ee6e88381821bfe0ee195d12b131b0147" + "sha": "8e45a5ac0cf1053d7cf9e3f40efe49f68678a287" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "4f4b1b9b8d8b52f1e9e4a76165896debce5ab7f1" + "sha": "7332178a11ddddc91188dc0f25bca1ccadcaa6c6" } } ] diff --git a/README.md b/README.md index 8eb1b7d439..b7fc8fac85 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.130.0 + 1.131.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.130.0' +compile 'com.google.cloud:google-cloud-bigquery:1.131.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.130.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.131.0" ``` ## Authentication From a2cb66a60a44748e7aa8d4f4b5386e46191557b7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 03:46:04 +0200 Subject: [PATCH 0152/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.114.0 (#1306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `1.113.16` -> `1.114.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.114.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.114.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.114.0/compatibility-slim/1.113.16)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.114.0/confidence-slim/1.113.16)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v1.114.0`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​11140-httpswwwgithubcomgoogleapisjava-storagecomparev111316v11140-2021-05-13) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v1.113.16...v1.114.0) ##### Features - Remove client side vaildation for lifecycle conditions ([#​816](https://www.github.com/googleapis/java-storage/issues/816)) ([5ec84cc](https://www.github.com/googleapis/java-storage/commit/5ec84cc2935a4787dd14a207d27501878f5849d5)) ##### Bug Fixes - **test:** update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication ([#​759](https://www.github.com/googleapis/java-storage/issues/759)) ([#​817](https://www.github.com/googleapis/java-storage/issues/817)) ([1a576ca](https://www.github.com/googleapis/java-storage/commit/1a576ca3945b51d7a678aa2414be91b3c6b2d55e)) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.31.5 ([#​820](https://www.github.com/googleapis/java-storage/issues/820)) ([9e1bc0b](https://www.github.com/googleapis/java-storage/commit/9e1bc0b42abdaab0b11d761ecdbb92f6116aacd2)) - update dependency com.google.api.grpc:grpc-google-cloud-kms-v1 to v0.88.3 ([#​797](https://www.github.com/googleapis/java-storage/issues/797)) ([747e7e4](https://www.github.com/googleapis/java-storage/commit/747e7e463c028b9cf8a406b7536b1916c1d52c01)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#​815](https://www.github.com/googleapis/java-storage/issues/815)) ([e210de9](https://www.github.com/googleapis/java-storage/commit/e210de93452243242be7d3d719d00da723632335)) ##### [1.113.16](https://www.github.com/googleapis/java-storage/compare/v1.113.15...v1.113.16) (2021-04-23) ##### Bug Fixes - release scripts from issuing overlapping phases ([#​784](https://www.github.com/googleapis/java-storage/issues/784)) ([36751f5](https://www.github.com/googleapis/java-storage/commit/36751f5de9708ac9e23550f67256fb05ebf1f69e)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#​789](https://www.github.com/googleapis/java-storage/issues/789)) ([c005e87](https://www.github.com/googleapis/java-storage/commit/c005e877a7d64c4bbd2ed267526d8025ea29a9ad)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#​794](https://www.github.com/googleapis/java-storage/issues/794)) ([195fead](https://www.github.com/googleapis/java-storage/commit/195fead94dea4c50f7e285e0a7a1578fa5b6265d)) ##### [1.113.15](https://www.github.com/googleapis/java-storage/compare/v1.113.14...v1.113.15) (2021-04-13) ##### Bug Fixes - **test:** update blob paths used in storage.it.ITStorageTest#testDownloadPublicBlobWithoutAuthentication ([#​759](https://www.github.com/googleapis/java-storage/issues/759)) ([9a6619c](https://www.github.com/googleapis/java-storage/commit/9a6619c39a89e2c2ee8d0000d595d09ac7b7825f)) - typo ([#​779](https://www.github.com/googleapis/java-storage/issues/779)) ([3c3d6b4](https://www.github.com/googleapis/java-storage/commit/3c3d6b487648fde4eb956ce8912cd680a4440f8d)) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.31.4 ([#​774](https://www.github.com/googleapis/java-storage/issues/774)) ([ad9ff7b](https://www.github.com/googleapis/java-storage/commit/ad9ff7b801d0c5fb39f72c7118c319f4e45084a0)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#​771](https://www.github.com/googleapis/java-storage/issues/771)) ([5605095](https://www.github.com/googleapis/java-storage/commit/5605095ed796327879a930c12526b3c5b1409b17)) - update kms.version to v0.88.1 ([#​758](https://www.github.com/googleapis/java-storage/issues/758)) ([3e57ea9](https://www.github.com/googleapis/java-storage/commit/3e57ea9a2f5f7013e997469c5ca32be8cef2a4a4)) - update kms.version to v0.88.2 ([#​778](https://www.github.com/googleapis/java-storage/issues/778)) ([6edfc4c](https://www.github.com/googleapis/java-storage/commit/6edfc4ced2bdae9878ecdbc5ef636ac39bdb5881)) - update truth ([#​767](https://www.github.com/googleapis/java-storage/issues/767)) ([4e5ee03](https://www.github.com/googleapis/java-storage/commit/4e5ee0398e700baf4f88224f66309e426f9532d7)) ##### [1.113.14](https://www.github.com/googleapis/java-storage/compare/v1.113.13...v1.113.14) (2021-03-11) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#​749](https://www.github.com/googleapis/java-storage/issues/749)) ([bb42107](https://www.github.com/googleapis/java-storage/commit/bb42107ff10148e14e112ff78534753f2ebc7dd9)) - update kms.version to v0.88.0 ([#​753](https://www.github.com/googleapis/java-storage/issues/753)) ([eaedb64](https://www.github.com/googleapis/java-storage/commit/eaedb6456f2f427a7f2f3f3d6bd13d0d49fd269b)) ##### [1.113.13](https://www.github.com/googleapis/java-storage/compare/v1.113.12...v1.113.13) (2021-03-08) ##### Bug Fixes - npe in createFrom ([#​746](https://www.github.com/googleapis/java-storage/issues/746)) ([9ed9d13](https://www.github.com/googleapis/java-storage/commit/9ed9d1389e92766b66e2b8b4fb78b44d96d98803)) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.31.3 ([#​737](https://www.github.com/googleapis/java-storage/issues/737)) ([71b3842](https://www.github.com/googleapis/java-storage/commit/71b384233226531eabc1bd8eebf716ec53708afc)) ##### [1.113.12](https://www.github.com/googleapis/java-storage/compare/v1.113.11...v1.113.12) (2021-02-26) ##### Bug Fixes - retrying get remote offset and recover from last chunk failures. ([#​726](https://www.github.com/googleapis/java-storage/issues/726)) ([b41b881](https://www.github.com/googleapis/java-storage/commit/b41b88109e13b5ebbd0393d1f264225c12876be6)) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.31.2 ([#​686](https://www.github.com/googleapis/java-storage/issues/686)) ([6b1f036](https://www.github.com/googleapis/java-storage/commit/6b1f0361376167719ec5456181134136d27d1d3c)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#​732](https://www.github.com/googleapis/java-storage/issues/732)) ([c98413d](https://www.github.com/googleapis/java-storage/commit/c98413df9d9514340aed78b5a4d5e596760bb616)) - update kms.version to v0.87.7 ([#​724](https://www.github.com/googleapis/java-storage/issues/724)) ([3229bd8](https://www.github.com/googleapis/java-storage/commit/3229bd860f3a4d700a969aa9e922bbf6b5c1ca10)) - update kms.version to v0.87.8 ([#​733](https://www.github.com/googleapis/java-storage/issues/733)) ([a21b75f](https://www.github.com/googleapis/java-storage/commit/a21b75fa846f373970298dd98f8f3520fc2b3c97)) ##### [1.113.11](https://www.github.com/googleapis/java-storage/compare/v1.113.10...v1.113.11) (2021-02-19) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#​719](https://www.github.com/googleapis/java-storage/issues/719)) ([5831bfa](https://www.github.com/googleapis/java-storage/commit/5831bfae3afeab9b044c8d53ebf6a2ce79bc9950)) ##### [1.113.10](https://www.github.com/googleapis/java-storage/compare/v1.113.9...v1.113.10) (2021-02-17) ##### Dependencies - update dependency com.google.apis:google-api-services-storage to v1-rev20210127-1.31.0 ([#​706](https://www.github.com/googleapis/java-storage/issues/706)) ([04db8f7](https://www.github.com/googleapis/java-storage/commit/04db8f7b87644559685d4c05a67a74e4c8bea364)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#​683](https://www.github.com/googleapis/java-storage/issues/683)) ([6f172eb](https://www.github.com/googleapis/java-storage/commit/6f172eba6fd6e9c11a1f49569249ea6e714ea91f)) - update kms.version to v0.87.6 ([#​702](https://www.github.com/googleapis/java-storage/issues/702)) ([a50c333](https://www.github.com/googleapis/java-storage/commit/a50c333f6e944fa4c6bdf9613cddca7c4fe79652)) ##### [1.113.9](https://www.github.com/googleapis/java-storage/compare/v1.113.8...v1.113.9) (2021-01-12) ##### Bug Fixes - last chunk is retriable ([#​677](https://www.github.com/googleapis/java-storage/issues/677)) ([44f49e0](https://www.github.com/googleapis/java-storage/commit/44f49e0a33c3e541d9f8b22622ffff17cc8b8eaa)) - unnecessary options in resumable upload URL ([#​679](https://www.github.com/googleapis/java-storage/issues/679)) ([d31a39b](https://www.github.com/googleapis/java-storage/commit/d31a39b88b2d8adb04549330f9b8ff1c1a516b69)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.1 ([#​678](https://www.github.com/googleapis/java-storage/issues/678)) ([d4a237f](https://www.github.com/googleapis/java-storage/commit/d4a237f4dff9dd870a69d5da9d690c14d4e88610)) - update kms.version to v0.87.5 ([#​662](https://www.github.com/googleapis/java-storage/issues/662)) ([20e7c1f](https://www.github.com/googleapis/java-storage/commit/20e7c1f10a233df6d4660b31d26cd95a6d4002e9)) ##### [1.113.8](https://www.github.com/googleapis/java-storage/compare/v1.113.7...v1.113.8) (2020-12-16) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#​659](https://www.github.com/googleapis/java-storage/issues/659)) ([5fa03fa](https://www.github.com/googleapis/java-storage/commit/5fa03fa14aa9ee29e7b1b27b783ab873052b97c6)) ##### [1.113.7](https://www.github.com/googleapis/java-storage/compare/v1.113.6...v1.113.7) (2020-12-14) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([f1fc884](https://www.github.com/googleapis/java-storage/commit/f1fc884851ee602d737f3e4191acb1f8450c8f2c)) ##### [1.113.6](https://www.github.com/googleapis/java-storage/compare/v1.113.5...v1.113.6) (2020-12-10) ##### Bug Fixes - content-length missing in offset request ([#​647](https://www.github.com/googleapis/java-storage/issues/647)) ([3cd3815](https://www.github.com/googleapis/java-storage/commit/3cd3815c62603d05d4c571ba1affeaf91e4d8040)) ##### Dependencies - update kms.version to v0.87.3 ([#​646](https://www.github.com/googleapis/java-storage/issues/646)) ([c93896a](https://www.github.com/googleapis/java-storage/commit/c93896a5007b48753809de806ddaf6c8df6e9d56)) ##### [1.113.5](https://www.github.com/googleapis/java-storage/compare/v1.113.4...v1.113.5) (2020-12-07) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.31.1 ([#​611](https://www.github.com/googleapis/java-storage/issues/611)) ([7c4c759](https://www.github.com/googleapis/java-storage/commit/7c4c759d8bca9c20252e06e02eb8ead3bd9f88d6)) - update dependency com.google.api.grpc:grpc-google-cloud-kms-v1 to v0.87.2 ([#​625](https://www.github.com/googleapis/java-storage/issues/625)) ([243a3cb](https://www.github.com/googleapis/java-storage/commit/243a3cb1506b2e2d609210dc4e9608637c06d7f3)) - update dependency com.google.apis:google-api-services-storage to v1-rev20201112-1.30.10 ([#​613](https://www.github.com/googleapis/java-storage/issues/613)) ([b0e24db](https://www.github.com/googleapis/java-storage/commit/b0e24db88c784fd05988a813bd8b29aeff0739f2)) - update dependency com.google.apis:google-api-services-storage to v1-rev20201112-1.31.0 ([#​641](https://www.github.com/googleapis/java-storage/issues/641)) ([11da9c7](https://www.github.com/googleapis/java-storage/commit/11da9c7e9058c508423e7b2f84c897ab3e9ab3f3)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#​639](https://www.github.com/googleapis/java-storage/issues/639)) ([68a3af9](https://www.github.com/googleapis/java-storage/commit/68a3af9b12c0e05d2cf59fb58aceab15323e29b1)) - update dependency org.apache.httpcomponents:httpcore to v4.4.14 ([#​637](https://www.github.com/googleapis/java-storage/issues/637)) ([af53902](https://www.github.com/googleapis/java-storage/commit/af5390239ffd1e157f066a1009b7bb18fa6264ec)) ##### [1.113.4](https://www.github.com/googleapis/java-storage/compare/v1.113.3...v1.113.4) (2020-11-13) ##### Bug Fixes - retry using remote offset ([#​604](https://www.github.com/googleapis/java-storage/issues/604)) ([216b52c](https://www.github.com/googleapis/java-storage/commit/216b52c54d34eaf1307788809a3512c461adf381)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.15.0 ([#​610](https://www.github.com/googleapis/java-storage/issues/610)) ([ac65e5b](https://www.github.com/googleapis/java-storage/commit/ac65e5b0bd324d5726504bb3405c758675a56ddc)) ##### [1.113.3](https://www.github.com/googleapis/java-storage/compare/v1.113.2...v1.113.3) (2020-11-06) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.14.1 ([#​592](https://www.github.com/googleapis/java-storage/issues/592)) ([25e8e6a](https://www.github.com/googleapis/java-storage/commit/25e8e6a01dde517fd42cfc8ae59b8555ea0a2831)) - update kms.version to v0.87.1 ([#​595](https://www.github.com/googleapis/java-storage/issues/595)) ([1e399cd](https://www.github.com/googleapis/java-storage/commit/1e399cd33755e647bf08f4a82af932320cab655d)) ##### [1.113.2](https://www.github.com/googleapis/java-storage/compare/v1.113.1...v1.113.2) (2020-10-26) ##### Documentation - update libraries-bom ([#​540](https://www.github.com/googleapis/java-storage/issues/540)) ([54987e1](https://www.github.com/googleapis/java-storage/commit/54987e1ba35d99db680ab2ad6ac86a6b74c7c705)) - update libraries-bom ([#​552](https://www.github.com/googleapis/java-storage/issues/552)) ([c4df018](https://www.github.com/googleapis/java-storage/commit/c4df01875b8f088bd65bcd0353e1b74a18b9582c)) ##### Dependencies - update dependency com.google.api-client:google-api-client to v1.30.11 ([#​575](https://www.github.com/googleapis/java-storage/issues/575)) ([99838e6](https://www.github.com/googleapis/java-storage/commit/99838e63f9a71095c4d8f6c99622a9aee2e5d26d)) - update dependency com.google.apis:google-api-services-storage to v1-rev20200927-1.30.10 ([#​539](https://www.github.com/googleapis/java-storage/issues/539)) ([5e49013](https://www.github.com/googleapis/java-storage/commit/5e49013add340e4d8287e00b8d4a9c499df80205)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#​529](https://www.github.com/googleapis/java-storage/issues/529)) ([dc58856](https://www.github.com/googleapis/java-storage/commit/dc58856c2548013a495b62cc6bb696ada24d2557)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.2 ([#​549](https://www.github.com/googleapis/java-storage/issues/549)) ([c59c28d](https://www.github.com/googleapis/java-storage/commit/c59c28d97a9eb4e811921c7cad637d67c2be16be)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.12.1 ([#​566](https://www.github.com/googleapis/java-storage/issues/566)) ([f1dedfb](https://www.github.com/googleapis/java-storage/commit/f1dedfbf9f47c87c7f7fea5e6c1c7c1af35b060e)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([#​570](https://www.github.com/googleapis/java-storage/issues/570)) ([ef55f49](https://www.github.com/googleapis/java-storage/commit/ef55f49230f58863195782b5fe0f84285a316aef)) ##### [1.113.1](https://www.github.com/googleapis/java-storage/compare/v1.113.0...v1.113.1) (2020-09-17) ##### Bug Fixes - KMS Bad Key error when using existing Blob context to overwrite object ([#​507](https://www.github.com/googleapis/java-storage/issues/507)) ([4d9c490](https://www.github.com/googleapis/java-storage/commit/4d9c49027e4746ee273902694441886c2f43188d)) - When passing a sub-array (offset, length) to the Storage#create method the array is needlessly cloned ([#​506](https://www.github.com/googleapis/java-storage/issues/506)) ([9415bb7](https://www.github.com/googleapis/java-storage/commit/9415bb7bdb42d8012ca457a90070b616e6bbec19)), closes [#​505](https://www.github.com/googleapis/java-storage/issues/505) ##### Dependencies - update dependency com.google.apis:google-api-services-storage to v1-rev20200814-1.30.10 ([#​499](https://www.github.com/googleapis/java-storage/issues/499)) ([af91d7d](https://www.github.com/googleapis/java-storage/commit/af91d7da4117fb22992d6a860af61f72906e0aa1)) ##### Documentation - update libraries-bom ([#​504](https://www.github.com/googleapis/java-storage/issues/504)) ([0e58c1c](https://www.github.com/googleapis/java-storage/commit/0e58c1cb2b6a890e567b043188613021592f2bc8))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35d1912277..fa0e75d960 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.113.16 + 1.114.0 test From f7e30f0c3a6e71dd929bbe3b7e33a88ce7baaf13 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 01:56:04 +0000 Subject: [PATCH 0153/2268] chore: release 1.131.1 (#1326) :robot: I have created a release \*beep\* \*boop\* --- ### [1.131.1](https://www.github.com/googleapis/java-bigquery/compare/v1.131.0...v1.131.1) (2021-05-19) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#1324](https://www.github.com/googleapis/java-bigquery/issues/1324)) ([dd238db](https://www.github.com/googleapis/java-bigquery/commit/dd238db05664e588aca00e4f10e368d3a574d605)) * update dependency com.google.cloud:google-cloud-storage to v1.114.0 ([#1306](https://www.github.com/googleapis/java-bigquery/issues/1306)) ([a2cb66a](https://www.github.com/googleapis/java-bigquery/commit/a2cb66a60a44748e7aa8d4f4b5386e46191557b7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f72ddbb90..81a98f7035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.131.1](https://www.github.com/googleapis/java-bigquery/compare/v1.131.0...v1.131.1) (2021-05-19) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#1324](https://www.github.com/googleapis/java-bigquery/issues/1324)) ([dd238db](https://www.github.com/googleapis/java-bigquery/commit/dd238db05664e588aca00e4f10e368d3a574d605)) +* update dependency com.google.cloud:google-cloud-storage to v1.114.0 ([#1306](https://www.github.com/googleapis/java-bigquery/issues/1306)) ([a2cb66a](https://www.github.com/googleapis/java-bigquery/commit/a2cb66a60a44748e7aa8d4f4b5386e46191557b7)) + ## [1.131.0](https://www.github.com/googleapis/java-bigquery/compare/v1.130.0...v1.131.0) (2021-05-18) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c120b150d9..68ffab6084 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.131.1-SNAPSHOT + 1.131.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c47f3361ab..ba88ca24d4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.131.1-SNAPSHOT + 1.131.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.131.1-SNAPSHOT + 1.131.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index fa0e75d960..916acbb977 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.131.1-SNAPSHOT + 1.131.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.131.1-SNAPSHOT + 1.131.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c9b3530abb..cdc365509b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.131.1-SNAPSHOT + 1.131.1 diff --git a/versions.txt b/versions.txt index 0ac6e26afe..b4d40e03ce 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.131.0:1.131.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.131.1:1.131.1 \ No newline at end of file From c0700ea4060c5e4331bb0f0f639097fac6263192 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 19 May 2021 02:08:03 +0000 Subject: [PATCH 0154/2268] chore: release 1.131.2-SNAPSHOT (#1327) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 68ffab6084..7eb9a06e09 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.131.1 + 1.131.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ba88ca24d4..ab19ed9fda 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.131.1 + 1.131.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.131.1 + 1.131.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 916acbb977..6a62699652 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.131.1 + 1.131.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.131.1 + 1.131.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cdc365509b..40d0dbbb6e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.131.1 + 1.131.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index b4d40e03ce..4fcde2e46f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.131.1:1.131.1 \ No newline at end of file +google-cloud-bigquery:1.131.1:1.131.2-SNAPSHOT \ No newline at end of file From beebb5c8feb78e3c32b606bcb151b06c9e94faf0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 07:15:28 +0200 Subject: [PATCH 0155/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.131.1 (#1329) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0e54a56064..67c7b66dc7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.131.0 + 1.131.1 From fa78fc1c0c8a7c001e8a896792c2c0751b4393bc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 18 May 2021 22:28:02 -0700 Subject: [PATCH 0156/2268] chore: regenerate README (#1330) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-19 05:17:35,360 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-19 05:17:36,603 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/1fdc6908-c58a-48fe-a983-76cb64d05e32/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index eb58f0236b..474f25902b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "8e45a5ac0cf1053d7cf9e3f40efe49f68678a287" + "sha": "beebb5c8feb78e3c32b606bcb151b06c9e94faf0" } }, { diff --git a/README.md b/README.md index b7fc8fac85..380cecac19 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.131.0 + 1.131.1 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.131.0' +compile 'com.google.cloud:google-cloud-bigquery:1.131.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.131.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.131.1" ``` ## Authentication From 3c741a91dc721484907c8778b5c666724f534ead Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 16:22:37 +0200 Subject: [PATCH 0157/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.0.18 (#1328) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 67c7b66dc7..7570863e77 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.17 + 1.0.18 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 40d0dbbb6e..1c63382508 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.17 + 1.0.18 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9d8e613961..858ecb0f74 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.17 + 1.0.18 test From 1f19362ad5527a12e4fadc1df42523857b6e709a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 May 2021 07:38:04 -0700 Subject: [PATCH 0158/2268] feat: add `gcf-owl-bot[bot]` to `ignoreAuthors` (#1331) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d9040141-c544-42d1-82e1-e841ec7c983d/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/7332178a11ddddc91188dc0f25bca1ccadcaa6c6 --- .github/generated-files-bot.yml | 1 + synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml index 47c2ba132e..c644a24e11 100644 --- a/.github/generated-files-bot.yml +++ b/.github/generated-files-bot.yml @@ -9,3 +9,4 @@ ignoreAuthors: - 'renovate-bot' - 'yoshi-automation' - 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/synth.metadata b/synth.metadata index 4761d127af..a995e978b5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "72568a031768207a28f5b5727f7af752b4e2a373" + "sha": "fa78fc1c0c8a7c001e8a896792c2c0751b4393bc" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "c86c7a60985644eab557949363a38301d40d78d2" + "sha": "7332178a11ddddc91188dc0f25bca1ccadcaa6c6" } } ], From 225cc67741126a532e47f3a9544d7fb3e67e10ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 May 2021 23:02:32 +0200 Subject: [PATCH 0159/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.12.0 (#1333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.11.2` -> `0.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/compatibility-slim/0.11.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/0.12.0/confidence-slim/0.11.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a62699652..d18c66d0bc 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.11.2 + 0.12.0 From f7be534a5a7fb79232bcd3d082365033262f6dcb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 May 2021 18:52:02 +0200 Subject: [PATCH 0160/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.25.0 (#1334) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.24.1` -> `1.25.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.25.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.25.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.25.0/compatibility-slim/1.24.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.25.0/confidence-slim/1.24.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.25.0`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1250-httpswwwgithubcomgoogleapisjava-bigtablecomparev1241v1250-2021-05-19) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.24.1...v1.25.0) ##### Features - add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#​815](https://www.github.com/googleapis/java-bigtable/issues/815)) ([ea558b0](https://www.github.com/googleapis/java-bigtable/commit/ea558b05b369c6131f94e471e5652866a037b948)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#​814](https://www.github.com/googleapis/java-bigtable/issues/814)) ([1299d72](https://www.github.com/googleapis/java-bigtable/commit/1299d727066e0aa24319b99d438503ea0cf60d86)) ##### [1.24.1](https://www.github.com/googleapis/java-bigtable/compare/v1.24.0...v1.24.1) (2021-05-11) ##### Bug Fixes - filter limit constant ([#​787](https://www.github.com/googleapis/java-bigtable/issues/787)) ([04f8ad4](https://www.github.com/googleapis/java-bigtable/commit/04f8ad463d1fa9efe0ab941ee5f3d0794baed814)) - fix flaky test ([#​798](https://www.github.com/googleapis/java-bigtable/issues/798)) ([83e0e8c](https://www.github.com/googleapis/java-bigtable/commit/83e0e8cf2cdbc143c10ce0f8b053096d61d5686f)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#​805](https://www.github.com/googleapis/java-bigtable/issues/805)) ([a498687](https://www.github.com/googleapis/java-bigtable/commit/a498687d15dd9af35c57b0df6d08c87ef36833da)) ##### Documentation - update the comments in Cloud Bigtable RestoreTable API to reflect the new API capability ([#​804](https://www.github.com/googleapis/java-bigtable/issues/804)) ([f5e5d5a](https://www.github.com/googleapis/java-bigtable/commit/f5e5d5ac196529d5b070ef5fd8118038fec2e2de))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7570863e77..93671d28f2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.24.1 + 1.25.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1c63382508..410170bfa5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.24.1 + 1.25.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 858ecb0f74..08443351fa 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.24.1 + 1.25.0 test From ed20000118ff59c0881ca1e4f20056f48adc13e0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 20 May 2021 15:32:19 -0700 Subject: [PATCH 0161/2268] chore: dump maven version along with java (#1335) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/17ca336b-fa2b-4537-8cfb-b72192e5b930/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/8eae0234a16b26c2ff616d305dbd9786c8b10a47 --- .kokoro/build.sh | 4 ++-- synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 0f37b1e020..1a024be85f 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -23,8 +23,8 @@ cd ${scriptDir}/.. # include common functions source ${scriptDir}/common.sh -# Print out Java version -java -version +# Print out Maven & Java version +mvn -version echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) diff --git a/synth.metadata b/synth.metadata index a995e978b5..c36d006ae1 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "fa78fc1c0c8a7c001e8a896792c2c0751b4393bc" + "sha": "f7be534a5a7fb79232bcd3d082365033262f6dcb" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7332178a11ddddc91188dc0f25bca1ccadcaa6c6" + "sha": "8eae0234a16b26c2ff616d305dbd9786c8b10a47" } } ], From e2e9a5f941a2a21b79dfdeefac667f0b3627cb78 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 May 2021 04:12:34 +0200 Subject: [PATCH 0162/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.3.0 (#1336) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d18c66d0bc..dafdd623f8 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.0 html From 6f0a9dafcb54c99394ad9a8aaa769dcb8f551aae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 00:52:06 +0200 Subject: [PATCH 0163/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.5.0 (#1337) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 08443351fa..ae1d4ef4da 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.4.0 + 20.5.0 pom import From 760e34f976e4b3d2c5622648bc45193767166aeb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 24 May 2021 16:06:02 -0700 Subject: [PATCH 0164/2268] chore: regenerate README (#1338) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-05-24 22:54:22,166 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-05-24 22:54:23,552 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/e1af13ed-83cf-4c1d-a5f6-53d1522efd32/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 474f25902b..4564b60366 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "beebb5c8feb78e3c32b606bcb151b06c9e94faf0" + "sha": "6f0a9dafcb54c99394ad9a8aaa769dcb8f551aae" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7332178a11ddddc91188dc0f25bca1ccadcaa6c6" + "sha": "a2de127f90799cd5bace653b1dcc5dd2ca8b19c9" } } ] diff --git a/README.md b/README.md index 380cecac19..e9dd64914b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.4.0 + 20.5.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.4.0') +implementation platform('com.google.cloud:libraries-bom:20.5.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From 5fcdb5cd7060fdd27a911cf1feb633a5d8cb1cbb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 May 2021 04:53:43 +0200 Subject: [PATCH 0165/2268] test(deps): update dependency com.google.truth:truth to v1.1.3 (#1339) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index dafdd623f8..d749d2f3ba 100644 --- a/pom.xml +++ b/pom.xml @@ -106,7 +106,7 @@ com.google.truth truth - 1.1 + 1.1.3 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 93671d28f2..dc75111602 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.1 + 1.1.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 410170bfa5..b2547ac521 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.1 + 1.1.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ae1d4ef4da..d8ef9148c6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.1 + 1.1.3 test From dfaa49e06715198a012385fad4a37160403b54f4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 May 2021 21:56:11 +0200 Subject: [PATCH 0166/2268] deps: update jmh.version to v1.32 (#1340) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | org.openjdk.jmh:jmh-generator-annprocess | `1.31` -> `1.32` | [![age](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-generator-annprocess/1.32/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-generator-annprocess/1.32/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-generator-annprocess/1.32/compatibility-slim/1.31)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-generator-annprocess/1.32/confidence-slim/1.31)](https://docs.renovatebot.com/merge-confidence/) | | org.openjdk.jmh:jmh-core | `1.31` -> `1.32` | [![age](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-core/1.32/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-core/1.32/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-core/1.32/compatibility-slim/1.31)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.openjdk.jmh:jmh-core/1.32/confidence-slim/1.31)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7eb9a06e09..553cd97fb3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.31 + 1.32 benchmark From a37a2f5240bb7b0681b8e5e70801d96b4a5675e5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 30 May 2021 23:12:28 +0200 Subject: [PATCH 0167/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210518-1.31.0 (#1341) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d749d2f3ba..1a95296e3c 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210430-1.31.0 + v2-rev20210518-1.31.0 1.2.0
From f72f1b50ca38c96d85d9e614e159db487cb0cbf2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Jun 2021 18:13:48 +0200 Subject: [PATCH 0168/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.0 (#1342) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index dc75111602..0244d79ef6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.18 + 1.1.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b2547ac521..5588da842b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.18 + 1.1.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d8ef9148c6..acdfd5fe2f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.0.18 + 1.1.0 test From 6fa2ea32fe8bd0d0de4903538c4f1d302781a7de Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Jun 2021 18:14:03 +0200 Subject: [PATCH 0169/2268] test(deps): update datacatalog dependencies to v1.4.0 (#1343) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1a95296e3c..ad0fa7548c 100644 --- a/pom.xml +++ b/pom.xml @@ -124,13 +124,13 @@ com.google.cloud google-cloud-datacatalog - 1.3.3 + 1.4.0 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.3.3 + 1.4.0 test From 0ee09f779c116c000be1cc99c6b1d52a14b33403 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Jun 2021 16:04:23 +0200 Subject: [PATCH 0170/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.115.0 (#1344) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad0fa7548c..ae60920556 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.114.0 + 1.115.0 test From e6695c0bc0e3d4e758ef75c0a8fe13c0c390b771 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 3 Jun 2021 18:21:12 +0200 Subject: [PATCH 0171/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.1 (#1346) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0244d79ef6..fc280da04b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.0 + 1.1.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5588da842b..c56e8d0fd2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.0 + 1.1.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index acdfd5fe2f..13d12b2848 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.0 + 1.1.1 test From ab41045628a6735de3223bb22285f0affc269c75 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Jun 2021 14:48:37 +0200 Subject: [PATCH 0172/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 (#1348) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ae60920556..7873b5ed3c 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ google-cloud-bigquery-parent v2-rev20210518-1.31.0 - 1.2.0 + 1.3.0
From 55f3e7b359cc197767e75f026f572110649c2ba7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Jun 2021 14:49:02 +0200 Subject: [PATCH 0173/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.26.0 (#1347) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fc280da04b..a96be2fd9d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.25.0 + 1.26.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c56e8d0fd2..0eea7c3cab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.25.0 + 1.26.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 13d12b2848..202ff7c92a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.25.0 + 1.26.0 test From cc70853dad3955815a0820aa411b1e5cd9b65722 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 4 Jun 2021 13:04:03 +0000 Subject: [PATCH 0174/2268] chore: release 1.132.0 (#1332) :robot: I have created a release \*beep\* \*boop\* --- ## [1.132.0](https://www.github.com/googleapis/java-bigquery/compare/v1.131.1...v1.132.0) (2021-06-04) ### Features * add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#1331](https://www.github.com/googleapis/java-bigquery/issues/1331)) ([1f19362](https://www.github.com/googleapis/java-bigquery/commit/1f19362ad5527a12e4fadc1df42523857b6e709a)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210518-1.31.0 ([#1341](https://www.github.com/googleapis/java-bigquery/issues/1341)) ([a37a2f5](https://www.github.com/googleapis/java-bigquery/commit/a37a2f5240bb7b0681b8e5e70801d96b4a5675e5)) * update dependency com.google.cloud:google-cloud-bigtable to v1.25.0 ([#1334](https://www.github.com/googleapis/java-bigquery/issues/1334)) ([f7be534](https://www.github.com/googleapis/java-bigquery/commit/f7be534a5a7fb79232bcd3d082365033262f6dcb)) * update dependency com.google.cloud:google-cloud-bigtable to v1.26.0 ([#1347](https://www.github.com/googleapis/java-bigquery/issues/1347)) ([55f3e7b](https://www.github.com/googleapis/java-bigquery/commit/55f3e7b359cc197767e75f026f572110649c2ba7)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#1348](https://www.github.com/googleapis/java-bigquery/issues/1348)) ([ab41045](https://www.github.com/googleapis/java-bigquery/commit/ab41045628a6735de3223bb22285f0affc269c75)) * update dependency com.google.cloud:google-cloud-storage to v1.115.0 ([#1344](https://www.github.com/googleapis/java-bigquery/issues/1344)) ([0ee09f7](https://www.github.com/googleapis/java-bigquery/commit/0ee09f779c116c000be1cc99c6b1d52a14b33403)) * update jmh.version to v1.32 ([#1340](https://www.github.com/googleapis/java-bigquery/issues/1340)) ([dfaa49e](https://www.github.com/googleapis/java-bigquery/commit/dfaa49e06715198a012385fad4a37160403b54f4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81a98f7035..0d526df96a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [1.132.0](https://www.github.com/googleapis/java-bigquery/compare/v1.131.1...v1.132.0) (2021-06-04) + + +### Features + +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#1331](https://www.github.com/googleapis/java-bigquery/issues/1331)) ([1f19362](https://www.github.com/googleapis/java-bigquery/commit/1f19362ad5527a12e4fadc1df42523857b6e709a)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210518-1.31.0 ([#1341](https://www.github.com/googleapis/java-bigquery/issues/1341)) ([a37a2f5](https://www.github.com/googleapis/java-bigquery/commit/a37a2f5240bb7b0681b8e5e70801d96b4a5675e5)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.25.0 ([#1334](https://www.github.com/googleapis/java-bigquery/issues/1334)) ([f7be534](https://www.github.com/googleapis/java-bigquery/commit/f7be534a5a7fb79232bcd3d082365033262f6dcb)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.26.0 ([#1347](https://www.github.com/googleapis/java-bigquery/issues/1347)) ([55f3e7b](https://www.github.com/googleapis/java-bigquery/commit/55f3e7b359cc197767e75f026f572110649c2ba7)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#1348](https://www.github.com/googleapis/java-bigquery/issues/1348)) ([ab41045](https://www.github.com/googleapis/java-bigquery/commit/ab41045628a6735de3223bb22285f0affc269c75)) +* update dependency com.google.cloud:google-cloud-storage to v1.115.0 ([#1344](https://www.github.com/googleapis/java-bigquery/issues/1344)) ([0ee09f7](https://www.github.com/googleapis/java-bigquery/commit/0ee09f779c116c000be1cc99c6b1d52a14b33403)) +* update jmh.version to v1.32 ([#1340](https://www.github.com/googleapis/java-bigquery/issues/1340)) ([dfaa49e](https://www.github.com/googleapis/java-bigquery/commit/dfaa49e06715198a012385fad4a37160403b54f4)) + ### [1.131.1](https://www.github.com/googleapis/java-bigquery/compare/v1.131.0...v1.131.1) (2021-05-19) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 553cd97fb3..3bd17e49ee 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.131.2-SNAPSHOT + 1.132.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ab19ed9fda..bc7ed08735 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.131.2-SNAPSHOT + 1.132.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.131.2-SNAPSHOT + 1.132.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7873b5ed3c..a9e0af8f29 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.131.2-SNAPSHOT + 1.132.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.131.2-SNAPSHOT + 1.132.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0eea7c3cab..4543b28731 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.131.2-SNAPSHOT + 1.132.0 diff --git a/versions.txt b/versions.txt index 4fcde2e46f..d249bfe554 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.131.1:1.131.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.132.0:1.132.0 \ No newline at end of file From 043d377a3932c3810b795b611709d355f7606941 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 4 Jun 2021 13:14:03 +0000 Subject: [PATCH 0175/2268] chore: release 1.132.1-SNAPSHOT (#1349) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3bd17e49ee..8c658fcd01 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.132.0 + 1.132.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bc7ed08735..15a737f97d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.132.0 + 1.132.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.132.0 + 1.132.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a9e0af8f29..ae275409f1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.132.0 + 1.132.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.132.0 + 1.132.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4543b28731..478bd9fcc9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.132.0 + 1.132.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index d249bfe554..927d6fd11c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.132.0:1.132.0 \ No newline at end of file +google-cloud-bigquery:1.132.0:1.132.1-SNAPSHOT \ No newline at end of file From cfc5fc9d210bb9fdfe3ec12b40541fd8a7044fef Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Jun 2021 16:56:49 +0200 Subject: [PATCH 0176/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.2 (#1350) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a96be2fd9d..e4b154669b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.1 + 1.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 478bd9fcc9..6d25ea9e35 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.1 + 1.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 202ff7c92a..0269f7a09a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.1 + 1.1.2 test From 2e08019e2312995995af3261350586fa59002b60 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Jun 2021 16:57:08 +0200 Subject: [PATCH 0177/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.132.0 (#1351) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e4b154669b..5d4be02d2b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.131.1 + 1.132.0 From b6b23dcc6dd408c94313e533d03b1cbfc0b7ab9f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Jun 2021 08:10:03 -0700 Subject: [PATCH 0178/2268] chore: regenerate README (#1352) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-04 14:58:59,298 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-04 14:59:00,669 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/c8c4259c-a230-49c2-b64d-b4303db73367/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 4564b60366..83a5a51b0d 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "6f0a9dafcb54c99394ad9a8aaa769dcb8f551aae" + "sha": "2e08019e2312995995af3261350586fa59002b60" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a2de127f90799cd5bace653b1dcc5dd2ca8b19c9" + "sha": "8da7927493739fa36130360019ca21258242f73a" } } ] diff --git a/README.md b/README.md index e9dd64914b..4e0289083f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.131.1 + 1.132.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.131.1' +compile 'com.google.cloud:google-cloud-bigquery:1.132.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.131.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.132.0" ``` ## Authentication From 475d61efdd4b194da79ca5190f2ad06876339a72 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Jun 2021 16:35:20 +0200 Subject: [PATCH 0179/2268] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.23 (#1354) --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5d4be02d2b..16447990f6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.22 + 1.0.23 diff --git a/samples/pom.xml b/samples/pom.xml index 835a13ac22..f2bb68bedb 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -34,7 +34,7 @@ com.google.cloud.samples shared-configuration - 1.0.22 + 1.0.23 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6d25ea9e35..3099382ed1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.22 + 1.0.23 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0269f7a09a..80b7acb09f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud.samples shared-configuration - 1.0.22 + 1.0.23 From 1e0827e04a23c5d53327dd32ae7f5d6877756f22 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Jun 2021 16:36:03 +0200 Subject: [PATCH 0180/2268] test(deps): update datacatalog dependencies to v1.4.1 (#1353) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ae275409f1..56bbadd6fb 100644 --- a/pom.xml +++ b/pom.xml @@ -124,13 +124,13 @@ com.google.cloud google-cloud-datacatalog - 1.4.0 + 1.4.1 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.4.0 + 1.4.1 test From bc7744e5570c2990231a680fb9cda9acebb3d7ca Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 5 Jun 2021 16:36:20 +0200 Subject: [PATCH 0181/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.0 (#1355) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 56bbadd6fb..679efca3ad 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210518-1.31.0 + v2-rev20210529-1.31.0 1.3.0 From 384dcc5fb9907ea9ff26a53d42c7033bd336bc73 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Jun 2021 17:40:18 +0200 Subject: [PATCH 0182/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.6.0 (#1357) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 80b7acb09f..75414a3a6a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.5.0 + 20.6.0 pom import From c31d82606fba1890211b34c3c9e65e17ab1e7af0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 15:50:02 +0000 Subject: [PATCH 0183/2268] chore: release 1.132.1 (#1356) :robot: I have created a release \*beep\* \*boop\* --- ### [1.132.1](https://www.github.com/googleapis/java-bigquery/compare/v1.132.0...v1.132.1) (2021-06-07) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.0 ([#1355](https://www.github.com/googleapis/java-bigquery/issues/1355)) ([bc7744e](https://www.github.com/googleapis/java-bigquery/commit/bc7744e5570c2990231a680fb9cda9acebb3d7ca)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d526df96a..2d028a6fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.132.1](https://www.github.com/googleapis/java-bigquery/compare/v1.132.0...v1.132.1) (2021-06-07) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.0 ([#1355](https://www.github.com/googleapis/java-bigquery/issues/1355)) ([bc7744e](https://www.github.com/googleapis/java-bigquery/commit/bc7744e5570c2990231a680fb9cda9acebb3d7ca)) + ## [1.132.0](https://www.github.com/googleapis/java-bigquery/compare/v1.131.1...v1.132.0) (2021-06-04) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8c658fcd01..9137e7d535 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.132.1-SNAPSHOT + 1.132.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 15a737f97d..4b88f59ccd 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.132.1-SNAPSHOT + 1.132.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.132.1-SNAPSHOT + 1.132.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 679efca3ad..50681b3310 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.132.1-SNAPSHOT + 1.132.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.132.1-SNAPSHOT + 1.132.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3099382ed1..32204cb426 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.132.1-SNAPSHOT + 1.132.1 diff --git a/versions.txt b/versions.txt index 927d6fd11c..0fef4ec611 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.132.0:1.132.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.132.1:1.132.1 \ No newline at end of file From 9b1b4876be0941531da707a33228e16ec290acc8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 7 Jun 2021 08:52:02 -0700 Subject: [PATCH 0184/2268] chore: regenerate README (#1358) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-07 15:42:36,422 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-07 15:42:37,763 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/8f04d138-d1c2-417b-a75f-ac65163cd477/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 83a5a51b0d..f2a00f876b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "2e08019e2312995995af3261350586fa59002b60" + "sha": "384dcc5fb9907ea9ff26a53d42c7033bd336bc73" } }, { diff --git a/README.md b/README.md index 4e0289083f..6aa15f9862 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.5.0 + 20.6.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.5.0') +implementation platform('com.google.cloud:libraries-bom:20.6.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From fa6f6fec1dc0c99a2e2927e144b8f01de5ca2a6b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:02:03 +0000 Subject: [PATCH 0185/2268] chore: release 1.132.2-SNAPSHOT (#1359) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9137e7d535..52a24ad252 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.132.1 + 1.132.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4b88f59ccd..b485b5fba2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.132.1 + 1.132.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.132.1 + 1.132.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 50681b3310..0a95d98a37 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.132.1 + 1.132.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.132.1 + 1.132.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 32204cb426..3ab3813224 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.132.1 + 1.132.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0fef4ec611..f0291dc532 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.132.1:1.132.1 \ No newline at end of file +google-cloud-bigquery:1.132.1:1.132.2-SNAPSHOT \ No newline at end of file From bf55699d849de7e873577de04e44fbfe0f078ab1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Jun 2021 18:52:02 +0200 Subject: [PATCH 0186/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.26.1 (#1360) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.26.0` -> `1.26.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.26.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.26.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.26.1/compatibility-slim/1.26.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.26.1/confidence-slim/1.26.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.26.1`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1261-httpswwwgithubcomgoogleapisjava-bigtablecomparev1260v1261-2021-06-07) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.26.0...v1.26.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 16447990f6..c14351ceaf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.26.0 + 1.26.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3ab3813224..84ebb2b0fe 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.26.0 + 1.26.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 75414a3a6a..6682efa6c1 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.26.0 + 1.26.1 test From d8b7a564e681e36dbb0f187a73dc1ddbc539f157 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 7 Jun 2021 10:04:02 -0700 Subject: [PATCH 0187/2268] chore: regenerate README (#1363) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-07 16:54:19,937 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-07 16:54:21,178 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/efe658b6-75ab-496c-ad8a-4bd12c9101c5/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index f2a00f876b..24ee14bc06 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "384dcc5fb9907ea9ff26a53d42c7033bd336bc73" + "sha": "bf55699d849de7e873577de04e44fbfe0f078ab1" } }, { diff --git a/README.md b/README.md index 6aa15f9862..c1a55874e0 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.132.0' +compile 'com.google.cloud:google-cloud-bigquery:1.132.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.132.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.132.1" ``` ## Authentication From 44c1a5d0083521b260bfa490c91b72051885eb4d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Jun 2021 19:04:06 +0200 Subject: [PATCH 0188/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.132.1 (#1362) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.132.0` -> `1.132.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.132.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.132.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.132.1/compatibility-slim/1.132.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.132.1/confidence-slim/1.132.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v1.132.1`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​11321-httpswwwgithubcomgoogleapisjava-bigquerycomparev11320v11321-2021-06-07) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.132.0...v1.132.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c14351ceaf..6608f9aa5b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.132.0 + 1.132.1 From 5f6307f9e788bdd3d860a7a89aa9dc043c67e609 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 7 Jun 2021 10:16:02 -0700 Subject: [PATCH 0189/2268] chore: regenerate README (#1364) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-07 17:06:17,435 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-07 17:06:18,718 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/8dff48cf-f7c0-4178-8110-8832472656a8/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 24ee14bc06..c316b69a1c 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "bf55699d849de7e873577de04e44fbfe0f078ab1" + "sha": "44c1a5d0083521b260bfa490c91b72051885eb4d" } }, { diff --git a/README.md b/README.md index c1a55874e0..a15eb421a7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.132.0 + 1.132.1 ``` From ba528df03def71907e2811cf267718f090605d95 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 8 Jun 2021 12:49:07 -0400 Subject: [PATCH 0190/2268] feat: add support for DecimalTargetTypes (#1345) * feat: add support for DecimalTargetType Towards b/188414733 Implemented in LoadJobConfiguration * update test to verify that the destination table's decimal column is loaded as BIGNUMERIC type * add decimalTargetTypes support in ExternalTableDefinition.java * add decimalTargetTypes support in ExternalTableDefinition.java --- .../clirr-ignored-differences.xml | 28 ++--------- .../bigquery/ExternalTableDefinition.java | 24 ++++++++++ .../cloud/bigquery/LoadJobConfiguration.java | 29 +++++++++++ .../bigquery/ExternalTableDefinitionTest.java | 5 ++ .../bigquery/LoadJobConfigurationTest.java | 4 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 48 +++++++++++++++++++ 6 files changed, 114 insertions(+), 24 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index d8b1ba813b..2801782f4d 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -4,32 +4,12 @@ 7013 - com/google/cloud/bigquery/MaterializedViewDefinition - com.google.cloud.bigquery.Clustering getClustering() + com/google/cloud/bigquery/ExternalTableDefinition + com.google.common.collect.ImmutableList getDecimalTargetTypes() 7013 - com/google/cloud/bigquery/MaterializedViewDefinition - com.google.cloud.bigquery.RangePartitioning getRangePartitioning() - - - 7013 - com/google/cloud/bigquery/MaterializedViewDefinition - com.google.cloud.bigquery.TimePartitioning getTimePartitioning() - - - 7013 - com/google/cloud/bigquery/MaterializedViewDefinition$Builder - com.google.cloud.bigquery.MaterializedViewDefinition$Builder setClustering(com.google.cloud.bigquery.Clustering) - - - 7013 - com/google/cloud/bigquery/MaterializedViewDefinition$Builder - com.google.cloud.bigquery.MaterializedViewDefinition$Builder setRangePartitioning(com.google.cloud.bigquery.RangePartitioning) - - - 7013 - com/google/cloud/bigquery/MaterializedViewDefinition$Builder - com.google.cloud.bigquery.MaterializedViewDefinition$Builder setTimePartitioning(com.google.cloud.bigquery.TimePartitioning) + com/google/cloud/bigquery/ExternalTableDefinition$Builder + com.google.cloud.bigquery.ExternalTableDefinition$Builder setDecimalTargetTypes(java.util.List) \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 1d2cfa2939..2b68a7ff22 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -93,6 +93,17 @@ public Builder setFormatOptions(FormatOptions formatOptions) { return setFormatOptionsInner(formatOptions); } + /** + * Defines the list of possible SQL data types to which the source decimal values are converted. + * This list and the precision and the scale parameters of the decimal field determine the + * target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in + * the specified list and if it supports the precision and the scale. STRING supports all + * precision and scale values. + * + * @param decimalTargetTypes decimalTargetType or {@code null} for none + */ + public abstract Builder setDecimalTargetTypes(List decimalTargetTypes); + abstract Builder setFormatOptionsInner(FormatOptions formatOptions); /** @@ -229,6 +240,9 @@ public F getFormatOptions() { @Nullable abstract FormatOptions getFormatOptionsInner(); + @Nullable + public abstract ImmutableList getDecimalTargetTypes(); + /** * [Experimental] Returns whether automatic detection of schema and format options should be * performed. @@ -283,6 +297,9 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getSourceUris() != null) { externalConfigurationPb.setSourceUris(getSourceUris()); } + if (getDecimalTargetTypes() != null) { + externalConfigurationPb.setDecimalTargetTypes(getDecimalTargetTypes()); + } if (getFormatOptions() != null && FormatOptions.CSV.equals(getFormatOptions().getType())) { externalConfigurationPb.setCsvOptions(((CsvOptions) getFormatOptions()).toPb()); } @@ -430,6 +447,10 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (externalDataConfiguration.getSourceUris() != null) { builder.setSourceUris(ImmutableList.copyOf(externalDataConfiguration.getSourceUris())); } + if (externalDataConfiguration.getDecimalTargetTypes() != null) { + builder.setDecimalTargetTypes( + ImmutableList.copyOf(externalDataConfiguration.getDecimalTargetTypes())); + } if (externalDataConfiguration.getSourceFormat() != null) { builder.setFormatOptions(FormatOptions.of(externalDataConfiguration.getSourceFormat())); } @@ -469,6 +490,9 @@ static ExternalTableDefinition fromExternalDataConfiguration( if (externalDataConfiguration.getSourceUris() != null) { builder.setSourceUris(externalDataConfiguration.getSourceUris()); } + if (externalDataConfiguration.getDecimalTargetTypes() != null) { + builder.setDecimalTargetTypes(externalDataConfiguration.getDecimalTargetTypes()); + } if (externalDataConfiguration.getSchema() != null) { builder.setSchema(Schema.fromPb(externalDataConfiguration.getSchema())); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index a317f1285f..2f625acf54 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -38,6 +38,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final List sourceUris; private final TableId destinationTable; + private final List decimalTargetTypes; private final EncryptionConfiguration destinationEncryptionConfiguration; private final JobInfo.CreateDisposition createDisposition; private final JobInfo.WriteDisposition writeDisposition; @@ -61,6 +62,7 @@ public static final class Builder extends JobConfiguration.Builder sourceUris; private TableId destinationTable; + private List decimalTargetTypes; private EncryptionConfiguration destinationEncryptionConfiguration; private JobInfo.CreateDisposition createDisposition; private JobInfo.WriteDisposition writeDisposition; @@ -87,6 +89,7 @@ private Builder() { private Builder(LoadJobConfiguration loadConfiguration) { this(); this.destinationTable = loadConfiguration.destinationTable; + this.decimalTargetTypes = loadConfiguration.decimalTargetTypes; this.createDisposition = loadConfiguration.createDisposition; this.writeDisposition = loadConfiguration.writeDisposition; this.formatOptions = loadConfiguration.formatOptions; @@ -112,6 +115,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this(); JobConfigurationLoad loadConfigurationPb = configurationPb.getLoad(); this.destinationTable = TableId.fromPb(loadConfigurationPb.getDestinationTable()); + if (loadConfigurationPb.getDecimalTargetTypes() != null) { + this.decimalTargetTypes = ImmutableList.copyOf(loadConfigurationPb.getDecimalTargetTypes()); + } if (loadConfigurationPb.getCreateDisposition() != null) { this.createDisposition = JobInfo.CreateDisposition.valueOf(loadConfigurationPb.getCreateDisposition()); @@ -278,6 +284,20 @@ public Builder setSourceUris(List sourceUris) { return this; } + /** + * Defines the list of possible SQL data types to which the source decimal values are converted. + * This list and the precision and the scale parameters of the decimal field determine the + * target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in + * the specified list and if it supports the precision and the scale. STRING supports all + * precision and scale values. + * + * @param decimalTargetTypes decimalTargetType or {@code null} for none + */ + public Builder setDecimalTargetTypes(List decimalTargetTypes) { + this.decimalTargetTypes = decimalTargetTypes; + return this; + } + public Builder setAutodetect(Boolean autodetect) { this.autodetect = autodetect; return this; @@ -341,6 +361,7 @@ private LoadJobConfiguration(Builder builder) { super(builder); this.sourceUris = builder.sourceUris; this.destinationTable = builder.destinationTable; + this.decimalTargetTypes = builder.decimalTargetTypes; this.createDisposition = builder.createDisposition; this.writeDisposition = builder.writeDisposition; this.formatOptions = builder.formatOptions; @@ -430,6 +451,10 @@ public List getSourceUris() { return sourceUris; } + public List getDecimalTargetTypes() { + return decimalTargetTypes; + } + public Boolean getAutodetect() { return autodetect; } @@ -482,6 +507,7 @@ public Builder toBuilder() { ToStringHelper toStringHelper() { return super.toStringHelper() .add("destinationTable", destinationTable) + .add("decimalTargetTypes", decimalTargetTypes) .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("createDisposition", createDisposition) .add("writeDisposition", writeDisposition) @@ -568,6 +594,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (sourceUris != null) { loadConfigurationPb.setSourceUris(ImmutableList.copyOf(sourceUris)); } + if (decimalTargetTypes != null) { + loadConfigurationPb.setDecimalTargetTypes(ImmutableList.copyOf(decimalTargetTypes)); + } if (schemaUpdateOptions != null) { ImmutableList.Builder schemaUpdateOptionsBuilder = new ImmutableList.Builder<>(); for (JobInfo.SchemaUpdateOption schemaUpdateOption : schemaUpdateOptions) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 23a095cb65..38dcd27142 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -27,6 +27,8 @@ public class ExternalTableDefinitionTest { private static final List SOURCE_URIS = ImmutableList.of("uri1", "uri2"); + private static final List DECIMAL_TARGET_TYPES = + ImmutableList.of("NUMERIC", "BIGNUMERIC", "STRING"); private static final Field FIELD_SCHEMA1 = Field.newBuilder("StringField", LegacySQLTypeName.STRING) .setMode(Field.Mode.NULLABLE) @@ -56,6 +58,7 @@ public class ExternalTableDefinitionTest { .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) + .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) .setCompression(COMPRESSION) .setConnectionId(CONNECTION_ID) .setIgnoreUnknownValues(IGNORE_UNKNOWN_VALUES) @@ -111,6 +114,7 @@ public void testBuilder() { assertEquals(MAX_BAD_RECORDS, EXTERNAL_TABLE_DEFINITION.getMaxBadRecords()); assertEquals(TABLE_SCHEMA, EXTERNAL_TABLE_DEFINITION.getSchema()); assertEquals(SOURCE_URIS, EXTERNAL_TABLE_DEFINITION.getSourceUris()); + assertEquals(DECIMAL_TARGET_TYPES, EXTERNAL_TABLE_DEFINITION.getDecimalTargetTypes()); assertEquals(AUTODETECT, EXTERNAL_TABLE_DEFINITION.getAutodetect()); assertEquals(HIVE_PARTITIONING_OPTIONS, EXTERNAL_TABLE_DEFINITION.getHivePartitioningOptions()); assertNotEquals(EXTERNAL_TABLE_DEFINITION, TableDefinition.Type.EXTERNAL); @@ -130,6 +134,7 @@ public void testToAndFromPb() { private void compareExternalTableDefinition( ExternalTableDefinition expected, ExternalTableDefinition value) { assertEquals(expected, value); + assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); assertEquals(expected.getCompression(), value.getCompression()); assertEquals(expected.getConnectionId(), value.getConnectionId()); assertEquals(expected.getFormatOptions(), value.getFormatOptions()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 9f42d62b72..a2f164f8af 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -50,6 +50,8 @@ public class LoadJobConfigurationTest { .setDescription("FieldDescription") .build(); private static final List SOURCE_URIS = ImmutableList.of("uri1", "uri2"); + private static final List DECIMAL_TARGET_TYPES = + ImmutableList.of("NUMERIC", "BIGNUMERIC", "STRING"); private static final List SCHEMA_UPDATE_OPTIONS = ImmutableList.of(SchemaUpdateOption.ALLOW_FIELD_ADDITION); private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA); @@ -76,6 +78,7 @@ public class LoadJobConfigurationTest { .build(); private static final LoadJobConfiguration LOAD_CONFIGURATION_CSV = LoadJobConfiguration.newBuilder(TABLE_ID, SOURCE_URIS) + .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) .setCreateDisposition(CREATE_DISPOSITION) .setWriteDisposition(WRITE_DISPOSITION) .setFormatOptions(CSV_OPTIONS) @@ -228,6 +231,7 @@ private void compareLoadJobConfiguration( assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.getDestinationTable(), value.getDestinationTable()); + assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); assertEquals(expected.getCreateDisposition(), value.getCreateDisposition()); assertEquals(expected.getWriteDisposition(), value.getWriteDisposition()); assertEquals(expected.getCsvOptions(), value.getCsvOptions()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index eae807bf74..b151ad22c0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2747,6 +2747,54 @@ public void testLoadJobWithRangePartitioning() throws InterruptedException { } } + @Test + public void testLoadJobWithDecimalTargetTypes() throws InterruptedException { + String tableName = "test_load_job_table_parquet_decimalTargetTypes"; + TableId destinationTable = TableId.of(DATASET, tableName); + String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; + try { + LoadJobConfiguration configuration = + LoadJobConfiguration.newBuilder(destinationTable, sourceUri, FormatOptions.parquet()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setDecimalTargetTypes(ImmutableList.of("NUMERIC", "BIGNUMERIC", "STRING")) + .build(); + Job job = bigquery.create(JobInfo.of(configuration)); + job = job.waitFor(); + assertNull(job.getStatus().getError()); + LoadJobConfiguration loadJobConfiguration = job.getConfiguration(); + assertEquals( + ImmutableList.of("NUMERIC", "BIGNUMERIC", "STRING"), + loadJobConfiguration.getDecimalTargetTypes()); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertEquals( + remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString(), + "BIGNUMERIC"); + } finally { + bigquery.delete(destinationTable); + } + } + + @Test + public void testExternalTableWithDecimalTargetTypes() throws InterruptedException { + String tableName = "test_create_external_table_parquet_decimalTargetTypes"; + TableId destinationTable = TableId.of(DATASET, tableName); + String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder(sourceUri, FormatOptions.parquet()) + .setDecimalTargetTypes(ImmutableList.of("NUMERIC", "BIGNUMERIC", "STRING")) + .build(); + TableInfo tableInfo = TableInfo.of(destinationTable, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + assertNotNull(createdTable); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertEquals( + remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString(), + "BIGNUMERIC"); + assertTrue(remoteTable.delete()); + } + @Test public void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { String tableName = "test_query_job_table"; From 5399d0fe858443d9b4cbca0847122ffaed711b2d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 17:00:06 +0000 Subject: [PATCH 0191/2268] chore: release 1.133.0 (#1361) :robot: I have created a release \*beep\* \*boop\* --- ## [1.133.0](https://www.github.com/googleapis/java-bigquery/compare/v1.132.1...v1.133.0) (2021-06-08) ### Features * add support for DecimalTargetTypes ([#1345](https://www.github.com/googleapis/java-bigquery/issues/1345)) ([ba528df](https://www.github.com/googleapis/java-bigquery/commit/ba528df03def71907e2811cf267718f090605d95)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.26.1 ([#1360](https://www.github.com/googleapis/java-bigquery/issues/1360)) ([bf55699](https://www.github.com/googleapis/java-bigquery/commit/bf55699d849de7e873577de04e44fbfe0f078ab1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d028a6fed..f04d03d844 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.133.0](https://www.github.com/googleapis/java-bigquery/compare/v1.132.1...v1.133.0) (2021-06-08) + + +### Features + +* add support for DecimalTargetTypes ([#1345](https://www.github.com/googleapis/java-bigquery/issues/1345)) ([ba528df](https://www.github.com/googleapis/java-bigquery/commit/ba528df03def71907e2811cf267718f090605d95)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.26.1 ([#1360](https://www.github.com/googleapis/java-bigquery/issues/1360)) ([bf55699](https://www.github.com/googleapis/java-bigquery/commit/bf55699d849de7e873577de04e44fbfe0f078ab1)) + ### [1.132.1](https://www.github.com/googleapis/java-bigquery/compare/v1.132.0...v1.132.1) (2021-06-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 52a24ad252..67260984db 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.132.2-SNAPSHOT + 1.133.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b485b5fba2..d7e5074bc4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.132.2-SNAPSHOT + 1.133.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.132.2-SNAPSHOT + 1.133.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0a95d98a37..6422aadc60 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.132.2-SNAPSHOT + 1.133.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.132.2-SNAPSHOT + 1.133.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 84ebb2b0fe..e4b9f94c39 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.132.2-SNAPSHOT + 1.133.0 diff --git a/versions.txt b/versions.txt index f0291dc532..4834b9a2a5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.132.1:1.132.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.133.0:1.133.0 \ No newline at end of file From f7eb31988137eef84b4d1a6cccc2daf3c65743b3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Jun 2021 17:12:03 +0000 Subject: [PATCH 0192/2268] chore: release 1.133.1-SNAPSHOT (#1365) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 67260984db..bd3dead621 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.133.0 + 1.133.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d7e5074bc4..b031beaf3e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.133.0 + 1.133.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.133.0 + 1.133.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6422aadc60..48fee4056b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.133.0 + 1.133.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.133.0 + 1.133.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e4b9f94c39..0e345790b6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.133.0 + 1.133.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4834b9a2a5..7813dd8121 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.133.0:1.133.0 \ No newline at end of file +google-cloud-bigquery:1.133.0:1.133.1-SNAPSHOT \ No newline at end of file From ac8e8989fce16ab32bfefda489651a521c699570 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Jun 2021 21:33:16 +0200 Subject: [PATCH 0193/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.133.0 (#1366) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6608f9aa5b..ce62adf8c0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.132.1 + 1.133.0 From 16580cb2bd1b50ef1d7fd91fb92719845101222e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 8 Jun 2021 12:46:04 -0700 Subject: [PATCH 0194/2268] chore: regenerate README (#1367) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-08 19:35:39,135 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-08 19:35:40,678 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/5d253c17-a368-49f7-90c2-51ab60246653/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index c316b69a1c..9c541bc1db 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "44c1a5d0083521b260bfa490c91b72051885eb4d" + "sha": "ac8e8989fce16ab32bfefda489651a521c699570" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8da7927493739fa36130360019ca21258242f73a" + "sha": "2430f8d90ed8a508e8422a3a7191e656d5a6bf53" } } ] diff --git a/README.md b/README.md index a15eb421a7..0bc040c91d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.132.1 + 1.133.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.132.1' +compile 'com.google.cloud:google-cloud-bigquery:1.133.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.132.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.133.0" ``` ## Authentication From dab6e48519928f32ca106fc738083284787e032d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Jun 2021 23:11:42 +0200 Subject: [PATCH 0195/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.3 (#1368) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ce62adf8c0..3e46031f78 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.2 + 1.1.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0e345790b6..456f7f2c8b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.2 + 1.1.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6682efa6c1..9d0ad9dc6a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.2 + 1.1.3 test From 68808e9f47c07af598324f3f07dd996bc1e5297b Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Tue, 15 Jun 2021 22:11:10 +0530 Subject: [PATCH 0196/2268] fix: handle specific exceptions (#1370) * Extending BaseService to create BIGQUERY_EXCEPTION_HANDLER with retry * Replacing EXCEPTION_HANDLER with BIGQUERY_EXCEPTION_HANDLER with retry logic * Adding retryOn java.net.UnknownHostException * Adding License Information * Reverting to EXCEPTION_HANDLER for create method, using BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER for listDataset * Using BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER for query method * Reverting back to EXCEPTION_HANDLER for create method * Updating to "Copyright 2021" * Fixed formatting * Fixed formatting --- .../cloud/bigquery/BigQueryBaseService.java | 36 +++++++++++++++++++ .../google/cloud/bigquery/BigQueryImpl.java | 5 ++- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java new file mode 100644 index 0000000000..aefb4329b6 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.cloud.BaseService; +import com.google.cloud.ExceptionHandler; +import com.google.cloud.ServiceOptions; + +abstract class BigQueryBaseService> + extends BaseService { + + protected BigQueryBaseService(ServiceOptions options) { + super(options); + } + + public static final ExceptionHandler BIGQUERY_EXCEPTION_HANDLER = + ExceptionHandler.newBuilder() + .abortOn(RuntimeException.class) + .retryOn(java.net.ConnectException.class) // retry on Connection Exception + .retryOn(java.net.UnknownHostException.class) // retry on UnknownHostException + .addInterceptors(EXCEPTION_HANDLER_INTERCEPTOR) + .build(); +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index d402ce549a..12eb09c5a6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.google.cloud.bigquery; import static com.google.cloud.RetryHelper.runWithRetries; @@ -458,7 +457,7 @@ private static Page listDatasets( } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.x(); return new PageImpl<>( @@ -1256,7 +1255,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw BigQueryException.translateAndThrow(e); From d064b7b363508d1a958b92563c5df1d1c429c69d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 16 Jun 2021 02:16:47 +0200 Subject: [PATCH 0197/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.116.0 (#1375) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 48fee4056b..e12f13e516 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.115.0 + 1.116.0 test From 8da5ba9e0f3ffc42f201e328ebf5c4c185cab862 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 14:26:02 +0000 Subject: [PATCH 0198/2268] chore: release 1.133.1 (#1372) :robot: I have created a release \*beep\* \*boop\* --- ### [1.133.1](https://www.github.com/googleapis/java-bigquery/compare/v1.133.0...v1.133.1) (2021-06-16) ### Bug Fixes * handle specific exceptions ([#1370](https://www.github.com/googleapis/java-bigquery/issues/1370)) ([68808e9](https://www.github.com/googleapis/java-bigquery/commit/68808e9f47c07af598324f3f07dd996bc1e5297b)) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v1.116.0 ([#1375](https://www.github.com/googleapis/java-bigquery/issues/1375)) ([d064b7b](https://www.github.com/googleapis/java-bigquery/commit/d064b7b363508d1a958b92563c5df1d1c429c69d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f04d03d844..dc606a11d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [1.133.1](https://www.github.com/googleapis/java-bigquery/compare/v1.133.0...v1.133.1) (2021-06-16) + + +### Bug Fixes + +* handle specific exceptions ([#1370](https://www.github.com/googleapis/java-bigquery/issues/1370)) ([68808e9](https://www.github.com/googleapis/java-bigquery/commit/68808e9f47c07af598324f3f07dd996bc1e5297b)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v1.116.0 ([#1375](https://www.github.com/googleapis/java-bigquery/issues/1375)) ([d064b7b](https://www.github.com/googleapis/java-bigquery/commit/d064b7b363508d1a958b92563c5df1d1c429c69d)) + ## [1.133.0](https://www.github.com/googleapis/java-bigquery/compare/v1.132.1...v1.133.0) (2021-06-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bd3dead621..70e1004af5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.133.1-SNAPSHOT + 1.133.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b031beaf3e..8f5940353c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.133.1-SNAPSHOT + 1.133.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.133.1-SNAPSHOT + 1.133.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e12f13e516..3c7079eecf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.133.1-SNAPSHOT + 1.133.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.133.1-SNAPSHOT + 1.133.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 456f7f2c8b..30110b3c41 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.133.1-SNAPSHOT + 1.133.1 diff --git a/versions.txt b/versions.txt index 7813dd8121..cbb4bf1b05 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.133.0:1.133.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.133.1:1.133.1 \ No newline at end of file From 74d31342fcfcd28cca333e0dacc0c5bb8a3d2190 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 14:36:03 +0000 Subject: [PATCH 0199/2268] chore: release 1.133.2-SNAPSHOT (#1376) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 70e1004af5..05a82c6f92 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.133.1 + 1.133.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8f5940353c..901f2ded09 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.133.1 + 1.133.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.133.1 + 1.133.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3c7079eecf..7cc66d63f7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.133.1 + 1.133.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.133.1 + 1.133.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 30110b3c41..9955f4699c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.133.1 + 1.133.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index cbb4bf1b05..09ad0c956c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.133.1:1.133.1 \ No newline at end of file +google-cloud-bigquery:1.133.1:1.133.2-SNAPSHOT \ No newline at end of file From b5a8f5b77694ac291145db926abd4f82a054ef50 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 16 Jun 2021 19:31:20 +0200 Subject: [PATCH 0200/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.133.1 (#1377) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3e46031f78..03ef39bfc6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.133.0 + 1.133.1 From c9c948127fa7a07661809698c18b1850207a3479 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 16 Jun 2021 10:44:02 -0700 Subject: [PATCH 0201/2268] chore: regenerate README (#1378) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-16 17:33:37,842 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-16 17:33:39,194 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/318fa6ad-659a-42b1-95fc-669893c2a0a5/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 9c541bc1db..596e11b3cb 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "ac8e8989fce16ab32bfefda489651a521c699570" + "sha": "b5a8f5b77694ac291145db926abd4f82a054ef50" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "2430f8d90ed8a508e8422a3a7191e656d5a6bf53" + "sha": "8f76a885deaaf2fe234daeba4a8cc4d1b3de8086" } } ] diff --git a/README.md b/README.md index 0bc040c91d..ec75117f46 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.133.0 + 1.133.1 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.133.0' +compile 'com.google.cloud:google-cloud-bigquery:1.133.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.133.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.133.1" ``` ## Authentication From 4a6906aa1e3ac139973823bdf142e5c280f6ab68 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 20 Jun 2021 00:48:43 +0200 Subject: [PATCH 0202/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.5 (#1380) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7cc66d63f7..5c796283f3 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210529-1.31.0 + v2-rev20210529-1.31.5 1.3.0
From f034a99806613fc6abb5587c56362fe38d60bebc Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Sun, 20 Jun 2021 04:19:08 +0530 Subject: [PATCH 0203/2268] fix: bug fix for get method of Bigquery Dataset (#1379) * Adding the projectId used of getting the DataSet as a parameter for the issue: https://github.com/googleapis/java-bigquery/issues/1369 * Adding the projectId used of getting the DataSet as a parameter for the issue: https://github.com/googleapis/java-bigquery/issues/1369 * Added testcase for getTable with projectId. --- .../java/com/google/cloud/bigquery/Dataset.java | 9 ++++++++- .../com/google/cloud/bigquery/DatasetTest.java | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index 05a7e85662..48ccd43142 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -23,6 +23,7 @@ import com.google.cloud.bigquery.BigQuery.DatasetOption; import com.google.cloud.bigquery.BigQuery.TableListOption; import com.google.cloud.bigquery.BigQuery.TableOption; +import com.google.common.base.Strings; import java.io.IOException; import java.io.ObjectInputStream; import java.util.List; @@ -275,7 +276,13 @@ public Page list(TableListOption... options) { * @throws BigQueryException upon failure */ public Table get(String tableId, TableOption... options) { - return bigquery.getTable(TableId.of(getDatasetId().getDataset(), tableId), options); + // Adding the projectId used of getting the DataSet as a parameter for the issue: + // https://github.com/googleapis/java-bigquery/issues/1369 + TableId tabId = + Strings.isNullOrEmpty(getDatasetId().getProject()) + ? TableId.of(getDatasetId().getDataset(), tableId) + : TableId.of(getDatasetId().getProject(), getDatasetId().getDataset(), tableId); + return bigquery.getTable(tabId, options); } /** diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index ae710a9fc9..d1c97a6940 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -77,6 +77,12 @@ public class DatasetTest { TableInfo.newBuilder(TableId.of("dataset", "table2"), VIEW_DEFINITION).build(); private static final TableInfo TABLE_INFO3 = TableInfo.newBuilder(TableId.of("dataset", "table3"), EXTERNAL_TABLE_DEFINITION).build(); + private static final String NEW_PROJECT_ID = "projectId2"; + private static final TableId TABLE_ID1 = TableId.of(NEW_PROJECT_ID, "dataset", "table3"); + private static final TableInfo TABLE_INFO4 = + TableInfo.newBuilder( + TableId.of(NEW_PROJECT_ID, "dataset", "table3"), EXTERNAL_TABLE_DEFINITION) + .build(); @Rule public MockitoRule rule; @@ -255,6 +261,16 @@ public void testGet() { verify(bigquery).getTable(TABLE_INFO1.getTableId()); } + @Test + public void testGetTableWithNewProjectId() { + Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO4)); + when(bigquery.getTable(TABLE_ID1, null)).thenReturn(expectedTable); + Table table = bigquery.getTable(TABLE_ID1, null); + assertNotNull(table); + assertEquals(table.getTableId().getProject(), NEW_PROJECT_ID); + verify(bigquery).getTable(TABLE_ID1, null); + } + @Test public void testGetNull() { when(bigquery.getTable(TABLE_INFO1.getTableId())).thenReturn(null); From 4059a8b778e86fca3a39a153f4368531ef89936c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 19 Jun 2021 15:59:53 -0700 Subject: [PATCH 0204/2268] chore: minimize noise from build scripts (#1381) This should limit the amount of scrolling client devs have to do when debugging a test failure Co-authored-by: Elliotte Rusty Harold Co-authored-by: Neenu Shaji Source-Author: Igor Bernstein Source-Date: Fri Jun 18 17:28:07 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 1c0c698705e668ccb3d68556ae7260f16ce63a6e Source-Link: https://github.com/googleapis/synthtool/commit/1c0c698705e668ccb3d68556ae7260f16ce63a6e --- .kokoro/coerce_logs.sh | 1 - synth.metadata | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh index 5cf7ba49e6..46edbf7f2f 100755 --- a/.kokoro/coerce_logs.sh +++ b/.kokoro/coerce_logs.sh @@ -28,7 +28,6 @@ job=$(basename ${KOKORO_JOB_NAME}) echo "coercing sponge logs..." for xml in `find . -name *-sponge_log.xml` do - echo "processing ${xml}" class=$(basename ${xml} | cut -d- -f2) dir=$(dirname ${xml})/${job}/${class} text=$(dirname ${xml})/${class}-sponge_log.txt diff --git a/synth.metadata b/synth.metadata index c36d006ae1..c7077792b6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "f7be534a5a7fb79232bcd3d082365033262f6dcb" + "sha": "c9c948127fa7a07661809698c18b1850207a3479" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8eae0234a16b26c2ff616d305dbd9786c8b10a47" + "sha": "1c0c698705e668ccb3d68556ae7260f16ce63a6e" } } ], @@ -80,6 +80,7 @@ "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", + "SECURITY.md", "java.header", "license-checks.xml", "samples/install-without-bom/pom.xml", From b09f951d9debe783c5f67c3e9479fb640722a8bd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Jun 2021 23:42:24 +0200 Subject: [PATCH 0205/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210611-1.31.5 (#1383) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c796283f3..e876968fa7 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210529-1.31.5 + v2-rev20210611-1.31.5 1.3.0 From 6c4d886a3875eaed5d7c10b82f6c064c1995b6ca Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 22 Jun 2021 23:40:07 +0200 Subject: [PATCH 0206/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.27.0 (#1384) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 03ef39bfc6..453ad54842 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.26.1 + 1.27.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9955f4699c..d4f9961db1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.26.1 + 1.27.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9d0ad9dc6a..ef77627836 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.26.1 + 1.27.0 test From d7bb8300f66edf6900c0ab27d046b0fb753a2222 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 23 Jun 2021 17:32:28 +0200 Subject: [PATCH 0207/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.7.0 (#1385) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ef77627836..23f3117c5e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.6.0 + 20.7.0 pom import From 9a552eb94684fd6b8b11013790f17bf13cdc50d7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 23 Jun 2021 08:46:30 -0700 Subject: [PATCH 0208/2268] chore: regenerate README (#1386) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-23 15:34:43,339 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-23 15:34:44,704 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/2bc88ac7-ef0e-481f-8300-def1cd51d674/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 596e11b3cb..aa07f22ba2 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "b5a8f5b77694ac291145db926abd4f82a054ef50" + "sha": "d7bb8300f66edf6900c0ab27d046b0fb753a2222" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8f76a885deaaf2fe234daeba4a8cc4d1b3de8086" + "sha": "9763f20e4b7bb1091082462b2f7970e965d0d414" } } ] diff --git a/README.md b/README.md index ec75117f46..a6b3bd6218 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.6.0 + 20.7.0 pom import @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.6.0') +implementation platform('com.google.cloud:libraries-bom:20.7.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From ac854c42fa4339f688c03d121e25df6030eabd3f Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 24 Jun 2021 13:06:13 -0400 Subject: [PATCH 0209/2268] docs(sample): update UpdateTableExpiration sample (#1389) Fixes #1371 --- .../main/java/com/example/bigquery/UpdateTableExpiration.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java b/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java index e66353741e..a0a1ebd770 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java +++ b/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java @@ -30,7 +30,8 @@ public static void main(String[] args) { String datasetName = "MY_DATASET_NAME"; String tableName = "MY_TABLE_NAME"; // Update table expiration to one day. - Long newExpiration = TimeUnit.MILLISECONDS.convert(1, TimeUnit.DAYS); + Long newExpiration = + TimeUnit.MILLISECONDS.convert(1, TimeUnit.DAYS) + System.currentTimeMillis(); updateTableExpiration(datasetName, tableName, newExpiration); } From 95f1a6c2e3281d61d38660749cf31fa504ddf8e0 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 24 Jun 2021 17:48:15 -0400 Subject: [PATCH 0210/2268] feat: add support for jobs.delete (#1387) * feat: add support for jobs.delete * update IT * lint * updates --- .../clirr-ignored-differences.xml | 12 +++++----- .../com/google/cloud/bigquery/BigQuery.java | 8 +++++++ .../google/cloud/bigquery/BigQueryImpl.java | 24 +++++++++++++++++++ .../cloud/bigquery/spi/v2/BigQueryRpc.java | 8 +++++++ .../bigquery/spi/v2/HttpBigQueryRpc.java | 15 ++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 14 +++++++++++ 6 files changed, 75 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 2801782f4d..4d66f0620e 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -3,13 +3,13 @@ - 7013 - com/google/cloud/bigquery/ExternalTableDefinition - com.google.common.collect.ImmutableList getDecimalTargetTypes() + 7012 + com/google/cloud/bigquery/BigQuery + boolean delete(com.google.cloud.bigquery.JobId) - 7013 - com/google/cloud/bigquery/ExternalTableDefinition$Builder - com.google.cloud.bigquery.ExternalTableDefinition$Builder setDecimalTargetTypes(java.util.List) + 7012 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + boolean deleteJob(java.lang.String, java.lang.String, java.lang.String) \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 70a29fd9ff..4e88f000f5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -982,6 +982,14 @@ public int hashCode() { */ boolean delete(RoutineId routineId); + /** + * Deletes the requested job. + * + * @return {@code true} if job was deleted, {@code false} if it was not found + * @throws BigQueryException upon failure + */ + boolean delete(JobId jobId); + /** * Updates dataset information. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 12eb09c5a6..4086c6a735 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -585,6 +585,30 @@ public Boolean call() { } } + @Override + public boolean delete(JobId jobId) { + final JobId completeJobId = + jobId.setProjectId( + Strings.isNullOrEmpty(jobId.getProject()) + ? getOptions().getProjectId() + : jobId.getProject()); + try { + return runWithRetries( + new Callable() { + @Override + public Boolean call() { + return bigQueryRpc.deleteJob( + completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); + } + }, + getOptions().getRetrySettings(), + EXCEPTION_HANDLER, + getOptions().getClock()); + } catch (RetryHelper.RetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + } + @Override public Dataset update(DatasetInfo datasetInfo, DatasetOption... options) { final com.google.api.services.bigquery.model.Dataset datasetPb = diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index c9b0f0a21d..06488c5b4f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -270,6 +270,14 @@ TableDataList listTableData( */ boolean cancel(String projectId, String jobId, String location); + /** + * Sends a job delete request. + * + * @return {@code true} if delete was successful, {@code false} if the job was not found + * @throws BigQueryException upon failure + */ + boolean deleteJob(String projectId, String jobName, String location); + /** * Returns results of the query associated with the provided job. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 4d9558454d..24d7dd6b0b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -607,6 +607,21 @@ public boolean cancel(String projectId, String jobId, String location) { } } + @Override + public boolean deleteJob(String projectId, String jobName, String location) { + try { + bigquery + .jobs() + .delete(projectId, jobName) + .setLocation(location) + .setPrettyPrint(false) + .execute(); + return true; + } catch (IOException ex) { + throw translate(ex); + } + } + @Override public GetQueryResultsResponse getQueryResults( String projectId, String jobId, String location, Map options) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b151ad22c0..e072cf0f7d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1243,6 +1243,20 @@ public void testDeleteNonExistingTable() { assertFalse(bigquery.delete("test_delete_non_existing_table")); } + @Test + public void testDeleteJob() { + String query = "SELECT 17 as foo"; + QueryJobConfiguration config = QueryJobConfiguration.of(query); + String jobName = "jobId_" + UUID.randomUUID().toString(); + JobId jobId = + JobId.newBuilder().setLocation("us-east1").setJob(jobName).setProject(PROJECT_ID).build(); + Job createdJob = bigquery.create(JobInfo.of(jobId, config)); + Job remoteJob = bigquery.getJob(createdJob.getJobId()); + assertEquals(createdJob.getJobId(), remoteJob.getJobId()); + assertTrue(bigquery.delete(jobId)); + assertNull(bigquery.getJob(jobId)); + } + @Test public void testInsertAll() throws IOException { String tableName = "test_insert_all_table"; From b1fb57c0b43f4bdc9e32b821b32e95bb1ca8df3b Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 24 Jun 2021 20:36:30 -0400 Subject: [PATCH 0211/2268] feat: add support for parameterized type (#1390) Fixes #1309 --- .../java/com/google/cloud/bigquery/Field.java | 88 +++++++++++++++++++ .../com/google/cloud/bigquery/SchemaTest.java | 3 + .../cloud/bigquery/it/ITBigQueryTest.java | 45 ++++++++++ 3 files changed, 136 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 1213bc4e8b..20c5acd3fa 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -59,6 +59,9 @@ public TableFieldSchema apply(Field field) { private final String mode; private final String description; private final PolicyTags policyTags; + private final Long maxLength; + private final Long scale; + private final Long precision; /** * Mode for a BigQuery Table field. {@link Mode#NULLABLE} fields can be set to {@code null}, @@ -79,6 +82,9 @@ public static final class Builder { private String mode; private String description; private PolicyTags policyTags; + private Long maxLength; + private Long scale; + private Long precision; private Builder() {} @@ -89,6 +95,9 @@ private Builder(Field field) { this.mode = field.mode; this.description = field.description; this.policyTags = field.policyTags; + this.maxLength = field.maxLength; + this.scale = field.scale; + this.precision = field.precision; } /** @@ -199,6 +208,43 @@ public Builder setPolicyTags(PolicyTags policyTags) { return this; } + /** + * Sets the maximum length of the field for STRING or BYTES type. + * + *

It is invalid to set value for types other than STRING or BYTES. + * + *

For STRING type, this represents the maximum UTF-8 length of strings allowed in the field. + * For BYTES type, this represents the maximum number of bytes in the field. + */ + public Builder setMaxLength(Long maxLength) { + this.maxLength = maxLength; + return this; + } + + /** + * Scale can be used to constrain the maximum number of digits in the fractional part of a + * NUMERIC or BIGNUMERIC type. If the Scale value is set, the Precision value must be set as + * well. It is invalid to set values for Scale for types other than NUMERIC or BIGNUMERIC. See + * the Precision field for additional guidance about valid values. + */ + public Builder setScale(Long scale) { + this.scale = scale; + return this; + } + + /** + * Precision can be used to constrain the maximum number of total digits allowed for NUMERIC or + * BIGNUMERIC types. It is invalid to set values for Precision for types other than // NUMERIC + * or BIGNUMERIC. For NUMERIC type, acceptable values for Precision must be: 1 ≤ (Precision - + * Scale) ≤ 29. Values for Scale must be: 0 ≤ Scale ≤ 9. For BIGNUMERIC type, acceptable values + * for Precision must be: 1 ≤ (Precision - Scale) ≤ 38. Values for Scale must be: 0 ≤ Scale ≤ + * 38. + */ + public Builder setPrecision(Long precision) { + this.precision = precision; + return this; + } + /** Creates a {@code Field} object. */ public Field build() { return new Field(this); @@ -212,6 +258,9 @@ private Field(Builder builder) { this.mode = builder.mode; this.description = builder.description; this.policyTags = builder.policyTags; + this.maxLength = builder.maxLength; + this.scale = builder.scale; + this.precision = builder.precision; } /** Returns the field name. */ @@ -244,6 +293,24 @@ public PolicyTags getPolicyTags() { return policyTags; } + /** Returns the maximum length of the field for STRING or BYTES type. */ + public Long getMaxLength() { + return maxLength; + } + + /** + * Returns the maximum number of digits set in the fractional part of a NUMERIC or BIGNUMERIC + * type. + */ + public Long getScale() { + return scale; + } + + /** Returns the maximum number of total digits allowed for NUMERIC or BIGNUMERIC types. */ + public Long getPrecision() { + return precision; + } + /** * Returns the list of sub-fields if {@link #getType()} is a {@link LegacySQLTypeName#RECORD}. * Returns {@code null} otherwise. @@ -265,6 +332,9 @@ public String toString() { .add("mode", mode) .add("description", description) .add("policyTags", policyTags) + .add("maxLength", maxLength) + .add("scale", scale) + .add("precision", precision) .toString(); } @@ -335,6 +405,15 @@ TableFieldSchema toPb() { if (policyTags != null) { fieldSchemaPb.setPolicyTags(policyTags.toPb()); } + if (maxLength != null) { + fieldSchemaPb.setMaxLength(maxLength); + } + if (scale != null) { + fieldSchemaPb.setScale(scale); + } + if (precision != null) { + fieldSchemaPb.setPrecision(precision); + } if (getSubFields() != null) { List fieldsPb = Lists.transform(getSubFields(), TO_PB_FUNCTION); fieldSchemaPb.setFields(fieldsPb); @@ -354,6 +433,15 @@ static Field fromPb(TableFieldSchema fieldSchemaPb) { if (fieldSchemaPb.getPolicyTags() != null) { fieldBuilder.setPolicyTags(PolicyTags.fromPb(fieldSchemaPb.getPolicyTags())); } + if (fieldSchemaPb.getMaxLength() != null) { + fieldBuilder.setMaxLength(fieldSchemaPb.getMaxLength()); + } + if (fieldSchemaPb.getScale() != null) { + fieldBuilder.setScale(fieldSchemaPb.getScale()); + } + if (fieldSchemaPb.getPrecision() != null) { + fieldBuilder.setPrecision(fieldSchemaPb.getPrecision()); + } FieldList subFields = fieldSchemaPb.getFields() != null ? FieldList.of(Lists.transform(fieldSchemaPb.getFields(), FROM_PB_FUNCTION)) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java index 63c6752d73..7f53680e62 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java @@ -32,6 +32,9 @@ public class SchemaTest { Field.newBuilder("StringField", LegacySQLTypeName.STRING) .setMode(Field.Mode.NULLABLE) .setDescription("FieldDescription1") + .setPrecision(20L) + .setScale(20L) + .setMaxLength(10L) .build(); private static final Field FIELD_SCHEMA2 = Field.newBuilder("IntegerField", LegacySQLTypeName.INTEGER) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e072cf0f7d..4d7b30bef6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -90,6 +90,7 @@ import com.google.cloud.bigquery.StandardSQLDataType; import com.google.cloud.bigquery.StandardSQLField; import com.google.cloud.bigquery.StandardSQLTableType; +import com.google.cloud.bigquery.StandardSQLTypeName; import com.google.cloud.bigquery.StandardTableDefinition; import com.google.cloud.bigquery.Table; import com.google.cloud.bigquery.TableDataWriteChannel; @@ -703,6 +704,50 @@ public void testCreateTableWithRangePartitioning() { } } + @Test + public void testCreateTableWithConstraints() { + String tableName = "test_create_table_with_constraints"; + TableId tableId = TableId.of(DATASET, tableName); + Field stringFieldWithConstraint = + Field.newBuilder("stringFieldWithConstraint", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("field has a constraint") + .setMaxLength(10L) + .build(); + Field byteFieldWithConstraint = + Field.newBuilder("byteFieldWithConstraint", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .setDescription("field has a constraint") + .setMaxLength(150L) + .build(); + Field numericFieldWithConstraint = + Field.newBuilder("numericFieldWithConstraint", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("field has a constraint") + .setPrecision(20L) + .build(); + Field bigNumericFieldWithConstraint = + Field.newBuilder("bigNumericFieldWithConstraint", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("field has a constraint") + .setPrecision(30L) + .setScale(5L) + .build(); + Schema schema = + Schema.of( + stringFieldWithConstraint, + byteFieldWithConstraint, + numericFieldWithConstraint, + bigNumericFieldWithConstraint); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(schema).build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertEquals(schema, remoteTable.getDefinition().getSchema()); + bigquery.delete(tableId); + } + @Test public void testCreateAndUpdateTableWithPolicyTags() throws IOException { // Set up policy tags in the datacatalog service From 51efc8308817fe4300188d149625af067b1707ba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Jun 2021 01:14:23 +0000 Subject: [PATCH 0212/2268] chore: release 1.134.0 (#1382) :robot: I have created a release \*beep\* \*boop\* --- ## [1.134.0](https://www.github.com/googleapis/java-bigquery/compare/v1.133.1...v1.134.0) (2021-06-25) ### Features * add support for jobs.delete ([#1387](https://www.github.com/googleapis/java-bigquery/issues/1387)) ([95f1a6c](https://www.github.com/googleapis/java-bigquery/commit/95f1a6c2e3281d61d38660749cf31fa504ddf8e0)) * add support for parameterized type ([#1390](https://www.github.com/googleapis/java-bigquery/issues/1390)) ([b1fb57c](https://www.github.com/googleapis/java-bigquery/commit/b1fb57c0b43f4bdc9e32b821b32e95bb1ca8df3b)), closes [#1309](https://www.github.com/googleapis/java-bigquery/issues/1309) ### Bug Fixes * bug fix for get method of Bigquery Dataset ([#1379](https://www.github.com/googleapis/java-bigquery/issues/1379)) ([f034a99](https://www.github.com/googleapis/java-bigquery/commit/f034a99806613fc6abb5587c56362fe38d60bebc)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.5 ([#1380](https://www.github.com/googleapis/java-bigquery/issues/1380)) ([4a6906a](https://www.github.com/googleapis/java-bigquery/commit/4a6906aa1e3ac139973823bdf142e5c280f6ab68)) * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210611-1.31.5 ([#1383](https://www.github.com/googleapis/java-bigquery/issues/1383)) ([b09f951](https://www.github.com/googleapis/java-bigquery/commit/b09f951d9debe783c5f67c3e9479fb640722a8bd)) * update dependency com.google.cloud:google-cloud-bigtable to v1.27.0 ([#1384](https://www.github.com/googleapis/java-bigquery/issues/1384)) ([6c4d886](https://www.github.com/googleapis/java-bigquery/commit/6c4d886a3875eaed5d7c10b82f6c064c1995b6ca)) ### Documentation * **sample:** update UpdateTableExpiration sample ([#1389](https://www.github.com/googleapis/java-bigquery/issues/1389)) ([ac854c4](https://www.github.com/googleapis/java-bigquery/commit/ac854c42fa4339f688c03d121e25df6030eabd3f)), closes [#1371](https://www.github.com/googleapis/java-bigquery/issues/1371) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 25 +++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc606a11d2..158be91a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [1.134.0](https://www.github.com/googleapis/java-bigquery/compare/v1.133.1...v1.134.0) (2021-06-25) + + +### Features + +* add support for jobs.delete ([#1387](https://www.github.com/googleapis/java-bigquery/issues/1387)) ([95f1a6c](https://www.github.com/googleapis/java-bigquery/commit/95f1a6c2e3281d61d38660749cf31fa504ddf8e0)) +* add support for parameterized type ([#1390](https://www.github.com/googleapis/java-bigquery/issues/1390)) ([b1fb57c](https://www.github.com/googleapis/java-bigquery/commit/b1fb57c0b43f4bdc9e32b821b32e95bb1ca8df3b)), closes [#1309](https://www.github.com/googleapis/java-bigquery/issues/1309) + + +### Bug Fixes + +* bug fix for get method of Bigquery Dataset ([#1379](https://www.github.com/googleapis/java-bigquery/issues/1379)) ([f034a99](https://www.github.com/googleapis/java-bigquery/commit/f034a99806613fc6abb5587c56362fe38d60bebc)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210529-1.31.5 ([#1380](https://www.github.com/googleapis/java-bigquery/issues/1380)) ([4a6906a](https://www.github.com/googleapis/java-bigquery/commit/4a6906aa1e3ac139973823bdf142e5c280f6ab68)) +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210611-1.31.5 ([#1383](https://www.github.com/googleapis/java-bigquery/issues/1383)) ([b09f951](https://www.github.com/googleapis/java-bigquery/commit/b09f951d9debe783c5f67c3e9479fb640722a8bd)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.27.0 ([#1384](https://www.github.com/googleapis/java-bigquery/issues/1384)) ([6c4d886](https://www.github.com/googleapis/java-bigquery/commit/6c4d886a3875eaed5d7c10b82f6c064c1995b6ca)) + + +### Documentation + +* **sample:** update UpdateTableExpiration sample ([#1389](https://www.github.com/googleapis/java-bigquery/issues/1389)) ([ac854c4](https://www.github.com/googleapis/java-bigquery/commit/ac854c42fa4339f688c03d121e25df6030eabd3f)), closes [#1371](https://www.github.com/googleapis/java-bigquery/issues/1371) + ### [1.133.1](https://www.github.com/googleapis/java-bigquery/compare/v1.133.0...v1.133.1) (2021-06-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 05a82c6f92..b1825df0a3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.133.2-SNAPSHOT + 1.134.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 901f2ded09..f15ba62daf 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.133.2-SNAPSHOT + 1.134.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.133.2-SNAPSHOT + 1.134.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e876968fa7..76495928e3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.133.2-SNAPSHOT + 1.134.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.133.2-SNAPSHOT + 1.134.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d4f9961db1..23fe7e6ca2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.133.2-SNAPSHOT + 1.134.0 diff --git a/versions.txt b/versions.txt index 09ad0c956c..b3f320e2a0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.133.1:1.133.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.134.0:1.134.0 \ No newline at end of file From e30a3b0ebd683a4b332307e288d27c84abb3f5c2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Jun 2021 01:26:10 +0000 Subject: [PATCH 0213/2268] chore: release 1.134.1-SNAPSHOT (#1391) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b1825df0a3..db93ba62b3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.134.0 + 1.134.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f15ba62daf..328cbbf0ca 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.134.0 + 1.134.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.134.0 + 1.134.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 76495928e3..f4c32ecbaa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.134.0 + 1.134.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.134.0 + 1.134.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 23fe7e6ca2..ae9dd541ce 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.134.0 + 1.134.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index b3f320e2a0..8fac321f34 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.134.0:1.134.0 \ No newline at end of file +google-cloud-bigquery:1.134.0:1.134.1-SNAPSHOT \ No newline at end of file From 05662f3d96ee26d74b8524f1b84e0bd1ec5d0716 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Jun 2021 13:21:01 +0200 Subject: [PATCH 0214/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.134.0 (#1392) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 453ad54842..d209b43758 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.133.1 + 1.134.0 From fda1e5a973d930772c432a4b9f8c0be9549dec6e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Jun 2021 09:36:13 -0700 Subject: [PATCH 0215/2268] chore: regenerate README (#1393) This PR was generated using Autosynth. :rainbow:

Log from Synthtool ``` 2021-06-25 11:23:24,857 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-25 11:23:26,201 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/15600613-ef07-4a28-9a19-6ebcd335a026/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index aa07f22ba2..0cffa91738 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "d7bb8300f66edf6900c0ab27d046b0fb753a2222" + "sha": "05662f3d96ee26d74b8524f1b84e0bd1ec5d0716" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9763f20e4b7bb1091082462b2f7970e965d0d414" + "sha": "e934b93402284f834b510ebbf421864e881dce02" } } ] diff --git a/README.md b/README.md index a6b3bd6218..9fc98244be 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.133.1 + 1.134.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.133.1' +compile 'com.google.cloud:google-cloud-bigquery:1.134.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.133.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.134.0" ``` ## Authentication From 580ac64e98167db7a57ca7e196e792a48822dce1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 28 Jun 2021 19:20:02 +0200 Subject: [PATCH 0216/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.31.5 (#1394) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f4c32ecbaa..61e785d178 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210611-1.31.5 + v2-rev20210617-1.31.5 1.3.0 From 9bd442addfd44ba29ada37d7747d2661ce27dd41 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 17:30:25 +0000 Subject: [PATCH 0217/2268] chore: release 1.134.1 (#1395) :robot: I have created a release \*beep\* \*boop\* --- ### [1.134.1](https://www.github.com/googleapis/java-bigquery/compare/v1.134.0...v1.134.1) (2021-06-28) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.31.5 ([#1394](https://www.github.com/googleapis/java-bigquery/issues/1394)) ([580ac64](https://www.github.com/googleapis/java-bigquery/commit/580ac64e98167db7a57ca7e196e792a48822dce1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 158be91a97..ee5dee8cca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.134.1](https://www.github.com/googleapis/java-bigquery/compare/v1.134.0...v1.134.1) (2021-06-28) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.31.5 ([#1394](https://www.github.com/googleapis/java-bigquery/issues/1394)) ([580ac64](https://www.github.com/googleapis/java-bigquery/commit/580ac64e98167db7a57ca7e196e792a48822dce1)) + ## [1.134.0](https://www.github.com/googleapis/java-bigquery/compare/v1.133.1...v1.134.0) (2021-06-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index db93ba62b3..17d47a3442 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.134.1-SNAPSHOT + 1.134.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 328cbbf0ca..32cfda8d60 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.134.1-SNAPSHOT + 1.134.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.134.1-SNAPSHOT + 1.134.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 61e785d178..5e4f80d520 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.134.1-SNAPSHOT + 1.134.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.134.1-SNAPSHOT + 1.134.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ae9dd541ce..1ce02d6a74 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.134.1-SNAPSHOT + 1.134.1 diff --git a/versions.txt b/versions.txt index 8fac321f34..a3bbd974dc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.134.0:1.134.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.134.1:1.134.1 \ No newline at end of file From d783292f4bd2d971235d8afa6318976856529cb5 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 28 Jun 2021 14:53:45 -0400 Subject: [PATCH 0218/2268] feat: add support for table snapshot (#1320) * feat: add table snapshot support Allows users to generate a persistent copy of an existing table as it were at a given point in time within the same project. * feat: add support for table snapshot * add comment on operationType * lint update and remove extraneous update table snapshot IT * add cleanup for restoredTable * update base on comments * update based on comments --- .../cloud/bigquery/CopyJobConfiguration.java | 30 ++++- .../bigquery/SnapshotTableDefinition.java | 112 ++++++++++++++++++ .../cloud/bigquery/TableDefinition.java | 4 + .../bigquery/CopyJobConfigurationTest.java | 3 +- .../bigquery/SnapshotTableDefinitionTest.java | 72 +++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 84 +++++++++++++ 6 files changed, 301 insertions(+), 4 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SnapshotTableDefinition.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index d0e15e49ee..0b11bf7bea 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -38,6 +38,7 @@ public final class CopyJobConfiguration extends JobConfiguration { private final List sourceTables; private final TableId destinationTable; + private final String operationType; private final JobInfo.CreateDisposition createDisposition; private final JobInfo.WriteDisposition writeDisposition; private final EncryptionConfiguration destinationEncryptionConfiguration; @@ -49,6 +50,7 @@ public static final class Builder private List sourceTables; private TableId destinationTable; + private String operationType; private JobInfo.CreateDisposition createDisposition; private JobInfo.WriteDisposition writeDisposition; private EncryptionConfiguration destinationEncryptionConfiguration; @@ -63,6 +65,7 @@ private Builder(CopyJobConfiguration jobConfiguration) { this(); this.sourceTables = jobConfiguration.sourceTables; this.destinationTable = jobConfiguration.destinationTable; + this.operationType = jobConfiguration.operationType; this.createDisposition = jobConfiguration.createDisposition; this.writeDisposition = jobConfiguration.writeDisposition; this.destinationEncryptionConfiguration = jobConfiguration.destinationEncryptionConfiguration; @@ -74,6 +77,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this(); JobConfigurationTableCopy copyConfigurationPb = configurationPb.getCopy(); this.destinationTable = TableId.fromPb(copyConfigurationPb.getDestinationTable()); + if (copyConfigurationPb.getOperationType() != null) { + this.operationType = copyConfigurationPb.getOperationType(); + } if (copyConfigurationPb.getSourceTables() != null) { this.sourceTables = Lists.transform(copyConfigurationPb.getSourceTables(), TableId.FROM_PB_FUNCTION); @@ -114,6 +120,15 @@ public Builder setDestinationTable(TableId destinationTable) { return this; } + /** + * Sets the supported operation types (COPY, SNAPSHOT or RESTORE) in table copy job. More info: + * https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype + */ + public Builder setOperationType(String operationType) { + this.operationType = operationType; + return this; + } + public Builder setDestinationEncryptionConfiguration( EncryptionConfiguration encryptionConfiguration) { this.destinationEncryptionConfiguration = encryptionConfiguration; @@ -178,6 +193,7 @@ private CopyJobConfiguration(Builder builder) { super(builder); this.sourceTables = checkNotNull(builder.sourceTables); this.destinationTable = checkNotNull(builder.destinationTable); + this.operationType = builder.operationType; this.createDisposition = builder.createDisposition; this.writeDisposition = builder.writeDisposition; this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration; @@ -195,6 +211,11 @@ public TableId getDestinationTable() { return destinationTable; } + /** Returns the table copy job type */ + public String getOperationType() { + return operationType; + } + public EncryptionConfiguration getDestinationEncryptionConfiguration() { return destinationEncryptionConfiguration; } @@ -241,6 +262,7 @@ ToStringHelper toStringHelper() { return super.toStringHelper() .add("sourceTables", sourceTables) .add("destinationTable", destinationTable) + .add("operationType", operationType) .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("createDisposition", createDisposition) .add("writeDisposition", writeDisposition) @@ -260,6 +282,7 @@ public int hashCode() { baseHashCode(), sourceTables, destinationTable, + operationType, createDisposition, writeDisposition, labels, @@ -293,11 +316,12 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { com.google.api.services.bigquery.model.JobConfiguration jobConfiguration = new com.google.api.services.bigquery.model.JobConfiguration(); configurationPb.setDestinationTable(destinationTable.toPb()); - if (sourceTables.size() == 1) { - configurationPb.setSourceTable(sourceTables.get(0).toPb()); - } else { + if (sourceTables != null) { configurationPb.setSourceTables(Lists.transform(sourceTables, TableId.TO_PB_FUNCTION)); } + if (operationType != null) { + configurationPb.setOperationType(operationType); + } if (createDisposition != null) { configurationPb.setCreateDisposition(createDisposition.toString()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SnapshotTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SnapshotTableDefinition.java new file mode 100644 index 0000000000..ad0aeb0ce5 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SnapshotTableDefinition.java @@ -0,0 +1,112 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.client.util.DateTime; +import com.google.api.core.BetaApi; +import com.google.api.services.bigquery.model.Table; +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import javax.annotation.Nullable; + +@AutoValue +@BetaApi +public abstract class SnapshotTableDefinition extends TableDefinition { + + private static final long serialVersionUID = 2113445776046717526L; + + @AutoValue.Builder + public abstract static class Builder + extends TableDefinition.Builder { + + /** Reference describing the ID of the table that was snapshot. * */ + public abstract Builder setBaseTableId(TableId baseTableId); + + /** + * The time at which the base table was snapshot. This value is reported in the JSON response + * using RFC3339 format. * + */ + public abstract Builder setSnapshotTime(String dateTime); + + public abstract Builder setTimePartitioning(TimePartitioning timePartitioning); + + public abstract Builder setRangePartitioning(RangePartitioning rangePartitioning); + + public abstract Builder setClustering(Clustering clustering); + + /** Creates a {@code SnapshotTableDefinition} object. */ + public abstract SnapshotTableDefinition build(); + } + + @Nullable + public abstract TableId getBaseTableId(); + + @Nullable + public abstract String getSnapshotTime(); + + @Nullable + public abstract TimePartitioning getTimePartitioning(); + + @Nullable + public abstract RangePartitioning getRangePartitioning(); + + @Nullable + public abstract Clustering getClustering(); + + /** Returns a builder for a snapshot table definition. */ + public static SnapshotTableDefinition.Builder newBuilder() { + return new AutoValue_SnapshotTableDefinition.Builder().setType(Type.SNAPSHOT); + } + + @VisibleForTesting + public abstract SnapshotTableDefinition.Builder toBuilder(); + + @Override + Table toPb() { + Table tablePb = super.toPb(); + com.google.api.services.bigquery.model.SnapshotDefinition snapshotDefinition = + new com.google.api.services.bigquery.model.SnapshotDefinition(); + snapshotDefinition.setBaseTableReference(getBaseTableId().toPb()); + snapshotDefinition.setSnapshotTime(DateTime.parseRfc3339(getSnapshotTime())); + tablePb.setSnapshotDefinition(snapshotDefinition); + if (getTimePartitioning() != null) { + tablePb.setTimePartitioning(getTimePartitioning().toPb()); + } + if (getRangePartitioning() != null) { + tablePb.setRangePartitioning(getRangePartitioning().toPb()); + } + if (getClustering() != null) { + tablePb.setClustering(getClustering().toPb()); + } + return tablePb; + } + + static SnapshotTableDefinition fromPb(Table tablePb) { + Builder builder = newBuilder().table(tablePb); + com.google.api.services.bigquery.model.SnapshotDefinition snapshotDefinition = + tablePb.getSnapshotDefinition(); + if (snapshotDefinition != null) { + if (snapshotDefinition.getBaseTableReference() != null) { + builder.setBaseTableId(TableId.fromPb(snapshotDefinition.getBaseTableReference())); + } + if (snapshotDefinition.getSnapshotTime() != null) { + builder.setSnapshotTime(snapshotDefinition.getSnapshotTime().toStringRfc3339()); + } + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java index 6babd4e6f4..1fa9024987 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDefinition.java @@ -83,6 +83,8 @@ public Type apply(String constant) { */ public static final Type MODEL = type.createAndRegister("MODEL"); + public static final Type SNAPSHOT = type.createAndRegister("SNAPSHOT"); + private Type(String constant) { super(constant); } @@ -165,6 +167,8 @@ static T fromPb(Table tablePb) { return (T) ExternalTableDefinition.fromPb(tablePb); case "MODEL": return (T) ModelTableDefinition.fromPb(tablePb); + case "SNAPSHOT": + return (T) SnapshotTableDefinition.fromPb(tablePb); default: // never reached throw new IllegalArgumentException("Format " + tablePb.getType() + " is not supported"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java index be62bc1d68..dfe76adafe 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java @@ -113,7 +113,8 @@ public void testToPbAndFromPb() { assertNull(COPY_JOB_CONFIGURATION.toPb().getExtract()); assertNull(COPY_JOB_CONFIGURATION.toPb().getLoad()); assertNull(COPY_JOB_CONFIGURATION.toPb().getQuery()); - assertNull(COPY_JOB_CONFIGURATION.toPb().getCopy().getSourceTables()); + assertNull(COPY_JOB_CONFIGURATION.toPb().getCopy().getSourceTable()); + assertNotNull(COPY_JOB_CONFIGURATION.toPb().getCopy().getSourceTables()); assertNull(COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.toPb().getCopy().getSourceTable()); assertNotNull(COPY_JOB_CONFIGURATION.getLabels()); assertNotNull(COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.getLabels()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java new file mode 100644 index 0000000000..c739bcf5a5 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class SnapshotTableDefinitionTest { + + private static final TableId BASE_TABLE_ID = TableId.of("DATASET_NAME", "BASE_TABLE_NAME"); + private static final String SNAPSHOT_TIME = "2021-05-19T11:32:26.553Z"; + private static final SnapshotTableDefinition SNAPSHOTTABLE_DEFINITION = + SnapshotTableDefinition.newBuilder() + .setBaseTableId(BASE_TABLE_ID) + .setSnapshotTime(SNAPSHOT_TIME) + .build(); + + @Test + public void testToBuilder() { + compareSnapshotTableDefinition( + SNAPSHOTTABLE_DEFINITION, SNAPSHOTTABLE_DEFINITION.toBuilder().build()); + SnapshotTableDefinition snapshotTableDefinition = + SNAPSHOTTABLE_DEFINITION.toBuilder().setSnapshotTime("2021-05-20T11:32:26.553Z").build(); + assertEquals("2021-05-20T11:32:26.553Z", snapshotTableDefinition.getSnapshotTime()); + } + + @Test + public void testBuilder() { + assertEquals(TableDefinition.Type.SNAPSHOT, SNAPSHOTTABLE_DEFINITION.getType()); + assertEquals(BASE_TABLE_ID, SNAPSHOTTABLE_DEFINITION.getBaseTableId()); + assertEquals(SNAPSHOT_TIME, SNAPSHOTTABLE_DEFINITION.getSnapshotTime()); + SnapshotTableDefinition snapshotTableDefinition = + SnapshotTableDefinition.newBuilder() + .setBaseTableId(BASE_TABLE_ID) + .setSnapshotTime(SNAPSHOT_TIME) + .build(); + assertEquals(SNAPSHOTTABLE_DEFINITION, snapshotTableDefinition); + } + + @Test + public void testToAndFromPb() { + SnapshotTableDefinition snapshotTableDefinition = SNAPSHOTTABLE_DEFINITION.toBuilder().build(); + assertTrue( + TableDefinition.fromPb(snapshotTableDefinition.toPb()) instanceof SnapshotTableDefinition); + compareSnapshotTableDefinition( + snapshotTableDefinition, + TableDefinition.fromPb(snapshotTableDefinition.toPb())); + } + + private void compareSnapshotTableDefinition( + SnapshotTableDefinition expected, SnapshotTableDefinition value) { + assertEquals(expected, value); + assertEquals(expected.getBaseTableId(), value.getBaseTableId()); + assertEquals(expected.getSnapshotTime(), value.getSnapshotTime()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 4d7b30bef6..a0135fb9eb 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -87,6 +87,7 @@ import com.google.cloud.bigquery.RoutineId; import com.google.cloud.bigquery.RoutineInfo; import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.SnapshotTableDefinition; import com.google.cloud.bigquery.StandardSQLDataType; import com.google.cloud.bigquery.StandardSQLField; import com.google.cloud.bigquery.StandardSQLTableType; @@ -2655,6 +2656,89 @@ public void testCopyJob() throws InterruptedException, TimeoutException { assertTrue(remoteTable.delete()); } + @Test + public void testSnapshotTableCopyJob() throws InterruptedException { + String sourceTableName = "test_copy_job_base_table"; + String ddlTableName = TABLE_ID_DDL.getTable(); + // this creates a snapshot table at specified snapshotTime + String snapshotTableName = String.format("test_snapshot_table"); + // Create source table with some data in it + String ddlQuery = + String.format( + "CREATE OR REPLACE TABLE %s (" + + "TimestampField TIMESTAMP OPTIONS(description='TimestampDescription'), " + + "StringField STRING OPTIONS(description='StringDescription'), " + + "BooleanField BOOLEAN OPTIONS(description='BooleanDescription') " + + ") AS SELECT * FROM %s", + sourceTableName, ddlTableName); + QueryJobConfiguration ddlConfig = + QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); + TableId sourceTableId = TableId.of(DATASET, sourceTableName); + TableResult result = bigquery.query(ddlConfig); + assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); + Table remoteTable = bigquery.getTable(DATASET, sourceTableName); + assertNotNull(remoteTable); + // StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); + // TableInfo tableInfo = TableInfo.of(sourceTableId, tableDefinition); + // Table createdTable = bigquery.create(tableInfo); + + // Create snapshot table using source table as the base table + TableId snapshotTableId = TableId.of(DATASET, snapshotTableName); + CopyJobConfiguration snapshotConfiguration = + CopyJobConfiguration.newBuilder(snapshotTableId, sourceTableId) + .setOperationType("SNAPSHOT") + .build(); + Job createdJob = bigquery.create(JobInfo.of(snapshotConfiguration)); + CopyJobConfiguration createdConfiguration = createdJob.getConfiguration(); + assertNotNull(createdConfiguration.getSourceTables()); + assertNotNull(createdConfiguration.getOperationType()); + assertNotNull(createdConfiguration.getDestinationTable()); + Job completedJob = createdJob.waitFor(); + assertNull(completedJob.getStatus().getError()); + Table snapshotTable = bigquery.getTable(DATASET, snapshotTableName); + assertNotNull(snapshotTable); + assertEquals(snapshotTableId.getDataset(), snapshotTable.getTableId().getDataset()); + assertEquals(snapshotTableName, snapshotTable.getTableId().getTable()); + assertTrue(snapshotTable.getDefinition() instanceof SnapshotTableDefinition); + assertEquals(DDL_TABLE_SCHEMA, snapshotTable.getDefinition().getSchema()); + assertNotNull(((SnapshotTableDefinition) snapshotTable.getDefinition()).getSnapshotTime()); + assertEquals( + sourceTableName, + ((SnapshotTableDefinition) snapshotTable.getDefinition()).getBaseTableId().getTable()); + + // Restore base table to a new table + String restoredTableName = "test_restore_table"; + TableId restoredTableId = TableId.of(DATASET, restoredTableName); + CopyJobConfiguration restoreConfiguration = + CopyJobConfiguration.newBuilder(restoredTableId, snapshotTableId) + .setOperationType("RESTORE") + .build(); + Job createdRestoreJob = bigquery.create(JobInfo.of(restoreConfiguration)); + CopyJobConfiguration createdRestoreConfiguration = createdRestoreJob.getConfiguration(); + assertEquals( + restoreConfiguration.getSourceTables().get(0).getTable(), + createdRestoreConfiguration.getSourceTables().get(0).getTable()); + assertEquals( + restoreConfiguration.getOperationType(), createdRestoreConfiguration.getOperationType()); + assertEquals( + restoreConfiguration.getDestinationTable().getTable(), + createdRestoreConfiguration.getDestinationTable().getTable()); + Job completedRestoreJob = createdRestoreJob.waitFor(); + assertNull(completedRestoreJob.getStatus().getError()); + Table restoredTable = bigquery.getTable(DATASET, restoredTableName); + assertNotNull(restoredTable); + assertEquals(restoredTableId.getDataset(), restoredTable.getTableId().getDataset()); + assertEquals(restoredTableName, restoredTable.getTableId().getTable()); + assertEquals(DDL_TABLE_SCHEMA, restoredTable.getDefinition().getSchema()); + assertEquals(snapshotTable.getNumBytes(), restoredTable.getNumBytes()); + assertEquals(snapshotTable.getNumRows(), restoredTable.getNumRows()); + + // Clean up + assertTrue(remoteTable.delete()); + assertTrue(restoredTable.delete()); + assertTrue(snapshotTable.delete()); + } + @Test public void testCopyJobWithLabels() throws InterruptedException { String sourceTableName = "test_copy_job_source_table_label"; From 3c0e7c6ee42f10aa2b528fcf81937ff58cc8136f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 19:00:09 +0000 Subject: [PATCH 0219/2268] chore: release 1.134.2-SNAPSHOT (#1396) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 17d47a3442..b311f98d15 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.134.1 + 1.134.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 32cfda8d60..1dcbcddc01 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.134.1 + 1.134.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.134.1 + 1.134.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5e4f80d520..4e4c4f9da0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.134.1 + 1.134.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.134.1 + 1.134.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1ce02d6a74..244b99fc25 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.134.1 + 1.134.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index a3bbd974dc..a0c358e865 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.134.1:1.134.1 \ No newline at end of file +google-cloud-bigquery:1.134.1:1.134.2-SNAPSHOT \ No newline at end of file From 06c07c1055deb594097448f3034c282ff565aa77 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 28 Jun 2021 12:06:17 -0700 Subject: [PATCH 0220/2268] chore: regenerate README (#1397) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-28 18:56:01,685 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-28 18:56:03,973 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/cf31ae60-53d3-48a6-b743-2942c506906b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 0cffa91738..140b5d5da0 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "05662f3d96ee26d74b8524f1b84e0bd1ec5d0716" + "sha": "d783292f4bd2d971235d8afa6318976856529cb5" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e934b93402284f834b510ebbf421864e881dce02" + "sha": "1f9ceba741b6b4a60ce09ab98423e941f5bd47f2" } } ] diff --git a/README.md b/README.md index 9fc98244be..079a6ad449 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.134.0' +compile 'com.google.cloud:google-cloud-bigquery:1.134.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.134.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.134.1" ``` ## Authentication From 4d1742ab0b85e6f3129a44bf460181e3590b248f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 28 Jun 2021 21:45:24 +0200 Subject: [PATCH 0221/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.134.1 (#1399) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d209b43758..967441699c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.134.0 + 1.134.1 From 2fe77ae9d123260cc98cc85394a8c10f5cab6326 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 19:56:18 +0000 Subject: [PATCH 0222/2268] chore: release 1.135.0 (#1398) :robot: I have created a release \*beep\* \*boop\* --- ## [1.135.0](https://www.github.com/googleapis/java-bigquery/compare/v1.134.1...v1.135.0) (2021-06-28) ### Features * add support for table snapshot ([#1320](https://www.github.com/googleapis/java-bigquery/issues/1320)) ([d783292](https://www.github.com/googleapis/java-bigquery/commit/d783292f4bd2d971235d8afa6318976856529cb5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee5dee8cca..220731e14a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.135.0](https://www.github.com/googleapis/java-bigquery/compare/v1.134.1...v1.135.0) (2021-06-28) + + +### Features + +* add support for table snapshot ([#1320](https://www.github.com/googleapis/java-bigquery/issues/1320)) ([d783292](https://www.github.com/googleapis/java-bigquery/commit/d783292f4bd2d971235d8afa6318976856529cb5)) + ### [1.134.1](https://www.github.com/googleapis/java-bigquery/compare/v1.134.0...v1.134.1) (2021-06-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b311f98d15..561e4f129d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.134.2-SNAPSHOT + 1.135.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1dcbcddc01..f3dd251854 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.134.2-SNAPSHOT + 1.135.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.134.2-SNAPSHOT + 1.135.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4e4c4f9da0..3d15667f74 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.134.2-SNAPSHOT + 1.135.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.134.2-SNAPSHOT + 1.135.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 244b99fc25..1237c4612f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.134.2-SNAPSHOT + 1.135.0 diff --git a/versions.txt b/versions.txt index a0c358e865..1a360aa9d1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.134.1:1.134.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.135.0:1.135.0 \ No newline at end of file From 02e9a6cd23869f05e6fde52ff0f35211a97727e9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 28 Jun 2021 13:00:10 -0700 Subject: [PATCH 0223/2268] chore: regenerate README (#1400) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-28 19:47:43,922 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-28 19:47:45,424 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/ea7c752e-ea7d-4536-9842-5e221e67ade2/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 140b5d5da0..302b899e98 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "d783292f4bd2d971235d8afa6318976856529cb5" + "sha": "4d1742ab0b85e6f3129a44bf460181e3590b248f" } }, { diff --git a/README.md b/README.md index 079a6ad449..ad2824afaa 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.134.0 + 1.134.1 ``` From b1ea77e37f1d80691b017e3246290b2276dcb20d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Jun 2021 20:08:31 +0000 Subject: [PATCH 0224/2268] chore: release 1.135.1-SNAPSHOT (#1401) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 561e4f129d..3695b9918b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.0 + 1.135.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f3dd251854..5bf4ce4220 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.0 + 1.135.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.0 + 1.135.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d15667f74..2bdbba4433 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.0 + 1.135.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.135.0 + 1.135.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1237c4612f..27b9ca8a68 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.0 + 1.135.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1a360aa9d1..741778b8cb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.0:1.135.0 \ No newline at end of file +google-cloud-bigquery:1.135.0:1.135.1-SNAPSHOT \ No newline at end of file From 530d44e857983ba7928914d8aa532bc71b798bfb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Jun 2021 01:45:10 +0200 Subject: [PATCH 0225/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.135.0 (#1402) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 967441699c..aff6345b78 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.134.1 + 1.135.0 From c8cd3d72b5456a69bb01d66f322e08aa216f30b6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 28 Jun 2021 16:58:41 -0700 Subject: [PATCH 0226/2268] chore: regenerate README (#1404) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-28 23:47:51,426 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-28 23:47:52,714 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/cae35229-1644-47e9-b41e-55f56c52e976/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 302b899e98..e67b918430 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "4d1742ab0b85e6f3129a44bf460181e3590b248f" + "sha": "530d44e857983ba7928914d8aa532bc71b798bfb" } }, { diff --git a/README.md b/README.md index ad2824afaa..f230970e59 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.134.1 + 1.135.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.134.1' +compile 'com.google.cloud:google-cloud-bigquery:1.135.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.134.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.0" ``` ## Authentication From 0cfcab02e7d80317b19062937677dbe07d3b3bd5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Jun 2021 06:33:04 +0200 Subject: [PATCH 0227/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.117.0 (#1403) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2bdbba4433..c3def40591 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.google.cloud google-cloud-storage - 1.116.0 + 1.117.0 test From 4bc8a6dc84d824edec1c89b1710a99415a93372b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 04:44:24 +0000 Subject: [PATCH 0228/2268] chore: release 1.135.1 (#1405) :robot: I have created a release \*beep\* \*boop\* --- ### [1.135.1](https://www.github.com/googleapis/java-bigquery/compare/v1.135.0...v1.135.1) (2021-06-29) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v1.117.0 ([#1403](https://www.github.com/googleapis/java-bigquery/issues/1403)) ([0cfcab0](https://www.github.com/googleapis/java-bigquery/commit/0cfcab02e7d80317b19062937677dbe07d3b3bd5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 220731e14a..5346ea9365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.135.1](https://www.github.com/googleapis/java-bigquery/compare/v1.135.0...v1.135.1) (2021-06-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v1.117.0 ([#1403](https://www.github.com/googleapis/java-bigquery/issues/1403)) ([0cfcab0](https://www.github.com/googleapis/java-bigquery/commit/0cfcab02e7d80317b19062937677dbe07d3b3bd5)) + ## [1.135.0](https://www.github.com/googleapis/java-bigquery/compare/v1.134.1...v1.135.0) (2021-06-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3695b9918b..c0d867bc0e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.1-SNAPSHOT + 1.135.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5bf4ce4220..f8e321e439 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.1-SNAPSHOT + 1.135.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.1-SNAPSHOT + 1.135.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c3def40591..96f71b65ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.1-SNAPSHOT + 1.135.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.135.1-SNAPSHOT + 1.135.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 27b9ca8a68..6710048fcb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.1-SNAPSHOT + 1.135.1 diff --git a/versions.txt b/versions.txt index 741778b8cb..323f032600 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.0:1.135.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.135.1:1.135.1 \ No newline at end of file From d4c530889dc78bbc95f9acf09d2a0e9aaf4bb2d2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 04:54:25 +0000 Subject: [PATCH 0229/2268] chore: release 1.135.2-SNAPSHOT (#1406) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c0d867bc0e..134c222734 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.1 + 1.135.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f8e321e439..99251c8884 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.1 + 1.135.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.1 + 1.135.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 96f71b65ca..6466a26a1c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.1 + 1.135.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -87,7 +87,7 @@ com.google.cloud google-cloud-bigquery - 1.135.1 + 1.135.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6710048fcb..69e2fc7c4a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.1 + 1.135.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 323f032600..0fb7afe0dc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.1:1.135.1 \ No newline at end of file +google-cloud-bigquery:1.135.1:1.135.2-SNAPSHOT \ No newline at end of file From 8479fd32c3136618ad1dea2cbcb6b7ee78cf8861 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Jun 2021 16:12:32 +0200 Subject: [PATCH 0230/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.135.1 (#1407) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index aff6345b78..6769e0a55f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.135.0 + 1.135.1 From f26ca9fca475f1533686ea66cf4606990e21e483 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 29 Jun 2021 07:28:24 -0700 Subject: [PATCH 0231/2268] chore: regenerate README (#1408) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-29 14:14:46,136 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-29 14:14:48,094 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/7343c34a-d04f-4aef-a1e9-1bb2f13ee63f/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index e67b918430..712dfe187a 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "530d44e857983ba7928914d8aa532bc71b798bfb" + "sha": "8479fd32c3136618ad1dea2cbcb6b7ee78cf8861" } }, { diff --git a/README.md b/README.md index f230970e59..3bcf6b67c5 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.135.0 + 1.135.1 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.135.0' +compile 'com.google.cloud:google-cloud-bigquery:1.135.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.1" ``` ## Authentication From 221439b55e0d42404e7d3bf4b8603a38158763ee Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 30 Jun 2021 12:18:21 -0400 Subject: [PATCH 0232/2268] ci: remove self-managed distributionManagement (#1410) --- pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index 6466a26a1c..a323f7c1f2 100644 --- a/pom.xml +++ b/pom.xml @@ -41,16 +41,6 @@ https://github.com/googleapis/java-bigquery/issues GitHub Issues - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - Apache-2.0 From e626c4aec7b7796fe5c888d7f726cd957469b4ad Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 30 Jun 2021 23:03:34 +0200 Subject: [PATCH 0233/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 (#1411) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a323f7c1f2..001a34fb4d 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210617-1.31.5 - 1.3.0 + 1.4.0
From 0234190d4fb0d22bc3c5359d9840f459bf048787 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 21:14:30 +0000 Subject: [PATCH 0234/2268] chore: release 1.135.2 (#1412) :robot: I have created a release \*beep\* \*boop\* --- ### [1.135.2](https://www.github.com/googleapis/java-bigquery/compare/v1.135.1...v1.135.2) (2021-06-30) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#1411](https://www.github.com/googleapis/java-bigquery/issues/1411)) ([e626c4a](https://www.github.com/googleapis/java-bigquery/commit/e626c4aec7b7796fe5c888d7f726cd957469b4ad)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5346ea9365..8f9b29f316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.135.2](https://www.github.com/googleapis/java-bigquery/compare/v1.135.1...v1.135.2) (2021-06-30) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#1411](https://www.github.com/googleapis/java-bigquery/issues/1411)) ([e626c4a](https://www.github.com/googleapis/java-bigquery/commit/e626c4aec7b7796fe5c888d7f726cd957469b4ad)) + ### [1.135.1](https://www.github.com/googleapis/java-bigquery/compare/v1.135.0...v1.135.1) (2021-06-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 134c222734..532be0caca 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.2-SNAPSHOT + 1.135.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 99251c8884..66de465d7a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.2-SNAPSHOT + 1.135.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.2-SNAPSHOT + 1.135.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 001a34fb4d..2ce1994b37 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.2-SNAPSHOT + 1.135.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.2-SNAPSHOT + 1.135.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 69e2fc7c4a..9dd2d6ddfa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.2-SNAPSHOT + 1.135.2 diff --git a/versions.txt b/versions.txt index 0fb7afe0dc..f58b650876 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.1:1.135.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.135.2:1.135.2 \ No newline at end of file From 457165fb1c055a4ef0484a86760819d75103ff50 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Jun 2021 21:24:21 +0000 Subject: [PATCH 0235/2268] chore: release 1.135.3-SNAPSHOT (#1413) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 532be0caca..2e467441b8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.2 + 1.135.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 66de465d7a..cd76b0a4cf 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.2 + 1.135.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.2 + 1.135.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2ce1994b37..efe3cbf739 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.2 + 1.135.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.2 + 1.135.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9dd2d6ddfa..2e0b7fc5d7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.2 + 1.135.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index f58b650876..d134744039 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.2:1.135.2 \ No newline at end of file +google-cloud-bigquery:1.135.2:1.135.3-SNAPSHOT \ No newline at end of file From 6d6d27699cc36984c2138beaf377906f8555d52a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 01:02:28 +0200 Subject: [PATCH 0236/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.27.1 (#1414) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6769e0a55f..6afe5bb037 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.27.0 + 1.27.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2e0b7fc5d7..64c7831664 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.27.0 + 1.27.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 23f3117c5e..99ebb0e2a0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.27.0 + 1.27.1 test From d0789ade20cae1aee0d34b1fbca927f64403bfc9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 01:06:13 +0200 Subject: [PATCH 0237/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.4 (#1416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `1.1.3` -> `1.1.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.1.4/compatibility-slim/1.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/1.1.4/confidence-slim/1.1.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigqueryconnection ### [`v1.1.4`](https://togithub.com/googleapis/java-bigqueryconnection/blob/master/CHANGELOG.md#​114-httpswwwgithubcomgoogleapisjava-bigqueryconnectioncomparev113v114-2021-06-24) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v1.1.3...v1.1.4)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6afe5bb037..bbc0a222ca 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.3 + 1.1.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 64c7831664..f87fb67bce 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.3 + 1.1.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 99ebb0e2a0..4dca1858d5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.3 + 1.1.4 test From b8a697dd1a574b3def982c5b7d78be82f5c6bcf1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 01:08:13 +0200 Subject: [PATCH 0238/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.135.2 (#1415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.135.1` -> `1.135.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.135.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.135.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.135.2/compatibility-slim/1.135.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/1.135.2/confidence-slim/1.135.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v1.135.2`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​11352-httpswwwgithubcomgoogleapisjava-bigquerycomparev11351v11352-2021-06-30) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.135.1...v1.135.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index bbc0a222ca..21fa561b60 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.135.1 + 1.135.2 From 42823bed79f736f40ab73e5c872346761baf6c89 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Jun 2021 16:16:18 -0700 Subject: [PATCH 0239/2268] chore: regenerate README (#1419) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-30 23:04:38,981 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-30 23:04:40,354 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/9be924df-2ad0-4dc8-9d2b-cd810f5a8019/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 712dfe187a..191814be23 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "8479fd32c3136618ad1dea2cbcb6b7ee78cf8861" + "sha": "6d6d27699cc36984c2138beaf377906f8555d52a" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f9ceba741b6b4a60ce09ab98423e941f5bd47f2" + "sha": "39652e3948f455fd0b77535a0145eeec561a3706" } } ] diff --git a/README.md b/README.md index 3bcf6b67c5..e1f51f1791 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.135.1' +compile 'com.google.cloud:google-cloud-bigquery:1.135.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.2" ``` ## Authentication From 5483d881d64c19a60b53d930b943a42af2d5f735 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 30 Jun 2021 16:30:25 -0700 Subject: [PATCH 0240/2268] chore: regenerate README (#1420) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-06-30 23:18:32,758 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-06-30 23:18:34,084 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/b86ba535-ccba-4fea-85ca-887d2d78521b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 191814be23..bbfabe3bd8 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "6d6d27699cc36984c2138beaf377906f8555d52a" + "sha": "42823bed79f736f40ab73e5c872346761baf6c89" } }, { diff --git a/README.md b/README.md index e1f51f1791..48aacb4d98 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.135.1 + 1.135.2 ``` From a746a1647db3b39c8f1bb68d97fb71bc477ad678 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 2 Jul 2021 22:40:25 +0200 Subject: [PATCH 0241/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.117.1 (#1417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `1.117.0` -> `1.117.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.117.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.117.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.117.1/compatibility-slim/1.117.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/1.117.1/confidence-slim/1.117.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v1.117.1`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​11171-httpswwwgithubcomgoogleapisjava-storagecomparev11170v11171-2021-06-30) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v1.117.0...v1.117.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index efe3cbf739..a9b7bb88b9 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ com.google.cloud google-cloud-storage - 1.117.0 + 1.117.1 test From 53c6cf14b96289ff2291a0dec1327e5b98d32910 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 2 Jul 2021 22:40:29 +0200 Subject: [PATCH 0242/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.27.2 (#1422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `1.27.1` -> `1.27.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.27.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.27.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.27.2/compatibility-slim/1.27.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/1.27.2/confidence-slim/1.27.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v1.27.2`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​1272-httpswwwgithubcomgoogleapisjava-bigtablecomparev1271v1272-2021-07-01) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v1.27.1...v1.27.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 21fa561b60..0aa281a123 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.27.1 + 1.27.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f87fb67bce..1da392d56d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.27.1 + 1.27.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4dca1858d5..996e1fa1c5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.27.1 + 1.27.2 test From 1d20b48addb0d1855db1d645966233822e375474 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 20:52:39 +0000 Subject: [PATCH 0243/2268] chore: release 1.135.3 (#1418) :robot: I have created a release \*beep\* \*boop\* --- ### [1.135.3](https://www.github.com/googleapis/java-bigquery/compare/v1.135.2...v1.135.3) (2021-07-02) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.27.1 ([#1414](https://www.github.com/googleapis/java-bigquery/issues/1414)) ([6d6d276](https://www.github.com/googleapis/java-bigquery/commit/6d6d27699cc36984c2138beaf377906f8555d52a)) * update dependency com.google.cloud:google-cloud-bigtable to v1.27.2 ([#1422](https://www.github.com/googleapis/java-bigquery/issues/1422)) ([53c6cf1](https://www.github.com/googleapis/java-bigquery/commit/53c6cf14b96289ff2291a0dec1327e5b98d32910)) * update dependency com.google.cloud:google-cloud-storage to v1.117.1 ([#1417](https://www.github.com/googleapis/java-bigquery/issues/1417)) ([a746a16](https://www.github.com/googleapis/java-bigquery/commit/a746a1647db3b39c8f1bb68d97fb71bc477ad678)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f9b29f316..73fa37c81a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### [1.135.3](https://www.github.com/googleapis/java-bigquery/compare/v1.135.2...v1.135.3) (2021-07-02) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.27.1 ([#1414](https://www.github.com/googleapis/java-bigquery/issues/1414)) ([6d6d276](https://www.github.com/googleapis/java-bigquery/commit/6d6d27699cc36984c2138beaf377906f8555d52a)) +* update dependency com.google.cloud:google-cloud-bigtable to v1.27.2 ([#1422](https://www.github.com/googleapis/java-bigquery/issues/1422)) ([53c6cf1](https://www.github.com/googleapis/java-bigquery/commit/53c6cf14b96289ff2291a0dec1327e5b98d32910)) +* update dependency com.google.cloud:google-cloud-storage to v1.117.1 ([#1417](https://www.github.com/googleapis/java-bigquery/issues/1417)) ([a746a16](https://www.github.com/googleapis/java-bigquery/commit/a746a1647db3b39c8f1bb68d97fb71bc477ad678)) + ### [1.135.2](https://www.github.com/googleapis/java-bigquery/compare/v1.135.1...v1.135.2) (2021-06-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2e467441b8..52ffda8427 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.3-SNAPSHOT + 1.135.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cd76b0a4cf..c169776902 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.3-SNAPSHOT + 1.135.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.3-SNAPSHOT + 1.135.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a9b7bb88b9..e1f04c5856 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.3-SNAPSHOT + 1.135.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.3-SNAPSHOT + 1.135.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1da392d56d..1bf234aff6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.3-SNAPSHOT + 1.135.3 diff --git a/versions.txt b/versions.txt index d134744039..d68ff18b7e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.2:1.135.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.135.3:1.135.3 \ No newline at end of file From 567f7b41f0305d2a18c4930435947dfb1a343646 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:04:21 +0000 Subject: [PATCH 0244/2268] chore: release 1.135.4-SNAPSHOT (#1423) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 52ffda8427..af017660fc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.3 + 1.135.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c169776902..0231d76e1e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.3 + 1.135.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.3 + 1.135.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e1f04c5856..eeb2494344 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.3 + 1.135.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.3 + 1.135.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1bf234aff6..29e53bb47b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.3 + 1.135.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index d68ff18b7e..128276accb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.3:1.135.3 \ No newline at end of file +google-cloud-bigquery:1.135.3:1.135.4-SNAPSHOT \ No newline at end of file From 9e943599b629d01bddcaeb69dde1f58f331e8987 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 4 Jul 2021 22:52:05 +0200 Subject: [PATCH 0245/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.135.3 (#1424) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0aa281a123..ec11782721 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.135.2 + 1.135.3 From ed54050096b9cfc65e015c43cc486984c0ff0970 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 4 Jul 2021 14:04:22 -0700 Subject: [PATCH 0246/2268] chore: regenerate README (#1427) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-04 20:54:11,177 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-04 20:54:12,496 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/c4f587de-8ee6-4659-8ae9-9dca2a730ac0/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index bbfabe3bd8..82441057f3 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "42823bed79f736f40ab73e5c872346761baf6c89" + "sha": "9e943599b629d01bddcaeb69dde1f58f331e8987" } }, { diff --git a/README.md b/README.md index 48aacb4d98..3ce0b13922 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.135.2 + 1.135.3 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.135.2' +compile 'com.google.cloud:google-cloud-bigquery:1.135.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.3" ``` ## Authentication From 7daaeff1294fb7c4ec27de60266b7e988791ba22 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Jul 2021 17:50:24 +0200 Subject: [PATCH 0247/2268] test(deps): update datacatalog dependencies to v1.4.2 (#1428) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index eeb2494344..8c6d119d3a 100644 --- a/pom.xml +++ b/pom.xml @@ -114,13 +114,13 @@ com.google.cloud google-cloud-datacatalog - 1.4.1 + 1.4.2 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.4.1 + 1.4.2 test From 82467ed4d8435e33a6496663a5dd6ae9377d4212 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 7 Jul 2021 20:47:54 +0200 Subject: [PATCH 0248/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.32.1 (#1425) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8c6d119d3a..a8b19da9f8 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210617-1.31.5 + v2-rev20210617-1.32.1 1.4.0
From ee4209421449deba488879923cd31f81c1c4376e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Jul 2021 13:35:42 +0200 Subject: [PATCH 0249/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.1.5 (#1430) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ec11782721..664eea2267 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.4 + 1.1.5 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 29e53bb47b..0a90d6e2a9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.4 + 1.1.5 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 996e1fa1c5..17e7692639 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.4 + 1.1.5 test From afa73af2a0912a25ee1e63f6fbb6b9453fdd1287 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:46:09 +0000 Subject: [PATCH 0250/2268] chore: release 1.135.4 (#1429) :robot: I have created a release \*beep\* \*boop\* --- ### [1.135.4](https://www.github.com/googleapis/java-bigquery/compare/v1.135.3...v1.135.4) (2021-07-08) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.32.1 ([#1425](https://www.github.com/googleapis/java-bigquery/issues/1425)) ([82467ed](https://www.github.com/googleapis/java-bigquery/commit/82467ed4d8435e33a6496663a5dd6ae9377d4212)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73fa37c81a..e4789162d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.135.4](https://www.github.com/googleapis/java-bigquery/compare/v1.135.3...v1.135.4) (2021-07-08) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210617-1.32.1 ([#1425](https://www.github.com/googleapis/java-bigquery/issues/1425)) ([82467ed](https://www.github.com/googleapis/java-bigquery/commit/82467ed4d8435e33a6496663a5dd6ae9377d4212)) + ### [1.135.3](https://www.github.com/googleapis/java-bigquery/compare/v1.135.2...v1.135.3) (2021-07-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index af017660fc..7f6831c428 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.4-SNAPSHOT + 1.135.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0231d76e1e..00ac8a2ed6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.4-SNAPSHOT + 1.135.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.4-SNAPSHOT + 1.135.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a8b19da9f8..a3c19d6e46 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.4-SNAPSHOT + 1.135.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.4-SNAPSHOT + 1.135.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0a90d6e2a9..1a1d7b1e12 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.4-SNAPSHOT + 1.135.4 diff --git a/versions.txt b/versions.txt index 128276accb..a6adcf2545 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.3:1.135.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.135.4:1.135.4 \ No newline at end of file From e755470ad3699eee8816f55cdec4dd995cf85d52 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:56:22 +0000 Subject: [PATCH 0251/2268] chore: release 1.135.5-SNAPSHOT (#1432) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7f6831c428..f6f7bb18c7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.4 + 1.135.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 00ac8a2ed6..682de75128 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.4 + 1.135.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.4 + 1.135.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a3c19d6e46..d611bdef07 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.4 + 1.135.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.4 + 1.135.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1a1d7b1e12..d978209e05 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.4 + 1.135.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index a6adcf2545..417a2a8dd0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.4:1.135.4 \ No newline at end of file +google-cloud-bigquery:1.135.4:1.135.5-SNAPSHOT \ No newline at end of file From e4dcd1a0a8b7e38ef8e366f4fe0e3ef306c3889f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Jul 2021 18:55:20 +0200 Subject: [PATCH 0252/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.135.4 (#1433) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 664eea2267..4697089deb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.135.3 + 1.135.4 From 94ce14fef44ea082925e621f6939db00d703c008 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Jul 2021 10:08:23 -0700 Subject: [PATCH 0253/2268] chore: regenerate README (#1434) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-08 16:57:21,103 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-08 16:57:22,339 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/b228950a-4d07-413b-94e8-8a87c7613bc7/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 82441057f3..dc41041e8b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9e943599b629d01bddcaeb69dde1f58f331e8987" + "sha": "e4dcd1a0a8b7e38ef8e366f4fe0e3ef306c3889f" } }, { diff --git a/README.md b/README.md index 3ce0b13922..7edcbab0c7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.135.3 + 1.135.4 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.135.3' +compile 'com.google.cloud:google-cloud-bigquery:1.135.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.4" ``` ## Authentication From 9d67e05d2a6fab0c9e6017dec33b0d74ad821825 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 8 Jul 2021 14:32:07 -0400 Subject: [PATCH 0254/2268] feat: add dmlStatistics support (#1431) Provides detailed statistics for DML statements Present only for DML statements INSERT, UPDATE, DELETE or TRUNCATE. Towards b/186432630 --- .../com/google/cloud/bigquery/DmlStats.java | 112 ++++++++++++++++++ .../google/cloud/bigquery/JobStatistics.java | 20 +++- .../google/cloud/bigquery/DmlStatsTest.java | 55 +++++++++ .../cloud/bigquery/JobStatisticsTest.java | 11 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 20 ++++ 5 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DmlStats.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DmlStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DmlStats.java new file mode 100644 index 0000000000..0ce97dc0cb --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DmlStats.java @@ -0,0 +1,112 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.DmlStatistics; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +/** Represents DML statistics information. */ +@AutoValue +public abstract class DmlStats implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + /** + * Number of deleted Rows. populated by DML DELETE, MERGE and TRUNCATE statements. + * + * @param deletedRowCount deletedRowCount or {@code null} for none + */ + public abstract Builder setDeletedRowCount(Long deletedRowCount); + + /** + * Number of inserted Rows. Populated by DML INSERT and MERGE statements. + * + * @param insertedRowCount insertedRowCount or {@code null} for none + */ + public abstract Builder setInsertedRowCount(Long insertedRowCount); + + /** + * Number of updated Rows. Populated by DML UPDATE and MERGE statements. + * + * @param updatedRowCount updatedRowCount or {@code null} for none + */ + public abstract Builder setUpdatedRowCount(Long updatedRowCount); + + /** Creates a {@code DmlStats} object. */ + public abstract DmlStats build(); + } + + /** + * Returns number of deleted Rows. populated by DML DELETE, MERGE and TRUNCATE statements. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract Long getDeletedRowCount(); + + /** + * Returns number of inserted Rows. Populated by DML INSERT and MERGE statements. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract Long getInsertedRowCount(); + + /** + * Returns number of updated Rows. Populated by DML UPDATE and MERGE statements. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract Long getUpdatedRowCount(); + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_DmlStats.Builder(); + } + + DmlStatistics toPb() { + DmlStatistics dmlStatisticsPb = new DmlStatistics(); + if (getDeletedRowCount() != null) { + dmlStatisticsPb.setDeletedRowCount(getDeletedRowCount()); + } + if (getInsertedRowCount() != null) { + dmlStatisticsPb.setInsertedRowCount(getInsertedRowCount()); + } + if (getUpdatedRowCount() != null) { + dmlStatisticsPb.setUpdatedRowCount(getUpdatedRowCount()); + } + return dmlStatisticsPb; + } + + static DmlStats fromPb(DmlStatistics dmlStatisticsPb) { + Builder builder = newBuilder(); + if (dmlStatisticsPb.getDeletedRowCount() != null) { + builder.setDeletedRowCount(dmlStatisticsPb.getDeletedRowCount()); + } + if (dmlStatisticsPb.getInsertedRowCount() != null) { + builder.setInsertedRowCount(dmlStatisticsPb.getInsertedRowCount()); + } + if (dmlStatisticsPb.getUpdatedRowCount() != null) { + builder.setUpdatedRowCount(dmlStatisticsPb.getUpdatedRowCount()); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index d971a6fb27..ea5555b9bf 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -326,6 +326,7 @@ public static class QueryStatistics extends JobStatistics { private final RoutineId ddlTargetRoutine; private final Long estimatedBytesProcessed; private final Long numDmlAffectedRows; + private final DmlStats dmlStats; private final List referencedTables; private final StatementType statementType; private final Long totalBytesBilled; @@ -406,6 +407,7 @@ static final class Builder extends JobStatistics.Builder referencedTables; private StatementType statementType; private Long totalBytesBilled; @@ -458,6 +460,9 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP if (statisticsPb.getQuery().getSchema() != null) { this.schema = Schema.fromPb(statisticsPb.getQuery().getSchema()); } + if (statisticsPb.getQuery().getDmlStats() != null) { + this.dmlStats = DmlStats.fromPb(statisticsPb.getQuery().getDmlStats()); + } } } @@ -496,6 +501,11 @@ Builder setNumDmlAffectedRows(Long numDmlAffectedRows) { return self(); } + Builder setDmlStats(DmlStats dmlStats) { + this.dmlStats = dmlStats; + return self(); + } + Builder setReferenceTables(List referencedTables) { this.referencedTables = referencedTables; return self(); @@ -561,6 +571,7 @@ private QueryStatistics(Builder builder) { this.ddlTargetRoutine = builder.ddlTargetRoutine; this.estimatedBytesProcessed = builder.estimatedBytesProcessed; this.numDmlAffectedRows = builder.numDmlAffectedRows; + this.dmlStats = builder.dmlStats; this.referencedTables = builder.referencedTables; this.statementType = builder.statementType; this.totalBytesBilled = builder.totalBytesBilled; @@ -614,6 +625,11 @@ public Long getNumDmlAffectedRows() { return numDmlAffectedRows; } + /** Detailed statistics for DML statements. */ + public DmlStats getDmlStats() { + return dmlStats; + } + /** * Referenced tables for the job. Queries that reference more than 50 tables will not have a * complete list. @@ -729,7 +745,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (ddlTargetRoutine != null) { queryStatisticsPb.setDdlTargetRoutine(ddlTargetRoutine.toPb()); } - + if (dmlStats != null) { + queryStatisticsPb.setDmlStats(dmlStats.toPb()); + } if (referencedTables != null) { queryStatisticsPb.setReferencedTables( Lists.transform(referencedTables, TableId.TO_PB_FUNCTION)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java new file mode 100644 index 0000000000..48950831a4 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class DmlStatsTest { + + private static final Long DELETED_ROW_COUNT = 10L; + private static final Long INSERTED_ROW_COUNT = 20L; + private static final Long UPDATED_ROW_COUNT = 30L; + private static final DmlStats DML_STATS = + DmlStats.newBuilder() + .setDeletedRowCount(DELETED_ROW_COUNT) + .setInsertedRowCount(INSERTED_ROW_COUNT) + .setUpdatedRowCount(UPDATED_ROW_COUNT) + .build(); + + @Test + public void testBuilder() { + assertEquals(DELETED_ROW_COUNT, DML_STATS.getDeletedRowCount()); + assertEquals(UPDATED_ROW_COUNT, DML_STATS.getUpdatedRowCount()); + assertEquals(INSERTED_ROW_COUNT, DML_STATS.getInsertedRowCount()); + } + + @Test + public void testToPbAndFromPb() { + compareDmlStats(DML_STATS, DmlStats.fromPb(DML_STATS.toPb())); + } + + private void compareDmlStats(DmlStats expected, DmlStats actual) { + assertEquals(expected, actual); + assertEquals(expected.hashCode(), actual.hashCode()); + assertEquals(expected.toString(), actual.toString()); + assertEquals(expected.getDeletedRowCount(), actual.getDeletedRowCount()); + assertEquals(expected.getInsertedRowCount(), actual.getInsertedRowCount()); + assertEquals(expected.getUpdatedRowCount(), actual.getUpdatedRowCount()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 96bfa3f084..a28eae26b9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -42,6 +42,15 @@ public class JobStatisticsTest { private static final RoutineId DDL_TARGET_ROUTINE = RoutineId.of("alpha", "beta", "gamma"); private static final Long ESTIMATE_BYTES_PROCESSED = 101L; private static final Long NUM_DML_AFFECTED_ROWS = 88L; + private static final Long DELETED_ROW_COUNT = 10L; + private static final Long INSERTED_ROW_COUNT = 20L; + private static final Long UPDATED_ROW_COUNT = 30L; + private static final DmlStats DML_STATS = + DmlStats.newBuilder() + .setDeletedRowCount(DELETED_ROW_COUNT) + .setInsertedRowCount(INSERTED_ROW_COUNT) + .setUpdatedRowCount(UPDATED_ROW_COUNT) + .build(); private static final QueryStatistics.StatementType STATEMENT_TYPE = QueryStatistics.StatementType.SELECT; private static final Long TOTAL_BYTES_BILLED = 24L; @@ -147,6 +156,7 @@ public class JobStatisticsTest { .setDDLTargetRoutine(DDL_TARGET_ROUTINE) .setEstimatedBytesProcessed(ESTIMATE_BYTES_PROCESSED) .setNumDmlAffectedRows(NUM_DML_AFFECTED_ROWS) + .setDmlStats(DML_STATS) .setReferenceTables(REFERENCED_TABLES) .setStatementType(STATEMENT_TYPE) .setTotalBytesBilled(TOTAL_BYTES_BILLED) @@ -232,6 +242,7 @@ public void testBuilder() { assertEquals(DDL_TARGET_ROUTINE, QUERY_STATISTICS.getDdlTargetRoutine()); assertEquals(ESTIMATE_BYTES_PROCESSED, QUERY_STATISTICS.getEstimatedBytesProcessed()); assertEquals(NUM_DML_AFFECTED_ROWS, QUERY_STATISTICS.getNumDmlAffectedRows()); + assertEquals(DML_STATS, QUERY_STATISTICS.getDmlStats()); assertEquals(REFERENCED_TABLES, QUERY_STATISTICS.getReferencedTables()); assertEquals(STATEMENT_TYPE, QUERY_STATISTICS.getStatementType()); assertEquals(TOTAL_BYTES_BILLED, QUERY_STATISTICS.getTotalBytesBilled()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index a0135fb9eb..1669343fb2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2205,6 +2205,26 @@ public void testFastQueryHTTPException() throws InterruptedException { } } + @Test + public void testDmlStatistics() throws InterruptedException { + String tableName = TABLE_ID_FASTQUERY.getTable(); + // Run a DML statement to UPDATE 2 rows of data + String dmlQuery = + String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); + QueryJobConfiguration dmlConfig = QueryJobConfiguration.newBuilder(dmlQuery).build(); + Job remoteJob = bigquery.create(JobInfo.of(dmlConfig)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + + TableResult result = remoteJob.getQueryResults(); + assertEquals(TABLE_SCHEMA, result.getSchema()); + + Job queryJob = bigquery.getJob(remoteJob.getJobId()); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + assertEquals(2L, statistics.getNumDmlAffectedRows().longValue()); + assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); + } + @Test public void testScriptStatistics() throws InterruptedException { String script = From 80c0748eae58b44a3244933cf12a5d1832bc070e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Jul 2021 11:44:12 -0700 Subject: [PATCH 0255/2268] chore: regenerate README (#1436) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-08 18:34:28,544 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-08 18:34:29,847 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/81d2ea6c-8e20-4fbf-9fdc-40a1d9147e9d/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index dc41041e8b..85260c62ef 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "e4dcd1a0a8b7e38ef8e366f4fe0e3ef306c3889f" + "sha": "9d67e05d2a6fab0c9e6017dec33b0d74ad821825" } }, { diff --git a/README.md b/README.md index 7edcbab0c7..11b0176157 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.7.0') +implementation platform('com.google.cloud:libraries-bom:20.8.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From df8e146749591807ae5fe9694e32b02ea24dc7db Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:20:23 +0000 Subject: [PATCH 0256/2268] chore: release 1.136.0 (#1435) :robot: I have created a release \*beep\* \*boop\* --- ## [1.136.0](https://www.github.com/googleapis/java-bigquery/compare/v1.135.4...v1.136.0) (2021-07-08) ### Features * add dmlStatistics support ([#1431](https://www.github.com/googleapis/java-bigquery/issues/1431)) ([9d67e05](https://www.github.com/googleapis/java-bigquery/commit/9d67e05d2a6fab0c9e6017dec33b0d74ad821825)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4789162d1..37703e4d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.136.0](https://www.github.com/googleapis/java-bigquery/compare/v1.135.4...v1.136.0) (2021-07-08) + + +### Features + +* add dmlStatistics support ([#1431](https://www.github.com/googleapis/java-bigquery/issues/1431)) ([9d67e05](https://www.github.com/googleapis/java-bigquery/commit/9d67e05d2a6fab0c9e6017dec33b0d74ad821825)) + ### [1.135.4](https://www.github.com/googleapis/java-bigquery/compare/v1.135.3...v1.135.4) (2021-07-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f6f7bb18c7..2d2aa79784 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.135.5-SNAPSHOT + 1.136.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 682de75128..9f474ba17d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.135.5-SNAPSHOT + 1.136.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.135.5-SNAPSHOT + 1.136.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d611bdef07..3db6cddb02 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.135.5-SNAPSHOT + 1.136.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.135.5-SNAPSHOT + 1.136.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d978209e05..ad6018b830 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.135.5-SNAPSHOT + 1.136.0 diff --git a/versions.txt b/versions.txt index 417a2a8dd0..b630ecfe34 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.135.4:1.135.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.136.0:1.136.0 \ No newline at end of file From d658bce1820279e9a6fb22570c9092283810633a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:32:23 +0000 Subject: [PATCH 0257/2268] chore: release 1.136.1-SNAPSHOT (#1438) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2d2aa79784..e020261d5d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.136.0 + 1.136.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9f474ba17d..3d27c9c455 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.136.0 + 1.136.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.136.0 + 1.136.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3db6cddb02..a246db86b0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.136.0 + 1.136.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.136.0 + 1.136.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ad6018b830..e4f7217814 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.136.0 + 1.136.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index b630ecfe34..1e049cff6d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.136.0:1.136.0 \ No newline at end of file +google-cloud-bigquery:1.136.0:1.136.1-SNAPSHOT \ No newline at end of file From 3d17e181472b60805a12e446463c13e1788416ec Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Jul 2021 22:51:08 +0200 Subject: [PATCH 0258/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.8.0 (#1437) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 17e7692639..75dcec18d9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.7.0 + 20.8.0 pom import From 526c517f1940007e532c7e1f7e1fa01a985f30e2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Jul 2021 14:04:08 -0700 Subject: [PATCH 0259/2268] chore: regenerate README (#1440) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-08 20:53:20,676 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-08 20:53:22,072 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/4926a2b2-9b00-4061-9c12-b8f03ce3b96b/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 85260c62ef..aae983ab72 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "9d67e05d2a6fab0c9e6017dec33b0d74ad821825" + "sha": "3d17e181472b60805a12e446463c13e1788416ec" } }, { diff --git a/README.md b/README.md index 11b0176157..46d660b105 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.7.0 + 20.8.0 pom import @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.135.4' +compile 'com.google.cloud:google-cloud-bigquery:1.136.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.135.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.136.0" ``` ## Authentication From f8c8eab97a431abef442e9622b8ecce851f052d9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 9 Jul 2021 04:11:26 -0700 Subject: [PATCH 0260/2268] chore: remove All rights reserved clause from java.header (#1441) After discussion with OSPO, it has been decided to remove "All rights reserved" clause from the java.header file to better reflect the [correct license header](https://g3doc.corp.google.com/company/teams/opensource/releasing/preparing.md?cl=head#Apache-header). Source-Author: Neenu Shaji Source-Date: Thu Jul 8 18:00:44 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 09c59c20a4bf0daed1665af59035ff240fe356df Source-Link: https://github.com/googleapis/synthtool/commit/09c59c20a4bf0daed1665af59035ff240fe356df --- java.header | 2 +- synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java.header b/java.header index 3a9b503aa2..d0970ba7d3 100644 --- a/java.header +++ b/java.header @@ -1,5 +1,5 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ ^ \*$ ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ ^ \* you may not use this file except in compliance with the License\.$ diff --git a/synth.metadata b/synth.metadata index c7077792b6..efc71a0989 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "c9c948127fa7a07661809698c18b1850207a3479" + "sha": "526c517f1940007e532c7e1f7e1fa01a985f30e2" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c0c698705e668ccb3d68556ae7260f16ce63a6e" + "sha": "09c59c20a4bf0daed1665af59035ff240fe356df" } } ], From b7aef82248b7fe6bf672bd7394d69745c9fd3335 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Jul 2021 13:11:41 +0200 Subject: [PATCH 0261/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.136.0 (#1439) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4697089deb..5900c73f63 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.135.4 + 1.136.0 From 5bee58910bb1725d46eaffb04a3451d8223f7c18 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 9 Jul 2021 04:24:08 -0700 Subject: [PATCH 0262/2268] chore: regenerate README (#1442) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-09 11:13:38,134 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-09 11:13:39,510 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/aac7f7e0-f599-4f64-b2ca-acc23b4c7490/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index aae983ab72..4047572e2e 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "3d17e181472b60805a12e446463c13e1788416ec" + "sha": "b7aef82248b7fe6bf672bd7394d69745c9fd3335" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "39652e3948f455fd0b77535a0145eeec561a3706" + "sha": "09c59c20a4bf0daed1665af59035ff240fe356df" } } ] diff --git a/README.md b/README.md index 46d660b105..e3649f5251 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.135.4 + 1.136.0 ``` From 44d97953febac11c9167efe6781c779f486355d0 Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Wed, 14 Jul 2021 19:28:29 +0530 Subject: [PATCH 0263/2268] feat: Implemented BigQueryRetryAlgorithm to retry on the basis of the configured re-triable error messages (#1426) * Updated BigQueryImpl * Initial Commit * Using BigQueryRetryAlgorithm as the retry algorithm * Created BigQueryRetryAlgorithm as a subclass of RetryAlgorithm * BigQueryErrorMessages property file * Implemented Builder Logic for BigQueryRetryConfig * Using BigQueryRetryConfig for getQueryResults * Updated shouldRetry with the logic to retry based on error messages * Implemented null checks on shouldRetryBasedOnBigQueryRetryConfig * Removed `Status` from shouldRetryBasedOnBigQueryRetryConfig implementation * Removed unused imports * created DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG for getQueryResults * Added testGetQueryResultsRetry test for testing getQueryResults Retry * Overriding createNextAttempt method so that it generates an attempt based on the error message * Linted BigQueryRetryHelper * Linted testGetQueryResultsRetry * Linted BigQueryRetryAlgorithm * Linted BigQueryErrorMessages * Linted BigQueryRetryConfig * Fixed Linting * Fixed Linting * Fixed Linting * Created translateAndThrow(BigQueryRetryHelper.BigQueryRetryHelperException ex) method to handle BigQueryRetryHelperException * Handling BigQueryRetryHelper.BigQueryRetryHelperException for getQueryResults * Implementing BigQueryRetryHelper.runWithRetries from TableResult.queryRPC method * Implementing testFastQueryRateLimitIdempotency Method to test Idempotency of the BigQueryRetryHelper.runWithRetries for TableResult.query(...) * Changed DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG to DEFAULT_RETRY_CONFIG * Implemented `BigQueryRetryHelper.runWithRetries` on `QueryResponse waitForQueryResults` method, which is used by `TableResult getQueryResults` method * Revert "Implemented `BigQueryRetryHelper.runWithRetries` on `QueryResponse waitForQueryResults` method, which is used by `TableResult getQueryResults` method" This reverts commit 84a3418cb5d14111d3d9d48fbd925c2ba7c10420. * Revert "Changed DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG to DEFAULT_RETRY_CONFIG" This reverts commit 22b17062788be5f8d8cd20a4b0d6804ad1c54463. * Renamed DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG to DEFAULT_RETRY_CONFIG * Revert "Renamed DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG to DEFAULT_RETRY_CONFIG" This reverts commit 2d21e116c4384402d6362937e61f4de51936b06c. * Renamed DEFAULT_RATE_LIMIT_EXCEEDED_RETRY_CONFIG to DEFAULT_RETRY_CONFIG * Implemented BigQueryRetryHelper.runWithRetries on `QueryResponse waitForQueryResults` method, which is used by `TableResult getQueryResults` method --- .../cloud/bigquery/BigQueryErrorMessages.java | 22 +++ .../cloud/bigquery/BigQueryException.java | 8 + .../google/cloud/bigquery/BigQueryImpl.java | 21 ++- .../bigquery/BigQueryRetryAlgorithm.java | 152 ++++++++++++++++++ .../cloud/bigquery/BigQueryRetryConfig.java | 54 +++++++ .../cloud/bigquery/BigQueryRetryHelper.java | 76 +++++++++ .../java/com/google/cloud/bigquery/Job.java | 20 ++- .../cloud/bigquery/BigQueryImplTest.java | 93 +++++++++++ 8 files changed, 433 insertions(+), 13 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java new file mode 100644 index 0000000000..04cabfc67e --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java @@ -0,0 +1,22 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +public class BigQueryErrorMessages { + public static final String RATE_LIMIT_EXCEEDED_MSG = + "Exceeded rate limits:"; // Error Message for RateLimitExceeded Error +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java index 8d6da0b4e9..06cbf344c9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java @@ -122,6 +122,14 @@ static BaseServiceException translateAndThrow(RetryHelperException ex) { throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); } + static BaseServiceException translateAndThrow( + BigQueryRetryHelper.BigQueryRetryHelperException ex) { + if (ex.getCause() instanceof BaseServiceException) { + throw (BaseServiceException) ex.getCause(); + } + throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); + } + static BaseServiceException translateAndThrow(ExecutionException ex) { BaseServiceException.translate(ex); throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 4086c6a735..c871eb551e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -237,6 +237,10 @@ public Page getNextPage() { } private final BigQueryRpc bigQueryRpc; + private static final BigQueryRetryConfig DEFAULT_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder() + .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) + .build(); // retry config with Error Message for RateLimitExceeded Error BigQueryImpl(BigQueryOptions options) { super(options); @@ -1271,7 +1275,7 @@ private TableResult queryRpc( com.google.api.services.bigquery.model.QueryResponse results; try { results = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override public com.google.api.services.bigquery.model.QueryResponse call() { @@ -1280,8 +1284,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelperException e) { + getOptions().getClock(), + DEFAULT_RETRY_CONFIG); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -1362,7 +1367,7 @@ private static QueryResponse getQueryResults( : jobId.getLocation()); try { GetQueryResultsResponse results = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override public GetQueryResultsResponse call() { @@ -1376,8 +1381,10 @@ public GetQueryResultsResponse call() { } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, - serviceOptions.getClock()); + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getClock(), + DEFAULT_RETRY_CONFIG); + TableSchema schemaPb = results.getSchema(); ImmutableList.Builder errors = ImmutableList.builder(); @@ -1393,7 +1400,7 @@ public GetQueryResultsResponse call() { .setTotalRows(results.getTotalRows() == null ? 0 : results.getTotalRows().longValue()) .setErrors(errors.build()) .build(); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java new file mode 100644 index 0000000000..1a75a9c08b --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -0,0 +1,152 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.ResultRetryAlgorithmWithContext; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetryingContext; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; +import java.util.Iterator; +import java.util.concurrent.CancellationException; + +public class BigQueryRetryAlgorithm extends RetryAlgorithm { + private final BigQueryRetryConfig bigQueryRetryConfig; + private final ResultRetryAlgorithm resultAlgorithm; + private final TimedRetryAlgorithm timedAlgorithm; + private final ResultRetryAlgorithmWithContext resultAlgorithmWithContext; + private final TimedRetryAlgorithmWithContext timedAlgorithmWithContext; + + public BigQueryRetryAlgorithm( + ResultRetryAlgorithm resultAlgorithm, + TimedRetryAlgorithm timedAlgorithm, + BigQueryRetryConfig bigQueryRetryConfig) { + super(resultAlgorithm, timedAlgorithm); + this.bigQueryRetryConfig = checkNotNull(bigQueryRetryConfig); + this.resultAlgorithm = checkNotNull(resultAlgorithm); + this.timedAlgorithm = checkNotNull(timedAlgorithm); + this.resultAlgorithmWithContext = null; + this.timedAlgorithmWithContext = null; + } + + @Override + public boolean shouldRetry( + RetryingContext context, + Throwable previousThrowable, + ResponseT previousResponse, + TimedAttemptSettings nextAttemptSettings) + throws CancellationException { + // Implementing shouldRetryBasedOnBigQueryRetryConfig so that we can retry exceptions based on + // the exception messages + return (shouldRetryBasedOnResult(context, previousThrowable, previousResponse) + || shouldRetryBasedOnBigQueryRetryConfig(previousThrowable, bigQueryRetryConfig)) + && shouldRetryBasedOnTiming(context, nextAttemptSettings); + } + + private boolean shouldRetryBasedOnBigQueryRetryConfig( + Throwable previousThrowable, BigQueryRetryConfig bigQueryRetryConfig) { + /* + We are deciding if a given error should be retried on the basis of error message. + Cannot rely on Error/Status code as for example error code 400 (which is not retriable) could be thrown due to rateLimitExceed, which is retriable + */ + String errorDesc; + if (previousThrowable != null && (errorDesc = previousThrowable.getMessage()) != null) { + for (Iterator retriableMessages = + bigQueryRetryConfig.getRetriableErrorMessages().iterator(); + retriableMessages.hasNext(); ) { + if (errorDesc.contains(retriableMessages.next())) { // Error message should be retried + return true; + } + } + } + return false; + } + + /*Duplicating this method as it can not be inherited from the RetryAlgorithm due to the default access modifier*/ + boolean shouldRetryBasedOnResult( + RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) { + if (resultAlgorithmWithContext != null && context != null) { + return resultAlgorithmWithContext.shouldRetry(context, previousThrowable, previousResponse); + } + return getResultAlgorithm().shouldRetry(previousThrowable, previousResponse); + } + + /*Duplicating this method as it can not be inherited from the RetryAlgorithm due to the private access modifier*/ + private boolean shouldRetryBasedOnTiming( + RetryingContext context, TimedAttemptSettings nextAttemptSettings) { + if (nextAttemptSettings == null) { + return false; + } + if (timedAlgorithmWithContext != null && context != null) { + return timedAlgorithmWithContext.shouldRetry(context, nextAttemptSettings); + } + return getTimedAlgorithm().shouldRetry(nextAttemptSettings); + } + + @Override + public TimedAttemptSettings createNextAttempt( + RetryingContext context, + Throwable previousThrowable, + ResponseT previousResponse, + TimedAttemptSettings previousSettings) { + // a small optimization that avoids calling relatively heavy methods + // like timedAlgorithm.createNextAttempt(), when it is not necessary. + + if (!((shouldRetryBasedOnResult(context, previousThrowable, previousResponse) + || shouldRetryBasedOnBigQueryRetryConfig( + previousThrowable, + bigQueryRetryConfig)))) { // Calling shouldRetryBasedOnBigQueryRetryConfig to check if + // the error message could be retried + return null; + } + + TimedAttemptSettings newSettings = + createNextAttemptBasedOnResult( + context, previousThrowable, previousResponse, previousSettings); + if (newSettings == null) { + newSettings = createNextAttemptBasedOnTiming(context, previousSettings); + } + return newSettings; + } + + /*Duplicating this method as it can not be inherited from the RetryAlgorithm due to the private access modifier*/ + private TimedAttemptSettings createNextAttemptBasedOnResult( + RetryingContext context, + Throwable previousThrowable, + ResponseT previousResponse, + TimedAttemptSettings previousSettings) { + if (resultAlgorithmWithContext != null && context != null) { + return resultAlgorithmWithContext.createNextAttempt( + context, previousThrowable, previousResponse, previousSettings); + } + return getResultAlgorithm() + .createNextAttempt(previousThrowable, previousResponse, previousSettings); + } + + /*Duplicating this method as it can not be inherited from the RetryAlgorithm due to the private access modifier*/ + private TimedAttemptSettings createNextAttemptBasedOnTiming( + RetryingContext context, TimedAttemptSettings previousSettings) { + if (timedAlgorithmWithContext != null && context != null) { + return timedAlgorithmWithContext.createNextAttempt(context, previousSettings); + } + return getTimedAlgorithm().createNextAttempt(previousSettings); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java new file mode 100644 index 0000000000..7e28e57073 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java @@ -0,0 +1,54 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.common.collect.ImmutableSet; + +public class BigQueryRetryConfig { + private final ImmutableSet retriableErrorMessages; + + private BigQueryRetryConfig(Builder builder) { + retriableErrorMessages = builder.retriableErrorMessages.build(); + } + + public ImmutableSet getRetriableErrorMessages() { + return retriableErrorMessages; + } + + // BigQueryRetryConfig builder + public static class Builder { + private final ImmutableSet.Builder retriableErrorMessages = ImmutableSet.builder(); + + private Builder() {} + + public final Builder retryOnMessage(String... errorMessages) { + for (String errorMessage : errorMessages) { + retriableErrorMessages.add(checkNotNull(errorMessage)); + } + return this; + } + + public BigQueryRetryConfig build() { + return new BigQueryRetryConfig(this); + } + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java new file mode 100644 index 0000000000..7c1e0e5927 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java @@ -0,0 +1,76 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.api.core.ApiClock; +import com.google.api.gax.retrying.*; +import com.google.cloud.RetryHelper; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; + +public class BigQueryRetryHelper extends RetryHelper { + + public static V runWithRetries( + Callable callable, + RetrySettings retrySettings, + ResultRetryAlgorithm resultRetryAlgorithm, + ApiClock clock, + BigQueryRetryConfig bigQueryRetryConfig) + throws RetryHelperException { + try { + // Suppressing should be ok as a workaraund. Current and only ResultRetryAlgorithm + // implementation does not use response at all, so ignoring its type is ok. + @SuppressWarnings("unchecked") + ResultRetryAlgorithm algorithm = (ResultRetryAlgorithm) resultRetryAlgorithm; + return run( + callable, + new ExponentialRetryAlgorithm(retrySettings, clock), + algorithm, + bigQueryRetryConfig); + } catch (Exception e) { + throw new BigQueryRetryHelperException(e.getCause()); + } + } + + private static V run( + Callable callable, + TimedRetryAlgorithm timedAlgorithm, + ResultRetryAlgorithm resultAlgorithm, + BigQueryRetryConfig bigQueryRetryConfig) + throws ExecutionException, InterruptedException { + RetryAlgorithm retryAlgorithm = + new BigQueryRetryAlgorithm<>( + resultAlgorithm, + timedAlgorithm, + bigQueryRetryConfig); // using BigQueryRetryAlgorithm in place of + // com.google.api.gax.retrying.RetryAlgorithm, as + // BigQueryRetryAlgorithm retries considering bigQueryRetryConfig + RetryingExecutor executor = new DirectRetryingExecutor<>(retryAlgorithm); + + RetryingFuture retryingFuture = executor.createFuture(callable); + executor.submit(retryingFuture); + return retryingFuture.get(); + } + + public static class BigQueryRetryHelperException extends RuntimeException { + + private static final long serialVersionUID = -8519852520090965314L; + + BigQueryRetryHelperException(Throwable cause) { + super(cause); + } + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 6ef7eb9061..7ed27676ce 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -73,6 +73,10 @@ public class Job extends JobInfo { private final BigQueryOptions options; private transient BigQuery bigquery; + private static final BigQueryRetryConfig DEFAULT_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder() + .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) + .build(); // retry config with Error Message for RateLimitExceeded Error /** A builder for {@code Job} objects. */ public static final class Builder extends JobInfo.Builder { @@ -319,7 +323,7 @@ public TableResult getQueryResults(QueryResultsOption... options) } private QueryResponse waitForQueryResults( - RetrySettings waitSettings, final QueryResultsOption... resultsOptions) + RetrySettings retrySettings, final QueryResultsOption... resultsOptions) throws InterruptedException { if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( @@ -327,22 +331,26 @@ private QueryResponse waitForQueryResults( } try { - return RetryHelper.poll( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override public QueryResponse call() { return bigquery.getQueryResults(getJobId(), resultsOptions); } }, - waitSettings, + retrySettings, new BasicResultRetryAlgorithm() { @Override - public boolean shouldRetry(Throwable prevThrowable, QueryResponse prevResponse) { + public boolean shouldRetry( + Throwable prevThrowable, + QueryResponse + prevResponse) { // Used by BigQueryRetryAlgorithm.shouldRetryBasedOnResult return prevResponse != null && !prevResponse.getCompleted(); } }, - options.getClock()); - } catch (ExecutionException e) { + options.getClock(), + DEFAULT_RETRY_CONFIG); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 7c970313fb..654cc02668 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -2173,6 +2173,49 @@ public void testGetQueryResults() { verify(bigqueryRpcMock).getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } + @Test + public void testGetQueryResultsRetry() { + JobId queryJob = JobId.of(JOB); + GetQueryResultsResponse responsePb = + new GetQueryResultsResponse() + .setEtag("etag") + .setJobReference(queryJob.toPb()) + .setRows(ImmutableList.of(TABLE_ROW)) + .setJobComplete(true) + .setCacheHit(false) + .setPageToken(CURSOR) + .setTotalBytesProcessed(42L) + .setTotalRows(BigInteger.valueOf(1L)); + + when(bigqueryRpcMock.getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + .thenThrow(new BigQueryException(500, "InternalError")) + .thenThrow(new BigQueryException(502, "Bad Gateway")) + .thenThrow(new BigQueryException(503, "Service Unavailable")) + .thenThrow(new BigQueryException(504, "Gateway Timeout")) + .thenThrow( + new BigQueryException( + 400, + BigQueryErrorMessages + .RATE_LIMIT_EXCEEDED_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG + .thenReturn(responsePb); + + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + QueryResponse response = bigquery.getQueryResults(queryJob); + assertEquals(true, response.getCompleted()); + assertEquals(null, response.getSchema()); + // IMP: Unable to test for idempotency of the requests using getQueryResults(PROJECT, JOB, null, + // EMPTY_RPC_OPTIONS) as there is no + // identifier in this method which will can potentially differ and which can be used to + // establish idempotency + verify(bigqueryRpcMock, times(6)).getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + } + @Test public void testGetQueryResultsWithProject() { JobId queryJob = JobId.of(OTHER_PROJECT, JOB); @@ -2377,6 +2420,56 @@ public void testFastQueryDMLShouldRetry() throws Exception { verify(bigqueryRpcMock, times(5)).queryRpc(eq(PROJECT), requestPbCapture.capture()); } + @Test + public void testFastQueryRateLimitIdempotency() throws Exception { + com.google.api.services.bigquery.model.QueryResponse responsePb = + new com.google.api.services.bigquery.model.QueryResponse() + .setCacheHit(false) + .setJobComplete(true) + .setRows(ImmutableList.of(TABLE_ROW)) + .setPageToken(null) + .setTotalBytesProcessed(42L) + .setNumDmlAffectedRows(1L) + .setSchema(TABLE_SCHEMA.toPb()); + + when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + .thenThrow(new BigQueryException(500, "InternalError")) + .thenThrow(new BigQueryException(502, "Bad Gateway")) + .thenThrow(new BigQueryException(503, "Service Unavailable")) + .thenThrow(new BigQueryException(504, "Gateway Timeout")) + .thenThrow( + new BigQueryException( + 400, + BigQueryErrorMessages + .RATE_LIMIT_EXCEEDED_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG + .thenReturn(responsePb); + + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + TableResult response = bigquery.query(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY); + assertEquals(TABLE_SCHEMA, response.getSchema()); + assertEquals(1, response.getTotalRows()); + + List allRequests = requestPbCapture.getAllValues(); + boolean idempotent = true; + String firstRequestId = allRequests.get(0).getRequestId(); + for (QueryRequest request : allRequests) { + idempotent = + idempotent + && request + .getRequestId() + .equals(firstRequestId); // all the requestIds should be the same + } + + assertTrue(idempotent); + verify(bigqueryRpcMock, times(6)).queryRpc(eq(PROJECT), requestPbCapture.capture()); + } + @Test public void testFastQueryDDLShouldRetry() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = From 271b8612da64e5216ac6dc5a39493b0593b23320 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Jul 2021 16:35:24 +0200 Subject: [PATCH 0264/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.118.0 (#1445) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a246db86b0..f8098e0e80 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ com.google.cloud google-cloud-storage - 1.117.1 + 1.118.0 test From 152fcbc6ed1c1fa15882f47bc9fb18e67c6064da Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 14 Jul 2021 14:49:22 -0400 Subject: [PATCH 0265/2268] chore: release 1.137.0 (#1446) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37703e4d13..61a9288036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.137.0](https://www.github.com/googleapis/java-bigquery/compare/v1.136.0...v1.137.0) (2021-07-14) + + +### Features + +* Implemented BigQueryRetryAlgorithm to retry on the basis of the configured re-triable error messages ([#1426](https://www.github.com/googleapis/java-bigquery/issues/1426)) ([44d9795](https://www.github.com/googleapis/java-bigquery/commit/44d97953febac11c9167efe6781c779f486355d0)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v1.118.0 ([#1445](https://www.github.com/googleapis/java-bigquery/issues/1445)) ([271b861](https://www.github.com/googleapis/java-bigquery/commit/271b8612da64e5216ac6dc5a39493b0593b23320)) + ## [1.136.0](https://www.github.com/googleapis/java-bigquery/compare/v1.135.4...v1.136.0) (2021-07-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e020261d5d..73c531d1e5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.136.1-SNAPSHOT + 1.137.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3d27c9c455..3962853ead 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.136.1-SNAPSHOT + 1.137.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.136.1-SNAPSHOT + 1.137.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f8098e0e80..a26524e47e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.136.1-SNAPSHOT + 1.137.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.136.1-SNAPSHOT + 1.137.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e4f7217814..34e15c6977 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.136.1-SNAPSHOT + 1.137.0 diff --git a/versions.txt b/versions.txt index 1e049cff6d..0d84de13f0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.136.0:1.136.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.137.0:1.137.0 \ No newline at end of file From 0580c93cb0260c872a4f8378c687a85cb398ed3a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Jul 2021 00:15:29 +0200 Subject: [PATCH 0266/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.137.0 (#1449) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5900c73f63..5599ed758b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.136.0 + 1.137.0 From c4684d295b7e0a8e360ccaf56ad595d87a0ad7b5 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 15 Jul 2021 12:47:23 -0400 Subject: [PATCH 0267/2268] chore: update dependencyDashboard labels (#1450) --- renovate.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index cc3338a4d2..2b19d40fdf 100644 --- a/renovate.json +++ b/renovate.json @@ -78,5 +78,8 @@ } ], "semanticCommits": true, - "masterIssue": true + "dependencyDashboard": true, + "dependencyDashboardLabels": [ + "type: process" + ] } From 1649761866b8a81e6ff6f77a5040c0f54b49720a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 15 Jul 2021 10:38:11 -0700 Subject: [PATCH 0268/2268] chore: regenerate README (#1447) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-14 14:00:36,442 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-14 14:00:38,032 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/f091cf98-ac21-47fe-84f4-e8de387b2a31/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 6 +-- README.md | 48 +++++++++++++++++++- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 4047572e2e..feb26e69b8 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "b7aef82248b7fe6bf672bd7394d69745c9fd3335" + "sha": "44d97953febac11c9167efe6781c779f486355d0" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "09c59c20a4bf0daed1665af59035ff240fe356df" + "sha": "959d4f81f2d1397297ebda90212df92aa0ef3a6a" } } ] -} \ No newline at end of file +} diff --git a/README.md b/README.md index e3649f5251..fa0455d5b5 100644 --- a/README.md +++ b/README.md @@ -240,10 +240,50 @@ has instructions for running the samples. To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. -## Java Versions +## Supported Java Versions Java 7 or above is required for using this client. +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + ## Versioning @@ -304,3 +344,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquery.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java From 5130cd0c6ed1ef32b071b64448fa061328628bb9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Jul 2021 17:56:24 +0000 Subject: [PATCH 0269/2268] chore: release 1.137.1-SNAPSHOT (#1448) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 73c531d1e5..529dac04bd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.0 + 1.137.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3962853ead..780847d3b7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.0 + 1.137.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.0 + 1.137.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a26524e47e..2e3e2089fa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.0 + 1.137.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.0 + 1.137.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 34e15c6977..376efb1c3d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.0 + 1.137.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0d84de13f0..0fbef41b6b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.0:1.137.0 \ No newline at end of file +google-cloud-bigquery:1.137.0:1.137.1-SNAPSHOT \ No newline at end of file From ea962e5fe8ab8b1247f47d9256c79e9291021dfb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 15 Jul 2021 12:48:28 -0700 Subject: [PATCH 0270/2268] chore: regenerate README (#1451) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-15 17:40:24,538 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-15 17:40:26,878 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/5fef9a31-e50d-446f-9f08-89e25341cfe1/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index feb26e69b8..bafc7ea1c6 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "44d97953febac11c9167efe6781c779f486355d0" + "sha": "1649761866b8a81e6ff6f77a5040c0f54b49720a" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "959d4f81f2d1397297ebda90212df92aa0ef3a6a" + "sha": "4124d245133c0f740ac5e6fa2e7daeba327f1297" } } ] diff --git a/README.md b/README.md index fa0455d5b5..0c50bf1f95 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.136.0 + 1.137.0 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.136.0' +compile 'com.google.cloud:google-cloud-bigquery:1.137.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.136.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.0" ``` ## Authentication From fea5eca733d501b72b8713e555f54dc86bbde85f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Jul 2021 20:17:22 +0200 Subject: [PATCH 0271/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v1.27.3 (#1452) * deps: update dependency com.google.cloud:google-cloud-bigtable to v1.27.3 * Update ITBigQueryTest.java Co-authored-by: Stephanie Wang --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 1 - samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 1669343fb2..1e0291757a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3118,7 +3118,6 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo assertEquals(2L, statistics.getOutputRows().longValue()); LoadJobConfiguration jobConfiguration = job.getConfiguration(); assertEquals(TABLE_SCHEMA, jobConfiguration.getSchema()); - assertNull(jobConfiguration.getSourceUris()); assertNull(job.getStatus().getError()); Page rows = bigquery.listTableData(tableId); int rowCount = 0; diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5599ed758b..7b8db0bb12 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.27.2 + 1.27.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 376efb1c3d..c3ee223cac 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.27.2 + 1.27.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 75dcec18d9..0b87f947dd 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.27.2 + 1.27.3 test From 53d832d741e21a985e90c98796cde4311a8e8c49 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:30:26 +0000 Subject: [PATCH 0272/2268] chore: release 1.137.1 (#1453) :robot: I have created a release \*beep\* \*boop\* --- ### [1.137.1](https://www.github.com/googleapis/java-bigquery/compare/v1.137.0...v1.137.1) (2021-07-20) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v1.27.3 ([#1452](https://www.github.com/googleapis/java-bigquery/issues/1452)) ([fea5eca](https://www.github.com/googleapis/java-bigquery/commit/fea5eca733d501b72b8713e555f54dc86bbde85f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61a9288036..1fd4c8bcdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.137.1](https://www.github.com/googleapis/java-bigquery/compare/v1.137.0...v1.137.1) (2021-07-20) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v1.27.3 ([#1452](https://www.github.com/googleapis/java-bigquery/issues/1452)) ([fea5eca](https://www.github.com/googleapis/java-bigquery/commit/fea5eca733d501b72b8713e555f54dc86bbde85f)) + ## [1.137.0](https://www.github.com/googleapis/java-bigquery/compare/v1.136.0...v1.137.0) (2021-07-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 529dac04bd..498feacd90 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.1-SNAPSHOT + 1.137.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 780847d3b7..791daeb241 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.1-SNAPSHOT + 1.137.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.1-SNAPSHOT + 1.137.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2e3e2089fa..c532a34152 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.1-SNAPSHOT + 1.137.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.1-SNAPSHOT + 1.137.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c3ee223cac..491c439fff 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.1-SNAPSHOT + 1.137.1 diff --git a/versions.txt b/versions.txt index 0fbef41b6b..a686574b76 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.0:1.137.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.137.1:1.137.1 \ No newline at end of file From a4534276647ef4959e8d3bf1f8ddd2a44756e3eb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:42:24 +0000 Subject: [PATCH 0273/2268] chore: release 1.137.2-SNAPSHOT (#1454) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 498feacd90..dd5e1957a6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.1 + 1.137.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 791daeb241..8de9d97f6b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.1 + 1.137.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.1 + 1.137.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c532a34152..4fb2fc618d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.1 + 1.137.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.1 + 1.137.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 491c439fff..3f09a7025e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.1 + 1.137.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index a686574b76..0a55f63e4e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.1:1.137.1 \ No newline at end of file +google-cloud-bigquery:1.137.1:1.137.2-SNAPSHOT \ No newline at end of file From d9a644b9321b3eabc2b19630d52a543f3f55e120 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 21 Jul 2021 19:04:49 +0200 Subject: [PATCH 0274/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v1.2.0 (#1456) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7b8db0bb12..35cb93c975 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.5 + 1.2.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3f09a7025e..91e4f4b1f9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.5 + 1.2.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0b87f947dd..3e09136ee5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.1.5 + 1.2.0 test From 8aebe3d57b2bfe3b9fb521d790d816025cd6f51a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 21 Jul 2021 19:05:08 +0200 Subject: [PATCH 0275/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.137.1 (#1455) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 35cb93c975..a658c0fbd8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.137.0 + 1.137.1 From 7da9066e3dcf4ca324bf6e7c27646a5d79d1cd26 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 21 Jul 2021 10:18:26 -0700 Subject: [PATCH 0276/2268] chore: regenerate README (#1457) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-21 17:07:06,311 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-21 17:07:08,743 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/c96f6af5-b304-4409-a21d-c2c8aa43b2dd/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 6 +++--- README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index bafc7ea1c6..ee1e7a7162 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "1649761866b8a81e6ff6f77a5040c0f54b49720a" + "sha": "8aebe3d57b2bfe3b9fb521d790d816025cd6f51a" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "4124d245133c0f740ac5e6fa2e7daeba327f1297" + "sha": "1563597d28eca099d6411bbc29ecd09314a80746" } } ] -} +} \ No newline at end of file diff --git a/README.md b/README.md index 0c50bf1f95..b5d6856f07 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.137.0 + 1.137.1 ``` @@ -53,12 +53,12 @@ compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.137.0' +compile 'com.google.cloud:google-cloud-bigquery:1.137.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.1" ``` ## Authentication From 6089e6a98c8e85538f330502ba278e8cc730f58d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 27 Jul 2021 18:19:27 +0200 Subject: [PATCH 0277/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v20.9.0 (#1460) * chore(deps): update dependency com.google.cloud:libraries-bom to v20.9.0 * Update pom.xml Co-authored-by: Stephanie Wang --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3e09136ee5..1d7f01ba8e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.8.0 + 20.9.0 pom import From 4cc796e90272b284716494e337e92ddde561771b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 27 Jul 2021 09:32:13 -0700 Subject: [PATCH 0278/2268] chore: regenerate README (#1463) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-07-27 16:21:44,428 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-07-27 16:21:45,704 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/3ae0c958-02c5-446d-9a4a-590df8bc91be/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 22 ++++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index ee1e7a7162..3bbb3a6a2d 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "8aebe3d57b2bfe3b9fb521d790d816025cd6f51a" + "sha": "6089e6a98c8e85538f330502ba278e8cc730f58d" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1563597d28eca099d6411bbc29ecd09314a80746" + "sha": "3d32990b6f4b57be77455e3ca89e6e21cd0c06b3" } } ] diff --git a/README.md b/README.md index b5d6856f07..c10a62e81d 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,11 @@ Java idiomatic client for [Cloud BigQuery][product-docs]. - [Product Documentation][product-docs] - [Client Library Documentation][javadocs] + ## Quickstart If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file + ```xml @@ -19,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.8.0 + 20.9.0 pom import @@ -36,6 +38,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google If you are using Maven without BOM, add this to your dependencies: + ```xml com.google.cloud @@ -46,17 +49,20 @@ If you are using Maven without BOM, add this to your dependencies: ``` If you are using Gradle 5.x or later, add this to your dependencies + ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.8.0') +implementation platform('com.google.cloud:libraries-bom:20.9.0') compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies + ```Groovy compile 'com.google.cloud:google-cloud-bigquery:1.137.1' ``` If you are using SBT, add this to your dependencies + ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.1" ``` @@ -65,6 +71,10 @@ libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.1" See the [Authentication][authentication] section in the base directory's README. +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud BigQuery APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud BigQuery API calls. + ## Getting Started ### Prerequisites @@ -96,8 +106,7 @@ use this Cloud BigQuery Client Library. ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree/master/samples) directory. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | @@ -290,6 +299,7 @@ and on [google-cloud-java][g-c-j]. This library follows [Semantic Versioning](http://semver.org/). + ## Contributing @@ -301,6 +311,7 @@ Please note that this project is released with a Contributor Code of Conduct. By this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + ## License Apache 2.0 - See [LICENSE][license] for more information. @@ -333,6 +344,9 @@ Java is a registered trademark of Oracle and/or its affiliates. [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquery&core=gav [authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ From 0a8eac2b679cf3e330e7325452a09f99e352a380 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Jul 2021 23:54:25 +0200 Subject: [PATCH 0279/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v0.13.1 (#1464) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fb2fc618d..efbae908e0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.12.0 + 0.13.1 From 06df9a65bfd58794a0898b0919cd3706a2dddd31 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 3 Aug 2021 14:16:10 -0400 Subject: [PATCH 0280/2268] chore: fix checker-qual dependency issue (#1468) --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index efbae908e0..8b3e23a1e2 100644 --- a/pom.xml +++ b/pom.xml @@ -98,6 +98,12 @@ truth 1.1.3 test + + + org.checkerframework + checker-qual + + org.mockito From 079c6cd29950b0b9526507cc6da57e7d3de76049 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 3 Aug 2021 18:48:27 -0400 Subject: [PATCH 0281/2268] build: configure branch java7 as a release branch (#1470) enable releases --- .github/release-please.yml | 12 ++-- .github/sync-repo-settings.yaml | 119 +++++++++++++++----------------- 2 files changed, 64 insertions(+), 67 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index c7b756e1bf..e44bbbd7ec 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,8 +1,12 @@ branches: -- branch: 1.127.12-sp - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-lts + - branch: 1.127.12-sp + bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-lts + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + branch: java7 bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index ba8ff8a8dc..65592909d6 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,68 +1,61 @@ -# Whether or not rebase-merging is enabled on this repository. -# Defaults to `true` rebaseMergeAllowed: true - -# Whether or not squash-merging is enabled on this repository. -# Defaults to `true` squashMergeAllowed: true - -# Whether or not PRs are merged with a merge commit on this repository. -# Defaults to `false` mergeCommitAllowed: false - -# Rules for master branch protection branchProtectionRules: -# Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master - # Can admins overwrite branch protection. - # Defaults to `true` - isAdminEnforced: true - # Number of approving reviews required to update matching branches. - # Defaults to `1` - requiredApprovingReviewCount: 1 - # Are reviews from code owners required to update matching branches. - # Defaults to `false` - requiresCodeOwnerReviews: true - # Require up to date branches - requiresStrictStatusChecks: false - # List of required status check contexts that must pass for commits to be accepted to matching branches. - requiredStatusCheckContexts: - - "dependencies (8)" - - "dependencies (11)" - - "linkage-monitor" - - "lint" - - "clirr" - - "units (7)" - - "units (8)" - - "units (11)" - - "Kokoro - Test: Integration" - - "cla/google" -- pattern: 1.127.12-sp - isAdminEnforced: true - requiredApprovingReviewCount: 1 - requiresCodeOwnerReviews: true - requiresStrictStatusChecks: false - requiredStatusCheckContexts: - - "dependencies (8)" - - "dependencies (11)" - - "linkage-monitor" - - "lint" - - "clirr" - - "units (7)" - - "units (8)" - - "units (11)" - - "Kokoro - Test: Integration" - - "cla/google" -# List of explicit permissions to add (additive only) + - pattern: master + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: 1.127.12-sp + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: java7 + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - linkage-monitor + - lint + - clirr + - units (7) + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google permissionRules: -# Team slug to add to repository permissions -- team: api-bigquery - # Access level required, one of push|pull|admin|maintain|triage - permission: admin -- team: yoshi-java - permission: push -- team: yoshi-admins - permission: admin -- team: yoshi-java-admins - permission: admin + - team: api-bigquery + permission: admin + - team: yoshi-java + permission: push + - team: yoshi-admins + permission: admin + - team: yoshi-java-admins + permission: admin From 9df5ac2525e3aa9b52512d59cab0fc8b998f0bc9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 4 Aug 2021 17:40:05 +0200 Subject: [PATCH 0282/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210726-1.32.1 (#1469) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b3e23a1e2..14d8e68409 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210617-1.32.1 + v2-rev20210726-1.32.1 1.4.0
From 4ae1be7b26fa1a3e84a47872b1b0ebaf0a7b885e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 4 Aug 2021 09:18:17 -0700 Subject: [PATCH 0283/2268] chore: remove java 7 units check (#1465) Source-Author: Neenu Shaji Source-Date: Wed Jul 28 18:18:26 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 1a2878d6909dd10ca4e3c1b5943d6622e996054e Source-Link: https://github.com/googleapis/synthtool/commit/1a2878d6909dd10ca4e3c1b5943d6622e996054e --- .github/workflows/ci.yaml | 2 +- synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0195b32f00..65ae6ecdda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [7, 8, 11] + java: [8, 11] steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 diff --git a/synth.metadata b/synth.metadata index efc71a0989..04f29b61f9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "526c517f1940007e532c7e1f7e1fa01a985f30e2" + "sha": "0a8eac2b679cf3e330e7325452a09f99e352a380" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "09c59c20a4bf0daed1665af59035ff240fe356df" + "sha": "1a2878d6909dd10ca4e3c1b5943d6622e996054e" } } ], From 120343fc8f398f2a913106a9c1cdbd5cc70053af Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 4 Aug 2021 12:20:13 -0400 Subject: [PATCH 0284/2268] ci: remove Java 7 branch protection (#1476) --- .github/sync-repo-settings.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 65592909d6..60fc43347a 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -13,7 +13,6 @@ branchProtectionRules: - linkage-monitor - lint - clirr - - units (7) - units (8) - units (11) - 'Kokoro - Test: Integration' From 227983e2c69dfdd5001f9c951f086daadb937578 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 Aug 2021 18:47:33 +0200 Subject: [PATCH 0285/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2 (#1472) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 14d8e68409..05532fd947 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210726-1.32.1 - 1.4.0 + 2.0.0
From f92cda6581ab29201f1df248e1d1425278414c74 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 17:32:18 +0000 Subject: [PATCH 0286/2268] chore: release 1.137.2 (#1474) :robot: I have created a release \*beep\* \*boop\* --- ### [1.137.2](https://www.github.com/googleapis/java-bigquery/compare/v1.137.1...v1.137.2) (2021-08-05) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210726-1.32.1 ([#1469](https://www.github.com/googleapis/java-bigquery/issues/1469)) ([9df5ac2](https://www.github.com/googleapis/java-bigquery/commit/9df5ac2525e3aa9b52512d59cab0fc8b998f0bc9)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#1472](https://www.github.com/googleapis/java-bigquery/issues/1472)) ([227983e](https://www.github.com/googleapis/java-bigquery/commit/227983e2c69dfdd5001f9c951f086daadb937578)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd4c8bcdb..50faf1dfd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.137.2](https://www.github.com/googleapis/java-bigquery/compare/v1.137.1...v1.137.2) (2021-08-05) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210726-1.32.1 ([#1469](https://www.github.com/googleapis/java-bigquery/issues/1469)) ([9df5ac2](https://www.github.com/googleapis/java-bigquery/commit/9df5ac2525e3aa9b52512d59cab0fc8b998f0bc9)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#1472](https://www.github.com/googleapis/java-bigquery/issues/1472)) ([227983e](https://www.github.com/googleapis/java-bigquery/commit/227983e2c69dfdd5001f9c951f086daadb937578)) + ### [1.137.1](https://www.github.com/googleapis/java-bigquery/compare/v1.137.0...v1.137.1) (2021-07-20) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dd5e1957a6..93e734c51c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.2-SNAPSHOT + 1.137.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8de9d97f6b..53193af39c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.2-SNAPSHOT + 1.137.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.2-SNAPSHOT + 1.137.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 05532fd947..efa91627a1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.2-SNAPSHOT + 1.137.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.2-SNAPSHOT + 1.137.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 91e4f4b1f9..ea2a871b5d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.2-SNAPSHOT + 1.137.2 diff --git a/versions.txt b/versions.txt index 0a55f63e4e..78aacc2fe6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.1:1.137.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:1.137.2:1.137.2 \ No newline at end of file From 563c30f2ed5db906b03ceffcc2c4e1c9cd8e8d20 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 17:48:17 +0000 Subject: [PATCH 0287/2268] chore: release 1.137.3-SNAPSHOT (#1477) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 93e734c51c..fd7b78612a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.2 + 1.137.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 53193af39c..daa06a95ca 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.2 + 1.137.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.2 + 1.137.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index efa91627a1..f1c1801505 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.2 + 1.137.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.2 + 1.137.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ea2a871b5d..ee9332c71a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.2 + 1.137.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 78aacc2fe6..54035a102a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.2:1.137.2 \ No newline at end of file +google-cloud-bigquery:1.137.2:1.137.3-SNAPSHOT \ No newline at end of file From 3db013eeb01f255e1bc40af21370241761f2b519 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 Aug 2021 19:52:17 +0200 Subject: [PATCH 0288/2268] feat!: update dependency com.google.cloud:google-cloud-shared-config to v1 (#1466) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `0.13.1` -> `1.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.0/compatibility-slim/0.13.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.0/confidence-slim/0.13.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.0.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​100-httpswwwgithubcomgoogleapisjava-shared-configcomparev0131v100-2021-07-29) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v0.13.1...v1.0.0) ##### ⚠ BREAKING CHANGES - update shared-config to java 1.8 ([#​277](https://togithub.com/googleapis/java-shared-config/issues/277)) ##### Features - update shared-config to java 1.8 ([#​277](https://www.github.com/googleapis/java-shared-config/issues/277)) ([9c297a2](https://www.github.com/googleapis/java-shared-config/commit/9c297a27bc236092aab3ae292c7bed206293bc51)) ##### [0.13.1](https://www.github.com/googleapis/java-shared-config/compare/v0.13.0...v0.13.1) (2021-07-27) ##### Bug Fixes - revert update dependency org.apache.maven.plugins:maven-dependency-plugin to v3.2.0 ([#​280](https://www.github.com/googleapis/java-shared-config/issues/280)) ([bdbbb9c](https://www.github.com/googleapis/java-shared-config/commit/bdbbb9c13571d0ef06009ebf03bc25c6e6fcbc17))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- .../cloud/bigquery/JobStatisticsTest.java | 13 +++++++++---- .../cloud/bigquery/it/ITBigQueryTest.java | 18 ++++++------------ pom.xml | 2 +- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index a28eae26b9..edd76f821d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -322,26 +322,31 @@ public void testIncomplete() { new com.google.api.services.bigquery.model.JobStatistics() .setCreationTime(1234L) .setStartTime(5678L)); + JobStatistics jobStatistics; job.setConfiguration( new com.google.api.services.bigquery.model.JobConfiguration() .setCopy(new com.google.api.services.bigquery.model.JobConfigurationTableCopy())); - assertThat(JobStatistics.fromPb(job)).isInstanceOf(CopyStatistics.class); + jobStatistics = JobStatistics.fromPb(job); + assertThat(jobStatistics).isInstanceOf(CopyStatistics.class); job.setConfiguration( new com.google.api.services.bigquery.model.JobConfiguration() .setLoad(new com.google.api.services.bigquery.model.JobConfigurationLoad())); - assertThat(JobStatistics.fromPb(job)).isInstanceOf(LoadStatistics.class); + jobStatistics = JobStatistics.fromPb(job); + assertThat(jobStatistics).isInstanceOf(LoadStatistics.class); job.setConfiguration( new com.google.api.services.bigquery.model.JobConfiguration() .setExtract(new com.google.api.services.bigquery.model.JobConfigurationExtract())); - assertThat(JobStatistics.fromPb(job)).isInstanceOf(ExtractStatistics.class); + jobStatistics = JobStatistics.fromPb(job); + assertThat(jobStatistics).isInstanceOf(ExtractStatistics.class); job.setConfiguration( new com.google.api.services.bigquery.model.JobConfiguration() .setQuery(new com.google.api.services.bigquery.model.JobConfigurationQuery())); - assertThat(JobStatistics.fromPb(job)).isInstanceOf(QueryStatistics.class); + jobStatistics = JobStatistics.fromPb(job); + assertThat(jobStatistics).isInstanceOf(QueryStatistics.class); } private void compareExtractStatistics(ExtractStatistics expected, ExtractStatistics value) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 1e0291757a..ff4068940a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1202,11 +1202,9 @@ public void testUpdateTimePartitioning() { .build(); Table table = bigquery.create(TableInfo.of(tableId, tableDefinition)); - assertThat(table.getDefinition()).isInstanceOf(StandardTableDefinition.class); - assertThat( - ((StandardTableDefinition) table.getDefinition()) - .getTimePartitioning() - .getExpirationMs()) + TableDefinition definition = table.getDefinition(); + assertThat(definition).isInstanceOf(StandardTableDefinition.class); + assertThat(((StandardTableDefinition) definition).getTimePartitioning().getExpirationMs()) .isNull(); table = @@ -1219,10 +1217,9 @@ public void testUpdateTimePartitioning() { .build()) .build() .update(BigQuery.TableOption.fields(BigQuery.TableField.TIME_PARTITIONING)); + TableDefinition updatedDefinition = table.getDefinition(); assertThat( - ((StandardTableDefinition) table.getDefinition()) - .getTimePartitioning() - .getExpirationMs()) + ((StandardTableDefinition) updatedDefinition).getTimePartitioning().getExpirationMs()) .isEqualTo(42L); table = @@ -1235,10 +1232,7 @@ public void testUpdateTimePartitioning() { .build()) .build() .update(BigQuery.TableOption.fields(BigQuery.TableField.TIME_PARTITIONING)); - assertThat( - ((StandardTableDefinition) table.getDefinition()) - .getTimePartitioning() - .getExpirationMs()) + assertThat(((StandardTableDefinition) definition).getTimePartitioning().getExpirationMs()) .isNull(); table.delete(); diff --git a/pom.xml b/pom.xml index f1c1801505..e4eb0b2791 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.13.1 + 1.0.0 From d4b595f3f4b4df37923fae5f0bc55c5f43224780 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 18:30:21 +0000 Subject: [PATCH 0289/2268] chore: release 2.0.0 (#1478) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release \*beep\* \*boop\* --- ## [2.0.0](https://www.github.com/googleapis/java-bigquery/compare/v1.137.2...v2.0.0) (2021-08-05) ### ⚠ BREAKING CHANGES * update dependency com.google.cloud:google-cloud-shared-config to v1 (#1466) ### Features * update dependency com.google.cloud:google-cloud-shared-config to v1 ([#1466](https://www.github.com/googleapis/java-bigquery/issues/1466)) ([3db013e](https://www.github.com/googleapis/java-bigquery/commit/3db013eeb01f255e1bc40af21370241761f2b519)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 11 +++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50faf1dfd1..b94c054ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://www.github.com/googleapis/java-bigquery/compare/v1.137.2...v2.0.0) (2021-08-05) + + +### ⚠ BREAKING CHANGES + +* update dependency com.google.cloud:google-cloud-shared-config to v1 (#1466) + +### Features + +* update dependency com.google.cloud:google-cloud-shared-config to v1 ([#1466](https://www.github.com/googleapis/java-bigquery/issues/1466)) ([3db013e](https://www.github.com/googleapis/java-bigquery/commit/3db013eeb01f255e1bc40af21370241761f2b519)) + ### [1.137.2](https://www.github.com/googleapis/java-bigquery/compare/v1.137.1...v1.137.2) (2021-08-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index fd7b78612a..2ace43851c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 1.137.3-SNAPSHOT + 2.0.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index daa06a95ca..ad18c7f8b2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 1.137.3-SNAPSHOT + 2.0.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 1.137.3-SNAPSHOT + 2.0.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e4eb0b2791..66c0206dc4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 1.137.3-SNAPSHOT + 2.0.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 1.137.3-SNAPSHOT + 2.0.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ee9332c71a..0710d6ff48 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 1.137.3-SNAPSHOT + 2.0.0 diff --git a/versions.txt b/versions.txt index 54035a102a..19e967262e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:1.137.2:1.137.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.0.0:2.0.0 \ No newline at end of file From 2a45523feae0dcbfdc3ef72ef4b18ba1956fbc66 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 5 Aug 2021 11:44:18 -0700 Subject: [PATCH 0290/2268] chore: regenerate README (#1480) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-05 18:32:45,071 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-05 18:32:46,508 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/0e457f36-36f7-4db7-ae99-2372f2ca1054/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 3bbb3a6a2d..e60e8b6570 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "6089e6a98c8e85538f330502ba278e8cc730f58d" + "sha": "d4b595f3f4b4df37923fae5f0bc55c5f43224780" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3d32990b6f4b57be77455e3ca89e6e21cd0c06b3" + "sha": "df7fc1e3a6df4316920ab221431945cdf9aa7217" } } ] diff --git a/README.md b/README.md index c10a62e81d..52a2ac6a43 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.137.1' +compile 'com.google.cloud:google-cloud-bigquery:1.137.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.2" ``` ## Authentication From 6715073e6969c200107af70068796a3629e0a855 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Aug 2021 18:46:17 +0000 Subject: [PATCH 0291/2268] chore: release 2.0.1-SNAPSHOT (#1479) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2ace43851c..2b33cddef7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ad18c7f8b2..48c5d92aad 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.0.0 + 2.0.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.0.0 + 2.0.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 66c0206dc4..0966f147aa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.0.0 + 2.0.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0710d6ff48..4fbc5e7f3f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 19e967262e..d896d74df6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.0.0:2.0.0 \ No newline at end of file +google-cloud-bigquery:2.0.0:2.0.1-SNAPSHOT \ No newline at end of file From af599a865b988191bb45182063c5fd9403b50f4c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 Aug 2021 22:14:15 +0200 Subject: [PATCH 0292/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v1.137.2 (#1481) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a658c0fbd8..0beba8eb11 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.137.1 + 1.137.2 From dc454811a31d616e1b5de02789e9aee8b117e34a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 5 Aug 2021 13:30:37 -0700 Subject: [PATCH 0293/2268] chore: regenerate README (#1484) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-05 20:16:31,467 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-05 20:16:32,834 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/4b6ab7a2-490a-4134-8e1e-2c073130ac20/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index e60e8b6570..1c50a13f25 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "d4b595f3f4b4df37923fae5f0bc55c5f43224780" + "sha": "af599a865b988191bb45182063c5fd9403b50f4c" } }, { diff --git a/README.md b/README.md index 52a2ac6a43..ab0cb6943a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.137.1 + 1.137.2 ``` @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:1.137.2' +compile 'com.google.cloud:google-cloud-bigquery:2.0.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "1.137.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.0.0" ``` ## Authentication From 92ff3932e5ae93623851a2db9d941316b4ecc3ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 Aug 2021 22:44:11 +0200 Subject: [PATCH 0294/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2 (#1483) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0beba8eb11..a2cb4693c6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.2.0 + 2.0.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4fbc5e7f3f..0b3aad383e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.2.0 + 2.0.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1d7f01ba8e..268b25d232 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 1.2.0 + 2.0.0 test From 6caf046d7504b0c21c15993152e4ae38c15f5edf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 Aug 2021 22:54:51 +0200 Subject: [PATCH 0295/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2 (#1482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `1.137.2` -> `2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.0.0/compatibility-slim/1.137.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.0.0/confidence-slim/1.137.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.0.0`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgoogleapisjava-bigquerycomparev11372v200-2021-08-05) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v1.137.2...v2.0.0) ##### ⚠ BREAKING CHANGES - update dependency com.google.cloud:google-cloud-shared-config to v1 ([#​1466](https://togithub.com/googleapis/java-bigquery/issues/1466)) ##### Features - update dependency com.google.cloud:google-cloud-shared-config to v1 ([#​1466](https://www.github.com/googleapis/java-bigquery/issues/1466)) ([3db013e](https://www.github.com/googleapis/java-bigquery/commit/3db013eeb01f255e1bc40af21370241761f2b519)) ##### [1.137.2](https://www.github.com/googleapis/java-bigquery/compare/v1.137.1...v1.137.2) (2021-08-05) ##### Dependencies - update dependency com.google.apis:google-api-services-bigquery to v2-rev20210726-1.32.1 ([#​1469](https://www.github.com/googleapis/java-bigquery/issues/1469)) ([9df5ac2](https://www.github.com/googleapis/java-bigquery/commit/9df5ac2525e3aa9b52512d59cab0fc8b998f0bc9)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#​1472](https://www.github.com/googleapis/java-bigquery/issues/1472)) ([227983e](https://www.github.com/googleapis/java-bigquery/commit/227983e2c69dfdd5001f9c951f086daadb937578)) ##### [1.137.1](https://www.github.com/googleapis/java-bigquery/compare/v1.137.0...v1.137.1) (2021-07-20) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigtable to v1.27.3 ([#​1452](https://www.github.com/googleapis/java-bigquery/issues/1452)) ([fea5eca](https://www.github.com/googleapis/java-bigquery/commit/fea5eca733d501b72b8713e555f54dc86bbde85f))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a2cb4693c6..dbc3fb4a35 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 1.137.2 + 2.0.0 From 8304924c4c66186aba27402ae32931cbb20fba8e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 5 Aug 2021 14:08:33 -0700 Subject: [PATCH 0296/2268] chore: regenerate README (#1485) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-05 20:57:10,116 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-05 20:57:11,580 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/b0c41e37-9ebf-4dc3-8c47-d274948c81f0/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 1c50a13f25..0b4019b5d1 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "af599a865b988191bb45182063c5fd9403b50f4c" + "sha": "6caf046d7504b0c21c15993152e4ae38c15f5edf" } }, { diff --git a/README.md b/README.md index ab0cb6943a..ed0e0760ba 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 1.137.2 + 2.0.0 ``` From 3ba6e1f8548b5518076187a65b214c79195d86ac Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 Aug 2021 17:50:51 +0200 Subject: [PATCH 0297/2268] deps: update dependency com.google.cloud:google-cloud-storage to v1.118.1 (#1486) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0966f147aa..97057d564a 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 1.118.0 + 1.118.1 test From 3eedfbe208897c6ee45b480ff81a90a4dba9bdd4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 Aug 2021 17:51:11 +0200 Subject: [PATCH 0298/2268] deps: update jmh.version to v1.33 (#1487) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2b33cddef7..1e535ba161 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.32 + 1.33 benchmark From 212c3840e17a87d6d5e08bd255beead1102984af Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 16:06:11 +0000 Subject: [PATCH 0299/2268] chore: release 2.0.1 (#1488) :robot: I have created a release \*beep\* \*boop\* --- ### [2.0.1](https://www.github.com/googleapis/java-bigquery/compare/v2.0.0...v2.0.1) (2021-08-09) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v1.118.1 ([#1486](https://www.github.com/googleapis/java-bigquery/issues/1486)) ([3ba6e1f](https://www.github.com/googleapis/java-bigquery/commit/3ba6e1f8548b5518076187a65b214c79195d86ac)) * update jmh.version to v1.33 ([#1487](https://www.github.com/googleapis/java-bigquery/issues/1487)) ([3eedfbe](https://www.github.com/googleapis/java-bigquery/commit/3eedfbe208897c6ee45b480ff81a90a4dba9bdd4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b94c054ac8..aafed6ea19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.0.1](https://www.github.com/googleapis/java-bigquery/compare/v2.0.0...v2.0.1) (2021-08-09) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v1.118.1 ([#1486](https://www.github.com/googleapis/java-bigquery/issues/1486)) ([3ba6e1f](https://www.github.com/googleapis/java-bigquery/commit/3ba6e1f8548b5518076187a65b214c79195d86ac)) +* update jmh.version to v1.33 ([#1487](https://www.github.com/googleapis/java-bigquery/issues/1487)) ([3eedfbe](https://www.github.com/googleapis/java-bigquery/commit/3eedfbe208897c6ee45b480ff81a90a4dba9bdd4)) + ## [2.0.0](https://www.github.com/googleapis/java-bigquery/compare/v1.137.2...v2.0.0) (2021-08-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1e535ba161..2f4b233b30 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.0.1-SNAPSHOT + 2.0.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 48c5d92aad..65393ac76d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.0.1-SNAPSHOT + 2.0.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.0.1-SNAPSHOT + 2.0.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 97057d564a..295a080f67 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.0.1-SNAPSHOT + 2.0.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.0.1-SNAPSHOT + 2.0.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0b3aad383e..8a97443c55 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.0.1-SNAPSHOT + 2.0.1 diff --git a/versions.txt b/versions.txt index d896d74df6..ec70c33852 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.0.0:2.0.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.0.1:2.0.1 \ No newline at end of file From a91cb7a5a340a73bec5e0495bcb0ceaa84f915ab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 9 Aug 2021 16:18:16 +0000 Subject: [PATCH 0300/2268] chore: release 2.0.2-SNAPSHOT (#1489) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2f4b233b30..b78221c11d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.0.1 + 2.0.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 65393ac76d..376ef0799f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.0.1 + 2.0.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.0.1 + 2.0.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 295a080f67..dc34b2edd3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.0.1 + 2.0.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.0.1 + 2.0.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8a97443c55..5751d63555 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.0.1 + 2.0.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ec70c33852..6552160d5c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.0.1:2.0.1 \ No newline at end of file +google-cloud-bigquery:2.0.1:2.0.2-SNAPSHOT \ No newline at end of file From c8e77fa8c16db8fb08f5ccb5b373e5b9efc6e120 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 Aug 2021 23:04:31 +0200 Subject: [PATCH 0301/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.0.1 (#1490) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index dbc3fb4a35..91f952521b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.0.0 + 2.0.1 From 70abb812b3ebfa47d70dccd936a65c10f35b4817 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 Aug 2021 23:04:53 +0200 Subject: [PATCH 0302/2268] test(deps): update datacatalog dependencies to v1.5.0 (#1492) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dc34b2edd3..9ce232f605 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.4.2 + 1.5.0 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.4.2 + 1.5.0 test From cdb6acbd1272fd27aefc5bd9edb3fefcdb64f987 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 9 Aug 2021 14:20:15 -0700 Subject: [PATCH 0303/2268] chore: regenerate README (#1493) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-09 21:06:37,198 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-09 21:06:38,548 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/9683894a-a2f7-4f09-ae80-aaee0855a778/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 0b4019b5d1..fc4efc8265 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "6caf046d7504b0c21c15993152e4ae38c15f5edf" + "sha": "70abb812b3ebfa47d70dccd936a65c10f35b4817" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "df7fc1e3a6df4316920ab221431945cdf9aa7217" + "sha": "5605f38f153e7627ba4441a2c5181060b664d224" } } ] diff --git a/README.md b/README.md index ed0e0760ba..2d1d958eec 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.0.0 + 2.0.1 ``` @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.0.0' +compile 'com.google.cloud:google-cloud-bigquery:2.0.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.0.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.0.1" ``` ## Authentication From 7c66e284e31875fcdd9575cfe145124a3454e29c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 10 Aug 2021 01:02:55 +0200 Subject: [PATCH 0304/2268] test(deps): update datacatalog dependencies to v1.5.1 (#1494) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9ce232f605..4fa0082f73 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.0 + 1.5.1 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.0 + 1.5.1 test From cf265347e5e650670d19a1122f69497272854ebe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 10 Aug 2021 19:38:58 +0200 Subject: [PATCH 0305/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2 (#1495) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 91f952521b..4f0e9cb6b9 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 1.27.3 + 2.0.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5751d63555..e5dd163cd2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 1.27.3 + 2.0.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 268b25d232..435ce8995c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 1.27.3 + 2.0.0 test From b705052475899512c7981d3893b7d630f1488c99 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 10 Aug 2021 19:40:10 +0200 Subject: [PATCH 0306/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2 (#1491) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fa0082f73..9a1efe733d 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 1.118.1 + 2.0.0 test From ec68c1145a89753e7d42458bbea86737cad6090f Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Wed, 11 Aug 2021 21:38:08 +0530 Subject: [PATCH 0307/2268] feat: Updated `BigQueryRetryAlgorithm` so that it can retry on RateLimit Errors using RegEx (#1499) * Modified RATE_LIMIT_ERROR_MSG and added testRateLimitRegEx for testing regex matching * Added JOB_RATE_LIMIT_EXCEEDED_MSG and RATE_LIMIT_EXCEEDED_REGEX pattern * Implemented retryOnRegEx to include retry on RegEx patterns * Updated DEFAULT_RETRY_CONFIG to include retry on JOB_RATE_LIMIT_EXCEEDED_MSG and RATE_LIMIT_EXCEEDED_REGEX * Modified shouldRetryBasedOnBigQueryRetryConfig method to try RegEx matching if all the contains checks fail --- .../cloud/bigquery/BigQueryErrorMessages.java | 5 +++ .../google/cloud/bigquery/BigQueryImpl.java | 4 ++- .../bigquery/BigQueryRetryAlgorithm.java | 21 ++++++++++++- .../cloud/bigquery/BigQueryRetryConfig.java | 14 +++++++++ .../cloud/bigquery/BigQueryImplTest.java | 31 ++++++++++++++++--- 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java index 04cabfc67e..5c86e08060 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryErrorMessages.java @@ -19,4 +19,9 @@ public class BigQueryErrorMessages { public static final String RATE_LIMIT_EXCEEDED_MSG = "Exceeded rate limits:"; // Error Message for RateLimitExceeded Error + public static final String JOB_RATE_LIMIT_EXCEEDED_MSG = "Job exceeded rate limits:"; + + public class RetryRegExPatterns { + public static final String RATE_LIMIT_EXCEEDED_REGEX = ".*exceed.*rate.*limit.*"; + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index c871eb551e..03635a89ed 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -240,7 +240,9 @@ public Page getNextPage() { private static final BigQueryRetryConfig DEFAULT_RETRY_CONFIG = BigQueryRetryConfig.newBuilder() .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) - .build(); // retry config with Error Message for RateLimitExceeded Error + .retryOnMessage(BigQueryErrorMessages.JOB_RATE_LIMIT_EXCEEDED_MSG) + .retryOnRegEx(BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX) + .build(); // retry config with Error Messages and RegEx for RateLimitExceeded Error BigQueryImpl(BigQueryOptions options) { super(options); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index 1a75a9c08b..c694e2c06c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -27,6 +27,7 @@ import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; import java.util.Iterator; import java.util.concurrent.CancellationException; +import java.util.regex.Pattern; public class BigQueryRetryAlgorithm extends RetryAlgorithm { private final BigQueryRetryConfig bigQueryRetryConfig; @@ -69,10 +70,23 @@ private boolean shouldRetryBasedOnBigQueryRetryConfig( */ String errorDesc; if (previousThrowable != null && (errorDesc = previousThrowable.getMessage()) != null) { + errorDesc = errorDesc.toLowerCase(); // for case insensitive comparison for (Iterator retriableMessages = bigQueryRetryConfig.getRetriableErrorMessages().iterator(); retriableMessages.hasNext(); ) { - if (errorDesc.contains(retriableMessages.next())) { // Error message should be retried + if (errorDesc.contains( + retriableMessages + .next() + .toLowerCase())) { // Error message should be retried, implementing cases + // insensitive match + return true; + } + } + // Check if there's a regex which matches the error message. This avoids too many regex + // matches which is expensive + for (Iterator retriableRegExes = bigQueryRetryConfig.getRetriableRegExes().iterator(); + retriableRegExes.hasNext(); ) { + if (matchRegEx(retriableRegExes.next(), errorDesc)) { return true; } } @@ -80,6 +94,11 @@ private boolean shouldRetryBasedOnBigQueryRetryConfig( return false; } + public static boolean matchRegEx( + String retriableRegEx, String errorDesc) { // cases insensitive match regex matching + return Pattern.matches(retriableRegEx.toLowerCase(), errorDesc.toLowerCase()); + } + /*Duplicating this method as it can not be inherited from the RetryAlgorithm due to the default access modifier*/ boolean shouldRetryBasedOnResult( RetryingContext context, Throwable previousThrowable, ResponseT previousResponse) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java index 7e28e57073..2e1f7c0bda 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryConfig.java @@ -21,18 +21,25 @@ public class BigQueryRetryConfig { private final ImmutableSet retriableErrorMessages; + private final ImmutableSet retriableRegExes; private BigQueryRetryConfig(Builder builder) { retriableErrorMessages = builder.retriableErrorMessages.build(); + retriableRegExes = builder.retriableRegExes.build(); } public ImmutableSet getRetriableErrorMessages() { return retriableErrorMessages; } + public ImmutableSet getRetriableRegExes() { + return retriableRegExes; + } + // BigQueryRetryConfig builder public static class Builder { private final ImmutableSet.Builder retriableErrorMessages = ImmutableSet.builder(); + private final ImmutableSet.Builder retriableRegExes = ImmutableSet.builder(); private Builder() {} @@ -43,6 +50,13 @@ public final Builder retryOnMessage(String... errorMessages) { return this; } + public final Builder retryOnRegEx(String... regExPatterns) { + for (String regExPattern : regExPatterns) { + retriableRegExes.add(checkNotNull(regExPattern)); + } + return this; + } + public BigQueryRetryConfig build() { return new BigQueryRetryConfig(this); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 654cc02668..a12800c879 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -508,11 +508,12 @@ public class BigQueryImplTest { .setEtag(ETAG) .setVersion(1) .build(); - private BigQueryOptions options; private BigQueryRpcFactory rpcFactoryMock; private BigQueryRpc bigqueryRpcMock; private BigQuery bigquery; + private static final String RATE_LIMIT_ERROR_MSG = + "Job exceeded rate limits: Your table exceeded quota for table update operations. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas"; @Captor private ArgumentCaptor> capturedOptions; @Captor private ArgumentCaptor jobCapture; @@ -2439,9 +2440,7 @@ public void testFastQueryRateLimitIdempotency() throws Exception { .thenThrow(new BigQueryException(504, "Gateway Timeout")) .thenThrow( new BigQueryException( - 400, - BigQueryErrorMessages - .RATE_LIMIT_EXCEEDED_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG + 400, RATE_LIMIT_ERROR_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG .thenReturn(responsePb); bigquery = @@ -2470,6 +2469,30 @@ public void testFastQueryRateLimitIdempotency() throws Exception { verify(bigqueryRpcMock, times(6)).queryRpc(eq(PROJECT), requestPbCapture.capture()); } + @Test + public void testRateLimitRegEx() throws Exception { + String msg2 = + "Job eceeded rate limits: Your table exceeded quota for table update operations. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas"; + String msg3 = "exceeded rate exceeded quota for table update"; + String msg4 = "exceeded rate limits"; + assertTrue( + BigQueryRetryAlgorithm.matchRegEx( + BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX, + RATE_LIMIT_ERROR_MSG)); + assertFalse( + BigQueryRetryAlgorithm.matchRegEx( + BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX, + msg2.toLowerCase())); + assertFalse( + BigQueryRetryAlgorithm.matchRegEx( + BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX, + msg3.toLowerCase())); + assertTrue( + BigQueryRetryAlgorithm.matchRegEx( + BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX, + msg4.toLowerCase())); + } + @Test public void testFastQueryDDLShouldRetry() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = From 4c3b2de16584b9079dd4afd5a33aa8c00bc75f20 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 11 Aug 2021 12:20:36 -0400 Subject: [PATCH 0308/2268] feat: add support for transactioninfo in query statistics (#1497) Fixes #1467 --- .../google/cloud/bigquery/JobStatistics.java | 92 ++++++++++++++++++- .../cloud/bigquery/JobStatisticsTest.java | 16 ++++ .../cloud/bigquery/it/ITBigQueryTest.java | 22 +++++ 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index ea5555b9bf..a3d04c0179 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -44,6 +44,7 @@ public abstract class JobStatistics implements Serializable { private final String parentJobId; private final ScriptStatistics scriptStatistics; private final List reservationUsage; + private final TransactionInfo transactionInfo; /** A Google BigQuery Copy Job statistics. */ public static class CopyStatistics extends JobStatistics { @@ -1178,6 +1179,78 @@ static ReservationUsage fromPb( } } + // TransactionInfo contains information about a multi-statement transaction that may have + // associated with a job. + public static class TransactionInfo { + + // TransactionID is the system-generated identifier for the transaction. + private final String transactionId; + + public static class Builder { + + private String transactionId; + + private Builder() {}; + + Builder setTransactionId(String transactionId) { + this.transactionId = transactionId; + return this; + } + + TransactionInfo build() { + return new TransactionInfo(this); + } + } + + private TransactionInfo(Builder builder) { + this.transactionId = builder.transactionId; + } + + public String getTransactionId() { + return transactionId; + } + + static Builder newbuilder() { + return new Builder(); + } + + ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("transactionId", transactionId); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(TransactionInfo.class) + && Objects.equals(toPb(), ((TransactionInfo) obj).toPb()); + } + + @Override + public int hashCode() { + return Objects.hash(transactionId); + } + + com.google.api.services.bigquery.model.TransactionInfo toPb() { + com.google.api.services.bigquery.model.TransactionInfo transactionInfo = + new com.google.api.services.bigquery.model.TransactionInfo(); + transactionInfo.setTransactionId(transactionId); + return transactionInfo; + } + + static TransactionInfo fromPb( + com.google.api.services.bigquery.model.TransactionInfo transactionInfo) { + Builder builder = newbuilder(); + builder.setTransactionId(transactionInfo.getTransactionId()); + return builder.build(); + } + } + abstract static class Builder> { private Long creationTime; @@ -1187,6 +1260,7 @@ abstract static class Builder> private String parentJobId; private ScriptStatistics scriptStatistics; private List reservationUsage; + private TransactionInfo transactionInfo; protected Builder() {} @@ -1203,6 +1277,9 @@ protected Builder(com.google.api.services.bigquery.model.JobStatistics statistic this.reservationUsage = Lists.transform(statisticsPb.getReservationUsage(), ReservationUsage.FROM_PB_FUNCTION); } + if (statisticsPb.getTransactionInfo() != null) { + this.transactionInfo = TransactionInfo.fromPb(statisticsPb.getTransactionInfo()); + } } @SuppressWarnings("unchecked") @@ -1236,6 +1313,7 @@ protected JobStatistics(Builder builder) { this.parentJobId = builder.parentJobId; this.scriptStatistics = builder.scriptStatistics; this.reservationUsage = builder.reservationUsage; + this.transactionInfo = builder.transactionInfo; } /** Returns the creation time of the job in milliseconds since epoch. */ @@ -1279,6 +1357,11 @@ public List getReservationUsage() { return reservationUsage; } + /** Info indicates the transaction ID associated with the job, if any. */ + public TransactionInfo getTransactionInfo() { + return transactionInfo; + } + ToStringHelper toStringHelper() { return MoreObjects.toStringHelper(this) .add("creationTime", creationTime) @@ -1287,7 +1370,8 @@ ToStringHelper toStringHelper() { .add("numChildJobs", numChildJobs) .add("parentJobId", parentJobId) .add("scriptStatistics", scriptStatistics) - .add("reservationUsage", reservationUsage); + .add("reservationUsage", reservationUsage) + .add("transactionInfo", transactionInfo); } @Override @@ -1303,7 +1387,8 @@ final int baseHashCode() { numChildJobs, parentJobId, scriptStatistics, - reservationUsage); + reservationUsage, + transactionInfo); } final boolean baseEquals(JobStatistics jobStatistics) { @@ -1325,6 +1410,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { statistics.setReservationUsage( Lists.transform(reservationUsage, ReservationUsage.TO_PB_FUNCTION)); } + if (transactionInfo != null) { + statistics.setTransactionInfo(transactionInfo.toPb()); + } return statistics; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index edd76f821d..c421c0370f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -26,9 +26,11 @@ import com.google.cloud.bigquery.JobStatistics.ReservationUsage; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics.ScriptStackFrame; +import com.google.cloud.bigquery.JobStatistics.TransactionInfo; import com.google.cloud.bigquery.QueryStage.QueryStep; import com.google.common.collect.ImmutableList; import java.util.List; +import java.util.UUID; import org.junit.Test; public class JobStatisticsTest { @@ -70,6 +72,7 @@ public class JobStatisticsTest { private static final Long START_TIME = 15L; private static final String NAME = "reservation-name"; private static final Long SLOTMS = 12545L; + private static final String TRANSACTION_ID = UUID.randomUUID().toString().substring(0, 8); private static final CopyStatistics COPY_STATISTICS = CopyStatistics.newBuilder() .setCreationTimestamp(CREATION_TIME) @@ -216,6 +219,9 @@ public class JobStatisticsTest { private static final ReservationUsage RESERVATION_USAGE = ReservationUsage.newBuilder().setName(NAME).setSlotMs(SLOTMS).build(); + private static final TransactionInfo TRANSACTION_INFO = + TransactionInfo.newbuilder().setTransactionId(TRANSACTION_ID).build(); + @Test public void testBuilder() { assertEquals(CREATION_TIME, EXTRACT_STATISTICS.getCreationTime()); @@ -286,6 +292,7 @@ public void testBuilder() { ImmutableList.of(EXPRESSION_STACK_FRAME), EXPRESSION_SCRIPT_STATISTICS.getStackFrames()); assertEquals(NAME, RESERVATION_USAGE.getName()); assertEquals(SLOTMS, RESERVATION_USAGE.getSlotMs()); + assertEquals(TRANSACTION_ID, TRANSACTION_INFO.getTransactionId()); } @Test @@ -311,6 +318,7 @@ public void testToPbAndFromPb() { compareStackFrames(stackFrame, ScriptStackFrame.fromPb(stackFrame.toPb())); } compareReservation(RESERVATION_USAGE, ReservationUsage.fromPb(RESERVATION_USAGE.toPb())); + compareTransactionInfo(TRANSACTION_INFO, TransactionInfo.fromPb(TRANSACTION_INFO.toPb())); } @Test @@ -425,4 +433,12 @@ private void compareReservation(ReservationUsage expected, ReservationUsage valu assertEquals(expected.getName(), value.getName()); assertEquals(expected.getSlotMs(), value.getSlotMs()); } + + private void compareTransactionInfo(TransactionInfo expected, TransactionInfo value) { + assertEquals(expected, value); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + assertEquals(expected.toPb(), value.toPb()); + assertEquals(expected.getTransactionId(), value.getTransactionId()); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ff4068940a..484e4c0f55 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -71,6 +71,7 @@ import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; import com.google.cloud.bigquery.JobStatistics.LoadStatistics; +import com.google.cloud.bigquery.JobStatistics.TransactionInfo; import com.google.cloud.bigquery.LegacySQLTypeName; import com.google.cloud.bigquery.LoadJobConfiguration; import com.google.cloud.bigquery.MaterializedViewDefinition; @@ -2219,6 +2220,27 @@ public void testDmlStatistics() throws InterruptedException { assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); } + @Test + public void testTransactionInfo() throws InterruptedException { + String tableName = TABLE_ID_FASTQUERY.getTable(); + String transaction = + String.format( + "BEGIN TRANSACTION;\n" + + " UPDATE %s.%s SET StringField = 'hello' WHERE TRUE;\n" + + " COMMIT TRANSACTION;\n", + DATASET, tableName); + QueryJobConfiguration config = QueryJobConfiguration.of(transaction); + Job remoteJob = bigquery.create(JobInfo.of(config)); + JobInfo parentJobInfo = remoteJob.waitFor(); + String parentJobId = parentJobInfo.getJobId().getJob(); + Page childJobs = bigquery.listJobs(JobListOption.parentJobId(parentJobId)); + for (Job job : childJobs.iterateAll()) { + // only those child jobs inside the transaction would have transactionInfo populated + TransactionInfo transactionInfo = job.getStatistics().getTransactionInfo(); + assertNotNull(transactionInfo.getTransactionId()); + } + } + @Test public void testScriptStatistics() throws InterruptedException { String script = From 32d10f6a50cf5db7db6542b884c8eca6a0e0ee05 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:45:50 -0400 Subject: [PATCH 0309/2268] chore: release 2.1.0 (#1496) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafed6ea19..6fb188d1a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.1.0](https://www.github.com/googleapis/java-bigquery/compare/v2.0.1...v2.1.0) (2021-08-11) + + +### Features + +* add support for transactioninfo in query statistics ([#1497](https://www.github.com/googleapis/java-bigquery/issues/1497)) ([4c3b2de](https://www.github.com/googleapis/java-bigquery/commit/4c3b2de16584b9079dd4afd5a33aa8c00bc75f20)), closes [#1467](https://www.github.com/googleapis/java-bigquery/issues/1467) +* Updated `BigQueryRetryAlgorithm` so that it can retry on RateLimit Errors using RegEx ([#1499](https://www.github.com/googleapis/java-bigquery/issues/1499)) ([ec68c11](https://www.github.com/googleapis/java-bigquery/commit/ec68c1145a89753e7d42458bbea86737cad6090f)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2 ([#1495](https://www.github.com/googleapis/java-bigquery/issues/1495)) ([cf26534](https://www.github.com/googleapis/java-bigquery/commit/cf265347e5e650670d19a1122f69497272854ebe)) +* update dependency com.google.cloud:google-cloud-storage to v2 ([#1491](https://www.github.com/googleapis/java-bigquery/issues/1491)) ([b705052](https://www.github.com/googleapis/java-bigquery/commit/b705052475899512c7981d3893b7d630f1488c99)) + ### [2.0.1](https://www.github.com/googleapis/java-bigquery/compare/v2.0.0...v2.0.1) (2021-08-09) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b78221c11d..e8355baa93 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.0.2-SNAPSHOT + 2.1.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 376ef0799f..3982e6aa27 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.0.2-SNAPSHOT + 2.1.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.0.2-SNAPSHOT + 2.1.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9a1efe733d..d39727b0d2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.0.2-SNAPSHOT + 2.1.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.0.2-SNAPSHOT + 2.1.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e5dd163cd2..f2b6ec823f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.0.2-SNAPSHOT + 2.1.0 diff --git a/versions.txt b/versions.txt index 6552160d5c..f16b3e50d7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.0.1:2.0.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.0:2.1.0 \ No newline at end of file From 7fc2fb848ecc6eca46fc2996bf0f301f0d08722b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 17:04:13 +0000 Subject: [PATCH 0310/2268] chore: release 2.1.1-SNAPSHOT (#1500) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e8355baa93..a49d916ab0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.0 + 2.1.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3982e6aa27..41b0aa7b2a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.0 + 2.1.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.0 + 2.1.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d39727b0d2..c8ce82db0c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.0 + 2.1.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.0 + 2.1.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f2b6ec823f..c796193fe2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.0 + 2.1.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index f16b3e50d7..ac2ee1e32e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.0:2.1.0 \ No newline at end of file +google-cloud-bigquery:2.1.0:2.1.1-SNAPSHOT \ No newline at end of file From 855faeb5c220ae951735fc340242f187be35dc6f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 12 Aug 2021 15:25:51 -0700 Subject: [PATCH 0311/2268] build(java): use ENABLE_FLAKYBOT env variable (#1501) Kokoro job config now supports both environment variables during this migration period. Source-Author: Jeff Ching Source-Date: Thu Aug 12 10:10:27 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: ff01716e16d2c6e87eaf87197b753ac9fcbbed5d Source-Link: https://github.com/googleapis/synthtool/commit/ff01716e16d2c6e87eaf87197b753ac9fcbbed5d --- .kokoro/build.sh | 2 +- .kokoro/nightly/integration.cfg | 2 +- synth.metadata | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 1a024be85f..2d4c91705b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -115,7 +115,7 @@ fi # fix output location of logs bash .kokoro/coerce_logs.sh -if [[ "${ENABLE_BUILD_COP}" == "true" ]] +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] then chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-bigquery diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 0048c8ece7..e51c7b4c6c 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -22,7 +22,7 @@ env_vars: { } env_vars: { - key: "ENABLE_BUILD_COP" + key: "ENABLE_FLAKYBOT" value: "true" } diff --git a/synth.metadata b/synth.metadata index 04f29b61f9..2e644ef323 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "0a8eac2b679cf3e330e7325452a09f99e352a380" + "sha": "7fc2fb848ecc6eca46fc2996bf0f301f0d08722b" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a2878d6909dd10ca4e3c1b5943d6622e996054e" + "sha": "ff01716e16d2c6e87eaf87197b753ac9fcbbed5d" } } ], From da6b6072673583577374c8c84d23311165a00059 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 12 Aug 2021 15:42:33 -0700 Subject: [PATCH 0312/2268] chore: regenerate README (#1502) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-12 22:28:59,302 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-12 22:29:00,947 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/b6043864-4086-4be6-aae5-78530bd566d0/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index fc4efc8265..09fe510f4b 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "70abb812b3ebfa47d70dccd936a65c10f35b4817" + "sha": "855faeb5c220ae951735fc340242f187be35dc6f" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5605f38f153e7627ba4441a2c5181060b664d224" + "sha": "ff01716e16d2c6e87eaf87197b753ac9fcbbed5d" } } ] diff --git a/README.md b/README.md index 2d1d958eec..c1fa789fc3 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.0.1' +compile 'com.google.cloud:google-cloud-bigquery:2.1.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.0.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.0" ``` ## Authentication From 3f6f6ef4d67b2ef01dac7f5aa2ed2eea862157e8 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 12 Aug 2021 18:56:18 -0400 Subject: [PATCH 0313/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 (#1503) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8ce82db0c..106404972b 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210726-1.32.1 - 2.0.0 + 2.0.1
From c5add380333ac5d1b6f425a4ecb20cd12ca2b869 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 17:18:29 +0000 Subject: [PATCH 0314/2268] chore: release 2.1.1 (#1504) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.1](https://www.github.com/googleapis/java-bigquery/compare/v2.1.0...v2.1.1) (2021-08-12) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#1503](https://www.github.com/googleapis/java-bigquery/issues/1503)) ([3f6f6ef](https://www.github.com/googleapis/java-bigquery/commit/3f6f6ef4d67b2ef01dac7f5aa2ed2eea862157e8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb188d1a4..31e196137a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.1.1](https://www.github.com/googleapis/java-bigquery/compare/v2.1.0...v2.1.1) (2021-08-12) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#1503](https://www.github.com/googleapis/java-bigquery/issues/1503)) ([3f6f6ef](https://www.github.com/googleapis/java-bigquery/commit/3f6f6ef4d67b2ef01dac7f5aa2ed2eea862157e8)) + ## [2.1.0](https://www.github.com/googleapis/java-bigquery/compare/v2.0.1...v2.1.0) (2021-08-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a49d916ab0..249c05c649 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.1-SNAPSHOT + 2.1.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 41b0aa7b2a..d718614985 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.1-SNAPSHOT + 2.1.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.1-SNAPSHOT + 2.1.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 106404972b..90af563823 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.1-SNAPSHOT + 2.1.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.1-SNAPSHOT + 2.1.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c796193fe2..4a3212e4e1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.1-SNAPSHOT + 2.1.1 diff --git a/versions.txt b/versions.txt index ac2ee1e32e..c181a3c200 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.0:2.1.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.1:2.1.1 \ No newline at end of file From 8e21a1246ed1c183632679c8ff3a0ce78cb89353 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 17:30:29 +0000 Subject: [PATCH 0315/2268] chore: release 2.1.2-SNAPSHOT (#1505) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 249c05c649..818f2b2d08 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.1 + 2.1.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d718614985..ef5e46c4e7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.1 + 2.1.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.1 + 2.1.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 90af563823..8104c467e5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.1 + 2.1.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.1 + 2.1.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4a3212e4e1..d34a53ecc8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.1 + 2.1.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index c181a3c200..fa6249f3ef 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.1:2.1.1 \ No newline at end of file +google-cloud-bigquery:2.1.1:2.1.2-SNAPSHOT \ No newline at end of file From f5982794fb5f9c13c3e328efcb8ab852682b4466 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 17 Aug 2021 16:06:51 -0400 Subject: [PATCH 0316/2268] fix: add retry logging for BigQueryRetryAlgorithm.java (#1506) * fix: add retry logging for BigQueryRetryAlgorithm.java * Added shouldRetry and Error Message to Logging * Added shouldRetry and Error Message to Logging * update based on comments - to add in retried method (enclosingMethod) * set log level to FINEST Co-authored-by: Prashant Mishra --- .../bigquery/BigQueryRetryAlgorithm.java | 32 +++++++++++++++++-- .../cloud/bigquery/BigQueryRetryHelper.java | 23 ++++++++++++- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index c694e2c06c..756377d210 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -27,7 +27,10 @@ import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; import java.util.Iterator; import java.util.concurrent.CancellationException; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.regex.Pattern; +import org.threeten.bp.Duration; public class BigQueryRetryAlgorithm extends RetryAlgorithm { private final BigQueryRetryConfig bigQueryRetryConfig; @@ -36,6 +39,8 @@ public class BigQueryRetryAlgorithm extends RetryAlgorithm private final ResultRetryAlgorithmWithContext resultAlgorithmWithContext; private final TimedRetryAlgorithmWithContext timedAlgorithmWithContext; + private static final Logger LOG = Logger.getLogger(BigQueryRetryAlgorithm.class.getName()); + public BigQueryRetryAlgorithm( ResultRetryAlgorithm resultAlgorithm, TimedRetryAlgorithm timedAlgorithm, @@ -55,11 +60,32 @@ public boolean shouldRetry( ResponseT previousResponse, TimedAttemptSettings nextAttemptSettings) throws CancellationException { + // Log retry info + int attemptCount = nextAttemptSettings == null ? 0 : nextAttemptSettings.getAttemptCount(); + Duration retryDelay = + nextAttemptSettings == null ? Duration.ZERO : nextAttemptSettings.getRetryDelay(); + String errorMessage = previousThrowable != null ? previousThrowable.getMessage() : ""; + // Implementing shouldRetryBasedOnBigQueryRetryConfig so that we can retry exceptions based on // the exception messages - return (shouldRetryBasedOnResult(context, previousThrowable, previousResponse) - || shouldRetryBasedOnBigQueryRetryConfig(previousThrowable, bigQueryRetryConfig)) - && shouldRetryBasedOnTiming(context, nextAttemptSettings); + boolean shouldRetry = + (shouldRetryBasedOnResult(context, previousThrowable, previousResponse) + || shouldRetryBasedOnBigQueryRetryConfig(previousThrowable, bigQueryRetryConfig)) + && shouldRetryBasedOnTiming(context, nextAttemptSettings); + + if (LOG.isLoggable(Level.FINEST)) { + LOG.log( + Level.FINEST, + "Retrying with:\n{0}\n{1}\n{2}\n{3}\n{4}", + new Object[] { + "BigQuery attemptCount: " + attemptCount, + "BigQuery delay: " + retryDelay, + "BigQuery retriableException: " + previousThrowable, + "BigQuery shouldRetry: " + shouldRetry, + "BigQuery previousThrowable.getMessage: " + errorMessage + }); + } + return shouldRetry; } private boolean shouldRetryBasedOnBigQueryRetryConfig( diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java index 7c1e0e5927..623228d6c6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java @@ -16,13 +16,24 @@ package com.google.cloud.bigquery; import com.google.api.core.ApiClock; -import com.google.api.gax.retrying.*; +import com.google.api.gax.retrying.DirectRetryingExecutor; +import com.google.api.gax.retrying.ExponentialRetryAlgorithm; +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingExecutor; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.cloud.RetryHelper; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; +import java.util.logging.Level; +import java.util.logging.Logger; public class BigQueryRetryHelper extends RetryHelper { + private static final Logger LOG = Logger.getLogger(BigQueryRetryHelper.class.getName()); + public static V runWithRetries( Callable callable, RetrySettings retrySettings, @@ -60,6 +71,16 @@ private static V run( // BigQueryRetryAlgorithm retries considering bigQueryRetryConfig RetryingExecutor executor = new DirectRetryingExecutor<>(retryAlgorithm); + // Log retry info + if (LOG.isLoggable(Level.FINEST)) { + LOG.log( + Level.FINEST, + "Retrying with:\n{0}", + new Object[] { + "BigQuery retried method: " + callable.getClass().getEnclosingMethod().getName(), + }); + } + RetryingFuture retryingFuture = executor.createFuture(callable); executor.submit(retryingFuture); return retryingFuture.get(); From 2c63e88bc000e58423d7bf96e29a8ec7fa954460 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 17 Aug 2021 13:20:37 -0700 Subject: [PATCH 0317/2268] chore: regenerate README (#1508) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-17 20:09:04,584 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-17 20:09:06,091 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/2a0139d3-2c62-45ee-af03-60c5b21067b9/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 09fe510f4b..84d90c7870 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "855faeb5c220ae951735fc340242f187be35dc6f" + "sha": "f5982794fb5f9c13c3e328efcb8ab852682b4466" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ff01716e16d2c6e87eaf87197b753ac9fcbbed5d" + "sha": "a01e1a0bf70754f51450958b966bd673945d1e6e" } } ] diff --git a/README.md b/README.md index c1fa789fc3..52f051dc31 100644 --- a/README.md +++ b/README.md @@ -51,20 +51,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:20.9.0') +implementation platform('com.google.cloud:libraries-bom:21.0.0') compile 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.1.0' +compile 'com.google.cloud:google-cloud-bigquery:2.1.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.1" ``` ## Authentication From 6d47b66722af4ea8be3921b68f117d38c07d00e9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 20:24:37 +0000 Subject: [PATCH 0318/2268] chore: release 2.1.2 (#1507) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.2](https://www.github.com/googleapis/java-bigquery/compare/v2.1.1...v2.1.2) (2021-08-17) ### Bug Fixes * add retry logging for BigQueryRetryAlgorithm.java ([#1506](https://www.github.com/googleapis/java-bigquery/issues/1506)) ([f598279](https://www.github.com/googleapis/java-bigquery/commit/f5982794fb5f9c13c3e328efcb8ab852682b4466)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e196137a..8a6214f54f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.1.2](https://www.github.com/googleapis/java-bigquery/compare/v2.1.1...v2.1.2) (2021-08-17) + + +### Bug Fixes + +* add retry logging for BigQueryRetryAlgorithm.java ([#1506](https://www.github.com/googleapis/java-bigquery/issues/1506)) ([f598279](https://www.github.com/googleapis/java-bigquery/commit/f5982794fb5f9c13c3e328efcb8ab852682b4466)) + ### [2.1.1](https://www.github.com/googleapis/java-bigquery/compare/v2.1.0...v2.1.1) (2021-08-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 818f2b2d08..3542e62248 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.2-SNAPSHOT + 2.1.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ef5e46c4e7..5aca148b47 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.2-SNAPSHOT + 2.1.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.2-SNAPSHOT + 2.1.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8104c467e5..b808250d8c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.2-SNAPSHOT + 2.1.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.2-SNAPSHOT + 2.1.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d34a53ecc8..c00d9b986f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.2-SNAPSHOT + 2.1.2 diff --git a/versions.txt b/versions.txt index fa6249f3ef..0b0f25a904 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.1:2.1.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.2:2.1.2 \ No newline at end of file From 8c0e6c20c6e56d66f2f00da55fc67f74091e9ae3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 20:38:37 +0000 Subject: [PATCH 0319/2268] chore: release 2.1.3-SNAPSHOT (#1509) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3542e62248..03a5bfdcaf 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.2 + 2.1.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5aca148b47..f21ce8fe78 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.2 + 2.1.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.2 + 2.1.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b808250d8c..ca2bfa7f68 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.2 + 2.1.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.2 + 2.1.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c00d9b986f..56a1fe621d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.2 + 2.1.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0b0f25a904..1cd0baaf17 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.2:2.1.2 \ No newline at end of file +google-cloud-bigquery:2.1.2:2.1.3-SNAPSHOT \ No newline at end of file From e1713f2cf04349cd0336cd3aca7ca2870bfa96d4 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 24 Aug 2021 12:40:08 -0400 Subject: [PATCH 0320/2268] ci: removing linkage-monitor from the required checks (#1513) Linkage Monitor is no longer needed, because the Libraries BOM synchronizes with Google Cloud BOM and the shared dependencies BOM https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/2137 --- .github/sync-repo-settings.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 60fc43347a..ab4807cbe0 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -10,7 +10,6 @@ branchProtectionRules: requiredStatusCheckContexts: - dependencies (8) - dependencies (11) - - linkage-monitor - lint - clirr - units (8) @@ -25,7 +24,6 @@ branchProtectionRules: requiredStatusCheckContexts: - dependencies (8) - dependencies (11) - - linkage-monitor - lint - clirr - units (7) @@ -41,7 +39,6 @@ branchProtectionRules: requiredStatusCheckContexts: - dependencies (8) - dependencies (11) - - linkage-monitor - lint - clirr - units (7) From 0dde21c66d3e4eecf44faefc78428ec40726e013 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 24 Aug 2021 09:56:10 -0700 Subject: [PATCH 0321/2268] chore: regenerate README (#1514) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-24 16:42:22,732 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-24 16:42:24,160 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/a7cf7262-7e16-4d7a-99fe-24a1f05aad4f/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 84d90c7870..592fcf91a7 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "f5982794fb5f9c13c3e328efcb8ab852682b4466" + "sha": "e1713f2cf04349cd0336cd3aca7ca2870bfa96d4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a01e1a0bf70754f51450958b966bd673945d1e6e" + "sha": "8032ab5a32471d85ece8fc261df16cc40fbfa4fb" } } ] diff --git a/README.md b/README.md index 52f051dc31..e46d895daf 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.1.1' +compile 'com.google.cloud:google-cloud-bigquery:2.1.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.2" ``` ## Authentication From 2fc3bcc4f6a708b3a7eb8811c6dc87cb1c84633d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:28:03 +0200 Subject: [PATCH 0322/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v21 (#1528) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 435ce8995c..53421b8c1b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 20.9.0 + 21.0.0 pom import From 5709319c3959b3a504aab57e80ec693b3c27d0c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:28:27 +0200 Subject: [PATCH 0323/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.0.1 (#1518) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ca2bfa7f68..9e3423c178 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.0 + 1.0.1 From 75aef641f48bec0ae549385146432725e7a6c58c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:28:54 +0200 Subject: [PATCH 0324/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.0.2 (#1519) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4f0e9cb6b9..17b45ac733 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.0 + 2.0.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 56a1fe621d..bdf77a6414 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.0 + 2.0.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 53421b8c1b..f5a1979350 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.0 + 2.0.2 test From da09e53bbdd18693c182d7945506b0531bb445e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:29:13 +0200 Subject: [PATCH 0325/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210813-1.32.1 (#1520) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9e3423c178..7447ec91bd 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210726-1.32.1 + v2-rev20210813-1.32.1 2.0.1
From 6be4f2473ecf1b710e7142da27616b374b3cca12 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:30:44 +0200 Subject: [PATCH 0326/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.0.2 (#1522) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.0.0` -> `2.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.0.2/compatibility-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.0.2/confidence-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.0.2`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​202-httpswwwgithubcomgoogleapisjava-storagecomparev201v202-2021-08-19) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.0.1...v2.0.2) ### [`v2.0.1`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​201-httpswwwgithubcomgoogleapisjava-storagecomparev200v201-2021-08-11) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.0.0...v2.0.1) ##### Features - generate storage v2 gapic client ([#​960](https://www.togithub.com/googleapis/java-storage/issues/960)) ([fb2f9d4](https://www.github.com/googleapis/java-storage/commit/fb2f9d489e42b57f61642ce9e0c1a65fe91c9c45)) ##### Bug Fixes - incorrectly labeled span list(String,Map) ([#​946](https://www.togithub.com/googleapis/java-storage/issues/946)) ([0c1fdcf](https://www.github.com/googleapis/java-storage/commit/0c1fdcfe89609b10c148f0dc6026084d2f49b1b7)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#​961](https://www.togithub.com/googleapis/java-storage/issues/961)) ([69543dc](https://www.github.com/googleapis/java-storage/commit/69543dcba2fce1028e5fac25a59e1defe6465f06))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7447ec91bd..f36e84d5a0 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.0.0 + 2.0.2 test From a36fc45329b9a73aa6ee1316b2d348276f30d25c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:31:42 +0200 Subject: [PATCH 0327/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.32.1 (#1527) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 17b45ac733..b494cd00b3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.5 + 1.32.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bdf77a6414..d531a798e0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.5 + 1.32.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f5a1979350..a345c06285 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.31.5 + 1.32.1 From c31f18b6dc9e02adcf72dc8ae8526d4ab766797c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:32:06 +0200 Subject: [PATCH 0328/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.32.1 (#1526) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b494cd00b3..56bf5acea3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.5 + 1.32.1 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d531a798e0..a79a4bba3d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.5 + 1.32.1 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a345c06285..166866e31b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.31.5 + 1.32.1 com.google.oauth-client From 11da456eb42f8b86d4ec64d192cd580f9e219aeb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:32:43 +0200 Subject: [PATCH 0329/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.0.1 (#1521) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.0.0` -> `2.0.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.0.1/compatibility-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.0.1/confidence-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v2.0.1`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​201-httpswwwgithubcomgoogleapisjava-bigtablecomparev200v201-2021-08-11) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.0.0...v2.0.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 56bf5acea3..664def9a02 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.0.0 + 2.0.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a79a4bba3d..9a77f881a8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.0.0 + 2.0.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 166866e31b..82875f9d7a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.0.0 + 2.0.1 test From 0d180694c95e1101d91a6cc4eb8aaddf27494192 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:32:47 +0200 Subject: [PATCH 0330/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.2 (#1524) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.0.1` -> `2.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.2/compatibility-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.2/confidence-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.1.2`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​212-httpswwwgithubcomgoogleapisjava-bigquerycomparev211v212-2021-08-17) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.1.1...v2.1.2) ### [`v2.1.1`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​211-httpswwwgithubcomgoogleapisjava-bigquerycomparev210v211-2021-08-12) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.1.0...v2.1.1) ### [`v2.1.0`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisjava-bigquerycomparev201v210-2021-08-11) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.0.1...v2.1.0) ##### Features - add support for transactioninfo in query statistics ([#​1497](https://www.togithub.com/googleapis/java-bigquery/issues/1497)) ([4c3b2de](https://www.github.com/googleapis/java-bigquery/commit/4c3b2de16584b9079dd4afd5a33aa8c00bc75f20)), closes [#​1467](https://www.togithub.com/googleapis/java-bigquery/issues/1467) - Updated `BigQueryRetryAlgorithm` so that it can retry on RateLimit Errors using RegEx ([#​1499](https://www.togithub.com/googleapis/java-bigquery/issues/1499)) ([ec68c11](https://www.github.com/googleapis/java-bigquery/commit/ec68c1145a89753e7d42458bbea86737cad6090f)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigtable to v2 ([#​1495](https://www.togithub.com/googleapis/java-bigquery/issues/1495)) ([cf26534](https://www.github.com/googleapis/java-bigquery/commit/cf265347e5e650670d19a1122f69497272854ebe)) - update dependency com.google.cloud:google-cloud-storage to v2 ([#​1491](https://www.togithub.com/googleapis/java-bigquery/issues/1491)) ([b705052](https://www.github.com/googleapis/java-bigquery/commit/b705052475899512c7981d3893b7d630f1488c99)) ##### [2.0.1](https://www.github.com/googleapis/java-bigquery/compare/v2.0.0...v2.0.1) (2021-08-09) ##### Dependencies - update dependency com.google.cloud:google-cloud-storage to v1.118.1 ([#​1486](https://www.togithub.com/googleapis/java-bigquery/issues/1486)) ([3ba6e1f](https://www.github.com/googleapis/java-bigquery/commit/3ba6e1f8548b5518076187a65b214c79195d86ac)) - update jmh.version to v1.33 ([#​1487](https://www.togithub.com/googleapis/java-bigquery/issues/1487)) ([3eedfbe](https://www.github.com/googleapis/java-bigquery/commit/3eedfbe208897c6ee45b480ff81a90a4dba9bdd4))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 664def9a02..7e63cd74ad 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.0.1 + 2.1.2 From a05491fdc3434013b37f80b32b04296df3813cd5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 24 Aug 2021 16:42:26 -0700 Subject: [PATCH 0331/2268] chore: regenerate README (#1530) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-24 23:30:16,489 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-24 23:30:17,732 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/a2bd1d2d-d8a7-46fd-ad1f-a2ff282ddbaf/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 592fcf91a7..c4f165f173 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "e1713f2cf04349cd0336cd3aca7ca2870bfa96d4" + "sha": "da09e53bbdd18693c182d7945506b0531bb445e4" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8032ab5a32471d85ece8fc261df16cc40fbfa4fb" + "sha": "63cff634aabb85854caa511c5837ea6b45f42b4b" } } ] diff --git a/README.md b/README.md index e46d895daf..45a977e136 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 20.9.0 + 21.0.0 pom import From cd7e46b6a7e78937a59c0a3aee0c81e51a342ce3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 01:44:42 +0200 Subject: [PATCH 0332/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 (#1525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.0.1` -> `2.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.1.0/compatibility-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.1.0/confidence-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v2.1.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare201v210-2021-08-23) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.0.1...v2.1.0) ##### Dependencies - update dependency com.google.auth:google-auth-library-bom to v1.1.0 ([#​439](https://www.togithub.com/googleapis/java-shared-dependencies/issues/439)) ([ca52bd9](https://www.github.com/googleapis/java-shared-dependencies/commit/ca52bd9c099c96bf7b5a57aa85d39b58a610c875)) - update dependency com.google.cloud:google-cloud-core-bom to v2.1.0 ([#​444](https://www.togithub.com/googleapis/java-shared-dependencies/issues/444)) ([ff914c6](https://www.github.com/googleapis/java-shared-dependencies/commit/ff914c6de9e3e7fa6ba75591d3d5077c5421827d)) - update dependency com.google.code.gson:gson to v2.8.8 ([#​442](https://www.togithub.com/googleapis/java-shared-dependencies/issues/442)) ([79a093f](https://www.github.com/googleapis/java-shared-dependencies/commit/79a093f9ccea4d47cf8b678570a1c9699029a8b2)) - update dependency com.google.errorprone:error_prone_annotations to v2.9.0 ([#​441](https://www.togithub.com/googleapis/java-shared-dependencies/issues/441)) ([e644a4b](https://www.github.com/googleapis/java-shared-dependencies/commit/e644a4b504ab8aa5771f9be36861d1730ea9bcc9)) - update dependency io.grpc:grpc-bom to v1.40.0 ([#​438](https://www.togithub.com/googleapis/java-shared-dependencies/issues/438)) ([c3f8fb4](https://www.github.com/googleapis/java-shared-dependencies/commit/c3f8fb4408f5dc6c7f7dc0e14f0c24fa755433a5)) - update gax.version to v2.3.0 ([#​437](https://www.togithub.com/googleapis/java-shared-dependencies/issues/437)) ([e59aaad](https://www.github.com/googleapis/java-shared-dependencies/commit/e59aaadd76e40ab5ea31c3e812686a4ba0471a49)) ##### [2.0.1](https://www.github.com/googleapis/java-shared-dependencies/compare/2.0.0...v2.0.1) (2021-08-11) ##### Dependencies - update dependency com.google.api:api-common to v2.0.1 ([#​431](https://www.togithub.com/googleapis/java-shared-dependencies/issues/431)) ([b1a52c8](https://www.github.com/googleapis/java-shared-dependencies/commit/b1a52c83e19be7be80086f2010e928171b046f62)) - update gax.version to v2.1.0 ([#​432](https://www.togithub.com/googleapis/java-shared-dependencies/issues/432)) ([7f53006](https://www.github.com/googleapis/java-shared-dependencies/commit/7f53006d021e839f52325a87d7c4715eff88818d)) - update google.core.version to v2.0.4 ([#​430](https://www.togithub.com/googleapis/java-shared-dependencies/issues/430)) ([d0465ad](https://www.github.com/googleapis/java-shared-dependencies/commit/d0465ad3a79993d4e854078ea992e53ab9add07f)) - update google.core.version to v2.0.5 ([#​434](https://www.togithub.com/googleapis/java-shared-dependencies/issues/434)) ([af00753](https://www.github.com/googleapis/java-shared-dependencies/commit/af0075390034cba5cefede8260ab03f728d525a8))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f36e84d5a0..1cb9b98ea9 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210813-1.32.1 - 2.0.1 + 2.1.0
From a5044fce36802d2503a14633780aab33ee5e3ed6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 24 Aug 2021 16:56:45 -0700 Subject: [PATCH 0333/2268] chore: regenerate README (#1531) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-24 23:44:46,090 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-24 23:44:47,238 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/fe5c2df8-e14c-4d63-b55e-42777a4d506d/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index c4f165f173..f1684c2165 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "da09e53bbdd18693c182d7945506b0531bb445e4" + "sha": "cd7e46b6a7e78937a59c0a3aee0c81e51a342ce3" } }, { diff --git a/README.md b/README.md index 45a977e136..778fb15548 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.0.1 + 2.1.2 ``` From 0d4c6c9f307c96654c603253a76619125bb29563 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Aug 2021 23:58:29 +0000 Subject: [PATCH 0334/2268] chore: release 2.1.3 (#1529) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.3](https://www.github.com/googleapis/java-bigquery/compare/v2.1.2...v2.1.3) (2021-08-24) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210813-1.32.1 ([#1520](https://www.github.com/googleapis/java-bigquery/issues/1520)) ([da09e53](https://www.github.com/googleapis/java-bigquery/commit/da09e53bbdd18693c182d7945506b0531bb445e4)) * update dependency com.google.cloud:google-cloud-bigtable to v2.0.1 ([#1521](https://www.github.com/googleapis/java-bigquery/issues/1521)) ([11da456](https://www.github.com/googleapis/java-bigquery/commit/11da456eb42f8b86d4ec64d192cd580f9e219aeb)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#1525](https://www.github.com/googleapis/java-bigquery/issues/1525)) ([cd7e46b](https://www.github.com/googleapis/java-bigquery/commit/cd7e46b6a7e78937a59c0a3aee0c81e51a342ce3)) * update dependency com.google.cloud:google-cloud-storage to v2.0.2 ([#1522](https://www.github.com/googleapis/java-bigquery/issues/1522)) ([6be4f24](https://www.github.com/googleapis/java-bigquery/commit/6be4f2473ecf1b710e7142da27616b374b3cca12)) * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.32.1 ([#1526](https://www.github.com/googleapis/java-bigquery/issues/1526)) ([c31f18b](https://www.github.com/googleapis/java-bigquery/commit/c31f18b6dc9e02adcf72dc8ae8526d4ab766797c)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.32.1 ([#1527](https://www.github.com/googleapis/java-bigquery/issues/1527)) ([a36fc45](https://www.github.com/googleapis/java-bigquery/commit/a36fc45329b9a73aa6ee1316b2d348276f30d25c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6214f54f..769ccadb5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [2.1.3](https://www.github.com/googleapis/java-bigquery/compare/v2.1.2...v2.1.3) (2021-08-24) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210813-1.32.1 ([#1520](https://www.github.com/googleapis/java-bigquery/issues/1520)) ([da09e53](https://www.github.com/googleapis/java-bigquery/commit/da09e53bbdd18693c182d7945506b0531bb445e4)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.0.1 ([#1521](https://www.github.com/googleapis/java-bigquery/issues/1521)) ([11da456](https://www.github.com/googleapis/java-bigquery/commit/11da456eb42f8b86d4ec64d192cd580f9e219aeb)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#1525](https://www.github.com/googleapis/java-bigquery/issues/1525)) ([cd7e46b](https://www.github.com/googleapis/java-bigquery/commit/cd7e46b6a7e78937a59c0a3aee0c81e51a342ce3)) +* update dependency com.google.cloud:google-cloud-storage to v2.0.2 ([#1522](https://www.github.com/googleapis/java-bigquery/issues/1522)) ([6be4f24](https://www.github.com/googleapis/java-bigquery/commit/6be4f2473ecf1b710e7142da27616b374b3cca12)) +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.32.1 ([#1526](https://www.github.com/googleapis/java-bigquery/issues/1526)) ([c31f18b](https://www.github.com/googleapis/java-bigquery/commit/c31f18b6dc9e02adcf72dc8ae8526d4ab766797c)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.32.1 ([#1527](https://www.github.com/googleapis/java-bigquery/issues/1527)) ([a36fc45](https://www.github.com/googleapis/java-bigquery/commit/a36fc45329b9a73aa6ee1316b2d348276f30d25c)) + ### [2.1.2](https://www.github.com/googleapis/java-bigquery/compare/v2.1.1...v2.1.2) (2021-08-17) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 03a5bfdcaf..fbc32e0d70 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.3-SNAPSHOT + 2.1.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f21ce8fe78..2f38cd6d10 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.3-SNAPSHOT + 2.1.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.3-SNAPSHOT + 2.1.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1cb9b98ea9..10a662c382 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.3-SNAPSHOT + 2.1.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.3-SNAPSHOT + 2.1.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9a77f881a8..e5dce8a6dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.3-SNAPSHOT + 2.1.3 diff --git a/versions.txt b/versions.txt index 1cd0baaf17..20ee2efe7c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.2:2.1.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.3:2.1.3 \ No newline at end of file From 45728a699b4076f606f44eb56ae3de90ae91742e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 00:10:43 +0000 Subject: [PATCH 0335/2268] chore: release 2.1.4-SNAPSHOT (#1532) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index fbc32e0d70..fc85dfb314 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.3 + 2.1.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2f38cd6d10..715ca51f3e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.3 + 2.1.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.3 + 2.1.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 10a662c382..9e6c9ce737 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.3 + 2.1.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.3 + 2.1.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e5dce8a6dd..b18a4a915b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.3 + 2.1.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 20ee2efe7c..146c6ea400 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.3:2.1.3 \ No newline at end of file +google-cloud-bigquery:2.1.3:2.1.4-SNAPSHOT \ No newline at end of file From 804221c521bae5e90e4e896cdcd2ea2144be8922 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 20:11:22 +0200 Subject: [PATCH 0336/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.3 (#1533) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7e63cd74ad..6353e7bd9d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.2 + 2.1.3 From 7884f5d4a281b37ea3ef61a03d3b6f94163d3486 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 21:30:50 +0200 Subject: [PATCH 0337/2268] test(deps): update datacatalog dependencies to v1.5.3 (#1523) * test(deps): update datacatalog dependencies to v1.5.3 * Update pom.xml Co-authored-by: Stephanie Wang --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9e6c9ce737..dc4a09e7b4 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.1 + 1.5.3 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.1 + 1.5.3 test From d998cf65c653eff3322547662b7e88b51ec21c15 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 Aug 2021 21:42:32 +0200 Subject: [PATCH 0338/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.0 (#1534) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.0.2` -> `2.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.0`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisjava-storagecomparev202v210-2021-08-24) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.0.2...v2.1.0) ##### Features - fix post policy escape bug, update conformance tests ([#​924](https://www.togithub.com/googleapis/java-storage/issues/924)) ([d8329c3](https://www.github.com/googleapis/java-storage/commit/d8329c34fe19fd8c6bba5579aa3c55490c1d4e6f)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#​976](https://www.togithub.com/googleapis/java-storage/issues/976)) ([5cac14d](https://www.github.com/googleapis/java-storage/commit/5cac14d7785ef3798c379d17cd44500958d9cc6a)) - update kms.version to v0.91.2 ([#​977](https://www.togithub.com/googleapis/java-storage/issues/977)) ([1c60e6e](https://www.github.com/googleapis/java-storage/commit/1c60e6e6a34f662478043989b5b0bddea32cc5bf)) ##### [2.0.2](https://www.github.com/googleapis/java-storage/compare/v2.0.1...v2.0.2) (2021-08-19) ##### Dependencies - update kms.version to v0.91.1 ([#​956](https://www.togithub.com/googleapis/java-storage/issues/956)) ([53d24e9](https://www.github.com/googleapis/java-storage/commit/53d24e9d3e27c0319fa3b6837c926484b1bd56a4))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc4a09e7b4..3b52002580 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.0.2 + 2.1.0 test From 96fc84456f81e5cd978dcb5be9f3b6e8edbeceb5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Aug 2021 12:52:15 -0700 Subject: [PATCH 0339/2268] chore: regenerate README (#1537) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-25 18:13:40,951 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-25 18:13:42,093 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/64346b6e-7f7e-4a04-89d6-3745bb818f90/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index f1684c2165..9578b90823 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "cd7e46b6a7e78937a59c0a3aee0c81e51a342ce3" + "sha": "804221c521bae5e90e4e896cdcd2ea2144be8922" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "63cff634aabb85854caa511c5837ea6b45f42b4b" + "sha": "e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22" } } ] diff --git a/README.md b/README.md index 778fb15548..94fba87f49 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.2 + 2.1.3 ``` @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.1.2' +compile 'com.google.cloud:google-cloud-bigquery:2.1.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.3" ``` ## Authentication From 0fc6199f470b6214ee75f35afa8b6cc480e1da80 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 19:56:27 +0000 Subject: [PATCH 0340/2268] chore: release 2.1.4 (#1538) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.4](https://www.github.com/googleapis/java-bigquery/compare/v2.1.3...v2.1.4) (2021-08-25) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.1.0 ([#1534](https://www.github.com/googleapis/java-bigquery/issues/1534)) ([d998cf6](https://www.github.com/googleapis/java-bigquery/commit/d998cf65c653eff3322547662b7e88b51ec21c15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 769ccadb5b..658f54fd48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.1.4](https://www.github.com/googleapis/java-bigquery/compare/v2.1.3...v2.1.4) (2021-08-25) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.1.0 ([#1534](https://www.github.com/googleapis/java-bigquery/issues/1534)) ([d998cf6](https://www.github.com/googleapis/java-bigquery/commit/d998cf65c653eff3322547662b7e88b51ec21c15)) + ### [2.1.3](https://www.github.com/googleapis/java-bigquery/compare/v2.1.2...v2.1.3) (2021-08-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index fc85dfb314..310470e571 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.4-SNAPSHOT + 2.1.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 715ca51f3e..f78ebf03cd 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.4-SNAPSHOT + 2.1.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.4-SNAPSHOT + 2.1.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3b52002580..53b39f1852 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.4-SNAPSHOT + 2.1.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.4-SNAPSHOT + 2.1.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b18a4a915b..596908eeb4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.4-SNAPSHOT + 2.1.4 diff --git a/versions.txt b/versions.txt index 146c6ea400..64551abe5c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.3:2.1.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.4:2.1.4 \ No newline at end of file From 983fa87bbf235668e9920cbcdbd48640a12f0488 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Aug 2021 20:10:29 +0000 Subject: [PATCH 0341/2268] chore: release 2.1.5-SNAPSHOT (#1539) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 310470e571..f0d2bf80e1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.4 + 2.1.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f78ebf03cd..56d28e53bb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.4 + 2.1.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.4 + 2.1.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 53b39f1852..9707602e0b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.4 + 2.1.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.4 + 2.1.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 596908eeb4..c1dbd7f805 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.4 + 2.1.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index 64551abe5c..3526a2ba8b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.4:2.1.4 \ No newline at end of file +google-cloud-bigquery:2.1.4:2.1.5-SNAPSHOT \ No newline at end of file From 64ceb01cc928679bc5e306a349aafd24caa1424b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 26 Aug 2021 00:51:58 +0200 Subject: [PATCH 0342/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.4 (#1540) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6353e7bd9d..046d7ab5ab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.3 + 2.1.4 From cd855e24e540fa141825f00b629c966a1efe7cdd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Aug 2021 16:08:25 -0700 Subject: [PATCH 0343/2268] chore: regenerate README (#1541) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-25 22:54:07,936 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-25 22:54:09,128 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/8bce8f5c-585a-48ce-9c4d-a986e30cd8db/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 9578b90823..0603a23ae9 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "804221c521bae5e90e4e896cdcd2ea2144be8922" + "sha": "64ceb01cc928679bc5e306a349aafd24caa1424b" } }, { diff --git a/README.md b/README.md index 94fba87f49..d29575db5f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.3 + 2.1.4 ``` @@ -58,13 +58,13 @@ compile 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.1.3' +compile 'com.google.cloud:google-cloud-bigquery:2.1.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.4" ``` ## Authentication From 56e82d104be9d277c54afa2db6c91f4fc61b5382 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Aug 2021 16:30:10 -0700 Subject: [PATCH 0344/2268] chore: enable release-trigger bot (#1535) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9d9d6f88-75f1-4d18-994b-3ba385348050/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/63cff634aabb85854caa511c5837ea6b45f42b4b --- .github/release-trigger.yml | 1 + synth.metadata | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .github/release-trigger.yml diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000000..d4ca94189e --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/synth.metadata b/synth.metadata index 2e644ef323..b554797cc8 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "7fc2fb848ecc6eca46fc2996bf0f301f0d08722b" + "sha": "45728a699b4076f606f44eb56ae3de90ae91742e" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ff01716e16d2c6e87eaf87197b753ac9fcbbed5d" + "sha": "63cff634aabb85854caa511c5837ea6b45f42b4b" } } ], @@ -25,6 +25,7 @@ ".github/generated-files-bot.yml", ".github/readme/synth.py", ".github/release-please.yml", + ".github/release-trigger.yml", ".github/snippet-bot.yml", ".github/sync-repo-settings.yaml", ".github/trusted-contribution.yml", From 345481081b3ca78e43aebfbc5ad1033b52349beb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 26 Aug 2021 09:06:20 -0700 Subject: [PATCH 0345/2268] ci: removing linkage-monitor from the required checks (#1542) Source-Author: Tomo Suzuki Source-Date: Wed Aug 25 13:18:10 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22 Source-Link: https://github.com/googleapis/synthtool/commit/e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22 --- .github/workflows/ci.yaml | 13 ------------- synth.metadata | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65ae6ecdda..d510359d97 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,19 +42,6 @@ jobs: java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh - linkage-monitor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 8 - - run: java -version - - name: Install artifacts to local Maven repository - run: .kokoro/build.sh - shell: bash - - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) - uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/synth.metadata b/synth.metadata index b554797cc8..882974a4dc 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "45728a699b4076f606f44eb56ae3de90ae91742e" + "sha": "56e82d104be9d277c54afa2db6c91f4fc61b5382" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "63cff634aabb85854caa511c5837ea6b45f42b4b" + "sha": "e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22" } } ], From 336a861e2e0a80bfc43a96844219ec2d0493a967 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 27 Aug 2021 17:01:23 +0200 Subject: [PATCH 0346/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v22 (#1544) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 82875f9d7a..6b246da467 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 21.0.0 + 22.0.0 pom import From 0c501c8d42641316853e2cde995e70723596dc88 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 27 Aug 2021 08:18:24 -0700 Subject: [PATCH 0347/2268] chore: regenerate README (#1545) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-27 15:06:24,732 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-27 15:06:25,843 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/a41b5798-95ef-4460-8578-b04583195c43/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 0603a23ae9..b79f06c3c1 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "64ceb01cc928679bc5e306a349aafd24caa1424b" + "sha": "336a861e2e0a80bfc43a96844219ec2d0493a967" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22" + "sha": "31728d872f50e439ded2f67fa8d67955b26a4e35" } } ] diff --git a/README.md b/README.md index d29575db5f..ecf30d98a1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 21.0.0 + 22.0.0 pom import @@ -51,7 +51,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:21.0.0') +implementation platform('com.google.cloud:libraries-bom:22.0.0') compile 'com.google.cloud:google-cloud-bigquery' ``` From c00e6b663b983e6ec030323d9da6829416065be5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 29 Aug 2021 18:14:28 +0200 Subject: [PATCH 0348/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210819-1.32.1 (#1546) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9707602e0b..5ea37d362e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210813-1.32.1 + v2-rev20210819-1.32.1 2.1.0
From 246605fd16bc29565dea4657f7d9d5a22555ce3c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 29 Aug 2021 09:28:23 -0700 Subject: [PATCH 0349/2268] chore: regenerate README (#1548) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-08-29 16:16:46,823 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-08-29 16:16:48,027 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/ce17b2cb-d7f7-462d-8c2a-e609ff1a043f/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b79f06c3c1..7593bdf8de 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "336a861e2e0a80bfc43a96844219ec2d0493a967" + "sha": "c00e6b663b983e6ec030323d9da6829416065be5" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "31728d872f50e439ded2f67fa8d67955b26a4e35" + "sha": "e770c12f2a9a5f84566fe04b16a4ceec1c8c109b" } } ] diff --git a/README.md b/README.md index ecf30d98a1..571cee84bc 100644 --- a/README.md +++ b/README.md @@ -53,12 +53,12 @@ If you are using Gradle 5.x or later, add this to your dependencies ```Groovy implementation platform('com.google.cloud:libraries-bom:22.0.0') -compile 'com.google.cloud:google-cloud-bigquery' +implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-bigquery:2.1.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.1.4' ``` If you are using SBT, add this to your dependencies From 69889f08b830ea47de66410cc45e9be3248c8154 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 Aug 2021 22:44:41 +0200 Subject: [PATCH 0350/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 (#1549) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.1.0` -> `2.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.0/compatibility-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.0/confidence-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v2.2.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​220-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare210v220-2021-08-31) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.1.0...v2.2.0) ##### Dependencies - update dependency com.fasterxml.jackson:jackson-bom to v2.12.5 ([#​456](https://www.togithub.com/googleapis/java-shared-dependencies/issues/456)) ([05b58e8](https://www.github.com/googleapis/java-shared-dependencies/commit/05b58e84ff6617bdcbb1ea644aa6e061bdea0319)) - update dependency com.google.api:api-common to v2.0.2 ([#​450](https://www.togithub.com/googleapis/java-shared-dependencies/issues/450)) ([51caebe](https://www.github.com/googleapis/java-shared-dependencies/commit/51caebe89bfade98866f63952bf82bc663a0179a)) - update dependency com.google.http-client:google-http-client-bom to v1.40.0 ([#​455](https://www.togithub.com/googleapis/java-shared-dependencies/issues/455)) ([82a5e42](https://www.github.com/googleapis/java-shared-dependencies/commit/82a5e42b06570a2c7c9d53b03161b110a44487a1)) - update dependency com.google.oauth-client:google-oauth-client-bom to v1.32.1 ([#​447](https://www.togithub.com/googleapis/java-shared-dependencies/issues/447)) ([9d2b895](https://www.github.com/googleapis/java-shared-dependencies/commit/9d2b8958f62daa6a3015a8ac052762fb3d79b35b)) - update dependency io.grpc:grpc-bom to v1.40.1 ([#​451](https://www.togithub.com/googleapis/java-shared-dependencies/issues/451)) ([df668ea](https://www.github.com/googleapis/java-shared-dependencies/commit/df668ead8830a40acf9d5605d47f93c465b779c0)) - update gax.version to v2.4.0 ([#​458](https://www.togithub.com/googleapis/java-shared-dependencies/issues/458)) ([a797d9e](https://www.github.com/googleapis/java-shared-dependencies/commit/a797d9eb8a4bcb3025a9511eae61271278a4a5c9)) - update google.common-protos.version to v2.5.0 ([#​457](https://www.togithub.com/googleapis/java-shared-dependencies/issues/457)) ([38c7bb9](https://www.github.com/googleapis/java-shared-dependencies/commit/38c7bb925414d90ff3065650d06589f79bcab9b6)) - update google.core.version to v2.1.1 ([#​449](https://www.togithub.com/googleapis/java-shared-dependencies/issues/449)) ([b28723a](https://www.github.com/googleapis/java-shared-dependencies/commit/b28723ace0c27ebc73f23a2d094e0fe9ba8a9075)) - update google.core.version to v2.1.2 ([#​459](https://www.togithub.com/googleapis/java-shared-dependencies/issues/459)) ([df4d5b7](https://www.github.com/googleapis/java-shared-dependencies/commit/df4d5b7717386f5e0e2cca87bd9afc56b2c7aee8)) - update iam.version to v1.1.0 ([#​448](https://www.togithub.com/googleapis/java-shared-dependencies/issues/448)) ([3967928](https://www.github.com/googleapis/java-shared-dependencies/commit/39679287f3ef8c1cbca5dfc8aca3f69cfee3d4a6))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ea37d362e..f855ddf00a 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210819-1.32.1 - 2.1.0 + 2.2.0
From 1079fd1f8e259ac4b54270b9e32a5aa9007facb3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 20:56:31 +0000 Subject: [PATCH 0351/2268] chore: release 2.1.5 (#1547) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.5](https://www.github.com/googleapis/java-bigquery/compare/v2.1.4...v2.1.5) (2021-08-31) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210819-1.32.1 ([#1546](https://www.github.com/googleapis/java-bigquery/issues/1546)) ([c00e6b6](https://www.github.com/googleapis/java-bigquery/commit/c00e6b663b983e6ec030323d9da6829416065be5)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#1549](https://www.github.com/googleapis/java-bigquery/issues/1549)) ([69889f0](https://www.github.com/googleapis/java-bigquery/commit/69889f08b830ea47de66410cc45e9be3248c8154)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 658f54fd48..142e7013aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.1.5](https://www.github.com/googleapis/java-bigquery/compare/v2.1.4...v2.1.5) (2021-08-31) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210819-1.32.1 ([#1546](https://www.github.com/googleapis/java-bigquery/issues/1546)) ([c00e6b6](https://www.github.com/googleapis/java-bigquery/commit/c00e6b663b983e6ec030323d9da6829416065be5)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#1549](https://www.github.com/googleapis/java-bigquery/issues/1549)) ([69889f0](https://www.github.com/googleapis/java-bigquery/commit/69889f08b830ea47de66410cc45e9be3248c8154)) + ### [2.1.4](https://www.github.com/googleapis/java-bigquery/compare/v2.1.3...v2.1.4) (2021-08-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f0d2bf80e1..35f022972f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.5-SNAPSHOT + 2.1.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 56d28e53bb..4452c58b06 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.5-SNAPSHOT + 2.1.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.5-SNAPSHOT + 2.1.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f855ddf00a..f3dc4478ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.5-SNAPSHOT + 2.1.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.5-SNAPSHOT + 2.1.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c1dbd7f805..894477cfef 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.5-SNAPSHOT + 2.1.5 diff --git a/versions.txt b/versions.txt index 3526a2ba8b..7d5a47b0f9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.4:2.1.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.5:2.1.5 \ No newline at end of file From 772a61337ef6f4579429ceb842f85d0dfbdd331d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 Aug 2021 21:10:34 +0000 Subject: [PATCH 0352/2268] chore: release 2.1.6-SNAPSHOT (#1550) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 35f022972f..de8bef8ff7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.5 + 2.1.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4452c58b06..ddda13e03f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.5 + 2.1.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.5 + 2.1.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f3dc4478ce..8fd89f1040 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.5 + 2.1.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.5 + 2.1.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 894477cfef..751f11042c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.5 + 2.1.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index 7d5a47b0f9..050c8d78cb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.5:2.1.5 \ No newline at end of file +google-cloud-bigquery:2.1.5:2.1.6-SNAPSHOT \ No newline at end of file From a08300427ae74b8de14c64f195766dd7d9dcd66a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Sep 2021 02:12:42 +0200 Subject: [PATCH 0353/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.5 (#1551) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 046d7ab5ab..336853eeca 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.4 + 2.1.5 From 80568caa3f0d7e3960952356223c9446619632b1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Sep 2021 02:12:56 +0200 Subject: [PATCH 0354/2268] test(deps): update datacatalog dependencies to v1.5.4 (#1552) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8fd89f1040..eb90fea1fb 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.3 + 1.5.4 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.3 + 1.5.4 test From bac17666c1d8852e976ed2e3a81b9a73dae36c84 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 31 Aug 2021 17:26:44 -0700 Subject: [PATCH 0355/2268] chore: regenerate README (#1553) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-09-01 00:14:52,673 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-09-01 00:14:53,788 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/0162d0b5-cb69-4ccc-835d-75d1987508c0/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 7593bdf8de..c9965ffce1 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "c00e6b663b983e6ec030323d9da6829416065be5" + "sha": "80568caa3f0d7e3960952356223c9446619632b1" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e770c12f2a9a5f84566fe04b16a4ceec1c8c109b" + "sha": "9a238a0623879c3de129a376c6085d4a862f6eb9" } } ] diff --git a/README.md b/README.md index 571cee84bc..c4069b0580 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.4 + 2.1.5 ``` @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.1.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.1.5' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.5" ``` ## Authentication From 4ab08f5c175f6d09614da4c01959abbb1f2190d9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Sep 2021 23:25:48 +0200 Subject: [PATCH 0356/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.0 (#1555) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 336853eeca..141adffaab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.2 + 2.1.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 751f11042c..c1a153dc61 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.2 + 2.1.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6b246da467..8e7316e789 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.0.2 + 2.1.0 test From a88f662a1fc1c21f59e5847670dbb3f559e754f2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Sep 2021 19:18:46 +0200 Subject: [PATCH 0357/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.1.1 (#1554) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.0.1` -> `2.1.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.1/compatibility-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.1/confidence-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v2.1.1`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​211-httpswwwgithubcomgoogleapisjava-bigtablecomparev210v211-2021-09-01) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.1.0...v2.1.1) ### [`v2.1.0`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​210-httpswwwgithubcomgoogleapisjava-bigtablecomparev201v210-2021-08-25) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.0.1...v2.1.0) ##### Features - publish new fields to support cluster group routing ([#​958](https://www.togithub.com/googleapis/java-bigtable/issues/958)) ([09b31bd](https://www.github.com/googleapis/java-bigtable/commit/09b31bd9032dc36071cb8d32fc5cb6d4d85878e1)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#​962](https://www.togithub.com/googleapis/java-bigtable/issues/962)) ([a013e77](https://www.github.com/googleapis/java-bigtable/commit/a013e777af0fb2945099c178832fccd14b33398f)) ##### [2.0.1](https://www.github.com/googleapis/java-bigtable/compare/v2.0.0...v2.0.1) (2021-08-11) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#​948](https://www.togithub.com/googleapis/java-bigtable/issues/948)) ([31a7cb6](https://www.github.com/googleapis/java-bigtable/commit/31a7cb60321429497ca29f02119e7a2c1b0d614f))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 141adffaab..ea2108994a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.0.1 + 2.1.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c1a153dc61..e8f64fd702 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.0.1 + 2.1.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8e7316e789..ba58b1d262 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.0.1 + 2.1.1 test From 333c0f89ae36143b81ff24a78d3c23d5a49f8929 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:32:45 +0000 Subject: [PATCH 0358/2268] chore: release 2.1.6 (#1556) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.6](https://www.github.com/googleapis/java-bigquery/compare/v2.1.5...v2.1.6) (2021-09-02) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.1.1 ([#1554](https://www.github.com/googleapis/java-bigquery/issues/1554)) ([a88f662](https://www.github.com/googleapis/java-bigquery/commit/a88f662a1fc1c21f59e5847670dbb3f559e754f2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .github/workflows/ci.yaml | 12 ++++++++++++ CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d510359d97..12890848c6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,9 @@ jobs: java: [8, 11] steps: - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 - uses: actions/setup-java@v1 with: java-version: ${{matrix.java}} @@ -37,6 +40,9 @@ jobs: java: [8, 11] steps: - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 - uses: actions/setup-java@v1 with: java-version: ${{matrix.java}} @@ -46,6 +52,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 - uses: actions/setup-java@v1 with: java-version: 8 @@ -57,6 +66,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 - uses: actions/setup-java@v1 with: java-version: 8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 142e7013aa..ca0983fbf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.1.6](https://www.github.com/googleapis/java-bigquery/compare/v2.1.5...v2.1.6) (2021-09-02) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.1.1 ([#1554](https://www.github.com/googleapis/java-bigquery/issues/1554)) ([a88f662](https://www.github.com/googleapis/java-bigquery/commit/a88f662a1fc1c21f59e5847670dbb3f559e754f2)) + ### [2.1.5](https://www.github.com/googleapis/java-bigquery/compare/v2.1.4...v2.1.5) (2021-08-31) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index de8bef8ff7..a98b6873dc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.6-SNAPSHOT + 2.1.6 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ddda13e03f..ada24c2726 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.6-SNAPSHOT + 2.1.6 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.6-SNAPSHOT + 2.1.6 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index eb90fea1fb..f3c558ceb5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.6-SNAPSHOT + 2.1.6 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.6-SNAPSHOT + 2.1.6 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e8f64fd702..ed7ceed724 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.6-SNAPSHOT + 2.1.6 diff --git a/versions.txt b/versions.txt index 050c8d78cb..c924e4f1ab 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.5:2.1.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.6:2.1.6 \ No newline at end of file From 2234aa70902212965d2e2f006efdfc7cccb84132 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:46:46 +0000 Subject: [PATCH 0359/2268] chore: release 2.1.7-SNAPSHOT (#1557) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a98b6873dc..9e47dc2fcb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.6 + 2.1.7-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ada24c2726..54b53fb927 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.6 + 2.1.7-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.6 + 2.1.7-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f3c558ceb5..a38215a15f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.6 + 2.1.7-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.6 + 2.1.7-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ed7ceed724..df3f8542bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.6 + 2.1.7-SNAPSHOT diff --git a/versions.txt b/versions.txt index c924e4f1ab..e23a818f90 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.6:2.1.6 \ No newline at end of file +google-cloud-bigquery:2.1.6:2.1.7-SNAPSHOT \ No newline at end of file From 2d68bd2233b54cce8abdbf569dd3d3890e0fefdc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Sep 2021 00:37:59 +0200 Subject: [PATCH 0360/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.6 (#1560) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ea2108994a..b332ef8cb3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.5 + 2.1.6 From c0dc007d47719f0ed43d21ba8af4d75f054e74d1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Sep 2021 15:52:11 -0700 Subject: [PATCH 0361/2268] chore: regenerate README (#1562) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-09-02 22:40:49,599 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-09-02 22:40:50,773 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/36e511db-b6c6-4f0d-aa9f-8269f3080bf7/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index c9965ffce1..b490214d18 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "80568caa3f0d7e3960952356223c9446619632b1" + "sha": "2d68bd2233b54cce8abdbf569dd3d3890e0fefdc" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9a238a0623879c3de129a376c6085d4a862f6eb9" + "sha": "ad7fd76e17bf9494a3e47ff9cf445f61564432e0" } } ] diff --git a/README.md b/README.md index c4069b0580..68e878c795 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.5 + 2.1.6 ``` @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.1.5' +implementation 'com.google.cloud:google-cloud-bigquery:2.1.6' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.6" ``` ## Authentication From addfae7442f9cda0d9ed9f243a532b18f2be8138 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 3 Sep 2021 09:17:40 -0700 Subject: [PATCH 0362/2268] chore(java): install maven 3.8.1 at runtime (#1564) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(java): install maven 3.8.1 at runtime * chore: pin github action runner at ubuntu-16.04 * chore: install maven 3.8.1 at runtime * chore: fix typo Source-Author: Neenu Shaji Source-Date: Thu Sep 2 15:46:06 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: ad7fd76e17bf9494a3e47ff9cf445f61564432e0 Source-Link: https://github.com/googleapis/synthtool/commit/ad7fd76e17bf9494a3e47ff9cf445f61564432e0 --- .github/workflows/ci.yaml | 2 +- synth.metadata | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 12890848c6..e23d923e1e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,4 +75,4 @@ jobs: - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr + JOB_TYPE: clirr \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index 882974a4dc..5fe0d4e937 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "56e82d104be9d277c54afa2db6c91f4fc61b5382" + "sha": "c0dc007d47719f0ed43d21ba8af4d75f054e74d1" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e2aa5bcc3356d9e3b8b53de3b5c86226447d3a22" + "sha": "ad7fd76e17bf9494a3e47ff9cf445f61564432e0" } } ], From cd6b3e2c663e626fd3769813fd50f66a0a3231df Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 4 Sep 2021 20:08:15 +0200 Subject: [PATCH 0363/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210828-1.32.1 (#1561) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a38215a15f..de92133bed 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210819-1.32.1 + v2-rev20210828-1.32.1 2.2.0
From b0e5d7ade8a82680cb02050586b758b83b80632e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Sep 2021 01:16:29 +0200 Subject: [PATCH 0364/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.1 (#1565) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de92133bed..4199165e08 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.0 + 2.1.1 test From bbe2c39d3ec78eb18aadbd3edd691d8151fa0dda Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 7 Sep 2021 15:02:56 -0700 Subject: [PATCH 0365/2268] chore(java): update windows build (#1569) to install maven 3.8.1 at runtime too (related to #1202) Tested in [java-bigquerystorage](https://github.com/googleapis/java-bigquerystorage/pull/1291/commits/7834f4ff86858f6ed0b8068ea66dadf6365e399a) Source-Author: Stephanie Wang Source-Date: Tue Sep 7 13:04:27 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 17ee6e5c08f2eb47029beee4776ce990e56b3925 Source-Link: https://github.com/googleapis/synthtool/commit/17ee6e5c08f2eb47029beee4776ce990e56b3925 --- .github/workflows/ci.yaml | 5 ++++- synth.metadata | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e23d923e1e..3becb5c022 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 - uses: actions/setup-java@v1 with: java-version: 8 @@ -75,4 +78,4 @@ jobs: - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr \ No newline at end of file + JOB_TYPE: clirr diff --git a/synth.metadata b/synth.metadata index 5fe0d4e937..9a1a30bf15 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "c0dc007d47719f0ed43d21ba8af4d75f054e74d1" + "sha": "b0e5d7ade8a82680cb02050586b758b83b80632e" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ad7fd76e17bf9494a3e47ff9cf445f61564432e0" + "sha": "17ee6e5c08f2eb47029beee4776ce990e56b3925" } } ], From 24b103591660c14584b96e32cde10c135b68d7a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Sep 2021 00:03:19 +0200 Subject: [PATCH 0366/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.3.1 (#1567) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4199165e08..f39d9922c7 100644 --- a/pom.xml +++ b/pom.xml @@ -175,7 +175,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.0 + 3.3.1 html From dc6e2f8191488bcaee21bd6c0b71ee5730ed103e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Sep 2021 00:03:32 +0200 Subject: [PATCH 0367/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v23 (#1568) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ba58b1d262..3f626991e8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 22.0.0 + 23.0.0 pom import From 01695f965d8ccd84ae9bc45982958edbf1214664 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:18:10 +0000 Subject: [PATCH 0368/2268] chore: release 2.1.7 (#1566) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.7](https://www.github.com/googleapis/java-bigquery/compare/v2.1.6...v2.1.7) (2021-09-07) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210828-1.32.1 ([#1561](https://www.github.com/googleapis/java-bigquery/issues/1561)) ([cd6b3e2](https://www.github.com/googleapis/java-bigquery/commit/cd6b3e2c663e626fd3769813fd50f66a0a3231df)) * update dependency com.google.cloud:google-cloud-storage to v2.1.1 ([#1565](https://www.github.com/googleapis/java-bigquery/issues/1565)) ([b0e5d7a](https://www.github.com/googleapis/java-bigquery/commit/b0e5d7ade8a82680cb02050586b758b83b80632e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca0983fbf8..88a1ca6308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.1.7](https://www.github.com/googleapis/java-bigquery/compare/v2.1.6...v2.1.7) (2021-09-07) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210828-1.32.1 ([#1561](https://www.github.com/googleapis/java-bigquery/issues/1561)) ([cd6b3e2](https://www.github.com/googleapis/java-bigquery/commit/cd6b3e2c663e626fd3769813fd50f66a0a3231df)) +* update dependency com.google.cloud:google-cloud-storage to v2.1.1 ([#1565](https://www.github.com/googleapis/java-bigquery/issues/1565)) ([b0e5d7a](https://www.github.com/googleapis/java-bigquery/commit/b0e5d7ade8a82680cb02050586b758b83b80632e)) + ### [2.1.6](https://www.github.com/googleapis/java-bigquery/compare/v2.1.5...v2.1.6) (2021-09-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9e47dc2fcb..723b09d5ad 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.7-SNAPSHOT + 2.1.7 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 54b53fb927..45e6dfa520 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.7-SNAPSHOT + 2.1.7 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.7-SNAPSHOT + 2.1.7 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f39d9922c7..3cc8cbb0ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.7-SNAPSHOT + 2.1.7 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.7-SNAPSHOT + 2.1.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index df3f8542bc..a15a8be07d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.7-SNAPSHOT + 2.1.7 diff --git a/versions.txt b/versions.txt index e23a818f90..ebc51c321f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.6:2.1.7-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.7:2.1.7 \ No newline at end of file From b5fa76ac4477e1835ae35c5e9c2a6902ad0949c5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 7 Sep 2021 15:18:25 -0700 Subject: [PATCH 0369/2268] chore: regenerate README (#1570) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-09-07 22:05:59,057 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-09-07 22:06:00,497 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/82f7f839-4cd7-4baf-962c-14403510f99d/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index b490214d18..99c8325460 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "2d68bd2233b54cce8abdbf569dd3d3890e0fefdc" + "sha": "dc6e2f8191488bcaee21bd6c0b71ee5730ed103e" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ad7fd76e17bf9494a3e47ff9cf445f61564432e0" + "sha": "17ee6e5c08f2eb47029beee4776ce990e56b3925" } } ] diff --git a/README.md b/README.md index 68e878c795..99626b3ca6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 22.0.0 + 23.0.0 pom import @@ -51,7 +51,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:22.0.0') +implementation platform('com.google.cloud:libraries-bom:23.0.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From 42c6f634b2d8002cd48890afbe6862c998308c94 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:34:33 +0000 Subject: [PATCH 0370/2268] chore: release 2.1.8-SNAPSHOT (#1571) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 723b09d5ad..abf5a72c3c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 45e6dfa520..e8dda9df74 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.7 + 2.1.8-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.7 + 2.1.8-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3cc8cbb0ee..2ade3c4cf5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.7 + 2.1.8-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a15a8be07d..9c094621ea 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.7 + 2.1.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index ebc51c321f..1a9b1813a9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.7:2.1.7 \ No newline at end of file +google-cloud-bigquery:2.1.7:2.1.8-SNAPSHOT \ No newline at end of file From fc25036de8fe4cc99dffe5d307baebc6d1b88117 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Sep 2021 15:58:26 +0200 Subject: [PATCH 0371/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.7 (#1572) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b332ef8cb3..a4e1751333 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.6 + 2.1.7 From 466c2953a38071d47abaa25e4a5b7470e6c38f8e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 8 Sep 2021 07:12:27 -0700 Subject: [PATCH 0372/2268] chore: regenerate README (#1573) This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2021-09-08 14:00:32,092 synthtool [DEBUG] > Executing /root/.cache/synthtool/java-bigquery/.github/readme/synth.py. On branch autosynth-readme nothing to commit, working tree clean 2021-09-08 14:00:33,230 synthtool [DEBUG] > Wrote metadata to .github/readme/synth.metadata/synth.metadata. ```
Full log will be available here: https://source.cloud.google.com/results/invocations/2b932daf-9114-4d9e-953d-7fc7f6e4b594/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) --- .github/readme/synth.metadata/synth.metadata | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 99c8325460..e9cf55f55d 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "dc6e2f8191488bcaee21bd6c0b71ee5730ed103e" + "sha": "fc25036de8fe4cc99dffe5d307baebc6d1b88117" } }, { diff --git a/README.md b/README.md index 99626b3ca6..7067b3ade5 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.6 + 2.1.7 ``` @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.1.6' +implementation 'com.google.cloud:google-cloud-bigquery:2.1.7' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.6" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.7" ``` ## Authentication From 9cf29fbb220ce3ff1de0d3e2d6a25b22058cbaa8 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 8 Sep 2021 15:10:46 -0700 Subject: [PATCH 0373/2268] chore: remove readme autosynth config (#1576) --- .github/readme/synth.metadata/synth.metadata | 18 ------- .github/readme/synth.py | 19 ------- .kokoro/continuous/readme.cfg | 55 -------------------- 3 files changed, 92 deletions(-) delete mode 100644 .github/readme/synth.metadata/synth.metadata delete mode 100644 .github/readme/synth.py delete mode 100644 .kokoro/continuous/readme.cfg diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata deleted file mode 100644 index e9cf55f55d..0000000000 --- a/.github/readme/synth.metadata/synth.metadata +++ /dev/null @@ -1,18 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "fc25036de8fe4cc99dffe5d307baebc6d1b88117" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "17ee6e5c08f2eb47029beee4776ce990e56b3925" - } - } - ] -} \ No newline at end of file diff --git a/.github/readme/synth.py b/.github/readme/synth.py deleted file mode 100644 index 7b48cc28d3..0000000000 --- a/.github/readme/synth.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated the README for this library.""" - -from synthtool.languages import java - -java.custom_templates(["java_library/README.md"]) diff --git a/.kokoro/continuous/readme.cfg b/.kokoro/continuous/readme.cfg deleted file mode 100644 index e99978cc71..0000000000 --- a/.kokoro/continuous/readme.cfg +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/readme.sh" -} - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.log" - } -} - -# The github token is stored here. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - # TODO(theacodes): remove this after secrets have globally propagated - backend_type: FASTCONFIGPUSH - } - } -} - -# Common env vars for all repositories and builds. -env_vars: { - key: "GITHUB_USER" - value: "yoshi-automation" -} -env_vars: { - key: "GITHUB_EMAIL" - value: "yoshi-automation@google.com" -} From 611689c0bd72c789e7e1adf9451e8abfcd143983 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Sep 2021 06:34:07 -0700 Subject: [PATCH 0374/2268] chore: pick up changes from synthtool. (#1575) * chore(java): remove readme autosynth job config README generation is now handled by owlbot Source-Author: Jeff Ching Source-Date: Wed Sep 8 12:11:28 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: df5093b950d4aafd49a4c7758d74c44485263ada Source-Link: https://github.com/googleapis/synthtool/commit/df5093b950d4aafd49a4c7758d74c44485263ada * chore: remove readme synth.py config Source-Author: Jeff Ching Source-Date: Wed Sep 8 13:23:41 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 2d31a9243781b282202b4f76dc7bbc8b45803196 Source-Link: https://github.com/googleapis/synthtool/commit/2d31a9243781b282202b4f76dc7bbc8b45803196 * chore: add gcf-owl-bot to list of trusted contributors Source-Author: Jeff Ching Source-Date: Wed Sep 8 13:42:12 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: a6b97202771f89a4b76873d43ea9a07d7fc95f91 Source-Link: https://github.com/googleapis/synthtool/commit/a6b97202771f89a4b76873d43ea9a07d7fc95f91 --- .github/trusted-contribution.yml | 3 ++- synth.metadata | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index f247d5c789..a0ba1f7d90 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,2 +1,3 @@ trustedContributors: -- renovate-bot \ No newline at end of file +- renovate-bot +- gcf-owl-bot[bot] diff --git a/synth.metadata b/synth.metadata index 9a1a30bf15..037bb2122f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "b0e5d7ade8a82680cb02050586b758b83b80632e" + "sha": "466c2953a38071d47abaa25e4a5b7470e6c38f8e" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "17ee6e5c08f2eb47029beee4776ce990e56b3925" + "sha": "a6b97202771f89a4b76873d43ea9a07d7fc95f91" } } ], @@ -23,7 +23,6 @@ ".github/PULL_REQUEST_TEMPLATE.md", ".github/blunderbuss.yml", ".github/generated-files-bot.yml", - ".github/readme/synth.py", ".github/release-please.yml", ".github/release-trigger.yml", ".github/snippet-bot.yml", @@ -40,7 +39,6 @@ ".kokoro/common.sh", ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", - ".kokoro/continuous/readme.cfg", ".kokoro/nightly/common.cfg", ".kokoro/nightly/integration.cfg", ".kokoro/nightly/java11.cfg", From 0b0a670d743a77512cb888d3b0341a1b230d37ab Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 9 Sep 2021 16:38:48 -0700 Subject: [PATCH 0375/2268] chore(java): update shared-config and shared-dependencies version in pom template (#1578) Source-Author: Neenu Shaji Source-Date: Wed Sep 8 17:28:48 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e Source-Link: https://github.com/googleapis/synthtool/commit/396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e --- .kokoro/release/common.sh | 2 +- .kokoro/release/drop.sh | 2 +- .kokoro/release/promote.sh | 2 +- .kokoro/release/publish_javadoc.sh | 2 +- .kokoro/release/publish_javadoc11.sh | 2 +- .kokoro/release/stage.sh | 2 +- .kokoro/trampoline.sh | 2 +- synth.metadata | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh index 6e3f65999b..7f78ee414f 100755 --- a/.kokoro/release/common.sh +++ b/.kokoro/release/common.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh index 5c4551efa2..742ec1a886 100755 --- a/.kokoro/release/drop.sh +++ b/.kokoro/release/drop.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh index 1fa95fa537..3cac3d8a97 100755 --- a/.kokoro/release/promote.sh +++ b/.kokoro/release/promote.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index ab106db966..2acd135afe 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2019 Google Inc. +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index 10fe72d411..d596527c8e 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021 Google Inc. +# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 8a1033843c..77dc4e8f0f 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index 9da0f83987..8b69b793c9 100644 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/synth.metadata b/synth.metadata index 037bb2122f..db25ea1e36 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "466c2953a38071d47abaa25e4a5b7470e6c38f8e" + "sha": "611689c0bd72c789e7e1adf9451e8abfcd143983" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "a6b97202771f89a4b76873d43ea9a07d7fc95f91" + "sha": "396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e" } } ], From 747890305f503a8b8e2406d3c51b4b7e0fae0741 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 00:06:12 +0200 Subject: [PATCH 0376/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 (#1586) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.2.0` -> `2.2.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.1/compatibility-slim/2.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.2.1/confidence-slim/2.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v2.2.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​221-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare220v221-2021-09-13) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.2.0...v2.2.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2ade3c4cf5..89a295ddb9 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210828-1.32.1 - 2.2.0 + 2.2.1
From 84f32b18947e90a389ddfa6c7ea52048132366e6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 00:18:14 +0200 Subject: [PATCH 0377/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.2 (#1583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.1.0` -> `2.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.1.2/compatibility-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.1.2/confidence-slim/2.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigqueryconnection ### [`v2.1.2`](https://togithub.com/googleapis/java-bigqueryconnection/blob/master/CHANGELOG.md#​212-httpswwwgithubcomgoogleapisjava-bigqueryconnectioncomparev211v212-2021-09-15) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.1.1...v2.1.2) ### [`v2.1.1`](https://togithub.com/googleapis/java-bigqueryconnection/blob/master/CHANGELOG.md#​211-httpswwwgithubcomgoogleapisjava-bigqueryconnectioncomparev210v211-2021-09-14) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.1.0...v2.1.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a4e1751333..81a4f5e3b7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.0 + 2.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9c094621ea..22e982af1a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.0 + 2.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3f626991e8..3094589ca7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.0 + 2.1.2 test From 9b42705e670e095cfd48b239e814d6608f4748c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 00:21:45 +0200 Subject: [PATCH 0378/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210904-1.32.1 (#1584) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89a295ddb9..d0ee1edfda 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210828-1.32.1 + v2-rev20210904-1.32.1 2.2.1
From 114d587e4b6bf25df3a33a7d9bfc2d22cb929812 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 00:42:12 +0200 Subject: [PATCH 0379/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.1.2 (#1585) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.1.1` -> `2.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.2/compatibility-slim/2.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.2/confidence-slim/2.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v2.1.2`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​212-httpswwwgithubcomgoogleapisjava-bigtablecomparev211v212-2021-09-13) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.1.1...v2.1.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 81a4f5e3b7..4dc5b709d0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.1.1 + 2.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 22e982af1a..43f9d3488c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.1.1 + 2.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3094589ca7..5d5c8d3e1d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.1.1 + 2.1.2 test From f006fd02d2966e358d53af7da4a86901ad64e4e9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 00:44:12 +0200 Subject: [PATCH 0380/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.3 (#1587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.1.1` -> `2.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.3/compatibility-slim/2.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.3/confidence-slim/2.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.3`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​213-httpswwwgithubcomgoogleapisjava-storagecomparev212v213-2021-09-15) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.2...v2.1.3) ### [`v2.1.2`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​212-httpswwwgithubcomgoogleapisjava-storagecomparev211v212-2021-09-14) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.1...v2.1.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d0ee1edfda..506c85b55e 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.1 + 2.1.3 test From 466a51b9d1be90fbb9f4b01cf7add1237f51d4bd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 22:58:12 +0000 Subject: [PATCH 0381/2268] chore: release 2.1.8 (#1589) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.8](https://www.github.com/googleapis/java-bigquery/compare/v2.1.7...v2.1.8) (2021-09-16) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210904-1.32.1 ([#1584](https://www.github.com/googleapis/java-bigquery/issues/1584)) ([9b42705](https://www.github.com/googleapis/java-bigquery/commit/9b42705e670e095cfd48b239e814d6608f4748c7)) * update dependency com.google.cloud:google-cloud-bigtable to v2.1.2 ([#1585](https://www.github.com/googleapis/java-bigquery/issues/1585)) ([114d587](https://www.github.com/googleapis/java-bigquery/commit/114d587e4b6bf25df3a33a7d9bfc2d22cb929812)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#1586](https://www.github.com/googleapis/java-bigquery/issues/1586)) ([7478903](https://www.github.com/googleapis/java-bigquery/commit/747890305f503a8b8e2406d3c51b4b7e0fae0741)) * update dependency com.google.cloud:google-cloud-storage to v2.1.3 ([#1587](https://www.github.com/googleapis/java-bigquery/issues/1587)) ([f006fd0](https://www.github.com/googleapis/java-bigquery/commit/f006fd02d2966e358d53af7da4a86901ad64e4e9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 10 ++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a1ca6308..951367d5fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +### [2.1.8](https://www.github.com/googleapis/java-bigquery/compare/v2.1.7...v2.1.8) (2021-09-16) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210904-1.32.1 ([#1584](https://www.github.com/googleapis/java-bigquery/issues/1584)) ([9b42705](https://www.github.com/googleapis/java-bigquery/commit/9b42705e670e095cfd48b239e814d6608f4748c7)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.1.2 ([#1585](https://www.github.com/googleapis/java-bigquery/issues/1585)) ([114d587](https://www.github.com/googleapis/java-bigquery/commit/114d587e4b6bf25df3a33a7d9bfc2d22cb929812)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#1586](https://www.github.com/googleapis/java-bigquery/issues/1586)) ([7478903](https://www.github.com/googleapis/java-bigquery/commit/747890305f503a8b8e2406d3c51b4b7e0fae0741)) +* update dependency com.google.cloud:google-cloud-storage to v2.1.3 ([#1587](https://www.github.com/googleapis/java-bigquery/issues/1587)) ([f006fd0](https://www.github.com/googleapis/java-bigquery/commit/f006fd02d2966e358d53af7da4a86901ad64e4e9)) + ### [2.1.7](https://www.github.com/googleapis/java-bigquery/compare/v2.1.6...v2.1.7) (2021-09-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index abf5a72c3c..d8361b98b3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e8dda9df74..2ffe24d657 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.8-SNAPSHOT + 2.1.8 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.8-SNAPSHOT + 2.1.8 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 506c85b55e..efb78fb8ff 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.8-SNAPSHOT + 2.1.8 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 43f9d3488c..1869f04782 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.8-SNAPSHOT + 2.1.8 diff --git a/versions.txt b/versions.txt index 1a9b1813a9..0085cc0380 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.7:2.1.8-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.8:2.1.8 \ No newline at end of file From e6a88a44727f9ccaed5ec375b215b87dc3444f52 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 23:10:14 +0000 Subject: [PATCH 0382/2268] chore: release 2.1.9-SNAPSHOT (#1590) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d8361b98b3..0b3dab0fe6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.8 + 2.1.9-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2ffe24d657..b83bcf5723 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.8 + 2.1.9-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.8 + 2.1.9-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index efb78fb8ff..9baf2aae8b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.8 + 2.1.9-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.8 + 2.1.9-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1869f04782..7031dfde24 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.8 + 2.1.9-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0085cc0380..d6b3d1aa2f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.8:2.1.8 \ No newline at end of file +google-cloud-bigquery:2.1.8:2.1.9-SNAPSHOT \ No newline at end of file From 1318cb690b018640052e67bf936849967607cb01 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 17 Sep 2021 09:30:52 -0400 Subject: [PATCH 0383/2268] chore: migrate to owlbot (#1579) --- .github/.OwlBot.lock.yaml | 3 +++ .github/.OwlBot.yaml | 16 ++++++++++++++++ synth.py => owlbot.py.py | 2 -- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .github/.OwlBot.lock.yaml create mode 100644 .github/.OwlBot.yaml rename synth.py => owlbot.py.py (96%) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml new file mode 100644 index 0000000000..5607b418e7 --- /dev/null +++ b/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + image: gcr.io/repo-automation-bots/owlbot-java:latest + digest: sha256:b328758e5113c392d3eccad613c2b18097eaebcb4d8bf77fab0326a6cad90bc7 \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml new file mode 100644 index 0000000000..8c5f03b4de --- /dev/null +++ b/.github/.OwlBot.yaml @@ -0,0 +1,16 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" diff --git a/synth.py b/owlbot.py.py similarity index 96% rename from synth.py rename to owlbot.py.py index 19fbf6010c..f514ca823d 100644 --- a/synth.py +++ b/owlbot.py.py @@ -16,8 +16,6 @@ import synthtool.languages.java as java -AUTOSYNTH_MULTIPLE_COMMITS = True - java.common_templates(excludes=[ '.kokoro/continuous/java8-samples.cfg', '.kokoro/continuous/java11-samples.cfg', From 66ff49859bc53601ff30d911d25351565b6ab9e8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 15:32:10 +0200 Subject: [PATCH 0384/2268] test(deps): update datacatalog dependencies to v1.5.6 (#1588) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9baf2aae8b..68e1848e99 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.4 + 1.5.6 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.4 + 1.5.6 test From 4fb3c2e6b23c3892f8570a2e9ccdc643b6c3fdef Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 15:32:23 +0200 Subject: [PATCH 0385/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.8 (#1591) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4dc5b709d0..c4d65c0ca0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.7 + 2.1.8 From e788510b667b897d10fa8b246db3e54233216dd2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Sep 2021 15:42:26 +0200 Subject: [PATCH 0386/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.0.2 (#1582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.0.1` -> `1.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.2/compatibility-slim/1.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.2/confidence-slim/1.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.0.2`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​102-httpswwwgithubcomgoogleapisjava-shared-configcomparev101v102-2021-09-13) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.0.1...v1.0.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68e1848e99..153a339dd2 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.1 + 1.0.2 From e384f5a2fa238d17458bbe26176e2508bd8d4796 Mon Sep 17 00:00:00 2001 From: Franklin Whaite <70151215+franklinWhaite@users.noreply.github.com> Date: Fri, 17 Sep 2021 13:56:25 -0500 Subject: [PATCH 0387/2268] chore: add UUID to retry logging (#1581) --- .../com/google/cloud/bigquery/BigQueryRetryAlgorithm.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index 756377d210..a4e642191c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -26,6 +26,7 @@ import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; import java.util.Iterator; +import java.util.UUID; import java.util.concurrent.CancellationException; import java.util.logging.Level; import java.util.logging.Logger; @@ -40,6 +41,7 @@ public class BigQueryRetryAlgorithm extends RetryAlgorithm private final TimedRetryAlgorithmWithContext timedAlgorithmWithContext; private static final Logger LOG = Logger.getLogger(BigQueryRetryAlgorithm.class.getName()); + private static final UUID RETRY_UUID = UUID.randomUUID(); public BigQueryRetryAlgorithm( ResultRetryAlgorithm resultAlgorithm, @@ -76,13 +78,14 @@ public boolean shouldRetry( if (LOG.isLoggable(Level.FINEST)) { LOG.log( Level.FINEST, - "Retrying with:\n{0}\n{1}\n{2}\n{3}\n{4}", + "Retrying with:\n{0}\n{1}\n{2}\n{3}\n{4}\n{5}", new Object[] { "BigQuery attemptCount: " + attemptCount, "BigQuery delay: " + retryDelay, "BigQuery retriableException: " + previousThrowable, "BigQuery shouldRetry: " + shouldRetry, - "BigQuery previousThrowable.getMessage: " + errorMessage + "BigQuery previousThrowable.getMessage: " + errorMessage, + "BigQuery retry identifier: " + RETRY_UUID }); } return shouldRetry; From 4251b19f5b240b907aa5fc6d0cc64026245714cf Mon Sep 17 00:00:00 2001 From: Ryan Culbertson Date: Mon, 20 Sep 2021 18:58:51 -0400 Subject: [PATCH 0388/2268] fix: do not throw NPE from BigQueryImpl.testIamPermissions (#1596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for issue where `BigQueryImpl.testIamPermissions` will throw a NullPointerException if the caller does not have any of the permissions being checked. Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes #1595 ☕️ --- .../com/google/cloud/bigquery/BigQueryImpl.java | 4 +++- .../google/cloud/bigquery/BigQueryImplTest.java | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 03635a89ed..fd9160f40e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1495,7 +1495,9 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() getOptions().getRetrySettings(), EXCEPTION_HANDLER, getOptions().getClock()); - return ImmutableList.copyOf(response.getPermissions()); + return response.getPermissions() == null + ? ImmutableList.of() + : ImmutableList.copyOf(response.getPermissions()); } catch (RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index a12800c879..760c84f32a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -2766,4 +2766,21 @@ public void testTestIamPermissions() { assertEquals(perms, grantedPermissions); verify(bigqueryRpcMock).testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); } + + @Test + public void testTestIamPermissionsWhenNoPermissionsGranted() { + final String resourceId = + String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); + final List checkedPermissions = ImmutableList.of("foo", "bar", "baz"); + // If caller has no permissions, TestIamPermissionsResponse.permissions will be null + final com.google.api.services.bigquery.model.TestIamPermissionsResponse response = + new com.google.api.services.bigquery.model.TestIamPermissionsResponse() + .setPermissions(null); + when(bigqueryRpcMock.testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS)) + .thenReturn(response); + bigquery = options.getService(); + List perms = bigquery.testIamPermissions(TABLE_ID, checkedPermissions); + assertEquals(perms, ImmutableList.of()); + verify(bigqueryRpcMock).testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); + } } From 354cf7f3a8dd8cf24d9a5f7e3377591a13b60863 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 21 Sep 2021 01:12:56 +0200 Subject: [PATCH 0389/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.4 (#1597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.1.3` -> `2.1.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.4/compatibility-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.4/confidence-slim/2.1.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.4`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​214-httpswwwgithubcomgoogleapisjava-storagecomparev213v214-2021-09-20) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.3...v2.1.4)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 153a339dd2..478bb7dec5 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.3 + 2.1.4 test From 7a715c71ae0ba1e17129949f078ccbd8ca1afeab Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 08:30:16 -0700 Subject: [PATCH 0390/2268] chore: relocate owl bot post processor (#1599) * chore: relocate owl bot post processor * chore: relocate owl bot post processor --- .github/.OwlBot.lock.yaml | 2 +- .github/.OwlBot.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5607b418e7..942f78aec4 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - image: gcr.io/repo-automation-bots/owlbot-java:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest digest: sha256:b328758e5113c392d3eccad613c2b18097eaebcb4d8bf77fab0326a6cad90bc7 \ No newline at end of file diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index 8c5f03b4de..5d9a9d8b56 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: - image: "gcr.io/repo-automation-bots/owlbot-java:latest" + image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" From b3c2ec3449cd72efb087ca851c3a808275786022 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:42:09 +0000 Subject: [PATCH 0391/2268] chore: release 2.1.9 (#1598) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.9](https://www.github.com/googleapis/java-bigquery/compare/v2.1.8...v2.1.9) (2021-09-21) ### Bug Fixes * do not throw NPE from BigQueryImpl.testIamPermissions ([#1596](https://www.github.com/googleapis/java-bigquery/issues/1596)) ([4251b19](https://www.github.com/googleapis/java-bigquery/commit/4251b19f5b240b907aa5fc6d0cc64026245714cf)) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.1.4 ([#1597](https://www.github.com/googleapis/java-bigquery/issues/1597)) ([354cf7f](https://www.github.com/googleapis/java-bigquery/commit/354cf7f3a8dd8cf24d9a5f7e3377591a13b60863)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 951367d5fb..471fdbe663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [2.1.9](https://www.github.com/googleapis/java-bigquery/compare/v2.1.8...v2.1.9) (2021-09-21) + + +### Bug Fixes + +* do not throw NPE from BigQueryImpl.testIamPermissions ([#1596](https://www.github.com/googleapis/java-bigquery/issues/1596)) ([4251b19](https://www.github.com/googleapis/java-bigquery/commit/4251b19f5b240b907aa5fc6d0cc64026245714cf)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.1.4 ([#1597](https://www.github.com/googleapis/java-bigquery/issues/1597)) ([354cf7f](https://www.github.com/googleapis/java-bigquery/commit/354cf7f3a8dd8cf24d9a5f7e3377591a13b60863)) + ### [2.1.8](https://www.github.com/googleapis/java-bigquery/compare/v2.1.7...v2.1.8) (2021-09-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0b3dab0fe6..02a0bf134a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.9-SNAPSHOT + 2.1.9 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b83bcf5723..8d5946a157 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.9-SNAPSHOT + 2.1.9 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.9-SNAPSHOT + 2.1.9 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 478bb7dec5..2f0f884ed3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.9-SNAPSHOT + 2.1.9 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.9-SNAPSHOT + 2.1.9 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7031dfde24..cb40626661 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.9-SNAPSHOT + 2.1.9 diff --git a/versions.txt b/versions.txt index d6b3d1aa2f..921e3131b4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.8:2.1.9-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.9:2.1.9 \ No newline at end of file From 0d0e4fde605bc3162764d58eeb864cded6771270 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 20:44:10 +0000 Subject: [PATCH 0392/2268] chore: release 2.1.10-SNAPSHOT (#1600) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- .../clirr-ignored-differences.xml | 15 --------------- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 7 insertions(+), 22 deletions(-) delete mode 100644 google-cloud-bigquery/clirr-ignored-differences.xml diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 02a0bf134a..40c88dd2af 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.9 + 2.1.10-SNAPSHOT diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml deleted file mode 100644 index 4d66f0620e..0000000000 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - 7012 - com/google/cloud/bigquery/BigQuery - boolean delete(com.google.cloud.bigquery.JobId) - - - 7012 - com/google/cloud/bigquery/spi/v2/BigQueryRpc - boolean deleteJob(java.lang.String, java.lang.String, java.lang.String) - - \ No newline at end of file diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8d5946a157..ca235f6746 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.9 + 2.1.10-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.9 + 2.1.10-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2f0f884ed3..6a43944f67 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.9 + 2.1.10-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.9 + 2.1.10-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cb40626661..3c05f34879 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.9 + 2.1.10-SNAPSHOT diff --git a/versions.txt b/versions.txt index 921e3131b4..b8cc97f5f3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.9:2.1.9 \ No newline at end of file +google-cloud-bigquery:2.1.9:2.1.10-SNAPSHOT \ No newline at end of file From c18254aa732b72287e53ae3ce9d8529a2a85b436 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 01:26:13 +0200 Subject: [PATCH 0393/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.0.3 (#1603) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.0.2` -> `1.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.3/compatibility-slim/1.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.0.3/confidence-slim/1.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.0.3`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​103-httpswwwgithubcomgoogleapisjava-shared-configcomparev102v103-2021-09-21) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.0.2...v1.0.3)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a43944f67..09b150afb0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.2 + 1.0.3 From 8c94050623f770e7238e3f33d732f4cb54cd8f35 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 16:02:40 +0200 Subject: [PATCH 0394/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.9 (#1601) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c4d65c0ca0..c894cb3fa5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.8 + 2.1.9 From 1a96cb076ded8eae8c34962aa00e914ba197b516 Mon Sep 17 00:00:00 2001 From: Franklin Whaite <70151215+franklinWhaite@users.noreply.github.com> Date: Wed, 22 Sep 2021 09:40:28 -0500 Subject: [PATCH 0395/2268] fix: add retrySetting in logging (#1604) --- .../java/com/google/cloud/bigquery/BigQueryRetryHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java index 623228d6c6..405a2371ed 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java @@ -75,9 +75,10 @@ private static V run( if (LOG.isLoggable(Level.FINEST)) { LOG.log( Level.FINEST, - "Retrying with:\n{0}", + "Retrying with:\n{0}\n{1}", new Object[] { "BigQuery retried method: " + callable.getClass().getEnclosingMethod().getName(), + "BigQuery retry settings: " + timedAlgorithm.createFirstAttempt().getGlobalSettings() }); } From 1ccac9a6ca891fd160911de524e8227414b29e75 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 16:42:29 +0200 Subject: [PATCH 0396/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210910-1.32.1 (#1602) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 09b150afb0..fc8da038ba 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210904-1.32.1 + v2-rev20210910-1.32.1 2.2.1
From 3714360299ff1d120e76f65f059f8566a5a3c367 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:02:11 +0000 Subject: [PATCH 0397/2268] chore: release 2.1.10 (#1606) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.10](https://www.github.com/googleapis/java-bigquery/compare/v2.1.9...v2.1.10) (2021-09-22) ### Bug Fixes * add retrySetting in logging ([#1604](https://www.github.com/googleapis/java-bigquery/issues/1604)) ([1a96cb0](https://www.github.com/googleapis/java-bigquery/commit/1a96cb076ded8eae8c34962aa00e914ba197b516)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210910-1.32.1 ([#1602](https://www.github.com/googleapis/java-bigquery/issues/1602)) ([1ccac9a](https://www.github.com/googleapis/java-bigquery/commit/1ccac9a6ca891fd160911de524e8227414b29e75)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471fdbe663..a3edd9ecfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [2.1.10](https://www.github.com/googleapis/java-bigquery/compare/v2.1.9...v2.1.10) (2021-09-22) + + +### Bug Fixes + +* add retrySetting in logging ([#1604](https://www.github.com/googleapis/java-bigquery/issues/1604)) ([1a96cb0](https://www.github.com/googleapis/java-bigquery/commit/1a96cb076ded8eae8c34962aa00e914ba197b516)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210910-1.32.1 ([#1602](https://www.github.com/googleapis/java-bigquery/issues/1602)) ([1ccac9a](https://www.github.com/googleapis/java-bigquery/commit/1ccac9a6ca891fd160911de524e8227414b29e75)) + ### [2.1.9](https://www.github.com/googleapis/java-bigquery/compare/v2.1.8...v2.1.9) (2021-09-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 40c88dd2af..dcf365913c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.10-SNAPSHOT + 2.1.10 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ca235f6746..64abf796b1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.10-SNAPSHOT + 2.1.10 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.10-SNAPSHOT + 2.1.10 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index fc8da038ba..ff6c3abe4c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.10-SNAPSHOT + 2.1.10 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.10-SNAPSHOT + 2.1.10 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3c05f34879..bc4e8fe9fb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.10-SNAPSHOT + 2.1.10 diff --git a/versions.txt b/versions.txt index b8cc97f5f3..e1dfe8cd93 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.9:2.1.10-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.10:2.1.10 \ No newline at end of file From 9d13792f8a6bda064816f5fdc921948959dd0743 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:16:27 +0000 Subject: [PATCH 0398/2268] chore: release 2.1.11-SNAPSHOT (#1607) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dcf365913c..c6f46db200 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.10 + 2.1.11-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 64abf796b1..40ef08b4bd 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.10 + 2.1.11-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.10 + 2.1.11-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ff6c3abe4c..4d02e74277 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.10 + 2.1.11-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.10 + 2.1.11-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bc4e8fe9fb..34cc278338 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.10 + 2.1.11-SNAPSHOT diff --git a/versions.txt b/versions.txt index e1dfe8cd93..ba8cc64a23 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.10:2.1.10 \ No newline at end of file +google-cloud-bigquery:2.1.10:2.1.11-SNAPSHOT \ No newline at end of file From 967768c724c2342afa01b7222ef03a9e1385b31b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 19:51:05 +0200 Subject: [PATCH 0399/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.10 (#1608) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c894cb3fa5..d3d51a5fcc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.9 + 2.1.10 From fb3895e811cdec46b05f2188cd054788fcb03a1d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 19:52:06 +0200 Subject: [PATCH 0400/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 (#1610) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d02e74277..9a3ed5613a 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210910-1.32.1 - 2.2.1 + 2.3.0 From cab62e8b47f9e20704ad47beb2787223ed3340b8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 21:15:21 +0200 Subject: [PATCH 0401/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.3 (#1612) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d3d51a5fcc..e45650b35d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.2 + 2.1.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 34cc278338..555ec3a61d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.2 + 2.1.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5d5c8d3e1d..a8e3e36613 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.2 + 2.1.3 test From 6b04f769ad5fb2eaa0eec57a5e937b81413c95e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Sep 2021 21:26:53 +0200 Subject: [PATCH 0402/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.1.3 (#1609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.1.2` -> `2.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.3/compatibility-slim/2.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.1.3/confidence-slim/2.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v2.1.3`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​213-httpswwwgithubcomgoogleapisjava-bigtablecomparev212v213-2021-09-21) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.1.2...v2.1.3)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e45650b35d..d7e44f8985 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.1.2 + 2.1.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 555ec3a61d..dddf4d846e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.1.2 + 2.1.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a8e3e36613..5b310aa228 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.1.2 + 2.1.3 test From c1322c574d9b151478ff762f272cd78e9c2a9b68 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 19:40:54 +0000 Subject: [PATCH 0403/2268] chore: release 2.1.11 (#1611) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.11](https://www.github.com/googleapis/java-bigquery/compare/v2.1.10...v2.1.11) (2021-09-22) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.1.3 ([#1609](https://www.github.com/googleapis/java-bigquery/issues/1609)) ([6b04f76](https://www.github.com/googleapis/java-bigquery/commit/6b04f769ad5fb2eaa0eec57a5e937b81413c95e3)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#1610](https://www.github.com/googleapis/java-bigquery/issues/1610)) ([fb3895e](https://www.github.com/googleapis/java-bigquery/commit/fb3895e811cdec46b05f2188cd054788fcb03a1d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3edd9ecfa..b59ddb8e4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.1.11](https://www.github.com/googleapis/java-bigquery/compare/v2.1.10...v2.1.11) (2021-09-22) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.1.3 ([#1609](https://www.github.com/googleapis/java-bigquery/issues/1609)) ([6b04f76](https://www.github.com/googleapis/java-bigquery/commit/6b04f769ad5fb2eaa0eec57a5e937b81413c95e3)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#1610](https://www.github.com/googleapis/java-bigquery/issues/1610)) ([fb3895e](https://www.github.com/googleapis/java-bigquery/commit/fb3895e811cdec46b05f2188cd054788fcb03a1d)) + ### [2.1.10](https://www.github.com/googleapis/java-bigquery/compare/v2.1.9...v2.1.10) (2021-09-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c6f46db200..14cac30b95 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.11-SNAPSHOT + 2.1.11 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 40ef08b4bd..d77a8a8c2e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.11-SNAPSHOT + 2.1.11 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.11-SNAPSHOT + 2.1.11 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9a3ed5613a..8c3f836168 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.11-SNAPSHOT + 2.1.11 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.11-SNAPSHOT + 2.1.11 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dddf4d846e..b8563626c9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.11-SNAPSHOT + 2.1.11 diff --git a/versions.txt b/versions.txt index ba8cc64a23..3608fd6e2b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.10:2.1.11-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.11:2.1.11 \ No newline at end of file From 1db04fc7eef0405f36a0e2bc2c1c9b60ff9229eb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Sep 2021 19:52:53 +0000 Subject: [PATCH 0404/2268] chore: release 2.1.12-SNAPSHOT (#1613) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 14cac30b95..9557136258 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.11 + 2.1.12-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d77a8a8c2e..621c9cf89d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.11 + 2.1.12-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.11 + 2.1.12-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8c3f836168..0fb0101675 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.11 + 2.1.12-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.11 + 2.1.12-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b8563626c9..a7ad8a4aaf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.11 + 2.1.12-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3608fd6e2b..de6e3337c3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.11:2.1.11 \ No newline at end of file +google-cloud-bigquery:2.1.11:2.1.12-SNAPSHOT \ No newline at end of file From 3e3b1da0f9e4006a83ed824f8ed67a9798219bee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 23 Sep 2021 01:56:07 +0200 Subject: [PATCH 0405/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.1.4 (#1616) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d7e44f8985..c1d4cf0131 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.1.3 + 2.1.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a7ad8a4aaf..1eb75aef4b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.1.3 + 2.1.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5b310aa228..06629d9976 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.1.3 + 2.1.4 test From 9401e362cd0957b34b6c2044fbd94405f50e83b4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 24 Sep 2021 17:33:38 +0200 Subject: [PATCH 0406/2268] test(deps): update datacatalog dependencies to v1.5.7 (#1617) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0fb0101675..ba706c0dd0 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.6 + 1.5.7 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.6 + 1.5.7 test From 828779d5de27d1b0f16be0a82753f9156a18c5df Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 24 Sep 2021 18:26:59 +0200 Subject: [PATCH 0407/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.11 (#1614) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.1.10` -> `2.1.11` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.11/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.11/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.11/compatibility-slim/2.1.10)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.1.11/confidence-slim/2.1.10)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.1.11`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​2111-httpswwwgithubcomgoogleapisjava-bigquerycomparev2110v2111-2021-09-22) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.1.10...v2.1.11)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c1d4cf0131..7d5dbc67e1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.10 + 2.1.11 From 00cc0682b694bcdad927e0ec1770b99896402563 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 24 Sep 2021 22:40:23 +0200 Subject: [PATCH 0408/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.5 (#1615) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.1.4` -> `2.1.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.5/compatibility-slim/2.1.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.5/confidence-slim/2.1.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.5`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​215-httpswwwgithubcomgoogleapisjava-storagecomparev214v215-2021-09-22) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.4...v2.1.5)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ba706c0dd0..76ca126f2a 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.4 + 2.1.5 test From 945131044c1ee32d7e9e63cab14f699ca229c21a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 20:52:48 +0000 Subject: [PATCH 0409/2268] chore: release 2.1.12 (#1618) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.12](https://www.github.com/googleapis/java-bigquery/compare/v2.1.11...v2.1.12) (2021-09-24) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.1.4 ([#1616](https://www.github.com/googleapis/java-bigquery/issues/1616)) ([3e3b1da](https://www.github.com/googleapis/java-bigquery/commit/3e3b1da0f9e4006a83ed824f8ed67a9798219bee)) * update dependency com.google.cloud:google-cloud-storage to v2.1.5 ([#1615](https://www.github.com/googleapis/java-bigquery/issues/1615)) ([00cc068](https://www.github.com/googleapis/java-bigquery/commit/00cc0682b694bcdad927e0ec1770b99896402563)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b59ddb8e4d..982359490a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.1.12](https://www.github.com/googleapis/java-bigquery/compare/v2.1.11...v2.1.12) (2021-09-24) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.1.4 ([#1616](https://www.github.com/googleapis/java-bigquery/issues/1616)) ([3e3b1da](https://www.github.com/googleapis/java-bigquery/commit/3e3b1da0f9e4006a83ed824f8ed67a9798219bee)) +* update dependency com.google.cloud:google-cloud-storage to v2.1.5 ([#1615](https://www.github.com/googleapis/java-bigquery/issues/1615)) ([00cc068](https://www.github.com/googleapis/java-bigquery/commit/00cc0682b694bcdad927e0ec1770b99896402563)) + ### [2.1.11](https://www.github.com/googleapis/java-bigquery/compare/v2.1.10...v2.1.11) (2021-09-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9557136258..2520002e71 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.12-SNAPSHOT + 2.1.12 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 621c9cf89d..4f9584cac2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.12-SNAPSHOT + 2.1.12 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.12-SNAPSHOT + 2.1.12 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 76ca126f2a..0297006629 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.12-SNAPSHOT + 2.1.12 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.12-SNAPSHOT + 2.1.12 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1eb75aef4b..442ea26081 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.12-SNAPSHOT + 2.1.12 diff --git a/versions.txt b/versions.txt index de6e3337c3..e5f3a2d4f7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.11:2.1.12-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.12:2.1.12 \ No newline at end of file From 6c227f07998d2eefdd7897753c5179d8375fc882 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Sep 2021 21:12:50 +0000 Subject: [PATCH 0410/2268] chore: release 2.1.13-SNAPSHOT (#1619) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2520002e71..e924c2a93e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.12 + 2.1.13-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4f9584cac2..ae351e1853 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.12 + 2.1.13-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.12 + 2.1.13-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0297006629..4398e2a92c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.12 + 2.1.13-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.12 + 2.1.13-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 442ea26081..d4a2ca50df 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.12 + 2.1.13-SNAPSHOT diff --git a/versions.txt b/versions.txt index e5f3a2d4f7..e297625bf1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.12:2.1.12 \ No newline at end of file +google-cloud-bigquery:2.1.12:2.1.13-SNAPSHOT \ No newline at end of file From fb439d7647074524c966250cd029dc34f45cb6e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 25 Sep 2021 23:23:56 +0200 Subject: [PATCH 0411/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.12 (#1620) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7d5dbc67e1..7145c55743 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.11 + 2.1.12 From dfa15e5ca08a3227f015a389c4c08732178a73e7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Sep 2021 21:22:56 +0200 Subject: [PATCH 0412/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.6 (#1621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.1.5` -> `2.1.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.6/compatibility-slim/2.1.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.6/confidence-slim/2.1.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.6`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​216-httpswwwgithubcomgoogleapisjava-storagecomparev215v216-2021-09-24) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.5...v2.1.6)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4398e2a92c..c1b038073f 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.5 + 2.1.6 test From cd4ff07866d1673f5c1344c5508ebe57cb0d1041 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 28 Sep 2021 12:42:16 -0700 Subject: [PATCH 0413/2268] chore: change branch master to main (#1623) --- .github/sync-repo-settings.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index ab4807cbe0..b595a8a2c9 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -2,7 +2,7 @@ rebaseMergeAllowed: true squashMergeAllowed: true mergeCommitAllowed: false branchProtectionRules: - - pattern: master + - pattern: main isAdminEnforced: true requiredApprovingReviewCount: 1 requiresCodeOwnerReviews: true From 874bf09a3c04495d0f4ef985b3ef1a56a3415493 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 29 Sep 2021 10:32:09 -0400 Subject: [PATCH 0414/2268] chore: change branch master to main in github configurations (#1625) --- .github/blunderbuss.yml | 2 +- .github/workflows/ci.yaml | 2 +- README.md | 274 +++++++++++++++++++------------------- 3 files changed, 139 insertions(+), 139 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 1a23ea42b1..2176b05432 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,5 +1,5 @@ # Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss assign_prs_by: - labels: - samples diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3becb5c022..3932a70d4e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,7 +1,7 @@ on: push: branches: - - master + - main pull_request: name: ci jobs: diff --git a/README.md b/README.md index 7067b3ade5..b428027cc0 100644 --- a/README.md +++ b/README.md @@ -106,142 +106,142 @@ use this Cloud BigQuery Client Library. ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree/master/samples) directory. +Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree/main/samples) directory. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Add Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | -| Add Empty Column | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | -| Alter Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | -| Auth Drive Scope | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | -| Auth Snippets | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | -| Auth User Flow | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | -| Auth User Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | -| Authorized View Tutorial | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | -| Browse Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | -| Cancel Job | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | -| Copy Multiple Tables | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | -| Copy Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | -| Copy Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | -| Create Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | -| Create Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | -| Create Dataset Aws | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | -| Create External Table Aws | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | -| Create Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | -| Create Job | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | -| Create Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateMaterializedView.java) | -| Create Model | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateModel.java) | -| Create Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreatePartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreatePartitionedTable.java) | -| Create Range Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateRangePartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRangePartitionedTable.java) | -| Create Routine | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRoutine.java) | -| Create Routine Ddl | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateRoutineDdl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRoutineDdl.java) | -| Create Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTable.java) | -| Create Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | -| Create Table External Hive Partitioned | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | -| Create Table Without Schema | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | -| Create View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | -| Dataset Exists | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | -| Ddl Create View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | -| Delete Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteDataset.java) | -| Delete Dataset And Contents | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteDatasetAndContents.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteDatasetAndContents.java) | -| Delete Label Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteLabelDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteLabelDataset.java) | -| Delete Label Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteLabelTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteLabelTable.java) | -| Delete Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteMaterializedView.java) | -| Delete Model | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteModel.java) | -| Delete Routine | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteRoutine.java) | -| Delete Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/DeleteTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteTable.java) | -| Export Query Results To S3 | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ExportQueryResultsToS3.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExportQueryResultsToS3.java) | -| Extract Model | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ExtractModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractModel.java) | -| Extract Table Compressed | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ExtractTableCompressed.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableCompressed.java) | -| Extract Table To Csv | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ExtractTableToCsv.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableToCsv.java) | -| Extract Table To Json | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ExtractTableToJson.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableToJson.java) | -| Get Dataset Info | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetDatasetInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetDatasetInfo.java) | -| Get Dataset Labels | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetDatasetLabels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetDatasetLabels.java) | -| Get Job | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetJob.java) | -| Get Model | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetModel.java) | -| Get Routine | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetRoutine.java) | -| Get Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetTable.java) | -| Get Table Labels | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetTableLabels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetTableLabels.java) | -| Get View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GetView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetView.java) | -| Grant View Access | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java) | -| Inserting Data Types | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java) | -| Label Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LabelDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LabelDataset.java) | -| Label Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LabelTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LabelTable.java) | -| List Datasets | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListDatasets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListDatasets.java) | -| List Datasets By Label | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListDatasetsByLabel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListDatasetsByLabel.java) | -| List Jobs | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListJobs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListJobs.java) | -| List Models | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListModels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListModels.java) | -| List Routines | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListRoutines.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListRoutines.java) | -| List Tables | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ListTables.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListTables.java) | -| Load Avro From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcs.java) | -| Load Avro From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcsTruncate.java) | -| Load Csv From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcs.java) | -| Load Csv From Gcs Autodetect | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsAutodetect.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsAutodetect.java) | -| Load Csv From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsTruncate.java) | -| Load Json From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcs.java) | -| Load Json From Gcs Autodetect | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsAutodetect.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsAutodetect.java) | -| Load Json From Gcs Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | -| Load Json From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | -| Load Local File | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | -| Load Orc From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | -| Load Orc From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | -| Load Parquet | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | -| Load Parquet Replace Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadParquetReplaceTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadParquetReplaceTable.java) | -| Load Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | -| Load Table Clustered | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | -| Nested Repeated Schema | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | -| Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/Query.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/Query.java) | -| Query Batch | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | -| Query Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | -| Query Destination Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | -| Query Disable Cache | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryDisableCache.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDisableCache.java) | -| Query Dry Run | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryDryRun.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDryRun.java) | -| Query External Bigtable Perm | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java) | -| Query External Bigtable Temp | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java) | -| Query External Gcs Perm | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsPerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsPerm.java) | -| Query External Gcs Temp | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsTemp.java) | -| Query External Sheets Perm | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsPerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsPerm.java) | -| Query External Sheets Temp | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsTemp.java) | -| Query External Table Aws | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryExternalTableAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalTableAws.java) | -| Query Large Results | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryLargeResults.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryLargeResults.java) | -| Query Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryMaterializedView.java) | -| Query Pagination | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | -| Query Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | -| Query Script | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | -| Query Total Rows | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | -| Query With Array Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | -| Query With Named Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | -| Query With Named Types Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | -| Query With Positional Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalParameters.java) | -| Query With Positional Types Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalTypesParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalTypesParameters.java) | -| Query With Structs Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java) | -| Query With Timestamp Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QuickstartSample.java) | -| Relax Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/RelaxColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxColumnLoadAppend.java) | -| Relax Column Mode | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/RelaxColumnMode.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxColumnMode.java) | -| Relax Table Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/RelaxTableQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxTableQuery.java) | -| Resource Clean Up | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | -| Run Legacy Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | -| Save Query To Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | -| Simple App | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | -| Simple Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | -| Table Exists | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | -| Table Insert Rows | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | -| Table Insert Rows Without Row Ids | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | -| Undelete Table | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UndeleteTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UndeleteTable.java) | -| Update Dataset Access | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetAccess.java) | -| Update Dataset Description | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetDescription.java) | -| Update Dataset Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | -| Update Dataset Partition Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | -| Update Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | -| Update Model Description | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | -| Update Routine | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | -| Update Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | -| Update Table Description | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateTableDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableDescription.java) | -| Update Table Dml | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateTableDml.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableDml.java) | -| Update Table Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java) | -| Update Table Require Partition Filter | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateTableRequirePartitionFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableRequirePartitionFilter.java) | -| Update View Query | [source code](https://github.com/googleapis/java-bigquery/blob/master/samples/snippets/src/main/java/com/example/bigquery/UpdateViewQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateViewQuery.java) | +| Add Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | +| Add Empty Column | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | +| Alter Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | +| Auth Drive Scope | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | +| Auth Snippets | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | +| Auth User Flow | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | +| Auth User Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | +| Authorized View Tutorial | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | +| Browse Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | +| Cancel Job | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | +| Copy Multiple Tables | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | +| Copy Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | +| Copy Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | +| Create Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | +| Create Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | +| Create Dataset Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | +| Create External Table Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | +| Create Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | +| Create Job | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | +| Create Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateMaterializedView.java) | +| Create Model | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateModel.java) | +| Create Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreatePartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreatePartitionedTable.java) | +| Create Range Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateRangePartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRangePartitionedTable.java) | +| Create Routine | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRoutine.java) | +| Create Routine Ddl | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateRoutineDdl.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateRoutineDdl.java) | +| Create Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTable.java) | +| Create Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | +| Create Table External Hive Partitioned | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | +| Create Table Without Schema | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | +| Create View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | +| Dataset Exists | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | +| Ddl Create View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | +| Delete Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteDataset.java) | +| Delete Dataset And Contents | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteDatasetAndContents.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteDatasetAndContents.java) | +| Delete Label Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteLabelDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteLabelDataset.java) | +| Delete Label Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteLabelTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteLabelTable.java) | +| Delete Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteMaterializedView.java) | +| Delete Model | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteModel.java) | +| Delete Routine | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteRoutine.java) | +| Delete Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DeleteTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DeleteTable.java) | +| Export Query Results To S3 | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ExportQueryResultsToS3.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExportQueryResultsToS3.java) | +| Extract Model | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ExtractModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractModel.java) | +| Extract Table Compressed | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ExtractTableCompressed.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableCompressed.java) | +| Extract Table To Csv | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ExtractTableToCsv.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableToCsv.java) | +| Extract Table To Json | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ExtractTableToJson.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ExtractTableToJson.java) | +| Get Dataset Info | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetDatasetInfo.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetDatasetInfo.java) | +| Get Dataset Labels | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetDatasetLabels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetDatasetLabels.java) | +| Get Job | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetJob.java) | +| Get Model | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetModel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetModel.java) | +| Get Routine | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetRoutine.java) | +| Get Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetTable.java) | +| Get Table Labels | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetTableLabels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetTableLabels.java) | +| Get View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GetView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GetView.java) | +| Grant View Access | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java) | +| Inserting Data Types | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java) | +| Label Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LabelDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LabelDataset.java) | +| Label Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LabelTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LabelTable.java) | +| List Datasets | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListDatasets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListDatasets.java) | +| List Datasets By Label | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListDatasetsByLabel.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListDatasetsByLabel.java) | +| List Jobs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListJobs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListJobs.java) | +| List Models | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListModels.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListModels.java) | +| List Routines | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListRoutines.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListRoutines.java) | +| List Tables | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ListTables.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ListTables.java) | +| Load Avro From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcs.java) | +| Load Avro From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadAvroFromGcsTruncate.java) | +| Load Csv From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcs.java) | +| Load Csv From Gcs Autodetect | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsAutodetect.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsAutodetect.java) | +| Load Csv From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadCsvFromGcsTruncate.java) | +| Load Json From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcs.java) | +| Load Json From Gcs Autodetect | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsAutodetect.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsAutodetect.java) | +| Load Json From Gcs Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | +| Load Json From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | +| Load Local File | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | +| Load Orc From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | +| Load Orc From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | +| Load Parquet | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | +| Load Parquet Replace Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadParquetReplaceTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadParquetReplaceTable.java) | +| Load Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | +| Load Table Clustered | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | +| Nested Repeated Schema | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | +| Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/Query.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/Query.java) | +| Query Batch | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | +| Query Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | +| Query Destination Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | +| Query Disable Cache | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryDisableCache.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDisableCache.java) | +| Query Dry Run | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryDryRun.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDryRun.java) | +| Query External Bigtable Perm | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java) | +| Query External Bigtable Temp | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java) | +| Query External Gcs Perm | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsPerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsPerm.java) | +| Query External Gcs Temp | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalGcsTemp.java) | +| Query External Sheets Perm | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsPerm.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsPerm.java) | +| Query External Sheets Temp | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsTemp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalSheetsTemp.java) | +| Query External Table Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryExternalTableAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryExternalTableAws.java) | +| Query Large Results | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryLargeResults.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryLargeResults.java) | +| Query Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryMaterializedView.java) | +| Query Pagination | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | +| Query Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | +| Query Script | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | +| Query Total Rows | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | +| Query With Array Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | +| Query With Named Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | +| Query With Named Types Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | +| Query With Positional Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalParameters.java) | +| Query With Positional Types Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalTypesParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithPositionalTypesParameters.java) | +| Query With Structs Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java) | +| Query With Timestamp Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java) | +| Quickstart Sample | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QuickstartSample.java) | +| Relax Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/RelaxColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxColumnLoadAppend.java) | +| Relax Column Mode | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/RelaxColumnMode.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxColumnMode.java) | +| Relax Table Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/RelaxTableQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RelaxTableQuery.java) | +| Resource Clean Up | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | +| Run Legacy Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | +| Save Query To Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | +| Simple App | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | +| Simple Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | +| Table Exists | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | +| Table Insert Rows | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | +| Table Insert Rows Without Row Ids | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | +| Undelete Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UndeleteTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UndeleteTable.java) | +| Update Dataset Access | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetAccess.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetAccess.java) | +| Update Dataset Description | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetDescription.java) | +| Update Dataset Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | +| Update Dataset Partition Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | +| Update Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | +| Update Model Description | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | +| Update Routine | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | +| Update Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | +| Update Table Description | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableDescription.java) | +| Update Table Dml | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableDml.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableDml.java) | +| Update Table Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableExpiration.java) | +| Update Table Require Partition Filter | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableRequirePartitionFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableRequirePartitionFilter.java) | +| Update View Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateViewQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateViewQuery.java) | @@ -350,10 +350,10 @@ Java is a registered trademark of Oracle and/or its affiliates. [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-sdk]: https://cloud.google.com/sdk/ -[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-bigquery/blob/master/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-bigquery/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-bigquery/blob/master/LICENSE +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-bigquery/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-bigquery/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-bigquery/blob/main/LICENSE [enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquery.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM From 70218db884dc876f9dc80a4130a384c23644bfe2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Sep 2021 14:44:31 +0000 Subject: [PATCH 0415/2268] chore: release 2.1.13 (#1624) :robot: I have created a release \*beep\* \*boop\* --- ### [2.1.13](https://www.github.com/googleapis/java-bigquery/compare/v2.1.12...v2.1.13) (2021-09-29) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.1.6 ([#1621](https://www.github.com/googleapis/java-bigquery/issues/1621)) ([dfa15e5](https://www.github.com/googleapis/java-bigquery/commit/dfa15e5ca08a3227f015a389c4c08732178a73e7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982359490a..c8507d308d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.1.13](https://www.github.com/googleapis/java-bigquery/compare/v2.1.12...v2.1.13) (2021-09-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.1.6 ([#1621](https://www.github.com/googleapis/java-bigquery/issues/1621)) ([dfa15e5](https://www.github.com/googleapis/java-bigquery/commit/dfa15e5ca08a3227f015a389c4c08732178a73e7)) + ### [2.1.12](https://www.github.com/googleapis/java-bigquery/compare/v2.1.11...v2.1.12) (2021-09-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e924c2a93e..414b622825 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.13-SNAPSHOT + 2.1.13 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ae351e1853..5a05701f2f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.13-SNAPSHOT + 2.1.13 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.13-SNAPSHOT + 2.1.13 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c1b038073f..4d28453688 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.13-SNAPSHOT + 2.1.13 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.13-SNAPSHOT + 2.1.13 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d4a2ca50df..8f574ae87a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.13-SNAPSHOT + 2.1.13 diff --git a/versions.txt b/versions.txt index e297625bf1..1646b28f87 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.12:2.1.13-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.1.13:2.1.13 \ No newline at end of file From db37f8bf4684b27e800833ac5914eabd9271870a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Sep 2021 14:56:12 +0000 Subject: [PATCH 0416/2268] chore: release 2.1.14-SNAPSHOT (#1626) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 414b622825..5f7f822bc5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.13 + 2.1.14-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5a05701f2f..345ffbfaf2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.13 + 2.1.14-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.13 + 2.1.14-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4d28453688..b3fa536fd7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.13 + 2.1.14-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.13 + 2.1.14-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8f574ae87a..dc7e16a70f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.13 + 2.1.14-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1646b28f87..51d5180d66 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.13:2.1.13 \ No newline at end of file +google-cloud-bigquery:2.1.13:2.1.14-SNAPSHOT \ No newline at end of file From 0a6738191dd73d304edd52391be8c947fee7fb08 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 29 Sep 2021 19:48:23 +0200 Subject: [PATCH 0417/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.1.13 (#1627) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7145c55743..367196a0d5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.12 + 2.1.13 From 6bdbc2d62eb5937cfd8a373bf8180ef8b0428a82 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 30 Sep 2021 21:22:22 +0200 Subject: [PATCH 0418/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v23.1.0 (#1629) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 06629d9976..7ddea439d8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 23.0.0 + 23.1.0 pom import From 10c1961f53ab6ba1b71ead9c51a369bf14389c49 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 1 Oct 2021 14:30:55 -0400 Subject: [PATCH 0419/2268] feat: add support for AvroOptions (#1630) New AvroOptions class and wired into ExternalTableDefinition --- .../clirr-ignored-differences.xml | 10 ++ .../google/cloud/bigquery/AvroOptions.java | 112 ++++++++++++++++++ .../bigquery/ExternalTableDefinition.java | 9 ++ .../google/cloud/bigquery/FormatOptions.java | 6 +- .../cloud/bigquery/AvroOptionsTest.java | 56 +++++++++ .../bigquery/ExternalTableDefinitionTest.java | 5 + .../bigquery/LoadJobConfigurationTest.java | 4 +- 7 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 google-cloud-bigquery/clirr-ignored-differences.xml create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AvroOptions.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml new file mode 100644 index 0000000000..5dba6ab7a7 --- /dev/null +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -0,0 +1,10 @@ + + + + + 7006 + com/google/cloud/bigquery/FormatOptions + com.google.cloud.bigquery.FormatOptions avro() + com.google.cloud.bigquery.AvroOptions + + diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AvroOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AvroOptions.java new file mode 100644 index 0000000000..dd5964f2db --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AvroOptions.java @@ -0,0 +1,112 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.common.base.MoreObjects; +import java.util.Objects; + +/** + * Google BigQuery options for AVRO format. This class wraps some properties of AVRO files used by + * BigQuery to parse external data. + */ +public final class AvroOptions extends FormatOptions { + + private static final long serialVersionUID = 2293570529308612712L; + + private final Boolean useAvroLogicalTypes; + + public static final class Builder { + + private Boolean useAvroLogicalTypes; + + private Builder() {} + + private Builder(AvroOptions avroOptions) { + this.useAvroLogicalTypes = avroOptions.useAvroLogicalTypes; + } + + /** + * [Optional] Sets whether BigQuery should interpret logical types as the corresponding BigQuery + * data type (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER). + */ + public Builder setUseAvroLogicalTypes(boolean useAvroLogicalTypes) { + this.useAvroLogicalTypes = useAvroLogicalTypes; + return this; + } + + /** Creates a {@code AvroOptions} object. */ + public AvroOptions build() { + return new AvroOptions(this); + } + } + + private AvroOptions(Builder builder) { + super(FormatOptions.AVRO); + this.useAvroLogicalTypes = builder.useAvroLogicalTypes; + } + + /** + * Returns whether BigQuery should interpret logical types as the corresponding BigQuery data type + * (for example, TIMESTAMP), instead of using the raw type (for example, INTEGER). + */ + public Boolean useAvroLogicalTypes() { + return useAvroLogicalTypes; + } + + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("type", getType()) + .add("useAvroLogicalTypes", useAvroLogicalTypes) + .toString(); + } + + @Override + public int hashCode() { + return Objects.hash(getType(), useAvroLogicalTypes); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj instanceof AvroOptions && Objects.equals(toPb(), ((AvroOptions) obj).toPb()); + } + + com.google.api.services.bigquery.model.AvroOptions toPb() { + com.google.api.services.bigquery.model.AvroOptions avroOptions = + new com.google.api.services.bigquery.model.AvroOptions(); + avroOptions.setUseAvroLogicalTypes(useAvroLogicalTypes); + return avroOptions; + } + + /** Returns a builder for a AvroOptions object. */ + public static AvroOptions.Builder newBuilder() { + return new AvroOptions.Builder(); + } + + static AvroOptions fromPb(com.google.api.services.bigquery.model.AvroOptions avroOptions) { + Builder builder = newBuilder(); + if (avroOptions.getUseAvroLogicalTypes() != null) { + builder.setUseAvroLogicalTypes(avroOptions.getUseAvroLogicalTypes()); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 2b68a7ff22..6ca64a8d78 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -300,6 +300,9 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getDecimalTargetTypes() != null) { externalConfigurationPb.setDecimalTargetTypes(getDecimalTargetTypes()); } + if (getFormatOptions() != null && FormatOptions.AVRO.equals(getFormatOptions().getType())) { + externalConfigurationPb.setAvroOptions(((AvroOptions) getFormatOptions()).toPb()); + } if (getFormatOptions() != null && FormatOptions.CSV.equals(getFormatOptions().getType())) { externalConfigurationPb.setCsvOptions(((CsvOptions) getFormatOptions()).toPb()); } @@ -459,6 +462,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { builder.setConnectionId(externalDataConfiguration.getConnectionId()); } builder.setIgnoreUnknownValues(externalDataConfiguration.getIgnoreUnknownValues()); + if (externalDataConfiguration.getAvroOptions() != null) { + builder.setFormatOptions(AvroOptions.fromPb(externalDataConfiguration.getAvroOptions())); + } if (externalDataConfiguration.getCsvOptions() != null) { builder.setFormatOptions(CsvOptions.fromPb(externalDataConfiguration.getCsvOptions())); } @@ -508,6 +514,9 @@ static ExternalTableDefinition fromExternalDataConfiguration( if (externalDataConfiguration.getIgnoreUnknownValues() != null) { builder.setIgnoreUnknownValues(externalDataConfiguration.getIgnoreUnknownValues()); } + if (externalDataConfiguration.getAvroOptions() != null) { + builder.setFormatOptions(AvroOptions.fromPb(externalDataConfiguration.getAvroOptions())); + } if (externalDataConfiguration.getCsvOptions() != null) { builder.setFormatOptions(CsvOptions.fromPb(externalDataConfiguration.getCsvOptions())); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java index 92a57fc8f0..c4f4111752 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java @@ -91,8 +91,8 @@ public static FormatOptions datastoreBackup() { } /** Default options for AVRO format. */ - public static FormatOptions avro() { - return new FormatOptions(AVRO); + public static AvroOptions avro() { + return AvroOptions.newBuilder().build(); } /** Default options for BIGTABLE format. */ @@ -120,6 +120,8 @@ public static FormatOptions of(String format) { checkArgument(!isNullOrEmpty(format), "Provided format is null or empty"); if (format.equals(CSV)) { return csv(); + } else if (format.equals(AVRO)) { + return avro(); } else if (format.equals(DATASTORE_BACKUP)) { return datastoreBackup(); } else if (format.equals(GOOGLE_SHEETS)) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java new file mode 100644 index 0000000000..f40660fd7b --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class AvroOptionsTest { + + private static final Boolean USE_AVRO_LOGICAL_TYPES = true; + private static final AvroOptions AVRO_OPTIONS = + AvroOptions.newBuilder().setUseAvroLogicalTypes(USE_AVRO_LOGICAL_TYPES).build(); + + @Test + public void testToBuilder() { + compareAvroOptions(AVRO_OPTIONS, AVRO_OPTIONS.toBuilder().build()); + AvroOptions avroOptions = AVRO_OPTIONS.toBuilder().setUseAvroLogicalTypes(false).build(); + assertEquals(false, avroOptions.useAvroLogicalTypes()); + avroOptions = avroOptions.toBuilder().setUseAvroLogicalTypes(true).build(); + compareAvroOptions(AVRO_OPTIONS, avroOptions); + } + + @Test + public void testBuilder() { + assertEquals(FormatOptions.AVRO, AVRO_OPTIONS.getType()); + assertEquals(USE_AVRO_LOGICAL_TYPES, AVRO_OPTIONS.useAvroLogicalTypes()); + } + + @Test + public void testToAndFromPb() { + compareAvroOptions(AVRO_OPTIONS, AvroOptions.fromPb(AVRO_OPTIONS.toPb())); + AvroOptions avroOptions = + AvroOptions.newBuilder().setUseAvroLogicalTypes(USE_AVRO_LOGICAL_TYPES).build(); + compareAvroOptions(avroOptions, AvroOptions.fromPb(avroOptions.toPb())); + } + + private void compareAvroOptions(AvroOptions expected, AvroOptions value) { + assertEquals(expected, value); + assertEquals(expected.useAvroLogicalTypes(), value.useAvroLogicalTypes()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 38dcd27142..b7b9531e55 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -50,6 +50,7 @@ public class ExternalTableDefinitionTest { private static final String COMPRESSION = "GZIP"; private static final String CONNECTION_ID = "123456789"; private static final Boolean AUTODETECT = true; + private static final AvroOptions AVRO_OPTIONS = AvroOptions.newBuilder().build(); private static final CsvOptions CSV_OPTIONS = CsvOptions.newBuilder().build(); private static final HivePartitioningOptions HIVE_PARTITIONING_OPTIONS = HivePartitioningOptions.newBuilder() @@ -67,6 +68,9 @@ public class ExternalTableDefinitionTest { .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) .build(); + private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = + ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, AVRO_OPTIONS).build(); + @Test public void testToBuilder() { compareExternalTableDefinition( @@ -109,6 +113,7 @@ public void testBuilder() { assertEquals(TableDefinition.Type.EXTERNAL, EXTERNAL_TABLE_DEFINITION.getType()); assertEquals(COMPRESSION, EXTERNAL_TABLE_DEFINITION.getCompression()); assertEquals(CONNECTION_ID, EXTERNAL_TABLE_DEFINITION.getConnectionId()); + assertEquals(AVRO_OPTIONS, EXTERNAL_TABLE_DEFINITION_AVRO.getFormatOptions()); assertEquals(CSV_OPTIONS, EXTERNAL_TABLE_DEFINITION.getFormatOptions()); assertEquals(IGNORE_UNKNOWN_VALUES, EXTERNAL_TABLE_DEFINITION.ignoreUnknownValues()); assertEquals(MAX_BAD_RECORDS, EXTERNAL_TABLE_DEFINITION.getMaxBadRecords()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index a2f164f8af..deed2f11b4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -56,7 +56,7 @@ public class LoadJobConfigurationTest { ImmutableList.of(SchemaUpdateOption.ALLOW_FIELD_ADDITION); private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA); private static final Boolean AUTODETECT = true; - private static final Boolean USERAVROLOGICALTYPES = true; + private static final Boolean USE_AVRO_LOGICAL_TYPES = true; private static final EncryptionConfiguration JOB_ENCRYPTION_CONFIGURATION = EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); private static final TimePartitioning TIME_PARTITIONING = TimePartitioning.of(Type.DAY); @@ -128,7 +128,7 @@ public class LoadJobConfigurationTest { .setDestinationEncryptionConfiguration(JOB_ENCRYPTION_CONFIGURATION) .setTimePartitioning(TIME_PARTITIONING) .setClustering(CLUSTERING) - .setUseAvroLogicalTypes(USERAVROLOGICALTYPES) + .setUseAvroLogicalTypes(USE_AVRO_LOGICAL_TYPES) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) .setRangePartitioning(RANGE_PARTITIONING) From 5dc972cef61f9d49ebe15eb4bc36a91cbe3a6280 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Oct 2021 19:46:32 +0000 Subject: [PATCH 0420/2268] chore: release 2.2.0 (#1631) :robot: I have created a release \*beep\* \*boop\* --- ## [2.2.0](https://www.github.com/googleapis/java-bigquery/compare/v2.1.13...v2.2.0) (2021-10-01) ### Features * add support for AvroOptions ([#1630](https://www.github.com/googleapis/java-bigquery/issues/1630)) ([10c1961](https://www.github.com/googleapis/java-bigquery/commit/10c1961f53ab6ba1b71ead9c51a369bf14389c49)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8507d308d..30c39f5ecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.0](https://www.github.com/googleapis/java-bigquery/compare/v2.1.13...v2.2.0) (2021-10-01) + + +### Features + +* add support for AvroOptions ([#1630](https://www.github.com/googleapis/java-bigquery/issues/1630)) ([10c1961](https://www.github.com/googleapis/java-bigquery/commit/10c1961f53ab6ba1b71ead9c51a369bf14389c49)) + ### [2.1.13](https://www.github.com/googleapis/java-bigquery/compare/v2.1.12...v2.1.13) (2021-09-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5f7f822bc5..56645dd933 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.1.14-SNAPSHOT + 2.2.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 345ffbfaf2..b88bb19a57 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.1.14-SNAPSHOT + 2.2.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.1.14-SNAPSHOT + 2.2.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b3fa536fd7..b46a240f80 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.1.14-SNAPSHOT + 2.2.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.1.14-SNAPSHOT + 2.2.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dc7e16a70f..b43dea32e0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.1.14-SNAPSHOT + 2.2.0 diff --git a/versions.txt b/versions.txt index 51d5180d66..bc8d5d4cce 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.1.13:2.1.14-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.2.0:2.2.0 \ No newline at end of file From 6736735d8c5f05575ac611485011b701d7d12728 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 4 Oct 2021 16:04:36 +0200 Subject: [PATCH 0421/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.2.0 (#1633) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 367196a0d5..11b3f28c8e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.1.13 + 2.2.0 From a929e9212398098ea07e909a16b33b6bd85ad2dd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 10:18:21 -0400 Subject: [PATCH 0422/2268] chore: release 2.2.1-SNAPSHOT (#1632) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: release 2.2.1-SNAPSHOT * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- benchmark/pom.xml | 2 +- google-cloud-bigquery/clirr-ignored-differences.xml | 10 ---------- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 google-cloud-bigquery/clirr-ignored-differences.xml diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 56645dd933..86bd33d788 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.2.0 + 2.2.1-SNAPSHOT diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml deleted file mode 100644 index 5dba6ab7a7..0000000000 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - 7006 - com/google/cloud/bigquery/FormatOptions - com.google.cloud.bigquery.FormatOptions avro() - com.google.cloud.bigquery.AvroOptions - - diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b88bb19a57..93f9cbc691 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.2.0 + 2.2.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.2.0 + 2.2.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b46a240f80..eb5f19d6e0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.2.0 + 2.2.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.2.0 + 2.2.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b43dea32e0..89c35a1558 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.2.0 + 2.2.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index bc8d5d4cce..29d25a9bf4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.2.0:2.2.0 \ No newline at end of file +google-cloud-bigquery:2.2.0:2.2.1-SNAPSHOT \ No newline at end of file From 13f45230a6f8ef888a6afafc02a270fb012e962f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 5 Oct 2021 17:15:00 +0200 Subject: [PATCH 0423/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20210927-1.32.1 (#1634) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb5f19d6e0..01771bb47f 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210910-1.32.1 + v2-rev20210927-1.32.1 2.3.0 From abb64dccd569632c2de5cc20b3f8d34642dab98f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 5 Oct 2021 20:36:02 +0200 Subject: [PATCH 0424/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.7 (#1635) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 01771bb47f..bc201f016f 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.6 + 2.1.7 test From 2527c8242eaf4100e1009fecd4a3d4635351686f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 18:48:12 +0000 Subject: [PATCH 0425/2268] chore: release 2.2.1 (#1636) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.1](https://www.github.com/googleapis/java-bigquery/compare/v2.2.0...v2.2.1) (2021-10-05) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20210927-1.32.1 ([#1634](https://www.github.com/googleapis/java-bigquery/issues/1634)) ([13f4523](https://www.github.com/googleapis/java-bigquery/commit/13f45230a6f8ef888a6afafc02a270fb012e962f)) * update dependency com.google.cloud:google-cloud-storage to v2.1.7 ([#1635](https://www.github.com/googleapis/java-bigquery/issues/1635)) ([abb64dc](https://www.github.com/googleapis/java-bigquery/commit/abb64dccd569632c2de5cc20b3f8d34642dab98f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c39f5ecc..ecd216e7eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.2.1](https://www.github.com/googleapis/java-bigquery/compare/v2.2.0...v2.2.1) (2021-10-05) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20210927-1.32.1 ([#1634](https://www.github.com/googleapis/java-bigquery/issues/1634)) ([13f4523](https://www.github.com/googleapis/java-bigquery/commit/13f45230a6f8ef888a6afafc02a270fb012e962f)) +* update dependency com.google.cloud:google-cloud-storage to v2.1.7 ([#1635](https://www.github.com/googleapis/java-bigquery/issues/1635)) ([abb64dc](https://www.github.com/googleapis/java-bigquery/commit/abb64dccd569632c2de5cc20b3f8d34642dab98f)) + ## [2.2.0](https://www.github.com/googleapis/java-bigquery/compare/v2.1.13...v2.2.0) (2021-10-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 86bd33d788..d422b31e59 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.2.1-SNAPSHOT + 2.2.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 93f9cbc691..4fb48f52fe 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.2.1-SNAPSHOT + 2.2.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.2.1-SNAPSHOT + 2.2.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bc201f016f..3a6e003ac4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.2.1-SNAPSHOT + 2.2.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.2.1-SNAPSHOT + 2.2.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 89c35a1558..47a935ce51 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.2.1-SNAPSHOT + 2.2.1 diff --git a/versions.txt b/versions.txt index 29d25a9bf4..dbb1468248 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.2.0:2.2.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.2.1:2.2.1 \ No newline at end of file From 4b990c40007a26143a61a89a865c49428066959d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 6 Oct 2021 00:11:04 +0200 Subject: [PATCH 0426/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.2.1 (#1638) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 11b3f28c8e..a528afdc36 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.2.0 + 2.2.1 From efb733e12a72ae22f9be43ff17e6fc760e8c4ba7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 6 Oct 2021 07:06:34 +0200 Subject: [PATCH 0427/2268] test(deps): update datacatalog dependencies to v1.5.8 (#1640) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3a6e003ac4..b0af752e87 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.7 + 1.5.8 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.7 + 1.5.8 test From 99e0ab22fa2019b9559a3a8de8e8dd8c5b7cce74 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 6 Oct 2021 16:59:58 +0200 Subject: [PATCH 0428/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.4 (#1639) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a528afdc36..de968e4341 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.3 + 2.1.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 47a935ce51..df91e80205 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.3 + 2.1.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7ddea439d8..f0666a60ce 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.3 + 2.1.4 test From d7005778ed9ae9fd2ba84ba48eb613c6c59cdd1b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 6 Oct 2021 15:14:15 +0000 Subject: [PATCH 0429/2268] chore: release 2.2.2-SNAPSHOT (#1637) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d422b31e59..451a55ec0b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4fb48f52fe..2032c657c0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.2.1 + 2.2.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.2.1 + 2.2.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b0af752e87..5ba2e76645 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.2.1 + 2.2.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index df91e80205..4d338439b6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.2.1 + 2.2.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index dbb1468248..6064c38c22 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.2.1:2.2.1 \ No newline at end of file +google-cloud-bigquery:2.2.1:2.2.2-SNAPSHOT \ No newline at end of file From 2b942da269742b21feae6e00a20f96b9967d678d Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 7 Oct 2021 10:51:03 -0700 Subject: [PATCH 0430/2268] chore: update repo-metadata.json client_documentation link (#1641) * chore: updating doc link * chore: fix missing comma --- .repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index cc60147c9d..1305be96ff 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "bigquery", "name_pretty": "Cloud BigQuery", "product_documentation": "https://cloud.google.com/bigquery", - "client_documentation": "https://googleapis.dev/java/google-cloud-bigquery/latest", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history", "api_description": "is a fully managed, NoOps, low cost data analytics service.\nData can be streamed into BigQuery at millions of rows per second to enable real-time analysis.\nWith BigQuery you can easily deploy Petabyte-scale Databases.", "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", "release_level": "ga", From 96bba389b43ead98f84d644b4cf788669c032dc3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Oct 2021 20:44:20 +0200 Subject: [PATCH 0431/2268] test(deps): update dependency org.mockito:mockito-core to v4 (#1642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `2.28.2` -> `4.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/compatibility-slim/2.28.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/confidence-slim/2.28.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.0.0`](https://togithub.com/mockito/mockito/releases/v4.0.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.4...v4.0.0) ### Mockito 4: Removing deprecated APIs. All of these APIs have been marked as deprecated and have been present in Mockito for quite a while. An overview of now-deleted classes/methods: - `org.mockito.Matchers` which was an alias for `org.mockito.ArgumentMatchers` - `org.mockito.ArgumentMatchers#{anyObject,anyVararg}` both which were aliases for `org.mockito.ArgumentMatchers#any` - `org.mockito.ArgumentMatchers#any*Of`, which were aliases for the same method name without the Of and the generic parameters (which were ignored) - `org.mockito.ArgumentMatchers#{is}{Not}Null(Class)` which took a class which was ignored. Aliases for the same methods without the parameter - `org.mockito.MockedStatic#verify` which had the parameter types reversed - `org.mockito.Mockito#verifyZeroInteractions` an alias of `verifyNoMoreInteractions` - `org.mockito.Mockito#debug` framework integration API that we later refactored - `org.mockito.configuration.AnnotationEngine` which was leaking internal APIs and instead users should use `org.mockito.plugins.AnnotationEngine` - `org.mockito.exceptions.verification.TooLittleActualInvocations` fixed the grammar from "Little" to "Few" - Numerous internal APIs that we never officially supported and can now remove - `org.mockito.plugins.InstantiatorProvider` which was leaking internal APIs and instead users should use InstantiatorProvider2 (we should probably rename back to remove the number in a future major release) - `org.mockito.runners` a package that hosted several old JUnit runners which were no longer supported. Users should instead use `org.mockito.junit.MockitoJUnitRunner` which is our official JUnit4 runner. ### [`v3.12.4`](https://togithub.com/mockito/mockito/releases/v3.12.4) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.3...v3.12.4) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.12.4 - 2021-08-25 - [1 commit(s)](https://togithub.com/mockito/mockito/compare/v3.12.3...v3.12.4) by Rafael Winterhalter - No notable improvements. No pull requests (issues) were referenced from commits. ### [`v3.12.3`](https://togithub.com/mockito/mockito/releases/v3.12.3) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.2...v3.12.3) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.12.3 - 2021-08-24 - [9 commit(s)](https://togithub.com/mockito/mockito/compare/v3.12.2...v3.12.3) by Rafael Winterhalter - Fix implementation of proxy mock maker for toString and add additional unit tests. [(#​2405)](https://togithub.com/mockito/mockito/pull/2405) - Avoid cache breakage [(#​2402)](https://togithub.com/mockito/mockito/pull/2402) - Add a limited mock maker that is based only on the java.lang.reflect.Proxy utility [(#​2397)](https://togithub.com/mockito/mockito/pull/2397) ### [`v3.12.2`](https://togithub.com/mockito/mockito/releases/v3.12.2) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.1...v3.12.2) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.12.2 - 2021-08-24 - [2 commit(s)](https://togithub.com/mockito/mockito/compare/v3.12.1...v3.12.2) by Dmitry Vyazelenko, dependabot\[bot] - Fixes [#​2399](https://togithub.com/mockito/mockito/issues/2399) : Adds defaultAnswer to the MockitoMockKey to distinguish the mock types, i.e. to separate mocks from spies otherwise spy type is reused for a mock or vice versa. [(#​2400)](https://togithub.com/mockito/mockito/pull/2400) - Sporadic mock verification failures related to hashCode/equals on 3.12.1 [(#​2399)](https://togithub.com/mockito/mockito/issues/2399) - Bump versions.errorprone from 2.8.1 to 2.9.0 [(#​2396)](https://togithub.com/mockito/mockito/pull/2396) ### [`v3.12.1`](https://togithub.com/mockito/mockito/releases/v3.12.1) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.0...v3.12.1) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.12.1 - 2021-08-20 - [2 commit(s)](https://togithub.com/mockito/mockito/compare/v3.12.0...v3.12.1) by Tim van der Lippe, dependabot\[bot] - Fix verifyNoMoreInteractions inOrder invocations for spies [(#​2395)](https://togithub.com/mockito/mockito/pull/2395) - Regression with InOrder verification after [#​2369](https://togithub.com/mockito/mockito/issues/2369) [(#​2394)](https://togithub.com/mockito/mockito/issues/2394) - Bump versions.bytebuddy from 1.11.12 to 1.11.13 [(#​2393)](https://togithub.com/mockito/mockito/pull/2393) ### [`v3.12.0`](https://togithub.com/mockito/mockito/releases/v3.12.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.11.2...v3.12.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.12.0 - 2021-08-19 - [31 commit(s)](https://togithub.com/mockito/mockito/compare/v3.11.2...v3.12.0) by EugeneLesnov, Lars Vogel, Logan Rosen, Rafael Winterhalter, Rob Pridham, Tim van der Lippe, dependabot\[bot], saurabh7248 - Add checks for sealed types [(#​2392)](https://togithub.com/mockito/mockito/pull/2392) - Bump versions.bytebuddy from 1.11.10 to 1.11.12 [(#​2388)](https://togithub.com/mockito/mockito/pull/2388) - Bump versions.bytebuddy from 1.11.9 to 1.11.10 [(#​2387)](https://togithub.com/mockito/mockito/pull/2387) - Bump versions.errorprone from 2.8.0 to 2.8.1 [(#​2386)](https://togithub.com/mockito/mockito/pull/2386) - Update StaticMockTest to use unified verify method [(#​2385)](https://togithub.com/mockito/mockito/pull/2385) - Reorder InjectMock Javadoc to fit the order of injection [(#​2383)](https://togithub.com/mockito/mockito/pull/2383) - Bump core-ktx from 1.5.0 to 1.6.0 [(#​2382)](https://togithub.com/mockito/mockito/pull/2382) - Bump google-java-format from 1.10.0 to 1.11.0 [(#​2381)](https://togithub.com/mockito/mockito/pull/2381) - Downgrade Android gradle plugin [(#​2380)](https://togithub.com/mockito/mockito/pull/2380) - Applied [@​CheckReturnValue](https://togithub.com/CheckReturnValue) to some classes [(#​2379)](https://togithub.com/mockito/mockito/pull/2379) - how to solve gradle sync failed after 'Add basic Android instrumented and unit tests' [(#​2378)](https://togithub.com/mockito/mockito/issues/2378) - Bump junit from 1.1.2 to 1.1.3 [(#​2377)](https://togithub.com/mockito/mockito/pull/2377) - Bump appcompat from 1.3.0 to 1.3.1 [(#​2376)](https://togithub.com/mockito/mockito/pull/2376) - Bump kotlin-gradle-plugin from 1.5.20 to 1.5.21 [(#​2374)](https://togithub.com/mockito/mockito/pull/2374) - Bump material from 1.3.0 to 1.4.0 [(#​2373)](https://togithub.com/mockito/mockito/pull/2373) - Bump espresso-core from 3.3.0 to 3.4.0 [(#​2372)](https://togithub.com/mockito/mockito/pull/2372) - Fixes [#​2331](https://togithub.com/mockito/mockito/issues/2331) [(#​2369)](https://togithub.com/mockito/mockito/pull/2369) - Fix typo in exception [(#​2368)](https://togithub.com/mockito/mockito/pull/2368) - Bump versions.bytebuddy from 1.11.8 to 1.11.9 [(#​2367)](https://togithub.com/mockito/mockito/pull/2367) - Bump versions.errorprone from 2.7.1 to 2.8.0 [(#​2365)](https://togithub.com/mockito/mockito/pull/2365) - Bump versions.bytebuddy from 1.11.7 to 1.11.8 [(#​2361)](https://togithub.com/mockito/mockito/pull/2361) - Basic Android instrumented and unit tests (closes [#​2341](https://togithub.com/mockito/mockito/issues/2341)) [(#​2360)](https://togithub.com/mockito/mockito/pull/2360) - Bump versions.bytebuddy from 1.11.6 to 1.11.7 [(#​2359)](https://togithub.com/mockito/mockito/pull/2359) - Bump kotlin-stdlib from 1.5.20 to 1.5.21 [(#​2356)](https://togithub.com/mockito/mockito/pull/2356) - Bump kotlinx-coroutines-core from 1.5.1 to 1.5.1-native-mt [(#​2354)](https://togithub.com/mockito/mockito/pull/2354) - Bump kotlinx-coroutines-core from 1.5.0-native-mt to 1.5.1 [(#​2353)](https://togithub.com/mockito/mockito/pull/2353) - Bump versions.bytebuddy from 1.11.5 to 1.11.6 [(#​2351)](https://togithub.com/mockito/mockito/pull/2351) - Bump gradle-errorprone-plugin from 2.0.1 to 2.0.2 [(#​2347)](https://togithub.com/mockito/mockito/pull/2347) - Bump kotlin-stdlib from 1.5.10 to 1.5.20 [(#​2343)](https://togithub.com/mockito/mockito/pull/2343) - Bump versions.bytebuddy from 1.11.3 to 1.11.5 [(#​2337)](https://togithub.com/mockito/mockito/pull/2337) - Bump assertj-core from 3.20.1 to 3.20.2 [(#​2336)](https://togithub.com/mockito/mockito/pull/2336) - Spy doesn't forward hashcode/equals to actual object [(#​2331)](https://togithub.com/mockito/mockito/issues/2331) - Fixes [#​2311](https://togithub.com/mockito/mockito/issues/2311) [(#​2320)](https://togithub.com/mockito/mockito/pull/2320) ### [`v3.11.2`](https://togithub.com/mockito/mockito/releases/v3.11.2) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.11.1...v3.11.2) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.11.2 - 2021-06-21 - [5 commit(s)](https://togithub.com/mockito/mockito/compare/v3.11.1...v3.11.2) by dependabot\[bot] - Bump versions.bytebuddy from 1.11.2 to 1.11.3 [(#​2333)](https://togithub.com/mockito/mockito/pull/2333) - Bump assertj-core from 3.20.0 to 3.20.1 [(#​2332)](https://togithub.com/mockito/mockito/pull/2332) - Bump org.eclipse.osgi from 3.16.200 to 3.16.300 [(#​2330)](https://togithub.com/mockito/mockito/pull/2330) - Bump assertj-core from 3.19.0 to 3.20.0 [(#​2329)](https://togithub.com/mockito/mockito/pull/2329) - Bump shipkit-auto-version from 1.1.17 to 1.1.19 [(#​2328)](https://togithub.com/mockito/mockito/pull/2328) ### [`v3.11.1`](https://togithub.com/mockito/mockito/releases/v3.11.1) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.11.0...v3.11.1) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.11.1 - 2021-06-11 - [3 commit(s)](https://togithub.com/mockito/mockito/compare/v3.11.0...v3.11.1) by Charles Munger, dependabot\[bot] - Bump versions.bytebuddy from 1.11.1 to 1.11.2 [(#​2322)](https://togithub.com/mockito/mockito/pull/2322) - Check package-privacy of method params [(#​2318)](https://togithub.com/mockito/mockito/pull/2318) - Bump shipkit-auto-version from 1.1.16 to 1.1.17 [(#​2317)](https://togithub.com/mockito/mockito/pull/2317) ### [`v3.11.0`](https://togithub.com/mockito/mockito/releases/v3.11.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.10.0...v3.11.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.11.0 - 2021-06-03 - [18 commit(s)](https://togithub.com/mockito/mockito/compare/v3.10.0...v3.11.0) by Charles Munger, Szczepan Faber, dependabot\[bot] - Bump versions.bytebuddy from 1.11.0 to 1.11.1 [(#​2313)](https://togithub.com/mockito/mockito/pull/2313) - Undo parent for MultipleParentsClassLoader [(#​2312)](https://togithub.com/mockito/mockito/pull/2312) - Bump shipkit-auto-version from 1.1.14 to 1.1.16 [(#​2310)](https://togithub.com/mockito/mockito/pull/2310) - Bump gradle/wrapper-validation-action from 1.0.3 to 1.0.4 [(#​2309)](https://togithub.com/mockito/mockito/pull/2309) - Bump com.github.ben-manes.versions from 0.38.0 to 0.39.0 [(#​2308)](https://togithub.com/mockito/mockito/pull/2308) - Bump shipkit-auto-version from 1.1.11 to 1.1.14 [(#​2307)](https://togithub.com/mockito/mockito/pull/2307) - Use the parent classloader if the context classloader is a child of it. [(#​2306)](https://togithub.com/mockito/mockito/pull/2306) - Bump kotlin-stdlib from 1.5.0 to 1.5.10 [(#​2305)](https://togithub.com/mockito/mockito/pull/2305) - "The type is not public and its mock class is loaded by a different class loader" with a context classloader that delegates [(#​2303)](https://togithub.com/mockito/mockito/issues/2303) - Enabled automated changelog [(#​2301)](https://togithub.com/mockito/mockito/pull/2301) - Bump kotlinx-coroutines-core from 1.4.3-native-mt to 1.5.0-native-mt [(#​2299)](https://togithub.com/mockito/mockito/pull/2299) - Bump versions.errorprone from 2.6.0 to 2.7.1 [(#​2298)](https://togithub.com/mockito/mockito/pull/2298) - Bump junit-platform-launcher from 1.7.1 to 1.7.2 [(#​2297)](https://togithub.com/mockito/mockito/pull/2297) - Bump versions.junitJupiter from 5.7.1 to 5.7.2 [(#​2296)](https://togithub.com/mockito/mockito/pull/2296) - Renamed main dev branch [(#​2295)](https://togithub.com/mockito/mockito/pull/2295) - Bump gradle/wrapper-validation-action from 1 to 1.0.3 [(#​2294)](https://togithub.com/mockito/mockito/pull/2294) - Bump actions/checkout from 2 to 2.3.4 [(#​2293)](https://togithub.com/mockito/mockito/pull/2293) - 'this' is not available - when enabling mock-maker-inline [(#​2082)](https://togithub.com/mockito/mockito/issues/2082) ### [`v3.10.0`](https://togithub.com/mockito/mockito/releases/v3.10.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.8.0...v3.10.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.10.0 - 2021-05-12 - [0 commit(s)](https://togithub.com/mockito/mockito/compare/HEAD...v3.10.0) by - No notable improvements. No pull requests (issues) were referenced from commits. ### [`v3.8.0`](https://togithub.com/mockito/mockito/releases/v3.8.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.7.7...v3.8.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.8.0 - 2021-02-22 - [1 commit(s)](https://togithub.com/mockito/mockito/compare/v3.7.18...v3.8.0) by Tim van der Lippe - Publish new minor version to Maven central [(#​2213)](https://togithub.com/mockito/mockito/pull/2213) ### [`v3.7.7`](https://togithub.com/mockito/mockito/releases/v3.7.7) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.7.0...v3.7.7) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.7.7 - 2021-01-16 - [1 commit(s)](https://togithub.com/mockito/mockito/compare/v3.7.6...v3.7.7) by Stefan Bohn - Fix reversed order of verify parameters [(#​2179)](https://togithub.com/mockito/mockito/pull/2179) - Feature request: Unify order of parameters [(#​2173)](https://togithub.com/mockito/mockito/issues/2173) ### [`v3.7.0`](https://togithub.com/mockito/mockito/releases/v3.7.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.6.28...v3.7.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.7.0 - 2021-01-04 - [2 commit(s)](https://togithub.com/mockito/mockito/compare/v3.6.54...v3.7.0) by Szczepan Faber, Tim van der Lippe - Publish new minor version to Maven central [(#​2165)](https://togithub.com/mockito/mockito/pull/2165) ### [`v3.6.28`](https://togithub.com/mockito/mockito/releases/v3.6.28) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.6.0...v3.6.28) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 3.6.28 - 2020-11-25 - [1 commit(s)](https://togithub.com/mockito/mockito/compare/v3.6.27...v3.6.28) by Szczepan Faber - No notable improvements. No pull requests (issues) were referenced from commits. ### [`v3.6.0`](https://togithub.com/mockito/mockito/releases/v3.6.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.15...v3.6.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.6.0 - 2020-10-27 - [7 commits](https://togithub.com/mockito/mockito/compare/v3.5.15...v3.6.0) by [Szczepan Faber](https://togithub.com/mockitoguy) (4), [shipkit-org](https://togithub.com/shipkit-org) (2), [Tim van der Lippe](https://togithub.com/TimvdLippe) (1) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.6.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.6.0) - Retry the release [(#​2078)](https://togithub.com/mockito/mockito/pull/2078) - Retry 3.6.0 release [(#​2077)](https://togithub.com/mockito/mockito/pull/2077) ### [`v3.5.15`](https://togithub.com/mockito/mockito/releases/v3.5.15) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.13...v3.5.15) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.15 - 2020-10-19 - [4 commits](https://togithub.com/mockito/mockito/compare/v3.5.14...v3.5.15) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.15-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.15) - Mock resolver plugin [(#​2042)](https://togithub.com/mockito/mockito/pull/2042) ### [`v3.5.13`](https://togithub.com/mockito/mockito/releases/v3.5.13) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.11...v3.5.13) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.13 - 2020-09-24 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.5.12...v3.5.13) by [Sinan Kozak](https://togithub.com/kozaxinan) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.13-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.13) - Use single version for strictly in mockito-android [(#​2053)](https://togithub.com/mockito/mockito/pull/2053) ### [`v3.5.11`](https://togithub.com/mockito/mockito/releases/v3.5.11) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.10...v3.5.11) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.11 - 2020-09-17 - [2 commits](https://togithub.com/mockito/mockito/compare/v3.5.10...v3.5.11) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.11-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.11) - Do not exclude synthetic constructors from instrumentation. Fixes [#​2040](https://togithub.com/mockito/mockito/issues/2040). [(#​2046)](https://togithub.com/mockito/mockito/pull/2046) - Mockito.spy(Activity).getBaseContext() returns null on Robolectric 4.4 and Java8 [(#​2040)](https://togithub.com/mockito/mockito/issues/2040) ### [`v3.5.10`](https://togithub.com/mockito/mockito/releases/v3.5.10) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.9...v3.5.10) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.10 - 2020-09-03 - [2 commits](https://togithub.com/mockito/mockito/compare/v3.5.9...v3.5.10) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.10-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.10) - Escape mock during method dispatch on mock to avoid premature garbage collection. [(#​2034)](https://togithub.com/mockito/mockito/pull/2034) - Exception "The mock object was garbage collected." [(#​1802)](https://togithub.com/mockito/mockito/issues/1802) ### [`v3.5.9`](https://togithub.com/mockito/mockito/releases/v3.5.9) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.7...v3.5.9) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.9 - 2020-09-01 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.5.8...v3.5.9) by [Sinan Kozak](https://togithub.com/kozaxinan) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.9-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.9) - Fixes [#​2007](https://togithub.com/mockito/mockito/issues/2007) : Downgrade objenesis version for mockito-android [(#​2024)](https://togithub.com/mockito/mockito/pull/2024) - Android instrumentation test packaging fails for mockito-android 3.5.0 with minSdk < 26 [(#​2007)](https://togithub.com/mockito/mockito/issues/2007) ### [`v3.5.7`](https://togithub.com/mockito/mockito/releases/v3.5.7) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.6...v3.5.7) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.7 - 2020-08-25 - [2 commits](https://togithub.com/mockito/mockito/compare/v3.5.6...v3.5.7) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.7-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.7) - Initializes classes prior to instrumentation to avoid uncontrolled code execution. [(#​2023)](https://togithub.com/mockito/mockito/pull/2023) - Stackoverflow error when upgrading to v3.5.2 [(#​2011)](https://togithub.com/mockito/mockito/issues/2011) ### [`v3.5.6`](https://togithub.com/mockito/mockito/releases/v3.5.6) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.5...v3.5.6) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.6 - 2020-08-24 - [5 commits](https://togithub.com/mockito/mockito/compare/v3.5.5...v3.5.6) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.6-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.6) - Only apply argument on illegal module access for inline tests if Java version is at least 9. [(#​2022)](https://togithub.com/mockito/mockito/pull/2022) - Constructor dispatch [(#​2021)](https://togithub.com/mockito/mockito/pull/2021) ### [`v3.5.5`](https://togithub.com/mockito/mockito/releases/v3.5.5) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.2...v3.5.5) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.5 - 2020-08-22 - [3 commits](https://togithub.com/mockito/mockito/compare/v3.5.4...v3.5.5) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.5-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.5) - Constructor dispatch [(#​2020)](https://togithub.com/mockito/mockito/pull/2020) ### [`v3.5.2`](https://togithub.com/mockito/mockito/releases/v3.5.2) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.5.0...v3.5.2) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.2 - 2020-08-18 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.5.1...v3.5.2) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.2-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.2) - No pull requests referenced in commit messages. ### [`v3.5.0`](https://togithub.com/mockito/mockito/releases/v3.5.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.4.6...v3.5.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.5.0 - 2020-08-15 - [9 commits](https://togithub.com/mockito/mockito/compare/v3.4.8...v3.5.0) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.5.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.5.0) - Pre release 3.5.0 [(#​2004)](https://togithub.com/mockito/mockito/pull/2004) ### [`v3.4.6`](https://togithub.com/mockito/mockito/releases/v3.4.6) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.4.4...v3.4.6) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.4.6 - 2020-07-29 - [3 commits](https://togithub.com/mockito/mockito/compare/v3.4.5...v3.4.6) by [Rafael Winterhalter](https://togithub.com/raphw) (2), [Valery Yatsynovich](https://togithub.com/valfirst) (1) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.4.6-green.svg)](https://bintray.com/mockito/maven/mockito/3.4.6) - \[Bugfixes] Do not pass static mocks to regular listener callback. [(#​1989)](https://togithub.com/mockito/mockito/pull/1989) - MockitoJUnitRunner causes NPE when using [@​Mock](https://togithub.com/Mock) on MockedStatic fields [(#​1988)](https://togithub.com/mockito/mockito/issues/1988) - Fixes [#​1985](https://togithub.com/mockito/mockito/issues/1985) : Update README to refer the latest documentation [(#​1986)](https://togithub.com/mockito/mockito/pull/1986) - README should refer the latest available documentation [(#​1985)](https://togithub.com/mockito/mockito/issues/1985) ### [`v3.4.4`](https://togithub.com/mockito/mockito/releases/v3.4.4) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.4.3...v3.4.4) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.4.4 - 2020-07-18 - [2 commits](https://togithub.com/mockito/mockito/compare/v3.4.3...v3.4.4) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.4.4-green.svg)](https://bintray.com/mockito/maven/mockito/3.4.4) - Fixes [#​1855](https://togithub.com/mockito/mockito/issues/1855) and [#​939](https://togithub.com/mockito/mockito/issues/939): improve error message when the inline mock maker cannot be used. [(#​1974)](https://togithub.com/mockito/mockito/pull/1974) - javax.tools.ToolProvider could not be found in InlineByteBuddyMockMaker [(#​1855)](https://togithub.com/mockito/mockito/issues/1855) ### [`v3.4.3`](https://togithub.com/mockito/mockito/releases/v3.4.3) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.4.2...v3.4.3) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.4.3 - 2020-07-17 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.4.2...v3.4.3) by [Robert Chmielowiec](https://togithub.com/chmielowiec) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.4.3-green.svg)](https://bintray.com/mockito/maven/mockito/3.4.3) - Fix Javadoc invalid syntax [(#​1978)](https://togithub.com/mockito/mockito/pull/1978) - Broken documentation [(#​1977)](https://togithub.com/mockito/mockito/issues/1977) ### [`v3.4.2`](https://togithub.com/mockito/mockito/releases/v3.4.2) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.4.0...v3.4.2) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.4.2 - 2020-07-16 - [2 commits](https://togithub.com/mockito/mockito/compare/v3.4.1...v3.4.2) by [Rafael Winterhalter](https://togithub.com/raphw) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.4.2-green.svg)](https://bintray.com/mockito/maven/mockito/3.4.2) - Fixes [#​1967](https://togithub.com/mockito/mockito/issues/1967): Correctly handle mocks with limited life-cycle in listeners. [(#​1968)](https://togithub.com/mockito/mockito/pull/1968) - Static method mocks incompatible with MockitoExtension (NotAMockException) [(#​1967)](https://togithub.com/mockito/mockito/issues/1967) ### [`v3.4.0`](https://togithub.com/mockito/mockito/releases/v3.4.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.3.3...v3.4.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.4.0 - 2020-07-10 - [19 commits](https://togithub.com/mockito/mockito/compare/v3.3.12...v3.4.0) by 9 authors - published to [![Bintray](https://img.shields.io/badge/Bintray-3.4.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.4.0) - Commits: [Tim van der Lippe](https://togithub.com/TimvdLippe) (5), [Erhard Pointl](https://togithub.com/epeee) (4), [Rafael Winterhalter](https://togithub.com/raphw) (3), [Eitan Adler](https://togithub.com/grimreaper) (2), adrianriley (1), akluball (1), [Artem Prigoda](https://togithub.com/arteam) (1), [Jamie Tanna](https://togithub.com/jamietanna) (1), [Naoki Takezoe](https://togithub.com/takezoe) (1) - \[Android support] Enable mocking static methods in Mockito [(#​1013)](https://togithub.com/mockito/mockito/issues/1013) - Document using `@Mock` with method parameters [(#​1961)](https://togithub.com/mockito/mockito/pull/1961) - Documentation: `@Mock` on method parameters [(#​1960)](https://togithub.com/mockito/mockito/issues/1960) - Update errorprone gradle plugin to v1.2.1 [(#​1958)](https://togithub.com/mockito/mockito/pull/1958) - Update spotless Travis job name to be more descriptive [(#​1957)](https://togithub.com/mockito/mockito/pull/1957) - Fix a confusing typo in subclassing error message [(#​1953)](https://togithub.com/mockito/mockito/pull/1953) - Update bnd gradle plugin to v5.1.1 [(#​1952)](https://togithub.com/mockito/mockito/pull/1952) - Use errorprone 2.4.0 [(#​1951)](https://togithub.com/mockito/mockito/pull/1951) - Use jacoco v0.8.5 [(#​1950)](https://togithub.com/mockito/mockito/pull/1950) - Fixes [#​1712](https://togithub.com/mockito/mockito/issues/1712) : prepend description to AssertionError thrown in verification [(#​1949)](https://togithub.com/mockito/mockito/pull/1949) - Update gradle 6 [(#​1948)](https://togithub.com/mockito/mockito/pull/1948) - Move spotless check to separate build task [(#​1946)](https://togithub.com/mockito/mockito/pull/1946) - \[Travis] Replace JDK 9/10 with 14 [(#​1945)](https://togithub.com/mockito/mockito/pull/1945) - Fixes [#​1898](https://togithub.com/mockito/mockito/issues/1898) : Return mock name from toString method for deep stub mocks [(#​1942)](https://togithub.com/mockito/mockito/pull/1942) - \[checkstyle] switch to new DTD [(#​1940)](https://togithub.com/mockito/mockito/pull/1940) - Use google-java-format in spotless [(#​1934)](https://togithub.com/mockito/mockito/pull/1934) - Update report message to use any() instead of anyObject() [(#​1931)](https://togithub.com/mockito/mockito/pull/1931) - \[build] bump gradle to latest 5.x release [(#​1923)](https://togithub.com/mockito/mockito/pull/1923) - \[build] update gradle-errorprone-plugin to 1.1.0 [(#​1908)](https://togithub.com/mockito/mockito/pull/1908) - RETURNS_DEEP_STUBS override a mock's toString to `null` [(#​1898)](https://togithub.com/mockito/mockito/issues/1898) - "description" not printing when verify args don't match [(#​1712)](https://togithub.com/mockito/mockito/issues/1712) ### [`v3.3.3`](https://togithub.com/mockito/mockito/releases/v3.3.3) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.3.0...v3.3.3) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.3.3 - 2020-03-13 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.3.2...v3.3.3) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.3.3-green.svg)](https://bintray.com/mockito/maven/mockito/3.3.3) - No pull requests referenced in commit messages. ### [`v3.3.0`](https://togithub.com/mockito/mockito/releases/v3.3.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.2.4...v3.3.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.3.0 - 2020-02-21 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.2.11...v3.3.0) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.3.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.3.0) - No pull requests referenced in commit messages. ### [`v3.2.4`](https://togithub.com/mockito/mockito/releases/v3.2.4) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.2.0...v3.2.4) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.2.4 - 2019-12-16 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.2.3...v3.2.4) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.2.4-green.svg)](https://bintray.com/mockito/maven/mockito/3.2.4) - No pull requests referenced in commit messages. ### [`v3.2.0`](https://togithub.com/mockito/mockito/releases/v3.2.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.1.0...v3.2.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.2.0 - 2019-11-29 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.1.13...v3.2.0) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.2.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.2.0) - No pull requests referenced in commit messages. ### [`v3.1.0`](https://togithub.com/mockito/mockito/releases/v3.1.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.0.0...v3.1.0) *Release notes were automatically generated by [Shipkit](http://shipkit.org/)* ##### 3.1.0 - 2019-10-01 - [1 commit](https://togithub.com/mockito/mockito/compare/v3.0.12...v3.1.0) by [Tim van der Lippe](https://togithub.com/TimvdLippe) - published to [![Bintray](https://img.shields.io/badge/Bintray-3.1.0-green.svg)](https://bintray.com/mockito/maven/mockito/3.1.0) - No pull requests referenced in commit messages. ### [`v3.0.0`](https://togithub.com/mockito/mockito/releases/v3.0.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v2.28.2...v3.0.0) Mockito 3.0.0 is equivalent to Mockito 2, but now requires Java 8. No API changes were made.
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ba2e76645..7bd2470da2 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ org.mockito mockito-core - 2.28.2 + 4.0.0 test From e60bdff9e196a618a59a0544ec93f87b2ec5fc82 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 11 Oct 2021 11:22:36 -0400 Subject: [PATCH 0432/2268] fix: fix timestamp rounding issue (#1645) * fix: fix timestamp ronuding issue Fixes #1644 remove unrelated test case update test case * add comment --- .../com/google/cloud/bigquery/FieldValue.java | 6 +++- .../cloud/bigquery/it/ITBigQueryTest.java | 35 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index a2ce187678..aef4728194 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -25,6 +25,7 @@ import com.google.common.io.BaseEncoding; import java.io.Serializable; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.List; import java.util.Map; import java.util.Objects; @@ -183,7 +184,10 @@ public long getTimestampValue() { // timestamps are encoded in the format 1408452095.22 where the integer part is seconds since // epoch (e.g. 1408452095.22 == 2014-08-19 07:41:35.220 -05:00) BigDecimal secondsWithMicro = new BigDecimal(getStringValue()); - BigDecimal scaled = secondsWithMicro.scaleByPowerOfTen(6); + // Rounding the BigDecimal to the nearest whole number before setting the longValue in order to + // address TimeStamp rounding issue described in + // https://github.com/googleapis/java-bigquery/issues/1644 + BigDecimal scaled = secondsWithMicro.scaleByPowerOfTen(6).setScale(0, RoundingMode.HALF_UP); return scaled.longValue(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 484e4c0f55..8ef74458fd 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -127,6 +127,7 @@ import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.FileSystems; +import java.time.Instant; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -1854,6 +1855,40 @@ public void testQuery() throws InterruptedException { assertNotNull(statistics.getQueryPlan()); } + @Test + public void testQueryTimeStamp() throws InterruptedException { + String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; + Instant beforeQueryInstant = Instant.parse("2022-01-24T23:54:25.095574Z"); + long microsBeforeQuery = + TimeUnit.SECONDS.toMicros(beforeQueryInstant.getEpochSecond()) + + TimeUnit.NANOSECONDS.toMicros(beforeQueryInstant.getNano()); + + // Verify that timestamp remains the same when priority is set to INTERACTIVE + TableResult result = + bigquery.query( + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority(QueryJobConfiguration.Priority.INTERACTIVE) + .build()); + for (FieldValueList row : result.getValues()) { + FieldValue timeStampCell = row.get(0); + long microsAfterQuery = timeStampCell.getTimestampValue(); + assertEquals(microsBeforeQuery, microsAfterQuery); + } + + // Verify that timestamp remains the same without priority set to INTERACTIVE + TableResult resultInteractive = + bigquery.query( + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .build()); + for (FieldValueList row : resultInteractive.getValues()) { + FieldValue timeStampCell = row.get(0); + long microsAfterQuery = timeStampCell.getTimestampValue(); + assertEquals(microsBeforeQuery, microsAfterQuery); + } + } + @Test public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); From fa3b477c78b20d4dca4174069c0a45d661aa0dc5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Oct 2021 17:30:22 +0200 Subject: [PATCH 0433/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.1.0 (#1651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.0.3` -> `1.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/compatibility-slim/1.0.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.1.0/confidence-slim/1.0.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.1.0`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​110-httpswwwgithubcomgoogleapisjava-shared-configcomparev103v110-2021-10-12) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.0.3...v1.1.0) ##### Features - introduce Maven configuration for GraalVM testing ([#​314](https://www.togithub.com/googleapis/java-shared-config/issues/314)) ([28fbeb8](https://www.github.com/googleapis/java-shared-config/commit/28fbeb86c4466a58a05d6933584564dbf3352e79)) ##### Bug Fixes - update doclet version ([#​332](https://www.togithub.com/googleapis/java-shared-config/issues/332)) ([3fd0350](https://www.github.com/googleapis/java-shared-config/commit/3fd035030e4f0954dd1f62f7b8ea62583685880c)) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v9.0.1 ([#​327](https://www.togithub.com/googleapis/java-shared-config/issues/327)) ([b6c9b65](https://www.github.com/googleapis/java-shared-config/commit/b6c9b657550db2dee6b36edbb9a6084baee125e2)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.6 ([#​330](https://www.togithub.com/googleapis/java-shared-config/issues/330)) ([271ed7d](https://www.github.com/googleapis/java-shared-config/commit/271ed7dba35623e22fc8a7f7d477e6043e772014)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.6 ([#​331](https://www.togithub.com/googleapis/java-shared-config/issues/331)) ([4f9ba15](https://www.github.com/googleapis/java-shared-config/commit/4f9ba1551df0a2d4fc8c9acca8a951afbe8cb78a)) - update dependency org.junit.vintage:junit-vintage-engine to v5.8.1 ([#​329](https://www.togithub.com/googleapis/java-shared-config/issues/329)) ([4a8789e](https://www.github.com/googleapis/java-shared-config/commit/4a8789ee814ba8a3480beecc76c16fd1cb4e5f12)) ##### [1.0.3](https://www.github.com/googleapis/java-shared-config/compare/v1.0.2...v1.0.3) (2021-09-21) ##### Bug Fixes - update java-docfx-doclet version ([#​315](https://www.togithub.com/googleapis/java-shared-config/issues/315)) ([07af07c](https://www.github.com/googleapis/java-shared-config/commit/07af07c188447ea5728ecd2700121ff477d1c58a)) ##### [1.0.2](https://www.github.com/googleapis/java-shared-config/compare/v1.0.1...v1.0.2) (2021-09-13) ##### Bug Fixes - specify animal-sniffer-maven-plugin version ([#​308](https://www.togithub.com/googleapis/java-shared-config/issues/308)) ([378bf43](https://www.github.com/googleapis/java-shared-config/commit/378bf431383306c1cdd0a4f922956c87edf321b5)) - update java docfx doclet version ([#​312](https://www.togithub.com/googleapis/java-shared-config/issues/312)) ([dd7f6e0](https://www.github.com/googleapis/java-shared-config/commit/dd7f6e0c1a7cc73831b74b4475457611a8c097d3)) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v9 ([#​303](https://www.togithub.com/googleapis/java-shared-config/issues/303)) ([71faea3](https://www.github.com/googleapis/java-shared-config/commit/71faea38d4132407598550e2bb4c77f9d4a4d83d)) ##### [1.0.1](https://www.github.com/googleapis/java-shared-config/compare/v1.0.0...v1.0.1) (2021-08-18) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v8.45.1 ([#​292](https://www.togithub.com/googleapis/java-shared-config/issues/292)) ([66bf6e6](https://www.github.com/googleapis/java-shared-config/commit/66bf6e6fb95997b9eb4b34268b8d20c2fbe9ed5a))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7bd2470da2..0a531ca7b5 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.0.3 + 1.1.0 From acc6cb8ad318ae41a9a3a00a5942025c14cbe681 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 15 Oct 2021 15:09:25 -0400 Subject: [PATCH 0434/2268] feat: add session support (#1652) Adds: - CreateSession to Query config - SessionInfo in JobStatistics to record session stats --- .../google/cloud/bigquery/JobStatistics.java | 90 ++++++++++++++++++- .../cloud/bigquery/QueryJobConfiguration.java | 29 ++++++ .../cloud/bigquery/QueryRequestInfo.java | 7 ++ .../cloud/bigquery/JobStatisticsTest.java | 15 ++++ .../bigquery/QueryJobConfigurationTest.java | 3 + .../cloud/bigquery/QueryRequestInfoTest.java | 2 + .../cloud/bigquery/it/ITBigQueryTest.java | 33 +++++++ 7 files changed, 177 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index a3d04c0179..999f8d2fe3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -45,6 +45,7 @@ public abstract class JobStatistics implements Serializable { private final ScriptStatistics scriptStatistics; private final List reservationUsage; private final TransactionInfo transactionInfo; + private final SessionInfo sessionInfo; /** A Google BigQuery Copy Job statistics. */ public static class CopyStatistics extends JobStatistics { @@ -1251,6 +1252,76 @@ static TransactionInfo fromPb( } } + // SessionInfo contains information about the session if this job is part of one. + public static class SessionInfo { + + // Id of the session + private final String sessionId; + + public static class Builder { + + private String sessionId; + + private Builder() {}; + + Builder setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + SessionInfo build() { + return new SessionInfo(this); + } + } + + private SessionInfo(Builder builder) { + this.sessionId = builder.sessionId; + } + + public String getSessionId() { + return sessionId; + } + + static Builder newBuilder() { + return new Builder(); + } + + ToStringHelper toStringHelper() { + return MoreObjects.toStringHelper(this).add("sessionId", sessionId); + } + + @Override + public String toString() { + return toStringHelper().toString(); + } + + @Override + public boolean equals(Object obj) { + return obj == this + || obj != null + && obj.getClass().equals(SessionInfo.class) + && Objects.equals(toPb(), ((SessionInfo) obj).toPb()); + } + + @Override + public int hashCode() { + return Objects.hash(sessionId); + } + + com.google.api.services.bigquery.model.SessionInfo toPb() { + com.google.api.services.bigquery.model.SessionInfo sessionInfo = + new com.google.api.services.bigquery.model.SessionInfo(); + sessionInfo.setSessionId(sessionId); + return sessionInfo; + } + + static SessionInfo fromPb(com.google.api.services.bigquery.model.SessionInfo sessionInfo) { + SessionInfo.Builder builder = newBuilder(); + builder.setSessionId(sessionInfo.getSessionId()); + return builder.build(); + } + } + abstract static class Builder> { private Long creationTime; @@ -1261,6 +1332,7 @@ abstract static class Builder> private ScriptStatistics scriptStatistics; private List reservationUsage; private TransactionInfo transactionInfo; + private SessionInfo sessionInfo; protected Builder() {} @@ -1280,6 +1352,9 @@ protected Builder(com.google.api.services.bigquery.model.JobStatistics statistic if (statisticsPb.getTransactionInfo() != null) { this.transactionInfo = TransactionInfo.fromPb(statisticsPb.getTransactionInfo()); } + if (statisticsPb.getSessionInfo() != null) { + this.sessionInfo = SessionInfo.fromPb(statisticsPb.getSessionInfo()); + } } @SuppressWarnings("unchecked") @@ -1314,6 +1389,7 @@ protected JobStatistics(Builder builder) { this.scriptStatistics = builder.scriptStatistics; this.reservationUsage = builder.reservationUsage; this.transactionInfo = builder.transactionInfo; + this.sessionInfo = builder.sessionInfo; } /** Returns the creation time of the job in milliseconds since epoch. */ @@ -1362,6 +1438,11 @@ public TransactionInfo getTransactionInfo() { return transactionInfo; } + /** Info of the session if this job is part of one. */ + public SessionInfo getSessionInfo() { + return sessionInfo; + } + ToStringHelper toStringHelper() { return MoreObjects.toStringHelper(this) .add("creationTime", creationTime) @@ -1371,7 +1452,8 @@ ToStringHelper toStringHelper() { .add("parentJobId", parentJobId) .add("scriptStatistics", scriptStatistics) .add("reservationUsage", reservationUsage) - .add("transactionInfo", transactionInfo); + .add("transactionInfo", transactionInfo) + .add("sessionInfo", sessionInfo); } @Override @@ -1388,7 +1470,8 @@ final int baseHashCode() { parentJobId, scriptStatistics, reservationUsage, - transactionInfo); + transactionInfo, + sessionInfo); } final boolean baseEquals(JobStatistics jobStatistics) { @@ -1413,6 +1496,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (transactionInfo != null) { statistics.setTransactionInfo(transactionInfo.toPb()); } + if (sessionInfo != null) { + statistics.setSessionInfo(sessionInfo.toPb()); + } return statistics; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 7733e48e6f..48ec22cafa 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -56,6 +56,7 @@ public final class QueryJobConfiguration extends JobConfiguration { private final DatasetId defaultDataset; private final Priority priority; private final Boolean allowLargeResults; + private final Boolean createSession; private final Boolean useQueryCache; private final Boolean flattenResults; private final Boolean dryRun; @@ -108,6 +109,7 @@ public static final class Builder private DatasetId defaultDataset; private Priority priority; private Boolean allowLargeResults; + private Boolean createSession; private Boolean useQueryCache; private Boolean flattenResults; private Boolean dryRun; @@ -142,6 +144,7 @@ private Builder(QueryJobConfiguration jobConfiguration) { this.defaultDataset = jobConfiguration.defaultDataset; this.priority = jobConfiguration.priority; this.allowLargeResults = jobConfiguration.allowLargeResults; + this.createSession = jobConfiguration.createSession; this.useQueryCache = jobConfiguration.useQueryCache; this.flattenResults = jobConfiguration.flattenResults; this.dryRun = jobConfiguration.dryRun; @@ -185,6 +188,7 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur } } allowLargeResults = queryConfigurationPb.getAllowLargeResults(); + createSession = queryConfigurationPb.getCreateSession(); useQueryCache = queryConfigurationPb.getUseQueryCache(); flattenResults = queryConfigurationPb.getFlattenResults(); useLegacySql = queryConfigurationPb.getUseLegacySql(); @@ -460,6 +464,16 @@ public Builder setPriority(Priority priority) { return this; } + /** + * Sets whether to create a new session. If {@code true} a random session id will be generated + * by BigQuery. If false, runs query with an existing session_id passed in ConnectionProperty, + * otherwise runs query in non-session mode." + */ + public Builder setCreateSession(Boolean createSession) { + this.createSession = createSession; + return this; + } + /** * Sets whether the job is enabled to create arbitrarily large results. If {@code true} the * query is allowed to create large results at a slight cost in performance. If {@code true} @@ -656,6 +670,7 @@ private QueryJobConfiguration(Builder builder) { namedParameters = ImmutableMap.copyOf(builder.namedParameters); this.parameterMode = builder.parameterMode; this.allowLargeResults = builder.allowLargeResults; + this.createSession = builder.createSession; this.createDisposition = builder.createDisposition; this.defaultDataset = builder.defaultDataset; this.destinationTable = builder.destinationTable; @@ -693,6 +708,15 @@ public Boolean allowLargeResults() { return allowLargeResults; } + /** + * Returns whether to create a new session. + * + * @see Create Sessions + */ + public Boolean createSession() { + return createSession; + } + /** * Returns whether the job is allowed to create new tables. * @@ -897,6 +921,7 @@ ToStringHelper toStringHelper() { .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("defaultDataset", defaultDataset) .add("allowLargeResults", allowLargeResults) + .add("createSession", createSession) .add("flattenResults", flattenResults) .add("priority", priority) .add("tableDefinitions", tableDefinitions) @@ -928,6 +953,7 @@ public int hashCode() { return Objects.hash( baseHashCode(), allowLargeResults, + createSession, createDisposition, destinationTable, defaultDataset, @@ -988,6 +1014,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (allowLargeResults != null) { queryConfigurationPb.setAllowLargeResults(allowLargeResults); } + if (createSession != null) { + queryConfigurationPb.setCreateSession(createSession); + } if (createDisposition != null) { queryConfigurationPb.setCreateDisposition(createDisposition.toString()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 7492809d61..ccde465af4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -37,6 +37,7 @@ final class QueryRequestInfo { private final String query; private final List queryParameters; private final String requestId; + private final Boolean createSession; private final Boolean useQueryCache; private final Boolean useLegacySql; @@ -51,6 +52,7 @@ final class QueryRequestInfo { this.query = config.getQuery(); this.queryParameters = config.toPb().getQuery().getQueryParameters(); this.requestId = UUID.randomUUID().toString(); + this.createSession = config.createSession(); this.useLegacySql = config.useLegacySql(); this.useQueryCache = config.useQueryCache(); } @@ -97,6 +99,9 @@ QueryRequest toPb() { if (queryParameters != null) { request.setQueryParameters(queryParameters); } + if (createSession != null) { + request.setCreateSession(createSession); + } if (useLegacySql != null) { request.setUseLegacySql(useLegacySql); } @@ -118,6 +123,7 @@ public String toString() { .add("query", query) .add("requestId", requestId) .add("queryParameters", queryParameters) + .add("createSession", createSession) .add("useQueryCache", useQueryCache) .add("useLegacySql", useLegacySql) .toString(); @@ -135,6 +141,7 @@ public int hashCode() { query, queryParameters, requestId, + createSession, useQueryCache, useLegacySql); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index c421c0370f..87fae41b58 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -26,6 +26,7 @@ import com.google.cloud.bigquery.JobStatistics.ReservationUsage; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics.ScriptStackFrame; +import com.google.cloud.bigquery.JobStatistics.SessionInfo; import com.google.cloud.bigquery.JobStatistics.TransactionInfo; import com.google.cloud.bigquery.QueryStage.QueryStep; import com.google.common.collect.ImmutableList; @@ -73,6 +74,7 @@ public class JobStatisticsTest { private static final String NAME = "reservation-name"; private static final Long SLOTMS = 12545L; private static final String TRANSACTION_ID = UUID.randomUUID().toString().substring(0, 8); + private static final String SESSION_ID = UUID.randomUUID().toString().substring(0, 8); private static final CopyStatistics COPY_STATISTICS = CopyStatistics.newBuilder() .setCreationTimestamp(CREATION_TIME) @@ -222,6 +224,9 @@ public class JobStatisticsTest { private static final TransactionInfo TRANSACTION_INFO = TransactionInfo.newbuilder().setTransactionId(TRANSACTION_ID).build(); + private static final SessionInfo SESSION_INFO = + SessionInfo.newBuilder().setSessionId(SESSION_ID).build(); + @Test public void testBuilder() { assertEquals(CREATION_TIME, EXTRACT_STATISTICS.getCreationTime()); @@ -293,6 +298,7 @@ public void testBuilder() { assertEquals(NAME, RESERVATION_USAGE.getName()); assertEquals(SLOTMS, RESERVATION_USAGE.getSlotMs()); assertEquals(TRANSACTION_ID, TRANSACTION_INFO.getTransactionId()); + assertEquals(SESSION_ID, SESSION_INFO.getSessionId()); } @Test @@ -319,6 +325,7 @@ public void testToPbAndFromPb() { } compareReservation(RESERVATION_USAGE, ReservationUsage.fromPb(RESERVATION_USAGE.toPb())); compareTransactionInfo(TRANSACTION_INFO, TransactionInfo.fromPb(TRANSACTION_INFO.toPb())); + compareSessionInfo(SESSION_INFO, SessionInfo.fromPb(SESSION_INFO.toPb())); } @Test @@ -441,4 +448,12 @@ private void compareTransactionInfo(TransactionInfo expected, TransactionInfo va assertEquals(expected.toPb(), value.toPb()); assertEquals(expected.getTransactionId(), value.getTransactionId()); } + + private void compareSessionInfo(SessionInfo expected, SessionInfo value) { + assertEquals(expected, value); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + assertEquals(expected.toPb(), value.toPb()); + assertEquals(expected.getSessionId(), value.getSessionId()); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index bcfc723568..9a20219d66 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -78,6 +78,7 @@ public class QueryJobConfigurationTest { private static final Priority PRIORITY = Priority.BATCH; private static final boolean ALLOW_LARGE_RESULTS = true; private static final boolean USE_QUERY_CACHE = false; + private static final boolean CREATE_SESSION = true; private static final boolean FLATTEN_RESULTS = true; private static final boolean USE_LEGACY_SQL = true; private static final Integer MAX_BILLING_TIER = 123; @@ -119,6 +120,7 @@ public class QueryJobConfigurationTest { .setDestinationTable(TABLE_ID) .setWriteDisposition(WRITE_DISPOSITION) .setPriority(PRIORITY) + .setCreateSession(CREATE_SESSION) .setFlattenResults(FLATTEN_RESULTS) .setUserDefinedFunctions(USER_DEFINED_FUNCTIONS) .setDryRun(true) @@ -238,6 +240,7 @@ private void compareQueryJobConfiguration( assertEquals(expected.getCreateDisposition(), value.getCreateDisposition()); assertEquals(expected.getDefaultDataset(), value.getDefaultDataset()); assertEquals(expected.getDestinationTable(), value.getDestinationTable()); + assertEquals(expected.createSession(), value.createSession()); assertEquals(expected.flattenResults(), value.flattenResults()); assertEquals(expected.getPriority(), value.getPriority()); assertEquals(expected.getQuery(), value.getQuery()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 4adeeaf006..5c224af809 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -74,6 +74,7 @@ public class QueryRequestInfoTest { private static final WriteDisposition WRITE_DISPOSITION = WriteDisposition.WRITE_APPEND; private static final Priority PRIORITY = Priority.BATCH; private static final boolean ALLOW_LARGE_RESULTS = true; + private static final boolean CREATE_SESSION = true; private static final boolean USE_QUERY_CACHE = false; private static final boolean FLATTEN_RESULTS = true; private static final boolean USE_LEGACY_SQL = true; @@ -142,6 +143,7 @@ public class QueryRequestInfoTest { .setLabels(LABELS) .setConnectionProperties(CONNECTION_PROPERTIES) .setPositionalParameters(POSITIONAL_PARAMETER) + .setCreateSession(CREATE_SESSION) .setMaxResults(100L) .build(); QueryRequestInfo REQUEST_INFO_SUPPORTED = new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8ef74458fd..88695f8733 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2235,6 +2235,39 @@ public void testFastQueryHTTPException() throws InterruptedException { } } + @Test + public void testQuerySessionSupport() throws InterruptedException { + String query = "CREATE TEMPORARY TABLE temptable AS SELECT 17 as foo"; + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .setCreateSession(true) + .build(); + Job remoteJob = bigquery.create(JobInfo.of(queryJobConfiguration)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + + Job queryJob = bigquery.getJob(remoteJob.getJobId()); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + String sessionId = statistics.getSessionInfo().getSessionId(); + assertNotNull(sessionId); + + String queryTempTable = "SELECT * FROM temptable"; + ConnectionProperty connectionProperty = + ConnectionProperty.newBuilder().setKey("session_id").setValue(sessionId).build(); + QueryJobConfiguration queryJobConfigurationWithSession = + QueryJobConfiguration.newBuilder(queryTempTable) + .setDefaultDataset(DatasetId.of(DATASET)) + .setConnectionProperties(ImmutableList.of(connectionProperty)) + .build(); + Job remoteJobWithSession = bigquery.create(JobInfo.of(queryJobConfigurationWithSession)); + remoteJobWithSession = remoteJobWithSession.waitFor(); + assertNull(remoteJobWithSession.getStatus().getError()); + Job queryJobWithSession = bigquery.getJob(remoteJobWithSession.getJobId()); + JobStatistics.QueryStatistics statisticsWithSession = queryJobWithSession.getStatistics(); + assertEquals(sessionId, statisticsWithSession.getSessionInfo().getSessionId()); + } + @Test public void testDmlStatistics() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); From 8378014739766a36664e6a61ed495d5d10028ce2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 19:22:14 +0000 Subject: [PATCH 0435/2268] chore: release 2.3.0 (#1646) :robot: I have created a release \*beep\* \*boop\* --- ## [2.3.0](https://www.github.com/googleapis/java-bigquery/compare/v2.2.1...v2.3.0) (2021-10-15) ### Features * add session support ([#1652](https://www.github.com/googleapis/java-bigquery/issues/1652)) ([acc6cb8](https://www.github.com/googleapis/java-bigquery/commit/acc6cb8ad318ae41a9a3a00a5942025c14cbe681)) ### Bug Fixes * fix timestamp rounding issue ([#1645](https://www.github.com/googleapis/java-bigquery/issues/1645)) ([e60bdff](https://www.github.com/googleapis/java-bigquery/commit/e60bdff9e196a618a59a0544ec93f87b2ec5fc82)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecd216e7eb..b5680dfeff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.3.0](https://www.github.com/googleapis/java-bigquery/compare/v2.2.1...v2.3.0) (2021-10-15) + + +### Features + +* add session support ([#1652](https://www.github.com/googleapis/java-bigquery/issues/1652)) ([acc6cb8](https://www.github.com/googleapis/java-bigquery/commit/acc6cb8ad318ae41a9a3a00a5942025c14cbe681)) + + +### Bug Fixes + +* fix timestamp rounding issue ([#1645](https://www.github.com/googleapis/java-bigquery/issues/1645)) ([e60bdff](https://www.github.com/googleapis/java-bigquery/commit/e60bdff9e196a618a59a0544ec93f87b2ec5fc82)) + ### [2.2.1](https://www.github.com/googleapis/java-bigquery/compare/v2.2.0...v2.2.1) (2021-10-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 451a55ec0b..14694682d7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2032c657c0..9b9156d65f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.2.2-SNAPSHOT + 2.3.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.2.2-SNAPSHOT + 2.3.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0a531ca7b5..5332226d90 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.2.2-SNAPSHOT + 2.3.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4d338439b6..75f378e06f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.2.2-SNAPSHOT + 2.3.0 diff --git a/versions.txt b/versions.txt index 6064c38c22..835e606388 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.2.1:2.2.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.3.0:2.3.0 \ No newline at end of file From 0a1589348ecbc7aebf49fa40efd369114aa718aa Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 19:36:11 +0000 Subject: [PATCH 0436/2268] chore: release 2.3.1-SNAPSHOT (#1653) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 14694682d7..b90f95e5b5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.0 + 2.3.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9b9156d65f..c35c11e63b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.0 + 2.3.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.0 + 2.3.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5332226d90..e603038051 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.0 + 2.3.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.0 + 2.3.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 75f378e06f..b63681a1a8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.0 + 2.3.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 835e606388..f8e04d3c5a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.0:2.3.0 \ No newline at end of file +google-cloud-bigquery:2.3.0:2.3.1-SNAPSHOT \ No newline at end of file From bb9129ed63bb903c97ad25897e1d7ef7ba8a52f1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Oct 2021 20:45:14 +0200 Subject: [PATCH 0437/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.3.0 (#1654) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index de968e4341..ef53c3b294 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.2.1 + 2.3.0 From 97a04ba1228f65e7045da2446f53d6dbd574552e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Oct 2021 22:07:59 +0200 Subject: [PATCH 0438/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.5 (#1658) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ef53c3b294..fff7caa5fa 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.4 + 2.1.5 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b63681a1a8..170cd55cf7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.4 + 2.1.5 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f0666a60ce..b913d6d1ab 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.4 + 2.1.5 test From a499bbc526da6a2e7f289ba2a86d9d206659d88c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Oct 2021 22:08:24 +0200 Subject: [PATCH 0439/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 (#1661) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e603038051..8030207c1e 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20210927-1.32.1 - 2.3.0 + 2.4.0 From f9ffd3f59d9774e3931619182f4522a1041e70bd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Oct 2021 22:20:25 +0200 Subject: [PATCH 0440/2268] test(deps): update datacatalog dependencies to v1.5.9 (#1660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-datacatalog-v1](https://togithub.com/googleapis/java-datacatalog) | `1.5.8` -> `1.5.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-datacatalog-v1/1.5.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-datacatalog-v1/1.5.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-datacatalog-v1/1.5.9/compatibility-slim/1.5.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-datacatalog-v1/1.5.9/confidence-slim/1.5.8)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-datacatalog](https://togithub.com/googleapis/java-datacatalog) | `1.5.8` -> `1.5.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.5.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.5.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.5.9/compatibility-slim/1.5.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog/1.5.9/confidence-slim/1.5.8)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-datacatalog ### [`v1.5.9`](https://togithub.com/googleapis/java-datacatalog/blob/master/CHANGELOG.md#​159-httpswwwgithubcomgoogleapisjava-datacatalogcomparev158v159-2021-10-19) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.5.8...v1.5.9)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8030207c1e..c3dc0019bc 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.8 + 1.5.9 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.8 + 1.5.9 test From 16c2d22550812e908f19969c27bcaf9dd5f861e1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Oct 2021 22:50:41 +0200 Subject: [PATCH 0441/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.1.9 (#1659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.1.7` -> `2.1.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.9/compatibility-slim/2.1.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.1.9/confidence-slim/2.1.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.1.9`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​219-httpswwwgithubcomgoogleapisjava-storagecomparev218v219-2021-10-19) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.8...v2.1.9) ### [`v2.1.8`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​218-httpswwwgithubcomgoogleapisjava-storagecomparev217v218-2021-10-18) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.1.7...v2.1.8)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3dc0019bc..9b257de418 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.7 + 2.1.9 test From 84584344a5fc2e498449cbeb39995b07d60d011c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 21:04:21 +0000 Subject: [PATCH 0442/2268] chore: release 2.3.1 (#1662) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.1](https://www.github.com/googleapis/java-bigquery/compare/v2.3.0...v2.3.1) (2021-10-19) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#1661](https://www.github.com/googleapis/java-bigquery/issues/1661)) ([a499bbc](https://www.github.com/googleapis/java-bigquery/commit/a499bbc526da6a2e7f289ba2a86d9d206659d88c)) * update dependency com.google.cloud:google-cloud-storage to v2.1.9 ([#1659](https://www.github.com/googleapis/java-bigquery/issues/1659)) ([16c2d22](https://www.github.com/googleapis/java-bigquery/commit/16c2d22550812e908f19969c27bcaf9dd5f861e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5680dfeff..d49f4e90a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.3.1](https://www.github.com/googleapis/java-bigquery/compare/v2.3.0...v2.3.1) (2021-10-19) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#1661](https://www.github.com/googleapis/java-bigquery/issues/1661)) ([a499bbc](https://www.github.com/googleapis/java-bigquery/commit/a499bbc526da6a2e7f289ba2a86d9d206659d88c)) +* update dependency com.google.cloud:google-cloud-storage to v2.1.9 ([#1659](https://www.github.com/googleapis/java-bigquery/issues/1659)) ([16c2d22](https://www.github.com/googleapis/java-bigquery/commit/16c2d22550812e908f19969c27bcaf9dd5f861e1)) + ## [2.3.0](https://www.github.com/googleapis/java-bigquery/compare/v2.2.1...v2.3.0) (2021-10-15) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b90f95e5b5..c7c1109afb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.1-SNAPSHOT + 2.3.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c35c11e63b..cd66c878f9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.1-SNAPSHOT + 2.3.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.1-SNAPSHOT + 2.3.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9b257de418..b4258f0cd7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.1-SNAPSHOT + 2.3.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.1-SNAPSHOT + 2.3.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 170cd55cf7..00c0ee711e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.1-SNAPSHOT + 2.3.1 diff --git a/versions.txt b/versions.txt index f8e04d3c5a..bdfa0c618a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.0:2.3.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.3.1:2.3.1 \ No newline at end of file From 64f6bf3ecce0caa96fd7d48fd13abfa9a27f3a16 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 19 Oct 2021 21:16:39 +0000 Subject: [PATCH 0443/2268] chore: release 2.3.2-SNAPSHOT (#1663) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c7c1109afb..40019ad523 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.1 + 2.3.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cd66c878f9..98ccab22a8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.1 + 2.3.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.1 + 2.3.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b4258f0cd7..fe7c4e3b8d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.1 + 2.3.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.1 + 2.3.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 00c0ee711e..4cd9c2a97b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.1 + 2.3.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index bdfa0c618a..5928a29966 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.1:2.3.1 \ No newline at end of file +google-cloud-bigquery:2.3.1:2.3.2-SNAPSHOT \ No newline at end of file From 36a822c419c8c14f55c1b0e985ddbc5ed40dbb72 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Oct 2021 17:31:27 +0200 Subject: [PATCH 0444/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.3.1 (#1664) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fff7caa5fa..11e54f6d83 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.3.0 + 2.3.1 From 201852fa3f9947da54bf4c4ec79d1b2630d76f2f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Oct 2021 19:52:21 +0200 Subject: [PATCH 0445/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.2.0 (#1667) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.1.4` -> `2.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.2.0/compatibility-slim/2.1.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.2.0/confidence-slim/2.1.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigtable ### [`v2.2.0`](https://togithub.com/googleapis/java-bigtable/blob/master/CHANGELOG.md#​220-httpswwwgithubcomgoogleapisjava-bigtablecomparev214v220-2021-10-20) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.1.4...v2.2.0) ##### Features - app profile multi cluster routing support with specified cluster ids ([#​961](https://www.togithub.com/googleapis/java-bigtable/issues/961)) ([f4c5c32](https://www.github.com/googleapis/java-bigtable/commit/f4c5c32c05d244a9ce7c3a4386ba9396c65f227e)) ##### Bug Fixes - fix typo in rst stream message ([#​1029](https://www.togithub.com/googleapis/java-bigtable/issues/1029)) ([50e6860](https://www.github.com/googleapis/java-bigtable/commit/50e686094c316560864c30a0295b3ed3f655c765)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#​1038](https://www.togithub.com/googleapis/java-bigtable/issues/1038)) ([d3efb29](https://www.github.com/googleapis/java-bigtable/commit/d3efb29df8461caddd3917fc42afa50961723a7d)) ##### [2.1.4](https://www.github.com/googleapis/java-bigtable/compare/v2.1.3...v2.1.4) (2021-09-22) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#​1020](https://www.togithub.com/googleapis/java-bigtable/issues/1020)) ([272f044](https://www.github.com/googleapis/java-bigtable/commit/272f0443501c502abf1b061414fb2435a9ad7952)) ##### [2.1.3](https://www.github.com/googleapis/java-bigtable/compare/v2.1.2...v2.1.3) (2021-09-21) ##### Dependencies - migrate to mockito-core 3.12.4 ([#​1008](https://www.togithub.com/googleapis/java-bigtable/issues/1008)) ([d9f19db](https://www.github.com/googleapis/java-bigtable/commit/d9f19db82f82615e4476462f9c34da7841169838)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#​1010](https://www.togithub.com/googleapis/java-bigtable/issues/1010)) ([a54a021](https://www.github.com/googleapis/java-bigtable/commit/a54a02135f30e3337812938f5794b293ee6535c6)) ##### [2.1.2](https://www.github.com/googleapis/java-bigtable/compare/v2.1.1...v2.1.2) (2021-09-13) ##### Bug Fixes - parallel execution and verbose grpc logs ([#​1004](https://www.togithub.com/googleapis/java-bigtable/issues/1004)) ([dd5164d](https://www.github.com/googleapis/java-bigtable/commit/dd5164dc9de7f060bb0dab79820cb43ac434d703)) ##### Reverts - temporary workaround for maven wildcard excludes ([#​989](https://www.togithub.com/googleapis/java-bigtable/issues/989)) ([148a928](https://www.github.com/googleapis/java-bigtable/commit/148a928e3f8f6d1e2ee1d1b119ca820d676802fd)) ##### [2.1.1](https://www.github.com/googleapis/java-bigtable/compare/v2.1.0...v2.1.1) (2021-09-01) ##### Dependencies - update dependency com.google.cloud:google-cloud-conformance-tests to v0.2.0 ([#​971](https://www.togithub.com/googleapis/java-bigtable/issues/971)) ([5c614d5](https://www.github.com/googleapis/java-bigtable/commit/5c614d58dd527a7fd36d32f201138a35e95a0577)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#​975](https://www.togithub.com/googleapis/java-bigtable/issues/975)) ([e5bb52e](https://www.github.com/googleapis/java-bigtable/commit/e5bb52eead42e8b351a7469529837d8b509b8332))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 11e54f6d83..49c8350bf1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.1.4 + 2.2.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4cd9c2a97b..b73a459d8f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.1.4 + 2.2.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b913d6d1ab..727b3dbc07 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.1.4 + 2.2.0 test From 92317d44ec93aa2fb620e81d5314501d7b0c9fc9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:06:17 +0000 Subject: [PATCH 0446/2268] chore: release 2.3.2 (#1668) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.2](https://www.github.com/googleapis/java-bigquery/compare/v2.3.1...v2.3.2) (2021-10-20) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.2.0 ([#1667](https://www.github.com/googleapis/java-bigquery/issues/1667)) ([201852f](https://www.github.com/googleapis/java-bigquery/commit/201852fa3f9947da54bf4c4ec79d1b2630d76f2f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d49f4e90a0..d83fdb4ce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.3.2](https://www.github.com/googleapis/java-bigquery/compare/v2.3.1...v2.3.2) (2021-10-20) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.2.0 ([#1667](https://www.github.com/googleapis/java-bigquery/issues/1667)) ([201852f](https://www.github.com/googleapis/java-bigquery/commit/201852fa3f9947da54bf4c4ec79d1b2630d76f2f)) + ### [2.3.1](https://www.github.com/googleapis/java-bigquery/compare/v2.3.0...v2.3.1) (2021-10-19) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 40019ad523..ebe8ef1ca8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.2-SNAPSHOT + 2.3.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 98ccab22a8..6d6d3f8577 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.2-SNAPSHOT + 2.3.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.2-SNAPSHOT + 2.3.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index fe7c4e3b8d..e120fc65b8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.2-SNAPSHOT + 2.3.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.2-SNAPSHOT + 2.3.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b73a459d8f..3ba93e6ed1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.2-SNAPSHOT + 2.3.2 diff --git a/versions.txt b/versions.txt index 5928a29966..0794eb78d2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.1:2.3.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.3.2:2.3.2 \ No newline at end of file From f0a69ae371d022c780b3667647d3c86084468be1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 18:22:41 +0000 Subject: [PATCH 0447/2268] chore: release 2.3.3-SNAPSHOT (#1669) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ebe8ef1ca8..7a099a25d5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6d6d3f8577..6f6b0dffcb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.2 + 2.3.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.2 + 2.3.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e120fc65b8..2f8122eac4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.2 + 2.3.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3ba93e6ed1..6746be514b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.2 + 2.3.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0794eb78d2..cc5803b705 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.2:2.3.2 \ No newline at end of file +google-cloud-bigquery:2.3.2:2.3.3-SNAPSHOT \ No newline at end of file From f97d6bf07081881c7a4e5487fc1a2ca30d5663aa Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 20 Oct 2021 12:22:58 -0700 Subject: [PATCH 0448/2268] test: test if tooling works (#1670) Co-authored-by: Stephanie Wang --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index e44bbbd7ec..473d7f07c4 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -7,6 +7,10 @@ branches: handleGHRelease: true releaseType: java-yoshi branch: java7 + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.3.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index b595a8a2c9..583a840c4d 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -46,6 +46,20 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google + - pattern: 2.3.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google permissionRules: - team: api-bigquery permission: admin From 7f1cc7a7a6a711bdf136679f11dec296768057c9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Oct 2021 21:50:16 +0200 Subject: [PATCH 0449/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.3.2 (#1674) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.3.1` -> `2.3.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.3.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.3.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.3.2/compatibility-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.3.2/confidence-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.3.2`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​232-httpswwwgithubcomgoogleapisjava-bigquerycomparev231v232-2021-10-20) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.3.1...v2.3.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 49c8350bf1..5361a5f150 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.3.1 + 2.3.2 From 66878c365fa50d54a9f1acefe2c9ff7f45335510 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 21 Oct 2021 12:49:39 -0400 Subject: [PATCH 0450/2268] chore: fix owlbot.py filename typo (#1675) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: fix owlbot.py filename typo * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: update owlbot image * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add dependencies.sh script for java17 check Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/ci.yaml | 19 ++++++++++------ .kokoro/build.sh | 5 +++++ .kokoro/dependencies.sh | 23 ++++++++++++++++++- .kokoro/presubmit/graalvm-native.cfg | 33 ++++++++++++++++++++++++++++ README.md | 8 +++---- owlbot.py.py => owlbot.py | 0 7 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 .kokoro/presubmit/graalvm-native.cfg rename owlbot.py.py => owlbot.py (100%) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 942f78aec4..859cc6b7a2 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:b328758e5113c392d3eccad613c2b18097eaebcb4d8bf77fab0326a6cad90bc7 \ No newline at end of file + digest: sha256:d4b2141d65566523dfd523f63c6e6899ab1281463bce182a9f600e74b0511875 \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3932a70d4e..2425d7234f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,14 +9,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11] + java: [8, 11, 17] steps: - uses: actions/checkout@v2 - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh @@ -29,8 +30,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -40,14 +42,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11] + java: [8, 11, 17] steps: - uses: actions/checkout@v2 - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh @@ -58,8 +61,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.sh @@ -72,8 +76,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 2d4c91705b..5454c3fc5d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -69,6 +69,11 @@ integration) verify RETURN_CODE=$? ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn test -Pnative -Penable-integration-tests + RETURN_CODE=$? + ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 12f1088d8d..78fed6d6e3 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -27,7 +27,28 @@ source ${scriptDir}/common.sh java -version echo $JOB_TYPE -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + case $javaVersion in + "17") + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + ;; + *) + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + ;; + esac +} + +export MAVEN_OPTS=$(determineMavenOpts) # this should run maven enforcer retry_with_backoff 3 10 \ diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg new file mode 100644 index 0000000000..4c7225ec92 --- /dev/null +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/README.md b/README.md index b428027cc0..aee18110ec 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.7 + 2.1.13 ``` @@ -51,20 +51,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:23.0.0') +implementation platform('com.google.cloud:libraries-bom:23.1.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.1.7' +implementation 'com.google.cloud:google-cloud-bigquery:2.3.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.1.7" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.3.2" ``` ## Authentication diff --git a/owlbot.py.py b/owlbot.py similarity index 100% rename from owlbot.py.py rename to owlbot.py From fd06ad2728e52eac2e8570b0ba15830ad79470ad Mon Sep 17 00:00:00 2001 From: Martin Vanek Date: Thu, 21 Oct 2021 19:46:12 +0100 Subject: [PATCH 0451/2268] fix: allow retry on connection establishing exceptions (#1666) --- .../google/cloud/bigquery/BigQueryImpl.java | 56 +++++++++---------- .../cloud/bigquery/TableDataWriteChannel.java | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index fd9160f40e..7d0e4c5550 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -270,7 +270,7 @@ public com.google.api.services.bigquery.model.Dataset call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -298,7 +298,7 @@ public com.google.api.services.bigquery.model.Table call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -326,7 +326,7 @@ public com.google.api.services.bigquery.model.Routine call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -375,7 +375,7 @@ public com.google.api.services.bigquery.model.Job call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -426,7 +426,7 @@ public com.google.api.services.bigquery.model.Dataset call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); if (getOptions().getThrowNotFound() && answer == null) { throw new BigQueryException(HTTP_NOT_FOUND, "Dataset not found"); @@ -501,7 +501,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -532,7 +532,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -558,7 +558,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -584,7 +584,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -608,7 +608,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -631,7 +631,7 @@ public com.google.api.services.bigquery.model.Dataset call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -659,7 +659,7 @@ public com.google.api.services.bigquery.model.Table call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -687,7 +687,7 @@ public com.google.api.services.bigquery.model.Model call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -715,7 +715,7 @@ public com.google.api.services.bigquery.model.Routine call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -751,7 +751,7 @@ public com.google.api.services.bigquery.model.Table call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); if (getOptions().getThrowNotFound() && answer == null) { throw new BigQueryException(HTTP_NOT_FOUND, "Table not found"); @@ -789,7 +789,7 @@ public com.google.api.services.bigquery.model.Model call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); if (getOptions().getThrowNotFound() && answer == null) { throw new BigQueryException(HTTP_NOT_FOUND, "Model not found"); @@ -827,7 +827,7 @@ public com.google.api.services.bigquery.model.Routine call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); if (getOptions().getThrowNotFound() && answer == null) { throw new BigQueryException(HTTP_NOT_FOUND, "Routine not found"); @@ -916,7 +916,7 @@ private static Page
listTables( } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.x(); Iterable
tables = @@ -953,7 +953,7 @@ private static Page listModels( } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.x(); Iterable models = @@ -990,7 +990,7 @@ private static Page listRoutines( } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.x(); Iterable routines = @@ -1055,7 +1055,7 @@ public TableDataInsertAllResponse call() throws Exception { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -1119,7 +1119,7 @@ public TableDataList call() { } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.getPageToken(); Map pageOptionMap = @@ -1179,7 +1179,7 @@ public com.google.api.services.bigquery.model.Job call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); if (getOptions().getThrowNotFound() && answer == null) { throw new BigQueryException(HTTP_NOT_FOUND, "Job not found"); @@ -1208,7 +1208,7 @@ public Tuple> call( } }, serviceOptions.getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock()); String cursor = result.x(); Iterable jobs = @@ -1247,7 +1247,7 @@ public Boolean call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -1440,7 +1440,7 @@ public com.google.api.services.bigquery.model.Policy call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -1466,7 +1466,7 @@ public com.google.api.services.bigquery.model.Policy call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock())); } catch (RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -1493,7 +1493,7 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); return response.getPermissions() == null ? ImmutableList.of() diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java index f96f7892c9..0f9632aea8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java @@ -60,7 +60,7 @@ public com.google.api.services.bigquery.model.Job call() { } }, getOptions().getRetrySettings(), - BigQueryImpl.EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock()); job = jobPb != null ? Job.fromPb(getOptions().getService(), jobPb) : null; } catch (RetryHelper.RetryHelperException e) { @@ -91,7 +91,7 @@ public String call() { } }, options.getRetrySettings(), - BigQueryImpl.EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, options.getClock()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); From 591361f1722acf23abf4af4ea9d72f40a0659ff3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Oct 2021 16:51:38 +0200 Subject: [PATCH 0452/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.0 (#1678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aee18110ec..9db97d6b8b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 23.0.0 + 23.1.0 pom import @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.1.13 + 2.3.2 ``` @@ -329,7 +329,7 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/bigquery -[javadocs]: https://googleapis.dev/java/google-cloud-bigquery/latest +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java7.svg [kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java7.html [kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8.svg diff --git a/pom.xml b/pom.xml index 2f8122eac4..ce99ee790e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.1.0 + 1.2.0 From 5e46e5c59f58efb996364edb394b149f4ead8428 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Oct 2021 16:53:32 +0200 Subject: [PATCH 0453/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20211017-1.32.1 (#1679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20211017-1.32.1 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ce99ee790e..bb8fdca2c8 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20210927-1.32.1 + v2-rev20211017-1.32.1 2.4.0 From f88665b8d3d012e79dde7a4983be794371a7446f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 16:08:13 +0000 Subject: [PATCH 0454/2268] chore: release 2.3.3 (#1677) :robot: I have created a release \*beep\* \*boop\* --- ### [2.3.3](https://www.github.com/googleapis/java-bigquery/compare/v2.3.2...v2.3.3) (2021-10-25) ### Bug Fixes * allow retry on connection establishing exceptions ([#1666](https://www.github.com/googleapis/java-bigquery/issues/1666)) ([fd06ad2](https://www.github.com/googleapis/java-bigquery/commit/fd06ad2728e52eac2e8570b0ba15830ad79470ad)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20211017-1.32.1 ([#1679](https://www.github.com/googleapis/java-bigquery/issues/1679)) ([5e46e5c](https://www.github.com/googleapis/java-bigquery/commit/5e46e5c59f58efb996364edb394b149f4ead8428)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d83fdb4ce4..7a316d02be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [2.3.3](https://www.github.com/googleapis/java-bigquery/compare/v2.3.2...v2.3.3) (2021-10-25) + + +### Bug Fixes + +* allow retry on connection establishing exceptions ([#1666](https://www.github.com/googleapis/java-bigquery/issues/1666)) ([fd06ad2](https://www.github.com/googleapis/java-bigquery/commit/fd06ad2728e52eac2e8570b0ba15830ad79470ad)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20211017-1.32.1 ([#1679](https://www.github.com/googleapis/java-bigquery/issues/1679)) ([5e46e5c](https://www.github.com/googleapis/java-bigquery/commit/5e46e5c59f58efb996364edb394b149f4ead8428)) + ### [2.3.2](https://www.github.com/googleapis/java-bigquery/compare/v2.3.1...v2.3.2) (2021-10-20) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7a099a25d5..548ba5f728 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6f6b0dffcb..1c14dfbdf0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.3-SNAPSHOT + 2.3.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.3-SNAPSHOT + 2.3.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bb8fdca2c8..ae7148f4ba 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.3-SNAPSHOT + 2.3.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6746be514b..a0edd819c7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.3-SNAPSHOT + 2.3.3 diff --git a/versions.txt b/versions.txt index cc5803b705..585b3ce8dc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.2:2.3.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.3.3:2.3.3 \ No newline at end of file From 974ccd480afc9b8e3eaa8523e5f6223ff94dbb87 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Oct 2021 16:20:11 +0000 Subject: [PATCH 0455/2268] chore: release 2.3.4-SNAPSHOT (#1680) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 548ba5f728..cbcee6bf1c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1c14dfbdf0..88ea25fa47 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.3 + 2.3.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.3 + 2.3.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ae7148f4ba..59d92fc638 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.3 + 2.3.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -77,7 +77,7 @@ com.google.cloud google-cloud-bigquery - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a0edd819c7..3394b8eb41 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.3 + 2.3.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 585b3ce8dc..faefa49f54 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.3:2.3.3 \ No newline at end of file +google-cloud-bigquery:2.3.3:2.3.4-SNAPSHOT \ No newline at end of file From c1a5d7357fe4a56aaf4b55b105f3dc77402c75f2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Oct 2021 21:01:52 +0200 Subject: [PATCH 0456/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.3.3 (#1681) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.3.3 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9db97d6b8b..e97b1a04bb 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.3.2 + 2.3.3 ``` @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.3.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.3.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.3.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.3.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5361a5f150..df372f3aab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.3.2 + 2.3.3 From bef2705208abfc837d16f01758c802d817420dd4 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 26 Oct 2021 11:56:15 -0400 Subject: [PATCH 0457/2268] fix(java): java 17 dependency arguments (#1683) --- .kokoro/dependencies.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 78fed6d6e3..4e4085d680 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -37,15 +37,13 @@ function determineMavenOpts() { | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' ) - case $javaVersion in - "17") + if [[ $javaVersion == 17* ]] + then # MaxPermSize is no longer supported as of jdk 17 echo -n "-Xmx1024m" - ;; - *) + else echo -n "-Xmx1024m -XX:MaxPermSize=128m" - ;; - esac + fi } export MAVEN_OPTS=$(determineMavenOpts) From 4025a5ff824d84a898391425abe55bd14fe51b60 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 26 Oct 2021 14:26:24 -0400 Subject: [PATCH 0458/2268] chore(ci): remove dependencies.sh exclusions (#1685) --- .kokoro/dependencies.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 4e4085d680..586b78bb9b 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -65,7 +65,9 @@ function completenessCheck() { # This is stripped from the output as it is not present in the flattened pom. # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + # Excluding commons-codec,commons-logging from the comparison as a temp fix + # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 + mvn dependency:list -f pom.xml -DexcludeArtifactIds=commons-codec,commons-logging -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) msg "Generating dependency list using flattened pom..." From f3c78d620c248d7c7fb153deb12d7e254e4772a4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 00:58:25 +0200 Subject: [PATCH 0459/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24 (#1686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `23.1.0` -> `24.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.0.0/compatibility-slim/23.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.0.0/confidence-slim/23.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/snippets/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e97b1a04bb..061d58faab 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 23.1.0 + 24.0.0 pom import @@ -51,7 +51,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:23.1.0') +implementation platform('com.google.cloud:libraries-bom:24.0.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 727b3dbc07..9c273a6f87 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 23.1.0 + 24.0.0 pom import From 6cb11db5f15e7d617bc5aa4a3ac5fdacbe515b77 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 27 Oct 2021 11:46:33 -0400 Subject: [PATCH 0460/2268] feat: induce minor version bump for lts (#1688) From ab9fcc75fd1c75fa494b795165a09f7c3895f631 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 4 Nov 2021 21:06:16 +0000 Subject: [PATCH 0461/2268] chore(java): remove pin on Apache Maven 3.8.1 from github actions (#1268) (#1692) --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/ci.yaml | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 859cc6b7a2..5a79fcd57b 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:d4b2141d65566523dfd523f63c6e6899ab1281463bce182a9f600e74b0511875 \ No newline at end of file + digest: sha256:ed012741acaae5d03e011244585a1f0625a596d31568967d77772aa5a0a51d5e diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2425d7234f..d95a11a262 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,9 +12,6 @@ jobs: java: [8, 11, 17] steps: - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - uses: actions/setup-java@v2 with: distribution: zulu @@ -27,9 +24,6 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - uses: actions/setup-java@v2 with: distribution: zulu @@ -45,9 +39,6 @@ jobs: java: [8, 11, 17] steps: - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - uses: actions/setup-java@v2 with: distribution: zulu @@ -58,9 +49,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - uses: actions/setup-java@v2 with: distribution: zulu @@ -73,9 +61,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: stCarolas/setup-maven@v4 - with: - maven-version: 3.8.1 - uses: actions/setup-java@v2 with: distribution: zulu @@ -83,4 +68,4 @@ jobs: - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr + JOB_TYPE: clirr \ No newline at end of file From 1f46d8dd316f1c8df392f749428986d4d9c7fa07 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Nov 2021 17:26:00 +0100 Subject: [PATCH 0462/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.2.0 (#1691) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59d92fc638..aa67ee4eb6 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ com.google.cloud google-cloud-storage - 2.1.9 + 2.2.0 test From f8f2e5e17d6542c8a3e4c7e412f6d25c61678834 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 5 Nov 2021 15:56:15 -0400 Subject: [PATCH 0463/2268] chore(test): add back test condition (#1693) Backend fix is in. Fixes #1443 --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 88695f8733..8460bccb78 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3202,6 +3202,7 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo assertEquals(2L, statistics.getOutputRows().longValue()); LoadJobConfiguration jobConfiguration = job.getConfiguration(); assertEquals(TABLE_SCHEMA, jobConfiguration.getSchema()); + assertNull(jobConfiguration.getSourceUris()); assertNull(job.getStatus().getError()); Page rows = bigquery.listTableData(tableId); int rowCount = 0; From e25dabb8720d46dcbc07d904b9cf81652e18367e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 6 Nov 2021 00:36:16 +0000 Subject: [PATCH 0464/2268] Update ci.yaml (#1275) (#1694) --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/ci.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5a79fcd57b..994dd04bfe 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:ed012741acaae5d03e011244585a1f0625a596d31568967d77772aa5a0a51d5e + digest: sha256:fecf6bd85f19eb046d913982ea36f6d434f9a49ab0545d25e31186aa64367c0c diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d95a11a262..93b337c628 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,7 @@ jobs: units: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: java: [8, 11, 17] steps: @@ -68,4 +69,4 @@ jobs: - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr \ No newline at end of file + JOB_TYPE: clirr From 1de58e851c3e04ed29de9000d3f80459bc3bfd73 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 8 Nov 2021 21:44:26 +0000 Subject: [PATCH 0465/2268] chore: cleanup cloud RAD generation (#1269) (#1695) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release/publish_javadoc11.sh | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 994dd04bfe..325daaa4b5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:fecf6bd85f19eb046d913982ea36f6d434f9a49ab0545d25e31186aa64367c0c + digest: sha256:204b7af96e6d481f19b0ff377aa379d46bc56dd06e1cc7c523f361dd9cbfeeaa diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index d596527c8e..aab9723455 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -36,13 +36,9 @@ mvn clean install -B -q -DskipTests=true export NAME=google-cloud-bigquery export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) -# V3 generates docfx yml from javadoc -# generate yml -mvn clean site -B -q -P docFX - -# copy README to docfx-yml dir and rename index.md -cp README.md target/docfx-yml/index.md -# copy CHANGELOG to docfx-yml dir and rename history.md +# cloud RAD generation +mvn clean javadoc:aggregate -B -q -P docFX +# include CHANGELOG cp CHANGELOG.md target/docfx-yml/history.md pushd target/docfx-yml From baf3a3c7a74808343c48df4afebfbf268c937940 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 14:46:26 +0000 Subject: [PATCH 0466/2268] chore: update jre to 11 for linter (#1278) (#1697) --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/ci.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 325daaa4b5..886d09496d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:204b7af96e6d481f19b0ff377aa379d46bc56dd06e1cc7c523f361dd9cbfeeaa + digest: sha256:14ecf64ec36f67c7bf04e3dc0f68eafcc01df3955121c38862b695e2ae7515d8 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 93b337c628..05de1f60dc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,7 @@ jobs: - uses: actions/setup-java@v2 with: distribution: zulu - java-version: 8 + java-version: 11 - run: java -version - run: .kokoro/build.sh env: From f34c11b3ab7c86b26751758f171bc2002e877918 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 9 Nov 2021 17:10:55 +0100 Subject: [PATCH 0467/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.1 (#1696) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa67ee4eb6..e96de64427 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.0 + 1.2.1 From e36a965bddd835eba7d6e81cd0f796fb73cc527e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 21:30:13 +0000 Subject: [PATCH 0468/2268] chore: update minimum java version to java 8 (#1281) (#1698) --- .github/.OwlBot.lock.yaml | 2 +- README.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 886d09496d..5d788be0b5 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:14ecf64ec36f67c7bf04e3dc0f68eafcc01df3955121c38862b695e2ae7515d8 + digest: sha256:a744afda1956beb7bd6dc8d0b740a7839bbe402e34e2f4ef24589074db53ceb0 diff --git a/README.md b/README.md index 061d58faab..9f0ac2232a 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ To get help, follow the instructions in the [shared Troubleshooting document][tr ## Supported Java Versions -Java 7 or above is required for using this client. +Java 8 or above is required for using this client. Google's Java client libraries, [Google Cloud Client Libraries][cloudlibs] @@ -320,7 +320,6 @@ Apache 2.0 - See [LICENSE][license] for more information. Java Version | Status ------------ | ------ -Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] From 5185801797c620dba9de7e72b7dea8ddc600ed58 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Fri, 12 Nov 2021 15:57:21 -0500 Subject: [PATCH 0469/2268] fix: removing a new line character in a property (#1700) --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e96de64427..d52f96540e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20211017-1.32.1 - + v2-rev20211017-1.32.1 2.4.0 From 33ab54f1559f903ec78f6d568c0aee666b2ad804 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Nov 2021 23:46:30 +0100 Subject: [PATCH 0470/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 (#1702) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d52f96540e..4038352919 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20211017-1.32.1 - 2.4.0 + 2.5.0 From 8987086469ff3ce6320332353744b0adfbb2aefd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 16:59:26 +0100 Subject: [PATCH 0471/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20211106-1.32.1 (#1703) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4038352919..08f84fb6f0 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20211017-1.32.1 + v2-rev20211106-1.32.1 2.5.0 From c0f48f89967a4d0c409790b253fcc236242f8152 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 20:54:14 +0000 Subject: [PATCH 0472/2268] chore: release 2.4.0 (#1684) :robot: I have created a release \*beep\* \*boop\* --- ## [2.4.0](https://www.github.com/googleapis/java-bigquery/compare/v2.3.3...v2.4.0) (2021-11-15) ### Features * induce minor version bump for lts ([#1688](https://www.github.com/googleapis/java-bigquery/issues/1688)) ([6cb11db](https://www.github.com/googleapis/java-bigquery/commit/6cb11db5f15e7d617bc5aa4a3ac5fdacbe515b77)) ### Bug Fixes * **java:** java 17 dependency arguments ([#1683](https://www.github.com/googleapis/java-bigquery/issues/1683)) ([bef2705](https://www.github.com/googleapis/java-bigquery/commit/bef2705208abfc837d16f01758c802d817420dd4)) * removing a new line character in a property ([#1700](https://www.github.com/googleapis/java-bigquery/issues/1700)) ([5185801](https://www.github.com/googleapis/java-bigquery/commit/5185801797c620dba9de7e72b7dea8ddc600ed58)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20211106-1.32.1 ([#1703](https://www.github.com/googleapis/java-bigquery/issues/1703)) ([8987086](https://www.github.com/googleapis/java-bigquery/commit/8987086469ff3ce6320332353744b0adfbb2aefd)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#1702](https://www.github.com/googleapis/java-bigquery/issues/1702)) ([33ab54f](https://www.github.com/googleapis/java-bigquery/commit/33ab54f1559f903ec78f6d568c0aee666b2ad804)) * update dependency com.google.cloud:google-cloud-storage to v2.2.0 ([#1691](https://www.github.com/googleapis/java-bigquery/issues/1691)) ([1f46d8d](https://www.github.com/googleapis/java-bigquery/commit/1f46d8dd316f1c8df392f749428986d4d9c7fa07)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a316d02be..1b4ca17eb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.4.0](https://www.github.com/googleapis/java-bigquery/compare/v2.3.3...v2.4.0) (2021-11-15) + + +### Features + +* induce minor version bump for lts ([#1688](https://www.github.com/googleapis/java-bigquery/issues/1688)) ([6cb11db](https://www.github.com/googleapis/java-bigquery/commit/6cb11db5f15e7d617bc5aa4a3ac5fdacbe515b77)) + + +### Bug Fixes + +* **java:** java 17 dependency arguments ([#1683](https://www.github.com/googleapis/java-bigquery/issues/1683)) ([bef2705](https://www.github.com/googleapis/java-bigquery/commit/bef2705208abfc837d16f01758c802d817420dd4)) +* removing a new line character in a property ([#1700](https://www.github.com/googleapis/java-bigquery/issues/1700)) ([5185801](https://www.github.com/googleapis/java-bigquery/commit/5185801797c620dba9de7e72b7dea8ddc600ed58)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20211106-1.32.1 ([#1703](https://www.github.com/googleapis/java-bigquery/issues/1703)) ([8987086](https://www.github.com/googleapis/java-bigquery/commit/8987086469ff3ce6320332353744b0adfbb2aefd)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#1702](https://www.github.com/googleapis/java-bigquery/issues/1702)) ([33ab54f](https://www.github.com/googleapis/java-bigquery/commit/33ab54f1559f903ec78f6d568c0aee666b2ad804)) +* update dependency com.google.cloud:google-cloud-storage to v2.2.0 ([#1691](https://www.github.com/googleapis/java-bigquery/issues/1691)) ([1f46d8d](https://www.github.com/googleapis/java-bigquery/commit/1f46d8dd316f1c8df392f749428986d4d9c7fa07)) + ### [2.3.3](https://www.github.com/googleapis/java-bigquery/compare/v2.3.2...v2.3.3) (2021-10-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cbcee6bf1c..d8c4460322 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.3.4-SNAPSHOT + 2.4.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 88ea25fa47..94f7bafe69 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.3.4-SNAPSHOT + 2.4.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.3.4-SNAPSHOT + 2.4.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 08f84fb6f0..88c3c581f3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.3.4-SNAPSHOT + 2.4.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.3.4-SNAPSHOT + 2.4.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3394b8eb41..121cc3691c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.3.4-SNAPSHOT + 2.4.0 diff --git a/versions.txt b/versions.txt index faefa49f54..64215b915b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.3.3:2.3.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.4.0:2.4.0 \ No newline at end of file From d6f092e83034489719158a2fcc8f9f00bb885813 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 21:06:20 +0000 Subject: [PATCH 0473/2268] chore: release 2.4.1-SNAPSHOT (#1705) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d8c4460322..75a7667d95 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 94f7bafe69..4158b9b2fe 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.4.0 + 2.4.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.4.0 + 2.4.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 88c3c581f3..0f3a3f1333 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.4.0 + 2.4.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 121cc3691c..5e429991c0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.4.0 + 2.4.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 64215b915b..8053328d9b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.4.0:2.4.0 \ No newline at end of file +google-cloud-bigquery:2.4.0:2.4.1-SNAPSHOT \ No newline at end of file From 32c34ab52641ff16ad14884f53f67848bbdee0f0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Nov 2021 18:21:32 +0100 Subject: [PATCH 0474/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.6 (#1708) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.6 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9f0ac2232a..936d261ff3 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.3.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.4.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.3.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.4.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index df372f3aab..c0151a9733 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.5 + 2.1.6 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5e429991c0..62c3b271a1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.5 + 2.1.6 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9c273a6f87..709143ab2a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.5 + 2.1.6 test From a7899539d3a676861848814afec7596d2de326d4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Nov 2021 23:35:37 +0100 Subject: [PATCH 0475/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.4.0 (#1710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.4.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 936d261ff3..8bfe942c18 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.3.3 + 2.4.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c0151a9733..b94051f03e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.3.3 + 2.4.0 From 3e6ac614a92b492407a920601781ed654b8523c6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Nov 2021 23:35:54 +0100 Subject: [PATCH 0476/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.2.1 (#1709) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.2.1 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f3a3f1333..574acd9171 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ com.google.cloud google-cloud-storage - 2.2.0 + 2.2.1 test From f604ea8ba93bfd3791f8993930a5f8fdcb9c333f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:48:19 +0000 Subject: [PATCH 0477/2268] chore: release 2.4.1 (#1711) :robot: I have created a release \*beep\* \*boop\* --- ### [2.4.1](https://www.github.com/googleapis/java-bigquery/compare/v2.4.0...v2.4.1) (2021-11-16) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.2.1 ([#1709](https://www.github.com/googleapis/java-bigquery/issues/1709)) ([3e6ac61](https://www.github.com/googleapis/java-bigquery/commit/3e6ac614a92b492407a920601781ed654b8523c6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4ca17eb5..50caea76ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.4.1](https://www.github.com/googleapis/java-bigquery/compare/v2.4.0...v2.4.1) (2021-11-16) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.2.1 ([#1709](https://www.github.com/googleapis/java-bigquery/issues/1709)) ([3e6ac61](https://www.github.com/googleapis/java-bigquery/commit/3e6ac614a92b492407a920601781ed654b8523c6)) + ## [2.4.0](https://www.github.com/googleapis/java-bigquery/compare/v2.3.3...v2.4.0) (2021-11-15) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 75a7667d95..5ca5bc86e3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4158b9b2fe..3e4ec56c67 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.4.1-SNAPSHOT + 2.4.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.4.1-SNAPSHOT + 2.4.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 574acd9171..eda32fe314 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.4.1-SNAPSHOT + 2.4.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 62c3b271a1..f073aaab25 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.4.1-SNAPSHOT + 2.4.1 diff --git a/versions.txt b/versions.txt index 8053328d9b..5e60b03b87 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.4.0:2.4.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.4.1:2.4.1 \ No newline at end of file From 496f33e13fdc6853a28e5c4ba0b50a127fa9fbeb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Nov 2021 23:00:19 +0000 Subject: [PATCH 0478/2268] chore: release 2.4.2-SNAPSHOT (#1712) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5ca5bc86e3..00d70d0d70 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3e4ec56c67..c7ca6ceef9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.4.1 + 2.4.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.4.1 + 2.4.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index eda32fe314..6259be06ef 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.4.1 + 2.4.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f073aaab25..87346484e4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.4.1 + 2.4.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5e60b03b87..9ff5a8c492 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.4.1:2.4.1 \ No newline at end of file +google-cloud-bigquery:2.4.1:2.4.2-SNAPSHOT \ No newline at end of file From 63fa2bfa2357dd153527437f1769ac527e25ecd1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 17 Nov 2021 18:42:28 +0100 Subject: [PATCH 0479/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.2 (#1714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.2.1` -> `1.2.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.2/compatibility-slim/1.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.2/confidence-slim/1.2.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.2.2`](https://togithub.com/googleapis/java-shared-config/blob/master/CHANGELOG.md#​122-httpswwwgithubcomgoogleapisjava-shared-configcomparev121v122-2021-11-16) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.2.1...v1.2.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8bfe942c18..ad9fa6f09b 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.4.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.4.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.4.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.4.1" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 6259be06ef..08adc08b5d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.1 + 1.2.2 From 6d555d57ee2d86c7fe835ded74d9931c7d7807cc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 17 Nov 2021 20:02:37 +0100 Subject: [PATCH 0480/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.4.1 (#1713) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.4.0` -> `2.4.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.4.1/compatibility-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.4.1/confidence-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.4.1`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​241-httpswwwgithubcomgoogleapisjava-bigquerycomparev240v241-2021-11-16) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.4.0...v2.4.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ad9fa6f09b..b7643a88dc 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.4.0 + 2.4.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b94051f03e..81a4d65e81 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.4.0 + 2.4.1 From 58b1bfd494a559923d31daefc22ade96aa335c6b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 19 Nov 2021 20:26:55 +0100 Subject: [PATCH 0481/2268] test(deps): update dependency org.mockito:mockito-core to v4.1.0 (#1716) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08adc08b5d..72dda825ec 100644 --- a/pom.xml +++ b/pom.xml @@ -107,7 +107,7 @@ org.mockito mockito-core - 4.0.0 + 4.1.0 test From d9bbb277a6d13305fd8fc6c5ce7bd67a951c8f08 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 19 Nov 2021 20:27:08 +0100 Subject: [PATCH 0482/2268] test(deps): update datacatalog dependencies to v1.6.0 (#1715) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 72dda825ec..1cd0886d30 100644 --- a/pom.xml +++ b/pom.xml @@ -119,13 +119,13 @@ com.google.cloud google-cloud-datacatalog - 1.5.9 + 1.6.0 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.5.9 + 1.6.0 test From e7f1cf82449b0d7c62db5f753892c9a042da9f8f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 18:26:11 +0000 Subject: [PATCH 0483/2268] chore: remove enable-samples profile (#1284) (#1718) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/build.sh | 1 - CONTRIBUTING.md | 61 +++++---------------------------------- 3 files changed, 8 insertions(+), 56 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5d788be0b5..88d9b926c1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a744afda1956beb7bd6dc8d0b740a7839bbe402e34e2f4ef24589074db53ceb0 + digest: sha256:5b8c790f57cca57e6b37ba25f79291265c218cea3e6ba9714b001910ab3f1419 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 5454c3fc5d..e490e6cd70 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -91,7 +91,6 @@ samples) pushd ${SAMPLES_DIR} mvn -B \ - -Penable-samples \ -ntp \ -DtrimStackTrace=false \ -Dclirr.skip=true \ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2dbdee06b..b65dd279c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,12 +53,12 @@ mvn -Penable-integration-tests clean verify ## Code Samples -Code Samples must be bundled in separate Maven modules, and guarded by a -Maven profile with the name `enable-samples`. +All code samples must be in compliance with the [java sample formatting guide][3]. +Code Samples must be bundled in separate Maven modules. The samples must be separate from the primary project for a few reasons: -1. Primary projects have a minimum Java version of Java 7 whereas samples have - a minimum Java version of Java 8. Due to this we need the ability to +1. Primary projects have a minimum Java version of Java 8 whereas samples can have + Java version of Java 11. Due to this we need the ability to selectively exclude samples from a build run. 2. Many code samples depend on external GCP services and need credentials to access the service. @@ -68,39 +68,16 @@ The samples must be separate from the primary project for a few reasons: ### Building ```bash -mvn -Penable-samples clean verify +mvn clean verify ``` Some samples require access to GCP services and require a service account: ```bash export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json -mvn -Penable-samples clean verify +mvn clean verify ``` -### Profile Config - -1. To add samples in a profile to your Maven project, add the following to your -`pom.xml` - - ```xml - - [...] - - - enable-samples - - sample - - - - [...] - - ``` - -2. [Activate](#profile-activation) the profile. -3. Define your samples in a normal Maven project in the `samples/` directory. - ### Code Formatting Code in this repo is formatted with @@ -110,30 +87,6 @@ To run formatting on your project, you can run: mvn com.coveo:fmt-maven-plugin:format ``` -### Profile Activation - -To include code samples when building and testing the project, enable the -`enable-samples` Maven profile. - -#### Command line - -To activate the Maven profile on the command line add `-Penable-samples` to your -Maven command. - -#### Maven `settings.xml` - -To activate the Maven profile in your `~/.m2/settings.xml` add an entry of -`enable-samples` following the instructions in [Active Profiles][2]. - -This method has the benefit of applying to all projects you build (and is -respected by IntelliJ IDEA) and is recommended if you are going to be -contributing samples to several projects. - -#### IntelliJ IDEA - -To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in -[Activate Maven profiles][3] to activate `enable-samples`. - [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account [2]: https://maven.apache.org/settings.html#Active_Profiles -[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles +[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md \ No newline at end of file From 13cc6e608fd501067f7c5dcd2f5b9a03c078b065 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 1 Dec 2021 14:02:18 -0500 Subject: [PATCH 0484/2268] feat: add support for BI Engine Statistics (#1723) fixes b/205146044 --- .../google/cloud/bigquery/BiEngineReason.java | 92 ++++++++++++++++ .../google/cloud/bigquery/BiEngineStats.java | 101 ++++++++++++++++++ .../google/cloud/bigquery/JobStatistics.java | 22 ++++ .../cloud/bigquery/JobStatisticsTest.java | 12 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 8 ++ 5 files changed, 235 insertions(+) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineReason.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineStats.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineReason.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineReason.java new file mode 100644 index 0000000000..e682ba2461 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineReason.java @@ -0,0 +1,92 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +@AutoValue +public abstract class BiEngineReason implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + + /** + * High-level BI Engine reason for partial or disabled acceleration. + * + * @param code code or {@code null} for none + */ + public abstract Builder setCode(String code); + + /** + * Free form human-readable reason for partial or disabled acceleration. + * + * @param message message or {@code null} for none + */ + public abstract Builder setMessage(String message); + + /** Creates a {@code BiEngineReason} object. */ + public abstract BiEngineReason build(); + } + + /** + * High-level BI Engine reason for partial or disabled acceleration. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getCode(); + + /** + * Free form human-readable reason for partial or disabled acceleration. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getMessage(); + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_BiEngineReason.Builder(); + } + + com.google.api.services.bigquery.model.BiEngineReason toPb() { + com.google.api.services.bigquery.model.BiEngineReason biEngineReasonPb = + new com.google.api.services.bigquery.model.BiEngineReason(); + if (getCode() != null) { + biEngineReasonPb.setCode(getCode()); + } + if (getMessage() != null) { + biEngineReasonPb.setMessage(getMessage()); + } + return biEngineReasonPb; + } + + static BiEngineReason fromPb( + com.google.api.services.bigquery.model.BiEngineReason biEngineReasonPb) { + Builder builder = newBuilder(); + if (biEngineReasonPb.getCode() != null) { + builder.setCode(biEngineReasonPb.getCode()); + } + if (biEngineReasonPb.getMessage() != null) { + builder.setMessage(biEngineReasonPb.getMessage()); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineStats.java new file mode 100644 index 0000000000..34d6c43268 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BiEngineStats.java @@ -0,0 +1,101 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.BiEngineStatistics; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** BIEngineStatistics contains query statistics specific to the use of BI Engine. */ +@AutoValue +public abstract class BiEngineStats implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + /** + * Specifies which mode of BI Engine acceleration was performed (if any). + * + * @param biEngineMode biEngineMode or {@code null} for none + */ + public abstract Builder setBiEngineMode(String biEngineMode); + + /** + * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to + * why BI Engine could not accelerate. In case the full query was accelerated, this field is not + * populated. + * + * @param biEngineReasons biEngineReasons or {@code null} for none + */ + public abstract Builder setBiEngineReasons(List biEngineReasons); + + /** Creates a @code BiEngineStats} object. */ + public abstract BiEngineStats build(); + } + + /** + * Specifies which mode of BI Engine acceleration was performed (if any). + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getBiEngineMode(); + + /** + * In case of DISABLED or PARTIAL bi_engine_mode, these contain the explanatory reasons as to why + * BI Engine could not accelerate. In case the full query was accelerated, this field is not + * populated. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract List getBiEngineReasons(); + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_BiEngineStats.Builder(); + } + + BiEngineStatistics toPb() { + BiEngineStatistics biEngineStatisticsPb = new BiEngineStatistics(); + if (getBiEngineMode() != null) { + biEngineStatisticsPb.setBiEngineMode(getBiEngineMode()); + } + if (getBiEngineReasons() != null) { + biEngineStatisticsPb.setBiEngineReasons( + getBiEngineReasons().stream().map(BiEngineReason::toPb).collect(Collectors.toList())); + } + return biEngineStatisticsPb; + } + + static BiEngineStats fromPb(BiEngineStatistics biEngineStatisticsPb) { + Builder builder = newBuilder(); + if (biEngineStatisticsPb.getBiEngineMode() != null) { + builder.setBiEngineMode(biEngineStatisticsPb.getBiEngineMode()); + } + if (biEngineStatisticsPb.getBiEngineReasons() != null) { + builder.setBiEngineReasons( + biEngineStatisticsPb.getBiEngineReasons().stream() + .map(BiEngineReason::fromPb) + .collect(Collectors.toList())); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 999f8d2fe3..ab9fdabb39 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -321,6 +321,7 @@ public static class QueryStatistics extends JobStatistics { private static final long serialVersionUID = 7539354109226732353L; + private final BiEngineStats biEngineStats; private final Integer billingTier; private final Boolean cacheHit; private final String ddlOperationPerformed; @@ -402,6 +403,7 @@ public static StatementType[] values() { static final class Builder extends JobStatistics.Builder { + private BiEngineStats biEngineStats; private Integer billingTier; private Boolean cacheHit; private String ddlOperationPerformed; @@ -425,6 +427,10 @@ private Builder() {} private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsPb) { super(statisticsPb); if (statisticsPb.getQuery() != null) { + if (statisticsPb.getQuery().getBiEngineStatistics() != null) { + this.biEngineStats = + BiEngineStats.fromPb(statisticsPb.getQuery().getBiEngineStatistics()); + } this.billingTier = statisticsPb.getQuery().getBillingTier(); this.cacheHit = statisticsPb.getQuery().getCacheHit(); this.ddlOperationPerformed = statisticsPb.getQuery().getDdlOperationPerformed(); @@ -468,6 +474,11 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP } } + Builder setBiEngineStats(BiEngineStats biEngineStats) { + this.biEngineStats = biEngineStats; + return self(); + } + Builder setBillingTier(Integer billingTier) { this.billingTier = billingTier; return self(); @@ -566,6 +577,7 @@ QueryStatistics build() { private QueryStatistics(Builder builder) { super(builder); + this.biEngineStats = builder.biEngineStats; this.billingTier = builder.billingTier; this.cacheHit = builder.cacheHit; this.ddlOperationPerformed = builder.ddlOperationPerformed; @@ -585,6 +597,11 @@ private QueryStatistics(Builder builder) { this.schema = builder.schema; } + /** Returns query statistics specific to the use of BI Engine. */ + public BiEngineStats getBiEngineStats() { + return biEngineStats; + } + /** Returns the billing tier for the job. */ public Integer getBillingTier() { return billingTier; @@ -701,6 +718,7 @@ public Schema getSchema() { @Override ToStringHelper toStringHelper() { return super.toStringHelper() + .add("biEngineStats", biEngineStats) .add("billingTier", billingTier) .add("cacheHit", cacheHit) .add("totalBytesBilled", totalBytesBilled) @@ -722,6 +740,7 @@ public final boolean equals(Object obj) { public final int hashCode() { return Objects.hash( baseHashCode(), + biEngineStats, billingTier, cacheHit, totalBytesBilled, @@ -733,6 +752,9 @@ public final int hashCode() { @Override com.google.api.services.bigquery.model.JobStatistics toPb() { JobStatistics2 queryStatisticsPb = new JobStatistics2(); + if (biEngineStats != null) { + queryStatisticsPb.setBiEngineStatistics(biEngineStats.toPb()); + } queryStatisticsPb.setBillingTier(billingTier); queryStatisticsPb.setCacheHit(cacheHit); queryStatisticsPb.setDdlOperationPerformed(ddlOperationPerformed); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 87fae41b58..0dad46e9e8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -36,6 +36,16 @@ public class JobStatisticsTest { + private static final BiEngineReason BI_ENGINE_REASON = + BiEngineReason.newBuilder() + .setMessage("Detected unsupported join type") + .setCode("UNSUPPORTED_SQL_TEXT") + .build(); + private static final BiEngineStats BI_ENGINE_STATS = + BiEngineStats.newBuilder() + .setBiEngineReasons(ImmutableList.of(BI_ENGINE_REASON)) + .setBiEngineMode("DISABLED") + .build(); private static final Integer BILLING_TIER = 42; private static final Boolean CACHE_HIT = true; private static final String DDL_OPERATION_PERFORMED = "SKIP"; @@ -154,6 +164,7 @@ public class JobStatisticsTest { .setCreationTimestamp(CREATION_TIME) .setEndTime(END_TIME) .setStartTime(START_TIME) + .setBiEngineStats(BI_ENGINE_STATS) .setBillingTier(BILLING_TIER) .setCacheHit(CACHE_HIT) .setDDLOperationPerformed(DDL_OPERATION_PERFORMED) @@ -246,6 +257,7 @@ public void testBuilder() { assertEquals(CREATION_TIME, QUERY_STATISTICS.getCreationTime()); assertEquals(START_TIME, QUERY_STATISTICS.getStartTime()); assertEquals(END_TIME, QUERY_STATISTICS.getEndTime()); + assertEquals(BI_ENGINE_STATS, QUERY_STATISTICS.getBiEngineStats()); assertEquals(BILLING_TIER, QUERY_STATISTICS.getBillingTier()); assertEquals(CACHE_HIT, QUERY_STATISTICS.getCacheHit()); assertEquals(DDL_OPERATION_PERFORMED, QUERY_STATISTICS.getDdlOperationPerformed()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8460bccb78..479a80e89f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2900,6 +2900,14 @@ public void testQueryJob() throws InterruptedException, TimeoutException { assertTrue(bigquery.delete(destinationTable)); Job queryJob = bigquery.getJob(remoteJob.getJobId()); JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + if (statistics.getBiEngineStats() != null) { + assertEquals(statistics.getBiEngineStats().getBiEngineMode(), "DISABLED"); + assertEquals( + statistics.getBiEngineStats().getBiEngineReasons().get(0).getCode(), "OTHER_REASON"); + assertEquals( + statistics.getBiEngineStats().getBiEngineReasons().get(0).getMessage(), + "Query output to destination table is not supported."); + } assertNotNull(statistics.getQueryPlan()); } From b07d12eb8894e62726e30b35fa6720fbd3c420af Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 02:46:17 +0000 Subject: [PATCH 0485/2268] chore: release 2.5.0 (#1724) :robot: I have created a release \*beep\* \*boop\* --- ## [2.5.0](https://www.github.com/googleapis/java-bigquery/compare/v2.4.1...v2.5.0) (2021-12-01) ### Features * add support for BI Engine Statistics ([#1723](https://www.github.com/googleapis/java-bigquery/issues/1723)) ([13cc6e6](https://www.github.com/googleapis/java-bigquery/commit/13cc6e608fd501067f7c5dcd2f5b9a03c078b065)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50caea76ae..4e23ce49a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.5.0](https://www.github.com/googleapis/java-bigquery/compare/v2.4.1...v2.5.0) (2021-12-01) + + +### Features + +* add support for BI Engine Statistics ([#1723](https://www.github.com/googleapis/java-bigquery/issues/1723)) ([13cc6e6](https://www.github.com/googleapis/java-bigquery/commit/13cc6e608fd501067f7c5dcd2f5b9a03c078b065)) + ### [2.4.1](https://www.github.com/googleapis/java-bigquery/compare/v2.4.0...v2.4.1) (2021-11-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 00d70d0d70..9ca71411f7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.4.2-SNAPSHOT + 2.5.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c7ca6ceef9..4eeeae45db 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.4.2-SNAPSHOT + 2.5.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.4.2-SNAPSHOT + 2.5.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1cd0886d30..f8ed583ed5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.4.2-SNAPSHOT + 2.5.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.4.2-SNAPSHOT + 2.5.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 87346484e4..897db4586e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.4.2-SNAPSHOT + 2.5.0 diff --git a/versions.txt b/versions.txt index 9ff5a8c492..0b56dac06b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.4.1:2.4.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.5.0:2.5.0 \ No newline at end of file From bbf2915a70e2d358b25eb631b34e33ec18917ed8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 03:00:44 +0000 Subject: [PATCH 0486/2268] chore: release 2.5.1-SNAPSHOT (#1725) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9ca71411f7..2757f58db5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.5.0 + 2.5.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4eeeae45db..19aef0b1db 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.5.0 + 2.5.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.5.0 + 2.5.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f8ed583ed5..c37d4f3430 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.5.0 + 2.5.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.5.0 + 2.5.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 897db4586e..33798b73c5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.5.0 + 2.5.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0b56dac06b..c8c300aeff 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.5.0:2.5.0 \ No newline at end of file +google-cloud-bigquery:2.5.0:2.5.1-SNAPSHOT \ No newline at end of file From a3ba13decd8e6bb329b0ab1d85704d48409a1820 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Dec 2021 20:50:04 +0100 Subject: [PATCH 0487/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.5.0 (#1726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.5.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b7643a88dc..5be608437b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.4.1 + 2.5.0 ``` @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.4.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.5.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.4.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.5.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 81a4d65e81..8287c43e99 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.4.1 + 2.5.0 From cc8d2e0da885983e86edb1071ae5b8ddbebbbaf7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:50:29 -0500 Subject: [PATCH 0488/2268] chore: fix regex in formatter to match string (#1296) (#1728) Source-Link: https://github.com/googleapis/synthtool/commit/a14177060a552462b9642baad132bd17f47ecd6f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:0ab8611cd29e7aba8413c6f83ed1734b60fddf845b4a37808b742302d32dd043 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 88d9b926c1..fd19c5541f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:5b8c790f57cca57e6b37ba25f79291265c218cea3e6ba9714b001910ab3f1419 + digest: sha256:0ab8611cd29e7aba8413c6f83ed1734b60fddf845b4a37808b742302d32dd043 From 3b4b0755eea06f8d1e5c290fc9aae500676e7213 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Dec 2021 17:18:37 +0100 Subject: [PATCH 0489/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 (#1731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.5.0` -> `2.5.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.5.1/compatibility-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.5.1/confidence-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v2.5.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/master/CHANGELOG.md#​251-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare250v251-2021-12-03) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.5.0...v2.5.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c37d4f3430..266f43b954 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20211106-1.32.1 - 2.5.0 + 2.5.1
From 6d503e887d44d76a10fee6c9eaad69ae926b2489 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Dec 2021 18:06:12 +0100 Subject: [PATCH 0490/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.3.0 (#1730) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8287c43e99..903a7915b8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.2.0 + 2.3.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 33798b73c5..1252d7bbce 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.2.0 + 2.3.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 709143ab2a..69d68ada6b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.2.0 + 2.3.0 test From 4b3102126b0fca64ed90d46004fb387f48f0ca6c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 3 Dec 2021 17:32:22 +0000 Subject: [PATCH 0491/2268] chore: release 2.5.1 (#1732) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.1](https://www.github.com/googleapis/java-bigquery/compare/v2.5.0...v2.5.1) (2021-12-03) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.3.0 ([#1730](https://www.github.com/googleapis/java-bigquery/issues/1730)) ([6d503e8](https://www.github.com/googleapis/java-bigquery/commit/6d503e887d44d76a10fee6c9eaad69ae926b2489)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#1731](https://www.github.com/googleapis/java-bigquery/issues/1731)) ([3b4b075](https://www.github.com/googleapis/java-bigquery/commit/3b4b0755eea06f8d1e5c290fc9aae500676e7213)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e23ce49a0..3afff959c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.5.1](https://www.github.com/googleapis/java-bigquery/compare/v2.5.0...v2.5.1) (2021-12-03) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.3.0 ([#1730](https://www.github.com/googleapis/java-bigquery/issues/1730)) ([6d503e8](https://www.github.com/googleapis/java-bigquery/commit/6d503e887d44d76a10fee6c9eaad69ae926b2489)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#1731](https://www.github.com/googleapis/java-bigquery/issues/1731)) ([3b4b075](https://www.github.com/googleapis/java-bigquery/commit/3b4b0755eea06f8d1e5c290fc9aae500676e7213)) + ## [2.5.0](https://www.github.com/googleapis/java-bigquery/compare/v2.4.1...v2.5.0) (2021-12-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2757f58db5..11702beed6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.5.1-SNAPSHOT + 2.5.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 19aef0b1db..5e4fd42fb5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.5.1-SNAPSHOT + 2.5.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.5.1-SNAPSHOT + 2.5.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 266f43b954..267afdb5c7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.5.1-SNAPSHOT + 2.5.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.5.1-SNAPSHOT + 2.5.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1252d7bbce..04da45ef81 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.5.1-SNAPSHOT + 2.5.1 diff --git a/versions.txt b/versions.txt index c8c300aeff..1b2ae277d4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.5.0:2.5.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.5.1:2.5.1 \ No newline at end of file From d5f67240c73c7cb0a2f559f1399fa5e0479eddb4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 3 Dec 2021 17:52:22 +0000 Subject: [PATCH 0492/2268] chore: release 2.5.2-SNAPSHOT (#1733) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 11702beed6..f5f80664e9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.5.1 + 2.5.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5e4fd42fb5..fd38262005 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.5.1 + 2.5.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.5.1 + 2.5.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 267afdb5c7..12e616bf3e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.5.1 + 2.5.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -76,7 +76,7 @@ com.google.cloud google-cloud-bigquery - 2.5.1 + 2.5.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 04da45ef81..4b918bade3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.5.1 + 2.5.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1b2ae277d4..d55ef60c2f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.5.1:2.5.1 \ No newline at end of file +google-cloud-bigquery:2.5.1:2.5.2-SNAPSHOT \ No newline at end of file From 2db8a1e68bef904c2855826a64fa21ab0408e1ef Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Dec 2021 20:41:06 +0100 Subject: [PATCH 0493/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.7 (#1734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.7 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5be608437b..e9e938e13b 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.5.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.5.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.5.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.5.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 903a7915b8..7be83fac1b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.6 + 2.1.7 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4b918bade3..1ec96921cf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.6 + 2.1.7 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 69d68ada6b..aac0235b65 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.6 + 2.1.7 test From 585875e776e17660c58f9f8fe8385f13833bca57 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:04:20 +0000 Subject: [PATCH 0494/2268] fix(java): add -ntp flag to native image testing command (#1299) (#1738) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fd19c5541f..3d2f828246 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:0ab8611cd29e7aba8413c6f83ed1734b60fddf845b4a37808b742302d32dd043 + digest: sha256:a4d7b2cfc6a9d6b378a6b2458740eae15fcab28854bd23dad3a15102d2e47c87 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index e490e6cd70..d01df07d4b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,7 +71,7 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn test -Pnative -Penable-integration-tests + mvn -ntp -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; samples) From 8438282fff6f722c77a48374455d41c3a9ae8f84 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Dec 2021 23:26:10 +0100 Subject: [PATCH 0495/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.5.1 (#1736) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.5.0` -> `2.5.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.5.1/compatibility-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.5.1/confidence-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-bigquery ### [`v2.5.1`](https://togithub.com/googleapis/java-bigquery/blob/master/CHANGELOG.md#​251-httpswwwgithubcomgoogleapisjava-bigquerycomparev250v251-2021-12-03) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.5.0...v2.5.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9e938e13b..0db82955b8 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.5.0 + 2.5.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7be83fac1b..2ad44ea93d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.5.0 + 2.5.1 From 2022301b39390f20796b8c5b3d6ee0e82aa127aa Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Dec 2021 23:28:20 +0100 Subject: [PATCH 0496/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.2.2 (#1740) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.2.1` -> `2.2.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.2.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.2.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.2.2/compatibility-slim/2.2.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.2.2/confidence-slim/2.2.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.2.2`](https://togithub.com/googleapis/java-storage/blob/master/CHANGELOG.md#​222-httpswwwgithubcomgoogleapisjava-storagecomparev221v222-2021-12-06) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.2.1...v2.2.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12e616bf3e..94f9662560 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ com.google.cloud google-cloud-storage - 2.2.1 + 2.2.2 test From 776ff1004592f62799ff0244a448d6911bcca5be Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Dec 2021 00:02:02 +0100 Subject: [PATCH 0497/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20211129-1.32.1 (#1737) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94f9662560..8a885c4cb5 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20211106-1.32.1 + v2-rev20211129-1.32.1 2.5.1
From b2720805f4e092ba2f1b258f3b7ded3eabea5bae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Dec 2021 00:22:10 +0100 Subject: [PATCH 0498/2268] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.2.0 (#1729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud.samples:shared-configuration](https://togithub.com/GoogleCloudPlatform/java-repo-tools) | `1.0.23` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/compatibility-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/confidence-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
GoogleCloudPlatform/java-repo-tools ### [`v1.2.0`](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0) [Compare Source](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0) ### [`v1.0.24`](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24) [Compare Source](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2ad44ea93d..265ae2881d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.23 + 1.2.0 diff --git a/samples/pom.xml b/samples/pom.xml index f2bb68bedb..4e9299af44 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -34,7 +34,7 @@ com.google.cloud.samples shared-configuration - 1.0.23 + 1.2.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1ec96921cf..b0e519aeda 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.0.23 + 1.2.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index aac0235b65..cb277cd1b6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud.samples shared-configuration - 1.0.23 + 1.2.0 From 2f31a0a4f491eca25cbd3992e48f94214bfd605b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Dec 2021 17:43:56 +0100 Subject: [PATCH 0499/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.3.1 (#1741) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 265ae2881d..5a3766eb5d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.3.0 + 2.3.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b0e519aeda..42120f0cbc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.3.0 + 2.3.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cb277cd1b6..e0f8c13df2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.3.0 + 2.3.1 test From 5212417b856520a17f601c4c6e36db8becce9669 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 7 Dec 2021 12:24:19 -0500 Subject: [PATCH 0500/2268] chore: make owlbot check required (#1743) --- .github/sync-repo-settings.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 583a840c4d..960ae2ba05 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -16,6 +16,7 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google + - OwlBot Post Processor - pattern: 1.127.12-sp isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -60,6 +61,7 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google + - OwlBot Post Processor permissionRules: - team: api-bigquery permission: admin From 3b9e90b74d2fee4c3f490a536c48625dde433594 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Dec 2021 19:23:08 +0100 Subject: [PATCH 0501/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog to v1.6.1 (#1735) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-datacatalog to v1.6.1 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update README.md * update version of proto-google-cloud-datacatalog-v1 to 1.6.1 too Strange that renovate-bot did not propose this change too. Co-authored-by: Owl Bot Co-authored-by: Stephanie Wang --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8a885c4cb5..7f00e1175b 100644 --- a/pom.xml +++ b/pom.xml @@ -119,13 +119,13 @@ com.google.cloud google-cloud-datacatalog - 1.6.0 + 1.6.1 test com.google.api.grpc proto-google-cloud-datacatalog-v1 - 1.6.0 + 1.6.1 test From 92e5d02ff25511233b15f07844bb8b13de2dc72f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Dec 2021 17:05:34 +0100 Subject: [PATCH 0502/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.4.0 (#1746) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5a3766eb5d..092fd82b23 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.3.1 + 2.4.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 42120f0cbc..a4d95e2203 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.3.1 + 2.4.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e0f8c13df2..1ae73891e0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.3.1 + 2.4.0 test From faf5897d8fa3b32ddad38eee88886edb031b2a26 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 11 Dec 2021 00:34:16 +0100 Subject: [PATCH 0503/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.1.0 (#1748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `24.0.0` -> `24.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.0/compatibility-slim/24.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.0/confidence-slim/24.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/snippets/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0db82955b8..939da9572e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.0.0 + 24.1.0 pom import @@ -51,7 +51,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.0.0') +implementation platform('com.google.cloud:libraries-bom:24.1.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1ae73891e0..bd9ece0d55 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.0.0 + 24.1.0 pom import From 97a61dc90fb701986a51a12c9c83b7138894307a Mon Sep 17 00:00:00 2001 From: Franklin Whaite <70151215+franklinWhaite@users.noreply.github.com> Date: Tue, 14 Dec 2021 15:00:09 -0500 Subject: [PATCH 0504/2268] feat: create Job retry for rate limit exceeded with status code 200 (#1744) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * retrying job create with new job id each time * retrying for rate limit exceeded on create Job regardless of the status code 200 * removing flattened pom * refactoring, removing unnecesary variables, adding comments * linting code * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * refactoring, removing comments Co-authored-by: Owl Bot --- .../google/cloud/bigquery/BigQueryImpl.java | 37 ++++++++++++------- .../bigquery/BigQueryRetryAlgorithm.java | 25 ++++++++++--- .../cloud/bigquery/BigQueryImplTest.java | 24 ++++++++++++ 3 files changed, 67 insertions(+), 19 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 7d0e4c5550..16814e99a3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -347,15 +347,9 @@ public JobId get() { @InternalApi("visible for testing") Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { - boolean idRandom = false; - if (jobInfo.getJobId() == null) { - jobInfo = jobInfo.toBuilder().setJobId(idProvider.get()).build(); - idRandom = true; - } - final com.google.api.services.bigquery.model.Job jobPb = - jobInfo.setProjectId(getOptions().getProjectId()).toPb(); - final Map optionsMap = optionMap(options); + final boolean idRandom = (jobInfo.getJobId() == null); + final Map optionsMap = optionMap(options); BigQueryException createException; // NOTE(pongad): This double-try structure is admittedly odd. // translateAndThrow itself throws, and pretends to return an exception only @@ -363,21 +357,36 @@ Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { // This makes it difficult to translate without throwing. // Fixing this entails some work on BaseServiceException.translate. // Since that affects a bunch of APIs, we should fix this as a separate change. + final JobId[] finalJobId = new JobId[1]; try { try { return Job.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override public com.google.api.services.bigquery.model.Job call() { - return bigQueryRpc.create(jobPb, optionsMap); + if (idRandom) { + // re-generate a new random job with the same jobInfo when jobId is not + // provided by the user + JobInfo recreatedJobInfo = + jobInfo.toBuilder().setJobId(idProvider.get()).build(); + com.google.api.services.bigquery.model.Job newJobPb = + recreatedJobInfo.setProjectId(getOptions().getProjectId()).toPb(); + finalJobId[0] = recreatedJobInfo.getJobId(); + return bigQueryRpc.create(newJobPb, optionsMap); + } else { + com.google.api.services.bigquery.model.Job jobPb = + jobInfo.setProjectId(getOptions().getProjectId()).toPb(); + return bigQueryRpc.create(jobPb, optionsMap); + } } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + EXCEPTION_HANDLER, + getOptions().getClock(), + DEFAULT_RETRY_CONFIG)); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } catch (BigQueryException e) { @@ -396,7 +405,7 @@ public com.google.api.services.bigquery.model.Job call() { // fetch a job created by someone else. Job job; try { - job = getJob(jobInfo.getJobId()); + job = getJob(finalJobId[0]); } catch (BigQueryException e) { throw createException; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index a4e642191c..af472430fc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -72,7 +72,8 @@ public boolean shouldRetry( // the exception messages boolean shouldRetry = (shouldRetryBasedOnResult(context, previousThrowable, previousResponse) - || shouldRetryBasedOnBigQueryRetryConfig(previousThrowable, bigQueryRetryConfig)) + || shouldRetryBasedOnBigQueryRetryConfig( + previousThrowable, bigQueryRetryConfig, previousResponse)) && shouldRetryBasedOnTiming(context, nextAttemptSettings); if (LOG.isLoggable(Level.FINEST)) { @@ -92,13 +93,26 @@ public boolean shouldRetry( } private boolean shouldRetryBasedOnBigQueryRetryConfig( - Throwable previousThrowable, BigQueryRetryConfig bigQueryRetryConfig) { + Throwable previousThrowable, + BigQueryRetryConfig bigQueryRetryConfig, + ResponseT previousResponse) { /* We are deciding if a given error should be retried on the basis of error message. Cannot rely on Error/Status code as for example error code 400 (which is not retriable) could be thrown due to rateLimitExceed, which is retriable */ - String errorDesc; - if (previousThrowable != null && (errorDesc = previousThrowable.getMessage()) != null) { + String errorDesc = null; + if (previousThrowable != null) { + errorDesc = previousThrowable.getMessage(); + } else if (previousResponse != null) { + /* + In some cases error messages may come without an exception + e.g. status code 200 with a rate limit exceeded for job create + in these cases there is now previousThrowable so we need to check previousResponse + */ + errorDesc = previousResponse.toString(); + } + + if (errorDesc != null) { errorDesc = errorDesc.toLowerCase(); // for case insensitive comparison for (Iterator retriableMessages = bigQueryRetryConfig.getRetriableErrorMessages().iterator(); @@ -161,7 +175,8 @@ public TimedAttemptSettings createNextAttempt( if (!((shouldRetryBasedOnResult(context, previousThrowable, previousResponse) || shouldRetryBasedOnBigQueryRetryConfig( previousThrowable, - bigQueryRetryConfig)))) { // Calling shouldRetryBasedOnBigQueryRetryConfig to check if + bigQueryRetryConfig, + previousResponse)))) { // Calling shouldRetryBasedOnBigQueryRetryConfig to check if // the error message could be retried return null; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 760c84f32a..b00d4b8607 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -1529,6 +1529,30 @@ public void testCreateJobSuccess() { verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } + @Test + public void testCreateJobFailureShouldRetry() { + when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + .thenThrow(new BigQueryException(500, "InternalError")) + .thenThrow(new BigQueryException(502, "Bad Gateway")) + .thenThrow(new BigQueryException(503, "Service Unavailable")) + .thenThrow( + new BigQueryException( + 400, RATE_LIMIT_ERROR_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG + .thenThrow(new BigQueryException(200, RATE_LIMIT_ERROR_MSG)) + .thenReturn(newJobPb()); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + ((BigQueryImpl) bigquery).create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY)); + verify(bigqueryRpcMock, times(6)).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + } + @Test public void testCreateJobWithSelectedFields() { when(bigqueryRpcMock.create( From 7509e1c5ae202def5e9ce130d5af55ad39f40c6b Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 15 Dec 2021 16:16:10 -0500 Subject: [PATCH 0505/2268] chore: update README to add missing closing tag (#1749) Related to #1745 --- README.md | 1 + samples/snippets/pom.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 939da9572e..131446e042 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud google-cloud-bigquery + ``` diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bd9ece0d55..a0e99f44ab 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -100,7 +100,9 @@ 1.1.3 test + + From a87ac462b83cc0cc76f81ddf409f494c9a29185b Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 16 Dec 2021 10:34:51 -0500 Subject: [PATCH 0506/2268] chore: import datacatalog BOM to avoid renovate-bot issues (#1751) Towards #1747 --- google-cloud-bigquery/pom.xml | 18 ++++++++++-------- pom.xml | 20 ++++++++------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index fd38262005..576ec66e9e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -29,14 +29,6 @@ com.google.http-client google-http-client-jackson2 - - com.google.cloud - google-cloud-datacatalog - - - com.google.api.grpc - proto-google-cloud-datacatalog-v1 - com.google.cloud google-cloud-storage @@ -116,6 +108,16 @@ assertj-core test + + com.google.cloud + google-cloud-datacatalog + test + + + com.google.api.grpc + proto-google-cloud-datacatalog-v1 + test + diff --git a/pom.xml b/pom.xml index 7f00e1175b..7641770024 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,14 @@ import + + com.google.cloud + google-cloud-datacatalog-bom + 1.6.1 + pom + import + + org.checkerframework checker-compat-qual @@ -116,18 +124,6 @@ 2.2.2 test - - com.google.cloud - google-cloud-datacatalog - 1.6.1 - test - - - com.google.api.grpc - proto-google-cloud-datacatalog-v1 - 1.6.1 - test - org.assertj assertj-core From 22a9e4c5183289696aa624378461b8e5c1b2954c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 16 Dec 2021 18:09:40 +0100 Subject: [PATCH 0507/2268] test(deps): update dependency org.mockito:mockito-core to v4.2.0 (#1752) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7641770024..9c6aba59e4 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ org.mockito mockito-core - 4.1.0 + 4.2.0 test From a62a9f4fdda465b8c9e2f67f111d1b1b4a067903 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 16 Dec 2021 13:53:11 -0500 Subject: [PATCH 0508/2268] docs(samples): update UpdateTableExpirationIT to fix failing IT. (#1753) --- .../java/com/example/bigquery/UpdateTableExpirationIT.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateTableExpirationIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateTableExpirationIT.java index e9f03e87e5..1e3b8980f9 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateTableExpirationIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateTableExpirationIT.java @@ -24,8 +24,9 @@ import com.google.cloud.bigquery.StandardSQLTypeName; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.time.Instant; +import java.time.temporal.ChronoUnit; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; @@ -81,7 +82,8 @@ public void tearDown() { @Test public void testUpdateTableExpiration() { - Long newExpiration = TimeUnit.MILLISECONDS.convert(1, TimeUnit.DAYS); + // Set new expiration to a week from Now + Long newExpiration = Instant.now().plus(7, ChronoUnit.DAYS).toEpochMilli(); UpdateTableExpiration.updateTableExpiration(BIGQUERY_DATASET_NAME, tableName, newExpiration); assertThat(bout.toString()).contains("Table expiration updated successfully"); } From 0b7d91135222505f0eb01e8b40095156a073b62e Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 20 Dec 2021 08:08:30 -0800 Subject: [PATCH 0509/2268] docs: rename alter materialized view to update (#1754) Alter implies a DDL sql ALTER MATERIALIZED VIEW statement, the code sample is purely an API update example. --- README.md | 2 +- ...edView.java => UpdateMaterializedView.java} | 18 +++++++++--------- ...ewIT.java => UpdateMaterializedViewIT.java} | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) rename samples/snippets/src/main/java/com/example/bigquery/{AlterMaterializedView.java => UpdateMaterializedView.java} (79%) rename samples/snippets/src/test/java/com/example/bigquery/{AlterMaterializedViewIT.java => UpdateMaterializedViewIT.java} (90%) diff --git a/README.md b/README.md index 131446e042..cb2c239487 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | --------------------------- | --------------------------------- | ------ | | Add Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | | Add Empty Column | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | -| Alter Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java) | | Auth Drive Scope | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | | Auth Snippets | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | | Auth User Flow | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | @@ -235,6 +234,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Update Dataset Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetExpiration.java) | | Update Dataset Partition Expiration | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateDatasetPartitionExpiration.java) | | Update Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateIamPolicy.java) | +| Update Materialized View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateMaterializedView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateMaterializedView.java) | | Update Model Description | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateModelDescription.java) | | Update Routine | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateRoutine.java) | | Update Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/UpdateTableCmek.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java b/samples/snippets/src/main/java/com/example/bigquery/UpdateMaterializedView.java similarity index 79% rename from samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java rename to samples/snippets/src/main/java/com/example/bigquery/UpdateMaterializedView.java index 8ce25196f3..4de1273443 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/AlterMaterializedView.java +++ b/samples/snippets/src/main/java/com/example/bigquery/UpdateMaterializedView.java @@ -16,7 +16,7 @@ package com.example.bigquery; -// [START bigquery_alter_materialized_view] +// [START bigquery_update_materialized_view] import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; @@ -24,17 +24,17 @@ import com.google.cloud.bigquery.Table; import com.google.cloud.bigquery.TableId; -// Sample to alter materialized view -public class AlterMaterializedView { +// Sample to update materialized view +public class UpdateMaterializedView { public static void main(String[] args) { // TODO(developer): Replace these variables before running the sample. String datasetName = "MY_DATASET_NAME"; String materializedViewName = "MY_MATERIALIZED_VIEW_NAME"; - alterMaterializedView(datasetName, materializedViewName); + updateMaterializedView(datasetName, materializedViewName); } - public static void alterMaterializedView(String datasetName, String materializedViewName) { + public static void updateMaterializedView(String datasetName, String materializedViewName) { try { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. @@ -45,17 +45,17 @@ public static void alterMaterializedView(String datasetName, String materialized // Get existing materialized view Table table = bigquery.getTable(tableId); MaterializedViewDefinition materializedViewDefinition = table.getDefinition(); - // Alter materialized view + // Update materialized view materializedViewDefinition .toBuilder() .setEnableRefresh(true) .setRefreshIntervalMs(1000L) .build(); table.toBuilder().setDefinition(materializedViewDefinition).build().update(); - System.out.println("Materialized view altered successfully"); + System.out.println("Materialized view updated successfully"); } catch (BigQueryException e) { - System.out.println("Materialized view was not altered. \n" + e.toString()); + System.out.println("Materialized view was not updated. \n" + e.toString()); } } } -// [END bigquery_alter_materialized_view] +// [END bigquery_update_materialized_view] diff --git a/samples/snippets/src/test/java/com/example/bigquery/AlterMaterializedViewIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateMaterializedViewIT.java similarity index 90% rename from samples/snippets/src/test/java/com/example/bigquery/AlterMaterializedViewIT.java rename to samples/snippets/src/test/java/com/example/bigquery/UpdateMaterializedViewIT.java index 3cc5dfa7c4..54ed2194a4 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/AlterMaterializedViewIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateMaterializedViewIT.java @@ -32,7 +32,7 @@ import org.junit.BeforeClass; import org.junit.Test; -public class AlterMaterializedViewIT { +public class UpdateMaterializedViewIT { private static final String ID = UUID.randomUUID().toString().substring(0, 8); private final Logger log = Logger.getLogger(this.getClass().getName()); @@ -65,7 +65,7 @@ public void setUp() { System.setOut(out); tableName = "MY_TABLE_NAME_TEST_" + ID; - materializedViewName = "MY_ALTER_MATERIALIZED_VIEW_NAME_TEST_" + ID; + materializedViewName = "MY_UPDATE_MATERIALIZED_VIEW_NAME_TEST_" + ID; Schema schema = Schema.of( @@ -95,8 +95,8 @@ public void tearDown() { } @Test - public void testAlterMaterializedView() { - AlterMaterializedView.alterMaterializedView(BIGQUERY_DATASET_NAME, materializedViewName); - assertThat(bout.toString()).contains("Materialized view altered successfully"); + public void testUpdateMaterializedView() { + UpdateMaterializedView.updateMaterializedView(BIGQUERY_DATASET_NAME, materializedViewName); + assertThat(bout.toString()).contains("Materialized view updated successfully"); } } From 51e89710d60faea4826235fd7e887217f67ec2f4 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 21 Dec 2021 14:40:32 -0500 Subject: [PATCH 0510/2268] chore: add enumeration type of library (#1756) --- .repo-metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.repo-metadata.json b/.repo-metadata.json index 1305be96ff..7ca892467f 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -12,5 +12,6 @@ "distribution_name": "com.google.cloud:google-cloud-bigquery", "codeowner_team": "@googleapis/api-bigquery", "api_id": "bigquery.googleapis.com", + "library_type": "REST", "requires_billing": true } From 5a2bcbc7197fa75a464ed62d3e3df3bd43652b9d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Dec 2021 19:56:26 +0100 Subject: [PATCH 0511/2268] deps: update jmh.version to v1.34 (#1758) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update jmh.version to v1.34 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- benchmark/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cb2c239487..34a849280c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.1.0') +implementation platform('com.google.cloud:libraries-bom:24.1.1') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f5f80664e9..f1bb430f13 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.33 + 1.34 benchmark From ad6ba29e28830116a1349897259b96426f0dadb2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Dec 2021 20:10:11 +0100 Subject: [PATCH 0512/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.1.1 (#1757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `24.1.0` -> `24.1.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.1/compatibility-slim/24.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.1/confidence-slim/24.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34a849280c..3f53801cee 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.1.0 + 24.1.1 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a0e99f44ab..be5a9645ea 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.1.0 + 24.1.1 pom import From 629123fd10ead24d4365caf3974e19a506aa7a8e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:58:12 +0000 Subject: [PATCH 0513/2268] chore: release 2.6.0 (#1739) :robot: I have created a release \*beep\* \*boop\* --- ## [2.6.0](https://www.github.com/googleapis/java-bigquery/compare/v2.5.1...v2.6.0) (2021-12-27) ### Features * create Job retry for rate limit exceeded with status code 200 ([#1744](https://www.github.com/googleapis/java-bigquery/issues/1744)) ([97a61dc](https://www.github.com/googleapis/java-bigquery/commit/97a61dc90fb701986a51a12c9c83b7138894307a)) ### Bug Fixes * **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-bigquery/issues/1299)) ([#1738](https://www.github.com/googleapis/java-bigquery/issues/1738)) ([585875e](https://www.github.com/googleapis/java-bigquery/commit/585875e776e17660c58f9f8fe8385f13833bca57)) ### Documentation * rename alter materialized view to update ([#1754](https://www.github.com/googleapis/java-bigquery/issues/1754)) ([0b7d911](https://www.github.com/googleapis/java-bigquery/commit/0b7d91135222505f0eb01e8b40095156a073b62e)) * **samples:** update UpdateTableExpirationIT to fix failing IT. ([#1753](https://www.github.com/googleapis/java-bigquery/issues/1753)) ([a62a9f4](https://www.github.com/googleapis/java-bigquery/commit/a62a9f4fdda465b8c9e2f67f111d1b1b4a067903)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20211129-1.32.1 ([#1737](https://www.github.com/googleapis/java-bigquery/issues/1737)) ([776ff10](https://www.github.com/googleapis/java-bigquery/commit/776ff1004592f62799ff0244a448d6911bcca5be)) * update dependency com.google.cloud:google-cloud-bigtable to v2.3.1 ([#1741](https://www.github.com/googleapis/java-bigquery/issues/1741)) ([2f31a0a](https://www.github.com/googleapis/java-bigquery/commit/2f31a0a4f491eca25cbd3992e48f94214bfd605b)) * update dependency com.google.cloud:google-cloud-bigtable to v2.4.0 ([#1746](https://www.github.com/googleapis/java-bigquery/issues/1746)) ([92e5d02](https://www.github.com/googleapis/java-bigquery/commit/92e5d02ff25511233b15f07844bb8b13de2dc72f)) * update dependency com.google.cloud:google-cloud-storage to v2.2.2 ([#1740](https://www.github.com/googleapis/java-bigquery/issues/1740)) ([2022301](https://www.github.com/googleapis/java-bigquery/commit/2022301b39390f20796b8c5b3d6ee0e82aa127aa)) * update jmh.version to v1.34 ([#1758](https://www.github.com/googleapis/java-bigquery/issues/1758)) ([5a2bcbc](https://www.github.com/googleapis/java-bigquery/commit/5a2bcbc7197fa75a464ed62d3e3df3bd43652b9d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3afff959c2..2aef61767a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [2.6.0](https://www.github.com/googleapis/java-bigquery/compare/v2.5.1...v2.6.0) (2021-12-27) + + +### Features + +* create Job retry for rate limit exceeded with status code 200 ([#1744](https://www.github.com/googleapis/java-bigquery/issues/1744)) ([97a61dc](https://www.github.com/googleapis/java-bigquery/commit/97a61dc90fb701986a51a12c9c83b7138894307a)) + + +### Bug Fixes + +* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-bigquery/issues/1299)) ([#1738](https://www.github.com/googleapis/java-bigquery/issues/1738)) ([585875e](https://www.github.com/googleapis/java-bigquery/commit/585875e776e17660c58f9f8fe8385f13833bca57)) + + +### Documentation + +* rename alter materialized view to update ([#1754](https://www.github.com/googleapis/java-bigquery/issues/1754)) ([0b7d911](https://www.github.com/googleapis/java-bigquery/commit/0b7d91135222505f0eb01e8b40095156a073b62e)) +* **samples:** update UpdateTableExpirationIT to fix failing IT. ([#1753](https://www.github.com/googleapis/java-bigquery/issues/1753)) ([a62a9f4](https://www.github.com/googleapis/java-bigquery/commit/a62a9f4fdda465b8c9e2f67f111d1b1b4a067903)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20211129-1.32.1 ([#1737](https://www.github.com/googleapis/java-bigquery/issues/1737)) ([776ff10](https://www.github.com/googleapis/java-bigquery/commit/776ff1004592f62799ff0244a448d6911bcca5be)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.3.1 ([#1741](https://www.github.com/googleapis/java-bigquery/issues/1741)) ([2f31a0a](https://www.github.com/googleapis/java-bigquery/commit/2f31a0a4f491eca25cbd3992e48f94214bfd605b)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.4.0 ([#1746](https://www.github.com/googleapis/java-bigquery/issues/1746)) ([92e5d02](https://www.github.com/googleapis/java-bigquery/commit/92e5d02ff25511233b15f07844bb8b13de2dc72f)) +* update dependency com.google.cloud:google-cloud-storage to v2.2.2 ([#1740](https://www.github.com/googleapis/java-bigquery/issues/1740)) ([2022301](https://www.github.com/googleapis/java-bigquery/commit/2022301b39390f20796b8c5b3d6ee0e82aa127aa)) +* update jmh.version to v1.34 ([#1758](https://www.github.com/googleapis/java-bigquery/issues/1758)) ([5a2bcbc](https://www.github.com/googleapis/java-bigquery/commit/5a2bcbc7197fa75a464ed62d3e3df3bd43652b9d)) + ### [2.5.1](https://www.github.com/googleapis/java-bigquery/compare/v2.5.0...v2.5.1) (2021-12-03) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f1bb430f13..aff3a530e6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.5.2-SNAPSHOT + 2.6.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 576ec66e9e..62bd66425c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.5.2-SNAPSHOT + 2.6.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.5.2-SNAPSHOT + 2.6.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9c6aba59e4..8a7dd43003 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.5.2-SNAPSHOT + 2.6.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.5.2-SNAPSHOT + 2.6.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a4d95e2203..a733801707 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.5.2-SNAPSHOT + 2.6.0 diff --git a/versions.txt b/versions.txt index d55ef60c2f..b8903da9c1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.5.1:2.5.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.6.0:2.6.0 \ No newline at end of file From 11584ed798704e89fecabc5cf49f846baceea821 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:12:11 +0000 Subject: [PATCH 0514/2268] chore: release 2.6.1-SNAPSHOT (#1764) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index aff3a530e6..112c9d3179 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.0 + 2.6.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 62bd66425c..21ca1c86ae 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.0 + 2.6.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8a7dd43003..91aa6ecfb6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.0 + 2.6.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a733801707..ad84ee43e4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index b8903da9c1..a67820d0c3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.0:2.6.0 \ No newline at end of file +google-cloud-bigquery:2.6.0:2.6.1-SNAPSHOT \ No newline at end of file From 1f530ea4d140d929318f8cebed0864010b6b07e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 Jan 2022 18:29:17 +0100 Subject: [PATCH 0515/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.0 (#1765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f53801cee..776d50cde7 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.5.1 + 2.6.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.5.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.6.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.5.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 092fd82b23..1dc831fafd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.5.1 + 2.6.0 From 536398115b5567f09b32de00f64f712ce811ae6c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 4 Jan 2022 17:34:53 -0500 Subject: [PATCH 0516/2268] fix(java): Pass missing integration test flags to native image test commands (#1309) (#1766) Source-Link: https://github.com/googleapis/synthtool/commit/21f4a8daa6419908a002eeaf5e42525cb8d16d1d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b5ce87328633e27aa3e65d42e84cc722519859349760cdad48c7b5051b519a7d Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3d2f828246..2b0252c5b2 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a4d7b2cfc6a9d6b378a6b2458740eae15fcab28854bd23dad3a15102d2e47c87 + digest: sha256:b5ce87328633e27aa3e65d42e84cc722519859349760cdad48c7b5051b519a7d diff --git a/.kokoro/build.sh b/.kokoro/build.sh index d01df07d4b..c8676f15c5 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -71,7 +71,7 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; samples) From 5ef85b2009abe42ef822a67497da1a9718346c89 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Jan 2022 16:36:49 +0100 Subject: [PATCH 0517/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.4 (#1769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.4 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 776d50cde7..228d31b016 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.1.1') +implementation platform('com.google.cloud:libraries-bom:24.1.2') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 91aa6ecfb6..d55df99a8e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.2 + 1.2.4 From d4ae6e720c5f38bdf71e1bb1ecf949d3a3a5747a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Jan 2022 16:37:07 +0100 Subject: [PATCH 0518/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.5.0 (#1770) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1dc831fafd..e155fb597e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.4.0 + 2.5.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ad84ee43e4..e5b94edd40 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.4.0 + 2.5.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index be5a9645ea..33b091cc94 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.4.0 + 2.5.0 test From 40b87cddbb51b343d28ddf1aab92cb85b46cc712 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Jan 2022 02:46:42 +0100 Subject: [PATCH 0519/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.1.2 (#1773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `24.1.1` -> `24.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.2/compatibility-slim/24.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.1.2/confidence-slim/24.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 228d31b016..0d030bc1e3 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.1.1 + 24.1.2 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 33b091cc94..7e8d7205c2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.1.1 + 24.1.2 pom import From 53db89d6d20aa29480b1583393c28749875001f5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Jan 2022 16:08:31 +0100 Subject: [PATCH 0520/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 (#1774) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.5.1` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/compatibility-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.6.0/confidence-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v2.6.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​260-httpswwwgithubcomgoogleapisjava-shared-dependenciescompare251v260-2022-01-07) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.5.1...v2.6.0) ##### Bug Fixes - **java:** add -ntp flag to native image testing command ([#​1299](https://www.togithub.com/googleapis/java-shared-dependencies/issues/1299)) ([#​546](https://www.togithub.com/googleapis/java-shared-dependencies/issues/546)) ([d8bb8d9](https://www.github.com/googleapis/java-shared-dependencies/commit/d8bb8d9d8e3b8c582f768cd3164e8580ec334511)) - **java:** run Maven in plain console-friendly mode ([#​1301](https://www.togithub.com/googleapis/java-shared-dependencies/issues/1301)) ([#​557](https://www.togithub.com/googleapis/java-shared-dependencies/issues/557)) ([6b57d08](https://www.github.com/googleapis/java-shared-dependencies/commit/6b57d08816ec6c1dfb637cae022624e896930ad8)) ##### Dependencies - gRPC upgrade to 1.43.2 ([#​567](https://www.togithub.com/googleapis/java-shared-dependencies/issues/567)) ([c946655](https://www.github.com/googleapis/java-shared-dependencies/commit/c94665571f26d24fbbb3f89ef5a3db99663bfdba)) - update dependency com.google.api-client:google-api-client-bom to v1.33.0 ([#​563](https://www.togithub.com/googleapis/java-shared-dependencies/issues/563)) ([0aedddb](https://www.github.com/googleapis/java-shared-dependencies/commit/0aedddb9a535753767d56f5910f355c7a1c8509c)) - update dependency com.google.api:api-common to v2.1.2 ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update dependency com.google.http-client:google-http-client-bom to v1.41.0 ([#​562](https://www.togithub.com/googleapis/java-shared-dependencies/issues/562)) ([6da0735](https://www.github.com/googleapis/java-shared-dependencies/commit/6da0735d4db9df998d11c549488a024b800bed65)) - update dependency io.grpc:grpc-bom to v1.43.1 ([#​553](https://www.togithub.com/googleapis/java-shared-dependencies/issues/553)) ([b787c8f](https://www.github.com/googleapis/java-shared-dependencies/commit/b787c8f2032b7ffc9797158c3ff214b7813f34b7)) - update dependency org.apache.httpcomponents:httpcore to v4.4.15 ([#​550](https://www.togithub.com/googleapis/java-shared-dependencies/issues/550)) ([e2d3dba](https://www.github.com/googleapis/java-shared-dependencies/commit/e2d3dbad6dd54c117abb5ab1b6137cfee4e5a32b)) - update dependency org.checkerframework:checker-qual to v3.20.0 ([#​549](https://www.togithub.com/googleapis/java-shared-dependencies/issues/549)) ([586df59](https://www.github.com/googleapis/java-shared-dependencies/commit/586df5949d4ddca11d0705d696882c32d8436c31)) - update gax.version to v2.8.0 ([#​564](https://www.togithub.com/googleapis/java-shared-dependencies/issues/564)) ([9ad5d4f](https://www.github.com/googleapis/java-shared-dependencies/commit/9ad5d4f5385753a0c5739ef400f5d346e3342b84)) - update gax.version to v2.8.1 ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update google.common-protos.version to v2.7.1 ([#​561](https://www.togithub.com/googleapis/java-shared-dependencies/issues/561)) ([9aa860d](https://www.github.com/googleapis/java-shared-dependencies/commit/9aa860d92f745f1d4382eb16439bf17ac6ca8ae9)) - update google.core.version to v2.3.5 ([#​565](https://www.togithub.com/googleapis/java-shared-dependencies/issues/565)) ([2f154a3](https://www.github.com/googleapis/java-shared-dependencies/commit/2f154a3ff759211438c72859e98b314c7ff8405f)) - update iam.version to v1.2.0 ([#​547](https://www.togithub.com/googleapis/java-shared-dependencies/issues/547)) ([3232c82](https://www.github.com/googleapis/java-shared-dependencies/commit/3232c828b628cb604a200b3e569e56e758e5e11d)) - upgrading protobuf to 3.19.2 ([#​560](https://www.togithub.com/googleapis/java-shared-dependencies/issues/560)) ([7ef3325](https://www.github.com/googleapis/java-shared-dependencies/commit/7ef33250f5473348d3546210b7a534360f476101)) ##### [2.5.1](https://www.github.com/googleapis/java-shared-dependencies/compare/2.5.0...v2.5.1) (2021-12-03) ##### Dependencies - update dependency com.google.api:api-common to v2.1.1 ([#​533](https://www.togithub.com/googleapis/java-shared-dependencies/issues/533)) ([4e23adb](https://www.github.com/googleapis/java-shared-dependencies/commit/4e23adb666dfaa18ae8bf869aca030153de16d62)) - update gax.version to v2.7.1 ([#​544](https://www.togithub.com/googleapis/java-shared-dependencies/issues/544)) ([5a0c480](https://www.github.com/googleapis/java-shared-dependencies/commit/5a0c480671fa834e600edc6ac6fe77967d1b79b3)) - update google.common-protos.version to v2.7.0 ([#​542](https://www.togithub.com/googleapis/java-shared-dependencies/issues/542)) ([af97eb5](https://www.github.com/googleapis/java-shared-dependencies/commit/af97eb5d9cff397080fdb3d4a6dbf7c2692e0358)) - update google.core.version to v2.3.3 ([#​534](https://www.togithub.com/googleapis/java-shared-dependencies/issues/534)) ([885acef](https://www.github.com/googleapis/java-shared-dependencies/commit/885acefe4ff5313eb53dc43b4825ca597b97dcfd))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d55df99a8e..4d83da1742 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20211129-1.32.1 - 2.5.1 + 2.6.0
From 20dba8301927800528476748fd6a6e8de0dc0e18 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:48:16 +0000 Subject: [PATCH 0521/2268] chore: release 2.6.1 (#1772) :robot: I have created a release \*beep\* \*boop\* --- ### [2.6.1](https://www.github.com/googleapis/java-bigquery/compare/v2.6.0...v2.6.1) (2022-01-07) ### Bug Fixes * **java:** Pass missing integration test flags to native image test commands ([#1309](https://www.github.com/googleapis/java-bigquery/issues/1309)) ([#1766](https://www.github.com/googleapis/java-bigquery/issues/1766)) ([5363981](https://www.github.com/googleapis/java-bigquery/commit/536398115b5567f09b32de00f64f712ce811ae6c)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.5.0 ([#1770](https://www.github.com/googleapis/java-bigquery/issues/1770)) ([d4ae6e7](https://www.github.com/googleapis/java-bigquery/commit/d4ae6e720c5f38bdf71e1bb1ecf949d3a3a5747a)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#1774](https://www.github.com/googleapis/java-bigquery/issues/1774)) ([53db89d](https://www.github.com/googleapis/java-bigquery/commit/53db89d6d20aa29480b1583393c28749875001f5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aef61767a..a023e72fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +### [2.6.1](https://www.github.com/googleapis/java-bigquery/compare/v2.6.0...v2.6.1) (2022-01-07) + + +### Bug Fixes + +* **java:** Pass missing integration test flags to native image test commands ([#1309](https://www.github.com/googleapis/java-bigquery/issues/1309)) ([#1766](https://www.github.com/googleapis/java-bigquery/issues/1766)) ([5363981](https://www.github.com/googleapis/java-bigquery/commit/536398115b5567f09b32de00f64f712ce811ae6c)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.5.0 ([#1770](https://www.github.com/googleapis/java-bigquery/issues/1770)) ([d4ae6e7](https://www.github.com/googleapis/java-bigquery/commit/d4ae6e720c5f38bdf71e1bb1ecf949d3a3a5747a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#1774](https://www.github.com/googleapis/java-bigquery/issues/1774)) ([53db89d](https://www.github.com/googleapis/java-bigquery/commit/53db89d6d20aa29480b1583393c28749875001f5)) + ## [2.6.0](https://www.github.com/googleapis/java-bigquery/compare/v2.5.1...v2.6.0) (2021-12-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 112c9d3179..166f8ed3e3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.1-SNAPSHOT + 2.6.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 21ca1c86ae..6bda68ee0b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.1-SNAPSHOT + 2.6.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.1-SNAPSHOT + 2.6.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4d83da1742..c47c85d060 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.1-SNAPSHOT + 2.6.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.1-SNAPSHOT + 2.6.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e5b94edd40..fc16ee3102 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.1-SNAPSHOT + 2.6.1 diff --git a/versions.txt b/versions.txt index a67820d0c3..a5519e67de 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.0:2.6.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.6.1:2.6.1 \ No newline at end of file From 863d61cf7e24ca2f46bd08e12cc649be933d23b9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 18:08:21 +0000 Subject: [PATCH 0522/2268] chore: release 2.6.2-SNAPSHOT (#1776) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 166f8ed3e3..ca2dbeeece 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.1 + 2.6.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6bda68ee0b..88141a427f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.1 + 2.6.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.1 + 2.6.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c47c85d060..74ecd9eeb4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.1 + 2.6.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.1 + 2.6.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fc16ee3102..f7d703c0dc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.1 + 2.6.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index a5519e67de..0340d54194 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.1:2.6.1 \ No newline at end of file +google-cloud-bigquery:2.6.1:2.6.2-SNAPSHOT \ No newline at end of file From a898e718ac5deed699abf1f5e5e7b8c97a317c77 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Jan 2022 20:50:00 +0100 Subject: [PATCH 0523/2268] build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.3.0 (#1775) --- google-cloud-bigquery/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 88141a427f..7e4a2bdcab 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -134,7 +134,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add-source diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e155fb597e..00086823ef 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -92,7 +92,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f7d703c0dc..9649bbfe29 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.3.0 add-snippets-source From 536be1a41769a39855cd401f227ab61b9b6eb75a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 02:42:19 +0100 Subject: [PATCH 0524/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.8 (#1777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.8 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d030bc1e3..f8215abeea 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.6.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.6.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 00086823ef..8796c2a10f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.7 + 2.1.8 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9649bbfe29..54612ef075 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.7 + 2.1.8 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7e8d7205c2..dd62c87bd9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.7 + 2.1.8 test From b7b34b1f20c2486dfc855aa6be5ec76eb3ac79e8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 02:42:34 +0100 Subject: [PATCH 0525/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.6.2 (#1778) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.6.2 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 74ecd9eeb4..5deaa92ecd 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.6.1 + 1.6.2 pom import From 925d22f8e142d7d19d40d229147e777c94b2c293 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 02:42:49 +0100 Subject: [PATCH 0526/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.2.3 (#1779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.2.3 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5deaa92ecd..a457254fbb 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ com.google.cloud google-cloud-storage - 2.2.2 + 2.2.3 test From 60c4c4470d77467f68e876c6d841df1f4e98dc20 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 02:43:03 +0100 Subject: [PATCH 0527/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.5.1 (#1780) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-bigtable to v2.5.1 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8796c2a10f..6928463840 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.5.0 + 2.5.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 54612ef075..4c7f129ce3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.5.0 + 2.5.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index dd62c87bd9..6f3c794a92 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.5.0 + 2.5.1 test From 3cdb082aac261da0564d30f8e16e12c1b5ea46c0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 02:43:16 +0100 Subject: [PATCH 0528/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.1 (#1781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.1 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8215abeea..64ce005bf2 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6928463840..4ea8fd0bc7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.1 From 6c292dddba117ee0d4b18d8af9f4e4802214a4c4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 9 Jan 2022 01:56:22 +0000 Subject: [PATCH 0529/2268] chore: release 2.6.2 (#1782) :robot: I have created a release \*beep\* \*boop\* --- ### [2.6.2](https://www.github.com/googleapis/java-bigquery/compare/v2.6.1...v2.6.2) (2022-01-09) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.5.1 ([#1780](https://www.github.com/googleapis/java-bigquery/issues/1780)) ([60c4c44](https://www.github.com/googleapis/java-bigquery/commit/60c4c4470d77467f68e876c6d841df1f4e98dc20)) * update dependency com.google.cloud:google-cloud-storage to v2.2.3 ([#1779](https://www.github.com/googleapis/java-bigquery/issues/1779)) ([925d22f](https://www.github.com/googleapis/java-bigquery/commit/925d22f8e142d7d19d40d229147e777c94b2c293)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a023e72fba..eda95ce174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.6.2](https://www.github.com/googleapis/java-bigquery/compare/v2.6.1...v2.6.2) (2022-01-09) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.5.1 ([#1780](https://www.github.com/googleapis/java-bigquery/issues/1780)) ([60c4c44](https://www.github.com/googleapis/java-bigquery/commit/60c4c4470d77467f68e876c6d841df1f4e98dc20)) +* update dependency com.google.cloud:google-cloud-storage to v2.2.3 ([#1779](https://www.github.com/googleapis/java-bigquery/issues/1779)) ([925d22f](https://www.github.com/googleapis/java-bigquery/commit/925d22f8e142d7d19d40d229147e777c94b2c293)) + ### [2.6.1](https://www.github.com/googleapis/java-bigquery/compare/v2.6.0...v2.6.1) (2022-01-07) diff --git a/README.md b/README.md index 64ce005bf2..f8215abeea 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.6.1 + 2.6.0 ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ca2dbeeece..1ecbd82368 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.2-SNAPSHOT + 2.6.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7e4a2bdcab..948b87671e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.2-SNAPSHOT + 2.6.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.2-SNAPSHOT + 2.6.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a457254fbb..df1183cee7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.2-SNAPSHOT + 2.6.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.2-SNAPSHOT + 2.6.2 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4ea8fd0bc7..6928463840 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.6.1 + 2.6.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4c7f129ce3..411763a3b2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.2-SNAPSHOT + 2.6.2 diff --git a/versions.txt b/versions.txt index 0340d54194..9a4015d7e2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.1:2.6.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.6.2:2.6.2 \ No newline at end of file From 103e1bc5631b349c4396928e85a6f3967609576a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 9 Jan 2022 02:10:22 +0000 Subject: [PATCH 0530/2268] chore: release 2.6.3-SNAPSHOT (#1783) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1ecbd82368..9b9a7fc81e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.2 + 2.6.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 948b87671e..6796b91c8b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.2 + 2.6.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.2 + 2.6.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index df1183cee7..f27e2b424d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.2 + 2.6.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.2 + 2.6.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 411763a3b2..371cd008df 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.2 + 2.6.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9a4015d7e2..6baef69bb6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.2:2.6.2 \ No newline at end of file +google-cloud-bigquery:2.6.2:2.6.3-SNAPSHOT \ No newline at end of file From 29667f9b5d0c97a21b8d3d4bfab33c5ad9cbe81b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 9 Jan 2022 21:58:19 +0100 Subject: [PATCH 0531/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.2 (#1784) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.6.2 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f8215abeea..f3f05f044a 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.2 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.6.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.6.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.2" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6928463840..4fc33bfbca 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.6.0 + 2.6.2 From e7bf122010026f5347cb9b6dda867c4fc87c201c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 19:20:24 +0000 Subject: [PATCH 0532/2268] chore(owlbot-java): disable re-writing clirr file in owlbot java post-processor (#1320) (#1787) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/build.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 2b0252c5b2..20c6ee3c30 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:b5ce87328633e27aa3e65d42e84cc722519859349760cdad48c7b5051b519a7d + digest: sha256:efbfc5e9ff713005a037941f8ebcc0c69cc630e3ad934675ee26868705a30897 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index c8676f15c5..f5a684ca35 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,15 +47,15 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -Dclirr.skip=true -Denforcer.skip=true + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check + mvn com.coveo:fmt-maven-plugin:check -B -ntp RETURN_CODE=$? ;; javadoc) - mvn javadoc:javadoc javadoc:test-javadoc + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp RETURN_CODE=$? ;; integration) @@ -104,7 +104,7 @@ samples) fi ;; clirr) - mvn -B -Denforcer.skip=true clirr:check + mvn -B -ntp -Denforcer.skip=true clirr:check RETURN_CODE=$? ;; *) From 69fcabf478c6fab23c4da3fcc516f820cc178a5b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 Jan 2022 00:40:04 +0100 Subject: [PATCH 0533/2268] deps: update dependency org.assertj:assertj-core to v3 (#1786) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f27e2b424d..30898a62df 100644 --- a/pom.xml +++ b/pom.xml @@ -128,7 +128,7 @@ org.assertj assertj-core - 2.9.1 + 3.22.0 test From da3c1815bd74394e84397b65af0d2318b527b8ae Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 10 Jan 2022 18:58:21 -0500 Subject: [PATCH 0534/2268] chore: change name to api_shortname in .repo-metadata.json (#1788) --- .repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index 7ca892467f..7f15ca2560 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "bigquery", + "api_shortname": "bigquery", "name_pretty": "Cloud BigQuery", "product_documentation": "https://cloud.google.com/bigquery", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history", From 7d75f4583573c171cab3aecf967058823eeac319 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:58:16 +0000 Subject: [PATCH 0535/2268] chore(java): update variable name to api_shortname in README template (#1323) (#1790) --- .github/.OwlBot.lock.yaml | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 20c6ee3c30..dddb13b845 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:efbfc5e9ff713005a037941f8ebcc0c69cc630e3ad934675ee26868705a30897 + digest: sha256:7f737996c88586c499f7b0c25294c760f9f5eec092289a0e08d2d3f42a069ebb diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 93f1b51330..c49cd2b618 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -21,7 +21,7 @@ If you are still having issues, please include as much information as possible: General, Core, and Other are also allowed as types 2. OS type and version: 3. Java version: -4. bigquery version(s): +4. version(s): #### Steps to reproduce diff --git a/README.md b/README.md index f3f05f044a..c06118d4a9 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.1.2') +implementation platform('com.google.cloud:libraries-bom:24.2.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From e5a316b7889f490516e118f09f8669e2fb703681 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Jan 2022 18:02:17 +0100 Subject: [PATCH 0536/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.5 (#1791) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.2.4` -> `1.2.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.5/compatibility-slim/1.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.5/confidence-slim/1.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.2.5`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​125-httpsgithubcomgoogleapisjava-shared-configcomparev124v125-2022-01-11) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.2.4...v1.2.5)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30898a62df..d74b3de5a6 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.4 + 1.2.5 From d2a77e7a275f3c5b4e74f9d58350f403e8845498 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Jan 2022 18:02:27 +0100 Subject: [PATCH 0537/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.2.0 (#1792) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `24.1.2` -> `24.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.2.0/compatibility-slim/24.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.2.0/confidence-slim/24.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c06118d4a9..dc351ce335 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.1.2 + 24.2.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6f3c794a92..21290488a3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.1.2 + 24.2.0 pom import From b26dbc2f36452c3bf8ef66ddd05d39b9883a4696 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Jan 2022 21:30:33 +0100 Subject: [PATCH 0538/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.9.0 (#1793) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9b9a7fc81e..1f924b9431 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.9.0 org.apache.maven.plugins From 53b5ef3c8ba195ca81cef648b94c81f9539defc8 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 13 Jan 2022 15:22:26 -0500 Subject: [PATCH 0539/2268] chore: update release-level in .repo-metadata.json (#1795) --- .repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index 7f15ca2560..a2f378081f 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -5,7 +5,7 @@ "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history", "api_description": "is a fully managed, NoOps, low cost data analytics service.\nData can be streamed into BigQuery at millions of rows per second to enable real-time analysis.\nWith BigQuery you can easily deploy Petabyte-scale Databases.", "issue_tracker": "https://issuetracker.google.com/savedsearches/559654", - "release_level": "ga", + "release_level": "stable", "language": "java", "repo": "googleapis/java-bigquery", "repo_short": "java-bigquery", From 2d9572b65c6c0df5e9bdfa6e2d6b24f2c6c86cdb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 21:20:26 +0000 Subject: [PATCH 0540/2268] chore(java): update release_type choices to stable and preview (#1331) (#1798) --- .github/.OwlBot.lock.yaml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index dddb13b845..dcdda8c6d9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7f737996c88586c499f7b0c25294c760f9f5eec092289a0e08d2d3f42a069ebb + digest: sha256:9669c169d0582f13d6b2d319a43a78fc49f296a883aa48519bd0e5c7d34087c4 diff --git a/README.md b/README.md index dc351ce335..dc6d2b7ee8 100644 --- a/README.md +++ b/README.md @@ -340,7 +340,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8-win.html [kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.svg [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html -[stability-image]: https://img.shields.io/badge/stability-ga-green +[stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg [maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquery&core=gav [authentication]: https://github.com/googleapis/google-cloud-java#authentication From 8b77d9b207b96dcbb4afc2e8f06fb9c147ce6a90 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 Jan 2022 00:06:28 +0100 Subject: [PATCH 0541/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.3.0 (#1796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.2.3` -> `2.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.3.0/compatibility-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.3.0/confidence-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-storage ### [`v2.3.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​230-httpsgithubcomgoogleapisjava-storagecomparev223v230-2022-01-12) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.2.3...v2.3.0) ##### Features - Add RPO metadata settings ([#​1105](https://togithub.com/googleapis/java-storage/issues/1105)) ([6f9dfdf](https://togithub.com/googleapis/java-storage/commit/6f9dfdfdbf9f1466839a17ef97489f207f18bec6)) ##### Bug Fixes - **java:** run Maven in plain console-friendly mode ([#​1301](https://togithub.com/googleapis/java-storage/issues/1301)) ([#​1186](https://togithub.com/googleapis/java-storage/issues/1186)) ([1e55dba](https://togithub.com/googleapis/java-storage/commit/1e55dba4cd5111472b9bb05db08ba7e47fafe762)) - Remove all client side validation for OLM, allow nonspecific lif… ([#​1160](https://togithub.com/googleapis/java-storage/issues/1160)) ([5a160ee](https://togithub.com/googleapis/java-storage/commit/5a160eee2b80e3d392df9d73dfc30ca9cd665764)) ##### Dependencies - update dependency org.easymock:easymock to v4 ([#​1198](https://togithub.com/googleapis/java-storage/issues/1198)) ([558520f](https://togithub.com/googleapis/java-storage/commit/558520f35ed64f0b36f7f8ada4491023a0fb759e)) - update kms.version to v0.94.1 ([#​1195](https://togithub.com/googleapis/java-storage/issues/1195)) ([cc999b1](https://togithub.com/googleapis/java-storage/commit/cc999b1ebaba051524ce6131052c824232ccb79a)) ##### [2.2.3](https://www.github.com/googleapis/java-storage/compare/v2.2.2...v2.2.3) (2022-01-07) ##### Bug Fixes - do not cause a failure when encountering no bindings ([#​1177](https://www.togithub.com/googleapis/java-storage/issues/1177)) ([16c2aef](https://www.github.com/googleapis/java-storage/commit/16c2aef4f09eccee59d1028e3bbf01c65b5982d6)) - **java:** add -ntp flag to native image testing command ([#​1169](https://www.togithub.com/googleapis/java-storage/issues/1169)) ([b8a6395](https://www.github.com/googleapis/java-storage/commit/b8a6395fcaa34423d42a90bd42f71809f89a6c3b)) - update retry handling to retry idempotent requests that encounter unexpected EOF while parsing json responses ([#​1155](https://www.togithub.com/googleapis/java-storage/issues/1155)) ([8fbe6ef](https://www.github.com/googleapis/java-storage/commit/8fbe6efab969d699e9ba9e5448db7a6ee10c0572)) ##### Documentation - add new sample storage_configure_retries ([#​1152](https://www.togithub.com/googleapis/java-storage/issues/1152)) ([8634c4b](https://www.github.com/googleapis/java-storage/commit/8634c4b5cb88d2818378558427170ecf6c403df5)) - update comments ([#​1188](https://www.togithub.com/googleapis/java-storage/issues/1188)) ([d58e67c](https://www.github.com/googleapis/java-storage/commit/d58e67c217f38ca7b1926882ec48bd7b0c351ea7)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#​1191](https://www.togithub.com/googleapis/java-storage/issues/1191)) ([3b384cf](https://www.github.com/googleapis/java-storage/commit/3b384cf46876610ce33f2842ee8e9fc13e08443c)) - update dependency org.apache.httpcomponents:httpcore to v4.4.15 ([#​1171](https://www.togithub.com/googleapis/java-storage/issues/1171)) ([57f7a74](https://www.github.com/googleapis/java-storage/commit/57f7a743ee042c52261cd388fb0aec48c84e5d32)) ##### [2.2.2](https://www.github.com/googleapis/java-storage/compare/v2.2.1...v2.2.2) (2021-12-06) ##### Bug Fixes - update StorageOptions to not overwrite any previously set host ([#​1142](https://www.togithub.com/googleapis/java-storage/issues/1142)) ([05375c0](https://www.github.com/googleapis/java-storage/commit/05375c0b9b6f9fde2e6cefb1af6a695aa3b01732)) ##### Documentation - Add comments to GCS gRPC API proto spec to describe how naming work ([#​1139](https://www.togithub.com/googleapis/java-storage/issues/1139)) ([417c525](https://www.github.com/googleapis/java-storage/commit/417c5250eb7ad1a7b04a055a39d72e6536a63e18)) ##### Dependencies - update dependency com.google.apis:google-api-services-storage to v1-rev20211201-1.32.1 ([#​1165](https://www.togithub.com/googleapis/java-storage/issues/1165)) ([9031836](https://www.github.com/googleapis/java-storage/commit/90318368e69d7677c49e985eb58ff1b61d878ec9)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#​1163](https://www.togithub.com/googleapis/java-storage/issues/1163)) ([feca2c6](https://www.github.com/googleapis/java-storage/commit/feca2c6342786ef3fb699c459067c015bd374a13)) - update kms.version to v0.94.0 ([#​1164](https://www.togithub.com/googleapis/java-storage/issues/1164)) ([8653783](https://www.github.com/googleapis/java-storage/commit/86537836a3b96f369e1cad59c692d350047414f7)) ##### [2.2.1](https://www.github.com/googleapis/java-storage/compare/v2.2.0...v2.2.1) (2021-11-15) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#​1146](https://www.togithub.com/googleapis/java-storage/issues/1146)) ([a5d13a9](https://www.github.com/googleapis/java-storage/commit/a5d13a97bae50b4ee8a2fcef180ddc26b77e3d16))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d74b3de5a6..549464ff12 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ com.google.cloud google-cloud-storage - 2.2.3 + 2.3.0 test From efa029c4c6cc28d5cee983ab159dae3596420bcc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 Jan 2022 21:30:11 +0100 Subject: [PATCH 0542/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.6 (#1801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.2.5` -> `1.2.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.6/compatibility-slim/1.2.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.2.6/confidence-slim/1.2.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.2.6`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​126-httpsgithubcomgoogleapisjava-shared-configcomparev125v126-2022-01-19) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.2.5...v1.2.6)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 549464ff12..a8c7adc2bc 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.5 + 1.2.6 From c78fc775fb5278e7925a1d473d40e3a801eb4acf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 Jan 2022 22:05:10 +0100 Subject: [PATCH 0543/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.0 (#1802) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4fc33bfbca..180ece39c1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.32.1 + 1.33.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 371cd008df..4523244cd8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.32.1 + 1.33.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 21290488a3..f997ba7056 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.32.1 + 1.33.0 com.google.oauth-client From 8e34e59f13d289bcc9ea42d954c16db9eed1a423 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 Jan 2022 22:05:29 +0100 Subject: [PATCH 0544/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.0 (#1803) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 180ece39c1..72c5dc0091 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.32.1 + 1.33.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4523244cd8..5a5cf67334 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.32.1 + 1.33.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f997ba7056..ebc1260a63 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.32.1 + 1.33.0 From ff3d6e58ba50fa06e099dbc2d15fe07c439b2581 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Jan 2022 17:12:45 +0100 Subject: [PATCH 0545/2268] test(deps): update dependency org.mockito:mockito-core to v4.3.0 (#1804) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8c7adc2bc..e2cf1f4c7b 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ org.mockito mockito-core - 4.2.0 + 4.3.0 test From 8e5f58552e83abf309e314bddbfdc9ab3527181e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Jan 2022 00:02:28 +0100 Subject: [PATCH 0546/2268] deps: update actions/github-script action to v5 (#1808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/github-script](https://togithub.com/actions/github-script) | action | major | `v3` -> `v5` | --- ### Release Notes
actions/github-script ### [`v5`](https://togithub.com/actions/github-script/compare/v4...v5) [Compare Source](https://togithub.com/actions/github-script/compare/v4...v5) ### [`v4`](https://togithub.com/actions/github-script/compare/v3...v4) [Compare Source](https://togithub.com/actions/github-script/compare/v3...v4)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 90afea5d50218c89d350fbb572072f2d75710072 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:20:42 -0500 Subject: [PATCH 0547/2268] deps(java): update actions/github-script action to v5 (#1339) (#1809) Source-Link: https://github.com/googleapis/synthtool/commit/466412a75d636d69bcf8a42d9a5f956e73ac421d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:7062473f423f339256346ddbee3d81fb1de6b784fabc2a4d959d7df2c720e375 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 15 ++++++++++++++- .github/workflows/approve-readme.yaml | 2 +- .github/workflows/auto-release.yaml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index dcdda8c6d9..be3b9bde4f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,16 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:9669c169d0582f13d6b2d319a43a78fc49f296a883aa48519bd0e5c7d34087c4 + digest: sha256:7062473f423f339256346ddbee3d81fb1de6b784fabc2a4d959d7df2c720e375 diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index 7513acaebc..c513242798 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v3 + - uses: actions/github-script@v5 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 9b4fd4d834..59c7cadde3 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v3 + - uses: actions/github-script@v5 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true From ca344f532ce0677450c8b0d6c11f9413f1b65bcd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Jan 2022 17:22:39 +0100 Subject: [PATCH 0548/2268] test(deps): update dependency org.mockito:mockito-core to v4.3.1 (#1810) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2cf1f4c7b..d5ac4bcbed 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ org.mockito mockito-core - 4.3.0 + 4.3.1 test From 73c4a7330b717416fb0c9ce21215460f25faa930 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 27 Jan 2022 15:50:16 -0500 Subject: [PATCH 0549/2268] feat: add JSON type support (#1799) Fixes b/213373577 cc @nageshs --- google-cloud-bigquery/pom.xml | 4 + .../cloud/bigquery/LegacySQLTypeName.java | 3 + .../cloud/bigquery/QueryParameterValue.java | 25 ++++ .../cloud/bigquery/StandardSQLTypeName.java | 4 +- .../bigquery/QueryParameterValueTest.java | 19 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 108 ++++++++++++++++++ pom.xml | 6 + 7 files changed, 168 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6796b91c8b..1c3f4a9bac 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -81,6 +81,10 @@ org.threeten threetenbp + + com.google.code.gson + gson + diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java index 56d66cb1a1..1c2a3d884a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java @@ -93,6 +93,9 @@ public LegacySQLTypeName apply(String constant) { /** A record type with a nested schema. */ public static final LegacySQLTypeName RECORD = type.createAndRegister("RECORD").setStandardType(StandardSQLTypeName.STRUCT); + /** Represents JSON data */ + public static final LegacySQLTypeName JSON = + type.createAndRegister("JSON").setStandardType(StandardSQLTypeName.JSON); private static Map standardToLegacyMap = new HashMap<>(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index 76e521d561..f7f7e384f6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.io.BaseEncoding; +import com.google.gson.JsonObject; import java.io.Serializable; import java.math.BigDecimal; import java.util.ArrayList; @@ -61,6 +62,7 @@ *
  • Float: StandardSQLTypeName.FLOAT64 *
  • BigDecimal: StandardSQLTypeName.NUMERIC *
  • BigNumeric: StandardSQLTypeName.BIGNUMERIC + *
  • JSON: StandardSQLTypeName.JSON * * *

    No other types are supported through that entry point. The other types can be created by @@ -254,6 +256,22 @@ public static QueryParameterValue string(String value) { return of(value, StandardSQLTypeName.STRING); } + /** + * Creates a {@code QueryParameterValue} object with a type of JSON. Currently, this is only + * supported in INSERT, not in query as a filter + */ + public static QueryParameterValue json(String value) { + return of(value, StandardSQLTypeName.JSON); + } + + /** + * Creates a {@code QueryParameterValue} object with a type of JSON. Currently, this is only + * supported in INSERT, not in query as a filter + */ + public static QueryParameterValue json(JsonObject value) { + return of(value, StandardSQLTypeName.JSON); + } + /** Creates a {@code QueryParameterValue} object with a type of BYTES. */ public static QueryParameterValue bytes(byte[] value) { return of(value, StandardSQLTypeName.BYTES); @@ -347,6 +365,10 @@ private static StandardSQLTypeName classToType(Class type) { return StandardSQLTypeName.NUMERIC; } else if (Date.class.isAssignableFrom(type)) { return StandardSQLTypeName.DATE; + } else if (String.class.isAssignableFrom(type)) { + return StandardSQLTypeName.JSON; + } else if (JsonObject.class.isAssignableFrom(type)) { + return StandardSQLTypeName.JSON; } throw new IllegalArgumentException("Unsupported object type for QueryParameter: " + type); } @@ -384,6 +406,9 @@ private static String valueToStringOrNull(T value, StandardSQLTypeName type) break; case STRING: return value.toString(); + case JSON: + if (value instanceof String || value instanceof JsonObject) return value.toString(); + break; case STRUCT: throw new IllegalArgumentException("Cannot convert STRUCT to String value"); case ARRAY: diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java index d618b76568..57152a2a6c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java @@ -56,5 +56,7 @@ public enum StandardSQLTypeName { /** Represents a year, month, day, hour, minute, second, and subsecond (microsecond precision). */ DATETIME, /** Represents a set of geographic points, represented as a Well Known Text (WKT) string. */ - GEOGRAPHY + GEOGRAPHY, + /** Represents JSON data */ + JSON } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index b643ae5808..679b6ec5c9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -24,6 +24,7 @@ import com.google.api.services.bigquery.model.QueryParameterType; import com.google.common.collect.ImmutableMap; +import com.google.gson.JsonObject; import java.math.BigDecimal; import java.text.ParseException; import java.util.Date; @@ -193,6 +194,24 @@ public void testString() { assertThat(value.getArrayValues()).isNull(); } + @Test + public void testJson() { + QueryParameterValue value = + QueryParameterValue.json("{\"class\" : {\"students\" : [{\"name\" : \"Jane\"}]}}"); + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("class", "student"); + QueryParameterValue value1 = QueryParameterValue.json(jsonObject); + assertThat(value.getValue()) + .isEqualTo("{\"class\" : {\"students\" : [{\"name\" : \"Jane\"}]}}"); + assertThat(value1.getValue()).isEqualTo("{\"class\":\"student\"}"); + assertThat(value.getType()).isEqualTo(StandardSQLTypeName.JSON); + assertThat(value1.getType()).isEqualTo(StandardSQLTypeName.JSON); + assertThat(value.getArrayType()).isNull(); + assertThat(value1.getArrayType()).isNull(); + assertThat(value.getArrayValues()).isNull(); + assertThat(value1.getArrayType()).isNull(); + } + @Test public void testBytes() { QueryParameterValue value = QueryParameterValue.bytes(new byte[] {1, 3}); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 479a80e89f..09c9b7a7b7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -122,6 +122,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.io.BaseEncoding; +import com.google.gson.JsonObject; import java.io.IOException; import java.math.BigDecimal; import java.nio.ByteBuffer; @@ -707,6 +708,113 @@ public void testCreateTableWithRangePartitioning() { } } + @Test + public void testJsonType() throws InterruptedException { + String tableName = "test_create_table_jsontype"; + TableId tableId = TableId.of(DATASET, tableName); + Schema schema = Schema.of(Field.of("jsonField", StandardSQLTypeName.JSON)); + StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(schema); + try { + // Create a table with a JSON column + Table createdTable = bigquery.create(TableInfo.of(tableId, standardTableDefinition)); + assertNotNull(createdTable); + + // Insert 4 rows of JSON data into the JSON column + Map jsonRow1 = + Collections.singletonMap( + "jsonField", "{\"student\" : {\"name\" : \"Jane\", \"id\": 10}}"); + Map jsonRow2 = + Collections.singletonMap("jsonField", "{\"student\" : {\"name\" : \"Joy\", \"id\": 11}}"); + Map jsonRow3 = + Collections.singletonMap( + "jsonField", "{\"student\" : {\"name\" : \"Alice\", \"id\": 12}}"); + Map jsonRow4 = + Collections.singletonMap( + "jsonField", "{\"student\" : {\"name\" : \"Bijoy\", \"id\": 14}}"); + InsertAllRequest request = + InsertAllRequest.newBuilder(tableId) + .addRow(jsonRow1) + .addRow(jsonRow2) + .addRow(jsonRow3) + .addRow(jsonRow4) + .build(); + InsertAllResponse response = bigquery.insertAll(request); + assertFalse(response.hasErrors()); + assertEquals(0, response.getInsertErrors().size()); + + // Query the JSON column with string positional query parameter + String sql = + "SELECT jsonField.class.student.id FROM " + + tableId.getTable() + + " WHERE JSON_VALUE(jsonField, \"$.class.student.name\") = ? "; + QueryParameterValue stringParameter = QueryParameterValue.string("Jane"); + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(sql) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(stringParameter) + .build(); + TableResult result = bigquery.query(queryJobConfiguration); + for (FieldValueList values : result.iterateAll()) { + assertEquals("10", values.get(0).getValue()); + } + + // Insert another JSON row parsed from a String with json positional query parameter + String dml = "INSERT INTO " + tableId.getTable() + " (jsonField) VALUES(?)"; + QueryParameterValue jsonParameter = + QueryParameterValue.json("{\"class\" : {\"student\" : [{\"name\" : \"Amy\"}]}}"); + QueryJobConfiguration dmlQueryJobConfiguration = + QueryJobConfiguration.newBuilder(dml) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(jsonParameter) + .build(); + bigquery.query(dmlQueryJobConfiguration); + Page rows = bigquery.listTableData(tableId); + assertEquals(5, Iterables.size(rows.getValues())); + + // Insert another JSON row parsed from a JsonObject with json positional query parameter + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("class", "student"); + QueryParameterValue jsonParameter1 = QueryParameterValue.json(jsonObject); + QueryJobConfiguration dmlQueryJobConfiguration1 = + QueryJobConfiguration.newBuilder(dml) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(jsonParameter1) + .build(); + bigquery.query(dmlQueryJobConfiguration1); + Page rows1 = bigquery.listTableData(tableId); + assertEquals(6, Iterables.size(rows1.getValues())); + int rowCount = 0; + for (FieldValueList row : rows1.iterateAll()) { + FieldValue jsonCell = row.get(0); + if (rowCount == 1) assertEquals("{\"class\":\"student\"}", jsonCell.getStringValue()); + rowCount++; + } + + // Try inserting a malformed JSON + QueryParameterValue badJsonParameter = + QueryParameterValue.json("{\"class\" : {\"student\" : [{\"name\" : \"BadBoy\"}}"); + QueryJobConfiguration dmlQueryJobConfiguration2 = + QueryJobConfiguration.newBuilder(dml) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(badJsonParameter) + .build(); + try { + bigquery.query(dmlQueryJobConfiguration2); + fail("Querying with malformed JSON shouldn't work"); + } catch (BigQueryException e) { + BigQueryError error = e.getError(); + assertNotNull(error); + assertEquals("invalidQuery", error.getReason()); + } + } finally { + assertTrue(bigquery.delete(tableId)); + } + } + @Test public void testCreateTableWithConstraints() { String tableName = "test_create_table_with_constraints"; diff --git a/pom.xml b/pom.xml index d5ac4bcbed..c6a3e2fedc 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,12 @@ ${google-api-services-bigquery.version} + + com.google.code.gson + gson + 2.8.9 + + junit From 00b58ce326268c822ab0a9fb5c180f7f66f2164d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 21:12:16 +0000 Subject: [PATCH 0550/2268] chore(main): release 2.7.0 (#1789) :robot: I have created a release *beep* *boop* --- ## [2.7.0](https://github.com/googleapis/java-bigquery/compare/v2.6.2...v2.7.0) (2022-01-27) ### Features * add JSON type support ([#1799](https://github.com/googleapis/java-bigquery/issues/1799)) ([73c4a73](https://github.com/googleapis/java-bigquery/commit/73c4a7330b717416fb0c9ce21215460f25faa930)) ### Dependencies * **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-bigquery/issues/1339)) ([#1809](https://github.com/googleapis/java-bigquery/issues/1809)) ([90afea5](https://github.com/googleapis/java-bigquery/commit/90afea5d50218c89d350fbb572072f2d75710072)) * update actions/github-script action to v5 ([#1808](https://github.com/googleapis/java-bigquery/issues/1808)) ([8e5f585](https://github.com/googleapis/java-bigquery/commit/8e5f58552e83abf309e314bddbfdc9ab3527181e)) * update dependency com.google.cloud:google-cloud-storage to v2.3.0 ([#1796](https://github.com/googleapis/java-bigquery/issues/1796)) ([8b77d9b](https://github.com/googleapis/java-bigquery/commit/8b77d9b207b96dcbb4afc2e8f06fb9c147ce6a90)) * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.0 ([#1802](https://github.com/googleapis/java-bigquery/issues/1802)) ([c78fc77](https://github.com/googleapis/java-bigquery/commit/c78fc775fb5278e7925a1d473d40e3a801eb4acf)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.0 ([#1803](https://github.com/googleapis/java-bigquery/issues/1803)) ([8e34e59](https://github.com/googleapis/java-bigquery/commit/8e34e59f13d289bcc9ea42d954c16db9eed1a423)) * update dependency org.assertj:assertj-core to v3 ([#1786](https://github.com/googleapis/java-bigquery/issues/1786)) ([69fcabf](https://github.com/googleapis/java-bigquery/commit/69fcabf478c6fab23c4da3fcc516f820cc178a5b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eda95ce174..641189bf20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.7.0](https://github.com/googleapis/java-bigquery/compare/v2.6.2...v2.7.0) (2022-01-27) + + +### Features + +* add JSON type support ([#1799](https://github.com/googleapis/java-bigquery/issues/1799)) ([73c4a73](https://github.com/googleapis/java-bigquery/commit/73c4a7330b717416fb0c9ce21215460f25faa930)) + + +### Dependencies + +* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-bigquery/issues/1339)) ([#1809](https://github.com/googleapis/java-bigquery/issues/1809)) ([90afea5](https://github.com/googleapis/java-bigquery/commit/90afea5d50218c89d350fbb572072f2d75710072)) +* update actions/github-script action to v5 ([#1808](https://github.com/googleapis/java-bigquery/issues/1808)) ([8e5f585](https://github.com/googleapis/java-bigquery/commit/8e5f58552e83abf309e314bddbfdc9ab3527181e)) +* update dependency com.google.cloud:google-cloud-storage to v2.3.0 ([#1796](https://github.com/googleapis/java-bigquery/issues/1796)) ([8b77d9b](https://github.com/googleapis/java-bigquery/commit/8b77d9b207b96dcbb4afc2e8f06fb9c147ce6a90)) +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.0 ([#1802](https://github.com/googleapis/java-bigquery/issues/1802)) ([c78fc77](https://github.com/googleapis/java-bigquery/commit/c78fc775fb5278e7925a1d473d40e3a801eb4acf)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.0 ([#1803](https://github.com/googleapis/java-bigquery/issues/1803)) ([8e34e59](https://github.com/googleapis/java-bigquery/commit/8e34e59f13d289bcc9ea42d954c16db9eed1a423)) +* update dependency org.assertj:assertj-core to v3 ([#1786](https://github.com/googleapis/java-bigquery/issues/1786)) ([69fcabf](https://github.com/googleapis/java-bigquery/commit/69fcabf478c6fab23c4da3fcc516f820cc178a5b)) + ### [2.6.2](https://www.github.com/googleapis/java-bigquery/compare/v2.6.1...v2.6.2) (2022-01-09) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1f924b9431..0192855ee9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.6.3-SNAPSHOT + 2.7.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1c3f4a9bac..4a78f2985d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.6.3-SNAPSHOT + 2.7.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.6.3-SNAPSHOT + 2.7.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c6a3e2fedc..3860c978e1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.6.3-SNAPSHOT + 2.7.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.6.3-SNAPSHOT + 2.7.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5a5cf67334..834fceabda 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.6.3-SNAPSHOT + 2.7.0 diff --git a/versions.txt b/versions.txt index 6baef69bb6..19cca9733d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.6.2:2.6.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.7.0:2.7.0 \ No newline at end of file From 3c0d0f62e917490726e881ba4d80194173f811dd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 23:42:10 +0000 Subject: [PATCH 0551/2268] chore(main): release 2.7.1-SNAPSHOT (#1811) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0192855ee9..d8832ca207 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.7.0 + 2.7.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4a78f2985d..fe0bc18eb4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.7.0 + 2.7.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.7.0 + 2.7.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3860c978e1..9692320607 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.7.0 + 2.7.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.7.0 + 2.7.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 834fceabda..f67ba8fdc1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.7.0 + 2.7.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 19cca9733d..4ef37ff191 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.7.0:2.7.0 \ No newline at end of file +google-cloud-bigquery:2.7.0:2.7.1-SNAPSHOT \ No newline at end of file From 94fe0bf11ef9b5b0f2bb7766835d38bd33002fe1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 28 Jan 2022 17:43:03 +0100 Subject: [PATCH 0552/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.7.0 (#1812) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.7.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dc6d2b7ee8..c4d97a1567 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.6.2 + 2.7.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.6.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.7.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.6.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.7.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 72c5dc0091..e19fa839dd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.6.2 + 2.7.0 From f2cfc8bc5f97359a69ac3647919670bd714ac953 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 21:16:26 +0100 Subject: [PATCH 0553/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 (#1813) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9692320607..a5cc0825da 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20211129-1.32.1 - 2.6.0 + 2.7.0 From d48ae41d1437bd9246d973a9f0b56f230a1eea68 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 31 Jan 2022 17:22:52 -0500 Subject: [PATCH 0554/2268] docs(samples): fix GrantViewAccess sample IT failure (#1816) Fixes issue: https://github.com/googleapis/java-bigquery/issues/1806 --- .../com/example/bigquery/GrantViewAccess.java | 5 ++--- .../com/example/bigquery/GrantViewAccessIT.java | 17 +++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java b/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java index 4a989f0247..00f5ccb1c4 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java +++ b/samples/snippets/src/main/java/com/example/bigquery/GrantViewAccess.java @@ -22,7 +22,6 @@ import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.Dataset; -import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.Table; import java.util.ArrayList; import java.util.List; @@ -44,8 +43,8 @@ public static void grantViewAccess(String srcDatasetId, String viewDatasetId, St // once, and can be reused for multiple requests. BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); - Dataset srcDataset = bigquery.getDataset(DatasetId.of(srcDatasetId)); - Dataset viewDataset = bigquery.getDataset(DatasetId.of(viewDatasetId)); + Dataset srcDataset = bigquery.getDataset(srcDatasetId); + Dataset viewDataset = bigquery.getDataset(viewDatasetId); Table view = viewDataset.get(viewId); // First, we'll add a group to the ACL for the dataset containing the view. This will allow // users within that group to query the view, but they must have direct access to any tables diff --git a/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java b/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java index f620c781e8..11b1215ff6 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java @@ -36,6 +36,7 @@ public class GrantViewAccessIT { private final Logger log = Logger.getLogger(this.getClass().getName()); private String datasetName; + private String viewDatasetName; private String tableName; private String viewName; private ByteArrayOutputStream bout; @@ -43,7 +44,6 @@ public class GrantViewAccessIT { private PrintStream originalPrintStream; private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); - private static final String BIGQUERY_DATASET_NAME = requireEnvVar("BIGQUERY_DATASET_NAME"); private static String requireEnvVar(String varName) { String value = System.getenv(varName); @@ -56,7 +56,6 @@ private static String requireEnvVar(String varName) { @BeforeClass public static void checkRequirements() { requireEnvVar("GOOGLE_CLOUD_PROJECT"); - requireEnvVar("BIGQUERY_DATASET_NAME"); } @Before @@ -68,30 +67,32 @@ public void setUp() { // create a temporary dataset, table and view to be deleted. datasetName = "MY_DATASET_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); + viewDatasetName = "MY_VIEW_DATASET_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); tableName = "MY_TABLE_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); viewName = "MY_VIEW_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); CreateDataset.createDataset(datasetName); + CreateDataset.createDataset(viewDatasetName); Schema schema = Schema.of( Field.of("timestampField", StandardSQLTypeName.TIMESTAMP), Field.of("stringField", StandardSQLTypeName.STRING), Field.of("booleanField", StandardSQLTypeName.BOOL)); - CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, schema); + CreateTable.createTable(viewDatasetName, tableName, schema); String query = String.format( "SELECT timestampField, stringField, booleanField FROM %s.%s", - BIGQUERY_DATASET_NAME, tableName); - CreateView.createView(BIGQUERY_DATASET_NAME, viewName, query); + viewDatasetName, tableName); + CreateView.createView(viewDatasetName, viewName, query); } @After public void tearDown() { // Clean up - DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, viewName); - DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableName); + DeleteTable.deleteTable(viewDatasetName, viewName); + DeleteTable.deleteTable(viewDatasetName, tableName); DeleteDataset.deleteDataset(PROJECT_ID, datasetName); // restores print statements in the original method System.out.flush(); @@ -101,7 +102,7 @@ public void tearDown() { @Test public void testGrantViewAccess() { - GrantViewAccess.grantViewAccess(datasetName, BIGQUERY_DATASET_NAME, viewName); + GrantViewAccess.grantViewAccess(datasetName, viewDatasetName, viewName); assertThat(bout.toString()).contains("Grant view access successfully"); } } From e12122c4472ed4c3d00fc8c7515be210bbf68df3 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 1 Feb 2022 12:03:32 -0500 Subject: [PATCH 0555/2268] docs(samples): fix CopyMultipleTables sample IT failure and improve a few other samples (#1817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): fix CopyMultipleTables sample IT failure and improve a few other samples Fixes issue: https://github.com/googleapis/java-bigquery/issues/1805 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../example/bigquery/CopyMultipleTables.java | 17 +++++---- .../bigquery/QueryExternalBigtablePerm.java | 3 +- .../bigquery/QueryExternalBigtableTemp.java | 3 +- .../bigquery/CopyMultipleTablesIT.java | 36 +++++++++++++++---- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java b/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java index 9c3c736fc3..2a7e023448 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java +++ b/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java @@ -32,25 +32,30 @@ public static void main(String[] args) { // TODO(developer): Replace these variables before running the sample. String destinationDatasetName = "MY_DATASET_NAME"; String destinationTableId = "MY_TABLE_NAME"; - copyMultipleTables(destinationDatasetName, destinationTableId); + String sourceTable1Id = "MY_SOURCE_TABLE_1"; + String sourceTable2Id = "MY_SOURCE_TABLE_2"; + copyMultipleTables(destinationDatasetName, destinationTableId, sourceTable1Id, sourceTable2Id); } - public static void copyMultipleTables(String destinationDatasetName, String destinationTableId) { + public static void copyMultipleTables( + String destinationDatasetName, + String destinationTableId, + String sourceTable1Id, + String sourceTable2Id) { try { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); TableId destinationTable = TableId.of(destinationDatasetName, destinationTableId); + TableId sourceTable1 = TableId.of(destinationDatasetName, sourceTable1Id); + TableId sourceTable2 = TableId.of(destinationDatasetName, sourceTable2Id); // For more information on CopyJobConfiguration see: // https://googleapis.dev/java/google-cloud-clients/latest/com/google/cloud/bigquery/JobConfiguration.html CopyJobConfiguration configuration = CopyJobConfiguration.newBuilder( - destinationTable, - Arrays.asList( - TableId.of(destinationDatasetName, "table1"), - TableId.of(destinationDatasetName, "table2"))) + destinationTable, Arrays.asList(sourceTable1, sourceTable2)) .build(); // For more information on Job see: diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java b/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java index 9162697075..fa5c30c16b 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtablePerm.java @@ -17,6 +17,8 @@ package com.example.bigquery; // [START bigquery_query_external_bigtable_perm] + +import com.google.api.client.util.Base64; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; @@ -29,7 +31,6 @@ import com.google.cloud.bigquery.TableInfo; import com.google.cloud.bigquery.TableResult; import com.google.common.collect.ImmutableList; -import org.apache.commons.codec.binary.Base64; // Sample to queries an external bigtable data source using a permanent table public class QueryExternalBigtablePerm { diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java b/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java index 51646fcb67..6a04631074 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryExternalBigtableTemp.java @@ -17,6 +17,8 @@ package com.example.bigquery; // [START bigquery_query_external_bigtable_temp] + +import com.google.api.client.util.Base64; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; @@ -27,7 +29,6 @@ import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.TableResult; import com.google.common.collect.ImmutableList; -import org.apache.commons.codec.binary.Base64; // Sample to queries an external bigtable data source using a temporary table public class QueryExternalBigtableTemp { diff --git a/samples/snippets/src/test/java/com/example/bigquery/CopyMultipleTablesIT.java b/samples/snippets/src/test/java/com/example/bigquery/CopyMultipleTablesIT.java index 685db52d1d..e0d175c86e 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CopyMultipleTablesIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CopyMultipleTablesIT.java @@ -19,6 +19,9 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.UUID; @@ -32,22 +35,27 @@ public class CopyMultipleTablesIT { private final Logger log = Logger.getLogger(this.getClass().getName()); + private String datasetName; private String tableName; + private String sourceTable1Name; + private String sourceTable2Name; private ByteArrayOutputStream bout; private PrintStream out; private PrintStream originalPrintStream; - private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); + private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); - private static void requireEnvVar(String varName) { + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); assertNotNull( "Environment variable " + varName + " is required to perform these tests.", System.getenv(varName)); + return value; } @BeforeClass public static void checkRequirements() { - requireEnvVar("BIGQUERY_DATASET_NAME"); + requireEnvVar("GOOGLE_CLOUD_PROJECT"); } @Before @@ -56,15 +64,30 @@ public void setUp() throws Exception { out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); + // Create a new destination table for each test since existing table cannot be overwritten + datasetName = "MY_DATASET_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); tableName = "COPY_MULTIPLE_TABLE_TEST" + UUID.randomUUID().toString().substring(0, 8); - CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, null); + sourceTable1Name = + "COPY_MULTIPLE_TABLE_SOURCE1_TEST" + UUID.randomUUID().toString().substring(0, 8); + sourceTable2Name = + "COPY_MULTIPLE_TABLE_SOURCE2_TEST" + UUID.randomUUID().toString().substring(0, 8); + CreateDataset.createDataset(datasetName); + + Schema schema = + Schema.of( + Field.of("timestampField", StandardSQLTypeName.TIMESTAMP), + Field.of("stringField", StandardSQLTypeName.STRING), + Field.of("booleanField", StandardSQLTypeName.BOOL)); + CreateTable.createTable(datasetName, tableName, schema); + CreateTable.createTable(datasetName, sourceTable1Name, schema); + CreateTable.createTable(datasetName, sourceTable2Name, schema); } @After public void tearDown() { // Clean up - DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableName); + DeleteDataset.deleteDataset(PROJECT_ID, datasetName); // restores print statements in the original method System.out.flush(); System.setOut(originalPrintStream); @@ -73,7 +96,8 @@ public void tearDown() { @Test public void testCopyMultipleTables() { - CopyMultipleTables.copyMultipleTables(BIGQUERY_DATASET_NAME, tableName); + CopyMultipleTables.copyMultipleTables( + datasetName, tableName, sourceTable1Name, sourceTable2Name); assertThat(bout.toString()).contains("Table copied successfully."); } } From 659fc796decd14d0d54abef7badfd68a38e0b302 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 17:20:51 +0000 Subject: [PATCH 0556/2268] chore(main): release 2.7.1 (#1815) :robot: I have created a release *beep* *boop* --- ### [2.7.1](https://github.com/googleapis/java-bigquery/compare/v2.7.0...v2.7.1) (2022-02-01) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#1813](https://github.com/googleapis/java-bigquery/issues/1813)) ([f2cfc8b](https://github.com/googleapis/java-bigquery/commit/f2cfc8bc5f97359a69ac3647919670bd714ac953)) ### Documentation * **samples:** fix CopyMultipleTables sample IT failure and improve a few other samples ([#1817](https://github.com/googleapis/java-bigquery/issues/1817)) ([e12122c](https://github.com/googleapis/java-bigquery/commit/e12122c4472ed4c3d00fc8c7515be210bbf68df3)) * **samples:** fix GrantViewAccess sample IT failure ([#1816](https://github.com/googleapis/java-bigquery/issues/1816)) ([d48ae41](https://github.com/googleapis/java-bigquery/commit/d48ae41d1437bd9246d973a9f0b56f230a1eea68)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 641189bf20..1b34e2ec70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +### [2.7.1](https://github.com/googleapis/java-bigquery/compare/v2.7.0...v2.7.1) (2022-02-01) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#1813](https://github.com/googleapis/java-bigquery/issues/1813)) ([f2cfc8b](https://github.com/googleapis/java-bigquery/commit/f2cfc8bc5f97359a69ac3647919670bd714ac953)) + + +### Documentation + +* **samples:** fix CopyMultipleTables sample IT failure and improve a few other samples ([#1817](https://github.com/googleapis/java-bigquery/issues/1817)) ([e12122c](https://github.com/googleapis/java-bigquery/commit/e12122c4472ed4c3d00fc8c7515be210bbf68df3)) +* **samples:** fix GrantViewAccess sample IT failure ([#1816](https://github.com/googleapis/java-bigquery/issues/1816)) ([d48ae41](https://github.com/googleapis/java-bigquery/commit/d48ae41d1437bd9246d973a9f0b56f230a1eea68)) + ## [2.7.0](https://github.com/googleapis/java-bigquery/compare/v2.6.2...v2.7.0) (2022-01-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d8832ca207..80e947d5c0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.7.1-SNAPSHOT + 2.7.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index fe0bc18eb4..011c2b8eb6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.7.1-SNAPSHOT + 2.7.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.7.1-SNAPSHOT + 2.7.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a5cc0825da..d4ac902e19 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.7.1-SNAPSHOT + 2.7.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.7.1-SNAPSHOT + 2.7.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f67ba8fdc1..7faba98a12 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.7.1-SNAPSHOT + 2.7.1 diff --git a/versions.txt b/versions.txt index 4ef37ff191..81ff40aa6b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.7.0:2.7.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.7.1:2.7.1 \ No newline at end of file From 81d832d56f594cf4c6b9dbc3f26df6dcfc86a6d2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 13:44:08 -0500 Subject: [PATCH 0557/2268] chore(main): release 2.7.2-SNAPSHOT (#1818) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 80e947d5c0..b1a8f6f3f4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.7.1 + 2.7.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 011c2b8eb6..859c535ec8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.7.1 + 2.7.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.7.1 + 2.7.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d4ac902e19..22491cbc48 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.7.1 + 2.7.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.7.1 + 2.7.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7faba98a12..feca4fe7ef 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.7.1 + 2.7.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 81ff40aa6b..b7da590b2d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.7.1:2.7.1 \ No newline at end of file +google-cloud-bigquery:2.7.1:2.7.2-SNAPSHOT \ No newline at end of file From 82175f19634550f8b16c830362798396cd28e79d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Feb 2022 23:58:43 +0100 Subject: [PATCH 0558/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220123-1.32.1 (#1819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20211129-1.32.1` -> `v2-rev20220123-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220123-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220123-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220123-1.32.1/compatibility-slim/v2-rev20211129-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220123-1.32.1/confidence-slim/v2-rev20211129-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4d97a1567..9d084caa07 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.7.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.7.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.7.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.7.1" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 22491cbc48..3dd3457284 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20211129-1.32.1 + v2-rev20220123-1.32.1 2.7.0 From 8c50fb51bcb3116bf037c30997563b67ba077945 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 16:04:41 +0100 Subject: [PATCH 0559/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.7.1 (#1822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.7.0` -> `2.7.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.7.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.7.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.7.1/compatibility-slim/2.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.7.1/confidence-slim/2.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

    googleapis/java-bigquery ### [`v2.7.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​271-httpsgithubcomgoogleapisjava-bigquerycomparev270v271-2022-02-01) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.7.0...v2.7.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d084caa07..0b3f49656a 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.7.0 + 2.7.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e19fa839dd..87ef5fb42b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.7.0 + 2.7.1 From 0fe0a78db110794f9d2797bd74792d361acef96c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 16:04:46 +0100 Subject: [PATCH 0560/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.5.2 (#1821) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.5.1` -> `2.5.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.5.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.5.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.5.2/compatibility-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.5.2/confidence-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.5.2`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​252-httpsgithubcomgoogleapisjava-bigtablecomparev251v252-2022-01-31) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.5.1...v2.5.2)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 87ef5fb42b..9cb96538f0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.5.1 + 2.5.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index feca4fe7ef..1b50734e3c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.5.1 + 2.5.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ebc1260a63..1be592b879 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.5.1 + 2.5.2 test From 18a11e88c0be5c0d5cf89d498439d5f8347e589d Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 2 Feb 2022 11:47:12 -0500 Subject: [PATCH 0561/2268] feat: add Dataset ACL support (#1763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add Dataset ACL support * some lint updates * add back interface that was causing IDE issues * fix recursive import issue * debug * update code based on pending discovery doc changes (cl/421673680) * update code to reflect more changes (target_types should be List) based on pending discovery doc changes (cl/421673680) * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * rename to address feedback Co-authored-by: Owl Bot --- .../java/com/google/cloud/bigquery/Acl.java | 89 +++++++++++++++++-- .../com/google/cloud/bigquery/AclTest.java | 14 +++ .../cloud/bigquery/SerializationTest.java | 9 +- .../cloud/bigquery/it/ITBigQueryTest.java | 42 +++++++++ 4 files changed, 144 insertions(+), 10 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index 48ff863420..115e001bd3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -20,9 +20,11 @@ import com.google.api.core.ApiFunction; import com.google.api.services.bigquery.model.Dataset.Access; +import com.google.api.services.bigquery.model.DatasetAccessEntry; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; import java.io.Serializable; +import java.util.List; import java.util.Objects; /** @@ -105,7 +107,8 @@ public enum Type { USER, VIEW, IAM_MEMBER, - ROUTINE + ROUTINE, + DATASET } Entity(Type type) { @@ -119,6 +122,11 @@ public Type getType() { abstract Access toPb(); static Entity fromPb(Access access) { + if (access.getDataset() != null) { + return new DatasetAclEntity( + DatasetId.fromPb(access.getDataset().getDataset()), + access.getDataset().getTargetTypes()); + } if (access.getDomain() != null) { return new Domain(access.getDomain()); } @@ -146,6 +154,65 @@ static Entity fromPb(Access access) { } } + /** + * Class for a BigQuery DatasetAclEntity ACL entity. Objects of this class represent a + * DatasetAclEntity from a different DatasetAclEntity to grant access to. Only views are supported + * for now. The role field is not required when this field is set. If that DatasetAclEntity is + * deleted and re-created, its access needs to be granted again via an update operation. + */ + public static final class DatasetAclEntity extends Entity { + + private static final long serialVersionUID = -8392885851733136526L; + + private final DatasetId id; + private final List targetTypes; + + /** Creates a DatasetAclEntity given the DatasetAclEntity's id. */ + public DatasetAclEntity(DatasetId id, List targetTypes) { + super(Type.DATASET); + this.id = id; + this.targetTypes = targetTypes; + } + + /** Returns DatasetAclEntity's identity. */ + public DatasetId getId() { + return id; + } + + public List getTargetTypes() { + return targetTypes; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + DatasetAclEntity datasetAclEntity = (DatasetAclEntity) obj; + return Objects.equals(getType(), datasetAclEntity.getType()) + && Objects.equals(id, datasetAclEntity.id); + } + + @Override + public int hashCode() { + return Objects.hash(getType(), id); + } + + @Override + public String toString() { + return toPb().toString(); + } + + @Override + Access toPb() { + return new Access() + .setDataset(new DatasetAccessEntry().setDataset(id.toPb()).setTargetTypes(targetTypes)); + } + } + /** * Class for a BigQuery Domain entity. Objects of this class represent a domain to grant access * to. Any users signed in with the domain specified will be granted the specified access. @@ -342,9 +409,10 @@ Access toPb() { /** * Class for a BigQuery View entity. Objects of this class represent a view from a different - * dataset to grant access to. Queries executed against that view will have read access to tables - * in this dataset. The role field is not required when this field is set. If that view is updated - * by any user, access to the view needs to be granted again via an update operation. + * datasetAclEntity to grant access to. Queries executed against that view will have read access + * to tables in this datasetAclEntity. The role field is not required when this field is set. If + * that view is updated by any user, access to the view needs to be granted again via an update + * operation. */ public static final class View extends Entity { @@ -393,10 +461,10 @@ Access toPb() { /** * Class for a BigQuery Routine entity. Objects of this class represent a routine from a different - * dataset to grant access to. Queries executed against that routine will have read access to - * views/tables/routines in this dataset. Only UDF is supported for now. The role field is not - * required when this field is set. If that routine is updated by any user, access to the routine - * needs to be granted again via an update operation. + * datasetAclEntity to grant access to. Queries executed against that routine will have read + * access to views/tables/routines in this datasetAclEntity. Only UDF is supported for now. The + * role field is not required when this field is set. If that routine is updated by any user, + * access to the routine needs to be granted again via an update operation. */ public static final class Routine extends Entity { @@ -516,6 +584,11 @@ public static Acl of(Entity entity, Role role) { return new Acl(entity, role); } + /** Returns an Acl object for a datasetAclEntity. */ + public static Acl of(DatasetAclEntity datasetAclEntity) { + return new Acl(datasetAclEntity, null); + } + /** Returns an Acl object for a view entity. */ public static Acl of(View view) { return new Acl(view, null); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java index 7368033918..30866c2b60 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals; import com.google.api.services.bigquery.model.Dataset; +import com.google.cloud.bigquery.Acl.DatasetAclEntity; import com.google.cloud.bigquery.Acl.Domain; import com.google.cloud.bigquery.Acl.Entity; import com.google.cloud.bigquery.Acl.Entity.Type; @@ -27,10 +28,23 @@ import com.google.cloud.bigquery.Acl.Role; import com.google.cloud.bigquery.Acl.User; import com.google.cloud.bigquery.Acl.View; +import com.google.common.collect.ImmutableList; +import java.util.List; import org.junit.Test; public class AclTest { + @Test + public void testDatasetEntity() { + DatasetId datasetId = DatasetId.of("dataset"); + List targetTypes = ImmutableList.of("VIEWS"); + DatasetAclEntity entity = new DatasetAclEntity(datasetId, targetTypes); + assertEquals(datasetId, entity.getId()); + assertEquals(targetTypes, entity.getTargetTypes()); + Dataset.Access pb = entity.toPb(); + assertEquals(entity, Entity.fromPb(pb)); + } + @Test public void testDomainEntity() { Domain entity = new Domain("d1"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java index 30bb0db0b8..0b0cd0207a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java @@ -20,6 +20,7 @@ import com.google.cloud.NoCredentials; import com.google.cloud.PageImpl; import com.google.cloud.Restorable; +import com.google.cloud.bigquery.Acl.DatasetAclEntity; import com.google.cloud.bigquery.StandardTableDefinition.StreamingBuffer; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -38,8 +39,6 @@ public class SerializationTest extends BaseSerializationTest { Acl.of(new Acl.View(TableId.of("project", "dataset", "table")), Acl.Role.WRITER); private static final Acl ROUTINE_ACCESS = Acl.of(new Acl.Routine(RoutineId.of("project", "dataset", "routine")), Acl.Role.WRITER); - private static final List ACCESS_RULES = - ImmutableList.of(DOMAIN_ACCESS, GROUP_ACCESS, VIEW_ACCESS, ROUTINE_ACCESS, USER_ACCESS); private static final Long CREATION_TIME = System.currentTimeMillis() - 10; private static final Long DEFAULT_TABLE_EXPIRATION = 100L; private static final String DESCRIPTION = "Description"; @@ -50,6 +49,11 @@ public class SerializationTest extends BaseSerializationTest { private static final String LOCATION = ""; private static final String SELF_LINK = "http://bigquery/p/d"; private static final DatasetId DATASET_ID = DatasetId.of("project", "dataset"); + private static final List TARGET_TYPES = ImmutableList.of("VIEWS"); + private static final Acl DATASET_ACCESS = Acl.of(new DatasetAclEntity(DATASET_ID, TARGET_TYPES)); + private static final List ACCESS_RULES = + ImmutableList.of( + DOMAIN_ACCESS, GROUP_ACCESS, VIEW_ACCESS, ROUTINE_ACCESS, USER_ACCESS, DATASET_ACCESS); private static final DatasetInfo DATASET_INFO = DatasetInfo.newBuilder(DATASET_ID) .setAcl(ACCESS_RULES) @@ -228,6 +232,7 @@ protected Serializable[] serializableObjects() { USER_ACCESS, VIEW_ACCESS, ROUTINE_ACCESS, + DATASET_ACCESS, DATASET_ID, DATASET_INFO, TABLE_ID, diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 09c9b7a7b7..b8051122f7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -38,6 +38,7 @@ import com.google.cloud.Role; import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.Acl; +import com.google.cloud.bigquery.Acl.DatasetAclEntity; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption; import com.google.cloud.bigquery.BigQuery.DatasetField; @@ -1897,6 +1898,47 @@ public void testAuthorizeRoutine() { assertEquals(routineAcl, routineDataset.getAcl()); } + @Test + public void testAuthorizeDataset() { + String datasetName = RemoteBigQueryHelper.generateDatasetName(); + DatasetId datasetId = DatasetId.of(PROJECT_ID, datasetName); + List targetTypes = ImmutableList.of("VIEWS"); + // Specify the acl which will be shared to the authorized dataset + List acl = + ImmutableList.of( + Acl.of(new Acl.Group("projectOwners"), Acl.Role.OWNER), + Acl.of(new Acl.IamMember("allUsers"), Acl.Role.READER)); + DatasetInfo datasetInfo = + DatasetInfo.newBuilder(datasetId).setAcl(acl).setDescription("shared Dataset").build(); + Dataset sharedDataset = bigquery.create(datasetInfo); + assertNotNull(sharedDataset); + assertEquals(sharedDataset.getDescription(), "shared Dataset"); + // Get the current metadata for the dataset you want to share by calling the datasets.get method + List sharedDatasetAcl = new ArrayList<>(sharedDataset.getAcl()); + + // Create a new dataset to be authorized + String authorizedDatasetName = RemoteBigQueryHelper.generateDatasetName(); + DatasetId authorizedDatasetId = DatasetId.of(PROJECT_ID, authorizedDatasetName); + DatasetInfo authorizedDatasetInfo = + DatasetInfo.newBuilder(authorizedDatasetId) + .setDescription("new Dataset to be authorized by the sharedDataset") + .build(); + Dataset authorizedDataset = bigquery.create(authorizedDatasetInfo); + assertNotNull(authorizedDataset); + assertEquals( + authorizedDataset.getDescription(), "new Dataset to be authorized by the sharedDataset"); + + // Add the new DatasetAccessEntry object to the existing sharedDatasetAcl list + DatasetAclEntity datasetEntity = new DatasetAclEntity(authorizedDatasetId, targetTypes); + sharedDatasetAcl.add(Acl.of(datasetEntity)); + + // Update the dataset with the added authorization + Dataset updatedDataset = sharedDataset.toBuilder().setAcl(sharedDatasetAcl).build().update(); + + // Verify that the authorized dataset has been added + assertEquals(sharedDatasetAcl, updatedDataset.getAcl()); + } + @Test public void testSingleStatementsQueryException() throws InterruptedException { String invalidQuery = From b3b8d174121da24b7305060cf23f5e85dddee9a4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Feb 2022 19:12:50 +0000 Subject: [PATCH 0562/2268] chore(main): release 2.8.0 (#1820) :robot: I have created a release *beep* *boop* --- ## [2.8.0](https://github.com/googleapis/java-bigquery/compare/v2.7.1...v2.8.0) (2022-02-02) ### Features * add Dataset ACL support ([#1763](https://github.com/googleapis/java-bigquery/issues/1763)) ([18a11e8](https://github.com/googleapis/java-bigquery/commit/18a11e88c0be5c0d5cf89d498439d5f8347e589d)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220123-1.32.1 ([#1819](https://github.com/googleapis/java-bigquery/issues/1819)) ([82175f1](https://github.com/googleapis/java-bigquery/commit/82175f19634550f8b16c830362798396cd28e79d)) * update dependency com.google.cloud:google-cloud-bigtable to v2.5.2 ([#1821](https://github.com/googleapis/java-bigquery/issues/1821)) ([0fe0a78](https://github.com/googleapis/java-bigquery/commit/0fe0a78db110794f9d2797bd74792d361acef96c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b34e2ec70..20c9d3e508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.8.0](https://github.com/googleapis/java-bigquery/compare/v2.7.1...v2.8.0) (2022-02-02) + + +### Features + +* add Dataset ACL support ([#1763](https://github.com/googleapis/java-bigquery/issues/1763)) ([18a11e8](https://github.com/googleapis/java-bigquery/commit/18a11e88c0be5c0d5cf89d498439d5f8347e589d)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220123-1.32.1 ([#1819](https://github.com/googleapis/java-bigquery/issues/1819)) ([82175f1](https://github.com/googleapis/java-bigquery/commit/82175f19634550f8b16c830362798396cd28e79d)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.5.2 ([#1821](https://github.com/googleapis/java-bigquery/issues/1821)) ([0fe0a78](https://github.com/googleapis/java-bigquery/commit/0fe0a78db110794f9d2797bd74792d361acef96c)) + ### [2.7.1](https://github.com/googleapis/java-bigquery/compare/v2.7.0...v2.7.1) (2022-02-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b1a8f6f3f4..c20b9eb519 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.7.2-SNAPSHOT + 2.8.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 859c535ec8..5eee1ea2f9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.7.2-SNAPSHOT + 2.8.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.7.2-SNAPSHOT + 2.8.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3dd3457284..07ad8b6b72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.7.2-SNAPSHOT + 2.8.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.7.2-SNAPSHOT + 2.8.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1b50734e3c..143ca6acd0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.7.2-SNAPSHOT + 2.8.0 diff --git a/versions.txt b/versions.txt index b7da590b2d..9e9df81f2e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.7.1:2.7.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.8.0:2.8.0 \ No newline at end of file From 8b94d484f8ca0d2ecfee0203560268daae6053f8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Feb 2022 15:28:41 -0500 Subject: [PATCH 0563/2268] chore(main): release 2.8.1-SNAPSHOT (#1823) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c20b9eb519..4cdb68ba17 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.8.0 + 2.8.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5eee1ea2f9..ba2a040e64 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.8.0 + 2.8.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.8.0 + 2.8.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 07ad8b6b72..1e9908b191 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.8.0 + 2.8.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.8.0 + 2.8.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 143ca6acd0..b9d3634078 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.8.0 + 2.8.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9e9df81f2e..ed75b039a3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.8.0:2.8.0 \ No newline at end of file +google-cloud-bigquery:2.8.0:2.8.1-SNAPSHOT \ No newline at end of file From 9685318d46dc832dbd9907f2227b5f8b3fc0a934 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 3 Feb 2022 16:00:56 +0100 Subject: [PATCH 0564/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.8.0 (#1824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.7.1` -> `2.8.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.8.0/compatibility-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.8.0/confidence-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.8.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​280-httpsgithubcomgoogleapisjava-bigquerycomparev271v280-2022-02-02) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.7.1...v2.8.0) ##### Features - add Dataset ACL support ([#​1763](https://togithub.com/googleapis/java-bigquery/issues/1763)) ([18a11e8](https://togithub.com/googleapis/java-bigquery/commit/18a11e88c0be5c0d5cf89d498439d5f8347e589d)) ##### Dependencies - update dependency com.google.apis:google-api-services-bigquery to v2-rev20220123-1.32.1 ([#​1819](https://togithub.com/googleapis/java-bigquery/issues/1819)) ([82175f1](https://togithub.com/googleapis/java-bigquery/commit/82175f19634550f8b16c830362798396cd28e79d)) - update dependency com.google.cloud:google-cloud-bigtable to v2.5.2 ([#​1821](https://togithub.com/googleapis/java-bigquery/issues/1821)) ([0fe0a78](https://togithub.com/googleapis/java-bigquery/commit/0fe0a78db110794f9d2797bd74792d361acef96c)) ##### [2.7.1](https://togithub.com/googleapis/java-bigquery/compare/v2.7.0...v2.7.1) (2022-02-01) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#​1813](https://togithub.com/googleapis/java-bigquery/issues/1813)) ([f2cfc8b](https://togithub.com/googleapis/java-bigquery/commit/f2cfc8bc5f97359a69ac3647919670bd714ac953)) ##### Documentation - **samples:** fix CopyMultipleTables sample IT failure and improve a few other samples ([#​1817](https://togithub.com/googleapis/java-bigquery/issues/1817)) ([e12122c](https://togithub.com/googleapis/java-bigquery/commit/e12122c4472ed4c3d00fc8c7515be210bbf68df3)) - **samples:** fix GrantViewAccess sample IT failure ([#​1816](https://togithub.com/googleapis/java-bigquery/issues/1816)) ([d48ae41](https://togithub.com/googleapis/java-bigquery/commit/d48ae41d1437bd9246d973a9f0b56f230a1eea68))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b3f49656a..e61c8713df 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.7.1 + 2.8.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.7.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.8.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.7.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.8.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9cb96538f0..f4073794a7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.7.1 + 2.8.0 From bcccf585cc09cdaea1d5aac7ac00cad23260ffd1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 19:46:39 +0000 Subject: [PATCH 0565/2268] chore: add kokoro config to run nightly integration test on java11.0.14 (#1347) (#1825) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/nightly/java11-integration.cfg | 37 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .kokoro/nightly/java11-integration.cfg diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index be3b9bde4f..8807efcad4 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7062473f423f339256346ddbee3d81fb1de6b784fabc2a4d959d7df2c720e375 + digest: sha256:7c853edc4136ae8f19f9d46d4569d38de2e446db2eea057f32e412bdba255846 diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 0000000000..58049cc38f --- /dev/null +++ b/.kokoro/nightly/java11-integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} From b9a6f7352c632d7d4fb8767bb93d4dfd2f692bbb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 16:50:57 +0100 Subject: [PATCH 0566/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.6.3 (#1826) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1e9908b191..a2aa639499 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.6.2 + 1.6.3 pom import From bb4dd403eb1a94120bc73d22cb1da587ea2dd179 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 16:52:40 +0100 Subject: [PATCH 0567/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.2.1 (#1830) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2aa639499..eb819d9a7d 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.1.2 + 3.2.1 From 7bb6c79e4839f183dda021ddf81a3961efd752d6 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 7 Feb 2022 11:01:42 -0500 Subject: [PATCH 0568/2268] docs(sample): Add sample for native image support in Bigquery (#1829) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc(java): add sample for native image support * rename test; remove unused deps * fix readme * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 1 + samples/native-image-sample/README.md | 47 +++++ samples/native-image-sample/pom.xml | 161 +++++++++++++++++ .../bigquery/NativeImageBigquerySample.java | 170 ++++++++++++++++++ .../bigquery/NativeImageBigquerySampleIT.java | 67 +++++++ samples/pom.xml | 1 + 6 files changed, 447 insertions(+) create mode 100644 samples/native-image-sample/README.md create mode 100644 samples/native-image-sample/pom.xml create mode 100644 samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java create mode 100644 samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java diff --git a/README.md b/README.md index e61c8713df..9ec60a4f35 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Native Image Bigquery Sample | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java) | | Add Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | | Add Empty Column | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | | Auth Drive Scope | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md new file mode 100644 index 0000000000..e4e4b52eeb --- /dev/null +++ b/samples/native-image-sample/README.md @@ -0,0 +1,47 @@ +# BigQuery Sample Application with Native Image + +The BigQuery sample application demonstrates some common operations with [Google Cloud BigQuery](https://cloud.google.com/bigquery) and is compatible with Native Image compilation. + +## Setup Instructions + +1. Follow the [GCP Project Authentication and Native Image Setup Instructions](../../README.md). + +2. [Enable the BigQuery APIs](https://console.cloud.google.com/apis/api/bigquery.googleapis.com). + +### Run with Native Image Support + +Navigate to this directory in a new terminal. + +1. Compile the application using the Native Image Compiler. This step may take a few minutes. + + ``` + mvn package -P native -DskipTests + ``` + +2. Run the application: + + ``` + ./target/native-image-sample + ``` + +3. The application will create a sample BigQuery dataset in your GCP project called `nativeimage_test_dataset` and perform some simple operations like creating a table, inserting data, and running a query. + + If you would like to delete the BigQuery dataset later, you can manage your BigQuery resources through [Google Cloud Console](https://console.cloud.google.com/bigquery) to clean up BigQuery resources under your project. + + When you run the application, you'll see output like this in the terminal: + + ``` + Created new table: nativeimage_test_table_2351b0891d2f48af9309bd289c3bad13 + Successfully inserted test row. + Queried the following records: + User id: TestUser-2f39e3ec-d81a-483f-9ec0-b9bd54155710 | age: 40 + Deleted table: nativeimage_test_table_2351b0891d2f48af9309bd289c3bad13 + ``` + +### Sample Integration test with Native Image Support + +In order to run the sample integration test, call the following command: + +``` +mvn test -Pnative +``` \ No newline at end of file diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml new file mode 100644 index 0000000000..225e3ea208 --- /dev/null +++ b/samples/native-image-sample/pom.xml @@ -0,0 +1,161 @@ + + + + 4.0.0 + com.example.bigquery + native-image-sample + Native Image Sample + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + libraries-bom + 24.2.0 + pom + import + + + + + + + com.google.cloud + google-cloud-bigquery + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.example.bigquery.NativeImageBigquerySample + + + + + + + + + + + + native + + + + com.google.cloud + native-image-support + 0.10.0 + + + org.junit.vintage + junit-vintage-engine + 5.8.2 + test + + + org.graalvm.buildtools + junit-platform-native + 0.9.9 + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 2.22.2 + + + **/*IT + + + + + org.graalvm.buildtools + native-maven-plugin + 0.9.9 + true + + com.example.bigquery.NativeImageBigquerySample + + + --no-fallback + --no-server + + + + + build-native + + build + test + + package + + + test-native + + test + + test + + + + + + + + diff --git a/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java b/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java new file mode 100644 index 0000000000..e7f1b35c5d --- /dev/null +++ b/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java @@ -0,0 +1,170 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import com.google.api.gax.paging.Page; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryError; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.InsertAllRequest; +import com.google.cloud.bigquery.InsertAllResponse; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.Table; +import com.google.cloud.bigquery.TableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.TableResult; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * Sample application demonstrating BigQuery operations. + * + *

    Note: This application will create a BigQuery dataset in your GCP project. You can delete this + * by viewing BigQuery in Cloud Console https://console.cloud.google.com/bigquery or by uncommenting + * the call to `deleteDataset(..)` made in main(). + */ +public class NativeImageBigquerySample { + + private static final String DATASET_ID = "nativeimage_test_dataset"; + + private static final String TABLE_ID = "nativeimage_test_table"; + + private static final Schema TABLE_SCHEMA = + Schema.of( + Field.of("id", StandardSQLTypeName.STRING), Field.of("age", StandardSQLTypeName.INT64)); + + /** Entrypoint to the application. */ + public static void main(String[] args) throws InterruptedException { + BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService(); + + if (!hasDataset(bigQuery, DATASET_ID)) { + createDataset(bigQuery, DATASET_ID); + } + + String tableName = TABLE_ID + "_" + UUID.randomUUID().toString().replace("-", ""); + createTable(bigQuery, DATASET_ID, tableName, TABLE_SCHEMA); + String testId = "TestUser-" + UUID.randomUUID().toString(); + int testAge = 40; + insertTestRecord(bigQuery, DATASET_ID, tableName, testId, testAge); + queryTable(bigQuery, DATASET_ID, tableName); + + // Clean up resources. + deleteTable(bigQuery, DATASET_ID, tableName); + + // Uncomment this to delete the created dataset. + // deleteDataset(bigQuery, DATASET_ID); + } + + static String queryTable(BigQuery bigQuery, String datasetName, String tableName) + throws InterruptedException { + String fullyQualifiedTable = datasetName + "." + tableName; + String query = "SELECT * FROM " + fullyQualifiedTable; + + QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build(); + TableResult results = bigQuery.query(queryConfig); + + String result = ""; + System.out.println("Queried the following records: "); + for (FieldValueList row : results.iterateAll()) { + String rowStatement = + String.format( + "User id: %s | age: %d\n", + row.get("id").getStringValue(), row.get("age").getLongValue()); + result += rowStatement; + System.out.println(row); + } + return result; + } + + static void insertTestRecord( + BigQuery bigQuery, String datasetName, String tableName, String id, int age) { + + Map rowContent = new HashMap<>(); + rowContent.put("id", id); + rowContent.put("age", age); + + InsertAllRequest request = + InsertAllRequest.newBuilder(datasetName, tableName).addRow(rowContent).build(); + + InsertAllResponse response = bigQuery.insertAll(request); + + if (response.hasErrors()) { + System.out.println("Insert resulted in errors:"); + for (Map.Entry> entry : response.getInsertErrors().entrySet()) { + System.out.println("Response error: \n" + entry.getValue()); + } + } else { + System.out.println("Successfully inserted test row."); + } + } + + static void createTable(BigQuery bigQuery, String datasetName, String tableName, Schema schema) { + + TableId tableId = TableId.of(datasetName, tableName); + TableDefinition tableDefinition = StandardTableDefinition.of(schema); + TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); + bigQuery.create(tableInfo); + System.out.println("Created new table: " + tableName); + } + + static boolean hasTable(BigQuery bigQuery, String datasetName, String tableName) { + + Page

  • tables = bigQuery.listTables(datasetName); + for (Table table : tables.iterateAll()) { + if (tableName.equals(table.getTableId().getTable())) { + return true; + } + } + return false; + } + + static void createDataset(BigQuery bigQuery, String datasetName) { + DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); + Dataset newDataset = bigQuery.create(datasetInfo); + System.out.println("Created new dataset: " + newDataset.getDatasetId().getDataset()); + } + + static boolean hasDataset(BigQuery bigQuery, String datasetName) { + Page datasets = bigQuery.listDatasets(); + for (Dataset dataset : datasets.iterateAll()) { + if (datasetName.equals(dataset.getDatasetId().getDataset())) { + return true; + } + } + return false; + } + + static void deleteTable(BigQuery bigQuery, String datasetName, String tableName) { + bigQuery.getTable(datasetName, tableName).delete(); + System.out.println("Deleted table: " + tableName); + } + + static void deleteDataset(BigQuery bigQuery, String datasetName) { + bigQuery.getDataset(datasetName).delete(); + System.out.println("Deleting dataset " + datasetName); + } +} diff --git a/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java b/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java new file mode 100644 index 0000000000..a65bc5aa87 --- /dev/null +++ b/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java @@ -0,0 +1,67 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import java.util.UUID; +import org.junit.Before; +import org.junit.Test; + +/** Tests for {@link NativeImageBigquerySample} */ +public class NativeImageBigquerySampleIT { + + private static final String DATASET_ID = "nativeimage_it_dataset"; + + private static final String TABLE_ID = "nativeimage_it_table"; + + private static final Schema TABLE_SCHEMA = + Schema.of( + Field.of("id", StandardSQLTypeName.STRING), Field.of("age", StandardSQLTypeName.INT64)); + + private BigQuery bigQuery; + + private String tableName; + + @Before + public void setUp() { + bigQuery = BigQueryOptions.getDefaultInstance().getService(); + tableName = TABLE_ID + "_" + UUID.randomUUID().toString().replace("-", ""); + if (!NativeImageBigquerySample.hasDataset(bigQuery, DATASET_ID)) { + NativeImageBigquerySample.createDataset(bigQuery, DATASET_ID); + } + NativeImageBigquerySample.createTable(bigQuery, DATASET_ID, tableName, TABLE_SCHEMA); + } + + @Test + public void testQueryTable() throws InterruptedException { + String testId = "TestUser-" + UUID.randomUUID(); + NativeImageBigquerySample.insertTestRecord(bigQuery, DATASET_ID, tableName, testId, 40); + + String result = NativeImageBigquerySample.queryTable(bigQuery, DATASET_ID, tableName); + + assertThat(result).isEqualTo("User id: " + testId + " | age: 40\n"); + + // Clean up + NativeImageBigquerySample.deleteTable(bigQuery, DATASET_ID, tableName); + } +} diff --git a/samples/pom.xml b/samples/pom.xml index 4e9299af44..a02b0b6c46 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -47,6 +47,7 @@ install-without-bom snapshot snippets + native-image-sample From d3704016ae603b86d265ae5abe31defc6444c3cc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 23:08:09 +0100 Subject: [PATCH 0569/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.9 (#1827) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f4073794a7..ad5a30df3d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.8 + 2.1.9 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b9d3634078..048b6febfd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.8 + 2.1.9 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1be592b879..de49cf79a6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.8 + 2.1.9 test From 94d838a96d123b20388ac40b241831bdd086a2d1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:08:24 -0500 Subject: [PATCH 0570/2268] chore: enable auto release in java (#1349) (#1833) * chore: fix auto-release * chore: remove codecov.yml * chore: update license headers for yaml files Source-Link: https://github.com/googleapis/synthtool/commit/5b777277a01a93e7f10c9279521e807b934e78d4 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:ebc2104854c5b81c6fd72ca79400a2e20e0d510c5e0654fd1a19e5c9be160ca6 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/approve-readme.yaml | 15 +++++++++++++++ .github/workflows/auto-release.yaml | 19 +++++++++++++++++-- .github/workflows/ci.yaml | 15 +++++++++++++++ .github/workflows/samples.yaml | 15 +++++++++++++++ .kokoro/build.bat | 15 +++++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8807efcad4..a8ddd81ae9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7c853edc4136ae8f19f9d46d4569d38de2e446db2eea057f32e412bdba255846 + digest: sha256:ebc2104854c5b81c6fd72ca79400a2e20e0d510c5e0654fd1a19e5c9be160ca6 diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index c513242798..1bb1823276 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: auto-merge-readme diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 59c7cadde3..2ba3082bee 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: auto-release @@ -16,8 +31,8 @@ jobs: return; } - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + // only approve PRs like "chore(main): release " + if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { return; } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 05de1f60dc..6b5e56aaac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: push: branches: diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index c46230a78c..d5d964df15 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: samples diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 05826ad93f..cc602c9eba 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,3 +1,18 @@ :: See documentation in type-shell-output.bat +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh From d628fff9b899e13c75aaf26d42bfc553c48a3c4e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 23:10:52 +0100 Subject: [PATCH 0571/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.4.0 (#1828) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb819d9a7d..15d25e3a2e 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ com.google.cloud google-cloud-storage - 2.3.0 + 2.4.0 test From 1d27b309e2fa6cdc99fc08234390a065d7ca1098 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 23:11:05 +0100 Subject: [PATCH 0572/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.0 (#1832) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 225e3ea208..dc7e8910fe 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.10.0 + 0.12.0 org.junit.vintage From b7c2ee12fd93471be4c95e0a990af2feac892bbb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 00:46:45 +0000 Subject: [PATCH 0573/2268] chore: update auto-release script to fix breaking changes in v5 (#1350) (#1834) Source-Link: https://github.com/googleapis/synthtool/commit/53a58c23eb4decb3a17fab07388d42799e158b5f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/auto-release.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a8ddd81ae9..9786771c43 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:ebc2104854c5b81c6fd72ca79400a2e20e0d510c5e0654fd1a19e5c9be160ca6 + digest: sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 2ba3082bee..18e23230d9 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -37,7 +37,7 @@ jobs: } // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.pulls.listFiles.endpoint({ + const filesPromise = github.rest.pulls.listFiles.endpoint({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.payload.pull_request.number, @@ -69,7 +69,7 @@ jobs: return; } - const promise = github.pulls.list.endpoint({ + const promise = github.rest.pulls.list.endpoint({ owner: context.repo.owner, repo: context.repo.repo, state: 'open' @@ -86,7 +86,7 @@ jobs: } // approve release PR - await github.pulls.createReview({ + await github.rest.pulls.createReview({ owner: context.repo.owner, repo: context.repo.repo, body: 'Rubber stamped release!', @@ -95,7 +95,7 @@ jobs: }); // attach kokoro:force-run and automerge labels - await github.issues.addLabels({ + await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.pull_request.number, From 7680714f4a2d0da798ec3ea613701251cba859ff Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Feb 2022 17:09:38 +0100 Subject: [PATCH 0574/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.1 (#1835) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ad5a30df3d..3c04414a20 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.0 + 1.33.1 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 048b6febfd..a4dd241734 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.0 + 1.33.1 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index de49cf79a6..056622b347 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.0 + 1.33.1 com.google.oauth-client From 950f3cdb3be2571f0519848aa167e67949e06f1e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Feb 2022 17:09:49 +0100 Subject: [PATCH 0575/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.1 (#1836) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3c04414a20..27edaf5f7d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.0 + 1.33.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a4dd241734..09a7c7f762 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.0 + 1.33.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 056622b347..f51e085958 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.0 + 1.33.1 From 7418e6fdb48a3b30f3ce41081141af2999dc8edf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Feb 2022 17:10:00 +0100 Subject: [PATCH 0576/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.2.7 (#1837) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 15d25e3a2e..e4c64c4c68 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.6 + 1.2.7 From 727a07a4c6e62d9a2317bd47af81c877eed419e3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Feb 2022 20:14:52 +0100 Subject: [PATCH 0577/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.3.0 (#1838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java)) | `24.2.0` -> `24.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.3.0/compatibility-slim/24.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/24.3.0/confidence-slim/24.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ec60a4f35..82c393b42f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.2.0 + 24.3.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.2.0') +implementation platform('com.google.cloud:libraries-bom:24.3.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index dc7e8910fe..c60891617f 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 24.2.0 + 24.3.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f51e085958..0edf7d4853 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.2.0 + 24.3.0 pom import From e8ebd5c2ed29f26aa004e1bdf59ab2e7afb2963c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Feb 2022 18:06:26 +0100 Subject: [PATCH 0578/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.4.1 (#1839) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4c64c4c68..b93e271236 100644 --- a/pom.xml +++ b/pom.xml @@ -127,7 +127,7 @@ com.google.cloud google-cloud-storage - 2.4.0 + 2.4.1 test From 88fc05f3233e4e3a9cdfa73eff9856e4fd6fb1c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Feb 2022 18:06:43 +0100 Subject: [PATCH 0579/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.5.3 (#1840) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 27edaf5f7d..4b3ba9df96 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.5.2 + 2.5.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 09a7c7f762..e3a9c6b5dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.5.2 + 2.5.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0edf7d4853..8a7caea9d9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.5.2 + 2.5.3 test From 15918a1fa006734ee265ccc569facb8958a1d0bb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Feb 2022 18:06:52 +0100 Subject: [PATCH 0580/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.1 (#1841) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index c60891617f..e846e5692c 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.0 + 0.12.1 org.junit.vintage From 56e6acf4def66c4c298fa7bb6b38025db9faee68 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Feb 2022 18:02:42 +0100 Subject: [PATCH 0581/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.2 (#1843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:native-image-support](https://togithub.com/googleapis/java-core) | `0.12.1` -> `0.12.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.2/compatibility-slim/0.12.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.2/confidence-slim/0.12.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e846e5692c..2af27fd1ea 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.1 + 0.12.2 org.junit.vintage From a79d802a0514aaf1a48c6d8462087c9cbeb6046a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 11 Feb 2022 16:46:52 +0100 Subject: [PATCH 0582/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.3.2 (#1846) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b93e271236..40574d0934 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.3.2 html From b64b441bf4d0e79434e556f1fdb9ec0083d5baec Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 11 Feb 2022 17:16:06 +0100 Subject: [PATCH 0583/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.3 (#1845) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 2af27fd1ea..6e3fced6bd 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.2 + 0.12.3 org.junit.vintage From 7ffe963043ae8b243f1e351a5fffd992f3fcbbb5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 11 Feb 2022 18:42:51 +0100 Subject: [PATCH 0584/2268] deps: update actions/github-script action to v6 (#1847) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/github-script](https://togithub.com/actions/github-script) | action | major | `v5` -> `v6` | --- ### Release Notes
    actions/github-script ### [`v6`](https://togithub.com/actions/github-script/compare/v5...v6) [Compare Source](https://togithub.com/actions/github-script/compare/v5...v6)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From fd3751a44be8f6401ea4b13684f862177ee9e976 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 11 Feb 2022 15:47:33 -0500 Subject: [PATCH 0585/2268] feat: add Interval type support (#1844) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add Interval type support Fixes b/208051516 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add threeten-extra PeriodDuration support * add unit test coverage Co-authored-by: Owl Bot --- google-cloud-bigquery/pom.xml | 4 + .../cloud/bigquery/LegacySQLTypeName.java | 3 + .../cloud/bigquery/QueryParameterValue.java | 20 ++++- .../cloud/bigquery/StandardSQLTypeName.java | 6 +- .../bigquery/QueryParameterValueTest.java | 20 +++++ .../cloud/bigquery/it/ITBigQueryTest.java | 73 +++++++++++++++++++ pom.xml | 8 ++ 7 files changed, 131 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ba2a040e64..acc436d43a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -85,6 +85,10 @@ com.google.code.gson gson
    + + org.threeten + threeten-extra + diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java index 1c2a3d884a..944df2fb06 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java @@ -96,6 +96,9 @@ public LegacySQLTypeName apply(String constant) { /** Represents JSON data */ public static final LegacySQLTypeName JSON = type.createAndRegister("JSON").setStandardType(StandardSQLTypeName.JSON); + /** Represents duration or amount of time. */ + public static final LegacySQLTypeName INTERVAL = + type.createAndRegister("INTERVAL").setStandardType(StandardSQLTypeName.INTERVAL); private static Map standardToLegacyMap = new HashMap<>(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index f7f7e384f6..227597bb13 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -43,6 +43,7 @@ import org.threeten.bp.format.DateTimeFormatter; import org.threeten.bp.format.DateTimeFormatterBuilder; import org.threeten.bp.format.DateTimeParseException; +import org.threeten.extra.PeriodDuration; /** * A value for a QueryParameter along with its type. @@ -63,6 +64,7 @@ *
  • BigDecimal: StandardSQLTypeName.NUMERIC *
  • BigNumeric: StandardSQLTypeName.BIGNUMERIC *
  • JSON: StandardSQLTypeName.JSON + *
  • INTERVAL: StandardSQLTypeName.INTERVAL * * *

    No other types are supported through that entry point. The other types can be created by @@ -308,12 +310,26 @@ public static QueryParameterValue time(String value) { /** * Creates a {@code QueryParameterValue} object with a type of DATETIME. Must be in the format - * "yyyy-MM-dd HH:mm:ss.SSSSSS", e.g. ""2014-08-19 12:41:35.220000". + * "yyyy-MM-dd HH:mm:ss.SSSSSS", e.g. "2014-08-19 12:41:35.220000". */ public static QueryParameterValue dateTime(String value) { return of(value, StandardSQLTypeName.DATETIME); } + /** + * Creates a {@code QueryParameterValue} object with a type of INTERVAL. Must be in the canonical + * format "[sign]Y-M [sign]D [sign]H:M:S[.F]", e.g. "123-7 -19 0:24:12.000006" or ISO 8601 + * duration format, e.g. "P123Y7M-19DT0H24M12.000006S" + */ + public static QueryParameterValue interval(String value) { + return of(value, StandardSQLTypeName.INTERVAL); + } + + /** Creates a {@code QueryParameterValue} object with a type of INTERVAL. */ + public static QueryParameterValue interval(PeriodDuration value) { + return of(value, StandardSQLTypeName.INTERVAL); + } + /** * Creates a {@code QueryParameterValue} object with a type of ARRAY, and an array element type * based on the given class. @@ -408,6 +424,8 @@ private static String valueToStringOrNull(T value, StandardSQLTypeName type) return value.toString(); case JSON: if (value instanceof String || value instanceof JsonObject) return value.toString(); + case INTERVAL: + if (value instanceof String || value instanceof PeriodDuration) return value.toString(); break; case STRUCT: throw new IllegalArgumentException("Cannot convert STRUCT to String value"); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java index 57152a2a6c..1081fc5d60 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java @@ -57,6 +57,8 @@ public enum StandardSQLTypeName { DATETIME, /** Represents a set of geographic points, represented as a Well Known Text (WKT) string. */ GEOGRAPHY, - /** Represents JSON data */ - JSON + /** Represents JSON data. */ + JSON, + /** Represents duration or amount of time. */ + INTERVAL } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index 679b6ec5c9..6b5368003b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -27,6 +27,7 @@ import com.google.gson.JsonObject; import java.math.BigDecimal; import java.text.ParseException; +import java.time.Period; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -38,6 +39,7 @@ import org.threeten.bp.format.DateTimeFormatter; import org.threeten.bp.format.DateTimeFormatterBuilder; import org.threeten.bp.jdk8.Jdk8Methods; +import org.threeten.extra.PeriodDuration; public class QueryParameterValueTest { @@ -212,6 +214,24 @@ public void testJson() { assertThat(value1.getArrayType()).isNull(); } + @Test + public void testInterval() { + QueryParameterValue value = QueryParameterValue.interval("123-7 -19 0:24:12.000006"); + QueryParameterValue value1 = QueryParameterValue.interval("P123Y7M-19DT0H24M12.000006S"); + QueryParameterValue value2 = + QueryParameterValue.interval( + PeriodDuration.of(Period.of(1, 2, 25), java.time.Duration.ofHours(8))); + assertThat(value.getValue()).isEqualTo("123-7 -19 0:24:12.000006"); + assertThat(value1.getValue()).isEqualTo("P123Y7M-19DT0H24M12.000006S"); + assertThat(value2.getValue()).isEqualTo("P1Y2M25DT8H"); + assertThat(value.getType()).isEqualTo(StandardSQLTypeName.INTERVAL); + assertThat(value1.getType()).isEqualTo(StandardSQLTypeName.INTERVAL); + assertThat(value2.getType()).isEqualTo(StandardSQLTypeName.INTERVAL); + assertThat(value.getArrayType()).isNull(); + assertThat(value1.getArrayType()).isNull(); + assertThat(value2.getArrayType()).isNull(); + } + @Test public void testBytes() { QueryParameterValue value = QueryParameterValue.bytes(new byte[] {1, 3}); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b8051122f7..282bef986c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -130,6 +130,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.FileSystems; import java.time.Instant; +import java.time.Period; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -151,6 +152,7 @@ import org.junit.Test; import org.junit.rules.Timeout; import org.threeten.bp.Duration; +import org.threeten.extra.PeriodDuration; public class ITBigQueryTest { @@ -816,6 +818,77 @@ public void testJsonType() throws InterruptedException { } } + @Test + public void testIntervalType() throws InterruptedException { + String tableName = "test_create_table_intervaltype"; + TableId tableId = TableId.of(DATASET, tableName); + Schema schema = Schema.of(Field.of("intervalField", StandardSQLTypeName.INTERVAL)); + StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(schema); + try { + // Create a table with a JSON column + Table createdTable = bigquery.create(TableInfo.of(tableId, standardTableDefinition)); + assertNotNull(createdTable); + + // Insert 3 rows of Interval data into the Interval column + Map intervalRow1 = + Collections.singletonMap("intervalField", "123-7 -19 0:24:12.000006"); + Map intervalRow2 = + Collections.singletonMap("intervalField", "P123Y7M-19DT0H24M12.000006S"); + + InsertAllRequest request = + InsertAllRequest.newBuilder(tableId).addRow(intervalRow1).addRow(intervalRow2).build(); + InsertAllResponse response = bigquery.insertAll(request); + assertFalse(response.hasErrors()); + assertEquals(0, response.getInsertErrors().size()); + + // Insert another Interval row parsed from a String with Interval positional query parameter + String dml = "INSERT INTO " + tableId.getTable() + " (intervalField) VALUES(?)"; + // Parsing from ISO 8610 format String + QueryParameterValue intervalParameter = + QueryParameterValue.interval("P125Y7M-19DT0H24M12.000006S"); + QueryJobConfiguration dmlQueryJobConfiguration = + QueryJobConfiguration.newBuilder(dml) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(intervalParameter) + .build(); + bigquery.query(dmlQueryJobConfiguration); + Page rows = bigquery.listTableData(tableId); + assertEquals(3, Iterables.size(rows.getValues())); + + // Parsing from threeten-extra PeriodDuration + QueryParameterValue intervalParameter1 = + QueryParameterValue.interval( + PeriodDuration.of(Period.of(1, 2, 25), java.time.Duration.ofHours(8))); + QueryJobConfiguration dmlQueryJobConfiguration1 = + QueryJobConfiguration.newBuilder(dml) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(intervalParameter1) + .build(); + bigquery.query(dmlQueryJobConfiguration1); + Page rows1 = bigquery.listTableData(tableId); + assertEquals(4, Iterables.size(rows1.getValues())); + + // Query the Interval column with Interval positional query parameter + String sql = "SELECT intervalField FROM " + tableId.getTable() + " WHERE intervalField = ? "; + QueryParameterValue intervalParameter2 = + QueryParameterValue.interval("P125Y7M-19DT0H24M12.000006S"); + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(sql) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .addPositionalParameter(intervalParameter2) + .build(); + TableResult result = bigquery.query(queryJobConfiguration); + for (FieldValueList values : result.iterateAll()) { + assertEquals("125-7 -19 0:24:12.000006", values.get(0).getValue()); + } + } finally { + assertTrue(bigquery.delete(tableId)); + } + } + @Test public void testCreateTableWithConstraints() { String tableName = "test_create_table_with_constraints"; diff --git a/pom.xml b/pom.xml index 40574d0934..d34ff12442 100644 --- a/pom.xml +++ b/pom.xml @@ -93,12 +93,20 @@ ${google-api-services-bigquery.version} + com.google.code.gson gson 2.8.9 + + + org.threeten + threeten-extra + 1.7.0 + + junit From 93b0d3e3f13d223e6a4ec6184e33959f9e83a27c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 22:07:05 +0000 Subject: [PATCH 0586/2268] chore(main): release 2.9.0 (#1831) :robot: I have created a release *beep* *boop* --- ## [2.9.0](https://github.com/googleapis/java-bigquery/compare/v2.8.0...v2.9.0) (2022-02-11) ### Features * add Interval type support ([#1844](https://github.com/googleapis/java-bigquery/issues/1844)) ([fd3751a](https://github.com/googleapis/java-bigquery/commit/fd3751a44be8f6401ea4b13684f862177ee9e976)) ### Documentation * **sample:** Add sample for native image support in Bigquery ([#1829](https://github.com/googleapis/java-bigquery/issues/1829)) ([7bb6c79](https://github.com/googleapis/java-bigquery/commit/7bb6c79e4839f183dda021ddf81a3961efd752d6)) ### Dependencies * update actions/github-script action to v6 ([#1847](https://github.com/googleapis/java-bigquery/issues/1847)) ([7ffe963](https://github.com/googleapis/java-bigquery/commit/7ffe963043ae8b243f1e351a5fffd992f3fcbbb5)) * update dependency com.google.cloud:google-cloud-bigtable to v2.5.3 ([#1840](https://github.com/googleapis/java-bigquery/issues/1840)) ([88fc05f](https://github.com/googleapis/java-bigquery/commit/88fc05f3233e4e3a9cdfa73eff9856e4fd6fb1c7)) * update dependency com.google.cloud:google-cloud-storage to v2.4.0 ([#1828](https://github.com/googleapis/java-bigquery/issues/1828)) ([d628fff](https://github.com/googleapis/java-bigquery/commit/d628fff9b899e13c75aaf26d42bfc553c48a3c4e)) * update dependency com.google.cloud:google-cloud-storage to v2.4.1 ([#1839](https://github.com/googleapis/java-bigquery/issues/1839)) ([e8ebd5c](https://github.com/googleapis/java-bigquery/commit/e8ebd5c2ed29f26aa004e1bdf59ab2e7afb2963c)) * update dependency com.google.cloud:native-image-support to v0.12.0 ([#1832](https://github.com/googleapis/java-bigquery/issues/1832)) ([1d27b30](https://github.com/googleapis/java-bigquery/commit/1d27b309e2fa6cdc99fc08234390a065d7ca1098)) * update dependency com.google.cloud:native-image-support to v0.12.1 ([#1841](https://github.com/googleapis/java-bigquery/issues/1841)) ([15918a1](https://github.com/googleapis/java-bigquery/commit/15918a1fa006734ee265ccc569facb8958a1d0bb)) * update dependency com.google.cloud:native-image-support to v0.12.2 ([#1843](https://github.com/googleapis/java-bigquery/issues/1843)) ([56e6acf](https://github.com/googleapis/java-bigquery/commit/56e6acf4def66c4c298fa7bb6b38025db9faee68)) * update dependency com.google.cloud:native-image-support to v0.12.3 ([#1845](https://github.com/googleapis/java-bigquery/issues/1845)) ([b64b441](https://github.com/googleapis/java-bigquery/commit/b64b441bf4d0e79434e556f1fdb9ec0083d5baec)) * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.1 ([#1835](https://github.com/googleapis/java-bigquery/issues/1835)) ([7680714](https://github.com/googleapis/java-bigquery/commit/7680714f4a2d0da798ec3ea613701251cba859ff)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.1 ([#1836](https://github.com/googleapis/java-bigquery/issues/1836)) ([950f3cd](https://github.com/googleapis/java-bigquery/commit/950f3cdb3be2571f0519848aa167e67949e06f1e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c9d3e508..8e9adc2177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [2.9.0](https://github.com/googleapis/java-bigquery/compare/v2.8.0...v2.9.0) (2022-02-11) + + +### Features + +* add Interval type support ([#1844](https://github.com/googleapis/java-bigquery/issues/1844)) ([fd3751a](https://github.com/googleapis/java-bigquery/commit/fd3751a44be8f6401ea4b13684f862177ee9e976)) + + +### Documentation + +* **sample:** Add sample for native image support in Bigquery ([#1829](https://github.com/googleapis/java-bigquery/issues/1829)) ([7bb6c79](https://github.com/googleapis/java-bigquery/commit/7bb6c79e4839f183dda021ddf81a3961efd752d6)) + + +### Dependencies + +* update actions/github-script action to v6 ([#1847](https://github.com/googleapis/java-bigquery/issues/1847)) ([7ffe963](https://github.com/googleapis/java-bigquery/commit/7ffe963043ae8b243f1e351a5fffd992f3fcbbb5)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.5.3 ([#1840](https://github.com/googleapis/java-bigquery/issues/1840)) ([88fc05f](https://github.com/googleapis/java-bigquery/commit/88fc05f3233e4e3a9cdfa73eff9856e4fd6fb1c7)) +* update dependency com.google.cloud:google-cloud-storage to v2.4.0 ([#1828](https://github.com/googleapis/java-bigquery/issues/1828)) ([d628fff](https://github.com/googleapis/java-bigquery/commit/d628fff9b899e13c75aaf26d42bfc553c48a3c4e)) +* update dependency com.google.cloud:google-cloud-storage to v2.4.1 ([#1839](https://github.com/googleapis/java-bigquery/issues/1839)) ([e8ebd5c](https://github.com/googleapis/java-bigquery/commit/e8ebd5c2ed29f26aa004e1bdf59ab2e7afb2963c)) +* update dependency com.google.cloud:native-image-support to v0.12.0 ([#1832](https://github.com/googleapis/java-bigquery/issues/1832)) ([1d27b30](https://github.com/googleapis/java-bigquery/commit/1d27b309e2fa6cdc99fc08234390a065d7ca1098)) +* update dependency com.google.cloud:native-image-support to v0.12.1 ([#1841](https://github.com/googleapis/java-bigquery/issues/1841)) ([15918a1](https://github.com/googleapis/java-bigquery/commit/15918a1fa006734ee265ccc569facb8958a1d0bb)) +* update dependency com.google.cloud:native-image-support to v0.12.2 ([#1843](https://github.com/googleapis/java-bigquery/issues/1843)) ([56e6acf](https://github.com/googleapis/java-bigquery/commit/56e6acf4def66c4c298fa7bb6b38025db9faee68)) +* update dependency com.google.cloud:native-image-support to v0.12.3 ([#1845](https://github.com/googleapis/java-bigquery/issues/1845)) ([b64b441](https://github.com/googleapis/java-bigquery/commit/b64b441bf4d0e79434e556f1fdb9ec0083d5baec)) +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.1 ([#1835](https://github.com/googleapis/java-bigquery/issues/1835)) ([7680714](https://github.com/googleapis/java-bigquery/commit/7680714f4a2d0da798ec3ea613701251cba859ff)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.1 ([#1836](https://github.com/googleapis/java-bigquery/issues/1836)) ([950f3cd](https://github.com/googleapis/java-bigquery/commit/950f3cdb3be2571f0519848aa167e67949e06f1e)) + ## [2.8.0](https://github.com/googleapis/java-bigquery/compare/v2.7.1...v2.8.0) (2022-02-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4cdb68ba17..8472c7ebb2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.8.1-SNAPSHOT + 2.9.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index acc436d43a..123f95281e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.8.1-SNAPSHOT + 2.9.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.8.1-SNAPSHOT + 2.9.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d34ff12442..4048b0b992 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.8.1-SNAPSHOT + 2.9.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.8.1-SNAPSHOT + 2.9.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e3a9c6b5dd..312c274576 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.8.1-SNAPSHOT + 2.9.0 diff --git a/versions.txt b/versions.txt index ed75b039a3..8dc052a16a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.8.0:2.8.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.9.0:2.9.0 \ No newline at end of file From e2c65e119adc179f8db786cc99551422076e82c4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 23:02:44 +0000 Subject: [PATCH 0587/2268] chore(main): release 2.9.1-SNAPSHOT (#1851) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8472c7ebb2..bcdb43dbc6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.0 + 2.9.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 123f95281e..8c714685b7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.0 + 2.9.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.0 + 2.9.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4048b0b992..c458e286f9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.0 + 2.9.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.0 + 2.9.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 312c274576..65665a06f7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.0 + 2.9.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8dc052a16a..509577ad80 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.0:2.9.0 \ No newline at end of file +google-cloud-bigquery:2.9.0:2.9.1-SNAPSHOT \ No newline at end of file From 627da62bd02314c673c345bd8eb87e973a805bc7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 00:33:58 +0100 Subject: [PATCH 0588/2268] deps: update dependency com.google.code.gson:gson to v2.9.0 (#1850) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c458e286f9..a77f773070 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.code.gson gson - 2.8.9 + 2.9.0 From ef91109821a702a6b55b4f1265e812578ca881d8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 00:34:37 +0100 Subject: [PATCH 0589/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.4.2 (#1853) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.4.2 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 82c393b42f..2557f71171 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.8.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.9.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.8.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.0" ``` ## Authentication diff --git a/pom.xml b/pom.xml index a77f773070..2665ea4288 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.4.1 + 2.4.2 test From c979f550bf34d6bf29dadf5b5ed08b52dade3cd6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 00:35:09 +0100 Subject: [PATCH 0590/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.10 (#1854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.10 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4b3ba9df96..42371f6ed4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.9 + 2.1.10 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 65665a06f7..35ab225ef4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.9 + 2.1.10 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8a7caea9d9..3e913a8346 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.9 + 2.1.10 test From 376738d5fb7253de6e2e9d574aa99e9d7a9e67ad Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 00:35:37 +0100 Subject: [PATCH 0591/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.4 (#1855) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:native-image-support to v0.12.4 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 6e3fced6bd..4eeaa7c9a5 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.3 + 0.12.4 org.junit.vintage From b3b5398d6ba5473e0a4a2f30cbb76510e0eb7e62 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 00:35:52 +0100 Subject: [PATCH 0592/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.0 (#1856) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2557f71171..d3f20914ee 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.8.0 + 2.9.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 42371f6ed4..115af2736a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.8.0 + 2.9.0 From 3e82960f75ced489f9f0e72fe45165ab866f1d8b Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 14 Feb 2022 11:00:32 -0500 Subject: [PATCH 0593/2268] fix(java): add additional configurations to fix native image tests (#1859) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(java): add configurations to fix native image tests * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/bigquery/it/ITBigQueryTest.java | 7 +++--- .../META-INF/native-image/reflect-config.json | 23 +++++++++++++++++++ .../native-image/resource-config.json | 3 +++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 google-cloud-bigquery/src/test/resources/META-INF/native-image/reflect-config.json create mode 100644 google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 282bef986c..9cab253a21 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -125,10 +125,10 @@ import com.google.common.io.BaseEncoding; import com.google.gson.JsonObject; import java.io.IOException; +import java.io.InputStream; import java.math.BigDecimal; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; -import java.nio.file.FileSystems; import java.time.Instant; import java.time.Period; import java.util.ArrayList; @@ -472,9 +472,10 @@ public static void beforeClass() throws InterruptedException, IOException { .setContentType("application/json") .build(), JSON_CONTENT_SIMPLE.getBytes(StandardCharsets.UTF_8)); + InputStream stream = + ITBigQueryTest.class.getClassLoader().getResourceAsStream("QueryTestData.csv"); storage.createFrom( - BlobInfo.newBuilder(BUCKET, LOAD_FILE_LARGE).setContentType("text/plain").build(), - FileSystems.getDefault().getPath("src/test/resources", "QueryTestData.csv")); + BlobInfo.newBuilder(BUCKET, LOAD_FILE_LARGE).setContentType("text/plain").build(), stream); DatasetInfo info = DatasetInfo.newBuilder(DATASET).setDescription(DESCRIPTION).setLabels(LABELS).build(); bigquery.create(info); diff --git a/google-cloud-bigquery/src/test/resources/META-INF/native-image/reflect-config.json b/google-cloud-bigquery/src/test/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 0000000000..b999445994 --- /dev/null +++ b/google-cloud-bigquery/src/test/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,23 @@ +[ + { + "name":"java.lang.Object", + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"com.google.api.client.googleapis.json.GoogleJsonError", + "methods":[ + {"name":"","parameterTypes":[] }] + }, + { + "name":"com.google.api.client.googleapis.json.GoogleJsonError$Details", + "methods":[{"name":"","parameterTypes":[] }] + }, + { + "name":"com.google.api.client.googleapis.json.GoogleJsonError$ErrorInfo", + "methods":[{"name":"","parameterTypes":[]}] + }, + { + "name":"java.util.HashMap", + "methods":[{"name":"","parameterTypes":[] }] + } +] \ No newline at end of file diff --git a/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json b/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..e00ed1f1c5 --- /dev/null +++ b/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,3 @@ +{ + "resources":[{"pattern": ".*.csv"}] +} \ No newline at end of file From 5598477db7a0eeddd72795ddb9257ade539597b2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 17:00:55 +0100 Subject: [PATCH 0594/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.10.0 (#1858) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bcdb43dbc6..92f5795258 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.9.0 + 3.10.0 org.apache.maven.plugins From b31b44c170b1bc948daaae1a9ae6c469370f986c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 19:49:06 +0100 Subject: [PATCH 0595/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.10 (#1860) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 4eeaa7c9a5..7f552bafcf 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -104,7 +104,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.9 + 0.9.10 test From ae05dfed0e670826f7674dc092b91bd5f634bf97 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 19:49:37 +0100 Subject: [PATCH 0596/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 (#1861) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 7f552bafcf..040ed2f62d 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -126,7 +126,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.9 + 0.9.10 true com.example.bigquery.NativeImageBigquerySample From 9359e0cd4c13bc9f391310613ebf90015973f39b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Feb 2022 16:51:36 +0100 Subject: [PATCH 0597/2268] build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.10 (#1862) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 92f5795258..d7acfdca9e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -83,7 +83,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.10 true diff --git a/samples/pom.xml b/samples/pom.xml index a02b0b6c46..1fd03cadb5 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -63,7 +63,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.10 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3e913a8346..aeb6f0648f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -117,7 +117,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.10 true From c37f800941f70d49e3316bd5f4299f3fce654f64 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 16 Feb 2022 17:32:57 +0100 Subject: [PATCH 0598/2268] build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.11 (#1864) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d7acfdca9e..370b42876e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -83,7 +83,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.10 + 1.6.11 true diff --git a/samples/pom.xml b/samples/pom.xml index 1fd03cadb5..5614ef8158 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -63,7 +63,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.10 + 1.6.11 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index aeb6f0648f..798d431117 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -117,7 +117,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.10 + 1.6.11 true From cf9c36ff641dfcb889ee2d2c7da79e4ef95482d3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 24 Feb 2022 01:03:45 +0100 Subject: [PATCH 0599/2268] build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.12 (#1867) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 370b42876e..bbb7694c28 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -83,7 +83,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.11 + 1.6.12 true diff --git a/samples/pom.xml b/samples/pom.xml index 5614ef8158..4e280e644d 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -63,7 +63,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.11 + 1.6.12 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 798d431117..cebeff8a16 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -117,7 +117,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.11 + 1.6.12 true From 7fa7480774f88bae2ffc2f03ab447381b9b3bf4a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Feb 2022 16:18:25 +0100 Subject: [PATCH 0600/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.2.2 (#1869) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2665ea4288..c90c999a46 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.2.1 + 3.2.2 From bd6dd2a7d8be6df240260d280fa35aa047bbb420 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 25 Feb 2022 22:06:43 +0000 Subject: [PATCH 0601/2268] ci: pull request template includes sample format (#1357) (#1871) Source-Link: https://github.com/googleapis/synthtool/commit/e122cb03ea37652946651346736d99b9dcc4311f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67 --- .github/.OwlBot.lock.yaml | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9786771c43..9351fdfb9a 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b + digest: sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0eddd3d4fc..51efda31d4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,3 +5,6 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). From 698306e480b5f3a180c62b6d9ae0d919e05154d3 Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Tue, 1 Mar 2022 04:52:30 +0530 Subject: [PATCH 0602/2268] docs(sample): Table exists sample fix (#1868) Added `null` check in the sample and modified the test case to test for "Table not found" --- .../src/main/java/com/example/bigquery/TableExists.java | 5 ++++- .../src/test/java/com/example/bigquery/TableExistsIT.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/TableExists.java b/samples/snippets/src/main/java/com/example/bigquery/TableExists.java index 0775c2548b..0447fe3de1 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/TableExists.java +++ b/samples/snippets/src/main/java/com/example/bigquery/TableExists.java @@ -40,7 +40,10 @@ public static void tableExists(String datasetName, String tableName) { BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); Table table = bigquery.getTable(TableId.of(datasetName, tableName)); - if (table.exists()) { + if (table != null + && table + .exists()) { // table will be null if it is not found and setThrowNotFound is not set + // to `true` System.out.println("Table already exist"); } else { System.out.println("Table not found"); diff --git a/samples/snippets/src/test/java/com/example/bigquery/TableExistsIT.java b/samples/snippets/src/test/java/com/example/bigquery/TableExistsIT.java index 4ff04e4efa..4573648a61 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/TableExistsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/TableExistsIT.java @@ -61,7 +61,6 @@ public void setUp() { System.setOut(out); // create a temporary table tableName = "MY_TABLE_NAME_TEST_" + UUID.randomUUID().toString().substring(0, 8); - CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, Schema.of()); } @After @@ -76,6 +75,9 @@ public void tearDown() { @Test public void testTableExists() { + TableExists.tableExists(BIGQUERY_DATASET_NAME, tableName); + assertThat(bout.toString()).contains("Table not found"); + CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, Schema.of()); TableExists.tableExists(BIGQUERY_DATASET_NAME, tableName); assertThat(bout.toString()).contains("Table already exist"); } From e67cf65bc044d07ba386f98cf67d2e16144255d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Mar 2022 01:23:10 +0100 Subject: [PATCH 0603/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220220-1.32.1 (#1872) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c90c999a46..c1712c9aa8 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220123-1.32.1 + v2-rev20220220-1.32.1 2.7.0 From a4deb16ed54edf51608f27b47b0846fb23c553fd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Mar 2022 03:48:20 +0100 Subject: [PATCH 0604/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.4.4 (#1873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.4.2` -> `2.4.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.4.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.4.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.4.4/compatibility-slim/2.4.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.4.4/confidence-slim/2.4.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

    googleapis/java-storage ### [`v2.4.4`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​244-httpsgithubcomgoogleapisjava-storagecomparev243v244-2022-02-28) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.4.3...v2.4.4) ### [`v2.4.3`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​243-httpsgithubcomgoogleapisjava-storagecomparev242v243-2022-02-25) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.4.2...v2.4.3)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c1712c9aa8..4f6bd87d17 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.4.2 + 2.4.4 test From c68c49a26abdcce8468b5e848cf39c458aba4774 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Mar 2022 18:52:17 +0100 Subject: [PATCH 0605/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.5 (#1874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:native-image-support](https://togithub.com/googleapis/java-core) | `0.12.4` -> `0.12.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.5/compatibility-slim/0.12.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.5/confidence-slim/0.12.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 040ed2f62d..b8fc2ecf32 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.4 + 0.12.5 org.junit.vintage From 04a97713ea791b1b48baa8f197e7e9030ac4736e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 22:36:18 +0000 Subject: [PATCH 0606/2268] chore: update github actions (#1361) (#1875) * chore: update github actions * chore: update Source-Link: https://github.com/googleapis/synthtool/commit/1622741e6877d4b335b137ac7e07f7f32d4e5af7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:e3746f84955528d0fe24bf2e4df89875d6ce5a036af01b9c326d61a38838523a --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/approve-readme.yaml | 2 +- .github/workflows/auto-release.yaml | 2 +- .github/workflows/ci.yaml | 20 ++++++++++---------- .github/workflows/samples.yaml | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9351fdfb9a..53941094cf 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67 + digest: sha256:e3746f84955528d0fe24bf2e4df89875d6ce5a036af01b9c326d61a38838523a diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index 1bb1823276..f5fc7d5169 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 18e23230d9..7a106d007e 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b5e56aaac..83ef7f9c2c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,8 +27,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -39,8 +39,8 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 @@ -54,8 +54,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -64,8 +64,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -76,8 +76,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index d5d964df15..de737e92a8 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,8 +20,8 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: java-version: 8 - name: Run checkstyle From a16985f79f5e09ee6567caf3eb502d7e88103f97 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Mar 2022 18:05:34 +0100 Subject: [PATCH 0607/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 (#1876) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4f6bd87d17..36b9ebc660 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220220-1.32.1 - 2.7.0 + 2.8.0 From 3749921d6d120ffd79941c9ede64822cea03f1cd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Mar 2022 18:05:52 +0100 Subject: [PATCH 0608/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.6 (#1878) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b8fc2ecf32..defbf2acaa 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.5 + 0.12.6 org.junit.vintage From cbc9208e105ed9b085a4d239b02f43fa82f03a71 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Mar 2022 18:08:36 +0100 Subject: [PATCH 0609/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v24.4.0 (#1880) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v24.4.0 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d3f20914ee..b5057ae0eb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.3.0 + 24.4.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.3.0') +implementation platform('com.google.cloud:libraries-bom:24.4.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index defbf2acaa..75cad8958d 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 24.3.0 + 24.4.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cebeff8a16..4c0b2d95f2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.3.0 + 24.4.0 pom import From 62ddb6133115626172458327cd5c104cc6fc7310 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 2 Mar 2022 12:10:24 -0500 Subject: [PATCH 0610/2268] Revert "chore: update github actions (#1361)" (#1881) Due to the fact that it is causing checkstyle failure: https://github.com/googleapis/java-bigquery/pull/1875#issuecomment-1057147095 --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/approve-readme.yaml | 2 +- .github/workflows/auto-release.yaml | 2 +- .github/workflows/ci.yaml | 20 ++++++++++---------- .github/workflows/samples.yaml | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 53941094cf..9351fdfb9a 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:e3746f84955528d0fe24bf2e4df89875d6ce5a036af01b9c326d61a38838523a + digest: sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67 diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index f5fc7d5169..1bb1823276 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v5 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 7a106d007e..18e23230d9 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v5 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83ef7f9c2c..6b5e56aaac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,8 +27,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 with: distribution: zulu java-version: ${{matrix.java}} @@ -39,8 +39,8 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 with: distribution: zulu java-version: 8 @@ -54,8 +54,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 with: distribution: zulu java-version: ${{matrix.java}} @@ -64,8 +64,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 with: distribution: zulu java-version: 11 @@ -76,8 +76,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index de737e92a8..d5d964df15 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,8 +20,8 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 with: java-version: 8 - name: Run checkstyle From 1bc9188e4f6679b3079d0da153ff4d8af62037a5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 20:54:23 +0000 Subject: [PATCH 0611/2268] chore: fix license header in build.bat (#1363) (#1883) * chore: fix license header in build.bat * chore: add disctribution field for setup-java action Source-Link: https://github.com/googleapis/synthtool/commit/4fea5f40a9075f3ba205ede0b453010cf080e194 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:df8d7b2cc0dbc65871e7edd86601901a0612b272fa3f7f0eb590c5c53aa5f92e --- .github/.OwlBot.lock.yaml | 2 +- .github/workflows/approve-readme.yaml | 2 +- .github/workflows/auto-release.yaml | 2 +- .github/workflows/ci.yaml | 20 +++++++++--------- .github/workflows/samples.yaml | 5 +++-- .kokoro/build.bat | 30 +++++++++++++-------------- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9351fdfb9a..3473042c08 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:387835a1375a0049ec44e02542c844302854c732d8291bdf8e472c0ff70a8f67 + digest: sha256:df8d7b2cc0dbc65871e7edd86601901a0612b272fa3f7f0eb590c5c53aa5f92e diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index 1bb1823276..f5fc7d5169 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 18e23230d9..7a106d007e 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b5e56aaac..83ef7f9c2c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,8 +27,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -39,8 +39,8 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 @@ -54,8 +54,8 @@ jobs: matrix: java: [8, 11, 17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: ${{matrix.java}} @@ -64,8 +64,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 11 @@ -76,8 +76,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: distribution: zulu java-version: 8 diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index d5d964df15..912ed8b2b0 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,9 +20,10 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 with: + distribution: zulu java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check diff --git a/.kokoro/build.bat b/.kokoro/build.bat index cc602c9eba..067cf4a4c4 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,18 +1,18 @@ +:: Copyright 2022 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. :: See documentation in type-shell-output.bat -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh From fd0753338e15965347683345b0e51838baf5d9f6 Mon Sep 17 00:00:00 2001 From: Franklin Whaite <70151215+franklinWhaite@users.noreply.github.com> Date: Thu, 3 Mar 2022 12:16:27 -0500 Subject: [PATCH 0612/2268] Fix: adjusting retry logic to avoid retrying successful job creation (#1879) https://github.com/googleapis/java-bigquery/pull/1744 introduced retrying 200 responses, but the regex that we are using is too broad: [".*exceed.*rate.limit."] and in some cases it may catch a valid response. The issue is that the current logic is scanning the whole response. In this PR the retry logic is modified to specifically check the error message from the response. For this purpose parsing logic was developed to extract error messages from responses. This logic is specifically designed for the [jobs.insert method response](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/insert#response-body) (only case observed so far where a response with status code 200 might also return an error message). --- .../bigquery/BigQueryRetryAlgorithm.java | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index af472430fc..0429b7f005 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -25,6 +25,8 @@ import com.google.api.gax.retrying.TimedAttemptSettings; import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import java.util.Iterator; import java.util.UUID; import java.util.concurrent.CancellationException; @@ -107,9 +109,10 @@ private boolean shouldRetryBasedOnBigQueryRetryConfig( /* In some cases error messages may come without an exception e.g. status code 200 with a rate limit exceeded for job create - in these cases there is now previousThrowable so we need to check previousResponse + in these cases there is no previousThrowable so we need + to check for error messages in previousResponse */ - errorDesc = previousResponse.toString(); + errorDesc = getErrorDescFromResponse(previousResponse); } if (errorDesc != null) { @@ -212,4 +215,28 @@ private TimedAttemptSettings createNextAttemptBasedOnTiming( } return getTimedAlgorithm().createNextAttempt(previousSettings); } + + private String getErrorDescFromResponse(ResponseT previousResponse) { + /* + error messages may come without an exception and must be extracted from response + following logic based on response body of jobs.insert method, so far the only + known case where a response with status code 200 may contain an error message + */ + try { + JsonObject responseJson = + JsonParser.parseString(previousResponse.toString()).getAsJsonObject(); + if (responseJson.has("status") && responseJson.getAsJsonObject("status").has("errorResult")) { + return responseJson + .getAsJsonObject("status") + .getAsJsonObject("errorResult") + .get("message") + .toString(); + } else { + return null; + } + } catch (Exception e) { + // exceptions here implies no error message present in response, returning null + return null; + } + } } From 7176c30e2c5c63b1b2875994e0fce9a8a3a68122 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 17:50:27 +0000 Subject: [PATCH 0613/2268] chore(main): release 2.9.1 (#1857) :robot: I have created a release *beep* *boop* --- ### [2.9.1](https://github.com/googleapis/java-bigquery/compare/v2.9.0...v2.9.1) (2022-03-03) ### Bug Fixes * adjusting retry logic to avoid retrying successful job creation ([#1879](https://github.com/googleapis/java-bigquery/issues/1879)) ([fd07533](https://github.com/googleapis/java-bigquery/commit/fd0753338e15965347683345b0e51838baf5d9f6)) * **java:** add additional configurations to fix native image tests ([#1859](https://github.com/googleapis/java-bigquery/issues/1859)) ([3e82960](https://github.com/googleapis/java-bigquery/commit/3e82960f75ced489f9f0e72fe45165ab866f1d8b)) ### Documentation * **sample:** Table exists sample fix ([#1868](https://github.com/googleapis/java-bigquery/issues/1868)) ([698306e](https://github.com/googleapis/java-bigquery/commit/698306e480b5f3a180c62b6d9ae0d919e05154d3)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220220-1.32.1 ([#1872](https://github.com/googleapis/java-bigquery/issues/1872)) ([e67cf65](https://github.com/googleapis/java-bigquery/commit/e67cf65bc044d07ba386f98cf67d2e16144255d0)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#1876](https://github.com/googleapis/java-bigquery/issues/1876)) ([a16985f](https://github.com/googleapis/java-bigquery/commit/a16985f79f5e09ee6567caf3eb502d7e88103f97)) * update dependency com.google.cloud:google-cloud-storage to v2.4.2 ([#1853](https://github.com/googleapis/java-bigquery/issues/1853)) ([ef91109](https://github.com/googleapis/java-bigquery/commit/ef91109821a702a6b55b4f1265e812578ca881d8)) * update dependency com.google.cloud:google-cloud-storage to v2.4.4 ([#1873](https://github.com/googleapis/java-bigquery/issues/1873)) ([a4deb16](https://github.com/googleapis/java-bigquery/commit/a4deb16ed54edf51608f27b47b0846fb23c553fd)) * update dependency com.google.cloud:native-image-support to v0.12.4 ([#1855](https://github.com/googleapis/java-bigquery/issues/1855)) ([376738d](https://github.com/googleapis/java-bigquery/commit/376738d5fb7253de6e2e9d574aa99e9d7a9e67ad)) * update dependency com.google.cloud:native-image-support to v0.12.5 ([#1874](https://github.com/googleapis/java-bigquery/issues/1874)) ([c68c49a](https://github.com/googleapis/java-bigquery/commit/c68c49a26abdcce8468b5e848cf39c458aba4774)) * update dependency com.google.cloud:native-image-support to v0.12.6 ([#1878](https://github.com/googleapis/java-bigquery/issues/1878)) ([3749921](https://github.com/googleapis/java-bigquery/commit/3749921d6d120ffd79941c9ede64822cea03f1cd)) * update dependency com.google.code.gson:gson to v2.9.0 ([#1850](https://github.com/googleapis/java-bigquery/issues/1850)) ([627da62](https://github.com/googleapis/java-bigquery/commit/627da62bd02314c673c345bd8eb87e973a805bc7)) * update dependency org.graalvm.buildtools:junit-platform-native to v0.9.10 ([#1860](https://github.com/googleapis/java-bigquery/issues/1860)) ([b31b44c](https://github.com/googleapis/java-bigquery/commit/b31b44c170b1bc948daaae1a9ae6c469370f986c)) * update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#1861](https://github.com/googleapis/java-bigquery/issues/1861)) ([ae05dfe](https://github.com/googleapis/java-bigquery/commit/ae05dfed0e670826f7674dc092b91bd5f634bf97)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9adc2177..8af93a8aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +### [2.9.1](https://github.com/googleapis/java-bigquery/compare/v2.9.0...v2.9.1) (2022-03-03) + + +### Bug Fixes + +* adjusting retry logic to avoid retrying successful job creation ([#1879](https://github.com/googleapis/java-bigquery/issues/1879)) ([fd07533](https://github.com/googleapis/java-bigquery/commit/fd0753338e15965347683345b0e51838baf5d9f6)) +* **java:** add additional configurations to fix native image tests ([#1859](https://github.com/googleapis/java-bigquery/issues/1859)) ([3e82960](https://github.com/googleapis/java-bigquery/commit/3e82960f75ced489f9f0e72fe45165ab866f1d8b)) + + +### Documentation + +* **sample:** Table exists sample fix ([#1868](https://github.com/googleapis/java-bigquery/issues/1868)) ([698306e](https://github.com/googleapis/java-bigquery/commit/698306e480b5f3a180c62b6d9ae0d919e05154d3)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220220-1.32.1 ([#1872](https://github.com/googleapis/java-bigquery/issues/1872)) ([e67cf65](https://github.com/googleapis/java-bigquery/commit/e67cf65bc044d07ba386f98cf67d2e16144255d0)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#1876](https://github.com/googleapis/java-bigquery/issues/1876)) ([a16985f](https://github.com/googleapis/java-bigquery/commit/a16985f79f5e09ee6567caf3eb502d7e88103f97)) +* update dependency com.google.cloud:google-cloud-storage to v2.4.2 ([#1853](https://github.com/googleapis/java-bigquery/issues/1853)) ([ef91109](https://github.com/googleapis/java-bigquery/commit/ef91109821a702a6b55b4f1265e812578ca881d8)) +* update dependency com.google.cloud:google-cloud-storage to v2.4.4 ([#1873](https://github.com/googleapis/java-bigquery/issues/1873)) ([a4deb16](https://github.com/googleapis/java-bigquery/commit/a4deb16ed54edf51608f27b47b0846fb23c553fd)) +* update dependency com.google.cloud:native-image-support to v0.12.4 ([#1855](https://github.com/googleapis/java-bigquery/issues/1855)) ([376738d](https://github.com/googleapis/java-bigquery/commit/376738d5fb7253de6e2e9d574aa99e9d7a9e67ad)) +* update dependency com.google.cloud:native-image-support to v0.12.5 ([#1874](https://github.com/googleapis/java-bigquery/issues/1874)) ([c68c49a](https://github.com/googleapis/java-bigquery/commit/c68c49a26abdcce8468b5e848cf39c458aba4774)) +* update dependency com.google.cloud:native-image-support to v0.12.6 ([#1878](https://github.com/googleapis/java-bigquery/issues/1878)) ([3749921](https://github.com/googleapis/java-bigquery/commit/3749921d6d120ffd79941c9ede64822cea03f1cd)) +* update dependency com.google.code.gson:gson to v2.9.0 ([#1850](https://github.com/googleapis/java-bigquery/issues/1850)) ([627da62](https://github.com/googleapis/java-bigquery/commit/627da62bd02314c673c345bd8eb87e973a805bc7)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.10 ([#1860](https://github.com/googleapis/java-bigquery/issues/1860)) ([b31b44c](https://github.com/googleapis/java-bigquery/commit/b31b44c170b1bc948daaae1a9ae6c469370f986c)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#1861](https://github.com/googleapis/java-bigquery/issues/1861)) ([ae05dfe](https://github.com/googleapis/java-bigquery/commit/ae05dfed0e670826f7674dc092b91bd5f634bf97)) + ## [2.9.0](https://github.com/googleapis/java-bigquery/compare/v2.8.0...v2.9.0) (2022-02-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bbb7694c28..336b7f398f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.1-SNAPSHOT + 2.9.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8c714685b7..402ae4e297 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.1-SNAPSHOT + 2.9.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.1-SNAPSHOT + 2.9.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 36b9ebc660..bf73724afe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.1-SNAPSHOT + 2.9.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.1-SNAPSHOT + 2.9.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 35ab225ef4..c2e0ebb5d0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.1-SNAPSHOT + 2.9.1 diff --git a/versions.txt b/versions.txt index 509577ad80..bb05ed50ce 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.0:2.9.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.9.1:2.9.1 \ No newline at end of file From c392f872ed207285e70dea4fc11dfaa2e172300f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 18:06:27 +0000 Subject: [PATCH 0614/2268] chore(main): release 2.9.2-SNAPSHOT (#1884) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 336b7f398f..2a38f5cb0b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.1 + 2.9.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 402ae4e297..07618fc723 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.1 + 2.9.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.1 + 2.9.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bf73724afe..a7856b1409 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.1 + 2.9.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.1 + 2.9.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c2e0ebb5d0..37c945a6ca 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.1 + 2.9.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index bb05ed50ce..3286c7bc21 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.1:2.9.1 \ No newline at end of file +google-cloud-bigquery:2.9.1:2.9.2-SNAPSHOT \ No newline at end of file From 4bce309ce089fc39843ce01200853fff4da685be Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Mar 2022 00:20:25 +0100 Subject: [PATCH 0615/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.11 (#1885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.1.11 * 🦉 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 --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b5057ae0eb..b3040ed600 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.9.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.9.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 115af2736a..ee37c55107 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.10 + 2.1.11 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 37c945a6ca..813da32bc3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.10 + 2.1.11 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4c0b2d95f2..a3dab00856 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.10 + 2.1.11 test From d428185429b0fb914efade903cbfffe5b115ab4e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Mar 2022 00:21:37 +0100 Subject: [PATCH 0616/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.0 (#1886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a7856b1409..fa13118c44 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.6.3 + 1.7.0 pom import From 24fc5cffee52a2756789846904ffbf3ae36d987e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 4 Mar 2022 17:22:50 +0100 Subject: [PATCH 0617/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.1 (#1887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.1 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3040ed600..8b986aae0a 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.9.0 + 2.9.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ee37c55107..425b80949c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.9.0 + 2.9.1 From c8eb8671e53759e786955dd44fae4867632237e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 17:12:25 +0100 Subject: [PATCH 0618/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220222-1.32.1 (#1888) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa13118c44..f7615e091b 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220220-1.32.1 + v2-rev20220222-1.32.1 2.8.0 From ca28e2d68901b6c9332f97c7985aaca7f4486e29 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 7 Mar 2022 12:33:03 -0500 Subject: [PATCH 0619/2268] fix: add missing equality check for targetTypes in DatasetAclEntity (#1866) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add missing equality check for targetTypes in DatasetAclEntity * 🦉 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 --- .../src/main/java/com/google/cloud/bigquery/Acl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index 115e001bd3..3fad689206 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -193,7 +193,8 @@ public boolean equals(Object obj) { } DatasetAclEntity datasetAclEntity = (DatasetAclEntity) obj; return Objects.equals(getType(), datasetAclEntity.getType()) - && Objects.equals(id, datasetAclEntity.id); + && Objects.equals(id, datasetAclEntity.id) + && Objects.equals(targetTypes, datasetAclEntity.targetTypes); } @Override From c8c5643d0552f9f28a684514cd192f985e0d711c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 18:33:18 +0100 Subject: [PATCH 0620/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220226-1.32.1 (#1890) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f7615e091b..4ee37ea5b6 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220222-1.32.1 + v2-rev20220226-1.32.1 2.8.0 From d5171e8ffe438811294a89b1c76b6285c810ec11 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:50:11 +0000 Subject: [PATCH 0621/2268] chore(main): release 2.9.2 (#1889) :robot: I have created a release *beep* *boop* --- ### [2.9.2](https://github.com/googleapis/java-bigquery/compare/v2.9.1...v2.9.2) (2022-03-07) ### Bug Fixes * add missing equality check for targetTypes in DatasetAclEntity ([#1866](https://github.com/googleapis/java-bigquery/issues/1866)) ([ca28e2d](https://github.com/googleapis/java-bigquery/commit/ca28e2d68901b6c9332f97c7985aaca7f4486e29)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220222-1.32.1 ([#1888](https://github.com/googleapis/java-bigquery/issues/1888)) ([c8eb867](https://github.com/googleapis/java-bigquery/commit/c8eb8671e53759e786955dd44fae4867632237e4)) * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220226-1.32.1 ([#1890](https://github.com/googleapis/java-bigquery/issues/1890)) ([c8c5643](https://github.com/googleapis/java-bigquery/commit/c8c5643d0552f9f28a684514cd192f985e0d711c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af93a8aac..9305864fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +### [2.9.2](https://github.com/googleapis/java-bigquery/compare/v2.9.1...v2.9.2) (2022-03-07) + + +### Bug Fixes + +* add missing equality check for targetTypes in DatasetAclEntity ([#1866](https://github.com/googleapis/java-bigquery/issues/1866)) ([ca28e2d](https://github.com/googleapis/java-bigquery/commit/ca28e2d68901b6c9332f97c7985aaca7f4486e29)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220222-1.32.1 ([#1888](https://github.com/googleapis/java-bigquery/issues/1888)) ([c8eb867](https://github.com/googleapis/java-bigquery/commit/c8eb8671e53759e786955dd44fae4867632237e4)) +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220226-1.32.1 ([#1890](https://github.com/googleapis/java-bigquery/issues/1890)) ([c8c5643](https://github.com/googleapis/java-bigquery/commit/c8c5643d0552f9f28a684514cd192f985e0d711c)) + ### [2.9.1](https://github.com/googleapis/java-bigquery/compare/v2.9.0...v2.9.1) (2022-03-03) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2a38f5cb0b..148b65a092 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.2-SNAPSHOT + 2.9.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 07618fc723..be614cc4b4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.2-SNAPSHOT + 2.9.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.2-SNAPSHOT + 2.9.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4ee37ea5b6..f3d4000129 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.2-SNAPSHOT + 2.9.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.2-SNAPSHOT + 2.9.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 813da32bc3..13cb3f5e95 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.2-SNAPSHOT + 2.9.2 diff --git a/versions.txt b/versions.txt index 3286c7bc21..0dddc4f88c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.1:2.9.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.9.2:2.9.2 \ No newline at end of file From 46e9e5c48fa486e9fab1bfb985945eb3c20b2b0e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 18:08:15 +0000 Subject: [PATCH 0622/2268] chore(main): release 2.9.3-SNAPSHOT (#1891) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 148b65a092..ba4884e471 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.2 + 2.9.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index be614cc4b4..90b3b84a47 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.2 + 2.9.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.2 + 2.9.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f3d4000129..59e3ef3462 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.2 + 2.9.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.2 + 2.9.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 13cb3f5e95..a47cd5cbc5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.2 + 2.9.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0dddc4f88c..ab5088609a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.2:2.9.2 \ No newline at end of file +google-cloud-bigquery:2.9.2:2.9.3-SNAPSHOT \ No newline at end of file From 1b82e1928d9fc5cb13494e7e0e86f7ccd99b125c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 18:21:34 -0500 Subject: [PATCH 0623/2268] chore: update java template (#1367) (#1893) * chore: update java template * chore: fix tests * chore: fix tests * chore: update project Source-Link: https://github.com/googleapis/synthtool/commit/1155a97fed1c195d10ad406d483bc8ac2507f1d7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/nightly/integration.cfg | 4 ++-- README.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3473042c08..426cf83e2e 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:df8d7b2cc0dbc65871e7edd86601901a0612b272fa3f7f0eb590c5c53aa5f92e + digest: sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index e51c7b4c6c..a2907a257b 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -13,12 +13,12 @@ env_vars: { # TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" - value: "gcloud-devel" + value: "java-docs-samples-testing" } env_vars: { key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" + value: "java-docs-samples-testing" } env_vars: { diff --git a/README.md b/README.md index 8b986aae0a..a754bfc97d 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.9.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.9.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.2" ``` ## Authentication From ce06adb5f95704309eaf0ab4b49d2bdb4ceaeb98 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 04:38:14 +0100 Subject: [PATCH 0624/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.6.0 (#1892) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.5.3` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.0/compatibility-slim/2.5.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.0/confidence-slim/2.5.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.6.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​260-httpsgithubcomgoogleapisjava-bigtablecomparev253v260-2022-03-03) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.5.3...v2.6.0) ##### Features - add WarmAndPing request for channel priming ([#​1178](https://togithub.com/googleapis/java-bigtable/issues/1178)) ([385ab33](https://togithub.com/googleapis/java-bigtable/commit/385ab33d12479a9d2b1b66babef9b9b5846b902a)) ##### Documentation - **sample:** Add sample for native image support in Bigtable ([#​1165](https://togithub.com/googleapis/java-bigtable/issues/1165)) ([143aaee](https://togithub.com/googleapis/java-bigtable/commit/143aaee42e1b59d125250982dbeb34a31d906e30)) ##### Dependencies - update actions/github-script action to v6 ([#​1170](https://togithub.com/googleapis/java-bigtable/issues/1170)) ([5790bdf](https://togithub.com/googleapis/java-bigtable/commit/5790bdf875d27e6194f1753ff66d208f65488716)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#​1186](https://togithub.com/googleapis/java-bigtable/issues/1186)) ([74cafca](https://togithub.com/googleapis/java-bigtable/commit/74cafcae4a562b87f1664b8844794a2e68c97625)) - update dependency com.google.cloud:native-image-support to v0.12.4 ([#​1175](https://togithub.com/googleapis/java-bigtable/issues/1175)) ([9cc6fbc](https://togithub.com/googleapis/java-bigtable/commit/9cc6fbc7de22303e17492824971fcc52fb041254)) - update dependency com.google.cloud:native-image-support to v0.12.5 ([#​1183](https://togithub.com/googleapis/java-bigtable/issues/1183)) ([b025b34](https://togithub.com/googleapis/java-bigtable/commit/b025b343af0b9309558f530dc0765bf2b4c4d588)) - update dependency com.google.cloud:native-image-support to v0.12.6 ([#​1187](https://togithub.com/googleapis/java-bigtable/issues/1187)) ([b110d65](https://togithub.com/googleapis/java-bigtable/commit/b110d650edd38a1866f6c2168c78ec8e31b528c2)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#​1174](https://togithub.com/googleapis/java-bigtable/issues/1174)) ([7ff5fa7](https://togithub.com/googleapis/java-bigtable/commit/7ff5fa712b6dcbbd3c721c8babb8ed4e1c7dad17)) ##### [2.5.3](https://togithub.com/googleapis/java-bigtable/compare/v2.5.2...v2.5.3) (2022-02-08) ##### Bug Fixes - integration tests ([#​1161](https://togithub.com/googleapis/java-bigtable/issues/1161)) ([8b00b5f](https://togithub.com/googleapis/java-bigtable/commit/8b00b5fb5b4e3a1ada514b0bdc60fd744833bd01)) ##### [2.5.2](https://togithub.com/googleapis/java-bigtable/compare/v2.5.1...v2.5.2) (2022-01-31) ##### Bug Fixes - UpdateAppProfileRequest equals and hashcode should build proto ([#​1142](https://togithub.com/googleapis/java-bigtable/issues/1142)) ([c9f1ed8](https://togithub.com/googleapis/java-bigtable/commit/c9f1ed8a5fdf44487a8c56388b35067ecfc4daea)) ##### Dependencies - **java:** update actions/github-script action to v5 ([#​1339](https://togithub.com/googleapis/java-bigtable/issues/1339)) ([#​1147](https://togithub.com/googleapis/java-bigtable/issues/1147)) ([9bfcccf](https://togithub.com/googleapis/java-bigtable/commit/9bfcccfd76d2a03412cf9fe8c115874f15a95c57)) - update actions/github-script action to v5 ([#​1146](https://togithub.com/googleapis/java-bigtable/issues/1146)) ([9b2c918](https://togithub.com/googleapis/java-bigtable/commit/9b2c918c3fad38d3b26d141b53f6dc037a23bed7)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#​1150](https://togithub.com/googleapis/java-bigtable/issues/1150)) ([744e483](https://togithub.com/googleapis/java-bigtable/commit/744e4830238b6ebe7bab6115ff26600b0c150b62)) ##### [2.5.1](https://www.github.com/googleapis/java-bigtable/compare/v2.5.0...v2.5.1) (2022-01-07) ##### Bug Fixes - Revert "fix: remove stats from javadoc" ([#​1118](https://www.togithub.com/googleapis/java-bigtable/issues/1118)) ([ba8f344](https://www.github.com/googleapis/java-bigtable/commit/ba8f344d19163627553a0a268742af2a1a792db5)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#​1124](https://www.togithub.com/googleapis/java-bigtable/issues/1124)) ([55ebf69](https://www.github.com/googleapis/java-bigtable/commit/55ebf6932bbe93e8b7635a7550320099eb4fbe93))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 425b80949c..2ab0f24c94 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a47cd5cbc5..0d7368c93d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a3dab00856..9f023ba9f6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.6.0 test From eb84441ce2461d24628bc4da51f2b4d5b727d007 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 04:00:26 +0000 Subject: [PATCH 0625/2268] chore(main): release 2.9.3 (#1894) :robot: I have created a release *beep* *boop* --- ### [2.9.3](https://github.com/googleapis/java-bigquery/compare/v2.9.2...v2.9.3) (2022-03-08) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.6.0 ([#1892](https://github.com/googleapis/java-bigquery/issues/1892)) ([ce06adb](https://github.com/googleapis/java-bigquery/commit/ce06adb5f95704309eaf0ab4b49d2bdb4ceaeb98)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9305864fc2..1a72d00245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.9.3](https://github.com/googleapis/java-bigquery/compare/v2.9.2...v2.9.3) (2022-03-08) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.6.0 ([#1892](https://github.com/googleapis/java-bigquery/issues/1892)) ([ce06adb](https://github.com/googleapis/java-bigquery/commit/ce06adb5f95704309eaf0ab4b49d2bdb4ceaeb98)) + ### [2.9.2](https://github.com/googleapis/java-bigquery/compare/v2.9.1...v2.9.2) (2022-03-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ba4884e471..52d246fc11 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.3-SNAPSHOT + 2.9.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 90b3b84a47..b441834e2a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.3-SNAPSHOT + 2.9.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.3-SNAPSHOT + 2.9.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 59e3ef3462..1dd42dd89d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.3-SNAPSHOT + 2.9.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.3-SNAPSHOT + 2.9.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0d7368c93d..e6cbc14673 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.3-SNAPSHOT + 2.9.3 diff --git a/versions.txt b/versions.txt index ab5088609a..307b285da8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.2:2.9.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.9.3:2.9.3 \ No newline at end of file From d068c710b20faba786f8ceaf30012c32a331484a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 04:22:20 +0000 Subject: [PATCH 0626/2268] chore(main): release 2.9.4-SNAPSHOT (#1895) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 52d246fc11..44cb4bd7f1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.3 + 2.9.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b441834e2a..792b0b895e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.3 + 2.9.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.3 + 2.9.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1dd42dd89d..fc3646c55f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.3 + 2.9.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.3 + 2.9.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e6cbc14673..4d8f25d317 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.3 + 2.9.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 307b285da8..f6d23ddd57 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.3:2.9.3 \ No newline at end of file +google-cloud-bigquery:2.9.3:2.9.4-SNAPSHOT \ No newline at end of file From 4145b37ed0f4570fdbd6841dd40ca24995abed6b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 16:14:57 +0100 Subject: [PATCH 0627/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.3 (#1901) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.3 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a754bfc97d..f80dced69f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.9.1 + 2.9.3 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.9.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.9.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2ab0f24c94..bbc0ece46d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.9.1 + 2.9.3 From 5dcb02b04f9a87ba39e7cfa72229318926262029 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 16:17:39 +0100 Subject: [PATCH 0628/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.7 (#1896) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:native-image-support to v0.12.7 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 75cad8958d..41919ac420 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.6 + 0.12.7 org.junit.vintage From 64b83a85761e0c2a0e2da53946e63cc540223e34 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 16:30:15 +0100 Subject: [PATCH 0629/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.3.0 (#1897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.2.7` -> `1.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.0/compatibility-slim/1.2.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.0/confidence-slim/1.2.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-config ### [`v1.3.0`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​130-httpsgithubcomgoogleapisjava-shared-configcomparev127v130-2022-03-07) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.2.7...v1.3.0) ##### Features - increase IT timeout from 20 to 60 mins ([#​440](https://togithub.com/googleapis/java-shared-config/issues/440)) ([a4427bc](https://togithub.com/googleapis/java-shared-config/commit/a4427bceebd0624e23f0b02bb24d7ed46ea4b3a6)) ##### Dependencies - update dependency com.google.cloud:native-image-support to v0.12.6 ([#​423](https://togithub.com/googleapis/java-shared-config/issues/423)) ([9a0cb79](https://togithub.com/googleapis/java-shared-config/commit/9a0cb79896d5c97dc3c5648a6740d53eb9ada673)) - update dependency com.puppycrawl.tools:checkstyle to v9.3 ([#​415](https://togithub.com/googleapis/java-shared-config/issues/415)) ([9e2d3fd](https://togithub.com/googleapis/java-shared-config/commit/9e2d3fd8bd42bc210dae5798f7d5dfe950c29f51)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.10 ([#​429](https://togithub.com/googleapis/java-shared-config/issues/429)) ([0355f29](https://togithub.com/googleapis/java-shared-config/commit/0355f2988ebcff19615b72bc65523555e4844523)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#​430](https://togithub.com/googleapis/java-shared-config/issues/430)) ([16984d2](https://togithub.com/googleapis/java-shared-config/commit/16984d25a84aa6a8daf2a0925ea57cd0d3f0ee24)) ##### [1.2.7](https://togithub.com/googleapis/java-shared-config/compare/v1.2.6...v1.2.7) (2022-02-04) ##### Dependencies - update dependency com.google.cloud:native-image-support to v0.12.0 ([#​414](https://togithub.com/googleapis/java-shared-config/issues/414)) ([2133cc0](https://togithub.com/googleapis/java-shared-config/commit/2133cc093efd8420e352274f3eab09de819ff796)) ##### [1.2.6](https://togithub.com/googleapis/java-shared-config/compare/v1.2.5...v1.2.6) (2022-01-19) ##### Bug Fixes - library should released as 1.2.6 ([#​408](https://togithub.com/googleapis/java-shared-config/issues/408)) ([4972daa](https://togithub.com/googleapis/java-shared-config/commit/4972daa60467797566c4b043cebd322577b8eb73)) ##### [1.2.5](https://togithub.com/googleapis/java-shared-config/compare/v1.2.4...v1.2.5) (2022-01-11) ##### Bug Fixes - **java:** Enable unit tests in generated libraries for native image testing ([#​394](https://togithub.com/googleapis/java-shared-config/issues/394)) ([a453b9f](https://togithub.com/googleapis/java-shared-config/commit/a453b9f141c7555f2fd5333eb17d223410ab66eb)) ##### [1.2.4](https://www.github.com/googleapis/java-shared-config/compare/v1.2.3...v1.2.4) (2022-01-06) ##### Dependencies - revert dependency com.google.googlejavaformat:google-java-format to v1.7 ([#​391](https://www.togithub.com/googleapis/java-shared-config/issues/391)) ([17077fb](https://www.github.com/googleapis/java-shared-config/commit/17077fb1a58eef7098dc5e1e9b2c78a63c5c11e1)) ##### [1.2.3](https://www.github.com/googleapis/java-shared-config/compare/v1.2.2...v1.2.3) (2022-01-04) ##### Bug Fixes - **java:** add -ntp flag to native image testing command ([#​1299](https://www.togithub.com/googleapis/java-shared-config/issues/1299)) ([#​376](https://www.togithub.com/googleapis/java-shared-config/issues/376)) ([50e7a10](https://www.github.com/googleapis/java-shared-config/commit/50e7a10a8dca0505fd831e3dd929577d2f82b011)) - **java:** Only enable integration tests for native image testing ([#​375](https://www.togithub.com/googleapis/java-shared-config/issues/375)) ([663f421](https://www.github.com/googleapis/java-shared-config/commit/663f421de342afcba24703079f778738045d3ff2)) - **java:** Pass missing integration test flags to native image test commands ([#​1309](https://www.togithub.com/googleapis/java-shared-config/issues/1309)) ([#​383](https://www.togithub.com/googleapis/java-shared-config/issues/383)) ([b17b44e](https://www.github.com/googleapis/java-shared-config/commit/b17b44e37fe44ba61616417189c6b2271f3a4d18)) ##### Dependencies - update auto-value-annotation.version to v1.9 ([#​378](https://www.togithub.com/googleapis/java-shared-config/issues/378)) ([5e1cd0e](https://www.github.com/googleapis/java-shared-config/commit/5e1cd0e39910548ec4eb6639da979c3b66411503)) - update dependency com.google.googlejavaformat:google-java-format to v1.13.0 ([#​361](https://www.togithub.com/googleapis/java-shared-config/issues/361)) ([095d60a](https://www.github.com/googleapis/java-shared-config/commit/095d60a061a574dcf84b9fcf26dff48617a306b1)) - update dependency com.puppycrawl.tools:checkstyle to v9.2 ([#​366](https://www.togithub.com/googleapis/java-shared-config/issues/366)) ([061df67](https://www.github.com/googleapis/java-shared-config/commit/061df676d8b2fef5bbb0ce9661d3c96fcb57e73a)) - update dependency com.puppycrawl.tools:checkstyle to v9.2.1 ([#​382](https://www.togithub.com/googleapis/java-shared-config/issues/382)) ([1a182c5](https://www.github.com/googleapis/java-shared-config/commit/1a182c52e7c5431875296940d68c9bdfcf74be00)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.9 ([#​379](https://www.togithub.com/googleapis/java-shared-config/issues/379)) ([0a2b05f](https://www.github.com/googleapis/java-shared-config/commit/0a2b05ff7f649331efbc4dd540705da10691a2f1)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.8 ([#​372](https://www.togithub.com/googleapis/java-shared-config/issues/372)) ([6fe795e](https://www.github.com/googleapis/java-shared-config/commit/6fe795ede39575656ef1609bf7aac28c1d170976)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.9 ([#​380](https://www.togithub.com/googleapis/java-shared-config/issues/380)) ([f2efad5](https://www.github.com/googleapis/java-shared-config/commit/f2efad585b431fe186c7900a8171a999c689405b)) - update dependency org.junit.vintage:junit-vintage-engine to v5.8.2 ([#​365](https://www.togithub.com/googleapis/java-shared-config/issues/365)) ([604058d](https://www.github.com/googleapis/java-shared-config/commit/604058d52dc962db9a506762926576542687285e)) ##### [1.2.2](https://www.github.com/googleapis/java-shared-config/compare/v1.2.1...v1.2.2) (2021-11-16) ##### Bug Fixes - update dependency com.google.cloud:native-image-support to v0.10.0 ([#​358](https://www.togithub.com/googleapis/java-shared-config/issues/358)) ([0441958](https://www.github.com/googleapis/java-shared-config/commit/044195865a1122d419cadae90fddbf8dc5b4a32d)) ##### [1.2.1](https://www.github.com/googleapis/java-shared-config/compare/v1.2.0...v1.2.1) (2021-11-08) ##### Bug Fixes - Add native image feature to register protobuf reflection in tests ([#​347](https://www.togithub.com/googleapis/java-shared-config/issues/347)) ([88c3e3b](https://www.github.com/googleapis/java-shared-config/commit/88c3e3b0ad1e480e0fdbe9f6fe1f9df183066ee6)) ##### Dependencies - update dependency com.google.auto.service:auto-service-annotations to v1.0.1 ([#​346](https://www.togithub.com/googleapis/java-shared-config/issues/346)) ([9c1f943](https://www.github.com/googleapis/java-shared-config/commit/9c1f94345fb47346fe66f901976c2347b8102bc8)) - update dependency com.google.cloud:native-image-support to v0.9.0 ([#​350](https://www.togithub.com/googleapis/java-shared-config/issues/350)) ([3b496b0](https://www.github.com/googleapis/java-shared-config/commit/3b496b03bd95e59fcd1a3a1eb6cc0dfd330db769)) - update dependency com.puppycrawl.tools:checkstyle to v9.1 ([#​345](https://www.togithub.com/googleapis/java-shared-config/issues/345)) ([f5c03d3](https://www.github.com/googleapis/java-shared-config/commit/f5c03d35684ef4e0bb3178ab6056f231f3f4faf6))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc3646c55f..fa388cff10 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.2.7 + 1.3.0 From 4e41eb93fe6fe985dde12f3d12ac0aa1fd65301a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:32:14 +0000 Subject: [PATCH 0630/2268] chore(main): release 2.9.4 (#1903) :robot: I have created a release *beep* *boop* --- ### [2.9.4](https://github.com/googleapis/java-bigquery/compare/v2.9.3...v2.9.4) (2022-03-08) ### Dependencies * update dependency com.google.cloud:native-image-support to v0.12.7 ([#1896](https://github.com/googleapis/java-bigquery/issues/1896)) ([5dcb02b](https://github.com/googleapis/java-bigquery/commit/5dcb02b04f9a87ba39e7cfa72229318926262029)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a72d00245..109738a0b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.9.4](https://github.com/googleapis/java-bigquery/compare/v2.9.3...v2.9.4) (2022-03-08) + + +### Dependencies + +* update dependency com.google.cloud:native-image-support to v0.12.7 ([#1896](https://github.com/googleapis/java-bigquery/issues/1896)) ([5dcb02b](https://github.com/googleapis/java-bigquery/commit/5dcb02b04f9a87ba39e7cfa72229318926262029)) + ### [2.9.3](https://github.com/googleapis/java-bigquery/compare/v2.9.2...v2.9.3) (2022-03-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 44cb4bd7f1..5c62e03aa3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.4-SNAPSHOT + 2.9.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 792b0b895e..0b46fa3b2a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.4-SNAPSHOT + 2.9.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.4-SNAPSHOT + 2.9.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index fa388cff10..7a5f9ee5ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.4-SNAPSHOT + 2.9.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.4-SNAPSHOT + 2.9.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4d8f25d317..8da0be0884 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.4-SNAPSHOT + 2.9.4 diff --git a/versions.txt b/versions.txt index f6d23ddd57..d3f450e42d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.3:2.9.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.9.4:2.9.4 \ No newline at end of file From 2d070ae9a5f4cb50cf0ee51f945634d6aa054938 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:44:35 +0000 Subject: [PATCH 0631/2268] chore(main): release 2.9.5-SNAPSHOT (#1904) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5c62e03aa3..954017f78c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.4 + 2.9.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0b46fa3b2a..7eb723e0f8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.4 + 2.9.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.4 + 2.9.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7a5f9ee5ca..1b673880ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.4 + 2.9.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.4 + 2.9.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8da0be0884..d1c6c0d3f9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.4 + 2.9.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index d3f450e42d..4fd0c62089 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.4:2.9.4 \ No newline at end of file +google-cloud-bigquery:2.9.4:2.9.5-SNAPSHOT \ No newline at end of file From b23fc36ca95fdbf3abf864fd9455efeaf01974b5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 21:42:27 +0100 Subject: [PATCH 0632/2268] test(deps): update dependency org.mockito:mockito-core to v4.4.0 (#1905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.3.1` -> `4.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/compatibility-slim/4.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/confidence-slim/4.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    mockito/mockito ### [`v4.4.0`](https://togithub.com/mockito/mockito/releases/v4.4.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.3.1...v4.4.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.4.0 - 2022-03-08 - [16 commit(s)](https://togithub.com/mockito/mockito/compare/v4.3.1...v4.4.0) by Andrew Kozel, Brice Dutheil, Jean-Baptiste Mille, Mirko Alicastro, dependabot\[bot] - Bump groovy from 3.0.9 to 3.0.10 [(#​2586)](https://togithub.com/mockito/mockito/pull/2586) - Bump google-java-format from 1.14.0 to 1.15.0 [(#​2585)](https://togithub.com/mockito/mockito/pull/2585) - Bump actions/checkout from 2.4.0 to 3 [(#​2582)](https://togithub.com/mockito/mockito/pull/2582) - Bump shipkit-auto-version from 1.1.19 to 1.1.20 [(#​2580)](https://togithub.com/mockito/mockito/pull/2580) - Bump biz.aQute.bnd.builder from 6.1.0 to 6.2.0 [(#​2579)](https://togithub.com/mockito/mockito/pull/2579) - Bump biz.aQute.bnd.gradle from 6.1.0 to 6.2.0 [(#​2578)](https://togithub.com/mockito/mockito/pull/2578) - Adds a Google Java Format for JDK17 [(#​2572)](https://togithub.com/mockito/mockito/pull/2572) - Clean up JUnit3 references [(#​2570)](https://togithub.com/mockito/mockito/pull/2570) - Bump com.diffplug.spotless from 6.2.2 to 6.3.0 [(#​2567)](https://togithub.com/mockito/mockito/pull/2567) - Bump google-java-format from 1.13.0 to 1.14.0 [(#​2565)](https://togithub.com/mockito/mockito/pull/2565) - Bump versions.bytebuddy from 1.12.7 to 1.12.8 [(#​2564)](https://togithub.com/mockito/mockito/pull/2564) - Bump com.diffplug.spotless from 6.2.1 to 6.2.2 [(#​2562)](https://togithub.com/mockito/mockito/pull/2562) - Bump com.github.ben-manes.versions from 0.41.0 to 0.42.0 [(#​2559)](https://togithub.com/mockito/mockito/pull/2559) - Bump com.diffplug.spotless from 6.2.0 to 6.2.1 [(#​2556)](https://togithub.com/mockito/mockito/pull/2556) - Fixes [#​2548](https://togithub.com/mockito/mockito/issues/2548) : Makes InOrder able to verify static methods [(#​2549)](https://togithub.com/mockito/mockito/pull/2549) - \[PR open] Add feature to verify static methods calls in order [(#​2548)](https://togithub.com/mockito/mockito/issues/2548) - Fixes [#​2201](https://togithub.com/mockito/mockito/issues/2201) : Fixed checking of declared exceptions. [(#​2547)](https://togithub.com/mockito/mockito/pull/2547) - Calling getExceptionTypes() on concrete object that is used as interface doesn't return exception types from interface [(#​2201)](https://togithub.com/mockito/mockito/issues/2201)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f80dced69f..4204763748 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.9.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.9.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.4" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 1b673880ce..4fe047812c 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ org.mockito mockito-core - 4.3.1 + 4.4.0 test From a7a196b4ea9cab28448bafe0fdc64f5e3de0412f Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Wed, 9 Mar 2022 21:34:53 +0530 Subject: [PATCH 0633/2268] docs(sample): Added AuthorizeDataset Sample (#1909) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added AuthorizeDataset sample * Added AuthorizeDataset IT * 🦉 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 --- README.md | 1 + .../example/bigquery/AuthorizeDataset.java | 73 ++++++++++++++++ .../example/bigquery/AuthorizeDatasetIT.java | 85 +++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java diff --git a/README.md b/README.md index 4204763748..ae6e80dbe9 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Auth Snippets | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthSnippets.java) | | Auth User Flow | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java) | | Auth User Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java) | +| Authorize Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java) | | Authorized View Tutorial | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthorizedViewTutorial.java) | | Browse Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/BrowseTable.java) | | Cancel Job | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CancelJob.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java b/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java new file mode 100644 index 0000000000..f7f28c2182 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java @@ -0,0 +1,73 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_authorized_dataset] +import com.google.cloud.bigquery.Acl; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetId; +import com.google.common.collect.ImmutableList; +import java.util.ArrayList; +import java.util.List; + +public class AuthorizeDataset { + + public static void main(String[] args) { + // TODO(developer): Replace these variables before running the sample. + String projectId = "PROJECT_ID"; + String sourceDatasetName = "BIGQUERY_SOURCE_DATASET_NAME"; + String userDatasetName = "BIGQUERY_USER_DATASET_NAME"; + authorizeDataset( + DatasetId.of(projectId, sourceDatasetName), DatasetId.of(projectId, userDatasetName)); + } + + // This method will update userDataset's ACL with sourceDataset's ACL + public static void authorizeDataset(DatasetId sourceDatasetId, DatasetId userDatasetId) { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + // Get both source and user dataset's references + Dataset sourceDataset = bigquery.getDataset(sourceDatasetId); + Dataset userDataset = bigquery.getDataset(userDatasetId); + + // Get the source dataset's ACL + List sourceDatasetAcl = new ArrayList<>(sourceDataset.getAcl()); + + // Add the user dataset's DatasetAccessEntry object to the existing sourceDatasetAcl + List targetTypes = ImmutableList.of("VIEWS"); + Acl.DatasetAclEntity userDatasetAclEntity = + new Acl.DatasetAclEntity(userDatasetId, targetTypes); + sourceDatasetAcl.add(Acl.of(userDatasetAclEntity)); + + // update the user dataset with source dataset's ACL + Dataset updatedUserDataset = + userDataset.toBuilder().setAcl(sourceDatasetAcl).build().update(); + + System.out.printf( + "Dataset %s updated with the added authorization\n", updatedUserDataset.getDatasetId()); + + } catch (BigQueryException e) { + System.out.println("Dataset Authorization failed due to error: \n" + e); + } + } +} +// [END bigquery_authorized_dataset] diff --git a/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java b/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java new file mode 100644 index 0000000000..b13c6bb73a --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java @@ -0,0 +1,85 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class AuthorizeDatasetIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String userDatasetName; + private String srcDatasetName; + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + private static final String GOOGLE_CLOUD_PROJECT = System.getenv("GOOGLE_CLOUD_PROJECT"); + private DatasetId sourceDatasetId; + private DatasetId userDatasetId; + + private static void requireEnvVar(String varName) { + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() { + userDatasetName = RemoteBigQueryHelper.generateDatasetName(); + srcDatasetName = RemoteBigQueryHelper.generateDatasetName(); + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + CreateDataset.createDataset(userDatasetName); + CreateDataset.createDataset(srcDatasetName); + userDatasetId = DatasetId.of(GOOGLE_CLOUD_PROJECT, userDatasetName); + sourceDatasetId = DatasetId.of(GOOGLE_CLOUD_PROJECT, srcDatasetName); + } + + @After + public void tearDown() { + // Clean up + DeleteDataset.deleteDataset(GOOGLE_CLOUD_PROJECT, userDatasetName); + DeleteDataset.deleteDataset(GOOGLE_CLOUD_PROJECT, srcDatasetName); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testCreateDataset() { + AuthorizeDataset.authorizeDataset(sourceDatasetId, userDatasetId); + assertThat(bout.toString()).contains(userDatasetId + " updated with the added authorization"); + } +} From b65dff500f0c092cfd6e20b905611731967eba10 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Mar 2022 17:05:08 +0100 Subject: [PATCH 0634/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.4 (#1908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.9.4 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae6e80dbe9..067a3279a7 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.9.3 + 2.9.4 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index bbc0ece46d..6bf3639238 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.9.3 + 2.9.4 From fddf59346e9635b5f10f94803ca87933337dc337 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Mar 2022 17:13:56 +0100 Subject: [PATCH 0635/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.8 (#1907) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 41919ac420..add71b368e 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.7 + 0.12.8 org.junit.vintage From d35d68963bc6a668d7177ac47d09b65dbefb9b7b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Mar 2022 17:14:08 +0100 Subject: [PATCH 0636/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.4.5 (#1906) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fe047812c..73cdf93547 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.4.4 + 2.4.5 test From 7802f16fb24bf29ab93139d8404d4b3c4d80b506 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 9 Mar 2022 18:10:13 -0500 Subject: [PATCH 0637/2268] docs(samples): fix undeleteTable sample IT failure (#1912) Caused by empty table schema Fixes #1911 --- .../test/java/com/example/bigquery/UndeleteTableIT.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/snippets/src/test/java/com/example/bigquery/UndeleteTableIT.java b/samples/snippets/src/test/java/com/example/bigquery/UndeleteTableIT.java index f6c725db6b..f53b0e41fe 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UndeleteTableIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UndeleteTableIT.java @@ -19,7 +19,9 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; +import com.google.cloud.bigquery.Field; import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.UUID; @@ -62,7 +64,11 @@ public void setUp() { tableName = "UNDELETE_TABLE_TEST_" + UUID.randomUUID().toString().substring(0, 8); recoverTableName = "RECOVER_DELETE_TABLE_TEST_" + UUID.randomUUID().toString().substring(0, 8); // Create table in dataset for testing - CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, Schema.of()); + Schema schema = + Schema.of( + Field.of("stringField", StandardSQLTypeName.STRING), + Field.of("booleanField", StandardSQLTypeName.BOOL)); + CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, schema); } @After From 830dd50ffaf62b398a1325df44e4c92cd0a6ae1b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Mar 2022 16:39:40 +0100 Subject: [PATCH 0638/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.9 (#1913) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index add71b368e..2f48de03e6 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.8 + 0.12.9 org.junit.vintage From 001302bbfd3d1e071bb48ad2a783183fd48f6059 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Mar 2022 16:39:58 +0100 Subject: [PATCH 0639/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.0 (#1914) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6bf3639238..4c399e899d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.11 + 2.2.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d1c6c0d3f9..102139f0df 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.11 + 2.2.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9f023ba9f6..1a087b7620 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.1.11 + 2.2.0 test From 3a54a8e5e1ee0bfd53c15f687ea22a3ed66f07af Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 10 Mar 2022 12:55:36 -0500 Subject: [PATCH 0640/2268] chore: revert nightly integration project (#1915) * chore: revert nightly integration project" * Update integration.cfg --- .kokoro/nightly/integration.cfg | 4 ++-- owlbot.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index a2907a257b..e51c7b4c6c 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -13,12 +13,12 @@ env_vars: { # TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" + value: "gcloud-devel" } env_vars: { key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" + value: "gcloud-devel" } env_vars: { diff --git a/owlbot.py b/owlbot.py index f514ca823d..cf3742f31b 100644 --- a/owlbot.py +++ b/owlbot.py @@ -27,4 +27,5 @@ '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', + '.kokoro/nightly/integration.cfg' ]) From fffdc14ba85d7de2bc24673222474aa7d2e3a65d Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 10 Mar 2022 18:33:35 -0500 Subject: [PATCH 0641/2268] Revert "chore: revert nightly integration project" (#1917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "chore: revert nightly integration project (#1915)" This reverts commit 3a54a8e5e1ee0bfd53c15f687ea22a3ed66f07af. * 🦉 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 --- .kokoro/nightly/integration.cfg | 4 ++-- README.md | 2 +- owlbot.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index e51c7b4c6c..a2907a257b 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -13,12 +13,12 @@ env_vars: { # TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" - value: "gcloud-devel" + value: "java-docs-samples-testing" } env_vars: { key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" + value: "java-docs-samples-testing" } env_vars: { diff --git a/README.md b/README.md index 067a3279a7..97442460b5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:24.4.0') +implementation platform('com.google.cloud:libraries-bom:25.0.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/owlbot.py b/owlbot.py index cf3742f31b..f514ca823d 100644 --- a/owlbot.py +++ b/owlbot.py @@ -27,5 +27,4 @@ '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', - '.kokoro/nightly/integration.cfg' ]) From 73e829bad373279b13fb59a56b1dc60eac0835a0 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 10 Mar 2022 21:40:23 -0500 Subject: [PATCH 0642/2268] feat: set Table.Schema for permanent external tables (#1701) Per discussion related to go/bq-external-table-schema --- .../google/cloud/bigquery/BigQueryImpl.java | 6 +++++ .../cloud/bigquery/it/ITBigQueryTest.java | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 16814e99a3..b2e939df09 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -286,6 +286,12 @@ public Table create(TableInfo tableInfo, TableOption... options) { ? getOptions().getProjectId() : tableInfo.getTableId().getProject()) .toPb(); + // Set schema on the Table for permanent external table + if (tablePb.getExternalDataConfiguration() != null) { + tablePb.setSchema(tablePb.getExternalDataConfiguration().getSchema()); + // clear table schema on ExternalDataConfiguration + tablePb.getExternalDataConfiguration().setSchema(null); + } final Map optionsMap = optionMap(options); try { return Table.fromPb( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9cab253a21..1ca5001dc8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1136,6 +1136,28 @@ public void testCreateExternalTable() throws InterruptedException { assertTrue(remoteTable.delete()); } + @Test + public void testSetPermExternalTableSchema() { + String tableName = "test_create_external_table_perm"; + TableId tableId = TableId.of(DATASET, tableName); + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder( + "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) + .setSchema(TABLE_SCHEMA) + .setConnectionId( + "projects/java-docs-samples-testing/locations/us/connections/DEVREL_TEST_CONNECTION") + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertTrue(remoteTable.delete()); + } + @Test public void testCreateViewTable() throws InterruptedException { String tableName = "test_create_view_table"; From c3faf1ffa6702c3d42bbf87ab1bc891c4eab34af Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 11 Mar 2022 20:49:08 +0100 Subject: [PATCH 0643/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.10.1 (#1918) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 954017f78c..35be2ab775 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.0 + 3.10.1 org.apache.maven.plugins From 30c5058f6e8a086d53ae4bfbbb25b28404fbcf15 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 11 Mar 2022 20:49:24 +0100 Subject: [PATCH 0644/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v25 (#1920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v25 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 97442460b5..8f463bbc23 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 24.4.0 + 25.0.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 2f48de03e6..d4029f6bb9 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 24.4.0 + 25.0.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1a087b7620..186e4a6561 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 24.4.0 + 25.0.0 pom import From fcad2091f9a24d667ceefc5a6d9aa57542bed702 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Mar 2022 15:14:43 +0100 Subject: [PATCH 0645/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220307-1.32.1 (#1921) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 73cdf93547..418d1ff850 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220226-1.32.1 + v2-rev20220307-1.32.1 2.8.0
    From a59ccf59c5fb1389fc5c5ed42ec8c41182f2e59d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Mar 2022 23:28:18 +0100 Subject: [PATCH 0646/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.10 (#1919) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:native-image-support](https://togithub.com/googleapis/java-core) | `0.12.9` -> `0.12.10` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.10/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.10/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.10/compatibility-slim/0.12.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.12.10/confidence-slim/0.12.9)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d4029f6bb9..5a36d5ab58 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.9 + 0.12.10 org.junit.vintage From 1c4ffd87f0ac3be01912116860471c28608191fe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 01:22:18 +0000 Subject: [PATCH 0647/2268] chore(main): release 2.10.0 (#1910) :robot: I have created a release *beep* *boop* --- ## [2.10.0](https://github.com/googleapis/java-bigquery/compare/v2.9.4...v2.10.0) (2022-03-14) ### Features * set Table.Schema for permanent external tables ([#1701](https://github.com/googleapis/java-bigquery/issues/1701)) ([73e829b](https://github.com/googleapis/java-bigquery/commit/73e829bad373279b13fb59a56b1dc60eac0835a0)) ### Documentation * **sample:** Added AuthorizeDataset Sample ([#1909](https://github.com/googleapis/java-bigquery/issues/1909)) ([a7a196b](https://github.com/googleapis/java-bigquery/commit/a7a196b4ea9cab28448bafe0fdc64f5e3de0412f)) * **samples:** fix undeleteTable sample IT failure ([#1912](https://github.com/googleapis/java-bigquery/issues/1912)) ([7802f16](https://github.com/googleapis/java-bigquery/commit/7802f16fb24bf29ab93139d8404d4b3c4d80b506)), closes [#1911](https://github.com/googleapis/java-bigquery/issues/1911) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220307-1.32.1 ([#1921](https://github.com/googleapis/java-bigquery/issues/1921)) ([fcad209](https://github.com/googleapis/java-bigquery/commit/fcad2091f9a24d667ceefc5a6d9aa57542bed702)) * update dependency com.google.cloud:google-cloud-storage to v2.4.5 ([#1906](https://github.com/googleapis/java-bigquery/issues/1906)) ([d35d689](https://github.com/googleapis/java-bigquery/commit/d35d68963bc6a668d7177ac47d09b65dbefb9b7b)) * update dependency com.google.cloud:native-image-support to v0.12.10 ([#1919](https://github.com/googleapis/java-bigquery/issues/1919)) ([a59ccf5](https://github.com/googleapis/java-bigquery/commit/a59ccf59c5fb1389fc5c5ed42ec8c41182f2e59d)) * update dependency com.google.cloud:native-image-support to v0.12.8 ([#1907](https://github.com/googleapis/java-bigquery/issues/1907)) ([fddf593](https://github.com/googleapis/java-bigquery/commit/fddf59346e9635b5f10f94803ca87933337dc337)) * update dependency com.google.cloud:native-image-support to v0.12.9 ([#1913](https://github.com/googleapis/java-bigquery/issues/1913)) ([830dd50](https://github.com/googleapis/java-bigquery/commit/830dd50ffaf62b398a1325df44e4c92cd0a6ae1b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 22 ++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 109738a0b1..43df759003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.10.0](https://github.com/googleapis/java-bigquery/compare/v2.9.4...v2.10.0) (2022-03-14) + + +### Features + +* set Table.Schema for permanent external tables ([#1701](https://github.com/googleapis/java-bigquery/issues/1701)) ([73e829b](https://github.com/googleapis/java-bigquery/commit/73e829bad373279b13fb59a56b1dc60eac0835a0)) + + +### Documentation + +* **sample:** Added AuthorizeDataset Sample ([#1909](https://github.com/googleapis/java-bigquery/issues/1909)) ([a7a196b](https://github.com/googleapis/java-bigquery/commit/a7a196b4ea9cab28448bafe0fdc64f5e3de0412f)) +* **samples:** fix undeleteTable sample IT failure ([#1912](https://github.com/googleapis/java-bigquery/issues/1912)) ([7802f16](https://github.com/googleapis/java-bigquery/commit/7802f16fb24bf29ab93139d8404d4b3c4d80b506)), closes [#1911](https://github.com/googleapis/java-bigquery/issues/1911) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220307-1.32.1 ([#1921](https://github.com/googleapis/java-bigquery/issues/1921)) ([fcad209](https://github.com/googleapis/java-bigquery/commit/fcad2091f9a24d667ceefc5a6d9aa57542bed702)) +* update dependency com.google.cloud:google-cloud-storage to v2.4.5 ([#1906](https://github.com/googleapis/java-bigquery/issues/1906)) ([d35d689](https://github.com/googleapis/java-bigquery/commit/d35d68963bc6a668d7177ac47d09b65dbefb9b7b)) +* update dependency com.google.cloud:native-image-support to v0.12.10 ([#1919](https://github.com/googleapis/java-bigquery/issues/1919)) ([a59ccf5](https://github.com/googleapis/java-bigquery/commit/a59ccf59c5fb1389fc5c5ed42ec8c41182f2e59d)) +* update dependency com.google.cloud:native-image-support to v0.12.8 ([#1907](https://github.com/googleapis/java-bigquery/issues/1907)) ([fddf593](https://github.com/googleapis/java-bigquery/commit/fddf59346e9635b5f10f94803ca87933337dc337)) +* update dependency com.google.cloud:native-image-support to v0.12.9 ([#1913](https://github.com/googleapis/java-bigquery/issues/1913)) ([830dd50](https://github.com/googleapis/java-bigquery/commit/830dd50ffaf62b398a1325df44e4c92cd0a6ae1b)) + ### [2.9.4](https://github.com/googleapis/java-bigquery/compare/v2.9.3...v2.9.4) (2022-03-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 35be2ab775..1f0c08dcc8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.9.5-SNAPSHOT + 2.10.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7eb723e0f8..e1a8a989b4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.9.5-SNAPSHOT + 2.10.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.9.5-SNAPSHOT + 2.10.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 418d1ff850..37302c3470 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.9.5-SNAPSHOT + 2.10.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.9.5-SNAPSHOT + 2.10.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 102139f0df..718b33dc12 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.9.5-SNAPSHOT + 2.10.0 diff --git a/versions.txt b/versions.txt index 4fd0c62089..8e2a3e59ff 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.9.4:2.9.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.0:2.10.0 \ No newline at end of file From 1eb6a9d92ebf40b1fc88301569597a2f571fb015 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Mar 2022 14:23:13 +0100 Subject: [PATCH 0648/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.0 (#1923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.0 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8f463bbc23..836549d159 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.9.4 + 2.10.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.9.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.9.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4c399e899d..252f96dbae 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.9.4 + 2.10.0 From 1fbf99a8eaf13f813a849e397dc87f6250658022 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 13:40:11 +0000 Subject: [PATCH 0649/2268] chore(main): release 2.10.1-SNAPSHOT (#1922) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1f0c08dcc8..a75a5fe3d9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.0 + 2.10.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e1a8a989b4..c3c7ddb962 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.0 + 2.10.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.0 + 2.10.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 37302c3470..dbb89687cc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.0 + 2.10.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.0 + 2.10.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 718b33dc12..f77ec96909 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.0 + 2.10.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8e2a3e59ff..c6872a48bb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.0:2.10.0 \ No newline at end of file +google-cloud-bigquery:2.10.0:2.10.1-SNAPSHOT \ No newline at end of file From 0e88b930ef4d2581e0d44ba31a0d4b6a05f6cc53 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Mar 2022 06:25:29 +0100 Subject: [PATCH 0650/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220313-1.32.1 (#1925) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dbb89687cc..5cedd168e5 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220307-1.32.1 + v2-rev20220313-1.32.1 2.8.0 From 832b21e0228f4c9164610c2d823dbc1dfbd08336 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 05:38:12 +0000 Subject: [PATCH 0651/2268] chore(main): release 2.10.1 (#1926) :robot: I have created a release *beep* *boop* --- ### [2.10.1](https://github.com/googleapis/java-bigquery/compare/v2.10.0...v2.10.1) (2022-03-21) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220313-1.32.1 ([#1925](https://github.com/googleapis/java-bigquery/issues/1925)) ([0e88b93](https://github.com/googleapis/java-bigquery/commit/0e88b930ef4d2581e0d44ba31a0d4b6a05f6cc53)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43df759003..23c7eb69ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.10.1](https://github.com/googleapis/java-bigquery/compare/v2.10.0...v2.10.1) (2022-03-21) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220313-1.32.1 ([#1925](https://github.com/googleapis/java-bigquery/issues/1925)) ([0e88b93](https://github.com/googleapis/java-bigquery/commit/0e88b930ef4d2581e0d44ba31a0d4b6a05f6cc53)) + ## [2.10.0](https://github.com/googleapis/java-bigquery/compare/v2.9.4...v2.10.0) (2022-03-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a75a5fe3d9..c701837c29 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.1-SNAPSHOT + 2.10.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c3c7ddb962..b8e9bddf84 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.1-SNAPSHOT + 2.10.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.1-SNAPSHOT + 2.10.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5cedd168e5..5c5cb181c3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.1-SNAPSHOT + 2.10.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.1-SNAPSHOT + 2.10.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f77ec96909..c8850e5241 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.1-SNAPSHOT + 2.10.1 diff --git a/versions.txt b/versions.txt index c6872a48bb..cd1fee6b51 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.0:2.10.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.1:2.10.1 \ No newline at end of file From 73d8091b481f7950946ee6752f366b6354a9129e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 05:52:37 +0000 Subject: [PATCH 0652/2268] chore(main): release 2.10.2-SNAPSHOT (#1927) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c701837c29..b24c423d15 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.1 + 2.10.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b8e9bddf84..9da1b2137b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.1 + 2.10.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.1 + 2.10.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5c5cb181c3..bc5152e501 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.1 + 2.10.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.1 + 2.10.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c8850e5241..d542af5191 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.1 + 2.10.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index cd1fee6b51..f4b7d85014 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.1:2.10.1 \ No newline at end of file +google-cloud-bigquery:2.10.1:2.10.2-SNAPSHOT \ No newline at end of file From 63130e1e6a4db9014aa42e9baa331a867a312a17 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 21 Mar 2022 16:42:12 +0100 Subject: [PATCH 0653/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.1 (#1928) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.0` -> `2.10.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.1/compatibility-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.1/confidence-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2101-httpsgithubcomgoogleapisjava-bigquerycomparev2100v2101-2022-03-21) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.0...v2.10.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 836549d159..8c5bd1807e 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.0 + 2.10.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 252f96dbae..206924382b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.0 + 2.10.1 From bc444b2cad99b8185a37a226abd2d315c95c6568 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 24 Mar 2022 16:12:13 +0100 Subject: [PATCH 0654/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.11 (#1932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.10` -> `0.9.11` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.11/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.11/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.11/compatibility-slim/0.9.10)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.11/confidence-slim/0.9.10)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.11`](https://togithub.com/graalvm/native-build-tools/releases/0.9.11) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.10...0.9.11) ##### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Add issue templates by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/216](https://togithub.com/graalvm/native-build-tools/pull/216) - Fix [@​arg](https://togithub.com/arg) file not being used for tests in Maven by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/212](https://togithub.com/graalvm/native-build-tools/pull/212) - Make it possible to use environment variables in native tests by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/217](https://togithub.com/graalvm/native-build-tools/pull/217) - Fix incorrect declaration of output directory by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/219](https://togithub.com/graalvm/native-build-tools/pull/219) - Refactor build by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/220](https://togithub.com/graalvm/native-build-tools/pull/220) - Integrate native configuration repository with Gradle by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/204](https://togithub.com/graalvm/native-build-tools/pull/204) - Rework argfile generation by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/223](https://togithub.com/graalvm/native-build-tools/pull/223) - Rename `metadataRepository` and document feature by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/225](https://togithub.com/graalvm/native-build-tools/pull/225) - Support applications with custom packaging types by [@​alvarosanchez](https://togithub.com/alvarosanchez) in [https://github.com/graalvm/native-build-tools/pull/226](https://togithub.com/graalvm/native-build-tools/pull/226) ##### New Contributors - [@​alvarosanchez](https://togithub.com/alvarosanchez) made their first contribution in [https://github.com/graalvm/native-build-tools/pull/226](https://togithub.com/graalvm/native-build-tools/pull/226) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.10...0.9.11
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 5a36d5ab58..43f340c5b4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -126,7 +126,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.10 + 0.9.11 true com.example.bigquery.NativeImageBigquerySample From d6af865bcccbdc3294d2c9442272f2f02bad3f8f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 24 Mar 2022 16:12:17 +0100 Subject: [PATCH 0655/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.11 (#1931) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.10` -> `0.9.11` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.11/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.11/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.11/compatibility-slim/0.9.10)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.11/confidence-slim/0.9.10)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.11`](https://togithub.com/graalvm/native-build-tools/releases/0.9.11) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.10...0.9.11) ##### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Add issue templates by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/216](https://togithub.com/graalvm/native-build-tools/pull/216) - Fix [@​arg](https://togithub.com/arg) file not being used for tests in Maven by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/212](https://togithub.com/graalvm/native-build-tools/pull/212) - Make it possible to use environment variables in native tests by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/217](https://togithub.com/graalvm/native-build-tools/pull/217) - Fix incorrect declaration of output directory by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/219](https://togithub.com/graalvm/native-build-tools/pull/219) - Refactor build by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/220](https://togithub.com/graalvm/native-build-tools/pull/220) - Integrate native configuration repository with Gradle by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/204](https://togithub.com/graalvm/native-build-tools/pull/204) - Rework argfile generation by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/223](https://togithub.com/graalvm/native-build-tools/pull/223) - Rename `metadataRepository` and document feature by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/225](https://togithub.com/graalvm/native-build-tools/pull/225) - Support applications with custom packaging types by [@​alvarosanchez](https://togithub.com/alvarosanchez) in [https://github.com/graalvm/native-build-tools/pull/226](https://togithub.com/graalvm/native-build-tools/pull/226) ##### New Contributors - [@​alvarosanchez](https://togithub.com/alvarosanchez) made their first contribution in [https://github.com/graalvm/native-build-tools/pull/226](https://togithub.com/graalvm/native-build-tools/pull/226) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.10...0.9.11
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 43f340c5b4..7652630eb2 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -104,7 +104,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.10 + 0.9.11 test From ed8d9d52e39709063a180da8845f6bf829e96efb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 24 Mar 2022 15:32:13 +0000 Subject: [PATCH 0656/2268] chore(main): release 2.10.2 (#1933) :robot: I have created a release *beep* *boop* --- ### [2.10.2](https://github.com/googleapis/java-bigquery/compare/v2.10.1...v2.10.2) (2022-03-24) ### Dependencies * update dependency org.graalvm.buildtools:junit-platform-native to v0.9.11 ([#1931](https://github.com/googleapis/java-bigquery/issues/1931)) ([d6af865](https://github.com/googleapis/java-bigquery/commit/d6af865bcccbdc3294d2c9442272f2f02bad3f8f)) * update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.11 ([#1932](https://github.com/googleapis/java-bigquery/issues/1932)) ([bc444b2](https://github.com/googleapis/java-bigquery/commit/bc444b2cad99b8185a37a226abd2d315c95c6568)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c7eb69ea..14b49f04be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.10.2](https://github.com/googleapis/java-bigquery/compare/v2.10.1...v2.10.2) (2022-03-24) + + +### Dependencies + +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.11 ([#1931](https://github.com/googleapis/java-bigquery/issues/1931)) ([d6af865](https://github.com/googleapis/java-bigquery/commit/d6af865bcccbdc3294d2c9442272f2f02bad3f8f)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.11 ([#1932](https://github.com/googleapis/java-bigquery/issues/1932)) ([bc444b2](https://github.com/googleapis/java-bigquery/commit/bc444b2cad99b8185a37a226abd2d315c95c6568)) + ### [2.10.1](https://github.com/googleapis/java-bigquery/compare/v2.10.0...v2.10.1) (2022-03-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b24c423d15..4488f7b36a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.2-SNAPSHOT + 2.10.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9da1b2137b..4fcdaeb746 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.2-SNAPSHOT + 2.10.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.2-SNAPSHOT + 2.10.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bc5152e501..dbe07b55ed 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.2-SNAPSHOT + 2.10.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.2-SNAPSHOT + 2.10.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d542af5191..f331145dbb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.2-SNAPSHOT + 2.10.2 diff --git a/versions.txt b/versions.txt index f4b7d85014..8110e71fea 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.1:2.10.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.2:2.10.2 \ No newline at end of file From 4f003f21dca930fc8fd55e2f7ad34bcd9d2fd415 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Mar 2022 17:42:15 +0100 Subject: [PATCH 0657/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.2 (#1935) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.1` -> `2.10.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.2/compatibility-slim/2.10.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.2/confidence-slim/2.10.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.2`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2102-httpsgithubcomgoogleapisjava-bigquerycomparev2101v2102-2022-03-24) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.1...v2.10.2)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8c5bd1807e..5b6aeb2948 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.1 + 2.10.2 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.2" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 206924382b..68d3347ea1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.1 + 2.10.2 From 6c6e76d815c8aed64e3b6a15fad0280670b99b47 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 16:56:16 +0000 Subject: [PATCH 0658/2268] chore(main): release 2.10.3-SNAPSHOT (#1934) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4488f7b36a..c159076a74 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.2 + 2.10.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4fcdaeb746..c57fd4dcc2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.2 + 2.10.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.2 + 2.10.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index dbe07b55ed..0649fe2edd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.2 + 2.10.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.2 + 2.10.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f331145dbb..63c865222a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.2 + 2.10.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8110e71fea..3a190648f9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.2:2.10.2 \ No newline at end of file +google-cloud-bigquery:2.10.2:2.10.3-SNAPSHOT \ No newline at end of file From 57e680724a1f6717b183ef48ce039600a6c90b9a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 28 Mar 2022 17:30:42 +0200 Subject: [PATCH 0659/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.5.0 (#1936) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0649fe2edd..999ce202de 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.4.5 + 2.5.0 test From 85e28a2c5641b7cd0d72d88ef1a6984b93c139d2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 15:44:13 +0000 Subject: [PATCH 0660/2268] chore(main): release 2.10.3 (#1939) :robot: I have created a release *beep* *boop* --- ### [2.10.3](https://github.com/googleapis/java-bigquery/compare/v2.10.2...v2.10.3) (2022-03-28) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.5.0 ([#1936](https://github.com/googleapis/java-bigquery/issues/1936)) ([57e6807](https://github.com/googleapis/java-bigquery/commit/57e680724a1f6717b183ef48ce039600a6c90b9a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b49f04be..a68067d483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.10.3](https://github.com/googleapis/java-bigquery/compare/v2.10.2...v2.10.3) (2022-03-28) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.5.0 ([#1936](https://github.com/googleapis/java-bigquery/issues/1936)) ([57e6807](https://github.com/googleapis/java-bigquery/commit/57e680724a1f6717b183ef48ce039600a6c90b9a)) + ### [2.10.2](https://github.com/googleapis/java-bigquery/compare/v2.10.1...v2.10.2) (2022-03-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c159076a74..440b546f64 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.3-SNAPSHOT + 2.10.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c57fd4dcc2..0c064857a9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.3-SNAPSHOT + 2.10.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.3-SNAPSHOT + 2.10.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 999ce202de..03623954ae 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.3-SNAPSHOT + 2.10.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.3-SNAPSHOT + 2.10.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 63c865222a..dd98f6f3ca 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.3-SNAPSHOT + 2.10.3 diff --git a/versions.txt b/versions.txt index 3a190648f9..13dfc56ce9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.2:2.10.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.3:2.10.3 \ No newline at end of file From 6b5ce65b247f94ae2d9669fe6a32192f317430d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:28:12 +0000 Subject: [PATCH 0661/2268] chore(main): release 2.10.4-SNAPSHOT (#1940) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 440b546f64..6c68d26b06 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.3 + 2.10.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0c064857a9..1af35d8c73 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.3 + 2.10.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.3 + 2.10.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 03623954ae..0c5b4ea8c1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.3 + 2.10.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.3 + 2.10.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dd98f6f3ca..99f9c801a3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.3 + 2.10.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 13dfc56ce9..19ddd80ad3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.3:2.10.3 \ No newline at end of file +google-cloud-bigquery:2.10.3:2.10.4-SNAPSHOT \ No newline at end of file From 95471ef6d8e7ca6bc8693106098e830462de3da6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 28 Mar 2022 23:45:14 +0200 Subject: [PATCH 0662/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.3 (#1941) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.3 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b6aeb2948..818b922912 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.2 + 2.10.3 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 68d3347ea1..2300e2a25a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.2 + 2.10.3 From c845e802a91bb22918913c3fd501eb80b8eb3c4c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 04:10:11 +0200 Subject: [PATCH 0663/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.5.1 (#1943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.5.0` -> `2.5.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.5.1/compatibility-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.5.1/confidence-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.5.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​251-httpsgithubcomgoogleapisjava-storagecomparev250v251-2022-03-28) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.5.0...v2.5.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0c5b4ea8c1..b765124b34 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.5.0 + 2.5.1 test From fd54a96f8ccdf7876d914d338cbb2ec7b6cc310a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 17:24:13 +0200 Subject: [PATCH 0664/2268] deps: update dependency com.google.cloud:native-image-support to v0.12.11 (#1944) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 7652630eb2..fcad43274a 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.10 + 0.12.11 org.junit.vintage From e6a65024498d5c44000fb982953d063710b7c1d5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 17:24:45 +0200 Subject: [PATCH 0665/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 (#1945) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b765124b34..93466f1ca8 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220313-1.32.1 - 2.8.0 + 2.9.0
    From 77b9a20d2aff95a49e6e1e56a50442e3eb04bf3c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 17:24:58 +0200 Subject: [PATCH 0666/2268] deps: update jmh.version to v1.35 (#1938) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 6c68d26b06..db44ec6516 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.34 + 1.35 benchmark From b3149a9c39c61b35e121059c4a2b1e831b66ec2a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 19:08:22 +0200 Subject: [PATCH 0667/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.3.2 (#1942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.3.0` -> `1.3.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.2/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.3.2/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-config ### [`v1.3.2`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​132-httpsgithubcomgoogleapisjava-shared-configcomparev131v132-2022-03-28) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.3.1...v1.3.2) ### [`v1.3.1`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​131-httpsgithubcomgoogleapisjava-shared-configcomparev130v131-2022-03-25) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.3.0...v1.3.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 93466f1ca8..b245593c44 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.3.0 + 1.3.2 From 64691da9793b311cb3e80fc0f6c5ccdc1884beee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 29 Mar 2022 19:54:25 +0200 Subject: [PATCH 0668/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.3.0 (#1948) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index db44ec6516..1d697dc615 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.4 + 3.3.0 package From a4683aae06a30704bf526e23fe1daee70f09d548 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 15:22:31 -0400 Subject: [PATCH 0669/2268] chore(main): release 2.10.4 (#1946) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a68067d483..cd33368d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +### [2.10.4](https://github.com/googleapis/java-bigquery/compare/v2.10.3...v2.10.4) (2022-03-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#1945](https://github.com/googleapis/java-bigquery/issues/1945)) ([e6a6502](https://github.com/googleapis/java-bigquery/commit/e6a65024498d5c44000fb982953d063710b7c1d5)) +* update dependency com.google.cloud:google-cloud-storage to v2.5.1 ([#1943](https://github.com/googleapis/java-bigquery/issues/1943)) ([c845e80](https://github.com/googleapis/java-bigquery/commit/c845e802a91bb22918913c3fd501eb80b8eb3c4c)) +* update dependency com.google.cloud:native-image-support to v0.12.11 ([#1944](https://github.com/googleapis/java-bigquery/issues/1944)) ([fd54a96](https://github.com/googleapis/java-bigquery/commit/fd54a96f8ccdf7876d914d338cbb2ec7b6cc310a)) +* update jmh.version to v1.35 ([#1938](https://github.com/googleapis/java-bigquery/issues/1938)) ([77b9a20](https://github.com/googleapis/java-bigquery/commit/77b9a20d2aff95a49e6e1e56a50442e3eb04bf3c)) + ### [2.10.3](https://github.com/googleapis/java-bigquery/compare/v2.10.2...v2.10.3) (2022-03-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1d697dc615..9a0763ffde 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.4-SNAPSHOT + 2.10.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1af35d8c73..9c746bd3ab 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.4-SNAPSHOT + 2.10.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.4-SNAPSHOT + 2.10.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b245593c44..751d886258 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.4-SNAPSHOT + 2.10.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.4-SNAPSHOT + 2.10.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 99f9c801a3..42eea913ae 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.4-SNAPSHOT + 2.10.4 diff --git a/versions.txt b/versions.txt index 19ddd80ad3..da5962d2d7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.3:2.10.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.4:2.10.4 \ No newline at end of file From f5614cc709ed4c28b83ea9a46b04320dd3b24118 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 15:37:11 -0400 Subject: [PATCH 0670/2268] chore(main): release 2.10.5-SNAPSHOT (#1949) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9a0763ffde..c50006a575 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.4 + 2.10.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9c746bd3ab..d1d9ad8807 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.4 + 2.10.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.4 + 2.10.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 751d886258..31e4b19ab7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.4 + 2.10.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.4 + 2.10.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 42eea913ae..679a50f341 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.4 + 2.10.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index da5962d2d7..1f48d75113 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.4:2.10.4 \ No newline at end of file +google-cloud-bigquery:2.10.4:2.10.5-SNAPSHOT \ No newline at end of file From 65ddcdbac0bf1407bc19f8c88c8dcae9906bbbab Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 16:50:56 +0200 Subject: [PATCH 0671/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.4 (#1950) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.4 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 818b922912..bfc1bf976c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.3 + 2.10.4 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.4" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2300e2a25a..f07b6b7af6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.3 + 2.10.4 From 426f86e0c88128c12d5591567f24eabc2db17159 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 31 Mar 2022 13:07:05 -0700 Subject: [PATCH 0672/2268] chore: comment out the portion that is causing the failure in testSnapshotTableCopyJob (#1957) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: comment out the portion that is causing the failure in testSnapshotTableCopyJob Will follow up once b/227623980 is answered * 🦉 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 --- README.md | 2 +- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bfc1bf976c..7caf2e63ac 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:25.0.0') +implementation platform('com.google.cloud:libraries-bom:25.1.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 1ca5001dc8..9f877cf23c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3065,9 +3065,10 @@ public void testSnapshotTableCopyJob() throws InterruptedException { .build(); Job createdRestoreJob = bigquery.create(JobInfo.of(restoreConfiguration)); CopyJobConfiguration createdRestoreConfiguration = createdRestoreJob.getConfiguration(); - assertEquals( - restoreConfiguration.getSourceTables().get(0).getTable(), - createdRestoreConfiguration.getSourceTables().get(0).getTable()); + // TODO: uncomment/modify below when b/227623980 is resolved + // assertEquals( + // restoreConfiguration.getSourceTables().get(0).getTable(), + // createdRestoreConfiguration.getSourceTables().get(0).getTable()); assertEquals( restoreConfiguration.getOperationType(), createdRestoreConfiguration.getOperationType()); assertEquals( From 17ba20c5e243327475c447ff180b9b2eef3f2b79 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 22:22:10 +0200 Subject: [PATCH 0673/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220322-1.32.1 (#1951) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220313-1.32.1` -> `v2-rev20220322-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220322-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220322-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220322-1.32.1/compatibility-slim/v2-rev20220313-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220322-1.32.1/confidence-slim/v2-rev20220313-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 31e4b19ab7..981463f87f 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220313-1.32.1 + v2-rev20220322-1.32.1 2.9.0 From 78a6ead8882036da5abc41a3c442e76c2a30265f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 22:26:11 +0200 Subject: [PATCH 0674/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.6.1 (#1952) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.6.0` -> `2.6.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.1/compatibility-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.1/confidence-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.6.1`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​261-httpsgithubcomgoogleapisjava-bigtablecomparev260v261-2022-03-29) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.6.0...v2.6.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f07b6b7af6..c9afb06e6f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.6.0 + 2.6.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 679a50f341..3b220532bb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.6.0 + 2.6.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 186e4a6561..0a2807dd05 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.6.0 + 2.6.1 test From 8ae3ab2ea43906880a608dac31c22b2c96c98ef3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 22:30:14 +0200 Subject: [PATCH 0675/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.1 (#1954) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.2.0` -> `2.2.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.1/compatibility-slim/2.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.1/confidence-slim/2.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.2.1`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​221-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev220v221-2022-03-29) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.2.0...v2.2.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c9afb06e6f..75bc791710 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.0 + 2.2.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3b220532bb..819d7f28fd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.0 + 2.2.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0a2807dd05..63b2bb4c03 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.0 + 2.2.1 test From d32e963a63b9a50d71ca399336d49d92fac54a23 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 22:30:20 +0200 Subject: [PATCH 0676/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.1 (#1955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) | `1.7.0` -> `1.7.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.7.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.7.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.7.1/compatibility-slim/1.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.7.1/confidence-slim/1.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-datacatalog ### [`v1.7.1`](https://togithub.com/googleapis/java-datacatalog/blob/HEAD/CHANGELOG.md#​171-httpsgithubcomgoogleapisjava-datacatalogcomparev170v171-2022-03-29) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.7.0...v1.7.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 981463f87f..a3bd3e7985 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.7.0 + 1.7.1 pom import From ee9dfce867900d9eba696aee3ca7bc09e68eccd4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 31 Mar 2022 22:32:10 +0200 Subject: [PATCH 0677/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.6.0 (#1956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.5.1` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.0/compatibility-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.0/confidence-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.6.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​260-httpsgithubcomgoogleapisjava-storagecomparev251v260-2022-03-30) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.5.1...v2.6.0) ##### Features - replace enum with string representation for predefined ACLs and public_access_prevention ([#​1323](https://togithub.com/googleapis/java-storage/issues/1323)) ([4dd1a88](https://togithub.com/googleapis/java-storage/commit/4dd1a8800317343bb0cd575864683e580f9ccd29)) ##### Bug Fixes - **java:** add configurations for Storage tests ([#​1305](https://togithub.com/googleapis/java-storage/issues/1305)) ([2bacf92](https://togithub.com/googleapis/java-storage/commit/2bacf92799e8a0fbdc1b5cfcfc6ef8d806a53fa3)) - update boundary checking of BlobReadChannel when limit() is used ([#​1324](https://togithub.com/googleapis/java-storage/issues/1324)) ([f21f624](https://togithub.com/googleapis/java-storage/commit/f21f624f1645b5ada350c04c774f9f113e76e971)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#​1321](https://togithub.com/googleapis/java-storage/issues/1321)) ([f48d8dd](https://togithub.com/googleapis/java-storage/commit/f48d8dd09e918ba4a54fccaebf65feaba4f6e206)) ##### Documentation - adjust retry settings for hmac samples ([#​1303](https://togithub.com/googleapis/java-storage/issues/1303)) ([d0c5361](https://togithub.com/googleapis/java-storage/commit/d0c5361e9e4996f8a99754381e5a28a843e6de2a)) ##### [2.5.1](https://togithub.com/googleapis/java-storage/compare/v2.5.0...v2.5.1) (2022-03-28) ##### Dependencies - update dependency com.google.cloud:google-cloud-pubsub to v1.116.2 ([#​1310](https://togithub.com/googleapis/java-storage/issues/1310)) ([fb64493](https://togithub.com/googleapis/java-storage/commit/fb644932d4350b4e33481abda8cc8f498f9da85e))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a3bd3e7985..8ea8547014 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.5.1 + 2.6.0 test From 829eb8931d1f57719630b8f2cd0ca343688fe563 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 20:46:11 +0000 Subject: [PATCH 0678/2268] chore(main): release 2.10.5 (#1959) :robot: I have created a release *beep* *boop* --- ### [2.10.5](https://github.com/googleapis/java-bigquery/compare/v2.10.4...v2.10.5) (2022-03-31) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220322-1.32.1 ([#1951](https://github.com/googleapis/java-bigquery/issues/1951)) ([17ba20c](https://github.com/googleapis/java-bigquery/commit/17ba20c5e243327475c447ff180b9b2eef3f2b79)) * update dependency com.google.cloud:google-cloud-bigtable to v2.6.1 ([#1952](https://github.com/googleapis/java-bigquery/issues/1952)) ([78a6ead](https://github.com/googleapis/java-bigquery/commit/78a6ead8882036da5abc41a3c442e76c2a30265f)) * update dependency com.google.cloud:google-cloud-storage to v2.6.0 ([#1956](https://github.com/googleapis/java-bigquery/issues/1956)) ([ee9dfce](https://github.com/googleapis/java-bigquery/commit/ee9dfce867900d9eba696aee3ca7bc09e68eccd4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd33368d79..aa6f061c94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### [2.10.5](https://github.com/googleapis/java-bigquery/compare/v2.10.4...v2.10.5) (2022-03-31) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220322-1.32.1 ([#1951](https://github.com/googleapis/java-bigquery/issues/1951)) ([17ba20c](https://github.com/googleapis/java-bigquery/commit/17ba20c5e243327475c447ff180b9b2eef3f2b79)) +* update dependency com.google.cloud:google-cloud-bigtable to v2.6.1 ([#1952](https://github.com/googleapis/java-bigquery/issues/1952)) ([78a6ead](https://github.com/googleapis/java-bigquery/commit/78a6ead8882036da5abc41a3c442e76c2a30265f)) +* update dependency com.google.cloud:google-cloud-storage to v2.6.0 ([#1956](https://github.com/googleapis/java-bigquery/issues/1956)) ([ee9dfce](https://github.com/googleapis/java-bigquery/commit/ee9dfce867900d9eba696aee3ca7bc09e68eccd4)) + ### [2.10.4](https://github.com/googleapis/java-bigquery/compare/v2.10.3...v2.10.4) (2022-03-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c50006a575..bdf7895226 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.5-SNAPSHOT + 2.10.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d1d9ad8807..2ebb5644da 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.5-SNAPSHOT + 2.10.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.5-SNAPSHOT + 2.10.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8ea8547014..b4a85eca25 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.5-SNAPSHOT + 2.10.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.5-SNAPSHOT + 2.10.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 819d7f28fd..db32f08ab6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.5-SNAPSHOT + 2.10.5 diff --git a/versions.txt b/versions.txt index 1f48d75113..864c8eede3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.4:2.10.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.5:2.10.5 \ No newline at end of file From 0c9ab6e835665bb0bb05572024609e535d958a51 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 21:00:16 +0000 Subject: [PATCH 0679/2268] chore(main): release 2.10.6-SNAPSHOT (#1960) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bdf7895226..ef7d8eb08d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.5 + 2.10.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2ebb5644da..4d07b7d2b0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.5 + 2.10.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.5 + 2.10.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b4a85eca25..cf1d804d64 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.5 + 2.10.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.5 + 2.10.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index db32f08ab6..447f578e18 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.5 + 2.10.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index 864c8eede3..c670001627 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.5:2.10.5 \ No newline at end of file +google-cloud-bigquery:2.10.5:2.10.6-SNAPSHOT \ No newline at end of file From 87d1a305737a830194e8aa306078c9bffbcf1b43 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Apr 2022 16:25:08 +0200 Subject: [PATCH 0680/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.5 (#1961) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.5 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7caf2e63ac..a1624de7f0 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.4 + 2.10.5 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.5' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.5" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 75bc791710..db59ee8691 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.4 + 2.10.5 From 0f19738e5e4229a52c8cc6b40d3bace40f8df747 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Apr 2022 18:34:16 +0200 Subject: [PATCH 0681/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v25.1.0 (#1958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java)) | `25.0.0` -> `25.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/25.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/25.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/25.1.0/compatibility-slim/25.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/25.1.0/confidence-slim/25.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1624de7f0..6e5d6cd870 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 25.0.0 + 25.1.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index fcad43274a..f4893182a9 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 25.0.0 + 25.1.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 63b2bb4c03..01e2977f4c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 25.0.0 + 25.1.0 pom import From eb9eaea2bbe025ce68d96846c6f9b3b0bad52299 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 5 Apr 2022 12:48:18 -0700 Subject: [PATCH 0682/2268] chore: make policy tag setup use unique display names (#1962) In accordance with https://github.com/googleapis/google-cloud-go/pull/5846 --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9f877cf23c..c8f7ce4fa3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -943,7 +943,8 @@ public void testCreateAndUpdateTableWithPolicyTags() throws IOException { .setParent(String.format("projects/%s/locations/%s", PROJECT_ID, "us")) .setTaxonomy( Taxonomy.newBuilder() - .setDisplayName("testing taxonomy") + // DisplayName must be unique across org + .setDisplayName(String.format("testing taxonomy %s", Instant.now().getNano())) .setDescription("taxonomy created for integration tests") .addActivatedPolicyTypes(PolicyType.FINE_GRAINED_ACCESS_CONTROL) .build()) From 2c9bc1bcd263cf9910001ebf259d12fd29f5a70b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:48:41 -0400 Subject: [PATCH 0683/2268] chore: Enable Size-Label bot in all googleapis Java repositories (#1381) (#1963) * chore: Enable Size-Label bot in all googleapis Java repositories Auto-label T-shirt size indicator should be assigned on every new pull request in all googleapis Java repositories * Remove product Remove product since it is by default true * add license header Co-authored-by: Neenu Shaji Source-Link: https://github.com/googleapis/synthtool/commit/54b2c6ac75370a4a3582431b4a3080f777ba1f11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:fc52b202aa298a50a12c64efd04fea3884d867947effe2fa85382a246c09e813 Co-authored-by: Owl Bot Co-authored-by: Neenu Shaji --- .github/.OwlBot.lock.yaml | 3 ++- .github/auto-label.yaml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .github/auto-label.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 426cf83e2e..f60d774937 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:b0b1c1c89570e229b1026372a2b8989ba31495007055b8d30178b7648503eefa + digest: sha256:fc52b202aa298a50a12c64efd04fea3884d867947effe2fa85382a246c09e813 +# created: 2022-04-06T16:30:03.627422514Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 0000000000..4caef688b7 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +requestsize: + enabled: true From 4ff65d6147c4dc4472a8adfb1840a1d5a3e5a044 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Apr 2022 18:10:11 +0200 Subject: [PATCH 0684/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220326-1.32.1 (#1964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220322-1.32.1` -> `v2-rev20220326-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220326-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220326-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220326-1.32.1/compatibility-slim/v2-rev20220322-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220326-1.32.1/confidence-slim/v2-rev20220322-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf1d804d64..cf4016f9ec 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220322-1.32.1 + v2-rev20220326-1.32.1 2.9.0 From c9fb53889c97234ba665a7b4f3d6ba52d4b787d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:44:13 +0000 Subject: [PATCH 0685/2268] chore(main): release 2.10.6 (#1965) :robot: I have created a release *beep* *boop* --- ### [2.10.6](https://github.com/googleapis/java-bigquery/compare/v2.10.5...v2.10.6) (2022-04-07) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220326-1.32.1 ([#1964](https://github.com/googleapis/java-bigquery/issues/1964)) ([4ff65d6](https://github.com/googleapis/java-bigquery/commit/4ff65d6147c4dc4472a8adfb1840a1d5a3e5a044)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6f061c94..2233081833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.10.6](https://github.com/googleapis/java-bigquery/compare/v2.10.5...v2.10.6) (2022-04-07) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220326-1.32.1 ([#1964](https://github.com/googleapis/java-bigquery/issues/1964)) ([4ff65d6](https://github.com/googleapis/java-bigquery/commit/4ff65d6147c4dc4472a8adfb1840a1d5a3e5a044)) + ### [2.10.5](https://github.com/googleapis/java-bigquery/compare/v2.10.4...v2.10.5) (2022-03-31) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ef7d8eb08d..09db7ee3b7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.6-SNAPSHOT + 2.10.6 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4d07b7d2b0..8982f70294 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.6-SNAPSHOT + 2.10.6 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.6-SNAPSHOT + 2.10.6 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cf4016f9ec..1734d40f46 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.6-SNAPSHOT + 2.10.6 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.6-SNAPSHOT + 2.10.6 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 447f578e18..209529a340 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.6-SNAPSHOT + 2.10.6 diff --git a/versions.txt b/versions.txt index c670001627..89d6c4b54a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.5:2.10.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.6:2.10.6 \ No newline at end of file From c527d836d6fe5b46ae8001e55a7ec5dc643cc6ca Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:06:19 +0000 Subject: [PATCH 0686/2268] chore(main): release 2.10.7-SNAPSHOT (#1966) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 09db7ee3b7..a3f400c101 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.6 + 2.10.7-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8982f70294..15b962e094 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.6 + 2.10.7-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.6 + 2.10.7-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1734d40f46..ff8e69827f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.6 + 2.10.7-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.6 + 2.10.7-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 209529a340..9818695423 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.6 + 2.10.7-SNAPSHOT diff --git a/versions.txt b/versions.txt index 89d6c4b54a..be069c16af 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.6:2.10.6 \ No newline at end of file +google-cloud-bigquery:2.10.6:2.10.7-SNAPSHOT \ No newline at end of file From ed8c1a3a22ee064dc50faed51318306170b51cc5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 17:28:17 +0200 Subject: [PATCH 0687/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.6 (#1967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.6 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6e5d6cd870..9220e08bd3 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.5 + 2.10.6 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.5' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.6' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.6" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index db59ee8691..e895c4af53 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.5 + 2.10.6 From 9f8265b452eb8ede6ae4972ea60b5be3df8a2be7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 17:28:30 +0200 Subject: [PATCH 0688/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.2 (#1968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e895c4af53..5793354b20 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.1 + 2.2.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9818695423..b86a9fcb18 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.1 + 2.2.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 01e2977f4c..57ea7abb3b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.1 + 2.2.2 test From f1c4b847a271a86bba7f123945515c721c3b9ae1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 17:28:49 +0200 Subject: [PATCH 0689/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.2 (#1969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5793354b20..28a3a61970 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.1 + 1.33.2 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b86a9fcb18..cbf8f48e0d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.1 + 1.33.2 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 57ea7abb3b..454f4abc85 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.1 + 1.33.2 com.google.oauth-client From 5e83e35190c29060d77183e832e64247f354d2e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 17:29:05 +0200 Subject: [PATCH 0690/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.2 (#1971) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.2 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ff8e69827f..8d16ba6d7b 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.7.1 + 1.7.2 pom import From 22fede57884f42001b3af91d5152a4da981d4fbc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 17:29:20 +0200 Subject: [PATCH 0691/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.2 (#1970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 28a3a61970..feb33fbe75 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.1 + 1.33.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cbf8f48e0d..9eaa760ad6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.1 + 1.33.2 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 454f4abc85..072ac96fed 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.1 + 1.33.2 From a4e96785895e966ac527481b7ce8837599327db6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 15:44:12 +0000 Subject: [PATCH 0692/2268] chore(main): release 2.10.7 (#1973) :robot: I have created a release *beep* *boop* --- ### [2.10.7](https://github.com/googleapis/java-bigquery/compare/v2.10.6...v2.10.7) (2022-04-08) ### Dependencies * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.2 ([#1969](https://github.com/googleapis/java-bigquery/issues/1969)) ([f1c4b84](https://github.com/googleapis/java-bigquery/commit/f1c4b847a271a86bba7f123945515c721c3b9ae1)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.2 ([#1970](https://github.com/googleapis/java-bigquery/issues/1970)) ([22fede5](https://github.com/googleapis/java-bigquery/commit/22fede57884f42001b3af91d5152a4da981d4fbc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2233081833..15e00891f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.10.7](https://github.com/googleapis/java-bigquery/compare/v2.10.6...v2.10.7) (2022-04-08) + + +### Dependencies + +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.2 ([#1969](https://github.com/googleapis/java-bigquery/issues/1969)) ([f1c4b84](https://github.com/googleapis/java-bigquery/commit/f1c4b847a271a86bba7f123945515c721c3b9ae1)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.2 ([#1970](https://github.com/googleapis/java-bigquery/issues/1970)) ([22fede5](https://github.com/googleapis/java-bigquery/commit/22fede57884f42001b3af91d5152a4da981d4fbc)) + ### [2.10.6](https://github.com/googleapis/java-bigquery/compare/v2.10.5...v2.10.6) (2022-04-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a3f400c101..b7a1547407 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.7-SNAPSHOT + 2.10.7 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 15b962e094..dc99bec7d5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.7-SNAPSHOT + 2.10.7 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.7-SNAPSHOT + 2.10.7 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8d16ba6d7b..70070720dd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.7-SNAPSHOT + 2.10.7 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.7-SNAPSHOT + 2.10.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9eaa760ad6..68f6877796 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.7-SNAPSHOT + 2.10.7 diff --git a/versions.txt b/versions.txt index be069c16af..18ea6ba95c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.6:2.10.7-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.7:2.10.7 \ No newline at end of file From 3c4d736234a0549f44a19e2020b32b7db0324248 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 8 Apr 2022 16:04:13 +0000 Subject: [PATCH 0693/2268] chore(main): release 2.10.8-SNAPSHOT (#1974) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b7a1547407..0b59ff743d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.7 + 2.10.8-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index dc99bec7d5..b539393d79 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.7 + 2.10.8-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.7 + 2.10.8-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 70070720dd..a1574dd56d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.7 + 2.10.8-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.7 + 2.10.8-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 68f6877796..179033a52c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.7 + 2.10.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index 18ea6ba95c..03fada45b2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.7:2.10.7 \ No newline at end of file +google-cloud-bigquery:2.10.7:2.10.8-SNAPSHOT \ No newline at end of file From eab45ff04c3fd6372c13f433d3047fdaff818785 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Apr 2022 21:07:45 +0200 Subject: [PATCH 0694/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.7 (#1975) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.7 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9220e08bd3..997add9ff3 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.6 + 2.10.7 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.6' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.7' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.6" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.7" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index feb33fbe75..62c6ecea32 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.6 + 2.10.7 From f9f7abdede91e8f780d5a60b6ee9a26e9316d04d Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 8 Apr 2022 16:23:03 -0400 Subject: [PATCH 0695/2268] chore: fix nightly samples check (#1976) * chore: fix nighly samples check * chore: test if teh new setup works * chore: add regular presubmit samples check --- .kokoro/continuous/java11-samples.cfg | 30 -------------- .kokoro/continuous/java8-samples.cfg | 33 --------------- .kokoro/nightly/java11-samples.cfg | 30 -------------- .kokoro/nightly/java8-samples.cfg | 33 --------------- .kokoro/presubmit/java11-samples.cfg | 30 -------------- .kokoro/presubmit/java8-samples.cfg | 33 --------------- .kokoro/presubmit/samples.cfg | 2 +- .kokoro/run_samples_resource_cleanup.sh | 4 ++ .kokoro/run_samples_tests.sh | 55 ------------------------- owlbot.py | 9 +--- 10 files changed, 7 insertions(+), 252 deletions(-) delete mode 100644 .kokoro/continuous/java11-samples.cfg delete mode 100644 .kokoro/continuous/java8-samples.cfg delete mode 100644 .kokoro/nightly/java11-samples.cfg delete mode 100644 .kokoro/nightly/java8-samples.cfg delete mode 100644 .kokoro/presubmit/java11-samples.cfg delete mode 100644 .kokoro/presubmit/java8-samples.cfg delete mode 100755 .kokoro/run_samples_tests.sh diff --git a/.kokoro/continuous/java11-samples.cfg b/.kokoro/continuous/java11-samples.cfg deleted file mode 100644 index 0d0a7a3297..0000000000 --- a/.kokoro/continuous/java11-samples.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -# Tell the trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} \ No newline at end of file diff --git a/.kokoro/continuous/java8-samples.cfg b/.kokoro/continuous/java8-samples.cfg deleted file mode 100644 index f3c1f7aaab..0000000000 --- a/.kokoro/continuous/java8-samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -# Tell trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} - - - diff --git a/.kokoro/nightly/java11-samples.cfg b/.kokoro/nightly/java11-samples.cfg deleted file mode 100644 index 0d0a7a3297..0000000000 --- a/.kokoro/nightly/java11-samples.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -# Tell the trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} \ No newline at end of file diff --git a/.kokoro/nightly/java8-samples.cfg b/.kokoro/nightly/java8-samples.cfg deleted file mode 100644 index f3c1f7aaab..0000000000 --- a/.kokoro/nightly/java8-samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -# Tell trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} - - - diff --git a/.kokoro/presubmit/java11-samples.cfg b/.kokoro/presubmit/java11-samples.cfg deleted file mode 100644 index 0d0a7a3297..0000000000 --- a/.kokoro/presubmit/java11-samples.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -# Tell the trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} \ No newline at end of file diff --git a/.kokoro/presubmit/java8-samples.cfg b/.kokoro/presubmit/java8-samples.cfg deleted file mode 100644 index f3c1f7aaab..0000000000 --- a/.kokoro/presubmit/java8-samples.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -# Download secrets from Cloud Storage. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -# Tell trampoline which tests to run. -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/run_samples_tests.sh" -} - - - diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg index 01e0960047..b14a33856e 100644 --- a/.kokoro/presubmit/samples.cfg +++ b/.kokoro/presubmit/samples.cfg @@ -29,5 +29,5 @@ env_vars: { env_vars: { key: "SECRET_MANAGER_KEYS" - value: "java-docs-samples-service-account" + value: "java-docs-samples-service-account, java-bigquery-samples-secrets" } \ No newline at end of file diff --git a/.kokoro/run_samples_resource_cleanup.sh b/.kokoro/run_samples_resource_cleanup.sh index e04daf3c64..4f89485f8b 100755 --- a/.kokoro/run_samples_resource_cleanup.sh +++ b/.kokoro/run_samples_resource_cleanup.sh @@ -30,6 +30,10 @@ source ${scriptDir}/common.sh # Setup required env variables source ${KOKORO_GFILE_DIR}/secret_manager/java-bigquery-samples-secrets +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi echo "********** Successfully Set All Environment Variables **********" # Move into the samples directory diff --git a/.kokoro/run_samples_tests.sh b/.kokoro/run_samples_tests.sh deleted file mode 100755 index 02038d8f3c..0000000000 --- a/.kokoro/run_samples_tests.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# `-e` enables the script to automatically fail when a command fails -# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero -set -eo pipefail - -echo "********** MAVEN INFO ***********" -mvn -v - -# Get the directory of the build script -scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) -## cd to the parent directory, i.e. the root of the git repo -cd ${scriptDir}/.. - -# include common functions -source ${scriptDir}/common.sh - -# Setup required env variables -source ${KOKORO_GFILE_DIR}/bigquery_secrets.txt -echo "********** Successfully Set All Environment Variables **********" - -# Attempt to install 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C - -# Activate service account -gcloud auth activate-service-account \ - --key-file="$GOOGLE_APPLICATION_CREDENTIALS" \ - --project="$GOOGLE_CLOUD_PROJECT" - -# Move into the samples directory -cd samples/ - -echo -e "\n******************** RUNNING SAMPLE TESTS ********************" - -mvn --fail-at-end clean verify \ No newline at end of file diff --git a/owlbot.py b/owlbot.py index f514ca823d..106a89a3bd 100644 --- a/owlbot.py +++ b/owlbot.py @@ -17,14 +17,9 @@ import synthtool.languages.java as java java.common_templates(excludes=[ - '.kokoro/continuous/java8-samples.cfg', - '.kokoro/continuous/java11-samples.cfg', - '.kokoro/nightly/java8-samples.cfg', - '.kokoro/nightly/java11-samples.cfg', '.kokoro/nightly/samples.cfg', - '.kokoro/presubmit/java8-samples.cfg', - '.kokoro/presubmit/java11-samples.cfg', + '.kokoro/presubmit/samples.cfg', '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', -]) +]) \ No newline at end of file From a24ce6ead65f3fceff6573e24c10c324650d907b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 14 Apr 2022 15:10:12 +0200 Subject: [PATCH 0696/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.3 (#1978) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.oauth-client:google-oauth-client-jetty](https://togithub.com/googleapis/google-oauth-java-client) | `1.33.2` -> `1.33.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/compatibility-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/confidence-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/google-oauth-java-client ### [`v1.33.3`](https://togithub.com/googleapis/google-oauth-java-client/blob/HEAD/CHANGELOG.md#​1333-httpsgithubcomgoogleapisgoogle-oauth-java-clientcomparev1332v1333-2022-04-13) [Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.33.2...v1.33.3)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 62c6ecea32..2fbe62d63c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.2 + 1.33.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 179033a52c..c74e52ebd0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.2 + 1.33.3 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 072ac96fed..875175504b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.2 + 1.33.3 From b08479180e212bccae166f3a675d46fb658d3ce8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 14 Apr 2022 15:10:16 +0200 Subject: [PATCH 0697/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.3 (#1977) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.oauth-client:google-oauth-client-java6](https://togithub.com/googleapis/google-oauth-java-client) | `1.33.2` -> `1.33.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/compatibility-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/confidence-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/google-oauth-java-client ### [`v1.33.3`](https://togithub.com/googleapis/google-oauth-java-client/blob/HEAD/CHANGELOG.md#​1333-httpsgithubcomgoogleapisgoogle-oauth-java-clientcomparev1332v1333-2022-04-13) [Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.33.2...v1.33.3)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2fbe62d63c..95115402ce 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.2 + 1.33.3 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c74e52ebd0..7bda0e2dac 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.2 + 1.33.3 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 875175504b..d75d36445c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.2 + 1.33.3 com.google.oauth-client From e113120560a2849717e5a3598cb51d6854cd1e1c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 13:26:36 +0000 Subject: [PATCH 0698/2268] chore(main): release 2.10.8 (#1979) :robot: I have created a release *beep* *boop* --- ### [2.10.8](https://github.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8) (2022-04-14) ### Dependencies * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.3 ([#1977](https://github.com/googleapis/java-bigquery/issues/1977)) ([b084791](https://github.com/googleapis/java-bigquery/commit/b08479180e212bccae166f3a675d46fb658d3ce8)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.3 ([#1978](https://github.com/googleapis/java-bigquery/issues/1978)) ([a24ce6e](https://github.com/googleapis/java-bigquery/commit/a24ce6ead65f3fceff6573e24c10c324650d907b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e00891f2..4994271918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.10.8](https://github.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8) (2022-04-14) + + +### Dependencies + +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.3 ([#1977](https://github.com/googleapis/java-bigquery/issues/1977)) ([b084791](https://github.com/googleapis/java-bigquery/commit/b08479180e212bccae166f3a675d46fb658d3ce8)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.3 ([#1978](https://github.com/googleapis/java-bigquery/issues/1978)) ([a24ce6e](https://github.com/googleapis/java-bigquery/commit/a24ce6ead65f3fceff6573e24c10c324650d907b)) + ### [2.10.7](https://github.com/googleapis/java-bigquery/compare/v2.10.6...v2.10.7) (2022-04-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0b59ff743d..d8722a1e6b 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.8-SNAPSHOT + 2.10.8 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b539393d79..5013cc80d2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.8-SNAPSHOT + 2.10.8 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.8-SNAPSHOT + 2.10.8 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a1574dd56d..4625caae25 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.8-SNAPSHOT + 2.10.8 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.8-SNAPSHOT + 2.10.8 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7bda0e2dac..4104c783df 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.8-SNAPSHOT + 2.10.8 diff --git a/versions.txt b/versions.txt index 03fada45b2..1490c80547 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.7:2.10.8-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.8:2.10.8 \ No newline at end of file From 9cefa4b16bb4eb92d4a3bc7ba55b5a837ce328a6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 18:50:26 -0400 Subject: [PATCH 0699/2268] chore(main): release 2.10.9-SNAPSHOT (#1980) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d8722a1e6b..e9466fcb91 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.8 + 2.10.9-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5013cc80d2..819df13b38 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.8 + 2.10.9-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.8 + 2.10.9-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4625caae25..0ccadebe66 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.8 + 2.10.9-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.8 + 2.10.9-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4104c783df..eb3aa78bde 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.8 + 2.10.9-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1490c80547..b771ef888e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.8:2.10.8 \ No newline at end of file +google-cloud-bigquery:2.10.8:2.10.9-SNAPSHOT \ No newline at end of file From 04f4679fe376e726b21e313115bfd48adc6cbe6b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Apr 2022 21:32:27 +0200 Subject: [PATCH 0700/2268] deps: update dependency com.google.cloud:native-image-support to v0.13.1 (#1982) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:native-image-support](https://togithub.com/googleapis/java-core) | `0.12.11` -> `0.13.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/compatibility-slim/0.12.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/confidence-slim/0.12.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 997add9ff3..6b8f45c204 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.7' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.8' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.7" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.8" ``` ## Authentication diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index f4893182a9..4d22a0c992 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ com.google.cloud native-image-support - 0.12.11 + 0.13.1 org.junit.vintage From ac7e2e8ad59a3026cdf82fc986cc2e2645ae1dff Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Apr 2022 21:40:28 +0200 Subject: [PATCH 0701/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.8 (#1981) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.7` -> `2.10.8` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/compatibility-slim/2.10.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/confidence-slim/2.10.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.8`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2108-httpsgithubcomgoogleapisjava-bigquerycomparev2107v2108-2022-04-14) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b8f45c204..f0e0c10530 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.7 + 2.10.8 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 95115402ce..5e342ab797 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.7 + 2.10.8 From 50ac31c598ae8c5aa4e1f6dcde80da704db904a5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Apr 2022 21:44:30 +0200 Subject: [PATCH 0702/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 (#1983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.9.0` -> `2.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v2.10.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​2100-httpsgithubcomgoogleapisjava-shared-dependenciescomparev290v2100-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.9.0...v2.10.0) ##### Dependencies - google-cloud-core 2.6.0 ([#​668](https://togithub.com/googleapis/java-shared-dependencies/issues/668)) ([22f4d18](https://togithub.com/googleapis/java-shared-dependencies/commit/22f4d1809cbb9848174b3569ab527e4bef00d443)) - reverting protobuf to 3.19.4 ([#​657](https://togithub.com/googleapis/java-shared-dependencies/issues/657)) ([8501e6d](https://togithub.com/googleapis/java-shared-dependencies/commit/8501e6d842c10d2370bbd5d5246070134336bddd)) - update dependency com.fasterxml.jackson:jackson-bom to v2.13.2.20220328 ([#​646](https://togithub.com/googleapis/java-shared-dependencies/issues/646)) ([7bfd6d7](https://togithub.com/googleapis/java-shared-dependencies/commit/7bfd6d7073859d1955b91b368c6713a72ffa14b6)) - update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#​662](https://togithub.com/googleapis/java-shared-dependencies/issues/662)) ([1b8e378](https://togithub.com/googleapis/java-shared-dependencies/commit/1b8e378fe0ccf2a28c759868caaf5ba593a95728)) - update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#​652](https://togithub.com/googleapis/java-shared-dependencies/issues/652)) ([1cc80ee](https://togithub.com/googleapis/java-shared-dependencies/commit/1cc80ee984ebcad9bc2a95e2f28c0a49fe924b37)) - update dependency com.google.errorprone:error_prone_annotations to v2.13.0 ([#​669](https://togithub.com/googleapis/java-shared-dependencies/issues/669)) ([61b7834](https://togithub.com/googleapis/java-shared-dependencies/commit/61b78341b34a251722be4805a6bdd895cd64836c)) - update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#​654](https://togithub.com/googleapis/java-shared-dependencies/issues/654)) ([140ef40](https://togithub.com/googleapis/java-shared-dependencies/commit/140ef405bc17ed83f5ce177df59affca14fbe49c)) - update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#​658](https://togithub.com/googleapis/java-shared-dependencies/issues/658)) ([f6f93e5](https://togithub.com/googleapis/java-shared-dependencies/commit/f6f93e5b9172c9684623c4c148e4a8fe2fae1e94)) - update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.2 ([#​655](https://togithub.com/googleapis/java-shared-dependencies/issues/655)) ([20cd9ed](https://togithub.com/googleapis/java-shared-dependencies/commit/20cd9eda112c96836a5ab7485a4247ed2bc0edb8)) - update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.3 ([#​663](https://togithub.com/googleapis/java-shared-dependencies/issues/663)) ([f011a46](https://togithub.com/googleapis/java-shared-dependencies/commit/f011a46c551dba16851b4f8c919c40452fc5d5c3)) - update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#​651](https://togithub.com/googleapis/java-shared-dependencies/issues/651)) ([ad2ff73](https://togithub.com/googleapis/java-shared-dependencies/commit/ad2ff73207dd6493321c77d8eca0022baf13b4ce)) - update dependency io.grpc:grpc-bom to v1.45.1 ([#​647](https://togithub.com/googleapis/java-shared-dependencies/issues/647)) ([38e46fc](https://togithub.com/googleapis/java-shared-dependencies/commit/38e46fc4f03af0a02f30ce4a2fa222c71797ae15)) - update dependency org.checkerframework:checker-qual to v3.21.4 ([#​650](https://togithub.com/googleapis/java-shared-dependencies/issues/650)) ([125e80a](https://togithub.com/googleapis/java-shared-dependencies/commit/125e80ab2c3225a00c03f5ff5de94872ebb94303)) - update gax.version to v2.15.0 ([#​649](https://togithub.com/googleapis/java-shared-dependencies/issues/649)) ([c7f32a6](https://togithub.com/googleapis/java-shared-dependencies/commit/c7f32a68b14520104432282ac9598643700162eb)) - update gax.version to v2.16.0 ([#​664](https://togithub.com/googleapis/java-shared-dependencies/issues/664)) ([caaf941](https://togithub.com/googleapis/java-shared-dependencies/commit/caaf941643af04295f5527a0144587d7bf040862)) - update google.common-protos.version to v2.8.1 ([#​656](https://togithub.com/googleapis/java-shared-dependencies/issues/656)) ([df4a4a2](https://togithub.com/googleapis/java-shared-dependencies/commit/df4a4a2130a3cdb2965ea42962d1ea6a85506ba7)) - update google.common-protos.version to v2.8.2 ([#​659](https://togithub.com/googleapis/java-shared-dependencies/issues/659)) ([b499e2b](https://togithub.com/googleapis/java-shared-dependencies/commit/b499e2bc99506d48d26e35bf6e68c09409ce8b11)) - update google.common-protos.version to v2.8.3 ([#​660](https://togithub.com/googleapis/java-shared-dependencies/issues/660)) ([461081c](https://togithub.com/googleapis/java-shared-dependencies/commit/461081c0cf73057c1f6e07fc573453ad467a60ae)) - update iam.version to v1.3.0 ([#​648](https://togithub.com/googleapis/java-shared-dependencies/issues/648)) ([6670c4f](https://togithub.com/googleapis/java-shared-dependencies/commit/6670c4f61fcf075c543bfd148eea49796e0662ce)) - update iam.version to v1.3.1 ([#​661](https://togithub.com/googleapis/java-shared-dependencies/issues/661)) ([cc8fbe6](https://togithub.com/googleapis/java-shared-dependencies/commit/cc8fbe6eae03341c2ece7d3356febc843a74a812))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ccadebe66..bf5fabe353 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220326-1.32.1 - 2.9.0 + 2.10.0
    From b9f75e236228e50964e5943b50d5984d64a477d4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 16 Apr 2022 06:20:10 +0200 Subject: [PATCH 0703/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.3 (#1986) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5e342ab797..0b58b476e8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.2 + 2.2.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index eb3aa78bde..e86e6d5ec0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.2 + 2.2.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d75d36445c..b95964164f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.2 + 2.2.3 test From 2c5646861a13f7c21e872ecb625ae7b0e6fc54b1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 16 Apr 2022 06:21:35 +0200 Subject: [PATCH 0704/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.3 (#1987) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bf5fabe353..28084fd807 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.7.2 + 1.7.3 pom import From d60c137cd86ce1834e9ac47f287b9c93ccf50b42 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 16 Apr 2022 04:36:21 +0000 Subject: [PATCH 0705/2268] chore(main): release 2.10.9 (#1984) :robot: I have created a release *beep* *boop* --- ### [2.10.9](https://github.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9) (2022-04-16) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#1983](https://github.com/googleapis/java-bigquery/issues/1983)) ([50ac31c](https://github.com/googleapis/java-bigquery/commit/50ac31c598ae8c5aa4e1f6dcde80da704db904a5)) * update dependency com.google.cloud:native-image-support to v0.13.1 ([#1982](https://github.com/googleapis/java-bigquery/issues/1982)) ([04f4679](https://github.com/googleapis/java-bigquery/commit/04f4679fe376e726b21e313115bfd48adc6cbe6b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4994271918..d49ced0dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.10.9](https://github.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9) (2022-04-16) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#1983](https://github.com/googleapis/java-bigquery/issues/1983)) ([50ac31c](https://github.com/googleapis/java-bigquery/commit/50ac31c598ae8c5aa4e1f6dcde80da704db904a5)) +* update dependency com.google.cloud:native-image-support to v0.13.1 ([#1982](https://github.com/googleapis/java-bigquery/issues/1982)) ([04f4679](https://github.com/googleapis/java-bigquery/commit/04f4679fe376e726b21e313115bfd48adc6cbe6b)) + ### [2.10.8](https://github.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8) (2022-04-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e9466fcb91..2829ff7639 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.9-SNAPSHOT + 2.10.9 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 819df13b38..6f600d7686 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.9-SNAPSHOT + 2.10.9 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.9-SNAPSHOT + 2.10.9 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 28084fd807..6cad60a404 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.9-SNAPSHOT + 2.10.9 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.9-SNAPSHOT + 2.10.9 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e86e6d5ec0..09c41694cc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.9-SNAPSHOT + 2.10.9 diff --git a/versions.txt b/versions.txt index b771ef888e..aa4bc48eb1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.8:2.10.9-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.9:2.10.9 \ No newline at end of file From 8709c9eb6f689f448412d3a5e1f5bd9d555796c7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 16 Apr 2022 04:50:20 +0000 Subject: [PATCH 0706/2268] chore(main): release 2.10.10-SNAPSHOT (#1988) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2829ff7639..ba3e3e0a10 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.9 + 2.10.10-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6f600d7686..0652faf805 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.9 + 2.10.10-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.9 + 2.10.10-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6cad60a404..958753c48d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.9 + 2.10.10-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.9 + 2.10.10-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 09c41694cc..82f7cf3d81 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.9 + 2.10.10-SNAPSHOT diff --git a/versions.txt b/versions.txt index aa4bc48eb1..4f7ca68b91 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.9:2.10.9 \ No newline at end of file +google-cloud-bigquery:2.10.9:2.10.10-SNAPSHOT \ No newline at end of file From d0823c1e1f99f22cbe42f99ed719e88c717e7011 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Apr 2022 17:40:39 +0200 Subject: [PATCH 0707/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.9 (#1989) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.8` -> `2.10.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/compatibility-slim/2.10.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/confidence-slim/2.10.8)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.9`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2109-httpsgithubcomgoogleapisjava-bigquerycomparev2108v2109-2022-04-16) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f0e0c10530..0616bfdbd0 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.8 + 2.10.9 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.8' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.9' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.8" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.9" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0b58b476e8..85acf0b23d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.8 + 2.10.9 From e02bf315737dba50741c1346af8bde6871cb857a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Apr 2022 23:14:26 +0200 Subject: [PATCH 0708/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.6.1 (#1991) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.6.0` -> `2.6.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/compatibility-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/confidence-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.6.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​261-httpsgithubcomgoogleapisjava-storagecomparev260v261-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.6.0...v2.6.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 958753c48d..27aac6fae5 100644 --- a/pom.xml +++ b/pom.xml @@ -135,7 +135,7 @@ com.google.cloud google-cloud-storage - 2.6.0 + 2.6.1 test From 4c1cb4c13214556b706f1ff8c50a46f881bf2724 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Apr 2022 23:14:30 +0200 Subject: [PATCH 0709/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.6.2 (#1990) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.6.1` -> `2.6.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/compatibility-slim/2.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/confidence-slim/2.6.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.6.2`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​262-httpsgithubcomgoogleapisjava-bigtablecomparev261v262-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.6.1...v2.6.2)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 85acf0b23d..24a0de4729 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.6.1 + 2.6.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 82f7cf3d81..1057e87933 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.6.1 + 2.6.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b95964164f..25edf810da 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.6.1 + 2.6.2 test From ef3c321b146ffff09d9f0edadc5823a34d25d15f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 21:36:15 +0000 Subject: [PATCH 0710/2268] chore(main): release 2.10.10 (#1992) :robot: I have created a release *beep* *boop* --- ### [2.10.10](https://github.com/googleapis/java-bigquery/compare/v2.10.9...v2.10.10) (2022-04-18) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.6.2 ([#1990](https://github.com/googleapis/java-bigquery/issues/1990)) ([4c1cb4c](https://github.com/googleapis/java-bigquery/commit/4c1cb4c13214556b706f1ff8c50a46f881bf2724)) * update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#1991](https://github.com/googleapis/java-bigquery/issues/1991)) ([e02bf31](https://github.com/googleapis/java-bigquery/commit/e02bf315737dba50741c1346af8bde6871cb857a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d49ced0dc6..f172457088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.10.10](https://github.com/googleapis/java-bigquery/compare/v2.10.9...v2.10.10) (2022-04-18) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.6.2 ([#1990](https://github.com/googleapis/java-bigquery/issues/1990)) ([4c1cb4c](https://github.com/googleapis/java-bigquery/commit/4c1cb4c13214556b706f1ff8c50a46f881bf2724)) +* update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#1991](https://github.com/googleapis/java-bigquery/issues/1991)) ([e02bf31](https://github.com/googleapis/java-bigquery/commit/e02bf315737dba50741c1346af8bde6871cb857a)) + ### [2.10.9](https://github.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9) (2022-04-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ba3e3e0a10..0c2783263f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.10-SNAPSHOT + 2.10.10 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0652faf805..c963fe70e2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.10-SNAPSHOT + 2.10.10 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.10-SNAPSHOT + 2.10.10 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 27aac6fae5..b81b23d2a8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.10-SNAPSHOT + 2.10.10 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.10-SNAPSHOT + 2.10.10 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1057e87933..ba4b018979 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.10-SNAPSHOT + 2.10.10 diff --git a/versions.txt b/versions.txt index 4f7ca68b91..f0ae8a52eb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.9:2.10.10-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.10.10:2.10.10 \ No newline at end of file From b3825584192e1d7fdbc70a7775fd9b3457469577 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 21:54:12 +0000 Subject: [PATCH 0711/2268] chore(main): release 2.10.11-SNAPSHOT (#1993) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0c2783263f..10f47165e2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.10 + 2.10.11-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c963fe70e2..93d5747840 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.10 + 2.10.11-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.10 + 2.10.11-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b81b23d2a8..66d1915f92 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.10 + 2.10.11-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -84,7 +84,7 @@ com.google.cloud google-cloud-bigquery - 2.10.10 + 2.10.11-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ba4b018979..2d7044933c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.10 + 2.10.11-SNAPSHOT diff --git a/versions.txt b/versions.txt index f0ae8a52eb..ad1668e67d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.10:2.10.10 \ No newline at end of file +google-cloud-bigquery:2.10.10:2.10.11-SNAPSHOT \ No newline at end of file From 6fe715cb053295ab9dae32bc7369cc28da11b119 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Apr 2022 04:14:40 +0200 Subject: [PATCH 0712/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 (#1995) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0616bfdbd0..cc3ab5f442 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.9 + 2.10.10 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.9' +implementation 'com.google.cloud:google-cloud-bigquery:2.10.10' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.9" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.10" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 24a0de4729..9d69b79099 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.9 + 2.10.10 From f716427490d4b87573669ab4338335c0844e82c0 Mon Sep 17 00:00:00 2001 From: Prashant Mishra Date: Tue, 19 Apr 2022 20:49:54 +0530 Subject: [PATCH 0713/2268] feat: next release from main branch is 2.10.9 (#1996) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index 473d7f07c4..c87ad8d73c 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -11,6 +11,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.3.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.10.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 960ae2ba05..1bede3ce68 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -62,6 +62,21 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor + - pattern: 2.10.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor permissionRules: - team: api-bigquery permission: admin From 1790ac4b54eca038b32a9e26b42a3df5fc77d4df Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Apr 2022 18:39:26 +0200 Subject: [PATCH 0714/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.3.3 (#2000) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 66d1915f92..7cf4408ac7 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.3.2 + 1.3.3 From 47d0946fb0c4e9cc5be7d267fd753c019d6e0379 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Apr 2022 22:31:03 +0200 Subject: [PATCH 0715/2268] test(deps): update dependency org.mockito:mockito-core to v4.5.0 (#1999) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7cf4408ac7..052dd3a777 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ org.mockito mockito-core - 4.4.0 + 4.5.0 test From 3c4e0e3503260435c3451885d2f5f6f3448c973c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 21 Apr 2022 16:28:57 +0200 Subject: [PATCH 0716/2268] test(deps): update dependency org.mockito:mockito-core to v4.5.1 (#2003) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 052dd3a777..2d45998cbe 100644 --- a/pom.xml +++ b/pom.xml @@ -129,7 +129,7 @@ org.mockito mockito-core - 4.5.0 + 4.5.1 test From ace01e1736a2da6d6c510624cf8cec1e2e4b4bce Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 21 Apr 2022 16:29:12 +0200 Subject: [PATCH 0717/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.0 (#2002) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2d45998cbe..1f12a0b691 100644 --- a/pom.xml +++ b/pom.xml @@ -184,7 +184,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.2 + 3.4.0 html From 828f2cd150a207055a76935a302f1b43c5efa29b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 21 Apr 2022 19:42:31 +0200 Subject: [PATCH 0718/2268] build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.13 (#2004) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.sonatype.plugins:nexus-staging-maven-plugin](http://www.sonatype.com/) ([source](https://togithub.com/sonatype/nexus-maven-plugins)) | `1.6.12` -> `1.6.13` | [![age](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/compatibility-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/confidence-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    sonatype/nexus-maven-plugins ### [`v1.6.13`](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13) [Compare Source](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 10f47165e2..db892112cb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -83,7 +83,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.12 + 1.6.13 true diff --git a/samples/pom.xml b/samples/pom.xml index 4e280e644d..cb1ba78020 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -63,7 +63,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.12 + 1.6.13 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 25edf810da..ff98571aae 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -117,7 +117,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.12 + 1.6.13 true From 7b2236ee80a4050d0d96933a1a254349b2a40702 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Apr 2022 16:12:21 +0200 Subject: [PATCH 0719/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.4 (#2006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.2.3` -> `2.2.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/compatibility-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/confidence-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.2.4`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​224-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev223v224-2022-04-21) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.2.3...v2.2.4)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9d69b79099..4b298cce87 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.3 + 2.2.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2d7044933c..befe436180 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.3 + 2.2.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ff98571aae..de7bbfd746 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.3 + 2.2.4 test From aa2830d5d5772b0d5f611ca526d7f2ff0972f2a6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Apr 2022 21:07:35 +0200 Subject: [PATCH 0720/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v25.2.0 (#2008) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v25.2.0 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc3ab5f442..8589bfc2b4 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 25.1.0 + 25.2.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:25.1.0') +implementation platform('com.google.cloud:libraries-bom:25.2.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 4d22a0c992..a8955f889f 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 25.1.0 + 25.2.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index de7bbfd746..26550a1c5b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 25.1.0 + 25.2.0 pom import From e2e91133718d41349a94b5d93d66699e84233e64 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 27 Apr 2022 15:50:24 -0400 Subject: [PATCH 0721/2268] docs(sample): remove unused dependency and add setup instructions (#2010) --- samples/native-image-sample/README.md | 37 ++++++++++++++++++++++++++- samples/native-image-sample/pom.xml | 5 ---- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md index e4e4b52eeb..8d7bce6589 100644 --- a/samples/native-image-sample/README.md +++ b/samples/native-image-sample/README.md @@ -4,7 +4,42 @@ The BigQuery sample application demonstrates some common operations with [Google ## Setup Instructions -1. Follow the [GCP Project Authentication and Native Image Setup Instructions](../../README.md). +## Setup Instructions + +You will need to follow these prerequisite steps in order to run the samples: + +1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). + +2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials. + + Once installed, log in with Application Default Credentials using the following command: + + ``` + gcloud auth application-default login + ``` + + **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use. + +3. Install the native image compiler. + + You can follow [the installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm) from the GraalVM website. + After following the instructions, ensure that you install the native image extension installed by running: + + ``` + gu install native-image + ``` + + Once you finish following the instructions, verify that the default version of Java is set to the GraalVM version by running `java -version` in a terminal. + + You will see something similar to the below output: + + ``` + $ java -version + + openjdk version "11.0.7" 2020-04-14 + OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02) + OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing) + ``` 2. [Enable the BigQuery APIs](https://console.cloud.google.com/apis/api/bigquery.googleapis.com). diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index a8955f889f..de1ea6adf7 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -90,11 +90,6 @@ native - - com.google.cloud - native-image-support - 0.13.1 - org.junit.vintage junit-vintage-engine From 56988a563d9395e405eaa45003c8cf7a1ad94435 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 28 Apr 2022 17:33:10 +0200 Subject: [PATCH 0722/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.3.0 (#2011) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f12a0b691..8bde21742f 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.2.2 + 3.3.0 From a8eb755cda581157bfdd79538c4b256dc0db0238 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Thu, 28 Apr 2022 11:44:40 -0700 Subject: [PATCH 0723/2268] chore: IT clean-up (#2012) Fixes #1924 Per discussion in b/227623980 --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c8f7ce4fa3..f3b60cebe7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3029,9 +3029,6 @@ public void testSnapshotTableCopyJob() throws InterruptedException { assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); Table remoteTable = bigquery.getTable(DATASET, sourceTableName); assertNotNull(remoteTable); - // StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); - // TableInfo tableInfo = TableInfo.of(sourceTableId, tableDefinition); - // Table createdTable = bigquery.create(tableInfo); // Create snapshot table using source table as the base table TableId snapshotTableId = TableId.of(DATASET, snapshotTableName); @@ -3066,10 +3063,6 @@ public void testSnapshotTableCopyJob() throws InterruptedException { .build(); Job createdRestoreJob = bigquery.create(JobInfo.of(restoreConfiguration)); CopyJobConfiguration createdRestoreConfiguration = createdRestoreJob.getConfiguration(); - // TODO: uncomment/modify below when b/227623980 is resolved - // assertEquals( - // restoreConfiguration.getSourceTables().get(0).getTable(), - // createdRestoreConfiguration.getSourceTables().get(0).getTable()); assertEquals( restoreConfiguration.getOperationType(), createdRestoreConfiguration.getOperationType()); assertEquals( From 086e97e519b7db55402a17727ccf87a28bf91dc0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 28 Apr 2022 23:45:47 +0200 Subject: [PATCH 0724/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.4.0 (#2013) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8bde21742f..d4961f44f0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.3.3 + 1.4.0 From 06cbe69112e3e0d31e4fb90e43dca6e6dc4f1bdf Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 2 May 2022 10:51:50 -0400 Subject: [PATCH 0725/2268] fix: add native image configuration for Arrow (#2018) --- .../google-cloud-bigquery/reflect-config.json | 10 ++++++++++ .../google-cloud-bigquery/resource-config.json | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json create mode 100644 google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json new file mode 100644 index 0000000000..f2190122d7 --- /dev/null +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json @@ -0,0 +1,10 @@ +[ + { + "name":"io.netty.buffer.AbstractByteBufAllocator", + "queryAllDeclaredMethods":true + }, + { + "name":"org.apache.arrow.memory.DefaultAllocationManagerFactory", + "fields":[{"name":"FACTORY"}] + } +] \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json new file mode 100644 index 0000000000..dfdcc58c44 --- /dev/null +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json @@ -0,0 +1,6 @@ +{ + "resources":{ + "includes":[{ + "pattern":"\\Qorg/apache/arrow/memory/DefaultAllocationManagerFactory.class\\E" + }]} +} \ No newline at end of file From b9fa786ad1bca2fb763a146fa3bb431ff6860153 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 2 May 2022 16:52:10 +0200 Subject: [PATCH 0726/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220422-1.32.1 (#2017) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d4961f44f0..ad88672200 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220326-1.32.1 + v2-rev20220422-1.32.1 2.10.0
    From 380427511b33938209241f3800bff05914957f2b Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 6 May 2022 05:33:08 -0700 Subject: [PATCH 0727/2268] feat: add Connection interface (#1374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * manage dependencies * manage dependencies * update pagination logic * Minor cleanup * Updated the bufferSize * Added testBQResultSetPagination * refactored processQueryResponseResults * updated testBQResultSetPagination to use generated table * implemented a child thread for fetching next page * Adding processQueryResponseResults2 (Independent pageFetcher and producer threads) * Adding processQueryResponseResults2 (Independent pageFetcher and producer threads) * nit: correct Javadoc * Added getPageCacheSize for dynamically computing the size of pageCache * Fixed NPE @ getPageCacheSize * Refactored - Renamed processQueryResponseResults methods * Refactored - exception handling for processQueryResponseResults * Added testConnectionCancel for testing ConnectionImpl.cancel * Added ConnectionImpl.cancel implementation and the interrupt logic in processQueryResponseResults * Lint * Commented testConnectionCancel - Need to update the Cancel Method logic * Implemented processQueryResponseResults_thread_pooled * nit: rename a few vars * Uncommented testConnectionCancel * Cleaned processQueryResponseResults. Removed unused methods. Implemented ThreadPool * Cleaned processQueryResponseResults. Removed unused methods. Implemented ThreadPool * add sessions support and BigQueryResultSetStats interface and impl * add BigQueryResultSetStats to getQueryResults path; refactor jobs.get rpc call method * feat: add support for BI Engine Statistics fixes b/205146044 * Updated pageCacheSize and buffer's size between a MIN and MAX bound. * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Refactored processQueryResponseResults to avoid code duplicity. Added upper bound for the buffer size * Implemented processGetQueryResponseResults(results, jobId) & Refactored the code * Implemented BigQueryDryRunResultImpl * implemented dryRun * Implemented execute select logic when the FastQuery is not Supported * added null check at useReadAPI * Added BQResultSet Test cases * code cleanup and refactoring * add import * additional lint * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add test requirements * add dryRun implementation * Added schema check @ testConnectionImplDryRun * Added schema check @ testConnectionImplDryRun * Added Java Doc, Removed commented code of processGetQueryResults * Added SetUp and testExecuteSelect * Exposing processQueryResponseResults for testing * Exposing processQueryResponseResults for testing * Added testFastQueryMultiplePages and testCancel * Added testQueryDryRun * Exposing Async methods for testing * Exposing Async methods for testing * Exposing tableDataListRpc for testing * Exposed tableDataListRpc for testing * Added testcases for the 3 async methods * Exposing getQueryResultsFirstPage, isFastQuerySupported and getSubsequentQueryResultsWithJob for testing * Exposing getQueryResultsFirstPage, isFastQuerySupported and getSubsequentQueryResultsWithJob for testing * Added testGetQueryResultsFirstPage and testLegacyQuerySinglePage testcases + Minor refactor * Deleted TODO * Exposed getDestinationTable and tableDataList for testing * Exposed getDestinationTable and tableDataList for testing * Added testFastQueryLongRunning testcase * Added testLegacyQueryMultiplePages * Added BigqueryStorage and Arrow's dependencies * Added draft impl for highThroughPutRead * resolve dependency issues * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Added Attribute to for ArrowSchema * updated highThroughPutRead * Revert "Added Attribute to for ArrowSchema" This reverts commit 3297e4d09f12e2f12cd48e2e2927e880342dc1ea. * composed BigQueryResultSetImpl with all the params * Added parsing logic for ArrowVectors * Update processRows * updated next methods and getters for 3 data types * Added translateAndThrow(Exception ex) * Refactored processRows, added exception handling * Added arrow-memory-netty * Updated highThroughPutRead - Code fix and refactoring * clean up Connection.java and remove methods meant only for testing from the public interface. Update ConnectionImplTest.java to test against ConnectionImpl instead of Connection. * Updated to StandardSQLTypeName * Added Arrow specific logic for primitive getters * Added Arrow specific parsing logic for primitive getters * Added Arrow specific parsing logic for additional datatypes * Modified the getter's logic for parsing arrow * Added Interrupt logic for Arrow processing * Added Arrow Support in ResultSet Methods * Removed typecasting from processRows method * Added Json typecasting logic * Updated Arrow dependency to latest * Added UseReadAPI property * Updated useReadAPI * Updated useReadAPI * feat: add Interval type support (#1844) * feat: add Interval type support Fixes b/208051516 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add threeten-extra PeriodDuration support * add unit test coverage Co-authored-by: Owl Bot * Reformat * remove unused declacred dependency: org.apache.arrow:arrow-memory-netty:jar:7.0.0:runtime * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fixed getDate * format * Added containsIntervalType check * Added containsIntervalType check * add back the arrow-netty dependency * add a rule to ignore org.apache.arrow:arrow-memory-netty in maven-dependency-plugin * Fixed getTime * Updated getString * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Added Nightly Integration test for testing Read API integration * Added Nightly Integration test for testing Read API integration * Added Nightly Integration test for testing Read API integration * Modified Nightly Integration test * Fixed NPE during bulk read * Fixed class cast exception @ getLong * Added @BetaApi Annotation * Added @BetaApi Annotation * Exposed methods for unit testing * Added more unit testing * fixed getString to handle LocalDateTime * Added ConnImplBenchmark * Added instructions for running ConnImplBenchmark * Updated Java Docs * add IT TODOs * Fixed getInt for JSONField types (Int returned as Text) * Added JsonType tests * Added test - testForAllDataTypeValues * Added translateAndThrowBigQuerySQLException * Added Exception Handling for executeSelect methods * Added testInvalidQuery * Added testMultipleRuns * Added testPositionalParams * updated positional query * update logic to not use Read API when QueryParameters are passed since it's not supported by the Read API * update support for query parameters deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.3 (#1978) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.oauth-client:google-oauth-client-jetty](https://togithub.com/googleapis/google-oauth-java-client) | `1.33.2` -> `1.33.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/compatibility-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-jetty/1.33.3/confidence-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | ---
    googleapis/google-oauth-java-client [Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.33.2...v1.33.3)
    --- 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.3 (#1977) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.oauth-client:google-oauth-client-java6](https://togithub.com/googleapis/google-oauth-java-client) | `1.33.2` -> `1.33.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/compatibility-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.oauth-client:google-oauth-client-java6/1.33.3/confidence-slim/1.33.2)](https://docs.renovatebot.com/merge-confidence/) | ---
    googleapis/google-oauth-java-client [Compare Source](https://togithub.com/googleapis/google-oauth-java-client/compare/v1.33.2...v1.33.3)
    --- 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(main): release 2.10.8 (#1979) :robot: I have created a release *beep* *boop* --- ### [2.10.8](https://github.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8) (2022-04-14) ### Dependencies * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.33.3 ([#1977](https://github.com/googleapis/java-bigquery/issues/1977)) ([b084791](https://github.com/googleapis/java-bigquery/commit/b08479180e212bccae166f3a675d46fb658d3ce8)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.33.3 ([#1978](https://github.com/googleapis/java-bigquery/issues/1978)) ([a24ce6e](https://github.com/googleapis/java-bigquery/commit/a24ce6ead65f3fceff6573e24c10c324650d907b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * chore(main): release 2.10.9-SNAPSHOT (#1980) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> * deps: update dependency com.google.cloud:native-image-support to v0.13.1 (#1982) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:native-image-support](https://togithub.com/googleapis/java-core) | `0.12.11` -> `0.13.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/compatibility-slim/0.12.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:native-image-support/0.13.1/confidence-slim/0.12.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.8 (#1981) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.7` -> `2.10.8` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/compatibility-slim/2.10.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.8/confidence-slim/2.10.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.8`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2108-httpsgithubcomgoogleapisjava-bigquerycomparev2107v2108-2022-04-14) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.7...v2.10.8)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 (#1983) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.9.0` -> `2.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.10.0/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v2.10.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​2100-httpsgithubcomgoogleapisjava-shared-dependenciescomparev290v2100-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.9.0...v2.10.0) ##### Dependencies - google-cloud-core 2.6.0 ([#​668](https://togithub.com/googleapis/java-shared-dependencies/issues/668)) ([22f4d18](https://togithub.com/googleapis/java-shared-dependencies/commit/22f4d1809cbb9848174b3569ab527e4bef00d443)) - reverting protobuf to 3.19.4 ([#​657](https://togithub.com/googleapis/java-shared-dependencies/issues/657)) ([8501e6d](https://togithub.com/googleapis/java-shared-dependencies/commit/8501e6d842c10d2370bbd5d5246070134336bddd)) - update dependency com.fasterxml.jackson:jackson-bom to v2.13.2.20220328 ([#​646](https://togithub.com/googleapis/java-shared-dependencies/issues/646)) ([7bfd6d7](https://togithub.com/googleapis/java-shared-dependencies/commit/7bfd6d7073859d1955b91b368c6713a72ffa14b6)) - update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#​662](https://togithub.com/googleapis/java-shared-dependencies/issues/662)) ([1b8e378](https://togithub.com/googleapis/java-shared-dependencies/commit/1b8e378fe0ccf2a28c759868caaf5ba593a95728)) - update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#​652](https://togithub.com/googleapis/java-shared-dependencies/issues/652)) ([1cc80ee](https://togithub.com/googleapis/java-shared-dependencies/commit/1cc80ee984ebcad9bc2a95e2f28c0a49fe924b37)) - update dependency com.google.errorprone:error_prone_annotations to v2.13.0 ([#​669](https://togithub.com/googleapis/java-shared-dependencies/issues/669)) ([61b7834](https://togithub.com/googleapis/java-shared-dependencies/commit/61b78341b34a251722be4805a6bdd895cd64836c)) - update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#​654](https://togithub.com/googleapis/java-shared-dependencies/issues/654)) ([140ef40](https://togithub.com/googleapis/java-shared-dependencies/commit/140ef405bc17ed83f5ce177df59affca14fbe49c)) - update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#​658](https://togithub.com/googleapis/java-shared-dependencies/issues/658)) ([f6f93e5](https://togithub.com/googleapis/java-shared-dependencies/commit/f6f93e5b9172c9684623c4c148e4a8fe2fae1e94)) - update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.2 ([#​655](https://togithub.com/googleapis/java-shared-dependencies/issues/655)) ([20cd9ed](https://togithub.com/googleapis/java-shared-dependencies/commit/20cd9eda112c96836a5ab7485a4247ed2bc0edb8)) - update dependency com.google.oauth-client:google-oauth-client-bom to v1.33.3 ([#​663](https://togithub.com/googleapis/java-shared-dependencies/issues/663)) ([f011a46](https://togithub.com/googleapis/java-shared-dependencies/commit/f011a46c551dba16851b4f8c919c40452fc5d5c3)) - update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#​651](https://togithub.com/googleapis/java-shared-dependencies/issues/651)) ([ad2ff73](https://togithub.com/googleapis/java-shared-dependencies/commit/ad2ff73207dd6493321c77d8eca0022baf13b4ce)) - update dependency io.grpc:grpc-bom to v1.45.1 ([#​647](https://togithub.com/googleapis/java-shared-dependencies/issues/647)) ([38e46fc](https://togithub.com/googleapis/java-shared-dependencies/commit/38e46fc4f03af0a02f30ce4a2fa222c71797ae15)) - update dependency org.checkerframework:checker-qual to v3.21.4 ([#​650](https://togithub.com/googleapis/java-shared-dependencies/issues/650)) ([125e80a](https://togithub.com/googleapis/java-shared-dependencies/commit/125e80ab2c3225a00c03f5ff5de94872ebb94303)) - update gax.version to v2.15.0 ([#​649](https://togithub.com/googleapis/java-shared-dependencies/issues/649)) ([c7f32a6](https://togithub.com/googleapis/java-shared-dependencies/commit/c7f32a68b14520104432282ac9598643700162eb)) - update gax.version to v2.16.0 ([#​664](https://togithub.com/googleapis/java-shared-dependencies/issues/664)) ([caaf941](https://togithub.com/googleapis/java-shared-dependencies/commit/caaf941643af04295f5527a0144587d7bf040862)) - update google.common-protos.version to v2.8.1 ([#​656](https://togithub.com/googleapis/java-shared-dependencies/issues/656)) ([df4a4a2](https://togithub.com/googleapis/java-shared-dependencies/commit/df4a4a2130a3cdb2965ea42962d1ea6a85506ba7)) - update google.common-protos.version to v2.8.2 ([#​659](https://togithub.com/googleapis/java-shared-dependencies/issues/659)) ([b499e2b](https://togithub.com/googleapis/java-shared-dependencies/commit/b499e2bc99506d48d26e35bf6e68c09409ce8b11)) - update google.common-protos.version to v2.8.3 ([#​660](https://togithub.com/googleapis/java-shared-dependencies/issues/660)) ([461081c](https://togithub.com/googleapis/java-shared-dependencies/commit/461081c0cf73057c1f6e07fc573453ad467a60ae)) - update iam.version to v1.3.0 ([#​648](https://togithub.com/googleapis/java-shared-dependencies/issues/648)) ([6670c4f](https://togithub.com/googleapis/java-shared-dependencies/commit/6670c4f61fcf075c543bfd148eea49796e0662ce)) - update iam.version to v1.3.1 ([#​661](https://togithub.com/googleapis/java-shared-dependencies/issues/661)) ([cc8fbe6](https://togithub.com/googleapis/java-shared-dependencies/commit/cc8fbe6eae03341c2ece7d3356febc843a74a812))
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.3 (#1986) * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.7.3 (#1987) * chore(main): release 2.10.9 (#1984) :robot: I have created a release *beep* *boop* --- ### [2.10.9](https://github.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9) (2022-04-16) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#1983](https://github.com/googleapis/java-bigquery/issues/1983)) ([50ac31c](https://github.com/googleapis/java-bigquery/commit/50ac31c598ae8c5aa4e1f6dcde80da704db904a5)) * update dependency com.google.cloud:native-image-support to v0.13.1 ([#1982](https://github.com/googleapis/java-bigquery/issues/1982)) ([04f4679](https://github.com/googleapis/java-bigquery/commit/04f4679fe376e726b21e313115bfd48adc6cbe6b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * chore(main): release 2.10.10-SNAPSHOT (#1988) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.9 (#1989) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.10.8` -> `2.10.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/compatibility-slim/2.10.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.10.9/confidence-slim/2.10.8)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.10.9`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2109-httpsgithubcomgoogleapisjava-bigquerycomparev2108v2109-2022-04-16) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.10.8...v2.10.9)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * deps: update dependency com.google.cloud:google-cloud-storage to v2.6.1 (#1991) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.6.0` -> `2.6.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/compatibility-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.6.1/confidence-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.6.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​261-httpsgithubcomgoogleapisjava-storagecomparev260v261-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.6.0...v2.6.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * deps: update dependency com.google.cloud:google-cloud-bigtable to v2.6.2 (#1990) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.6.1` -> `2.6.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/compatibility-slim/2.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.6.2/confidence-slim/2.6.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.6.2`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​262-httpsgithubcomgoogleapisjava-bigtablecomparev261v262-2022-04-15) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.6.1...v2.6.2)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(main): release 2.10.10 (#1992) :robot: I have created a release *beep* *boop* --- * update dependency com.google.cloud:google-cloud-bigtable to v2.6.2 ([#1990](https://github.com/googleapis/java-bigquery/issues/1990)) ([4c1cb4c](https://github.com/googleapis/java-bigquery/commit/4c1cb4c13214556b706f1ff8c50a46f881bf2724)) * update dependency com.google.cloud:google-cloud-storage to v2.6.1 ([#1991](https://github.com/googleapis/java-bigquery/issues/1991)) ([e02bf31](https://github.com/googleapis/java-bigquery/commit/e02bf315737dba50741c1346af8bde6871cb857a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). chore(main): release 2.10.11-SNAPSHOT (#1993) :robot: I have created a release *beep* *boop* --- --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). * fix dependencies.sh * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update query parameters for dryRun * Made Label optional by making it a vararg * Made Label optional by making it a vararg * Removed null labels * Renamed cancel to close * Refactored testConnectionCancel * Renamed cancel() to close() * Renamed testCancel * Added testPositionalParams * Replaced all the shutdownNows with MoreExecutors.shutdownAndAwaitTermination() * Using TimeUnit.DAYS.toMillis for conversion from Days to Millis * deleted outdated comment * nit update * update based on comments * updated to using a public dataset * updated cancel() to close() * using constants for clientConnectionConfiguration * using constants for clientConnectionConfiguration * updated Warmup iterations to 1 * updated dataset * Fix for testConnectionClose IT * update labels and close method 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Made Label optional by making it a vararg Made Label optional by making it a vararg Removed null labels Renamed cancel to close Refactored testConnectionCancel Renamed cancel() to close() Renamed testCancel Added testPositionalParams Replaced all the shutdownNows with MoreExecutors.shutdownAndAwaitTermination() * update based on comments update based on feedback Using TimeUnit.DAYS.toMillis for conversion from Days to Millis deleted outdated comment nit update update based on comments updated to using a public dataset updated cancel() to close() using constants for clientConnectionConfiguration using constants for clientConnectionConfiguration updated Warmup iterations to 1 combine commits updated dataset Fix for testConnectionClose IT update based on comments fix lint * Refactored code - Replaced Tuple, Boolean> with Row * Added class Row and Refactored code - Replaced Tuple, Boolean> with Row * Added overloaded constructor with just message as an argument * refactored and added BigQuerySQLException in next() * refactored and added throwing BigQuerySQLException * Added fieldvalue null checks * modified close * modified close * modified getLong * address feedback deleted outdated comment update based on comments updated to using a public dataset updated cancel() to close() using constants for clientConnectionConfiguration using constants for clientConnectionConfiguration updated Warmup iterations to 1 updated dataset Fix for testConnectionClose IT * update based on comments update based on feedback Using TimeUnit.DAYS.toMillis for conversion from Days to Millis deleted outdated comment nit update update based on comments updated to using a public dataset updated cancel() to close() using constants for clientConnectionConfiguration using constants for clientConnectionConfiguration updated Warmup iterations to 1 combine commits updated dataset Fix for testConnectionClose IT update based on comments fix lint * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 (#1995) * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 * 🦉 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 * feat: next release from main branch is 2.10.9 (#1996) * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.3.3 (#2000) * test(deps): update dependency org.mockito:mockito-core to v4.5.0 (#1999) * test(deps): update dependency org.mockito:mockito-core to v4.5.1 (#2003) * build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.0 (#2002) * build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.13 (#2004) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.sonatype.plugins:nexus-staging-maven-plugin](http://www.sonatype.com/) ([source](https://togithub.com/sonatype/nexus-maven-plugins)) | `1.6.12` -> `1.6.13` | [![age](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/compatibility-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.sonatype.plugins:nexus-staging-maven-plugin/1.6.13/confidence-slim/1.6.12)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    sonatype/nexus-maven-plugins ### [`v1.6.13`](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13) [Compare Source](https://togithub.com/sonatype/nexus-maven-plugins/compare/release-1.6.12...release-1.6.13)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.2.4 (#2006) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.2.3` -> `2.2.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/compatibility-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.2.4/confidence-slim/2.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.2.4`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​224-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev223v224-2022-04-21) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.2.3...v2.2.4)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). * chore(deps): update dependency com.google.cloud:libraries-bom to v25.2.0 (#2008) * chore(deps): update dependency com.google.cloud:libraries-bom to v25.2.0 * 🦉 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 * docs(sample): remove unused dependency and add setup instructions (#2010) * build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.3.0 (#2011) * chore: IT clean-up (#2012) Fixes #1924 Per discussion in b/227623980 * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.4.0 (#2013) * address feedback Refactored code - Replaced Tuple, Boolean> with Row Added class Row and Refactored code - Replaced Tuple, Boolean> with Row Added overloaded constructor with just message as an argument refactored and added BigQuerySQLException in next() address feedback refactored and added throwing BigQuerySQLException Added fieldvalue null checks modified close modified close modified getLong * add clarification to dryRun query params * Fixed BigQuerySQLException in the Integration Tests * Added line comment * Updated getInt to include check for Long * Added testReadAPIIterationAndOrder IT * Add testReadAPIConnectionMultiClose, Removed ReadClientConnectionConfiguration * Refactored for removal of ReadClientConnectionConfiguration * Added more properties and default values * Changed the type of preFetchedRowLimit from Long to Integer * Updated method signature - Changed the type of preFetchedRowLimit from Long to Integer * Refactor - Removed the usage of ReadClientConnectionConfiguration * Refactor - Removed the usage of ReadClientConnectionConfiguration * Changed the type of preFetchedRowLimit to Integer * Refactor due to Change in the type of preFetchedRowLimit to Integer * lint * some cleanup and corrections * nit * mark createConnection as Beta * disable graalvm IT until it works with Apache Arrow * Added instance check for IntegerArrayField * Added Connection createConnection() * Added testIterateAndOrderDefaultConnSettings IT * Added Connection createConnection(). Marked createConnection(@NonNull ConnectionSettings connectionSettings) * Added com.google.cloud.bigquery.Connection createConnection() * add IT and some clean up * add org.checkerframework:checker-qual:jar:3.21.4:compile as a dependency to fix dependency check failure * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * provide BigQueryResultStats in dryRun results * Fixed testQueryDryRun UT failure - Added jobConfigurationQuery Co-authored-by: Prashant Mishra Co-authored-by: Owl Bot Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: WhiteSource Renovate Co-authored-by: Prashant Mishra Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- .gitignore | 6 +- .kokoro/dependencies.sh | 4 +- benchmark/README.md | 7 + .../ConnImplBenchmark.java | 186 +++ .../clirr-ignored-differences.xml | 35 + google-cloud-bigquery/pom.xml | 20 + .../cloud/bigquery/AbstractJdbcResultSet.java | 910 ++++++++++++ .../com/google/cloud/bigquery/BigQuery.java | 49 + .../cloud/bigquery/BigQueryDryRunResult.java | 39 + .../bigquery/BigQueryDryRunResultImpl.java | 49 + .../cloud/bigquery/BigQueryException.java | 9 + .../google/cloud/bigquery/BigQueryImpl.java | 17 + .../google/cloud/bigquery/BigQueryResult.java | 38 + .../cloud/bigquery/BigQueryResultImpl.java | 610 ++++++++ .../cloud/bigquery/BigQueryResultStats.java | 36 + .../bigquery/BigQueryResultStatsImpl.java | 41 + .../cloud/bigquery/BigQuerySQLException.java | 86 ++ .../com/google/cloud/bigquery/Connection.java | 92 ++ .../google/cloud/bigquery/ConnectionImpl.java | 1240 +++++++++++++++++ .../cloud/bigquery/ConnectionSettings.java | 453 ++++++ .../google/cloud/bigquery/JobStatistics.java | 26 +- .../com/google/cloud/bigquery/Parameter.java | 70 + .../cloud/bigquery/QueryJobConfiguration.java | 5 + .../ReadClientConnectionConfiguration.java | 70 + .../cloud/bigquery/spi/v2/BigQueryRpc.java | 31 + .../bigquery/spi/v2/HttpBigQueryRpc.java | 67 + .../cloud/bigquery/ConnectionImplTest.java | 542 +++++++ .../bigquery/ConnectionSettingsTest.java | 166 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 802 ++++++++++- .../bigquery/it/ITNightlyBigQueryTest.java | 610 ++++++++ pom.xml | 71 + 31 files changed, 6381 insertions(+), 6 deletions(-) create mode 100644 benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java create mode 100644 google-cloud-bigquery/clirr-ignored-differences.xml create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AbstractJdbcResultSet.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResult.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResultImpl.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResult.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStats.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStatsImpl.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuerySQLException.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Parameter.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java diff --git a/.gitignore b/.gitignore index 8782d86f6e..1c7a7e78f8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,8 @@ __pycache__ .settings .classpath .DS_Store - +.diff.txt +.new-list.txt +.org-list.txt +SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java +.flattened-pom.xml \ No newline at end of file diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 586b78bb9b..545820622f 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -67,13 +67,13 @@ function completenessCheck() { msg "Generating dependency list using original pom..." # Excluding commons-codec,commons-logging from the comparison as a temp fix # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 - mvn dependency:list -f pom.xml -DexcludeArtifactIds=commons-codec,commons-logging -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + mvn dependency:list -f pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) msg "Generating dependency list using flattened pom..." # Excluding commons-codec,commons-logging from the comparison as a temp fix # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 - mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=commons-codec,commons-logging -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt # Compare two dependency lists msg "Comparing dependency lists..." diff --git a/benchmark/README.md b/benchmark/README.md index 41e9c2fdac..d1a1ae1571 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -19,3 +19,10 @@ To run a benchmark jar, run the following command cd benchmark java -jar target/benchmark.jar ``` + +To run ConnImplBenchmark, run the following command +``` +# Run from benchmark directory + cd benchmark + java -jar target/benchmark.jar com.google.cloud.bigquery.ConnImplBenchmark +``` diff --git a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java new file mode 100644 index 0000000000..36c27eb6a9 --- /dev/null +++ b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java @@ -0,0 +1,186 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +@Fork(value = 1) +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 1) +@Measurement(iterations = 3) +@State(Scope.Benchmark) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class ConnImplBenchmark { + @Param({"500000", "1000000", "10000000", "100000000"}) // 500K, 1M, 10M, and 100M + public int rowLimit; + + private ConnectionSettings connectionSettingsReadAPIEnabled, connectionSettingsReadAPIDisabled; + private long numBuffRows = 100000L; + private final String DATASET = "new_york_taxi_trips"; + private final String QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; + public static final long NUM_PAGE_ROW_CNT_RATIO = + 10; // ratio of [records in the current page :: total rows] to be met to use read API + public static final long NUM_MIN_RESULT_SIZE = + 200000; // min number of records to use to ReadAPI with + + @Setup + public void setUp() throws IOException { + java.util.logging.Logger.getGlobal().setLevel(Level.ALL); + ReadClientConnectionConfiguration clientConnectionConfiguration; + + clientConnectionConfiguration = + ReadClientConnectionConfiguration.newBuilder() + .setTotalToPageRowCountRatio(NUM_PAGE_ROW_CNT_RATIO) + .setMinResultSize(NUM_MIN_RESULT_SIZE) + .setBufferSize(numBuffRows) + .build(); + + connectionSettingsReadAPIEnabled = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(numBuffRows) // page size + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // DEFAULT VALUE - so that isFastQuerySupported returns false + .setReadClientConnectionConfiguration(clientConnectionConfiguration) + .setUseReadAPI(true) // enable read api + .build(); + connectionSettingsReadAPIDisabled = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(numBuffRows) // page size + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // so that isFastQuerySupported returns false + .setReadClientConnectionConfiguration(clientConnectionConfiguration) + .setUseReadAPI(false) // disable read api + .build(); + } + + @Benchmark + public void iterateRecordsUsingReadAPI(Blackhole blackhole) + throws InterruptedException, BigQuerySQLException { + Connection connectionReadAPIEnabled = + BigQueryOptions.getDefaultInstance() + .getService() + .createConnection(connectionSettingsReadAPIEnabled); + String selectQuery = String.format(QUERY, rowLimit); + long hash = 0L; + try { + BigQueryResultSet bigQueryResultSet = connectionReadAPIEnabled.executeSelect(selectQuery); + hash = getResultHash(bigQueryResultSet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + connectionReadAPIEnabled.close(); // IMP to kill the bg workers + } + blackhole.consume(hash); + } + + @Benchmark + public void iterateRecordsWithoutUsingReadAPI(Blackhole blackhole) + throws InterruptedException, BigQuerySQLException { + Connection connectionReadAPIDisabled = + BigQueryOptions.getDefaultInstance() + .getService() + .createConnection(connectionSettingsReadAPIDisabled); + String selectQuery = String.format(QUERY, rowLimit); + long hash = 0L; + try { + BigQueryResultSet bigQueryResultSet = connectionReadAPIDisabled.executeSelect(selectQuery); + hash = getResultHash(bigQueryResultSet); + } catch (Exception e) { + e.printStackTrace(); + } finally { + connectionReadAPIDisabled.close(); // IMP to kill the bg workers + } + blackhole.consume(hash); + } + + // Hashes all the 20 columns of all the rows + private long getResultHash(BigQueryResultSet bigQueryResultSet) throws SQLException { + ResultSet rs = bigQueryResultSet.getResultSet(); + long hash = 0L; + int cnt = 0; + System.out.print("\n Running"); + while (rs.next()) { + hash += rs.getString("vendor_id") == null ? 0 : rs.getString("vendor_id").hashCode(); + hash += + rs.getString("pickup_datetime") == null ? 0 : rs.getString("pickup_datetime").hashCode(); + hash += + rs.getString("dropoff_datetime") == null + ? 0 + : rs.getString("dropoff_datetime").hashCode(); + hash += rs.getLong("passenger_count"); + hash += rs.getDouble("trip_distance"); + hash += rs.getDouble("pickup_longitude"); + hash += rs.getDouble("pickup_latitude"); + hash += rs.getString("rate_code") == null ? 0 : rs.getString("rate_code").hashCode(); + hash += + rs.getString("store_and_fwd_flag") == null + ? 0 + : rs.getString("store_and_fwd_flag").hashCode(); + hash += rs.getDouble("dropoff_longitude"); + hash += rs.getDouble("dropoff_latitude"); + hash += rs.getString("payment_type") == null ? 0 : rs.getString("payment_type").hashCode(); + hash += rs.getDouble("fare_amount"); + hash += rs.getDouble("extra"); + hash += rs.getDouble("mta_tax"); + hash += rs.getDouble("tip_amount"); + hash += rs.getDouble("tolls_amount"); + hash += rs.getDouble("imp_surcharge"); + hash += rs.getDouble("total_amount"); + hash += + rs.getString("pickup_location_id") == null + ? 0 + : rs.getString("pickup_location_id").hashCode(); + hash += + rs.getString("dropoff_location_id") == null + ? 0 + : rs.getString("dropoff_location_id").hashCode(); + if (++cnt % 100000 == 0) { // just to indicate the progress while long running benchmarks + System.out.print("."); + } + } + return hash; + } + + public static void main(String[] args) throws Exception { + Options opt = new OptionsBuilder().include(ConnImplBenchmark.class.getSimpleName()).build(); + new Runner(opt).run(); + } +} diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml new file mode 100644 index 0000000000..1dccf5a668 --- /dev/null +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -0,0 +1,35 @@ + + + + + + 7012 + com/google/cloud/bigquery/BigQuery + com.google.cloud.bigquery.Connection createConnection(com.google.cloud.bigquery.ConnectionSettings) + + + 7012 + com/google/cloud/bigquery/BigQuery + com.google.cloud.bigquery.Connection createConnection() + + + 7012 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + com.google.api.services.bigquery.model.Job createJobForQuery(com.google.api.services.bigquery.model.Job) + + + 7012 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + com.google.api.services.bigquery.model.Job getQueryJob(java.lang.String, java.lang.String, java.lang.String) + + + 7012 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) + + + 7012 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + com.google.api.services.bigquery.model.TableDataList listTableDataWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String) + + \ No newline at end of file diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 93d5747840..c3abfe1cf7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -46,6 +46,10 @@ org.checkerframework checker-compat-qual
    + + org.checkerframework + checker-qual + com.google.auth google-auth-library-oauth2-http @@ -97,6 +101,21 @@ + + com.google.cloud + google-cloud-datacatalog + test + + + com.google.api.grpc + proto-google-cloud-datacatalog-v1 + test + + + com.google.cloud + google-cloud-storage + test + junit junit @@ -105,6 +124,7 @@ com.google.truth truth + test org.mockito diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AbstractJdbcResultSet.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AbstractJdbcResultSet.java new file mode 100644 index 0000000000..5b82469250 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/AbstractJdbcResultSet.java @@ -0,0 +1,910 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.*; +import java.util.Calendar; +import java.util.Map; + +abstract class AbstractJdbcResultSet implements ResultSet { + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public void close() throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public boolean wasNull() throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public byte getByte(String column) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public short getShort(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + // TODO: Implement the logic + throw new RuntimeException("Not implemented"); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + return null; + } + + @Override + public void clearWarnings() throws SQLException {} + + @Override + public String getCursorName() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isLast() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void beforeFirst() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void afterLast() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean first() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean last() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean previous() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getFetchDirection() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getFetchSize() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getType() throws SQLException { + return TYPE_FORWARD_ONLY; + } + + @Override + public int getConcurrency() throws SQLException { + return CONCUR_READ_ONLY; + } + + @Override + public boolean rowUpdated() throws SQLException { + return false; + } + + @Override + public boolean rowInserted() throws SQLException { + return false; + } + + @Override + public boolean rowDeleted() throws SQLException { + return false; + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(int columnIndex, Object x, SQLType type, int scaleOrLength) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(int columnIndex, Object x, SQLType type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(String columnLabel, Object x, SQLType type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateObject(String columnLabel, Object x, SQLType type, int scaleOrLength) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void insertRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void deleteRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void refreshRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isAfterLast() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isFirst() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getRow() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Statement getStatement() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getHoldability() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isClosed() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 4e88f000f5..b574df32da 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument; +import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.cloud.FieldSelector; @@ -32,6 +33,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import org.checkerframework.checker.nullness.qual.NonNull; /** * An interface for Google Cloud BigQuery. @@ -760,6 +762,53 @@ public int hashCode() { */ Job create(JobInfo jobInfo, JobOption... options); + /** + * Creates a new BigQuery query connection used for executing queries (not the same as BigQuery + * connection properties). It uses the BigQuery Storage Read API for high throughput queries by + * default. + * + *

    Example of creating a query connection. + * + *

    +   * {
    +   *   @code
    +   *       ConnectionSettings connectionSettings =
    +   *         ConnectionSettings.newBuilder()
    +   *             .setRequestTimeout(10L)
    +   *             .setMaxResults(100L)
    +   *             .setUseQueryCache(true)
    +   *             .build();
    +   *       Connection connection = bigquery.createConnection(connectionSettings);
    +   * }
    +   * 
    + * + * @throws BigQueryException upon failure + * @param connectionSettings + */ + @BetaApi + Connection createConnection(@NonNull ConnectionSettings connectionSettings); + + /** + * Creates a new BigQuery query connection used for executing queries (not the same as BigQuery + * connection properties). It uses the BigQuery Storage Read API for high throughput queries by + * default. This overloaded method creates a Connection with default ConnectionSettings for query + * execution where default values are set for numBufferedRows (20000), useReadApi (true), + * useLegacySql (false). + * + *

    Example of creating a query connection. + * + *

    +   * {
    +   *   @code
    +   *       Connection connection = bigquery.createConnection();
    +   * }
    +   * 
    + * + * @throws BigQueryException upon failure + */ + @BetaApi + Connection createConnection(); + /** * Returns the requested dataset or {@code null} if not found. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResult.java new file mode 100644 index 0000000000..0494aa1a97 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResult.java @@ -0,0 +1,39 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.core.BetaApi; +import java.util.List; + +public interface BigQueryDryRunResult { + + /** Returns the schema of the results. Null if the schema is not supplied. */ + @BetaApi + Schema getSchema() throws BigQuerySQLException; + + /** + * Returns query parameters for standard SQL queries by extracting undeclare query parameters from + * the dry run job. See more information: + * https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/java/latest/com/google/api/services/bigquery/model/JobStatistics2.html#getUndeclaredQueryParameters-- + */ + @BetaApi + List getQueryParameters() throws BigQuerySQLException; + + /** Returns some processing statistics */ + @BetaApi + BigQueryResultStats getStatistics() throws BigQuerySQLException; +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResultImpl.java new file mode 100644 index 0000000000..fabb2f2fcb --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryDryRunResultImpl.java @@ -0,0 +1,49 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.util.List; + +public class BigQueryDryRunResultImpl implements BigQueryDryRunResult { + private Schema schema; + private List queryParameters; + private BigQueryResultStats stats; + + BigQueryDryRunResultImpl( + Schema schema, + List queryParameters, + BigQueryResultStats stats) { // Package-Private access + this.schema = schema; + this.queryParameters = queryParameters; + this.stats = stats; + } + + @Override + public Schema getSchema() throws BigQuerySQLException { + return schema; + } + + @Override + public List getQueryParameters() throws BigQuerySQLException { + return queryParameters; + } + + @Override + public BigQueryResultStats getStatistics() throws BigQuerySQLException { + return stats; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java index 06cbf344c9..c42ff63275 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java @@ -134,4 +134,13 @@ static BaseServiceException translateAndThrow(ExecutionException ex) { BaseServiceException.translate(ex); throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); } + + static BaseServiceException translateAndThrow(Exception ex) { + throw new BigQueryException(UNKNOWN_CODE, ex.getMessage(), ex.getCause()); + } + + static BaseServiceException translateAndThrowBigQuerySQLException(BigQueryException e) + throws BigQuerySQLException { + throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index b2e939df09..3cfbfd6528 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; +import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.api.services.bigquery.model.ErrorProto; @@ -54,6 +55,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Callable; +import org.checkerframework.checker.nullness.qual.NonNull; final class BigQueryImpl extends BaseService implements BigQuery { @@ -351,6 +353,21 @@ public JobId get() { return create(jobInfo, idProvider, options); } + @Override + @BetaApi + public Connection createConnection(@NonNull ConnectionSettings connectionSettings) + throws BigQueryException { + return new ConnectionImpl(connectionSettings, getOptions(), bigQueryRpc, DEFAULT_RETRY_CONFIG); + } + + @Override + @BetaApi + public Connection createConnection() throws BigQueryException { + ConnectionSettings defaultConnectionSettings = ConnectionSettings.newBuilder().build(); + return new ConnectionImpl( + defaultConnectionSettings, getOptions(), bigQueryRpc, DEFAULT_RETRY_CONFIG); + } + @InternalApi("visible for testing") Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { final boolean idRandom = (jobInfo.getJobId() == null); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResult.java new file mode 100644 index 0000000000..6b0c35f67c --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResult.java @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.sql.ResultSet; + +public interface BigQueryResult { + + /** Returns the schema of the results. */ + Schema getSchema(); + + /** + * Returns the total number of rows in the complete result set, which can be more than the number + * of rows in the first page of results. This might return -1 if the query is long running and the + * job is not complete at the time this object is returned. + */ + long getTotalRows(); + + /* Returns the underlying ResultSet Implementation */ + ResultSet getResultSet(); + + /* Returns the query statistics associated with this query. */ + BigQueryResultStats getBigQueryResultStats(); +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java new file mode 100644 index 0000000000..7c24ca0dd4 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -0,0 +1,610 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.TimeUnit; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.Text; + +public class BigQueryResultImpl implements BigQueryResult { + + private static final String NULL_CURSOR_MSG = + "Error occurred while reading the cursor. This could happen if getters are called after we are done reading all the records"; + + // This class represents a row of records, the columns are represented as a map + // (columnName:columnValue pair) + static class Row { + private Map value; + private boolean isLast; + + public Row(Map value) { + this.value = value; + } + + public Row(Map value, boolean isLast) { + this.value = value; + this.isLast = isLast; + } + + public Map getValue() { + return value; + } + + public boolean isLast() { + return isLast; + } + + public boolean hasField(String fieldName) { + return this.value.containsKey(fieldName); + } + + public Object get(String fieldName) { + return this.value.get(fieldName); + } + } + + private final Schema schema; + private final long totalRows; + private final BlockingQueue buffer; + private T cursor; + private final BigQueryResultSet underlyingResultSet; + private final BigQueryResultStats bigQueryResultStats; + private final FieldList schemaFieldList; + + public BigQueryResultImpl( + Schema schema, + long totalRows, + BlockingQueue buffer, + BigQueryResultStats bigQueryResultStats) { + this.schema = schema; + this.totalRows = totalRows; + this.buffer = buffer; + this.underlyingResultSet = new BigQueryResultSet(); + this.bigQueryResultStats = bigQueryResultStats; + this.schemaFieldList = schema.getFields(); + } + + @Override + public Schema getSchema() { + return schema; + } + + @Override + public long getTotalRows() { + return totalRows; + } + + @Override + public ResultSet getResultSet() { + return underlyingResultSet; + } + + private class BigQueryResultSet extends AbstractJdbcResultSet { + @Override + /*Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation*/ + public boolean next() throws SQLException { + try { + cursor = buffer.take(); // advance the cursor,Potentially blocking operation + if (isEndOfStream(cursor)) { // check for end of stream + cursor = null; + return false; + } else if (cursor instanceof Row) { + Row curTup = (Row) cursor; + if (curTup.isLast()) { // last Tuple + cursor = null; + return false; + } + return true; + } else if (cursor instanceof FieldValueList) { // cursor is advanced, we can return true now + return true; + } else { // this case should never occur as the cursor will either be a Row of EoS + throw new BigQuerySQLException("Could not process the current row"); + } + } catch (InterruptedException e) { + throw new SQLException( + "Error occurred while advancing the cursor. This could happen when connection is closed while we call the next method"); + } + } + + private boolean isEndOfStream(T cursor) { + return cursor instanceof ConnectionImpl.EndOfFieldValueList; + } + + @Override + public Object getObject(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) ? null : fieldValue.getValue(); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + return curRow.get(fieldName); + } + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + if (cursor == null) { + return null; + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) ? null : fieldValue.getValue(); + } else { // Data received from Read API (Arrow) + return getObject(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public String getString(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + if ((fieldValue == null || fieldValue.getValue() == null)) { + return null; + } else if (fieldValue + .getAttribute() + .equals(FieldValue.Attribute.REPEATED)) { // Case for Arrays + return fieldValue.getValue().toString(); + } else { + return fieldValue.getStringValue(); + } + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object currentVal = curRow.get(fieldName); + if (currentVal == null) { + return null; + } else if (currentVal instanceof JsonStringArrayList) { // arrays + JsonStringArrayList jsnAry = (JsonStringArrayList) currentVal; + return jsnAry.toString(); + } else if (currentVal instanceof LocalDateTime) { + LocalDateTime dateTime = (LocalDateTime) currentVal; + return dateTime.toString(); + } else { + Text textVal = (Text) currentVal; + return textVal.toString(); + } + } + } + + @Override + public String getString(int columnIndex) throws SQLException { + if (cursor == null) { + return null; + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : fieldValue.getStringValue(); + } else { // Data received from Read API (Arrow) + return getString(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public int getInt(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + return 0; // the column value; if the value is SQL NULL, the value returned is 0 as per + // java.sql.ResultSet definition + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0 + : fieldValue.getNumericValue().intValue(); + } else { // Data received from Read API (Arrow) + + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object curVal = curRow.get(fieldName); + if (curVal == null) { + return 0; + } + if (curVal instanceof Text) { // parse from text to int + return Integer.parseInt(((Text) curVal).toString()); + } else if (curVal + instanceof + Long) { // incase getInt is called for a Long value. Loss of precision might occur + return ((Long) curVal).intValue(); + } + return ((BigDecimal) curVal).intValue(); + } + } + + @Override + public int getInt(int columnIndex) throws SQLException { + if (cursor == null) { + return 0; // the column value; if the value is SQL NULL, the value returned is 0 as per + // java.sql.ResultSet definition + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0 + : fieldValue.getNumericValue().intValue(); + } else { // Data received from Read API (Arrow) + return getInt(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public long getLong(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0L + : fieldValue.getNumericValue().longValue(); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object curVal = curRow.get(fieldName); + if (curVal == null) { + return 0L; + } else { // value will be Long or BigDecimal, but are Number + return ((Number) curVal).longValue(); + } + } + } + + @Override + public long getLong(int columnIndex) throws SQLException { + if (cursor == null) { + return 0L; // the column value; if the value is SQL NULL, the value returned is 0 as per + // java.sql.ResultSet definition + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0L + : fieldValue.getNumericValue().longValue(); + } else { // Data received from Read API (Arrow) + return getInt(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public double getDouble(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0d + : fieldValue.getNumericValue().doubleValue(); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object curVal = curRow.get(fieldName); + return curVal == null ? 0.0d : ((BigDecimal) curVal).doubleValue(); + } + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + if (cursor == null) { + return 0d; // the column value; if the value is SQL NULL, the value returned is 0 as per + // java.sql.ResultSet definition + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? 0d + : fieldValue.getNumericValue().doubleValue(); + } else { // Data received from Read API (Arrow) + return getDouble(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public BigDecimal getBigDecimal(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); + } else { // Data received from Read API (Arrow) + return BigDecimal.valueOf(getDouble(fieldName)); + } + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); + } else { // Data received from Read API (Arrow) + return getBigDecimal(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public boolean getBoolean(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return fieldValue.getValue() != null && fieldValue.getBooleanValue(); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object curVal = curRow.get(fieldName); + return curVal != null && (Boolean) curVal; + } + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return fieldValue.getValue() != null && fieldValue.getBooleanValue(); + } else { // Data received from Read API (Arrow) + return getBoolean(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public byte[] getBytes(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : fieldValue.getBytesValue(); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object curVal = curRow.get(fieldName); + return curVal == null ? null : (byte[]) curVal; + } + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + if (cursor == null) { + return null; // if the value is SQL NULL, the value returned is null + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : fieldValue.getBytesValue(); + } else { // Data received from Read API (Arrow) + return getBytes(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public Timestamp getTimestamp(String fieldName) throws SQLException { + if (fieldName == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } + if (cursor == null) { + return null; // if the value is SQL NULL, the value returned is null + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : new Timestamp( + fieldValue.getTimestampValue() + / 1000); // getTimestampValue returns time in microseconds, and TimeStamp + // expects it in millis + } else { + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object timeStampVal = curRow.get(fieldName); + return timeStampVal == null + ? null + : new Timestamp((Long) timeStampVal / 1000); // Timestamp is represented as a Long + } + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : new Timestamp( + fieldValue.getTimestampValue() + / 1000); // getTimestampValue returns time in microseconds, and TimeStamp + // expects it in millis + } else { // Data received from Read API (Arrow) + return getTimestamp(schemaFieldList.get(columnIndex).getName()); + } + } + + @Override + public Time getTime(String fieldName) throws SQLException { + if (fieldName == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } + if (cursor == null) { + return null; // if the value is SQL NULL, the value returned is null + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return getTimeFromFieldVal(fieldValue); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object timeStampObj = curRow.get(fieldName); + return timeStampObj == null + ? null + : new Time( + ((Long) timeStampObj) + / 1000); // Time.toString() will return 12:11:35 in GMT as 17:41:35 in + // (GMT+5:30). This can be offset using getTimeZoneOffset + } + } + + private int getTimeZoneOffset() { + TimeZone timeZone = TimeZone.getTimeZone(ZoneId.systemDefault()); + return timeZone.getOffset(new java.util.Date().getTime()); // offset in seconds + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return getTimeFromFieldVal(fieldValue); + } else { // Data received from Read API (Arrow) + return getTime(schemaFieldList.get(columnIndex).getName()); + } + } + + private Time getTimeFromFieldVal(FieldValue fieldValue) throws SQLException { + if (fieldValue.getValue() != null) { + // Time ranges from 00:00:00 to 23:59:59.99999. in BigQuery. Parsing it to java.sql.Time + String strTime = fieldValue.getStringValue(); + String[] timeSplt = strTime.split(":"); + if (timeSplt.length != 3) { + throw new SQLException("Can not parse the value " + strTime + " to java.sql.Time"); + } + int hr = Integer.parseInt(timeSplt[0]); + int min = Integer.parseInt(timeSplt[1]); + int sec = 0, nanoSec = 0; + if (timeSplt[2].contains(".")) { + String[] secSplt = timeSplt[2].split("\\."); + sec = Integer.parseInt(secSplt[0]); + nanoSec = Integer.parseInt(secSplt[1]); + } else { + sec = Integer.parseInt(timeSplt[2]); + } + return Time.valueOf(LocalTime.of(hr, min, sec, nanoSec)); + } else { + return null; + } + } + + @Override + public Date getDate(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : Date.valueOf(fieldValue.getStringValue()); + } else { // Data received from Read API (Arrow) + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + Object dateObj = curRow.get(fieldName); + if (dateObj == null) { + return null; + } else { + Integer dateInt = (Integer) dateObj; + long dateInMillis = + TimeUnit.DAYS.toMillis( + Long.valueOf( + dateInt)); // For example int 18993 represents 2022-01-01, converting time to + // milli seconds + return new Date(dateInMillis); + } + } + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + return (fieldValue == null || fieldValue.getValue() == null) + ? null + : Date.valueOf(fieldValue.getStringValue()); + } else { // Data received from Read API (Arrow) + return getDate(schemaFieldList.get(columnIndex).getName()); + } + } + } + + @Override + public BigQueryResultStats getBigQueryResultStats() { + return bigQueryResultStats; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStats.java new file mode 100644 index 0000000000..a4c37a9b66 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStats.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.core.BetaApi; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.SessionInfo; + +public interface BigQueryResultStats { + + /** Returns query statistics of a query job */ + @BetaApi + QueryStatistics getQueryStatistics(); + + /** + * Returns SessionInfo contains information about the session if this job is part of one. + * JobStatistics2 model class does not allow setSessionInfo so this cannot be set as part of + * QueryStatistics when we use jobs.query API. + */ + @BetaApi + SessionInfo getSessionInfo(); +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStatsImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStatsImpl.java new file mode 100644 index 0000000000..53d67f8f3a --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultStatsImpl.java @@ -0,0 +1,41 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.SessionInfo; + +public class BigQueryResultStatsImpl implements BigQueryResultStats { + + private final QueryStatistics queryStatistics; + private final SessionInfo sessionInfo; + + public BigQueryResultStatsImpl(QueryStatistics queryStatistics, SessionInfo sessionInfo) { + this.queryStatistics = queryStatistics; + this.sessionInfo = sessionInfo; + } + + @Override + public QueryStatistics getQueryStatistics() { + return queryStatistics; + } + + @Override + public SessionInfo getSessionInfo() { + return sessionInfo; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuerySQLException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuerySQLException.java new file mode 100644 index 0000000000..672c6ad3fa --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuerySQLException.java @@ -0,0 +1,86 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import java.sql.SQLException; +import java.util.List; + +/** + * BigQuery service exception. + * + * @see Google Cloud BigQuery + * error codes + */ +public final class BigQuerySQLException extends SQLException { + + private static final long serialVersionUID = -5006625989225438209L; + private final List errors; + + public BigQuerySQLException() { + this.errors = null; + } + + public BigQuerySQLException( + String msg) { // overloaded constructor with just message as an argument + super(msg); + this.errors = null; + } + + public BigQuerySQLException(List errors) { + this.errors = errors; + } + + public BigQuerySQLException(List errors, Throwable cause) { + super(cause != null ? cause.toString() : null); + this.errors = errors; + } + + public BigQuerySQLException(String reason, List errors) { + super(reason); + this.errors = errors; + } + + public BigQuerySQLException(String reason, Throwable cause, List errors) { + super(reason, cause); + this.errors = errors; + } + + public BigQuerySQLException(String reason, String sqlState, List errors) { + super(reason, sqlState); + this.errors = errors; + } + + public BigQuerySQLException( + String reason, String sqlState, int errorCode, List errors) { + super(reason, sqlState, errorCode); + this.errors = errors; + } + + public BigQuerySQLException( + String reason, String sqlState, int errorCode, Throwable cause, List errors) { + super(reason, sqlState, errorCode, cause); + this.errors = errors; + } + + /** + * Returns a list of {@link BigQueryError}s that caused this exception. Returns {@code null} if + * none exists. + */ + public List getErrors() { + return errors; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java new file mode 100644 index 0000000000..109838d8b2 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java @@ -0,0 +1,92 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.core.BetaApi; +import java.util.List; +import java.util.Map; + +/** + * A Connection is a session between a Java application and BigQuery. SQL statements are executed + * and results are returned within the context of a connection. + */ +public interface Connection { + + /** Sends a query cancel request. This call will return immediately */ + @BetaApi + boolean close() throws BigQuerySQLException; + + /** + * Execute a query dry run that returns information on the schema and query parameters of the + * query results. + * + * @param sql typically a static SQL SELECT statement + * @exception BigQuerySQLException if a database access error occurs + */ + @BetaApi + BigQueryDryRunResult dryRun(String sql) throws BigQuerySQLException; + + /** + * Execute a SQL statement that returns a single ResultSet. + * + *

    Example of running a query. + * + *

    +   * {
    +   *   @code
    +   *   ConnectionSettings connectionSettings =
    +   *        ConnectionSettings.newBuilder()
    +   *            .setRequestTimeout(10L)
    +   *            .setMaxResults(100L)
    +   *            .setUseQueryCache(true)
    +   *            .build();
    +   *   Connection connection = bigquery.createConnection(connectionSettings);
    +   *   String selectQuery = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    +   *   BigQueryResult bqResultSet = connection.executeSelect(selectQuery)
    +   *   ResultSet rs = bqResultSet.getResultSet();
    +   *   while (rs.next()) {
    +   *       System.out.printf("%s,", rs.getString("corpus"));
    +   *   }
    +   * 
    + * + * @param sql a static SQL SELECT statement + * @return a ResultSet that contains the data produced by the query + * @exception BigQuerySQLException if a database access error occurs + */ + @BetaApi + BigQueryResult executeSelect(String sql) throws BigQuerySQLException; + + /** + * This method executes a SQL SELECT query + * + * @param sql SQL SELECT query + * @param parameters named or positional parameters. The set of query parameters must either be + * all positional or all named parameters. + * @param labels (optional) the labels associated with this query. You can use these to organize + * and group your query jobs. Label keys and values can be no longer than 63 characters, can + * only contain lowercase letters, numeric characters, underscores and dashes. International + * characters are allowed. Label values are optional and Label is a Varargs. You should pass + * all the Labels in a single Map .Label keys must start with a letter and each label in the + * list must have a different key. + * @return BigQueryResult containing the output of the query + * @throws BigQuerySQLException + */ + @BetaApi + BigQueryResult executeSelect( + String sql, List parameters, Map... labels) + throws BigQuerySQLException; +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java new file mode 100644 index 0000000000..c24a00888d --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -0,0 +1,1240 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static com.google.cloud.RetryHelper.runWithRetries; +import static java.net.HttpURLConnection.HTTP_NOT_FOUND; + +import com.google.api.core.BetaApi; +import com.google.api.services.bigquery.model.GetQueryResultsResponse; +import com.google.api.services.bigquery.model.JobConfigurationQuery; +import com.google.api.services.bigquery.model.QueryParameter; +import com.google.api.services.bigquery.model.QueryRequest; +import com.google.api.services.bigquery.model.TableDataList; +import com.google.api.services.bigquery.model.TableRow; +import com.google.cloud.RetryHelper; +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.SessionInfo; +import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; +import com.google.cloud.bigquery.storage.v1.ArrowSchema; +import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.DataFormat; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Function; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.UUID; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import org.apache.arrow.memory.BufferAllocator; +import org.apache.arrow.memory.RootAllocator; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.VectorLoader; +import org.apache.arrow.vector.VectorSchemaRoot; +import org.apache.arrow.vector.ipc.ReadChannel; +import org.apache.arrow.vector.ipc.message.MessageSerializer; +import org.apache.arrow.vector.types.pojo.Field; +import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel; + +/** Implementation for {@link Connection}, the generic BigQuery connection API (not JDBC). */ +class ConnectionImpl implements Connection { + + private final ConnectionSettings connectionSettings; + private final BigQueryOptions bigQueryOptions; + private final BigQueryRpc bigQueryRpc; + private final BigQueryRetryConfig retryConfig; + private final int bufferSize; // buffer size in Producer Thread + private final int MAX_PROCESS_QUERY_THREADS_CNT = 5; + private final ExecutorService queryTaskExecutor = + Executors.newFixedThreadPool(MAX_PROCESS_QUERY_THREADS_CNT); + private final Logger logger = Logger.getLogger(this.getClass().getName()); + private BigQueryReadClient bqReadClient; + private static final long EXECUTOR_TIMEOUT_SEC = 5; + + ConnectionImpl( + ConnectionSettings connectionSettings, + BigQueryOptions bigQueryOptions, + BigQueryRpc bigQueryRpc, + BigQueryRetryConfig retryConfig) { + this.connectionSettings = connectionSettings; + this.bigQueryOptions = bigQueryOptions; + this.bigQueryRpc = bigQueryRpc; + this.retryConfig = retryConfig; + // Sets a reasonable buffer size (a blocking queue) if user input is suboptimal + this.bufferSize = + (connectionSettings == null + || connectionSettings.getNumBufferedRows() == null + || connectionSettings.getNumBufferedRows() < 10000 + ? 20000 + : Math.min(connectionSettings.getNumBufferedRows() * 2, 100000)); + } + + /** + * Cancel method shutdowns the pageFetcher and producerWorker threads gracefully using interrupt. + * The pageFetcher threat will not request for any subsequent threads after interrupting and + * shutdown as soon as any ongoing RPC call returns. The producerWorker will not populate the + * buffer with any further records and clear the buffer, put a EoF marker and shutdown. + * + * @return Boolean value true if the threads were interrupted + * @throws BigQuerySQLException + */ + @BetaApi + @Override + public synchronized boolean close() throws BigQuerySQLException { + queryTaskExecutor.shutdownNow(); + try { + queryTaskExecutor.awaitTermination( + EXECUTOR_TIMEOUT_SEC, TimeUnit.SECONDS); // wait for the executor shutdown + } catch (InterruptedException e) { + e.printStackTrace(); + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Exception while awaitTermination", + e); // Logging InterruptedException instead of throwing the exception back, close method + // will return queryTaskExecutor.isShutdown() + } + return queryTaskExecutor.isShutdown(); // check if the executor has been shutdown + } + + /** + * This method runs a dry run query + * + * @param sql SQL SELECT statement + * @return BigQueryDryRunResult containing List and Schema + * @throws BigQuerySQLException + */ + @BetaApi + @Override + public BigQueryDryRunResult dryRun(String sql) throws BigQuerySQLException { + com.google.api.services.bigquery.model.Job dryRunJob = createDryRunJob(sql); + Schema schema = Schema.fromPb(dryRunJob.getStatistics().getQuery().getSchema()); + List queryParametersPb = + dryRunJob.getStatistics().getQuery().getUndeclaredQueryParameters(); + List queryParameters = + Lists.transform(queryParametersPb, QUERY_PARAMETER_FROM_PB_FUNCTION); + QueryStatistics queryStatistics = JobStatistics.fromPb(dryRunJob); + SessionInfo sessionInfo = + queryStatistics.getSessionInfo() == null ? null : queryStatistics.getSessionInfo(); + BigQueryResultStats bigQueryResultStats = + new BigQueryResultStatsImpl(queryStatistics, sessionInfo); + return new BigQueryDryRunResultImpl(schema, queryParameters, bigQueryResultStats); + } + + /** + * This method executes a SQL SELECT query + * + * @param sql SQL SELECT statement + * @return BigQueryResult containing the output of the query + * @throws BigQuerySQLException + */ + @BetaApi + @Override + public BigQueryResult executeSelect(String sql) throws BigQuerySQLException { + try { + // use jobs.query if all the properties of connectionSettings are supported + if (isFastQuerySupported()) { + String projectId = bigQueryOptions.getProjectId(); + QueryRequest queryRequest = createQueryRequest(connectionSettings, sql, null, null); + return queryRpc(projectId, queryRequest, false); + } + // use jobs.insert otherwise + com.google.api.services.bigquery.model.Job queryJob = + createQueryJob(sql, connectionSettings, null, null); + JobId jobId = JobId.fromPb(queryJob.getJobReference()); + GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); + return getResultSet(firstPage, jobId, sql, false); + } catch (BigQueryException e) { + throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); + } + } + + /** + * This method executes a SQL SELECT query + * + * @param sql SQL SELECT query + * @param parameters named or positional parameters. The set of query parameters must either be + * all positional or all named parameters. + * @param labels the labels associated with this query. You can use these to organize and group + * your query jobs. Label keys and values can be no longer than 63 characters, can only + * contain lowercase letters, numeric characters, underscores and dashes. International + * characters are allowed. Label values are optional and Label is a Varargs. You should pass + * all the Labels in a single Map .Label keys must start with a letter and each label in the + * list must have a different key. + * @return BigQueryResult containing the output of the query + * @throws BigQuerySQLException + */ + @BetaApi + @Override + public BigQueryResult executeSelect( + String sql, List parameters, Map... labels) + throws BigQuerySQLException { + Map labelMap = null; + if (labels != null + && labels.length == 1) { // We expect label as a key value pair in a single Map + labelMap = labels[0]; + } + try { + // use jobs.query if possible + if (isFastQuerySupported()) { + final String projectId = bigQueryOptions.getProjectId(); + final QueryRequest queryRequest = + createQueryRequest(connectionSettings, sql, parameters, labelMap); + return queryRpc(projectId, queryRequest, parameters != null); + } + // use jobs.insert otherwise + com.google.api.services.bigquery.model.Job queryJob = + createQueryJob(sql, connectionSettings, parameters, labelMap); + JobId jobId = JobId.fromPb(queryJob.getJobReference()); + GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); + return getResultSet(firstPage, jobId, sql, parameters != null); + } catch (BigQueryException e) { + throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); + } + } + + @VisibleForTesting + BigQueryResult getResultSet( + GetQueryResultsResponse firstPage, JobId jobId, String sql, Boolean hasQueryParameters) { + if (firstPage.getJobComplete() + && firstPage.getTotalRows() + != null) { // firstPage.getTotalRows() is null if job is not complete + return getSubsequentQueryResultsWithJob( + firstPage.getTotalRows().longValue(), + (long) firstPage.getRows().size(), + jobId, + firstPage, + hasQueryParameters); + } else { // job is still running, use dryrun to get Schema + com.google.api.services.bigquery.model.Job dryRunJob = createDryRunJob(sql); + Schema schema = Schema.fromPb(dryRunJob.getStatistics().getQuery().getSchema()); + // TODO: check how can we get totalRows and pageRows while the job is still running. + // `firstPage.getTotalRows()` returns null + return getSubsequentQueryResultsWithJob( + null, null, jobId, firstPage, schema, hasQueryParameters); + } + } + + static class EndOfFieldValueList + extends AbstractList< + FieldValue> { // A reference of this class is used as a token to inform the thread + // consuming `buffer` BigQueryResultImpl that we have run out of records + @Override + public FieldValue get(int index) { + return null; + } + + @Override + public int size() { + return 0; + } + } + + private BigQueryResult queryRpc( + final String projectId, final QueryRequest queryRequest, Boolean hasQueryParameters) { + com.google.api.services.bigquery.model.QueryResponse results; + try { + results = + BigQueryRetryHelper.runWithRetries( + () -> bigQueryRpc.queryRpc(projectId, queryRequest), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock(), + retryConfig); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + + if (results.getErrors() != null) { + List bigQueryErrors = + results.getErrors().stream() + .map(BigQueryError.FROM_PB_FUNCTION) + .collect(Collectors.toList()); + // Throwing BigQueryException since there may be no JobId, and we want to stay consistent + // with the case where there is an HTTP error + throw new BigQueryException(bigQueryErrors); + } + + // Query finished running and we can paginate all the results + if (results.getJobComplete() && results.getSchema() != null) { + return processQueryResponseResults(results); + } else { + // Query is long-running (> 10s) and hasn't completed yet, or query completed but didn't + // return the schema, fallback to jobs.insert path. Some operations don't return the schema + // and can be optimized here, but this is left as future work. + Long totalRows = results.getTotalRows() == null ? null : results.getTotalRows().longValue(); + Long pageRows = results.getRows() == null ? null : (long) (results.getRows().size()); + JobId jobId = JobId.fromPb(results.getJobReference()); + GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); + return getSubsequentQueryResultsWithJob( + totalRows, pageRows, jobId, firstPage, hasQueryParameters); + } + } + + @VisibleForTesting + BigQueryResultStats getBigQueryResultSetStats(JobId jobId) { + // Create GetQueryResultsResponse query statistics + Job queryJob = getQueryJobRpc(jobId); + QueryStatistics queryStatistics = queryJob.getStatistics(); + SessionInfo sessionInfo = + queryStatistics.getSessionInfo() == null ? null : queryStatistics.getSessionInfo(); + return new BigQueryResultStatsImpl(queryStatistics, sessionInfo); + } + /* This method processed the first page of GetQueryResultsResponse and then it uses tabledata.list */ + @VisibleForTesting + BigQueryResult tableDataList(GetQueryResultsResponse firstPage, JobId jobId) { + Schema schema; + long numRows; + schema = Schema.fromPb(firstPage.getSchema()); + numRows = firstPage.getTotalRows().longValue(); + + BigQueryResultStats bigQueryResultStats = getBigQueryResultSetStats(jobId); + + // Keeps the deserialized records at the row level, which is consumed by BigQueryResult + BlockingQueue> buffer = new LinkedBlockingDeque<>(bufferSize); + + // Keeps the parsed FieldValueLists + BlockingQueue, Boolean>> pageCache = + new LinkedBlockingDeque<>( + getPageCacheSize(connectionSettings.getNumBufferedRows(), schema)); + + // Keeps the raw RPC responses + BlockingQueue> rpcResponseQueue = + new LinkedBlockingDeque<>( + getPageCacheSize(connectionSettings.getNumBufferedRows(), schema)); + + runNextPageTaskAsync(firstPage.getPageToken(), getDestinationTable(jobId), rpcResponseQueue); + + parseRpcDataAsync( + firstPage.getRows(), + schema, + pageCache, + rpcResponseQueue); // parses data on a separate thread, thus maximising processing + // throughput + + populateBufferAsync( + rpcResponseQueue, pageCache, buffer); // spawns a thread to populate the buffer + + // This will work for pagination as well, as buffer is getting updated asynchronously + return new BigQueryResultImpl>( + schema, numRows, buffer, bigQueryResultStats); + } + + @VisibleForTesting + BigQueryResult processQueryResponseResults( + com.google.api.services.bigquery.model.QueryResponse results) { + Schema schema; + long numRows; + schema = Schema.fromPb(results.getSchema()); + numRows = + results.getTotalRows() == null + ? 0 + : results.getTotalRows().longValue(); // in case of DML or DDL + // QueryResponse only provides cache hits, dmlStats, and sessionInfo as query processing + // statistics + DmlStats dmlStats = + results.getDmlStats() == null ? null : DmlStats.fromPb(results.getDmlStats()); + Boolean cacheHit = results.getCacheHit(); + QueryStatistics queryStatistics = + QueryStatistics.newBuilder().setDmlStats(dmlStats).setCacheHit(cacheHit).build(); + // We cannot directly set sessionInfo in QueryStatistics + SessionInfo sessionInfo = + results.getSessionInfo() == null + ? null + : JobStatistics.SessionInfo.fromPb(results.getSessionInfo()); + BigQueryResultStats bigQueryResultStats = + new BigQueryResultStatsImpl(queryStatistics, sessionInfo); + + BlockingQueue> buffer = new LinkedBlockingDeque<>(bufferSize); + BlockingQueue, Boolean>> pageCache = + new LinkedBlockingDeque<>( + getPageCacheSize(connectionSettings.getNumBufferedRows(), schema)); + BlockingQueue> rpcResponseQueue = + new LinkedBlockingDeque<>( + getPageCacheSize(connectionSettings.getNumBufferedRows(), schema)); + + JobId jobId = JobId.fromPb(results.getJobReference()); + + // Thread to make rpc calls to fetch data from the server + runNextPageTaskAsync(results.getPageToken(), getDestinationTable(jobId), rpcResponseQueue); + + // Thread to parse data received from the server to client library objects + parseRpcDataAsync(results.getRows(), schema, pageCache, rpcResponseQueue); + + // Thread to populate the buffer (a blocking queue) shared with the consumer + populateBufferAsync(rpcResponseQueue, pageCache, buffer); + + return new BigQueryResultImpl>( + schema, numRows, buffer, bigQueryResultStats); + } + + @VisibleForTesting + void runNextPageTaskAsync( + String firstPageToken, + TableId destinationTable, + BlockingQueue> rpcResponseQueue) { + // This thread makes the RPC calls and paginates + Runnable nextPageTask = + () -> { + String pageToken = firstPageToken; // results.getPageToken(); + try { + while (pageToken != null) { // paginate for non null token + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown()) { // do not process further pages and shutdown + break; + } + TableDataList tabledataList = tableDataListRpc(destinationTable, pageToken); + pageToken = tabledataList.getPageToken(); + rpcResponseQueue.put( + Tuple.of( + tabledataList, + true)); // this will be parsed asynchronously without blocking the current + // thread + } + rpcResponseQueue.put( + Tuple.of( + null, + false)); // this will stop the parseDataTask as well in case of interrupt or + // when the pagination completes + } catch (Exception e) { + throw new BigQueryException(0, e.getMessage(), e); + } + }; + queryTaskExecutor.execute(nextPageTask); + } + + /* + This method takes TableDataList from rpcResponseQueue and populates pageCache with FieldValueList + */ + @VisibleForTesting + void parseRpcDataAsync( + // com.google.api.services.bigquery.model.QueryResponse results, + List tableRows, + Schema schema, + BlockingQueue, Boolean>> pageCache, + BlockingQueue> rpcResponseQueue) { + + // parse and put the first page in the pageCache before the other pages are parsed from the RPC + // calls + Iterable firstFieldValueLists = getIterableFieldValueList(tableRows, schema); + try { + pageCache.put( + Tuple.of(firstFieldValueLists, true)); // this is the first page which we have received. + } catch (InterruptedException e) { + throw new BigQueryException(0, e.getMessage(), e); + } + + // rpcResponseQueue will get null tuple if Cancel method is called, so no need to explicitly use + // thread interrupt here + Runnable parseDataTask = + () -> { + try { + boolean hasMorePages = true; + while (hasMorePages) { + Tuple rpcResponse = rpcResponseQueue.take(); + TableDataList tabledataList = rpcResponse.x(); + hasMorePages = rpcResponse.y(); + if (tabledataList != null) { + Iterable fieldValueLists = + getIterableFieldValueList(tabledataList.getRows(), schema); // Parse + pageCache.put(Tuple.of(fieldValueLists, true)); + } + } + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted", + e); // Thread might get interrupted while calling the Cancel method, which is + // expected, so logging this instead of throwing the exception back + } + try { + pageCache.put(Tuple.of(null, false)); // no further pages + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted", + e); // Thread might get interrupted while calling the Cancel method, which is + // expected, so logging this instead of throwing the exception back + } + }; + queryTaskExecutor.execute(parseDataTask); + } + + @VisibleForTesting + void populateBufferAsync( + BlockingQueue> rpcResponseQueue, + BlockingQueue, Boolean>> pageCache, + BlockingQueue> buffer) { + Runnable populateBufferRunnable = + () -> { // producer thread populating the buffer + Iterable fieldValueLists = null; + boolean hasRows = true; // as we have to process the first page + while (hasRows) { + try { + Tuple, Boolean> nextPageTuple = pageCache.take(); + hasRows = nextPageTuple.y(); + fieldValueLists = nextPageTuple.x(); + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted", + e); // Thread might get interrupted while calling the Cancel method, which is + // expected, so logging this instead of throwing the exception back + } + + if (Thread.currentThread().isInterrupted() + || fieldValueLists + == null) { // do not process further pages and shutdown (outerloop) + break; + } + + for (FieldValueList fieldValueList : fieldValueLists) { + try { + if (Thread.currentThread() + .isInterrupted()) { // do not process further pages and shutdown (inner loop) + break; + } + buffer.put(fieldValueList); + } catch (InterruptedException e) { + throw new BigQueryException(0, e.getMessage(), e); + } + } + } + + if (Thread.currentThread() + .isInterrupted()) { // clear the buffer for any outstanding records + buffer.clear(); + rpcResponseQueue + .clear(); // IMP - so that if it's full then it unblocks and the interrupt logic + // could trigger + } + + try { + buffer.put( + new EndOfFieldValueList()); // All the pages has been processed, put this marker + } catch (InterruptedException e) { + throw new BigQueryException(0, e.getMessage(), e); + } finally { + queryTaskExecutor.shutdownNow(); // Shutdown the thread pool + } + }; + + queryTaskExecutor.execute(populateBufferRunnable); + } + + /* Helper method that parse and populate a page with TableRows */ + private static Iterable getIterableFieldValueList( + Iterable tableDataPb, final Schema schema) { + return ImmutableList.copyOf( + Iterables.transform( + tableDataPb != null ? tableDataPb : ImmutableList.of(), + new Function() { + final FieldList fields = schema != null ? schema.getFields() : null; + + @Override + public FieldValueList apply(TableRow rowPb) { + return FieldValueList.fromPb(rowPb.getF(), fields); + } + })); + } + + /* Helper method that determines the optimal number of caches pages to improve read performance */ + @VisibleForTesting + int getPageCacheSize(Integer numBufferedRows, Schema schema) { + final int MIN_CACHE_SIZE = 3; // Min number of pages to cache + final int MAX_CACHE_SIZE = 20; // //Min number of pages to cache + int numColumns = schema.getFields().size(); + int numCachedPages; + long numCachedRows = numBufferedRows == null ? 0 : numBufferedRows.longValue(); + + // TODO: Further enhance this logic depending on customer feedback on memory consumption + if (numCachedRows > 10000) { + numCachedPages = + 2; // the size of numBufferedRows is quite large and as per our tests we should be able to + // do enough even with low + } else if (numColumns > 15 + && numCachedRows + > 5000) { // too many fields are being read, setting the page size on the lower end + numCachedPages = 3; + } else if (numCachedRows < 2000 + && numColumns < 15) { // low pagesize with fewer number of columns, we can cache more pages + numCachedPages = 20; + } else { // default - under 10K numCachedRows with any number of columns + numCachedPages = 5; + } + return numCachedPages < MIN_CACHE_SIZE + ? MIN_CACHE_SIZE + : (Math.min( + numCachedPages, + MAX_CACHE_SIZE)); // numCachedPages should be between the defined min and max + } + + /* Returns query results using either tabledata.list or the high throughput Read API */ + @VisibleForTesting + BigQueryResult getSubsequentQueryResultsWithJob( + Long totalRows, + Long pageRows, + JobId jobId, + GetQueryResultsResponse firstPage, + Boolean hasQueryParameters) { + TableId destinationTable = getDestinationTable(jobId); + return useReadAPI(totalRows, pageRows, Schema.fromPb(firstPage.getSchema()), hasQueryParameters) + ? highThroughPutRead( + destinationTable, + firstPage.getTotalRows().longValue(), + Schema.fromPb(firstPage.getSchema()), + getBigQueryResultSetStats( + jobId)) // discord first page and stream the entire BigQueryResult using + // the Read API + : tableDataList(firstPage, jobId); + } + + /* Returns query results using either tabledata.list or the high throughput Read API */ + @VisibleForTesting + BigQueryResult getSubsequentQueryResultsWithJob( + Long totalRows, + Long pageRows, + JobId jobId, + GetQueryResultsResponse firstPage, + Schema schema, + Boolean hasQueryParameters) { + TableId destinationTable = getDestinationTable(jobId); + return useReadAPI(totalRows, pageRows, schema, hasQueryParameters) + ? highThroughPutRead( + destinationTable, + totalRows == null + ? -1L + : totalRows, // totalRows is null when the job is still running. TODO: Check if + // any workaround is possible + schema, + getBigQueryResultSetStats( + jobId)) // discord first page and stream the entire BigQueryResult using + // the Read API + : tableDataList(firstPage, jobId); + } + + /* Returns Job from jobId by calling the jobs.get API */ + private Job getQueryJobRpc(JobId jobId) { + final JobId completeJobId = + jobId + .setProjectId(bigQueryOptions.getProjectId()) + .setLocation( + jobId.getLocation() == null && bigQueryOptions.getLocation() != null + ? bigQueryOptions.getLocation() + : jobId.getLocation()); + com.google.api.services.bigquery.model.Job jobPb; + try { + jobPb = + runWithRetries( + () -> + bigQueryRpc.getQueryJob( + completeJobId.getProject(), + completeJobId.getJob(), + completeJobId.getLocation()), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock()); + if (bigQueryOptions.getThrowNotFound() && jobPb == null) { + throw new BigQueryException(HTTP_NOT_FOUND, "Query job not found"); + } + } catch (RetryHelper.RetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + return Job.fromPb(bigQueryOptions.getService(), jobPb); + } + + /* Returns the destinationTable from jobId by calling jobs.get API */ + @VisibleForTesting + TableId getDestinationTable(JobId jobId) { + Job job = getQueryJobRpc(jobId); + return ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable(); + } + + @VisibleForTesting + TableDataList tableDataListRpc(TableId destinationTable, String pageToken) { + try { + final TableId completeTableId = + destinationTable.setProjectId( + Strings.isNullOrEmpty(destinationTable.getProject()) + ? bigQueryOptions.getProjectId() + : destinationTable.getProject()); + TableDataList results = + runWithRetries( + () -> + bigQueryOptions + .getBigQueryRpcV2() + .listTableDataWithRowLimit( + completeTableId.getProject(), + completeTableId.getDataset(), + completeTableId.getTable(), + connectionSettings.getMaxResultPerPage(), + pageToken), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock()); + + return results; + } catch (RetryHelper.RetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + } + + @VisibleForTesting + BigQueryResult highThroughPutRead( + TableId destinationTable, long totalRows, Schema schema, BigQueryResultStats stats) { + + try { + if (bqReadClient == null) { // if the read client isn't already initialized. Not thread safe. + bqReadClient = BigQueryReadClient.create(); + } + String parent = String.format("projects/%s", destinationTable.getProject()); + String srcTable = + String.format( + "projects/%s/datasets/%s/tables/%s", + destinationTable.getProject(), + destinationTable.getDataset(), + destinationTable.getTable()); + + // Read all the columns if the source table (temp table) and stream the data back in Arrow + // format + ReadSession.Builder sessionBuilder = + ReadSession.newBuilder().setTable(srcTable).setDataFormat(DataFormat.ARROW); + + CreateReadSessionRequest.Builder builder = + CreateReadSessionRequest.newBuilder() + .setParent(parent) + .setReadSession(sessionBuilder) + .setMaxStreamCount(1) // Currently just one stream is allowed + // DO a regex check using order by and use multiple streams + ; + + ReadSession readSession = bqReadClient.createReadSession(builder.build()); + BlockingQueue buffer = new LinkedBlockingDeque<>(bufferSize); + Map arrowNameToIndex = new HashMap<>(); + // deserialize and populate the buffer async, so that the client isn't blocked + processArrowStreamAsync( + readSession, + buffer, + new ArrowRowReader(readSession.getArrowSchema(), arrowNameToIndex), + schema); + + logger.log(Level.INFO, "\n Using BigQuery Read API"); + return new BigQueryResultImpl(schema, totalRows, buffer, stats); + + } catch (IOException e) { + throw BigQueryException.translateAndThrow(e); + } + } + + private void processArrowStreamAsync( + ReadSession readSession, + BlockingQueue buffer, + ArrowRowReader reader, + Schema schema) { + + Runnable arrowStreamProcessor = + () -> { + try { + // Use the first stream to perform reading. + String streamName = readSession.getStreams(0).getName(); + ReadRowsRequest readRowsRequest = + ReadRowsRequest.newBuilder().setReadStream(streamName).build(); + + // Process each block of rows as they arrive and decode using our simple row reader. + com.google.api.gax.rpc.ServerStream stream = + bqReadClient.readRowsCallable().call(readRowsRequest); + for (ReadRowsResponse response : stream) { + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown()) { // do not process and shutdown + break; + } + reader.processRows(response.getArrowRecordBatch(), buffer, schema); + } + + } catch (Exception e) { + throw BigQueryException.translateAndThrow(e); + } finally { + try { + buffer.put(new BigQueryResultImpl.Row(null, true)); // marking end of stream + queryTaskExecutor.shutdownNow(); // Shutdown the thread pool + } catch (InterruptedException e) { + logger.log(Level.WARNING, "\n Error occurred ", e); + } + } + }; + + queryTaskExecutor.execute(arrowStreamProcessor); + } + + private class ArrowRowReader + implements AutoCloseable { // TODO: Update to recent version of Arrow to avoid memoryleak + + BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE); + + // Decoder object will be reused to avoid re-allocation and too much garbage collection. + private final VectorSchemaRoot root; + private final VectorLoader loader; + + private ArrowRowReader(ArrowSchema arrowSchema, Map arrowNameToIndex) + throws IOException { + org.apache.arrow.vector.types.pojo.Schema schema = + MessageSerializer.deserializeSchema( + new org.apache.arrow.vector.ipc.ReadChannel( + new ByteArrayReadableSeekableByteChannel( + arrowSchema.getSerializedSchema().toByteArray()))); + List vectors = new ArrayList<>(); + List fields = schema.getFields(); + for (int i = 0; i < fields.size(); i++) { + vectors.add(fields.get(i).createVector(allocator)); + arrowNameToIndex.put( + fields.get(i).getName(), + i); // mapping for getting against the field name in the result set + } + root = new VectorSchemaRoot(vectors); + loader = new VectorLoader(root); + } + + /** @param batch object returned from the ReadRowsResponse. */ + private void processRows( + ArrowRecordBatch batch, BlockingQueue buffer, Schema schema) + throws IOException { // deserialize the values and consume the hash of the values + try { + org.apache.arrow.vector.ipc.message.ArrowRecordBatch deserializedBatch = + MessageSerializer.deserializeRecordBatch( + new ReadChannel( + new ByteArrayReadableSeekableByteChannel( + batch.getSerializedRecordBatch().toByteArray())), + allocator); + + loader.load(deserializedBatch); + // Release buffers from batch (they are still held in the vectors in root). + deserializedBatch.close(); + + // Parse the vectors using BQ Schema. Deserialize the data at the row level and add it to + // the + // buffer + FieldList fields = schema.getFields(); + for (int rowNum = 0; + rowNum < root.getRowCount(); + rowNum++) { // for the given number of rows in the batch + + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown()) { // do not process and shutdown + break; // exit the loop, root will be cleared in the finally block + } + + Map curRow = new HashMap<>(); + for (int col = 0; col < fields.size(); col++) { // iterate all the vectors for a given row + com.google.cloud.bigquery.Field field = fields.get(col); + FieldVector curFieldVec = + root.getVector( + field.getName()); // can be accessed using the index or Vector/column name + curRow.put(field.getName(), curFieldVec.getObject(rowNum)); // Added the raw value + } + buffer.put(new BigQueryResultImpl.Row(curRow)); + } + root.clear(); // TODO: make sure to clear the root while implementing the thread + // interruption logic (Connection.close method) + + } catch (RuntimeException | InterruptedException e) { + throw BigQueryException.translateAndThrow(e); + } finally { + try { + root.clear(); + } catch (RuntimeException e) { + logger.log(Level.WARNING, "\n Error while clearing VectorSchemaRoot ", e); + } + } + } + + @Override + public void close() { + root.close(); + allocator.close(); + } + } + /*Returns just the first page of GetQueryResultsResponse using the jobId*/ + @VisibleForTesting + GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { + JobId completeJobId = + jobId + .setProjectId(bigQueryOptions.getProjectId()) + .setLocation( + jobId.getLocation() == null && bigQueryOptions.getLocation() != null + ? bigQueryOptions.getLocation() + : jobId.getLocation()); + try { + GetQueryResultsResponse results = + BigQueryRetryHelper.runWithRetries( + () -> + bigQueryRpc.getQueryResultsWithRowLimit( + completeJobId.getProject(), + completeJobId.getJob(), + completeJobId.getLocation(), + connectionSettings.getMaxResultPerPage()), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock(), + retryConfig); + + if (results.getErrors() != null) { + List bigQueryErrors = + results.getErrors().stream() + .map(BigQueryError.FROM_PB_FUNCTION) + .collect(Collectors.toList()); + // Throwing BigQueryException since there may be no JobId and we want to stay consistent + // with the case where there there is a HTTP error + throw new BigQueryException(bigQueryErrors); + } + return results; + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + } + + @VisibleForTesting + boolean isFastQuerySupported() { + // TODO: add regex logic to check for scripting + return connectionSettings.getClustering() == null + && connectionSettings.getCreateDisposition() == null + && connectionSettings.getDestinationEncryptionConfiguration() == null + && connectionSettings.getDestinationTable() == null + && connectionSettings.getJobTimeoutMs() == null + && connectionSettings.getMaximumBillingTier() == null + && connectionSettings.getPriority() == null + && connectionSettings.getRangePartitioning() == null + && connectionSettings.getSchemaUpdateOptions() == null + && connectionSettings.getTableDefinitions() == null + && connectionSettings.getTimePartitioning() == null + && connectionSettings.getUserDefinedFunctions() == null + && connectionSettings.getWriteDisposition() == null; + } + + @VisibleForTesting + boolean useReadAPI(Long totalRows, Long pageRows, Schema schema, Boolean hasQueryParameters) { + + // TODO(prasmish) get this logic review - totalRows and pageRows are returned null when the job + // is not complete + if ((totalRows == null || pageRows == null) + && Boolean.TRUE.equals( + connectionSettings + .getUseReadAPI())) { // totalRows and pageRows are returned null when the job is not + // complete + return true; + } + + // Schema schema = Schema.fromPb(tableSchema); + // Read API does not yet support Interval Type or QueryParameters + if (containsIntervalType(schema) || hasQueryParameters) { + logger.log(Level.INFO, "\n Schema has IntervalType, or QueryParameters. Disabling ReadAPI"); + return false; + } + + long resultRatio = totalRows / pageRows; + if (Boolean.TRUE.equals(connectionSettings.getUseReadAPI())) { + return resultRatio >= connectionSettings.getTotalToPageRowCountRatio() + && totalRows > connectionSettings.getMinResultSize(); + } else { + return false; + } + } + + // Does a BFS iteration to find out if there's an interval type in the schema. Implementation to + // be used until ReadAPI supports IntervalType + private boolean containsIntervalType(Schema schema) { + Queue fields = + new LinkedList(schema.getFields()); + while (!fields.isEmpty()) { + com.google.cloud.bigquery.Field curField = fields.poll(); + if (curField.getType().getStandardType() == StandardSQLTypeName.INTERVAL) { + return true; + } else if (curField.getType().getStandardType() == StandardSQLTypeName.STRUCT + || curField.getType().getStandardType() == StandardSQLTypeName.ARRAY) { + fields.addAll(curField.getSubFields()); + } + } + return false; + } + + // Used for job.query API endpoint + @VisibleForTesting + QueryRequest createQueryRequest( + ConnectionSettings connectionSettings, + String sql, + List queryParameters, + Map labels) { + QueryRequest content = new QueryRequest(); + String requestId = UUID.randomUUID().toString(); + + if (connectionSettings.getConnectionProperties() != null) { + content.setConnectionProperties( + connectionSettings.getConnectionProperties().stream() + .map(ConnectionProperty.TO_PB_FUNCTION) + .collect(Collectors.toList())); + } + if (connectionSettings.getDefaultDataset() != null) { + content.setDefaultDataset(connectionSettings.getDefaultDataset().toPb()); + } + if (connectionSettings.getMaximumBytesBilled() != null) { + content.setMaximumBytesBilled(connectionSettings.getMaximumBytesBilled()); + } + if (connectionSettings.getMaxResults() != null) { + content.setMaxResults(connectionSettings.getMaxResults()); + } + if (queryParameters != null) { + // content.setQueryParameters(queryParameters); + if (queryParameters.get(0).getName() == null) { + // If query parameter name is unset, then assume mode is positional + content.setParameterMode("POSITIONAL"); + // pass query parameters + List queryParametersPb = + Lists.transform(queryParameters, POSITIONAL_PARAMETER_TO_PB_FUNCTION); + content.setQueryParameters(queryParametersPb); + } else { + content.setParameterMode("NAMED"); + // pass query parameters + List queryParametersPb = + Lists.transform(queryParameters, NAMED_PARAMETER_TO_PB_FUNCTION); + content.setQueryParameters(queryParametersPb); + } + } + if (connectionSettings.getCreateSession() != null) { + content.setCreateSession(connectionSettings.getCreateSession()); + } + if (labels != null) { + content.setLabels(labels); + } + content.setQuery(sql); + content.setRequestId(requestId); + // The new Connection interface only supports StandardSQL dialect + content.setUseLegacySql(false); + return content; + } + + // Used by jobs.getQueryResults API endpoint + @VisibleForTesting + com.google.api.services.bigquery.model.Job createQueryJob( + String sql, + ConnectionSettings connectionSettings, + List queryParameters, + Map labels) { + com.google.api.services.bigquery.model.JobConfiguration configurationPb = + new com.google.api.services.bigquery.model.JobConfiguration(); + JobConfigurationQuery queryConfigurationPb = new JobConfigurationQuery(); + queryConfigurationPb.setQuery(sql); + if (queryParameters != null) { + if (queryParameters.get(0).getName() == null) { + // If query parameter name is unset, then assume mode is positional + queryConfigurationPb.setParameterMode("POSITIONAL"); + // pass query parameters + List queryParametersPb = + Lists.transform(queryParameters, POSITIONAL_PARAMETER_TO_PB_FUNCTION); + queryConfigurationPb.setQueryParameters(queryParametersPb); + } else { + queryConfigurationPb.setParameterMode("NAMED"); + // pass query parameters + List queryParametersPb = + Lists.transform(queryParameters, NAMED_PARAMETER_TO_PB_FUNCTION); + queryConfigurationPb.setQueryParameters(queryParametersPb); + } + } + if (connectionSettings.getDestinationTable() != null) { + queryConfigurationPb.setDestinationTable(connectionSettings.getDestinationTable().toPb()); + } + if (connectionSettings.getTableDefinitions() != null) { + queryConfigurationPb.setTableDefinitions( + Maps.transformValues( + connectionSettings.getTableDefinitions(), + ExternalTableDefinition.TO_EXTERNAL_DATA_FUNCTION)); + } + if (connectionSettings.getUserDefinedFunctions() != null) { + queryConfigurationPb.setUserDefinedFunctionResources( + connectionSettings.getUserDefinedFunctions().stream() + .map(UserDefinedFunction.TO_PB_FUNCTION) + .collect(Collectors.toList())); + } + if (connectionSettings.getCreateDisposition() != null) { + queryConfigurationPb.setCreateDisposition( + connectionSettings.getCreateDisposition().toString()); + } + if (connectionSettings.getWriteDisposition() != null) { + queryConfigurationPb.setWriteDisposition(connectionSettings.getWriteDisposition().toString()); + } + if (connectionSettings.getDefaultDataset() != null) { + queryConfigurationPb.setDefaultDataset(connectionSettings.getDefaultDataset().toPb()); + } + if (connectionSettings.getPriority() != null) { + queryConfigurationPb.setPriority(connectionSettings.getPriority().toString()); + } + if (connectionSettings.getAllowLargeResults() != null) { + queryConfigurationPb.setAllowLargeResults(connectionSettings.getAllowLargeResults()); + } + if (connectionSettings.getUseQueryCache() != null) { + queryConfigurationPb.setUseQueryCache(connectionSettings.getUseQueryCache()); + } + if (connectionSettings.getFlattenResults() != null) { + queryConfigurationPb.setFlattenResults(connectionSettings.getFlattenResults()); + } + if (connectionSettings.getMaximumBillingTier() != null) { + queryConfigurationPb.setMaximumBillingTier(connectionSettings.getMaximumBillingTier()); + } + if (connectionSettings.getMaximumBytesBilled() != null) { + queryConfigurationPb.setMaximumBytesBilled(connectionSettings.getMaximumBytesBilled()); + } + if (connectionSettings.getSchemaUpdateOptions() != null) { + ImmutableList.Builder schemaUpdateOptionsBuilder = new ImmutableList.Builder<>(); + for (JobInfo.SchemaUpdateOption schemaUpdateOption : + connectionSettings.getSchemaUpdateOptions()) { + schemaUpdateOptionsBuilder.add(schemaUpdateOption.name()); + } + queryConfigurationPb.setSchemaUpdateOptions(schemaUpdateOptionsBuilder.build()); + } + if (connectionSettings.getDestinationEncryptionConfiguration() != null) { + queryConfigurationPb.setDestinationEncryptionConfiguration( + connectionSettings.getDestinationEncryptionConfiguration().toPb()); + } + if (connectionSettings.getTimePartitioning() != null) { + queryConfigurationPb.setTimePartitioning(connectionSettings.getTimePartitioning().toPb()); + } + if (connectionSettings.getClustering() != null) { + queryConfigurationPb.setClustering(connectionSettings.getClustering().toPb()); + } + if (connectionSettings.getRangePartitioning() != null) { + queryConfigurationPb.setRangePartitioning(connectionSettings.getRangePartitioning().toPb()); + } + if (connectionSettings.getConnectionProperties() != null) { + queryConfigurationPb.setConnectionProperties( + connectionSettings.getConnectionProperties().stream() + .map(ConnectionProperty.TO_PB_FUNCTION) + .collect(Collectors.toList())); + } + if (connectionSettings.getCreateSession() != null) { + queryConfigurationPb.setCreateSession(connectionSettings.getCreateSession()); + } + if (connectionSettings.getJobTimeoutMs() != null) { + configurationPb.setJobTimeoutMs(connectionSettings.getJobTimeoutMs()); + } + if (labels != null) { + configurationPb.setLabels(labels); + } + // The new Connection interface only supports StandardSQL dialect + queryConfigurationPb.setUseLegacySql(false); + configurationPb.setQuery(queryConfigurationPb); + + com.google.api.services.bigquery.model.Job jobPb = + JobInfo.of(QueryJobConfiguration.fromPb(configurationPb)).toPb(); + com.google.api.services.bigquery.model.Job queryJob; + try { + queryJob = + BigQueryRetryHelper.runWithRetries( + () -> bigQueryRpc.createJobForQuery(jobPb), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock(), + retryConfig); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + return queryJob; + } + + // Used by dryRun + private com.google.api.services.bigquery.model.Job createDryRunJob(String sql) { + com.google.api.services.bigquery.model.JobConfiguration configurationPb = + new com.google.api.services.bigquery.model.JobConfiguration(); + configurationPb.setDryRun(true); + JobConfigurationQuery queryConfigurationPb = new JobConfigurationQuery(); + String parameterMode = sql.contains("?") ? "POSITIONAL" : "NAMED"; + queryConfigurationPb.setParameterMode(parameterMode); + queryConfigurationPb.setQuery(sql); + // UndeclaredQueryParameter is only supported in StandardSQL + queryConfigurationPb.setUseLegacySql(false); + if (connectionSettings.getDefaultDataset() != null) { + queryConfigurationPb.setDefaultDataset(connectionSettings.getDefaultDataset().toPb()); + } + if (connectionSettings.getCreateSession() != null) { + queryConfigurationPb.setCreateSession(connectionSettings.getCreateSession()); + } + configurationPb.setQuery(queryConfigurationPb); + + com.google.api.services.bigquery.model.Job jobPb = + JobInfo.of(QueryJobConfiguration.fromPb(configurationPb)).toPb(); + + com.google.api.services.bigquery.model.Job dryRunJob; + try { + dryRunJob = + BigQueryRetryHelper.runWithRetries( + () -> bigQueryRpc.createJobForQuery(jobPb), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock(), + retryConfig); + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + return dryRunJob; + } + + // Convert from Parameter wrapper class to positional QueryParameter generated class + private static final Function POSITIONAL_PARAMETER_TO_PB_FUNCTION = + value -> { + QueryParameter queryParameterPb = new QueryParameter(); + queryParameterPb.setParameterValue(value.getValue().toValuePb()); + queryParameterPb.setParameterType(value.getValue().toTypePb()); + return queryParameterPb; + }; + + // Convert from Parameter wrapper class to name QueryParameter generated class + private static final Function NAMED_PARAMETER_TO_PB_FUNCTION = + value -> { + QueryParameter queryParameterPb = new QueryParameter(); + queryParameterPb.setName(value.getName()); + queryParameterPb.setParameterValue(value.getValue().toValuePb()); + queryParameterPb.setParameterType(value.getValue().toTypePb()); + return queryParameterPb; + }; + + // Convert from QueryParameter class to the Parameter wrapper class + private static final Function QUERY_PARAMETER_FROM_PB_FUNCTION = + pb -> + Parameter.newBuilder() + .setName(pb.getName() == null ? "" : pb.getName()) + .setValue(QueryParameterValue.fromPb(pb.getParameterValue(), pb.getParameterType())) + .build(); +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java new file mode 100644 index 0000000000..ac3b1b1e05 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java @@ -0,0 +1,453 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.cloud.bigquery.JobInfo.CreateDisposition; +import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; +import com.google.cloud.bigquery.JobInfo.WriteDisposition; +import com.google.cloud.bigquery.QueryJobConfiguration.Priority; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +/** ConnectionSettings for setting up a BigQuery query connection. */ +@AutoValue +public abstract class ConnectionSettings { + ConnectionSettings() { + // Package private so users can't subclass it but AutoValue can. + } + + /** + * Returns useReadAPI flag, enabled by default. Read API will be used if the underlying conditions + * are satisfied and this flag is enabled + */ + @Nullable + public abstract Boolean getUseReadAPI(); + + /** Returns the synchronous response timeoutMs associated with this query */ + @Nullable + public abstract Long getRequestTimeout(); + + /** Returns the connection properties for connection string with this query */ + @Nullable + public abstract List getConnectionProperties(); + + /** Returns the default dataset */ + @Nullable + public abstract DatasetId getDefaultDataset(); + + /** Returns the limits the bytes billed for this job */ + @Nullable + public abstract Long getMaximumBytesBilled(); + + /** Returns the maximum number of rows of data */ + @Nullable + public abstract Long getMaxResults(); + + /** Returns the number of rows of data to pre-fetch */ + @Nullable + public abstract Integer getNumBufferedRows(); + + @Nullable + public abstract Integer getTotalToPageRowCountRatio(); + + @Nullable + public abstract Integer getMinResultSize(); + + @Nullable + public abstract Integer getMaxResultPerPage(); + + /** Returns whether to look for the result in the query cache */ + @Nullable + public abstract Boolean getUseQueryCache(); + + /** + * Returns whether nested and repeated fields should be flattened. If set to {@code false} {@link + * ConnectionSettings.Builder#setAllowLargeResults(Boolean)} must be {@code true}. + * + * @see Flatten + */ + @Nullable + public abstract Boolean getFlattenResults(); + + /** + * Returns the BigQuery Storage read API configuration @Nullable public abstract + * ReadClientConnectionConfiguration getReadClientConnectionConfiguration(); + */ + + /** + * Below properties are only supported by jobs.insert API and not yet supported by jobs.query API + * * + */ + + /** Returns the clustering specification for the destination table. */ + @Nullable + public abstract Clustering getClustering(); + + /** + * Returns whether the job is allowed to create new tables. + * + * @see + * Create Disposition + */ + @Nullable + public abstract CreateDisposition getCreateDisposition(); + + /** Returns the custom encryption configuration (e.g., Cloud KMS keys) */ + @Nullable + public abstract EncryptionConfiguration getDestinationEncryptionConfiguration(); + + /** + * Returns the table where to put query results. If not provided a new table is created. This + * value is required if {@link # allowLargeResults()} is {@code true}. + */ + @Nullable + public abstract TableId getDestinationTable(); + + /** Returns the timeout associated with this job */ + @Nullable + public abstract Long getJobTimeoutMs(); + + /** Returns the optional billing tier limit for this job. */ + @Nullable + public abstract Integer getMaximumBillingTier(); + + /** Returns the query priority. */ + @Nullable + public abstract Priority getPriority(); + + /** + * Returns whether the job is enabled to create arbitrarily large results. If {@code true} the + * query is allowed to create large results at a slight cost in performance. the query is allowed + * to create large results at a slight cost in performance. + * + * @see Returning + * Large Query Results + */ + @Nullable + public abstract Boolean getAllowLargeResults(); + + /** + * Returns whether to create a new session. + * + * @see Create Sessions + */ + @Nullable + public abstract Boolean getCreateSession(); + + /** Returns the range partitioning specification for the table */ + @Nullable + public abstract RangePartitioning getRangePartitioning(); + + /** + * [Experimental] Returns options allowing the schema of the destination table to be updated as a + * side effect of the query job. Schema update options are supported in two cases: when + * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination + * table is a partition of a table, specified by partition decorators. For normal tables, + * WRITE_TRUNCATE will always overwrite the schema. + */ + @Nullable + public abstract List getSchemaUpdateOptions(); + + /** + * Returns the external tables definitions. If querying external data sources outside of BigQuery, + * this value describes the data format, location and other properties of the data sources. By + * defining these properties, the data sources can be queried as if they were standard BigQuery + * tables. + */ + @Nullable + public abstract Map getTableDefinitions(); + + /** Returns the time partitioning specification for the destination table. */ + @Nullable + public abstract TimePartitioning getTimePartitioning(); + + /** + * Returns user defined function resources that can be used by this query. Function resources can + * either be defined inline ({@link UserDefinedFunction.Type#INLINE}) or loaded from a Google + * Cloud Storage URI ({@link UserDefinedFunction.Type#FROM_URI}. + */ + @Nullable + public abstract List getUserDefinedFunctions(); + + /** + * Returns the action that should occur if the destination table already exists. + * + * @see + * Write Disposition + */ + @Nullable + public abstract WriteDisposition getWriteDisposition(); + + /** Returns a builder pre-populated using the current values of this field. */ + public abstract Builder toBuilder(); + + /** Returns a builder for a {@code ConnectionSettings} object. */ + public static Builder newBuilder() { + return new AutoValue_ConnectionSettings.Builder().withDefaultValues(); + } + + @AutoValue.Builder + public abstract static class Builder { + + Builder withDefaultValues() { + return setUseReadAPI(true) // Read API is enabled by default + .setNumBufferedRows(10000) // 10K records will be kept in the buffer (Blocking Queue) + .setMinResultSize(200000) // Read API will be enabled when there are at least 100K records + .setTotalToPageRowCountRatio(3) // there should be at least 3 pages of records + .setMaxResultPerPage(100000); // page size for pagination + } + + /** + * Sets useReadAPI flag, enabled by default. Read API will be used if the underlying conditions + * are satisfied and this flag is enabled + * + * @param useReadAPI or {@code true} for none + */ + @Nullable + public abstract Builder setUseReadAPI(Boolean useReadAPI); + + /** + * Sets how long to wait for the query to complete, in milliseconds, before the request times + * out and returns. Note that this is only a timeout for the request, not the query. If the + * query takes longer to run than the timeout value, the call returns without any results and + * with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the + * query to complete and read the results. The default value is 10000 milliseconds (10 seconds). + * + * @param timeoutMs or {@code null} for none + */ + public abstract Builder setRequestTimeout(Long timeoutMs); + + /** + * Sets a connection-level property to customize query behavior. + * + * @param connectionProperties connectionProperties or {@code null} for none + */ + public abstract Builder setConnectionProperties(List connectionProperties); + + /** + * Sets the default dataset. This dataset is used for all unqualified table names used in the + * query. + */ + public abstract Builder setDefaultDataset(DatasetId datasetId); + + /** + * Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit + * will fail (without incurring a charge). If unspecified, this will be set to your project + * default. + * + * @param maximumBytesBilled maximum bytes billed for this job + */ + public abstract Builder setMaximumBytesBilled(Long maximumBytesBilled); + + /** + * Sets the maximum number of rows of data to return per page of results. Setting this flag to a + * small value such as 1000 and then paging through results might improve reliability when the + * query result set is large. In addition to this limit, responses are also limited to 10 MB. By + * default, there is no maximum row count, and only the byte limit applies. + * + * @param maxResults maxResults or {@code null} for none + */ + public abstract Builder setMaxResults(Long maxResults); + + /** + * Sets the number of rows in the buffer (a blocking queue) that query results are consumed + * from. + * + * @param numBufferedRows numBufferedRows or {@code null} for none + */ + public abstract Builder setNumBufferedRows(Integer numBufferedRows); + + /** + * Sets a ratio of the total number of records and the records returned in the current page. + * This value is checked before calling the Read API + * + * @param totalToPageRowCountRatio totalToPageRowCountRatio + */ + public abstract Builder setTotalToPageRowCountRatio(Integer totalToPageRowCountRatio); + + /** + * Sets the minimum result size for which the Read API will be enabled + * + * @param minResultSize minResultSize + */ + public abstract Builder setMinResultSize(Integer minResultSize); + + /** + * Sets the maximum records per page to be used for pagination. This is used as an input for the + * tabledata.list and jobs.getQueryResults RPC calls + * + * @param maxResultPerPage + */ + public abstract Builder setMaxResultPerPage(Integer maxResultPerPage); + + /** + * Sets whether to look for the result in the query cache. The query cache is a best-effort + * cache that will be flushed whenever tables in the query are modified. Moreover, the query + * cache is only available when {@link ConnectionSettings.Builder#setDestinationTable(TableId)} + * is not set. + * + * @see Query Caching + */ + public abstract Builder setUseQueryCache(Boolean useQueryCache); + + /** + * Sets whether nested and repeated fields should be flattened. If set to {@code false} {@link + * ConnectionSettings.Builder#setAllowLargeResults(Boolean)} must be {@code true}. By default + * results are flattened. + * + * @see Flatten + */ + public abstract Builder setFlattenResults(Boolean flattenResults); + + /* */ + /**/ + /** + * Sets the values necessary to determine whether table result will be read using the BigQuery + * Storage client Read API. The BigQuery Storage client Read API will be used to read the query + * result when the totalToFirstPageSizeRatio (default 3) and minimumTableSize (default 100 rows) + * conditions set are met. A ReadSession will be created using the Apache Arrow data format for + * serialization. + * + *

    It also sets the maximum number of table rows allowed in buffer before streaming them to + * the BigQueryResult. + * + * @param readClientConnectionConfiguration or {@code null} for none + */ + /* + public abstract Builder setReadClientConnectionConfiguration( + ReadClientConnectionConfiguration readClientConnectionConfiguration);*/ + + /** Sets the clustering specification for the destination table. */ + public abstract Builder setClustering(Clustering clustering); + + /** + * Sets whether the job is allowed to create tables. + * + * @see + * Create Disposition + */ + public abstract Builder setCreateDisposition(CreateDisposition createDisposition); + + /** + * Sets the custom encryption configuration (e.g., Cloud KMS keys). + * + * @param destinationEncryptionConfiguration destinationEncryptionConfiguration or {@code null} + * for none + */ + public abstract Builder setDestinationEncryptionConfiguration( + EncryptionConfiguration destinationEncryptionConfiguration); + + /** + * Sets the table where to put query results. If not provided a new table is created. This value + * is required if {@link ConnectionSettings.Builder#setAllowLargeResults(Boolean)} is set to + * {@code true}. + */ + public abstract Builder setDestinationTable(TableId destinationTable); + + /** + * [Optional] Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt + * to terminate the job. + * + * @param jobTimeoutMs jobTimeoutMs or {@code null} for none + */ + public abstract Builder setJobTimeoutMs(Long jobTimeoutMs); + + /** + * Limits the billing tier for this job. Queries that have resource usage beyond this tier will + * fail (without incurring a charge). If unspecified, this will be set to your project default. + * + * @param maximumBillingTier maximum billing tier for this job + */ + public abstract Builder setMaximumBillingTier(Integer maximumBillingTier); + + /** + * Sets a priority for the query. If not specified the priority is assumed to be {@link + * Priority#INTERACTIVE}. + */ + public abstract Builder setPriority(Priority priority); + + /** + * Sets whether the job is enabled to create arbitrarily large results. If {@code true} the + * query is allowed to create large results at a slight cost in performance. If {@code true} + * {@link ConnectionSettings.Builder#setDestinationTable(TableId)} must be provided. + * + * @see Returning + * Large Query Results + */ + public abstract Builder setAllowLargeResults(Boolean allowLargeResults); + + /** + * Sets whether to create a new session. If {@code true} a random session id will be generated + * by BigQuery. If false, runs query with an existing session_id passed in ConnectionProperty, + * otherwise runs query in non-session mode." + */ + public abstract Builder setCreateSession(Boolean createSession); + + /** + * Range partitioning specification for this table. Only one of timePartitioning and + * rangePartitioning should be specified. + * + * @param rangePartitioning rangePartitioning or {@code null} for none + */ + public abstract Builder setRangePartitioning(RangePartitioning rangePartitioning); + + /** + * [Experimental] Sets options allowing the schema of the destination table to be updated as a + * side effect of the query job. Schema update options are supported in two cases: when + * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination + * table is a partition of a table, specified by partition decorators. For normal tables, + * WRITE_TRUNCATE will always overwrite the schema. + */ + public abstract Builder setSchemaUpdateOptions(List schemaUpdateOptions); + + /** + * Sets the external tables definitions. If querying external data sources outside of BigQuery, + * this value describes the data format, location and other properties of the data sources. By + * defining these properties, the data sources can be queried as if they were standard BigQuery + * tables. + */ + public abstract Builder setTableDefinitions( + Map tableDefinitions); + + /** Sets the time partitioning specification for the destination table. */ + public abstract Builder setTimePartitioning(TimePartitioning timePartitioning); + + /** + * Sets user defined function resources that can be used by this query. Function resources can + * either be defined inline ({@link UserDefinedFunction#inline(String)}) or loaded from a Google + * Cloud Storage URI ({@link UserDefinedFunction#fromUri(String)}. + */ + public abstract Builder setUserDefinedFunctions(List userDefinedFunctions); + + /** + * Sets the action that should occur if the destination table already exists. + * + * @see + * Write Disposition + */ + public abstract Builder setWriteDisposition(WriteDisposition writeDisposition); + + /** Creates a {@code ConnectionSettings} object. */ + public abstract ConnectionSettings build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index ab9fdabb39..0ef1d1f947 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -21,6 +21,7 @@ import com.google.api.services.bigquery.model.JobStatistics2; import com.google.api.services.bigquery.model.JobStatistics3; import com.google.api.services.bigquery.model.JobStatistics4; +import com.google.api.services.bigquery.model.QueryParameter; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; import com.google.common.base.Function; @@ -339,6 +340,7 @@ public static class QueryStatistics extends JobStatistics { private final List queryPlan; private final List timeline; private final Schema schema; + private final List queryParameters; /** * StatementType represents possible types of SQL statements reported as part of the @@ -421,6 +423,7 @@ static final class Builder extends JobStatistics.Builder queryPlan; private List timeline; private Schema schema; + private List queryParameters; private Builder() {} @@ -569,6 +572,11 @@ Builder setSchema(Schema schema) { return self(); } + Builder setQueryParameters(List queryParameters) { + this.queryParameters = queryParameters; + return self(); + } + @Override QueryStatistics build() { return new QueryStatistics(this); @@ -595,6 +603,7 @@ private QueryStatistics(Builder builder) { this.queryPlan = builder.queryPlan; this.timeline = builder.timeline; this.schema = builder.schema; + this.queryParameters = builder.queryParameters; } /** Returns query statistics specific to the use of BI Engine. */ @@ -715,6 +724,14 @@ public Schema getSchema() { return schema; } + /** + * Standard SQL only: Returns a list of undeclared query parameters detected during a dry run + * validation. + */ + public List getQueryParameters() { + return queryParameters; + } + @Override ToStringHelper toStringHelper() { return super.toStringHelper() @@ -725,7 +742,8 @@ ToStringHelper toStringHelper() { .add("totalBytesProcessed", totalBytesProcessed) .add("queryPlan", queryPlan) .add("timeline", timeline) - .add("schema", schema); + .add("schema", schema) + .add("queryParameters", queryParameters); } @Override @@ -746,7 +764,8 @@ public final int hashCode() { totalBytesBilled, totalBytesProcessed, queryPlan, - schema); + schema, + queryParameters); } @Override @@ -788,6 +807,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (schema != null) { queryStatisticsPb.setSchema(schema.toPb()); } + if (queryParameters != null) { + queryStatisticsPb.setUndeclaredQueryParameters(queryParameters); + } return super.toPb().setQuery(queryStatisticsPb); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Parameter.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Parameter.java new file mode 100644 index 0000000000..9959feab91 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Parameter.java @@ -0,0 +1,70 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import javax.annotation.Nullable; + +/* Wrapper class for query parameters */ +@AutoValue +public abstract class Parameter { + Parameter() { + // Package private so users can't subclass it but AutoValue can. + } + + /** + * Returns the name of the query parameter. If unset, this is a positional parameter. Otherwise, + * should be unique within a query. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getName(); + + /** Returns the value for a query parameter along with its type. */ + public abstract QueryParameterValue getValue(); + + /** Returns a builder pre-populated using the current values of this field. */ + public abstract Builder toBuilder(); + + /** Returns a builder for a {@code Parameter} object. */ + public static Builder newBuilder() { + return new AutoValue_Parameter.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + + /** + * [Optional] Sets the name of the query parameter. If unset, this is a positional parameter. + * Otherwise, should be unique within a query. + * + * @param name name or {@code null} for none + */ + public abstract Builder setName(String name); + + /** + * Sets the the value for a query parameter along with its type. + * + * @param parameter parameter or {@code null} for none + */ + public abstract Builder setValue(QueryParameterValue parameter); + + /** Creates a {@code Parameter} object. */ + public abstract Parameter build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 48ec22cafa..cc726bdd15 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -166,6 +166,11 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this(); JobConfigurationQuery queryConfigurationPb = configurationPb.getQuery(); this.query = queryConfigurationPb.getQuery(); + // Allows to get undeclaredqueryparameters in jobstatistics2 + if (queryConfigurationPb.getQueryParameters() == null + && queryConfigurationPb.getParameterMode() != null) { + parameterMode = queryConfigurationPb.getParameterMode(); + } if (queryConfigurationPb.getQueryParameters() != null && !queryConfigurationPb.getQueryParameters().isEmpty()) { if (queryConfigurationPb.getQueryParameters().get(0).getName() == null) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java new file mode 100644 index 0000000000..e0805a11e9 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +/** Represents BigQueryStorage Read client connection information. */ +@AutoValue +public abstract class ReadClientConnectionConfiguration implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + + /** + * Sets the total row count to page row count ratio used to determine whether to us the + * BigQueryStorage Read client to fetch result sets after the first page. + */ + @Nullable + public abstract Builder setTotalToPageRowCountRatio(Long ratio); + + /** + * Sets the minimum number of table rows in the query results used to determine whether to us + * the BigQueryStorage Read client to fetch result sets after the first page. + */ + @Nullable + public abstract Builder setMinResultSize(Long numRows); + + /** + * Sets the maximum number of table rows allowed in buffer before streaming them to the + * BigQueryResult. + */ + @Nullable + public abstract Builder setBufferSize(Long bufferSize); + + /** Creates a {@code ReadClientConnectionConfiguration} object. */ + public abstract ReadClientConnectionConfiguration build(); + } + + /** Returns the totalToPageRowCountRatio in this configuration. */ + public abstract Long getTotalToPageRowCountRatio(); + + /** Returns the minResultSize in this configuration. */ + public abstract Long getMinResultSize(); + + /** Returns the bufferSize in this configuration. */ + public abstract Long getBufferSize(); + + public abstract Builder toBuilder(); + + /** Returns a builder for a {@code ReadClientConnectionConfiguration} object. */ + public static Builder newBuilder() { + return new AutoValue_ReadClientConnectionConfiguration.Builder(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 06488c5b4f..871590ca4b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -122,6 +122,13 @@ Boolean getBoolean(Map options) { */ Job create(Job job, Map options); + /** + * Creates a new query job. + * + * @throws BigQueryException upon failure + */ + Job createJobForQuery(Job job); + /** * Delete the requested dataset. * @@ -246,6 +253,14 @@ TableDataInsertAllResponse insertAll( TableDataList listTableData( String projectId, String datasetId, String tableId, Map options); + /** + * Lists the table's rows with a limit on how many rows of data to pre-fetch. + * + * @throws BigQueryException upon failure + */ + TableDataList listTableDataWithRowLimit( + String projectId, String datasetId, String tableId, Integer rowLimit, String pageToken); + /** * Returns the requested job or {@code null} if not found. * @@ -253,6 +268,13 @@ TableDataList listTableData( */ Job getJob(String projectId, String jobId, String location, Map options); + /** + * Returns the requested query job or {@code null} if not found. + * + * @throws BigQueryException upon failure + */ + Job getQueryJob(String projectId, String jobId, String location); + /** * Lists the project's jobs. * @@ -286,6 +308,15 @@ TableDataList listTableData( GetQueryResultsResponse getQueryResults( String projectId, String jobId, String location, Map options); + /** + * Returns results of the query with a limit on how many rows of data to pre-fetch associated with + * the provided job. + * + * @throws BigQueryException upon failure + */ + GetQueryResultsResponse getQueryResultsWithRowLimit( + String projectId, String jobId, String location, Integer preFetchedRowLimit); + /** * Runs a BigQuery SQL query synchronously and returns query results if the query completes within * a specified timeout. diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 24d7dd6b0b..d6b57a3daf 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -221,6 +221,19 @@ public Job create(Job job, Map options) { } } + @Override + public Job createJobForQuery(Job job) { + try { + String projectId = + job.getJobReference() != null + ? job.getJobReference().getProjectId() + : this.options.getProjectId(); + return bigquery.jobs().insert(projectId, job).setPrettyPrint(false).execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + @Override public boolean deleteDataset(String projectId, String datasetId, Map options) { try { @@ -515,6 +528,26 @@ public TableDataList listTableData( } } + @Override + public TableDataList listTableDataWithRowLimit( + String projectId, + String datasetId, + String tableId, + Integer maxResultPerPage, + String pageToken) { + try { + return bigquery + .tabledata() + .list(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .setPageToken(pageToken) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + @Override public Job getJob(String projectId, String jobId, String location, Map options) { try { @@ -534,6 +567,24 @@ public Job getJob(String projectId, String jobId, String location, Map> listJobs(String projectId, Map options) { try { @@ -644,6 +695,22 @@ public GetQueryResultsResponse getQueryResults( } } + @Override + public GetQueryResultsResponse getQueryResultsWithRowLimit( + String projectId, String jobId, String location, Integer maxResultPerPage) { + try { + return bigquery + .jobs() + .getQueryResults(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .execute(); + } catch (IOException ex) { + throw translate(ex); + } + } + @Override public QueryResponse queryRpc(String projectId, QueryRequest content) { try { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java new file mode 100644 index 0000000000..e4fdc97318 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -0,0 +1,542 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; +import static org.mockito.Mockito.verify; + +import com.google.api.services.bigquery.model.*; +import com.google.api.services.bigquery.model.QueryResponse; +import com.google.cloud.ServiceOptions; +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.spi.BigQueryRpcFactory; +import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.common.collect.ImmutableList; +import java.math.BigInteger; +import java.sql.SQLException; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingDeque; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class ConnectionImplTest { + private BigQueryOptions options; + private BigQueryRpcFactory rpcFactoryMock; + private BigQueryRpc bigqueryRpcMock; + private Connection connectionMock; + private BigQuery bigquery; + private ConnectionImpl connection; + private static final String PROJECT = "project"; + private static final String JOB = "job"; + private static final String LOCATION = "US"; + private static final String DEFAULT_TEST_DATASET = "bigquery_test_dataset"; + private static final String PAGE_TOKEN = "ABCD123"; + private static final TableId TABLE_NAME = TableId.of(DEFAULT_TEST_DATASET, PROJECT); + private static final TableCell STRING_CELL = new TableCell().setV("Value"); + private static final TableRow TABLE_ROW = new TableRow().setF(ImmutableList.of(STRING_CELL)); + private static final String SQL_QUERY = + "SELECT county, state_name FROM bigquery_test_dataset.large_data_testing_table limit 2"; + private static final String DRY_RUN_SQL = + "SELECT county, state_name FROM bigquery_test_dataset.large_data_testing_table where country = ?"; + private static final int DEFAULT_PAGE_SIZE = 10000; + private ConnectionSettings connectionSettings; + private static final Schema QUERY_SCHEMA = + Schema.of( + Field.newBuilder("country", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("state_name", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + private static final TableSchema FAST_QUERY_TABLESCHEMA = QUERY_SCHEMA.toPb(); + private static final BigQueryResult BQ_RS_MOCK_RES = + new BigQueryResultImpl(QUERY_SCHEMA, 2, null, null); + + private static final BigQueryResult BQ_RS_MOCK_RES_MULTI_PAGE = + new BigQueryResultImpl(QUERY_SCHEMA, 4, null, null); + + private static final JobId QUERY_JOB = JobId.of(PROJECT, JOB).setLocation(LOCATION); + private static final GetQueryResultsResponse GET_QUERY_RESULTS_RESPONSE = + new GetQueryResultsResponse() + .setJobReference(QUERY_JOB.toPb()) + .setRows(ImmutableList.of(TABLE_ROW)) + .setJobComplete(true) + .setCacheHit(false) + .setPageToken(PAGE_TOKEN) + .setTotalBytesProcessed(42L) + .setTotalRows(BigInteger.valueOf(1L)) + .setSchema(FAST_QUERY_TABLESCHEMA); + + private BigQueryOptions createBigQueryOptionsForProject( + String project, BigQueryRpcFactory rpcFactory) { + return BigQueryOptions.newBuilder() + .setProjectId(project) + .setServiceRpcFactory(rpcFactory) + .setRetrySettings(ServiceOptions.getNoRetrySettings()) + .build(); + } + + @Before + public void setUp() { + rpcFactoryMock = mock(BigQueryRpcFactory.class); + bigqueryRpcMock = mock(BigQueryRpc.class); + connectionMock = mock(Connection.class); + when(rpcFactoryMock.create(any(BigQueryOptions.class))).thenReturn(bigqueryRpcMock); + options = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); + bigquery = options.getService(); + + connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DEFAULT_TEST_DATASET)) + .setNumBufferedRows(DEFAULT_PAGE_SIZE) + .build(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + connection = (ConnectionImpl) bigquery.createConnection(connectionSettings); + assertNotNull(connection); + } + + @Test + public void testFastQuerySinglePage() throws BigQuerySQLException { + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = + new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); + when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + .thenReturn(mockQueryRes); + ConnectionImpl connectionSpy = Mockito.spy(connection); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .processQueryResponseResults(any(QueryResponse.class)); + + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + } + + @Test + // NOTE: This doesn't truly paginates. Returns a response while mocking + // processQueryResponseResults + public void testFastQueryMultiplePages() throws BigQuerySQLException { + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = + new QueryResponse() + .setSchema(FAST_QUERY_TABLESCHEMA) + .setJobComplete(true) + .setPageToken(PAGE_TOKEN); + when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + .thenReturn(mockQueryRes); + ConnectionImpl connectionSpy = Mockito.spy(connection); + + doReturn(BQ_RS_MOCK_RES_MULTI_PAGE) + .when(connectionSpy) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 4); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + } + + @Test + public void testClose() throws BigQuerySQLException { + boolean cancelled = connection.close(); + assertTrue(cancelled); + } + + @Test + public void testQueryDryRun() throws BigQuerySQLException { + List queryParametersMock = + ImmutableList.of( + new QueryParameter().setParameterType(new QueryParameterType().setType("STRING"))); + com.google.api.services.bigquery.model.JobStatistics2 queryMock = + new com.google.api.services.bigquery.model.JobStatistics2() + .setSchema(FAST_QUERY_TABLESCHEMA) + .setUndeclaredQueryParameters(queryParametersMock); + com.google.api.services.bigquery.model.JobStatistics jobStatsMock = + new com.google.api.services.bigquery.model.JobStatistics() + .setCreationTime(1234L) + .setStartTime(5678L) + .setQuery(queryMock); + com.google.api.services.bigquery.model.JobConfigurationQuery jobConfigurationQuery = + new com.google.api.services.bigquery.model.JobConfigurationQuery(); + com.google.api.services.bigquery.model.JobConfiguration jobConfig = + new com.google.api.services.bigquery.model.JobConfiguration() + .setQuery(jobConfigurationQuery); + com.google.api.services.bigquery.model.Job mockDryRunJob = + new com.google.api.services.bigquery.model.Job() + .setStatistics(jobStatsMock) + .setConfiguration(jobConfig); + when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + .thenReturn(mockDryRunJob); + BigQueryDryRunResult dryRunResult = connection.dryRun(DRY_RUN_SQL); + assertEquals(1, dryRunResult.getQueryParameters().size()); + assertEquals(QUERY_SCHEMA, dryRunResult.getSchema()); + verify(bigqueryRpcMock, times(1)) + .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + } + + @Test + public void testParseDataTask() throws InterruptedException { + List tableRows = + ImmutableList.of( + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value1"), new TableCell().setV("Value2"))), + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value3"), new TableCell().setV("Value4")))); + + BlockingQueue, Boolean>> pageCache = + new LinkedBlockingDeque<>(2); + BlockingQueue> rpcResponseQueue = new LinkedBlockingDeque<>(2); + rpcResponseQueue.offer(Tuple.of(null, false)); + // This call should populate page cache + ConnectionImpl connectionSpy = Mockito.spy(connection); + connectionSpy.parseRpcDataAsync(tableRows, QUERY_SCHEMA, pageCache, rpcResponseQueue); + Tuple, Boolean> fvlTupple = + pageCache.take(); // wait for the parser thread to parse the data + assertNotNull(fvlTupple); + Iterable iterableFvl = fvlTupple.x(); + int rowCnt = 0; + for (FieldValueList fvl : iterableFvl) { + assertEquals(2, fvl.size()); // both the rows should have 2 fields each + rowCnt++; + } + assertEquals(2, rowCnt); // row rows read + + verify(connectionSpy, times(1)) + .parseRpcDataAsync( + any(List.class), any(Schema.class), any(BlockingQueue.class), any(BlockingQueue.class)); + } + + @Test + public void testPopulateBuffer() throws InterruptedException { + List tableRows = + ImmutableList.of( + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value1"), new TableCell().setV("Value2"))), + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value3"), new TableCell().setV("Value4")))); + + BlockingQueue, Boolean>> pageCache = + new LinkedBlockingDeque<>(2); + BlockingQueue> rpcResponseQueue = new LinkedBlockingDeque<>(2); + BlockingQueue> buffer = new LinkedBlockingDeque<>(5); + rpcResponseQueue.offer(Tuple.of(null, false)); + // This call should populate page cache + ConnectionImpl connectionSpy = Mockito.spy(connection); + + connectionSpy.parseRpcDataAsync(tableRows, QUERY_SCHEMA, pageCache, rpcResponseQueue); + + verify(connectionSpy, times(1)) + .parseRpcDataAsync( + any(List.class), any(Schema.class), any(BlockingQueue.class), any(BlockingQueue.class)); + + // now pass the pageCache to populateBuffer method + connectionSpy.populateBufferAsync(rpcResponseQueue, pageCache, buffer); + // check if buffer was populated with two rows async by using the blocking take method + AbstractList fvl1 = buffer.take(); + assertNotNull(fvl1); + assertEquals(2, fvl1.size()); + assertEquals("Value1", fvl1.get(0).getValue().toString()); + assertEquals("Value2", fvl1.get(1).getValue().toString()); + AbstractList fvl2 = buffer.take(); + assertNotNull(fvl2); + assertEquals(2, fvl2.size()); + assertEquals("Value3", fvl2.get(0).getValue().toString()); + assertEquals("Value4", fvl2.get(1).getValue().toString()); + verify(connectionSpy, times(1)) + .populateBufferAsync( + any(BlockingQueue.class), any(BlockingQueue.class), any(BlockingQueue.class)); + } + + @Test + public void testNextPageTask() throws InterruptedException { + BlockingQueue> rpcResponseQueue = new LinkedBlockingDeque<>(2); + TableDataList mockTabledataList = + new TableDataList() + .setPageToken(PAGE_TOKEN) + .setRows(ImmutableList.of(TABLE_ROW)) + .setTotalRows(1L); + ConnectionImpl connectionSpy = Mockito.spy(connection); + doReturn(mockTabledataList) + .when(connectionSpy) + .tableDataListRpc(any(TableId.class), any(String.class)); + connectionSpy.runNextPageTaskAsync(PAGE_TOKEN, TABLE_NAME, rpcResponseQueue); + Tuple tableDataListTuple = rpcResponseQueue.take(); + assertNotNull(tableDataListTuple); + TableDataList tableDataList = tableDataListTuple.x(); + assertNotNull(tableDataList); + assertEquals("ABCD123", tableDataList.getPageToken()); + assertEquals(Long.valueOf(1), tableDataList.getTotalRows()); + verify(connectionSpy, times(1)) + .runNextPageTaskAsync(any(String.class), any(TableId.class), any(BlockingQueue.class)); + } + + @Test + public void testGetQueryResultsFirstPage() { + when(bigqueryRpcMock.getQueryResultsWithRowLimit( + any(String.class), any(String.class), any(String.class), any(Integer.class))) + .thenReturn(GET_QUERY_RESULTS_RESPONSE); + GetQueryResultsResponse response = connection.getQueryResultsFirstPage(QUERY_JOB); + assertNotNull(response); + assertEquals(GET_QUERY_RESULTS_RESPONSE, response); + verify(bigqueryRpcMock, times(1)) + .getQueryResultsWithRowLimit( + any(String.class), any(String.class), any(String.class), any(Integer.class)); + } + + // calls executeSelect with a nonFast query and exercises createQueryJob + @Test + public void testLegacyQuerySinglePage() throws BigQuerySQLException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + // .setConfiguration(QUERY_JOB.g) + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")); + // emulating a legacy query + doReturn(false).when(connectionSpy).isFastQuerySupported(); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .getSubsequentQueryResultsWithJob( + any(Long.class), + any(Long.class), + any(JobId.class), + any(GetQueryResultsResponse.class), + any(Boolean.class)); + when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + .thenReturn(jobResponseMock); // RPC call in createQueryJob + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(bigqueryRpcMock, times(1)) + .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + } + + // exercises getSubsequentQueryResultsWithJob for fast running queries + @Test + public void testFastQueryLongRunning() throws SQLException { + List tableRows = + ImmutableList.of( + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value1"), new TableCell().setV("Value2"))), + new TableRow() + .setF( + ImmutableList.of( + new TableCell().setV("Value3"), new TableCell().setV("Value4")))); + ConnectionImpl connectionSpy = Mockito.spy(connection); + // emulating a fast query + doReturn(true).when(connectionSpy).isFastQuerySupported(); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + + doReturn(TABLE_NAME).when(connectionSpy).getDestinationTable(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .tableDataList(any(GetQueryResultsResponse.class), any(JobId.class)); + + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = + new QueryResponse() + .setSchema(FAST_QUERY_TABLESCHEMA) + .setJobComplete(false) + .setTotalRows(new BigInteger(String.valueOf(4L))) + .setJobReference(QUERY_JOB.toPb()) + .setRows(tableRows); + when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + .thenReturn(mockQueryRes); + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(bigqueryRpcMock, times(1)).queryRpc(any(String.class), any(QueryRequest.class)); + } + + @Test + // Emulates first page response using getQueryResultsFirstPage(jobId) and then subsequent pages + // using getQueryResultsFirstPage(jobId) getSubsequentQueryResultsWithJob( + public void testLegacyQueryMultiplePages() throws SQLException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + com.google.api.services.bigquery.model.JobStatistics jobStatistics = + new com.google.api.services.bigquery.model.JobStatistics(); + // emulating a Legacy query + doReturn(false).when(connectionSpy).isFastQuerySupported(); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + doReturn(TABLE_NAME).when(connectionSpy).getDestinationTable(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .tableDataList(any(GetQueryResultsResponse.class), any(JobId.class)); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) + .setStatistics(jobStatistics); + when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + .thenReturn(jobResponseMock); // RPC call in createQueryJob + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(bigqueryRpcMock, times(1)) + .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + verify(connectionSpy, times(1)) + .tableDataList(any(GetQueryResultsResponse.class), any(JobId.class)); + } + + @Test + public void testExecuteSelectSlow() throws BigQuerySQLException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + doReturn(false).when(connectionSpy).isFastQuerySupported(); + com.google.api.services.bigquery.model.JobStatistics jobStatistics = + new com.google.api.services.bigquery.model.JobStatistics(); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) + .setStatistics(jobStatistics); + + doReturn(jobResponseMock) + .when(connectionSpy) + .createQueryJob(SQL_QUERY, connectionSettings, null, null); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + } + + @Test + public void testExecuteSelectSlowWithParams() throws BigQuerySQLException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + List parameters = new ArrayList<>(); + Map labels = new HashMap<>(); + doReturn(false).when(connectionSpy).isFastQuerySupported(); + com.google.api.services.bigquery.model.JobStatistics jobStatistics = + new com.google.api.services.bigquery.model.JobStatistics(); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) + .setStatistics(jobStatistics); + + doReturn(jobResponseMock) + .when(connectionSpy) + .createQueryJob(SQL_QUERY, connectionSettings, parameters, labels); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY, parameters, labels); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + } + + @Test + public void testGetSubsequentQueryResultsWithJob() { + ConnectionImpl connectionSpy = Mockito.spy(connection); + JobId jobId = mock(JobId.class); + BigQueryResultStats bqRsStats = mock(BigQueryResultStats.class); + doReturn(true) + .when(connectionSpy) + .useReadAPI(any(Long.class), any(Long.class), any(Schema.class), any(Boolean.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .highThroughPutRead( + any(TableId.class), any(Long.class), any(Schema.class), any(BigQueryResultStats.class)); + + doReturn(TABLE_NAME).when(connectionSpy).getDestinationTable(any(JobId.class)); + doReturn(bqRsStats).when(connectionSpy).getBigQueryResultSetStats(any(JobId.class)); + BigQueryResult res = + connectionSpy.getSubsequentQueryResultsWithJob( + 10000L, 100L, jobId, GET_QUERY_RESULTS_RESPONSE, false); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .getSubsequentQueryResultsWithJob(10000L, 100L, jobId, GET_QUERY_RESULTS_RESPONSE, false); + } + + @Test + public void testGetPageCacheSize() { + ConnectionImpl connectionSpy = Mockito.spy(connection); + // number of cached pages should be within a range + assertTrue(connectionSpy.getPageCacheSize(10000, QUERY_SCHEMA) >= 3); + assertTrue(connectionSpy.getPageCacheSize(100000000, QUERY_SCHEMA) <= 20); + verify(connectionSpy, times(2)).getPageCacheSize(any(Integer.class), any(Schema.class)); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java new file mode 100644 index 0000000000..8523825bca --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.bigquery.JobInfo.CreateDisposition; +import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; +import com.google.cloud.bigquery.JobInfo.WriteDisposition; +import com.google.cloud.bigquery.QueryJobConfiguration.Priority; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Map; +import org.junit.Test; + +public class ConnectionSettingsTest { + private static final String TEST_PROJECT_ID = "test-project-id"; + private static final DatasetId DATASET_ID = DatasetId.of("dataset"); + private static final TableId TABLE_ID = TableId.of("dataset", "table"); + private static final Long REQUEST_TIMEOUT = 10l; + private static final Integer NUM_BUFFERED_ROWS = 100; + private static final Long MAX_RESULTS = 1000l; + private static final List SOURCE_URIS = ImmutableList.of("uri1", "uri2"); + private static final String KEY = "time_zone"; + private static final String VALUE = "US/Eastern"; + private static final ConnectionProperty CONNECTION_PROPERTY = + ConnectionProperty.newBuilder().setKey(KEY).setValue(VALUE).build(); + private static final List CONNECTION_PROPERTIES = + ImmutableList.of(CONNECTION_PROPERTY); + private static final Field FIELD_SCHEMA1 = + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("FieldDescription1") + .build(); + private static final Field FIELD_SCHEMA2 = + Field.newBuilder("IntegerField", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REPEATED) + .setDescription("FieldDescription2") + .build(); + private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA1, FIELD_SCHEMA2); + private static final Integer MAX_BAD_RECORDS = 42; + private static final Boolean IGNORE_UNKNOWN_VALUES = true; + private static final String COMPRESSION = "GZIP"; + private static final CsvOptions CSV_OPTIONS = CsvOptions.newBuilder().build(); + private static final ExternalTableDefinition TABLE_CONFIGURATION = + ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) + .setCompression(COMPRESSION) + .setIgnoreUnknownValues(IGNORE_UNKNOWN_VALUES) + .setMaxBadRecords(MAX_BAD_RECORDS) + .build(); + private static final Map TABLE_DEFINITIONS = + ImmutableMap.of("tableName", TABLE_CONFIGURATION); + private static final CreateDisposition CREATE_DISPOSITION = CreateDisposition.CREATE_IF_NEEDED; + private static final WriteDisposition WRITE_DISPOSITION = WriteDisposition.WRITE_APPEND; + private static final Priority PRIORITY = Priority.BATCH; + private static final boolean ALLOW_LARGE_RESULTS = true; + private static final boolean USE_QUERY_CACHE = false; + private static final boolean FLATTEN_RESULTS = true; + private static final Integer MAX_BILLING_TIER = 123; + private static final Long MAX_BYTES_BILL = 12345L; + private static final List SCHEMA_UPDATE_OPTIONS = + ImmutableList.of(SchemaUpdateOption.ALLOW_FIELD_RELAXATION); + private static final List USER_DEFINED_FUNCTIONS = + ImmutableList.of(UserDefinedFunction.inline("Function"), UserDefinedFunction.fromUri("URI")); + private static final EncryptionConfiguration JOB_ENCRYPTION_CONFIGURATION = + EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); + private static final TimePartitioning TIME_PARTITIONING = + TimePartitioning.of(TimePartitioning.Type.DAY); + private static final Clustering CLUSTERING = + Clustering.newBuilder().setFields(ImmutableList.of("Foo", "Bar")).build(); + private static final Long TIMEOUT = 10L; + private static final RangePartitioning.Range RANGE = + RangePartitioning.Range.newBuilder().setStart(1L).setInterval(2L).setEnd(10L).build(); + private static final RangePartitioning RANGE_PARTITIONING = + RangePartitioning.newBuilder().setField("IntegerField").setRange(RANGE).build(); + + private static final ConnectionSettings CONNECTION_SETTINGS = + ConnectionSettings.newBuilder() + .setRequestTimeout(REQUEST_TIMEOUT) + .setNumBufferedRows(NUM_BUFFERED_ROWS) + .setMaxResults(MAX_RESULTS) + .setUseQueryCache(USE_QUERY_CACHE) + .setTableDefinitions(TABLE_DEFINITIONS) + .setAllowLargeResults(ALLOW_LARGE_RESULTS) + .setCreateDisposition(CREATE_DISPOSITION) + .setDefaultDataset(DATASET_ID) + .setDestinationTable(TABLE_ID) + .setWriteDisposition(WRITE_DISPOSITION) + .setPriority(PRIORITY) + .setFlattenResults(FLATTEN_RESULTS) + .setUserDefinedFunctions(USER_DEFINED_FUNCTIONS) + .setMaximumBillingTier(MAX_BILLING_TIER) + .setMaximumBytesBilled(MAX_BYTES_BILL) + .setSchemaUpdateOptions(SCHEMA_UPDATE_OPTIONS) + .setDestinationEncryptionConfiguration(JOB_ENCRYPTION_CONFIGURATION) + .setTimePartitioning(TIME_PARTITIONING) + .setClustering(CLUSTERING) + .setJobTimeoutMs(TIMEOUT) + .setRangePartitioning(RANGE_PARTITIONING) + .setConnectionProperties(CONNECTION_PROPERTIES) + .build(); + + @Test + public void testToBuilder() { + compareConnectionSettings(CONNECTION_SETTINGS, CONNECTION_SETTINGS.toBuilder().build()); + } + + @Test + public void testToBuilderIncomplete() { + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DATASET_ID).build(); + compareConnectionSettings(connectionSettings, connectionSettings.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(REQUEST_TIMEOUT, CONNECTION_SETTINGS.getRequestTimeout()); + assertEquals(NUM_BUFFERED_ROWS, CONNECTION_SETTINGS.getNumBufferedRows()); + assertEquals(MAX_RESULTS, CONNECTION_SETTINGS.getMaxResults()); + } + + private void compareConnectionSettings(ConnectionSettings expected, ConnectionSettings value) { + assertEquals(expected, value); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + assertEquals(expected.getRequestTimeout(), value.getRequestTimeout()); + assertEquals(expected.getNumBufferedRows(), value.getNumBufferedRows()); + assertEquals(expected.getMaxResults(), value.getMaxResults()); + assertEquals(expected.getAllowLargeResults(), value.getAllowLargeResults()); + assertEquals(expected.getCreateDisposition(), value.getCreateDisposition()); + assertEquals(expected.getDefaultDataset(), value.getDefaultDataset()); + assertEquals(expected.getDestinationTable(), value.getDestinationTable()); + assertEquals(expected.getFlattenResults(), value.getFlattenResults()); + assertEquals(expected.getPriority(), value.getPriority()); + assertEquals(expected.getTableDefinitions(), value.getTableDefinitions()); + assertEquals(expected.getUseQueryCache(), value.getUseQueryCache()); + assertEquals(expected.getUserDefinedFunctions(), value.getUserDefinedFunctions()); + assertEquals(expected.getWriteDisposition(), value.getWriteDisposition()); + assertEquals(expected.getMaximumBillingTier(), value.getMaximumBillingTier()); + assertEquals(expected.getMaximumBytesBilled(), value.getMaximumBytesBilled()); + assertEquals(expected.getSchemaUpdateOptions(), value.getSchemaUpdateOptions()); + assertEquals( + expected.getDestinationEncryptionConfiguration(), + value.getDestinationEncryptionConfiguration()); + assertEquals(expected.getTimePartitioning(), value.getTimePartitioning()); + assertEquals(expected.getClustering(), value.getClustering()); + assertEquals(expected.getJobTimeoutMs(), value.getJobTimeoutMs()); + assertEquals(expected.getRangePartitioning(), value.getRangePartitioning()); + assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index f3b60cebe7..348749b467 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -49,10 +49,15 @@ import com.google.cloud.bigquery.BigQuery.JobOption; import com.google.cloud.bigquery.BigQuery.TableField; import com.google.cloud.bigquery.BigQuery.TableOption; +import com.google.cloud.bigquery.BigQueryDryRunResult; import com.google.cloud.bigquery.BigQueryError; import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryResult; +import com.google.cloud.bigquery.BigQuerySQLException; import com.google.cloud.bigquery.Clustering; +import com.google.cloud.bigquery.Connection; import com.google.cloud.bigquery.ConnectionProperty; +import com.google.cloud.bigquery.ConnectionSettings; import com.google.cloud.bigquery.CopyJobConfiguration; import com.google.cloud.bigquery.Dataset; import com.google.cloud.bigquery.DatasetId; @@ -62,6 +67,7 @@ import com.google.cloud.bigquery.Field; import com.google.cloud.bigquery.FieldList; import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; import com.google.cloud.bigquery.FieldValueList; import com.google.cloud.bigquery.FormatOptions; import com.google.cloud.bigquery.HivePartitioningOptions; @@ -72,6 +78,9 @@ import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; import com.google.cloud.bigquery.JobStatistics.LoadStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; +import com.google.cloud.bigquery.JobStatistics.SessionInfo; import com.google.cloud.bigquery.JobStatistics.TransactionInfo; import com.google.cloud.bigquery.LegacySQLTypeName; import com.google.cloud.bigquery.LoadJobConfiguration; @@ -79,6 +88,7 @@ import com.google.cloud.bigquery.Model; import com.google.cloud.bigquery.ModelId; import com.google.cloud.bigquery.ModelInfo; +import com.google.cloud.bigquery.Parameter; import com.google.cloud.bigquery.ParquetOptions; import com.google.cloud.bigquery.PolicyTags; import com.google.cloud.bigquery.QueryJobConfiguration; @@ -129,7 +139,11 @@ import java.math.BigDecimal; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Time; import java.time.Instant; +import java.time.LocalTime; import java.time.Period; import java.util.ArrayList; import java.util.Collection; @@ -273,6 +287,103 @@ public class ITBigQueryTest { BIGNUMERIC_FIELD_SCHEMA3, BIGNUMERIC_FIELD_SCHEMA4); + private static final Schema BQ_RESULTSET_SCHEMA = + Schema.of( + Field.newBuilder("TimestampField", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .setDescription("TimestampDescription") + .build(), + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("StringDescription") + .build(), + Field.newBuilder("IntegerArrayField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.REPEATED) + .setDescription("IntegerArrayDescription") + .build(), + Field.newBuilder("BooleanField", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .setDescription("BooleanDescription") + .build(), + Field.newBuilder("BytesField", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .setDescription("BytesDescription") + .build(), + Field.newBuilder( + "RecordField", + StandardSQLTypeName.STRUCT, + Field.newBuilder("TimestampField", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .setDescription("TimestampDescription") + .build(), + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("StringDescription") + .build(), + Field.newBuilder("IntegerArrayField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.REPEATED) + .setDescription("IntegerArrayDescription") + .build(), + Field.newBuilder("BooleanField", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .setDescription("BooleanDescription") + .build(), + Field.newBuilder("BytesField", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .setDescription("BytesDescription") + .build()) + .setMode(Field.Mode.REQUIRED) + .setDescription("RecordDescription") + .build(), + Field.newBuilder("IntegerField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("IntegerDescription") + .build(), + Field.newBuilder("FloatField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("FloatDescription") + .build(), + Field.newBuilder("GeographyField", StandardSQLTypeName.GEOGRAPHY) + .setMode(Field.Mode.NULLABLE) + .setDescription("GeographyDescription") + .build(), + Field.newBuilder("NumericField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("NumericDescription") + .build(), + Field.newBuilder("BigNumericField", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumericDescription") + .build(), + Field.newBuilder("BigNumericField1", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumeric1Description") + .build(), + Field.newBuilder("BigNumericField2", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumeric2Description") + .build(), + Field.newBuilder("BigNumericField3", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumeric3Description") + .build(), + Field.newBuilder("BigNumericField4", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumeric4Description") + .build(), + Field.newBuilder("TimeField", StandardSQLTypeName.TIME) + .setMode(Field.Mode.NULLABLE) + .setDescription("TimeDescription") + .build(), + Field.newBuilder("DateField", StandardSQLTypeName.DATE) + .setMode(Field.Mode.NULLABLE) + .setDescription("DateDescription") + .build(), + Field.newBuilder("DateTimeField", StandardSQLTypeName.DATETIME) + .setMode(Field.Mode.NULLABLE) + .setDescription("DateTimeDescription") + .build()); + private static final Field DDL_TIMESTAMP_FIELD_SCHEMA = Field.newBuilder("TimestampField", LegacySQLTypeName.TIMESTAMP) .setDescription("TimestampDescription") @@ -316,6 +427,55 @@ public class ITBigQueryTest { Field.newBuilder("BooleanField", LegacySQLTypeName.BOOLEAN) .setMode(Field.Mode.NULLABLE) .build()); + + private static final Schema BQ_RESULTSET_EXPECTED_SCHEMA = + Schema.of( + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("BigNumericField", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("BooleanField", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("BytesField", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("IntegerField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("TimestampField", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("FloatField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("NumericField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("TimeField", StandardSQLTypeName.TIME) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("DateField", StandardSQLTypeName.DATE) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("DateTimeField", StandardSQLTypeName.DATETIME) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("GeographyField", StandardSQLTypeName.GEOGRAPHY) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("BytesField_1", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("BooleanField_1", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("IntegerArrayField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.REPEATED) + .build()); + private static final Schema QUERY_RESULT_SCHEMA_BIGNUMERIC = Schema.of( Field.newBuilder("TimestampField", LegacySQLTypeName.TIMESTAMP) @@ -360,6 +520,7 @@ public class ITBigQueryTest { private static final String LOAD_FILE = "load.csv"; private static final String LOAD_FILE_LARGE = "load_large.csv"; private static final String JSON_LOAD_FILE = "load.json"; + private static final String JSON_LOAD_FILE_BQ_RESULTSET = "load_bq_resultset.json"; private static final String JSON_LOAD_FILE_SIMPLE = "load_simple.json"; private static final String EXTRACT_FILE = "extract.csv"; private static final String EXTRACT_MODEL_FILE = "extract_model.csv"; @@ -368,7 +529,10 @@ public class ITBigQueryTest { private static final TableId TABLE_ID_DDL = TableId.of(DATASET, "ddl_testing_table"); private static final TableId TABLE_ID_FASTQUERY = TableId.of(DATASET, "fastquery_testing_table"); private static final TableId TABLE_ID_LARGE = TableId.of(DATASET, "large_data_testing_table"); + private static final TableId TABLE_ID_FASTQUERY_BQ_RESULTSET = + TableId.of(DATASET, "fastquery_testing_bq_resultset"); private static final String CSV_CONTENT = "StringValue1\nStringValue2\n"; + private static final String JSON_CONTENT = "{" + " \"TimestampField\": \"2014-08-19 07:41:35.220 -05:00\"," @@ -424,6 +588,64 @@ public class ITBigQueryTest { + " \"BigNumericField3\": \"578960446186580977117854925043439539266.34992332820282019728792003956564819967\"," + " \"BigNumericField4\": \"-578960446186580977117854925043439539266.34992332820282019728792003956564819968\"" + "}"; + + private static final String JSON_CONTENT_BQ_RESULTSET = + "{" + + " \"TimestampField\": null," + + " \"StringField\": null," + + " \"IntegerArrayField\": null," + + " \"BooleanField\": null," + + " \"BytesField\": null," + + " \"RecordField\": {" + + " \"TimestampField\": null," + + " \"StringField\": null," + + " \"IntegerArrayField\": null," + + " \"BooleanField\": null," + + " \"BytesField\": null" + + " }," + + " \"IntegerField\": null," + + " \"FloatField\": null," + + " \"GeographyField\": null," + + " \"NumericField\": null," + + " \"BigNumericField\": null," + + " \"BigNumericField1\": null," + + " \"BigNumericField2\": null," + + " \"BigNumericField3\": null," + + " \"BigNumericField4\": null," + + " \"TimeField\": null," + + " \"DateField\": null," + + " \"DateTimeField\": null" + + "}\n" + + "{" + + " \"TimestampField\": \"2018-08-19 12:11:35.123456 UTC\"," + + " \"StringField\": \"StringValue1\"," + + " \"IntegerArrayField\": [1,2,3,4]," + + " \"BooleanField\": \"false\"," + + " \"BytesField\": \"" + + BYTES_BASE64 + + "\"," + + " \"RecordField\": {" + + " \"TimestampField\": \"1969-07-20 20:18:04 UTC\"," + + " \"StringField\": null," + + " \"IntegerArrayField\": [1,0]," + + " \"BooleanField\": \"true\"," + + " \"BytesField\": \"" + + BYTES_BASE64 + + "\"" + + " }," + + " \"IntegerField\": \"1\"," + + " \"FloatField\": \"10.1\"," + + " \"GeographyField\": \"POINT(-122.35022 47.649154)\"," + + " \"NumericField\": \"100\"," + + " \"BigNumericField\": \"0.33333333333333333333333333333333333333\"," + + " \"BigNumericField1\": \"1e-38\"," + + " \"BigNumericField2\": \"-1e38\"," + + " \"BigNumericField3\": \"578960446186580977117854925043439539266.34992332820282019728792003956564819967\"," + + " \"BigNumericField4\": \"-578960446186580977117854925043439539266.34992332820282019728792003956564819968\"," + + " \"TimeField\": \"12:11:35.123456\"," + + " \"DateField\": \"2018-08-19\"," + + " \"DateTimeField\": \"2018-08-19 12:11:35.123456\"" + + "}"; private static final String JSON_CONTENT_SIMPLE = "{" + " \"TimestampField\": \"2014-08-19 07:41:35.220 -05:00\"," @@ -476,6 +698,11 @@ public static void beforeClass() throws InterruptedException, IOException { ITBigQueryTest.class.getClassLoader().getResourceAsStream("QueryTestData.csv"); storage.createFrom( BlobInfo.newBuilder(BUCKET, LOAD_FILE_LARGE).setContentType("text/plain").build(), stream); + storage.create( + BlobInfo.newBuilder(BUCKET, JSON_LOAD_FILE_BQ_RESULTSET) + .setContentType("application/json") + .build(), + JSON_CONTENT_BQ_RESULTSET.getBytes(StandardCharsets.UTF_8)); DatasetInfo info = DatasetInfo.newBuilder(DATASET).setDescription(DESCRIPTION).setLabels(LABELS).build(); bigquery.create(info); @@ -509,6 +736,19 @@ public static void beforeClass() throws InterruptedException, IOException { jobFastQuery = jobFastQuery.waitFor(); assertNull(jobFastQuery.getStatus().getError()); + LoadJobConfiguration configFastQueryBQResultset = + LoadJobConfiguration.newBuilder( + TABLE_ID_FASTQUERY_BQ_RESULTSET, + "gs://" + BUCKET + "/" + JSON_LOAD_FILE_BQ_RESULTSET, + FormatOptions.json()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(BQ_RESULTSET_SCHEMA) + .setLabels(labels) + .build(); + Job jobFastQueryBQResultSet = bigquery.create(JobInfo.of(configFastQueryBQResultset)); + jobFastQueryBQResultSet = jobFastQueryBQResultSet.waitFor(); + assertNull(jobFastQueryBQResultSet.getStatus().getError()); + LoadJobConfiguration configurationDDL = LoadJobConfiguration.newBuilder( TABLE_ID_DDL, "gs://" + BUCKET + "/" + JSON_LOAD_FILE_SIMPLE, FormatOptions.json()) @@ -712,6 +952,7 @@ public void testCreateTableWithRangePartitioning() { } } + /* TODO(prasmish): replicate this test case for executeSelect on the relevant part */ @Test public void testJsonType() throws InterruptedException { String tableName = "test_create_table_jsontype"; @@ -819,6 +1060,7 @@ public void testJsonType() throws InterruptedException { } } + /* TODO(prasmish): replicate this test case for executeSelect on the relevant part */ @Test public void testIntervalType() throws InterruptedException { String tableName = "test_create_table_intervaltype"; @@ -1701,6 +1943,7 @@ public void testInsertAllWithErrors() { assertTrue(bigquery.delete(TableId.of(DATASET, tableName))); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testListAllTableData() { Page rows = bigquery.listTableData(TABLE_ID); @@ -2036,6 +2279,7 @@ public void testAuthorizeDataset() { assertEquals(sharedDatasetAcl, updatedDataset.getAcl()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testSingleStatementsQueryException() throws InterruptedException { String invalidQuery = @@ -2052,6 +2296,7 @@ public void testSingleStatementsQueryException() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testMultipleStatementsQueryException() throws InterruptedException { String invalidQuery = @@ -2070,6 +2315,7 @@ public void testMultipleStatementsQueryException() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQuery() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); @@ -2102,6 +2348,16 @@ public void testQuery() throws InterruptedException { assertNotNull(statistics.getQueryPlan()); } + @Test + public void testExecuteSelectDefaultConnectionSettings() throws SQLException { + // Use the default connection settings + Connection connection = bigquery.createConnection(); + String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertEquals(42, bigQueryResult.getTotalRows()); + } + + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryTimeStamp() throws InterruptedException { String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; @@ -2136,6 +2392,7 @@ public void testQueryTimeStamp() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); @@ -2164,6 +2421,7 @@ public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedExc assertEquals(2, rowCount); } + /* TODO(prasmish): replicate bigquery.query part of the test case for executeSelect - modify this test case */ @Test public void testQueryExternalHivePartitioningOptionAutoLayout() throws InterruptedException { String tableName = "test_queryexternalhivepartition_autolayout_table"; @@ -2198,6 +2456,7 @@ public void testQueryExternalHivePartitioningOptionAutoLayout() throws Interrupt assertTrue(bigquery.delete(tableId)); } + /* TODO(prasmish): replicate bigquery.query part of the test case for executeSelect - modify this test case */ @Test public void testQueryExternalHivePartitioningOptionCustomLayout() throws InterruptedException { String tableName = "test_queryexternalhivepartition_customlayout_table"; @@ -2233,6 +2492,463 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru assertTrue(bigquery.delete(tableId)); } + @Test + public void testConnectionImplDryRun() throws SQLException { + String query = + String.format( + "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from %s where StringField = ? order by TimestampField", + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable()); + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setCreateSession(true) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryDryRunResult bigQueryDryRunResultSet = connection.dryRun(query); + assertNotNull(bigQueryDryRunResultSet.getSchema()); + assertEquals( + BQ_RESULTSET_EXPECTED_SCHEMA, bigQueryDryRunResultSet.getSchema()); // match the schema + List queryParameters = bigQueryDryRunResultSet.getQueryParameters(); + assertEquals(StandardSQLTypeName.STRING, queryParameters.get(0).getValue().getType()); + QueryStatistics queryStatistics = bigQueryDryRunResultSet.getStatistics().getQueryStatistics(); + assertNotNull(queryStatistics); + SessionInfo sessionInfo = bigQueryDryRunResultSet.getStatistics().getSessionInfo(); + assertNotNull(sessionInfo.getSessionId()); + assertEquals(StatementType.SELECT, queryStatistics.getStatementType()); + } + + @Test + // This test case test the order of the records, making sure that the result is not jumbled up due + // to the multithreaded BigQueryResult implementation + public void testBQResultSetMultiThreadedOrder() throws SQLException { + String query = + "SELECT date FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null order by date asc limit 300000"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(10000) // page size + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + assertTrue(rs.next()); + ++cnt; + java.sql.Date lastDate = rs.getDate(0); + while (rs.next()) { + assertNotNull(rs.getDate(0)); + assertTrue(rs.getDate(0).getTime() >= lastDate.getTime()); // sorted order is maintained + lastDate = rs.getDate(0); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + } + + @Test + public void testBQResultSetPaginationSlowQuery() throws SQLException { + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by date limit 300000"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(10000) // page size + .setJobTimeoutMs( + 15000L) // So that ConnectionImpl.isFastQuerySupported returns false, and the slow + // query route gets executed + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { // pagination starts after approx 120,000 records + assertNotNull(rs.getDate(0)); + assertNotNull(rs.getString(1)); + assertNotNull(rs.getString(2)); + assertTrue(rs.getInt(3) >= 0); + assertTrue(rs.getInt(4) >= 0); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + } + + @Test + public void testExecuteSelectSinglePageTableRow() throws SQLException { + String query = + "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " + + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + " order by TimestampField"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + Schema sc = bigQueryResult.getSchema(); + + assertEquals(BQ_RESULTSET_EXPECTED_SCHEMA, sc); // match the schema + assertEquals(2, bigQueryResult.getTotalRows()); // Expecting 2 rows + + assertTrue(rs.next()); // first row + // checking for the null or 0 column values + assertNull(rs.getString("StringField")); + assertTrue(rs.getDouble("BigNumericField") == 0.0d); + assertFalse(rs.getBoolean("BooleanField")); + assertNull(rs.getBytes("BytesField")); + assertEquals(rs.getInt("IntegerField"), 0); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getDate("DateField")); + assertTrue(rs.getDouble("FloatField") == 0.0d); + assertTrue(rs.getDouble("NumericField") == 0.0d); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getString("DateTimeField")); + assertNull(rs.getString("GeographyField")); + assertNull(rs.getBytes("BytesField_1")); + assertFalse(rs.getBoolean("BooleanField_1")); + + assertTrue(rs.next()); // second row + // second row is non null, comparing the values + assertEquals("StringValue1", rs.getString("StringField")); + assertTrue(rs.getDouble("BigNumericField") == 0.3333333333333333d); + assertFalse(rs.getBoolean("BooleanField")); + assertNotNull(rs.getBytes("BytesField")); + assertEquals(1, rs.getInt("IntegerField")); + assertEquals(1534680695123L, rs.getTimestamp("TimestampField").getTime()); + assertEquals(java.sql.Date.valueOf("2018-08-19"), rs.getDate("DateField")); + assertTrue(rs.getDouble("FloatField") == 10.1d); + assertTrue(rs.getDouble("NumericField") == 100.0d); + assertEquals(Time.valueOf(LocalTime.of(12, 11, 35, 123456)), rs.getTime("TimeField")); + assertEquals("2018-08-19T12:11:35.123456", rs.getString("DateTimeField")); + assertEquals("POINT(-122.35022 47.649154)", rs.getString("GeographyField")); + assertNotNull(rs.getBytes("BytesField_1")); + assertTrue(rs.getBoolean("BooleanField_1")); + assertTrue( + rs.getObject("IntegerArrayField") instanceof com.google.cloud.bigquery.FieldValueList); + FieldValueList integerArrayFieldValue = + (com.google.cloud.bigquery.FieldValueList) rs.getObject("IntegerArrayField"); + assertEquals(4, integerArrayFieldValue.size()); // Array has 4 elements + assertEquals(3, (integerArrayFieldValue.get(2).getNumericValue()).intValue()); + + assertFalse(rs.next()); // no 3rd row in the table + } + + @Test + public void testConnectionClose() throws SQLException { + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by date limit 300000"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(10000) // page size + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { + ++cnt; + if (cnt > 57000) { // breaking at 57K, query reads 300K + assertTrue(connection.close()); // we should be able to cancel the connection + } + } + assertTrue( + cnt < 60000); // Few extra records are still read (generally ~10) even after canceling, as + // the backgrounds threads are still active while the interrupt occurs and the + // buffer and pageCache are cleared + } + + @Test + public void testBQResultSetPagination() throws SQLException { + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by date limit 300000"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setNumBufferedRows(10000) // page size + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { // pagination starts after approx 120,000 records + assertNotNull(rs.getDate(0)); + assertNotNull(rs.getString(1)); + assertNotNull(rs.getString(2)); + assertTrue(rs.getInt(3) >= 0); + assertTrue(rs.getInt(4) >= 0); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + } + + @Test + public void testReadAPIIterationAndOrder() + throws SQLException { // use read API to read 300K records and check the order + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // required for this integration test so that isFastQuerySupported + // returns false + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + int lasConfirmedCases = Integer.MIN_VALUE; + while (rs.next()) { // pagination starts after approx 120,000 records + assertNotNull(rs.getDate(0)); + assertNotNull(rs.getString(1)); + assertNotNull(rs.getString(2)); + assertTrue(rs.getInt(3) >= 0); + assertTrue(rs.getInt(4) >= 0); + + // check if the records are sorted + assertTrue(rs.getInt(3) >= lasConfirmedCases); + lasConfirmedCases = rs.getInt(3); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + connection.close(); + } + + @Test + public void testReadAPIConnectionMultiClose() + throws + SQLException { // use read API to read 300K records, then closes the connection. This test + // repeats it multiple times and assets if the connection was closed + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // required for this integration test so that isFastQuerySupported + // returns false + .build(); + int closeCnt = 0, runCnt = 3; + for (int run = 0; run < runCnt; run++) { + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { // pagination starts after approx 120,000 records + assertNotNull(rs.getDate(0)); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + assertTrue(connection.close()); // check if connection closed + closeCnt++; + } + assertEquals( + closeCnt, runCnt); // check if the connection closed for the required number of times + } + + @Test + public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { + String query = + "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " + + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + " order by TimestampField"; + /* + Column Index mapping for ref: + StringField, 0 BigNumericField, 1 BooleanField, 2 BytesField, 3 IntegerField, 4 TimestampField, 5 FloatField, " 6 + NumericField, 7 TimeField, 8 DateField, 9 DateTimeField , 10 GeographyField, 11 RecordField.BytesField, 12 RecordField.BooleanField, 13 IntegerArrayField 14 + */ + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet rs = bigQueryResult.getResultSet(); + Schema sc = bigQueryResult.getSchema(); + + assertEquals(BQ_RESULTSET_EXPECTED_SCHEMA, sc); // match the schema + assertEquals(2, bigQueryResult.getTotalRows()); // Expecting 2 rows + while (rs.next()) { + assertEquals(rs.getString(0), rs.getString("StringField")); + assertTrue(rs.getDouble(1) == rs.getDouble("BigNumericField")); + assertEquals(rs.getBoolean(2), rs.getBoolean("BooleanField")); + if (rs.getBytes(3) == null) { // both overloads should be null + assertEquals(rs.getBytes(3), rs.getBytes("BytesField")); + } else { // value in String representation should be the same + assertEquals( + new String(rs.getBytes(3), StandardCharsets.UTF_8), + new String(rs.getBytes("BytesField"), StandardCharsets.UTF_8)); + } + assertEquals(rs.getInt(4), rs.getInt("IntegerField")); + assertEquals(rs.getTimestamp(5), rs.getTimestamp("TimestampField")); + assertEquals(rs.getDate(9), rs.getDate("DateField")); + assertTrue(rs.getDouble("FloatField") == rs.getDouble(6)); + assertTrue(rs.getDouble("NumericField") == rs.getDouble(7)); + assertEquals(rs.getTime(8), rs.getTime("TimeField")); + assertEquals(rs.getString(10), rs.getString("DateTimeField")); + assertEquals(rs.getString(11), rs.getString("GeographyField")); + if (rs.getBytes(12) == null) { // both overloads should be null + assertEquals(rs.getBytes(12), rs.getBytes("BytesField_1")); + } else { // value in String representation should be the same + assertEquals( + new String(rs.getBytes(12), StandardCharsets.UTF_8), + new String(rs.getBytes("BytesField_1"), StandardCharsets.UTF_8)); + } + assertEquals(rs.getBoolean(13), rs.getBoolean("BooleanField_1")); + assertTrue( + rs.getObject("IntegerArrayField") instanceof com.google.cloud.bigquery.FieldValueList); + FieldValueList integerArrayFieldValue = + (com.google.cloud.bigquery.FieldValueList) rs.getObject("IntegerArrayField"); + assertTrue(rs.getObject(14) instanceof com.google.cloud.bigquery.FieldValueList); + FieldValueList integerArrayFieldValueColInd = + (com.google.cloud.bigquery.FieldValueList) rs.getObject(14); + assertEquals( + integerArrayFieldValue.size(), + integerArrayFieldValueColInd.size()); // Array has 4 elements + if (integerArrayFieldValue.size() == 4) { // as we are picking the third index + assertEquals( + (integerArrayFieldValue.get(2).getNumericValue()).intValue(), + (integerArrayFieldValueColInd.get(2).getNumericValue()).intValue()); + } + } + } + + @Test + public void testExecuteSelectStruct() throws SQLException { + String query = "select (STRUCT(\"Vancouver\" as city, 5 as years)) as address"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertEquals(1, bigQueryResult.getTotalRows()); + + Schema schema = bigQueryResult.getSchema(); + assertEquals("address", schema.getFields().get(0).getName()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getMode()); + // Backend is currently returning LegacySQLTypeName. Tracking bug: b/202977620 + assertEquals(LegacySQLTypeName.RECORD, schema.getFields().get(0).getType()); + assertEquals("city", schema.getFields().get(0).getSubFields().get(0).getName()); + assertEquals( + LegacySQLTypeName.STRING, schema.getFields().get(0).getSubFields().get(0).getType()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getSubFields().get(0).getMode()); + assertEquals("years", schema.getFields().get(0).getSubFields().get(1).getName()); + assertEquals( + LegacySQLTypeName.INTEGER, schema.getFields().get(0).getSubFields().get(1).getType()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getSubFields().get(1).getMode()); + + ResultSet rs = bigQueryResult.getResultSet(); + assertTrue(rs.next()); + FieldValueList addressFieldValue = + (com.google.cloud.bigquery.FieldValueList) rs.getObject("address"); + assertEquals(rs.getObject("address"), rs.getObject(0)); + assertEquals("Vancouver", addressFieldValue.get(0).getStringValue()); + assertEquals(5, addressFieldValue.get(1).getLongValue()); + assertFalse(rs.next()); // only 1 row of data + } + + @Test + public void testExecuteSelectStructSubField() throws SQLException { + String query = + "select address.city from (select (STRUCT(\"Vancouver\" as city, 5 as years)) as address)"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertEquals(1, bigQueryResult.getTotalRows()); + + Schema schema = bigQueryResult.getSchema(); + assertEquals("city", schema.getFields().get(0).getName()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getMode()); + // Backend is currently returning LegacySQLTypeName. Tracking bug: b/202977620 + assertEquals(LegacySQLTypeName.STRING, schema.getFields().get(0).getType()); + assertNull( + schema.getFields().get(0).getSubFields()); // this is a String field without any subfields + + ResultSet rs = bigQueryResult.getResultSet(); + assertTrue(rs.next()); + String cityFieldValue = rs.getString("city"); + assertEquals(rs.getString("city"), rs.getObject(0)); + assertEquals("Vancouver", cityFieldValue); + assertFalse(rs.next()); // only 1 row of data + } + + @Test + public void testExecuteSelectArray() throws SQLException { + String query = "SELECT [1,2,3]"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertEquals(1, bigQueryResult.getTotalRows()); + + Schema schema = bigQueryResult.getSchema(); + assertEquals("f0_", schema.getFields().get(0).getName()); + assertEquals(Field.Mode.REPEATED, schema.getFields().get(0).getMode()); + assertEquals(LegacySQLTypeName.INTEGER, schema.getFields().get(0).getType()); + assertNull(schema.getFields().get(0).getSubFields()); // no subfields for Integers + + ResultSet rs = bigQueryResult.getResultSet(); + assertTrue(rs.next()); + FieldValueList arrayFieldValue = (com.google.cloud.bigquery.FieldValueList) rs.getObject(0); + assertEquals(1, arrayFieldValue.get(0).getLongValue()); + assertEquals(2, arrayFieldValue.get(1).getLongValue()); + assertEquals(3, arrayFieldValue.get(2).getLongValue()); + } + + @Test + public void testExecuteSelectArrayOfStruct() throws SQLException { + String query = + "SELECT [STRUCT(\"Vancouver\" as city, 5 as years), STRUCT(\"Boston\" as city, 10 as years)]"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertEquals(1, bigQueryResult.getTotalRows()); + + Schema schema = bigQueryResult.getSchema(); + assertEquals("f0_", schema.getFields().get(0).getName()); + assertEquals(Field.Mode.REPEATED, schema.getFields().get(0).getMode()); + // Backend is currently returning LegacySQLTypeName. Tracking bug: b/202977620 + // Verify the field metadata of the two subfields of the struct + assertEquals(LegacySQLTypeName.RECORD, schema.getFields().get(0).getType()); + assertEquals("city", schema.getFields().get(0).getSubFields().get(0).getName()); + assertEquals( + LegacySQLTypeName.STRING, schema.getFields().get(0).getSubFields().get(0).getType()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getSubFields().get(0).getMode()); + assertEquals("years", schema.getFields().get(0).getSubFields().get(1).getName()); + assertEquals( + LegacySQLTypeName.INTEGER, schema.getFields().get(0).getSubFields().get(1).getType()); + assertEquals(Field.Mode.NULLABLE, schema.getFields().get(0).getSubFields().get(1).getMode()); + + ResultSet rs = bigQueryResult.getResultSet(); + assertTrue(rs.next()); + FieldValueList arrayOfStructFieldValue = + (com.google.cloud.bigquery.FieldValueList) rs.getObject(0); + // Verify the values of the two structs in the array + assertEquals(Attribute.RECORD, arrayOfStructFieldValue.get(0).getAttribute()); + assertEquals( + "Vancouver", arrayOfStructFieldValue.get(0).getRecordValue().get(0).getStringValue()); + assertEquals(5, arrayOfStructFieldValue.get(0).getRecordValue().get(1).getLongValue()); + assertEquals(Attribute.RECORD, arrayOfStructFieldValue.get(1).getAttribute()); + assertEquals("Boston", arrayOfStructFieldValue.get(1).getRecordValue().get(0).getStringValue()); + assertEquals(10, arrayOfStructFieldValue.get(1).getRecordValue().get(1).getLongValue()); + } + + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastQueryMultipleRuns() throws InterruptedException { String query = @@ -2265,6 +2981,7 @@ public void testFastQueryMultipleRuns() throws InterruptedException { assertFalse(result2.hasNextPage()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedException { String query = @@ -2294,6 +3011,7 @@ public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedExcep assertFalse(result2.hasNextPage()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastSQLQuery() throws InterruptedException { String query = @@ -2323,6 +3041,7 @@ public void testFastSQLQuery() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastSQLQueryMultiPage() throws InterruptedException { String query = @@ -2449,6 +3168,7 @@ public void testFastQuerySlowDDL() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastQueryHTTPException() throws InterruptedException { String queryInvalid = @@ -2511,10 +3231,36 @@ public void testQuerySessionSupport() throws InterruptedException { remoteJobWithSession = remoteJobWithSession.waitFor(); assertNull(remoteJobWithSession.getStatus().getError()); Job queryJobWithSession = bigquery.getJob(remoteJobWithSession.getJobId()); - JobStatistics.QueryStatistics statisticsWithSession = queryJobWithSession.getStatistics(); + QueryStatistics statisticsWithSession = queryJobWithSession.getStatistics(); assertEquals(sessionId, statisticsWithSession.getSessionInfo().getSessionId()); } + // TODO: uncomment this testcase when executeUpdate is implemented + // @Test + // public void testExecuteSelectWithSession() throws BigQuerySQLException { + // String query = "CREATE TEMPORARY TABLE temptable AS SELECT 17 as foo"; + // ConnectionSettings connectionSettings = + // ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).setCreateSession(true).build(); + // Connection connection = bigquery.createConnection(connectionSettings); + // BigQueryResult bigQueryResult = connection.execute(query); + // BigQueryResultStats stats = bigQueryResult.getBigQueryResultStats(); + // assertNotNull(stats.getSessionInfo().getSessionId()); + // } + + @Test + public void testExecuteSelectSessionSupport() throws BigQuerySQLException { + String query = "SELECT 17 as foo"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setCreateSession(true) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + String sessionId = bigQueryResult.getBigQueryResultStats().getSessionInfo().getSessionId(); + assertNotNull(sessionId); + } + @Test public void testDmlStatistics() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); @@ -2535,6 +3281,7 @@ public void testDmlStatistics() throws InterruptedException { assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testTransactionInfo() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); @@ -2556,6 +3303,7 @@ public void testTransactionInfo() throws InterruptedException { } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testScriptStatistics() throws InterruptedException { String script = @@ -2706,6 +3454,27 @@ public void testPositionalQueryParameters() throws InterruptedException { } } + /* TODO(prasmish): expand below test case with all the fields shown in the above test case */ + @Test + public void testExecuteSelectWithPositionalQueryParameters() throws BigQuerySQLException { + String query = + "SELECT TimestampField, StringField FROM " + + TABLE_ID.getTable() + + " WHERE StringField = ?" + + " AND TimestampField > ?"; + QueryParameterValue stringParameter = QueryParameterValue.string("stringValue"); + QueryParameterValue timestampParameter = + QueryParameterValue.timestamp("2014-01-01 07:00:00.000000+00:00"); + Parameter stringParam = Parameter.newBuilder().setValue(stringParameter).build(); + Parameter timeStampParam = Parameter.newBuilder().setValue(timestampParameter).build(); + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + List parameters = ImmutableList.of(stringParam, timeStampParam); + BigQueryResult rs = connection.executeSelect(query, parameters); + assertEquals(2, rs.getTotalRows()); + } + @Test public void testNamedQueryParameters() throws InterruptedException { String query = @@ -2728,6 +3497,30 @@ public void testNamedQueryParameters() throws InterruptedException { assertEquals(2, Iterables.size(result.getValues())); } + @Test + public void testExecuteSelectWithNamedQueryParameters() throws BigQuerySQLException { + String query = + "SELECT TimestampField, StringField, BooleanField FROM " + + TABLE_ID.getTable() + + " WHERE StringField = @stringParam" + + " AND IntegerField IN UNNEST(@integerList)"; + QueryParameterValue stringParameter = QueryParameterValue.string("stringValue"); + QueryParameterValue intArrayParameter = + QueryParameterValue.array(new Integer[] {3, 4}, Integer.class); + Parameter stringParam = + Parameter.newBuilder().setName("stringParam").setValue(stringParameter).build(); + Parameter intArrayParam = + Parameter.newBuilder().setName("integerList").setValue(intArrayParameter).build(); + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + List parameters = ImmutableList.of(stringParam, intArrayParam); + BigQueryResult rs = connection.executeSelect(query, parameters); + assertEquals(2, rs.getTotalRows()); + } + + /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test public void testStructNamedQueryParameters() throws InterruptedException { QueryParameterValue booleanValue = QueryParameterValue.bool(true); @@ -2782,6 +3575,7 @@ private static void assertsFieldValue(FieldValue record) { assertEquals("test-stringField", record.getRecordValue().get("stringField").getStringValue()); } + /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test public void testNestedStructNamedQueryParameters() throws InterruptedException { QueryParameterValue booleanValue = QueryParameterValue.bool(true); @@ -2825,6 +3619,7 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { } } + /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test public void testBytesParameter() throws Exception { String query = "SELECT BYTE_LENGTH(@p) AS length"; @@ -3108,6 +3903,7 @@ public void testCopyJobWithLabels() throws InterruptedException { assertTrue(remoteTable.delete()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJob() throws InterruptedException, TimeoutException { String tableName = "test_query_job_table"; @@ -3152,6 +3948,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { assertNotNull(statistics.getQueryPlan()); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJobWithConnectionProperties() throws InterruptedException { String tableName = "test_query_job_table_connection_properties"; @@ -3171,6 +3968,7 @@ public void testQueryJobWithConnectionProperties() throws InterruptedException { assertTrue(bigquery.delete(destinationTable)); } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJobWithLabels() throws InterruptedException, TimeoutException { String tableName = "test_query_job_table"; @@ -3194,6 +3992,7 @@ public void testQueryJobWithLabels() throws InterruptedException, TimeoutExcepti } } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJobWithRangePartitioning() throws InterruptedException { String tableName = "test_query_job_table_rangepartitioning"; @@ -3304,6 +4103,7 @@ public void testQueryJobWithDryRun() throws InterruptedException, TimeoutExcepti .build(); Job remoteJob = bigquery.create(JobInfo.of(configuration)); assertNull(remoteJob.getJobId().getJob()); + remoteJob.getStatistics(); assertEquals(DONE, remoteJob.getStatus().getState()); assertNotNull(remoteJob.getConfiguration()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java new file mode 100644 index 0000000000..d672967b14 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -0,0 +1,610 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryError; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryResult; +import com.google.cloud.bigquery.BigQuerySQLException; +import com.google.cloud.bigquery.Connection; +import com.google.cloud.bigquery.ConnectionSettings; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.InsertAllRequest; +import com.google.cloud.bigquery.InsertAllResponse; +import com.google.cloud.bigquery.Parameter; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.Table; +import com.google.cloud.bigquery.TableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import com.google.common.collect.ImmutableList; +import com.google.common.io.BaseEncoding; +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Time; +import java.time.LocalTime; +import java.time.ZoneId; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TimeZone; +import java.util.concurrent.ExecutionException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; + +public class ITNightlyBigQueryTest { + private static final Logger logger = Logger.getLogger(ITNightlyBigQueryTest.class.getName()); + private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); + private static final String TABLE = "TEMP_RS_TEST_TABLE"; + private static final byte[] BYTES = "TestByteValue".getBytes(StandardCharsets.UTF_8); + private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); + // Script will populate NUM_BATCHES*REC_PER_BATCHES number of records (eg: 100*10000 = 1M) + private static final int NUM_BATCHES = 55; + private static final int REC_PER_BATCHES = 10000; + private static final int LIMIT_RECS = 500000; // We can plan to read ~ 500K / 1M records + private static final int MULTI_LIMIT_RECS = + 300000; // Used for multiquery testcase, a lower limit like 300K should be fine + private static int rowCnt = 0; + private static BigQuery bigquery; + private static final String BASE_QUERY = + "select StringField, GeographyField, BooleanField, BigNumericField, IntegerField, NumericField, BytesField, " + + "TimestampField, TimeField, DateField, IntegerArrayField, RecordField.BooleanField, RecordField.StringField ," + + " JSONField, JSONField.hello, JSONField.id from %s.%s order by IntegerField asc LIMIT %s"; + private static final String POSITIONAL_QUERY = + String.format( + "select RecordField.BooleanField, RecordField.StringField, StringField, BooleanField, BytesField, IntegerField, GeographyField, NumericField, BigNumericField, TimeField, DateField, TimestampField, JSONField from %s.%s where DateField = ? and BooleanField = ? and IntegerField > ? and NumericField > ? LIMIT %s", + DATASET, TABLE, MULTI_LIMIT_RECS); + private static final String QUERY = String.format(BASE_QUERY, DATASET, TABLE, LIMIT_RECS); + private static final String MULTI_QUERY = + String.format(BASE_QUERY, DATASET, TABLE, MULTI_LIMIT_RECS); + private static final String INVALID_QUERY = + String.format( + "select into %s.%s order by IntegerField asc LIMIT %s", DATASET, TABLE, LIMIT_RECS); + + private static final Schema BQ_SCHEMA = + Schema.of( + Field.newBuilder("TimestampField", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .setDescription("TimestampDescription") + .build(), + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("StringDescription") + .build(), + Field.newBuilder("IntegerArrayField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.REPEATED) + .setDescription("IntegerArrayDescription") + .build(), + Field.newBuilder("BooleanField", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .setDescription("BooleanDescription") + .build(), + Field.newBuilder("BytesField", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .setDescription("BytesDescription") + .build(), + Field.newBuilder( + "RecordField", + StandardSQLTypeName.STRUCT, + Field.newBuilder("StringField", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("StringDescription") + .build(), + Field.newBuilder("BooleanField", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .setDescription("BooleanDescription") + .build()) + .setMode(Field.Mode.NULLABLE) + .setDescription("RecordDescription") + .build(), + Field.newBuilder("IntegerField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("IntegerDescription") + .build(), + Field.newBuilder("GeographyField", StandardSQLTypeName.GEOGRAPHY) + .setMode(Field.Mode.NULLABLE) + .setDescription("GeographyDescription") + .build(), + Field.newBuilder("NumericField", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("NumericDescription") + .build(), + Field.newBuilder("BigNumericField", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .setDescription("BigNumericDescription") + .build(), + Field.newBuilder("TimeField", StandardSQLTypeName.TIME) + .setMode(Field.Mode.NULLABLE) + .setDescription("TimeDescription") + .build(), + Field.newBuilder("DateField", StandardSQLTypeName.DATE) + .setMode(Field.Mode.NULLABLE) + .setDescription("DateDescription") + .build(), + Field.newBuilder("JSONField", StandardSQLTypeName.JSON) + .setMode(Field.Mode.NULLABLE) + .setDescription("JSONFieldDescription") + .build(), + Field.newBuilder("IntervalField", StandardSQLTypeName.INTERVAL) + .setMode(Field.Mode.NULLABLE) + .setDescription("IntervalFieldDescription") + .build()); + + @Rule public Timeout globalTimeout = Timeout.seconds(1800); // setting 30 mins as the timeout + + @BeforeClass + public static void beforeClass() throws InterruptedException, IOException { + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + bigquery = bigqueryHelper.getOptions().getService(); + createDataset(DATASET); + createTable(DATASET, TABLE, BQ_SCHEMA); + populateTestRecords(DATASET, TABLE); + } + + @AfterClass + public static void afterClass() throws ExecutionException, InterruptedException { + try { + if (bigquery != null) { + deleteTable(DATASET, TABLE); + RemoteBigQueryHelper.forceDelete(bigquery, DATASET); + } else { + fail("Error clearing the test dataset"); + } + } catch (BigQueryException e) { + fail("Error clearing the test dataset " + e); + } + } + + @Test + public void testInvalidQuery() throws BigQuerySQLException { + Connection connection = getConnection(); + try { + BigQueryResult bigQueryResult = connection.executeSelect(INVALID_QUERY); + fail("BigQuerySQLException was expected"); + } catch (BigQuerySQLException ex) { + assertNotNull(ex.getMessage()); + assertTrue(ex.getMessage().toLowerCase().contains("unexpected keyword into")); + } finally { + connection.close(); + } + } + + /* + This tests for the order of the records as well as the value of the records using testForAllDataTypeValues + */ + @Test + public void testIterateAndOrder() throws SQLException { + Connection connection = getConnection(); + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + assertNotNull(rs.getString("StringField")); + assertNotNull(rs.getString("GeographyField")); + assertNotNull(rs.getObject("IntegerArrayField")); + assertTrue(rs.getBoolean("BooleanField")); + assertTrue(0.0d < rs.getDouble("BigNumericField")); + assertTrue(0 < rs.getInt("IntegerField")); + assertTrue(0L < rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row + } + ++cnt; + } + assertEquals(LIMIT_RECS, cnt); // all the records were retrieved + connection.close(); + } + + /* + This tests for the order of the records using default connection settings as well as the value of the records using testForAllDataTypeValues + */ + @Test + public void testIterateAndOrderDefaultConnSettings() throws SQLException { + Connection connection = bigquery.createConnection(); + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + assertNotNull(rs.getString("StringField")); + assertNotNull(rs.getString("GeographyField")); + assertNotNull(rs.getObject("IntegerArrayField")); + assertTrue(rs.getBoolean("BooleanField")); + assertTrue(0.0d < rs.getDouble("BigNumericField")); + assertTrue(0 < rs.getInt("IntegerField")); + assertTrue(0L < rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row + } + ++cnt; + } + assertEquals(LIMIT_RECS, cnt); // all the records were retrieved + connection.close(); + } + + @Test + public void testMultipleRuns() throws SQLException { + + Connection connection = getConnection(); + BigQueryResult bigQueryResult = connection.executeSelect(MULTI_QUERY); + logger.log(Level.INFO, "Query used: {0}", MULTI_QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + int totalCnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row + } + ++cnt; + } + connection.close(); + totalCnt += cnt; + // Repeat the same run + connection = getConnection(); + bigQueryResult = connection.executeSelect(MULTI_QUERY); + rs = bigQueryResult.getResultSet(); + cnt = 0; + prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row + } + ++cnt; + } + connection.close(); + totalCnt += cnt; + assertEquals(MULTI_LIMIT_RECS * 2, totalCnt); + } + + @Test + public void testPositionalParams() + throws SQLException { // Bypasses Read API as it doesnt support Positional Params + Connection connection = getConnection(); + Parameter dateParam = + Parameter.newBuilder().setValue(QueryParameterValue.date("2022-01-01")).build(); + Parameter boolParam = Parameter.newBuilder().setValue(QueryParameterValue.bool(true)).build(); + Parameter intParam = Parameter.newBuilder().setValue(QueryParameterValue.int64(1)).build(); + Parameter numericParam = + Parameter.newBuilder().setValue(QueryParameterValue.numeric(new BigDecimal(100))).build(); + List parameters = ImmutableList.of(dateParam, boolParam, intParam, numericParam); + + BigQueryResult bigQueryResult = connection.executeSelect(POSITIONAL_QUERY, parameters); + logger.log(Level.INFO, "Query used: {0}", POSITIONAL_QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d <= rs.getDouble("BigNumericField")); + assertTrue(0 <= rs.getInt("IntegerField")); + assertTrue(0L <= rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertTrue(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + ++cnt; + } + connection.close(); + assertEquals(MULTI_LIMIT_RECS, cnt); + } + + // asserts the value of each row + private static void testForAllDataTypeValues(ResultSet rs, int cnt) throws SQLException { + // Testing JSON type + assertEquals("\"world\"", rs.getString("hello")); // BQ stores the value as "world" + assertEquals(100, rs.getInt("id")); + assertEquals("{\"hello\":\"world\",\"id\":100}", rs.getString("JSONField")); + + // String and Geography types + assertEquals(String.format("String Val %s", cnt), rs.getString("StringField")); + assertEquals("POINT(1 2)", rs.getString("GeographyField")); + + // Array type tests + if (rs.getObject("IntegerArrayField") instanceof JsonStringArrayList) { + JsonStringArrayList ary = (JsonStringArrayList) rs.getObject("IntegerArrayField"); + assertEquals(3, ary.size()); + assertEquals(1, ary.get(0).intValue()); + assertEquals(2, ary.get(1).intValue()); + assertEquals(3, ary.get(2).intValue()); + } + + // BigNumeric, int and Numeric + assertTrue(10000000L + cnt == rs.getDouble("BigNumericField")); + assertEquals(1 + cnt, rs.getInt("IntegerField")); + assertEquals(100 + cnt, rs.getLong("NumericField")); + // Test Byte field + assertEquals("TestByteValue", new String(rs.getBytes("BytesField"), StandardCharsets.UTF_8)); + + // Struct Fields + assertFalse(rs.getBoolean("BooleanField_1")); + assertEquals(String.format("Str Val %s", cnt), rs.getString("StringField_1")); + + // Timestamp, Time, DateTime and Date fields + assertEquals(1649064795000L, rs.getTimestamp("TimestampField").getTime()); + assertEquals( + java.sql.Date.valueOf("2022-01-01").toString(), rs.getDate("DateField").toString()); + // Time is represented independent of a specific date and timezone. For example a 12:11:35 (GMT) + // is returned as + // 17:11:35 (GMT+5:30) . So we need to adjust the offset + int offset = + TimeZone.getTimeZone(ZoneId.systemDefault()) + .getOffset(new java.util.Date().getTime()); // offset in seconds + assertEquals( + Time.valueOf(LocalTime.of(12, 11, 35)).getTime() + offset, + rs.getTime("TimeField").getTime()); + } + + private static void populateTestRecords(String datasetName, String tableName) { + TableId tableId = TableId.of(datasetName, tableName); + for (int batchCnt = 1; batchCnt <= NUM_BATCHES; batchCnt++) { + addBatchRecords(tableId); + } + } + + private static void addBatchRecords(TableId tableId) { + Map nullRow = new HashMap<>(); + try { + InsertAllRequest.Builder reqBuilder = InsertAllRequest.newBuilder(tableId); + if (rowCnt == 0) { + reqBuilder.addRow(nullRow); + } + for (int i = 0; i < REC_PER_BATCHES; i++) { + reqBuilder.addRow(getNextRow()); + } + InsertAllResponse response = bigquery.insertAll(reqBuilder.build()); + + if (response.hasErrors()) { + // If any of the insertions failed, this lets you inspect the errors + for (Map.Entry> entry : response.getInsertErrors().entrySet()) { + logger.log(Level.WARNING, "Exception while adding records {0}", entry.getValue()); + } + fail("Response has errors"); + } + } catch (BigQueryException e) { + logger.log(Level.WARNING, "Exception while adding records {0}", e); + fail("Error in addBatchRecords"); + } + } + + private static void createTable(String datasetName, String tableName, Schema schema) { + try { + TableId tableId = TableId.of(datasetName, tableName); + TableDefinition tableDefinition = StandardTableDefinition.of(schema); + TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); + Table table = bigquery.create(tableInfo); + assertTrue(table.exists()); + } catch (BigQueryException e) { + fail("Table was not created. \n" + e); + } + } + + public static void deleteTable(String datasetName, String tableName) { + try { + assertTrue(bigquery.delete(TableId.of(datasetName, tableName))); + } catch (BigQueryException e) { + fail("Table was not deleted. \n" + e); + } + } + + public static void createDataset(String datasetName) { + try { + DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); + Dataset newDataset = bigquery.create(datasetInfo); + assertNotNull(newDataset.getDatasetId().getDataset()); + } catch (BigQueryException e) { + fail("Dataset was not created. \n" + e); + } + } + + public static void deleteDataset(String datasetName) { + try { + DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); + assertTrue(bigquery.delete(datasetInfo.getDatasetId())); + } catch (BigQueryException e) { + fail("Dataset was not deleted. \n" + e); + } + } + + private Connection getConnection() { + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .build(); // Read API is enabled by default + return bigquery.createConnection(connectionSettings); + } + + private static Map getNextRow() { + rowCnt++; + Map row = new HashMap<>(); + Map structVal = new HashMap<>(); + structVal.put("StringField", "Str Val " + rowCnt); + structVal.put("BooleanField", false); + row.put("RecordField", structVal); // struct + row.put("TimestampField", "2022-04-04 15:03:15.000 +05:30"); + row.put("StringField", "String Val " + rowCnt); + row.put("IntegerArrayField", new int[] {1, 2, 3}); + row.put("BooleanField", true); + row.put("BytesField", BYTES_BASE64); + row.put("IntegerField", 1 + rowCnt); + row.put("GeographyField", "POINT(1 2)"); + row.put("NumericField", 100 + rowCnt); + row.put("BigNumericField", 10000000L + rowCnt); + row.put("TimeField", "12:11:35"); + row.put("DateField", "2022-01-01"); + row.put("JSONField", "{\"hello\":\"world\",\"id\":100}"); + row.put("IntervalField", "10000-0 3660000 87840000:0:0"); + return row; + } +} diff --git a/pom.xml b/pom.xml index ad88672200..5283f06a9d 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,21 @@ pom import + + + + com.google.cloud + google-cloud-datacatalog-bom + 1.6.1 + pom + import + com.google.cloud @@ -107,6 +122,13 @@ 1.7.0 + + + org.threeten + threeten-extra + 1.7.0 + + junit @@ -148,10 +170,59 @@ + + + + com.google.protobuf + protobuf-java + + + com.google.cloud + google-cloud-bigquerystorage + 2.8.3 + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + 2.8.3 + + + org.apache.arrow + arrow-vector + 7.0.0 + + + org.apache.arrow + arrow-memory-core + 7.0.0 + + + org.apache.arrow + arrow-memory-netty + 7.0.0 + runtime + + + google-cloud-bigquery + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.apache.arrow:arrow-memory-netty + + + + + + From 78789a5530679349dbee691bd1907ffaefc617a6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 6 May 2022 14:34:49 +0200 Subject: [PATCH 0728/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220429-1.32.1 (#2020) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5283f06a9d..06419ac5ea 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220422-1.32.1 + v2-rev20220429-1.32.1 2.10.0 From 59688ddb69909da4676375512610f487b7c1d458 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 6 May 2022 08:02:50 -0700 Subject: [PATCH 0729/2268] chore: restructure dependencies for the new features related to bigquerystorage Java client (#2024) Relates to https://github.com/googleapis/java-bigquery/pull/1374 --- google-cloud-bigquery/pom.xml | 25 +++++++++++ pom.xml | 82 ++++++++++++++--------------------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c3abfe1cf7..ab0b4d22a3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -93,6 +93,31 @@ org.threeten threeten-extra + + com.google.protobuf + protobuf-java + + + com.google.cloud + google-cloud-bigquerystorage + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + + + org.apache.arrow + arrow-vector + + + org.apache.arrow + arrow-memory-core + + + org.apache.arrow + arrow-memory-netty + runtime + diff --git a/pom.xml b/pom.xml index 06419ac5ea..76d1c65e41 100644 --- a/pom.xml +++ b/pom.xml @@ -66,21 +66,39 @@ pom import - - - - com.google.cloud - google-cloud-datacatalog-bom - 1.6.1 - pom - import - + + + + com.google.cloud + google-cloud-bigquerystorage-bom + 2.8.3 + pom + import + + + org.apache.arrow + arrow-vector + 7.0.0 + + + org.apache.arrow + arrow-memory-core + 7.0.0 + + + org.apache.arrow + arrow-memory-netty + 7.0.0 + runtime + + + + com.google.cloud + google-cloud-datacatalog-bom + 1.6.1 + pom + import + com.google.cloud @@ -170,40 +188,6 @@ - - - - com.google.protobuf - protobuf-java - - - com.google.cloud - google-cloud-bigquerystorage - 2.8.3 - - - com.google.api.grpc - proto-google-cloud-bigquerystorage-v1 - 2.8.3 - - - org.apache.arrow - arrow-vector - 7.0.0 - - - org.apache.arrow - arrow-memory-core - 7.0.0 - - - org.apache.arrow - arrow-memory-netty - 7.0.0 - runtime - - - google-cloud-bigquery From 1022f2f86027d4fb38d0df92fb70c3f06a2c7208 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Fri, 6 May 2022 08:20:13 -0700 Subject: [PATCH 0730/2268] chore: temporarily disable graalvm IT (#2023) Until https://github.com/googleapis/java-bigquery/issues/2007 is fixed. --- owlbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owlbot.py b/owlbot.py index 106a89a3bd..c14fae8627 100644 --- a/owlbot.py +++ b/owlbot.py @@ -22,4 +22,5 @@ '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', + 'build.sh', ]) \ No newline at end of file From 5296465e2a9b253ed9e8faa07be3be1e9d308f9b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 6 May 2022 17:24:11 +0200 Subject: [PATCH 0731/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.13.0 (#2025) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.8.3` -> `2.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.13.0/compatibility-slim/2.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.13.0/confidence-slim/2.8.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

    googleapis/java-bigquerystorage ### [`v2.13.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2130-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2122v2130-2022-05-05) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.12.2...v2.13.0) ##### Features - add support to a few more specific StorageErrors for the Write API ([#​1563](https://togithub.com/googleapis/java-bigquerystorage/issues/1563)) ([c26091e](https://togithub.com/googleapis/java-bigquerystorage/commit/c26091e48b6542cf2078d46e2dbfe3220ab031f6)) - next release from main branch is 2.12.2 ([#​1624](https://togithub.com/googleapis/java-bigquerystorage/issues/1624)) ([b2aa2a4](https://togithub.com/googleapis/java-bigquerystorage/commit/b2aa2a43752e5a8a71f7bc434397b73d77d8eb58)) ##### Bug Fixes - A stuck when the client fail to get DoneCallback ([#​1637](https://togithub.com/googleapis/java-bigquerystorage/issues/1637)) ([3baa84e](https://togithub.com/googleapis/java-bigquerystorage/commit/3baa84e96671a14936d1667d0e036a1565fa5b7a)) - Fix a possible NULL PTR after introduced timeout on waitForDone ([#​1638](https://togithub.com/googleapis/java-bigquerystorage/issues/1638)) ([e1c6ded](https://togithub.com/googleapis/java-bigquerystorage/commit/e1c6ded336effbe302eee56df056a56a9dbb6b2f)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.10.10 ([#​1623](https://togithub.com/googleapis/java-bigquerystorage/issues/1623)) ([54b74b8](https://togithub.com/googleapis/java-bigquerystorage/commit/54b74b80368252b93fb445c481731e0edfe3f5c3)) - update dependency org.apache.avro:avro to v1.11.0 ([#​1632](https://togithub.com/googleapis/java-bigquerystorage/issues/1632)) ([b47eea0](https://togithub.com/googleapis/java-bigquerystorage/commit/b47eea05d4db5acaa7337dc4e1faa018d8b4e40d)) ##### Documentation - **samples:** update WriteComittedStream sample code to match best practices ([#​1628](https://togithub.com/googleapis/java-bigquerystorage/issues/1628)) ([5d4c7e1](https://togithub.com/googleapis/java-bigquerystorage/commit/5d4c7e18b82ab85f7498e34a29920e9af765f918)) - **sample:** update WriteToDefaultStream sample to match best practices ([#​1631](https://togithub.com/googleapis/java-bigquerystorage/issues/1631)) ([73ddd7b](https://togithub.com/googleapis/java-bigquerystorage/commit/73ddd7b4fd44dce4be434726df57ecd84e6e3e6a)) ##### [2.12.2](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.12.1...v2.12.2) (2022-04-18) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.10.7 ([#​1614](https://togithub.com/googleapis/java-bigquerystorage/issues/1614)) ([ccdac87](https://togithub.com/googleapis/java-bigquerystorage/commit/ccdac87cc439b5f765d35af6d247b83122c1f40b)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.8 ([#​1618](https://togithub.com/googleapis/java-bigquerystorage/issues/1618)) ([b9c50f1](https://togithub.com/googleapis/java-bigquerystorage/commit/b9c50f169d6092647becef5d99174be61b095ca8)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.9 ([#​1620](https://togithub.com/googleapis/java-bigquerystorage/issues/1620)) ([7e1ae93](https://togithub.com/googleapis/java-bigquerystorage/commit/7e1ae93a1ee54a83d93a7421b438a53455dc89c2)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#​1619](https://togithub.com/googleapis/java-bigquerystorage/issues/1619)) ([55c4134](https://togithub.com/googleapis/java-bigquerystorage/commit/55c413459d029bf521eadf59f3c9fba9a7e876a1)) ##### [2.12.1](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.12.0...v2.12.1) (2022-04-08) ##### Bug Fixes - even better ISO compilance ([#​1607](https://togithub.com/googleapis/java-bigquerystorage/issues/1607)) ([5701597](https://togithub.com/googleapis/java-bigquerystorage/commit/570159799d8d464fbdb5bd617cc2a51f4f276f98)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.10.6 ([#​1610](https://togithub.com/googleapis/java-bigquerystorage/issues/1610)) ([20e4225](https://togithub.com/googleapis/java-bigquerystorage/commit/20e4225734358bfce7c872e19c823ac6958d7905)) ### [`v2.12.2`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2122-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2121v2122-2022-04-18) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.12.1...v2.12.2) ### [`v2.12.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2121-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2120v2121-2022-04-08) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.12.0...v2.12.1) ### [`v2.12.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2120-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2111v2120-2022-04-01) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.11.1...v2.12.0) ##### Features - Deprecate format specific `row_count` field in Read API ([#​1599](https://togithub.com/googleapis/java-bigquerystorage/issues/1599)) ([6f415f6](https://togithub.com/googleapis/java-bigquerystorage/commit/6f415f62685549f50f7382bc7d896e5f60c5285e)) ##### Bug Fixes - better ISO8601 compliance ([#​1589](https://togithub.com/googleapis/java-bigquerystorage/issues/1589)) ([29fa8b7](https://togithub.com/googleapis/java-bigquerystorage/commit/29fa8b73bc092a7ebe8e3951daf2026057d1d040)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.10.5 ([#​1602](https://togithub.com/googleapis/java-bigquerystorage/issues/1602)) ([8787b5d](https://togithub.com/googleapis/java-bigquerystorage/commit/8787b5d36849981f9497ac2b0ddf8c5291b07fc8)) ##### [2.11.1](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.11.0...v2.11.1) (2022-03-29) ##### Bug Fixes - Numerics cast from strings ([#​1588](https://togithub.com/googleapis/java-bigquerystorage/issues/1588)) ([085768b](https://togithub.com/googleapis/java-bigquerystorage/commit/085768b41943237f50d5e47fa4ba5f22abff9fc6)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.10.0 ([#​1578](https://togithub.com/googleapis/java-bigquerystorage/issues/1578)) ([adca54e](https://togithub.com/googleapis/java-bigquerystorage/commit/adca54eb0348d2ba02d3c272e180beebd9feb6c6)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.1 ([#​1583](https://togithub.com/googleapis/java-bigquerystorage/issues/1583)) ([cc33d0e](https://togithub.com/googleapis/java-bigquerystorage/commit/cc33d0e539cc2ed53bf0ab265c5ebe55a0ac6c6e)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.2 ([#​1587](https://togithub.com/googleapis/java-bigquerystorage/issues/1587)) ([d4ab7f6](https://togithub.com/googleapis/java-bigquerystorage/commit/d4ab7f64e32e4be8d1047d93b34cdadeccd98d90)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.3 ([#​1591](https://togithub.com/googleapis/java-bigquerystorage/issues/1591)) ([0c62c85](https://togithub.com/googleapis/java-bigquerystorage/commit/0c62c85cf5fead39c04512c49db79d8e95fd44e6)) - update dependency com.google.cloud:google-cloud-bigquery to v2.10.4 ([#​1594](https://togithub.com/googleapis/java-bigquerystorage/issues/1594)) ([05e9062](https://togithub.com/googleapis/java-bigquerystorage/commit/05e90620192747096854e60047cbca1fa6d81ea5)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#​1593](https://togithub.com/googleapis/java-bigquerystorage/issues/1593)) ([5234809](https://togithub.com/googleapis/java-bigquerystorage/commit/5234809e0482b05e40cbb6cecbb1154699255a59)) ### [`v2.11.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2111-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2110v2111-2022-03-29) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.11.0...v2.11.1) ### [`v2.11.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2110-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2101v2110-2022-03-14) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.10.1...v2.11.0) ##### Features - add JsonToProtoMessage support for TIMESTAMP ([#​1574](https://togithub.com/googleapis/java-bigquerystorage/issues/1574)) ([6412fb2](https://togithub.com/googleapis/java-bigquerystorage/commit/6412fb2c03fc6b2c6d220d72bbd89e47922bf970)), closes [#​1515](https://togithub.com/googleapis/java-bigquerystorage/issues/1515) ##### Bug Fixes - a possible race condition that we used table schema out of the lock. ([#​1575](https://togithub.com/googleapis/java-bigquerystorage/issues/1575)) ([b587638](https://togithub.com/googleapis/java-bigquerystorage/commit/b58763833ad4bd51515c055bbcb8e29d9fea05a9)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.9.1 ([#​1562](https://togithub.com/googleapis/java-bigquerystorage/issues/1562)) ([7efdbf0](https://togithub.com/googleapis/java-bigquerystorage/commit/7efdbf0df14ccc84409d09b5c93ac1058c95d50e)) - update dependency com.google.cloud:google-cloud-bigquery to v2.9.3 ([#​1570](https://togithub.com/googleapis/java-bigquerystorage/issues/1570)) ([3d281d2](https://togithub.com/googleapis/java-bigquerystorage/commit/3d281d2e01f9170eac92ac51757fbd434d9b6b73)) - update dependency com.google.cloud:google-cloud-bigquery to v2.9.4 ([#​1572](https://togithub.com/googleapis/java-bigquerystorage/issues/1572)) ([d3935cd](https://togithub.com/googleapis/java-bigquerystorage/commit/d3935cd3120f49aaae4c4e6839782bfa05836e90)) ##### [2.10.1](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.10.0...v2.10.1) (2022-03-03) ##### Bug Fixes - change customer StorageException from RuntimeException to StatusRuntimeException ([#​1559](https://togithub.com/googleapis/java-bigquerystorage/issues/1559)) ([523377e](https://togithub.com/googleapis/java-bigquerystorage/commit/523377e0bbfbae33165258b8eeed812c81cfeb82)) ##### Dependencies - update actions/checkout action to v3 ([#​1554](https://togithub.com/googleapis/java-bigquerystorage/issues/1554)) ([1371ac9](https://togithub.com/googleapis/java-bigquerystorage/commit/1371ac91bad55711b66e08ddeed6302598329a46)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#​1555](https://togithub.com/googleapis/java-bigquerystorage/issues/1555)) ([cc25162](https://togithub.com/googleapis/java-bigquerystorage/commit/cc25162021a2b05e68fd3dd1f98e252a10626f6b)) ##### Documentation - improve documentation for write client ([#​1560](https://togithub.com/googleapis/java-bigquerystorage/issues/1560)) ([fbb5321](https://togithub.com/googleapis/java-bigquerystorage/commit/fbb5321bd35bdd7ba81bcb95278d6cdd9abd3dee)) ### [`v2.10.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2101-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2100v2101-2022-03-03) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.10.0...v2.10.1) ### [`v2.10.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2100-httpsgithubcomgoogleapisjava-bigquerystoragecomparev291v2100-2022-02-28) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.9.1...v2.10.0) ##### Features - add trace_id for Read API ([#​1544](https://togithub.com/googleapis/java-bigquerystorage/issues/1544)) ([5a92ade](https://togithub.com/googleapis/java-bigquerystorage/commit/5a92ade809d16e2770c07bd5287fbccb75645b21)) ##### Bug Fixes - Add a e2e test on byte string array and remove a impossible case for byte array conversion ([#​1546](https://togithub.com/googleapis/java-bigquerystorage/issues/1546)) ([adcb9bb](https://togithub.com/googleapis/java-bigquerystorage/commit/adcb9bb699e54d93da320e6a458caff79faa2f9f)) - add more idiomatic way to insert ARRAY data ([#​1550](https://togithub.com/googleapis/java-bigquerystorage/issues/1550)) ([3ae4038](https://togithub.com/googleapis/java-bigquerystorage/commit/3ae40381aeacd21676f2c896216faa26eb1ef960)) - remove bigquery.readonly auth scope ([#​1543](https://togithub.com/googleapis/java-bigquerystorage/issues/1543)) ([a70ae45](https://togithub.com/googleapis/java-bigquerystorage/commit/a70ae45c013a311aaeccd6885a9b9752bbcf57cc)) ##### Dependencies - update actions/github-script action to v6 ([#​1533](https://togithub.com/googleapis/java-bigquerystorage/issues/1533)) ([370c3b5](https://togithub.com/googleapis/java-bigquerystorage/commit/370c3b5bf236ab7853c4cc6d32393f93f5a165e4)) - update dependency com.google.cloud:google-cloud-bigquery to v2.9.0 ([#​1538](https://togithub.com/googleapis/java-bigquerystorage/issues/1538)) ([43446b2](https://togithub.com/googleapis/java-bigquerystorage/commit/43446b24438526cc31542a0181fbed610df4b3c0)) ##### Documentation - **tutorials:** Add STRUCT column to tutorial ([#​1534](https://togithub.com/googleapis/java-bigquerystorage/issues/1534)) ([9595dab](https://togithub.com/googleapis/java-bigquerystorage/commit/9595dab89144cb13e812f4a277bb424d98c6591c)) - **tutorials:** Call append asynchronously instead of blocking ([#​1542](https://togithub.com/googleapis/java-bigquerystorage/issues/1542)) ([c777e23](https://togithub.com/googleapis/java-bigquerystorage/commit/c777e236c21204300231c3d3cbfaa3760da643b8)) ##### [2.9.1](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.9.0...v2.9.1) (2022-02-11) ##### Bug Fixes - rollback the reconnect after 10MB behavior after the fix for omg… ([#​1530](https://togithub.com/googleapis/java-bigquerystorage/issues/1530)) ([737bd0e](https://togithub.com/googleapis/java-bigquerystorage/commit/737bd0e2c21332fd1c0c82a12e31ce5749a078fd)) ##### Dependencies - update arrow.version to v7 (major) ([#​1526](https://togithub.com/googleapis/java-bigquerystorage/issues/1526)) ([b6a4479](https://togithub.com/googleapis/java-bigquerystorage/commit/b6a4479e023c6c05bccd3451e929105a1f7b8b9d)) - update dependency org.apache.arrow:arrow-memory-netty to v7 ([#​1527](https://togithub.com/googleapis/java-bigquerystorage/issues/1527)) ([06e927f](https://togithub.com/googleapis/java-bigquerystorage/commit/06e927f071271c12d7c1904b2d2c3f7f9e8338c7)) - update dependency org.apache.arrow:arrow-vector to v7 ([#​1528](https://togithub.com/googleapis/java-bigquerystorage/issues/1528)) ([70297cc](https://togithub.com/googleapis/java-bigquerystorage/commit/70297ccd4828fc08bdf3b021af103aa01975ccb3)) ### [`v2.9.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​291-httpsgithubcomgoogleapisjava-bigquerystoragecomparev290v291-2022-02-11) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.9.0...v2.9.1) ### [`v2.9.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​290-httpsgithubcomgoogleapisjava-bigquerystoragecomparev284v290-2022-02-08) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.8.4...v2.9.0) ##### Features - add a indicator of how much time a request is waiting for inflight limit ([#​1514](https://togithub.com/googleapis/java-bigquerystorage/issues/1514)) ([54874be](https://togithub.com/googleapis/java-bigquerystorage/commit/54874be945c2b88be6be03ae654277445c17741d)) - temp workaround for omg/48020 ([#​1521](https://togithub.com/googleapis/java-bigquerystorage/issues/1521)) ([ff28f65](https://togithub.com/googleapis/java-bigquerystorage/commit/ff28f65328fbd433117a314cdff7510a28160591)) ##### Bug Fixes - add a DATE type e2e test ([#​1511](https://togithub.com/googleapis/java-bigquerystorage/issues/1511)) ([5eaf38e](https://togithub.com/googleapis/java-bigquerystorage/commit/5eaf38ee7fb9f84c454e0e9da5fe9092ff4c456a)) ##### Documentation - **tutorials:** Add IT to JsonWriteDefaultStream tutorial ([#​1522](https://togithub.com/googleapis/java-bigquerystorage/issues/1522)) ([9fd7aca](https://togithub.com/googleapis/java-bigquerystorage/commit/9fd7aca8b6032a2c02d0ea91dd063c9ac9e151aa)) ##### [2.8.4](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.8.3...v2.8.4) (2022-02-03) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.7.1 ([#​1505](https://togithub.com/googleapis/java-bigquerystorage/issues/1505)) ([a700d92](https://togithub.com/googleapis/java-bigquerystorage/commit/a700d92c9f591f2b653aad6d79b2f61c4c44df98)) - update dependency com.google.cloud:google-cloud-bigquery to v2.8.0 ([#​1508](https://togithub.com/googleapis/java-bigquerystorage/issues/1508)) ([b9ab6aa](https://togithub.com/googleapis/java-bigquerystorage/commit/b9ab6aac2f360f9ab541d83ad1f2d921657a56bf)) ##### Documentation - **tutorials:** add integration test file structure for tutorials ([#​1507](https://togithub.com/googleapis/java-bigquerystorage/issues/1507)) ([ecb1fbb](https://togithub.com/googleapis/java-bigquerystorage/commit/ecb1fbb1186a2bb22a2c27ba85ff6ecfab883011)) - **tutorials:** Add README, other small fixes to JsonWriterDefaultStream tutorial ([#​1504](https://togithub.com/googleapis/java-bigquerystorage/issues/1504)) ([691eae5](https://togithub.com/googleapis/java-bigquerystorage/commit/691eae56f80a6751f25ef0db4f1d7b4bd6db2f66)) ##### [2.8.3](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.8.2...v2.8.3) (2022-01-28) ##### Dependencies - **java:** update actions/github-script action to v5 ([#​1339](https://togithub.com/googleapis/java-bigquerystorage/issues/1339)) ([#​1491](https://togithub.com/googleapis/java-bigquerystorage/issues/1491)) ([7eea012](https://togithub.com/googleapis/java-bigquerystorage/commit/7eea012ee49ebba9c97273abd6331a63868bf72e)) - update actions/github-script action to v5 ([#​1492](https://togithub.com/googleapis/java-bigquerystorage/issues/1492)) ([580c033](https://togithub.com/googleapis/java-bigquerystorage/commit/580c03363e5f3b8231e8ef491164badf0b126ca8)) - update dependency com.google.cloud:google-cloud-bigquery to v2.7.0 ([#​1499](https://togithub.com/googleapis/java-bigquerystorage/issues/1499)) ([0d414f8](https://togithub.com/googleapis/java-bigquerystorage/commit/0d414f8eaca6daf89b3f981f2c727b217a59e658)) - upgrade google-cloud-shared-dependencies to v2.7.0 ([#​1501](https://togithub.com/googleapis/java-bigquerystorage/issues/1501)) ([3f75e83](https://togithub.com/googleapis/java-bigquerystorage/commit/3f75e83cb5140f633204374a315831ccd09dfae3)) ##### Documentation - **tutorials:** add a README.md ([#​1500](https://togithub.com/googleapis/java-bigquerystorage/issues/1500)) ([c50c6a0](https://togithub.com/googleapis/java-bigquerystorage/commit/c50c6a039a47cc6e0a1e56966142b21e476074c8)) - **tutorials:** add new tutorials directory and JsonWriterDefaultStream tutorial ([#​1498](https://togithub.com/googleapis/java-bigquerystorage/issues/1498)) ([fd1ecf2](https://togithub.com/googleapis/java-bigquerystorage/commit/fd1ecf2a8e7b96b7edbf5c9b6d12dedee8c9ba49)) ##### [2.8.2](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.8.1...v2.8.2) (2022-01-25) ##### Bug Fixes - **java:** add reflection configuration for native-image testing ([#​1488](https://togithub.com/googleapis/java-bigquerystorage/issues/1488)) ([d87fe28](https://togithub.com/googleapis/java-bigquerystorage/commit/d87fe282800b4ef4a9c5ecf918278a84eb20ce5d)) ##### Documentation - **samples:** add finalize call to our samples ([#​1471](https://togithub.com/googleapis/java-bigquerystorage/issues/1471)) ([47e3654](https://togithub.com/googleapis/java-bigquerystorage/commit/47e36543480bf495f4caea63419bb3b31ac7638c)) - **samples:** update to v1 in doc URls ([#​1489](https://togithub.com/googleapis/java-bigquerystorage/issues/1489)) ([7efe427](https://togithub.com/googleapis/java-bigquerystorage/commit/7efe4273d9afebac6f67ed46763d5896b4b1bbcd)) ##### Dependencies - exclude un-used runtime dependencies brought in by gax-grpc ([#​1490](https://togithub.com/googleapis/java-bigquerystorage/issues/1490)) ([3e7833e](https://togithub.com/googleapis/java-bigquerystorage/commit/3e7833ea33ceac5f3e7cb9696a6e7ef6e914469b)) - update dependency com.google.cloud:google-cloud-bigquery to v2.6.1 ([#​1473](https://togithub.com/googleapis/java-bigquerystorage/issues/1473)) ([f996cdb](https://togithub.com/googleapis/java-bigquerystorage/commit/f996cdbbc6cc9ad7c6a649ebb649ae005054f36e)) - update dependency com.google.cloud:google-cloud-bigquery to v2.6.2 ([#​1475](https://togithub.com/googleapis/java-bigquerystorage/issues/1475)) ([37c1fd8](https://togithub.com/googleapis/java-bigquerystorage/commit/37c1fd887acfc5676ebb55e085b6e3514b6e5ca4)) - update dependency kr.motd.maven:os-maven-plugin to v1.7.0 ([#​1476](https://togithub.com/googleapis/java-bigquerystorage/issues/1476)) ([e038151](https://togithub.com/googleapis/java-bigquerystorage/commit/e038151442c4fd86e94ab7f3d02989c73a23ee91)) ##### [2.8.1](https://www.github.com/googleapis/java-bigquerystorage/compare/v2.8.0...v2.8.1) (2022-01-07) ##### Bug Fixes - **java:** run Maven in plain console-friendly mode ([#​1301](https://www.togithub.com/googleapis/java-bigquerystorage/issues/1301)) ([#​1461](https://www.togithub.com/googleapis/java-bigquerystorage/issues/1461)) ([6b9e08c](https://www.github.com/googleapis/java-bigquerystorage/commit/6b9e08c4736cfdb4d98bf3c8f782a87ab68580ce)) ##### Dependencies - update dependency com.google.cloud:google-cloud-bigquery to v2.6.0 ([#​1459](https://www.togithub.com/googleapis/java-bigquerystorage/issues/1459)) ([323813c](https://www.github.com/googleapis/java-bigquerystorage/commit/323813c88cd673bbf3f8631f03ac1732f7d3ac53)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#​1467](https://www.togithub.com/googleapis/java-bigquerystorage/issues/1467)) ([8ebb448](https://www.github.com/googleapis/java-bigquerystorage/commit/8ebb448ff0a1188124c1deeebe4bddbfe277e35b)) ### [`v2.8.4`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​284-httpsgithubcomgoogleapisjava-bigquerystoragecomparev283v284-2022-02-03) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.8.3...v2.8.4)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 76d1c65e41..c1d8cc9782 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.8.3 + 2.13.0 pom import From c5c1bb016c9fa26d8dad9437f81bf7c603cf6cec Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 9 May 2022 10:28:12 -0400 Subject: [PATCH 0732/2268] chore(deps): manage arrow version in the parent pom properties (#2029) so that we don't get multiple dependency update PRs for arrow-related dependencies --- pom.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c1d8cc9782..ccb4ccc1d6 100644 --- a/pom.xml +++ b/pom.xml @@ -55,6 +55,7 @@ google-cloud-bigquery-parent v2-rev20220429-1.32.1 2.10.0 + 8.0.0
    @@ -78,17 +79,17 @@ org.apache.arrow arrow-vector - 7.0.0 + ${arrow.version} org.apache.arrow arrow-memory-core - 7.0.0 + ${arrow.version} org.apache.arrow arrow-memory-netty - 7.0.0 + ${arrow.version} runtime From aeca04da45b5f92199f0f5e55e757e666d98367d Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Mon, 9 May 2022 12:01:34 -0400 Subject: [PATCH 0733/2268] chore: disable graalvm ITs till #2007 is fixed (#2032) --- .kokoro/build.sh | 10 +++++----- owlbot.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index f5a684ca35..eeaa078353 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -69,11 +69,11 @@ integration) verify RETURN_CODE=$? ;; -graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; +#graalvm) +# # Run Unit and Integration Tests with Native Image +# mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test +# RETURN_CODE=$? +# ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. diff --git a/owlbot.py b/owlbot.py index c14fae8627..55f7f4101e 100644 --- a/owlbot.py +++ b/owlbot.py @@ -22,5 +22,5 @@ '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', - 'build.sh', + '.kokoro/build.sh', ]) \ No newline at end of file From db3daacea8a91ab80b7e923f1480874b01cbad0c Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 10 May 2022 19:59:24 +0530 Subject: [PATCH 0734/2268] fix: fix for flaky connection close issue (#2034) * Added hasReachedEnd flag in next() method to avoid blocking * Added and wired markEoS and markLast methods. Minor refactor --- .../cloud/bigquery/BigQueryResultImpl.java | 9 +++ .../google/cloud/bigquery/ConnectionImpl.java | 73 +++++++++++++------ 2 files changed, 61 insertions(+), 21 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java index 7c24ca0dd4..2a2aba7cd2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -106,18 +106,27 @@ public ResultSet getResultSet() { } private class BigQueryResultSet extends AbstractJdbcResultSet { + private boolean hasReachedEnd = + false; // flag which will be set to true when we have encountered a EndOfStream or when + // curTup.isLast(). Ref: https://github.com/googleapis/java-bigquery/issues/2033 + @Override /*Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation*/ public boolean next() throws SQLException { + if (hasReachedEnd) { // if end of stream is reached then we can simply return false + return false; + } try { cursor = buffer.take(); // advance the cursor,Potentially blocking operation if (isEndOfStream(cursor)) { // check for end of stream cursor = null; + hasReachedEnd = true; return false; } else if (cursor instanceof Row) { Row curTup = (Row) cursor; if (curTup.isLast()) { // last Tuple cursor = null; + hasReachedEnd = true; return false; } return true; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index c24a00888d..b43615141c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -20,6 +20,7 @@ import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; import com.google.api.services.bigquery.model.GetQueryResultsResponse; import com.google.api.services.bigquery.model.JobConfigurationQuery; import com.google.api.services.bigquery.model.QueryParameter; @@ -496,6 +497,38 @@ void parseRpcDataAsync( queryTaskExecutor.execute(parseDataTask); } + /** + * This method is called when the current thread is interrupted, this communicates to ResultSet by + * adding a EoS + * + * @param buffer + */ + @InternalApi + void markEoS(BlockingQueue> buffer) { // package-private + try { + buffer.put(new EndOfFieldValueList()); // All the pages has been processed, put this marker + } catch (InterruptedException e) { + logger.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); + } + } + + /** + * This method is called when the current thread is interrupted, this communicates to ResultSet by + * adding a isLast Row + * + * @param buffer + */ + @InternalApi + void markLast(BlockingQueue buffer) { // package-private + try { + buffer.put( + new BigQueryResultImpl.Row( + null, true)); // All the pages has been processed, put this marker + } catch (InterruptedException e) { + logger.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); + } + } + @VisibleForTesting void populateBufferAsync( BlockingQueue> rpcResponseQueue, @@ -516,11 +549,15 @@ void populateBufferAsync( "\n" + Thread.currentThread().getName() + " Interrupted", e); // Thread might get interrupted while calling the Cancel method, which is // expected, so logging this instead of throwing the exception back + markEoS( + buffer); // Thread has been interrupted, communicate to ResultSet by adding EoS } if (Thread.currentThread().isInterrupted() || fieldValueLists == null) { // do not process further pages and shutdown (outerloop) + markEoS( + buffer); // Thread has been interrupted, communicate to ResultSet by adding EoS break; } @@ -528,6 +565,9 @@ void populateBufferAsync( try { if (Thread.currentThread() .isInterrupted()) { // do not process further pages and shutdown (inner loop) + markEoS( + buffer); // Thread has been interrupted, communicate to ResultSet by adding + // EoS break; } buffer.put(fieldValueList); @@ -537,19 +577,15 @@ void populateBufferAsync( } } - if (Thread.currentThread() - .isInterrupted()) { // clear the buffer for any outstanding records - buffer.clear(); - rpcResponseQueue - .clear(); // IMP - so that if it's full then it unblocks and the interrupt logic - // could trigger - } - try { - buffer.put( - new EndOfFieldValueList()); // All the pages has been processed, put this marker - } catch (InterruptedException e) { - throw new BigQueryException(0, e.getMessage(), e); + if (Thread.currentThread() + .isInterrupted()) { // clear the buffer for any outstanding records + rpcResponseQueue + .clear(); // IMP - so that if it's full then it unblocks and the interrupt logic + // could trigger + buffer.clear(); + } + markEoS(buffer); // All the pages has been processed, put this marker } finally { queryTaskExecutor.shutdownNow(); // Shutdown the thread pool } @@ -790,12 +826,8 @@ private void processArrowStreamAsync( } catch (Exception e) { throw BigQueryException.translateAndThrow(e); } finally { - try { - buffer.put(new BigQueryResultImpl.Row(null, true)); // marking end of stream - queryTaskExecutor.shutdownNow(); // Shutdown the thread pool - } catch (InterruptedException e) { - logger.log(Level.WARNING, "\n Error occurred ", e); - } + markLast(buffer); // marking end of stream + queryTaskExecutor.shutdownNow(); // Shutdown the thread pool } }; @@ -856,6 +888,7 @@ private void processRows( if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { // do not process and shutdown + markLast(buffer); // puts an isLast Row in the buffer for ResultSet to process break; // exit the loop, root will be cleared in the finally block } @@ -869,9 +902,7 @@ private void processRows( } buffer.put(new BigQueryResultImpl.Row(curRow)); } - root.clear(); // TODO: make sure to clear the root while implementing the thread - // interruption logic (Connection.close method) - + root.clear(); } catch (RuntimeException | InterruptedException e) { throw BigQueryException.translateAndThrow(e); } finally { From 938c6248424b5f270e6264644d1db8679ae80c44 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 10 May 2022 23:41:09 +0530 Subject: [PATCH 0735/2268] Updated initialization logic for ConnectionSettings, and refactored (#2035) --- .../ConnImplBenchmark.java | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java index 36c27eb6a9..40c5fc11d4 100644 --- a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java +++ b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java @@ -60,33 +60,13 @@ public class ConnImplBenchmark { @Setup public void setUp() throws IOException { java.util.logging.Logger.getGlobal().setLevel(Level.ALL); - ReadClientConnectionConfiguration clientConnectionConfiguration; - - clientConnectionConfiguration = - ReadClientConnectionConfiguration.newBuilder() - .setTotalToPageRowCountRatio(NUM_PAGE_ROW_CNT_RATIO) - .setMinResultSize(NUM_MIN_RESULT_SIZE) - .setBufferSize(numBuffRows) - .build(); connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder() - .setDefaultDataset(DatasetId.of(DATASET)) - .setNumBufferedRows(numBuffRows) // page size - .setPriority( - QueryJobConfiguration.Priority - .INTERACTIVE) // DEFAULT VALUE - so that isFastQuerySupported returns false - .setReadClientConnectionConfiguration(clientConnectionConfiguration) .setUseReadAPI(true) // enable read api .build(); connectionSettingsReadAPIDisabled = ConnectionSettings.newBuilder() - .setDefaultDataset(DatasetId.of(DATASET)) - .setNumBufferedRows(numBuffRows) // page size - .setPriority( - QueryJobConfiguration.Priority - .INTERACTIVE) // so that isFastQuerySupported returns false - .setReadClientConnectionConfiguration(clientConnectionConfiguration) .setUseReadAPI(false) // disable read api .build(); } @@ -101,7 +81,7 @@ public void iterateRecordsUsingReadAPI(Blackhole blackhole) String selectQuery = String.format(QUERY, rowLimit); long hash = 0L; try { - BigQueryResultSet bigQueryResultSet = connectionReadAPIEnabled.executeSelect(selectQuery); + BigQueryResult bigQueryResultSet = connectionReadAPIEnabled.executeSelect(selectQuery); hash = getResultHash(bigQueryResultSet); } catch (Exception e) { e.printStackTrace(); @@ -121,7 +101,7 @@ public void iterateRecordsWithoutUsingReadAPI(Blackhole blackhole) String selectQuery = String.format(QUERY, rowLimit); long hash = 0L; try { - BigQueryResultSet bigQueryResultSet = connectionReadAPIDisabled.executeSelect(selectQuery); + BigQueryResult bigQueryResultSet = connectionReadAPIDisabled.executeSelect(selectQuery); hash = getResultHash(bigQueryResultSet); } catch (Exception e) { e.printStackTrace(); @@ -132,7 +112,7 @@ public void iterateRecordsWithoutUsingReadAPI(Blackhole blackhole) } // Hashes all the 20 columns of all the rows - private long getResultHash(BigQueryResultSet bigQueryResultSet) throws SQLException { + private long getResultHash(BigQueryResult bigQueryResultSet) throws SQLException { ResultSet rs = bigQueryResultSet.getResultSet(); long hash = 0L; int cnt = 0; From 7164add624198dc40fedca13c105204a56086c17 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 18:30:13 +0000 Subject: [PATCH 0736/2268] chore(main): release 2.11.0 (#1998) :robot: I have created a release *beep* *boop* --- ## [2.11.0](https://github.com/googleapis/java-bigquery/compare/v2.10.10...v2.11.0) (2022-05-10) ### Features * add Connection interface ([#1374](https://github.com/googleapis/java-bigquery/issues/1374)) ([3804275](https://github.com/googleapis/java-bigquery/commit/380427511b33938209241f3800bff05914957f2b)) * next release from main branch is 2.10.9 ([#1996](https://github.com/googleapis/java-bigquery/issues/1996)) ([f716427](https://github.com/googleapis/java-bigquery/commit/f716427490d4b87573669ab4338335c0844e82c0)) ### Bug Fixes * add native image configuration for Arrow ([#2018](https://github.com/googleapis/java-bigquery/issues/2018)) ([06cbe69](https://github.com/googleapis/java-bigquery/commit/06cbe69112e3e0d31e4fb90e43dca6e6dc4f1bdf)) * fix for flaky connection close issue ([#2034](https://github.com/googleapis/java-bigquery/issues/2034)) ([db3daac](https://github.com/googleapis/java-bigquery/commit/db3daacea8a91ab80b7e923f1480874b01cbad0c)) ### Documentation * **sample:** remove unused dependency and add setup instructions ([#2010](https://github.com/googleapis/java-bigquery/issues/2010)) ([e2e9113](https://github.com/googleapis/java-bigquery/commit/e2e91133718d41349a94b5d93d66699e84233e64)) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220422-1.32.1 ([#2017](https://github.com/googleapis/java-bigquery/issues/2017)) ([b9fa786](https://github.com/googleapis/java-bigquery/commit/b9fa786ad1bca2fb763a146fa3bb431ff6860153)) * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220429-1.32.1 ([#2020](https://github.com/googleapis/java-bigquery/issues/2020)) ([78789a5](https://github.com/googleapis/java-bigquery/commit/78789a5530679349dbee691bd1907ffaefc617a6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 25 +++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f172457088..9f5d81197b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [2.11.0](https://github.com/googleapis/java-bigquery/compare/v2.10.10...v2.11.0) (2022-05-10) + + +### Features + +* add Connection interface ([#1374](https://github.com/googleapis/java-bigquery/issues/1374)) ([3804275](https://github.com/googleapis/java-bigquery/commit/380427511b33938209241f3800bff05914957f2b)) +* next release from main branch is 2.10.9 ([#1996](https://github.com/googleapis/java-bigquery/issues/1996)) ([f716427](https://github.com/googleapis/java-bigquery/commit/f716427490d4b87573669ab4338335c0844e82c0)) + + +### Bug Fixes + +* add native image configuration for Arrow ([#2018](https://github.com/googleapis/java-bigquery/issues/2018)) ([06cbe69](https://github.com/googleapis/java-bigquery/commit/06cbe69112e3e0d31e4fb90e43dca6e6dc4f1bdf)) +* fix for flaky connection close issue ([#2034](https://github.com/googleapis/java-bigquery/issues/2034)) ([db3daac](https://github.com/googleapis/java-bigquery/commit/db3daacea8a91ab80b7e923f1480874b01cbad0c)) + + +### Documentation + +* **sample:** remove unused dependency and add setup instructions ([#2010](https://github.com/googleapis/java-bigquery/issues/2010)) ([e2e9113](https://github.com/googleapis/java-bigquery/commit/e2e91133718d41349a94b5d93d66699e84233e64)) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220422-1.32.1 ([#2017](https://github.com/googleapis/java-bigquery/issues/2017)) ([b9fa786](https://github.com/googleapis/java-bigquery/commit/b9fa786ad1bca2fb763a146fa3bb431ff6860153)) +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220429-1.32.1 ([#2020](https://github.com/googleapis/java-bigquery/issues/2020)) ([78789a5](https://github.com/googleapis/java-bigquery/commit/78789a5530679349dbee691bd1907ffaefc617a6)) + ### [2.10.10](https://github.com/googleapis/java-bigquery/compare/v2.10.9...v2.10.10) (2022-04-18) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index db892112cb..f86445f31d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.10.11-SNAPSHOT + 2.11.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ab0b4d22a3..911ddc9334 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.10.11-SNAPSHOT + 2.11.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.10.11-SNAPSHOT + 2.11.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ccb4ccc1d6..bfc0b544f5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.10.11-SNAPSHOT + 2.11.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.10.11-SNAPSHOT + 2.11.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index befe436180..3d45f98341 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.10.11-SNAPSHOT + 2.11.0 diff --git a/versions.txt b/versions.txt index ad1668e67d..0a094a6c67 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.10.10:2.10.11-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.11.0:2.11.0 \ No newline at end of file From fdb35f9dbc676c4a7ec2f924dd48a84e8de7b923 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 18:50:16 +0000 Subject: [PATCH 0737/2268] chore(main): release 2.11.1-SNAPSHOT (#2036) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f86445f31d..c763a5dce6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.0 + 2.11.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 911ddc9334..3af4c1cb83 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.0 + 2.11.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.0 + 2.11.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bfc0b544f5..9532335f98 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.0 + 2.11.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.0 + 2.11.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3d45f98341..97350f9006 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.0 + 2.11.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0a094a6c67..54b6871551 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.0:2.11.0 \ No newline at end of file +google-cloud-bigquery:2.11.0:2.11.1-SNAPSHOT \ No newline at end of file From be68b35176634be371f74e50c11785de23027c59 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 11 May 2022 11:55:09 -0400 Subject: [PATCH 0738/2268] chore: setup nightly integration tests (#2038) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: setup nightly integration tests * 🦉 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 --- .kokoro/build.sh | 12 +++++++- .kokoro/nightly/nightly-integration.cfg | 37 +++++++++++++++++++++++++ README.md | 4 +-- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .kokoro/nightly/nightly-integration.cfg diff --git a/.kokoro/build.sh b/.kokoro/build.sh index eeaa078353..62eaa83a0d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,7 +61,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Penable-integration-tests \ + -Dtest=ITBigQueryTest\ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -69,6 +69,16 @@ integration) verify RETURN_CODE=$? ;; +nightly-it) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Dtest=ITNightlyBigQueryTest + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + test + ;; #graalvm) # # Run Unit and Integration Tests with Native Image # mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test diff --git a/.kokoro/nightly/nightly-integration.cfg b/.kokoro/nightly/nightly-integration.cfg new file mode 100644 index 0000000000..675f799182 --- /dev/null +++ b/.kokoro/nightly/nightly-integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "nightly-it" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/README.md b/README.md index 8589bfc2b4..9eca24b8c2 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.10.10' +implementation 'com.google.cloud:google-cloud-bigquery:2.11.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.10.10" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.0" ``` ## Authentication From dba9fdef6251212cd5bbe016999ed26831a156af Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 11 May 2022 17:55:55 +0200 Subject: [PATCH 0739/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.0 (#2037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9eca24b8c2..7afce7e97f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.10.10 + 2.11.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4b298cce87..3ce7cebc4f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.10.10 + 2.11.0 From ec10547a16a141d7b222f0d34f1b85fcf8b436a0 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 12 May 2022 15:46:12 -0400 Subject: [PATCH 0740/2268] chore: fix nightly integration test (#2041) Fixes #2009 --- .kokoro/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 62eaa83a0d..9a64ef854d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -77,7 +77,8 @@ nightly-it) -Dclirr.skip=true \ -Denforcer.skip=true \ -fae \ - test + verify + RETURN_CODE=$? ;; #graalvm) # # Run Unit and Integration Tests with Native Image From 3ab34d2c4c6e5b8c0b20fcf32d807c4d075791a9 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 13 May 2022 11:12:00 -0400 Subject: [PATCH 0741/2268] chore: fix typo (#2043) --- .kokoro/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 9a64ef854d..3c45ad23a2 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,7 +61,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITBigQueryTest\ + -Dtest=ITBigQueryTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -72,7 +72,7 @@ integration) nightly-it) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITNightlyBigQueryTest + -Dtest=ITNightlyBigQueryTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ From 8c9efa08607be88332c89f4ab417f7d4ab2f3a97 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 16 May 2022 17:47:10 +0200 Subject: [PATCH 0742/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v25.3.0 (#2045) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v25.3.0 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7afce7e97f..34a0ae2286 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 25.2.0 + 25.3.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:25.2.0') +implementation platform('com.google.cloud:libraries-bom:25.3.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index de1ea6adf7..ad74463cb6 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 25.2.0 + 25.3.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 26550a1c5b..1e8dd6ef9e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 25.2.0 + 25.3.0 pom import From 081888e9ab9bc2c68e607fb11ff1ee40ac58873a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 16 May 2022 19:38:12 +0200 Subject: [PATCH 0743/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220507-1.32.1 (#2042) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220429-1.32.1` -> `v2-rev20220507-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220507-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220507-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220507-1.32.1/compatibility-slim/v2-rev20220429-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220507-1.32.1/confidence-slim/v2-rev20220429-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9532335f98..837b8297a6 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220429-1.32.1 + v2-rev20220507-1.32.1 2.10.0 8.0.0 From d231fac94fd6f3990963955ec88b63afec97db0d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 17:56:14 +0000 Subject: [PATCH 0744/2268] chore(main): release 2.11.1 (#2046) :robot: I have created a release *beep* *boop* --- ### [2.11.1](https://github.com/googleapis/java-bigquery/compare/v2.11.0...v2.11.1) (2022-05-16) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220507-1.32.1 ([#2042](https://github.com/googleapis/java-bigquery/issues/2042)) ([081888e](https://github.com/googleapis/java-bigquery/commit/081888e9ab9bc2c68e607fb11ff1ee40ac58873a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5d81197b..748304184f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.11.1](https://github.com/googleapis/java-bigquery/compare/v2.11.0...v2.11.1) (2022-05-16) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220507-1.32.1 ([#2042](https://github.com/googleapis/java-bigquery/issues/2042)) ([081888e](https://github.com/googleapis/java-bigquery/commit/081888e9ab9bc2c68e607fb11ff1ee40ac58873a)) + ## [2.11.0](https://github.com/googleapis/java-bigquery/compare/v2.10.10...v2.11.0) (2022-05-10) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c763a5dce6..f3ac092bbe 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.1-SNAPSHOT + 2.11.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3af4c1cb83..c110be2115 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.1-SNAPSHOT + 2.11.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.1-SNAPSHOT + 2.11.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 837b8297a6..32a0419375 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.1-SNAPSHOT + 2.11.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.1-SNAPSHOT + 2.11.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 97350f9006..3715d2b05f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.1-SNAPSHOT + 2.11.1 diff --git a/versions.txt b/versions.txt index 54b6871551..e5caec1bb2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.0:2.11.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.11.1:2.11.1 \ No newline at end of file From c7e5a91015e6338bbbe3a026621f975ed8c74020 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 18:10:19 +0000 Subject: [PATCH 0745/2268] chore(main): release 2.11.2-SNAPSHOT (#2047) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f3ac092bbe..c1e3382e94 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.1 + 2.11.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c110be2115..e2707c1e78 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.1 + 2.11.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.1 + 2.11.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 32a0419375..ebc31870ef 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.1 + 2.11.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.1 + 2.11.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3715d2b05f..40c892c2bb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.1 + 2.11.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index e5caec1bb2..d0677dd3a6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.1:2.11.1 \ No newline at end of file +google-cloud-bigquery:2.11.1:2.11.2-SNAPSHOT \ No newline at end of file From bf77967e006bf699861550fc95205b9f66af6567 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 17 May 2022 16:42:07 +0200 Subject: [PATCH 0746/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.1 (#2048) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 34a0ae2286..ef43a359ad 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.11.0 + 2.11.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.11.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.11.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3ce7cebc4f..906f422e00 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.11.0 + 2.11.1 From 251d4686d22e0000982bcd891de68491326558fe Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Wed, 18 May 2022 21:06:12 +0530 Subject: [PATCH 0747/2268] fix: NPE issue with testMultipleRuns (#2050) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a `null` check for `firstPage.getSchema()` as we might get null schema when the job is long running (We get schema using dryRun in such cases) Fixes #2049 ☕️ --- .../main/java/com/google/cloud/bigquery/ConnectionImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index b43615141c..cc330a90a0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -234,8 +234,10 @@ public BigQueryResult executeSelect( BigQueryResult getResultSet( GetQueryResultsResponse firstPage, JobId jobId, String sql, Boolean hasQueryParameters) { if (firstPage.getJobComplete() - && firstPage.getTotalRows() - != null) { // firstPage.getTotalRows() is null if job is not complete + && firstPage.getTotalRows() != null + && firstPage.getSchema() + != null) { // firstPage.getTotalRows() is null if job is not complete. We need to make + // sure that the schema is not null, as it is required for the ResultSet return getSubsequentQueryResultsWithJob( firstPage.getTotalRows().longValue(), (long) firstPage.getRows().size(), From 9993717d546c4039cb8c846787fdd131cc0c113f Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Wed, 18 May 2022 21:08:55 +0530 Subject: [PATCH 0748/2268] fix: Flaky connenction close issue (#2044) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added EoS mark in populate buffer. changed log level to Fine. Minor refactor * Updated count assertion @ testConnectionClose * Updated condition to trigger `connection.close` at testConnectionClose * Added and wired flagEndOfStream. Refactored and improved Thread interrupt logic * Add testConnectionClose for checking connection close while using Read API * 🦉 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 --- .../google/cloud/bigquery/ConnectionImpl.java | 195 +++++++++++------- .../cloud/bigquery/it/ITBigQueryTest.java | 5 +- .../bigquery/it/ITNightlyBigQueryTest.java | 26 ++- 3 files changed, 142 insertions(+), 84 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index cc330a90a0..be5174b260 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -87,7 +87,11 @@ class ConnectionImpl implements Connection { Executors.newFixedThreadPool(MAX_PROCESS_QUERY_THREADS_CNT); private final Logger logger = Logger.getLogger(this.getClass().getName()); private BigQueryReadClient bqReadClient; - private static final long EXECUTOR_TIMEOUT_SEC = 5; + private static final long EXECUTOR_TIMEOUT_SEC = 10; + private BlockingQueue> + bufferFvl; // initialized lazily iff we end up using the tabledata.list end point + private BlockingQueue + bufferRow; // initialized lazily iff we end up using Read API ConnectionImpl( ConnectionSettings connectionSettings, @@ -107,6 +111,19 @@ class ConnectionImpl implements Connection { : Math.min(connectionSettings.getNumBufferedRows() * 2, 100000)); } + /** + * This method returns the number of records to be stored in the buffer and it ensures that it is + * between a reasonable range + * + * @return The max number of records to be stored in the buffer + */ + private int getBufferSize() { + return (connectionSettings == null + || connectionSettings.getNumBufferedRows() == null + || connectionSettings.getNumBufferedRows() < 10000 + ? 20000 + : Math.min(connectionSettings.getNumBufferedRows() * 2, 100000)); + } /** * Cancel method shutdowns the pageFetcher and producerWorker threads gracefully using interrupt. * The pageFetcher threat will not request for any subsequent threads after interrupting and @@ -119,12 +136,14 @@ class ConnectionImpl implements Connection { @BetaApi @Override public synchronized boolean close() throws BigQuerySQLException { + flagEndOfStream(); // an End of Stream flag in the buffer so that the `ResultSet.next()` stops + // advancing the cursor queryTaskExecutor.shutdownNow(); try { - queryTaskExecutor.awaitTermination( - EXECUTOR_TIMEOUT_SEC, TimeUnit.SECONDS); // wait for the executor shutdown + if (queryTaskExecutor.awaitTermination(EXECUTOR_TIMEOUT_SEC, TimeUnit.SECONDS)) { + return true; + } // else queryTaskExecutor.isShutdown() will be returned outside this try block } catch (InterruptedException e) { - e.printStackTrace(); logger.log( Level.WARNING, "\n" + Thread.currentThread().getName() + " Exception while awaitTermination", @@ -330,7 +349,7 @@ BigQueryResult tableDataList(GetQueryResultsResponse firstPage, JobId jobId) { BigQueryResultStats bigQueryResultStats = getBigQueryResultSetStats(jobId); // Keeps the deserialized records at the row level, which is consumed by BigQueryResult - BlockingQueue> buffer = new LinkedBlockingDeque<>(bufferSize); + bufferFvl = new LinkedBlockingDeque<>(getBufferSize()); // Keeps the parsed FieldValueLists BlockingQueue, Boolean>> pageCache = @@ -352,11 +371,11 @@ BigQueryResult tableDataList(GetQueryResultsResponse firstPage, JobId jobId) { // throughput populateBufferAsync( - rpcResponseQueue, pageCache, buffer); // spawns a thread to populate the buffer + rpcResponseQueue, pageCache, bufferFvl); // spawns a thread to populate the buffer // This will work for pagination as well, as buffer is getting updated asynchronously return new BigQueryResultImpl>( - schema, numRows, buffer, bigQueryResultStats); + schema, numRows, bufferFvl, bigQueryResultStats); } @VisibleForTesting @@ -384,7 +403,7 @@ BigQueryResult processQueryResponseResults( BigQueryResultStats bigQueryResultStats = new BigQueryResultStatsImpl(queryStatistics, sessionInfo); - BlockingQueue> buffer = new LinkedBlockingDeque<>(bufferSize); + bufferFvl = new LinkedBlockingDeque<>(getBufferSize()); BlockingQueue, Boolean>> pageCache = new LinkedBlockingDeque<>( getPageCacheSize(connectionSettings.getNumBufferedRows(), schema)); @@ -401,10 +420,10 @@ BigQueryResult processQueryResponseResults( parseRpcDataAsync(results.getRows(), schema, pageCache, rpcResponseQueue); // Thread to populate the buffer (a blocking queue) shared with the consumer - populateBufferAsync(rpcResponseQueue, pageCache, buffer); + populateBufferAsync(rpcResponseQueue, pageCache, bufferFvl); return new BigQueryResultImpl>( - schema, numRows, buffer, bigQueryResultStats); + schema, numRows, bufferFvl, bigQueryResultStats); } @VisibleForTesting @@ -420,6 +439,11 @@ void runNextPageTaskAsync( while (pageToken != null) { // paginate for non null token if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { // do not process further pages and shutdown + logger.log( + Level.WARNING, + "\n" + + Thread.currentThread().getName() + + " Interrupted @ runNextPageTaskAsync"); break; } TableDataList tabledataList = tableDataListRpc(destinationTable, pageToken); @@ -432,12 +456,12 @@ void runNextPageTaskAsync( } rpcResponseQueue.put( Tuple.of( - null, - false)); // this will stop the parseDataTask as well in case of interrupt or - // when the pagination completes + null, false)); // this will stop the parseDataTask as well when the pagination + // completes } catch (Exception e) { throw new BigQueryException(0, e.getMessage(), e); - } + } // We cannot do queryTaskExecutor.shutdownNow() here as populate buffer method may not + // have finished processing the records and even that will be interrupted }; queryTaskExecutor.execute(nextPageTask); } @@ -460,7 +484,9 @@ void parseRpcDataAsync( pageCache.put( Tuple.of(firstFieldValueLists, true)); // this is the first page which we have received. } catch (InterruptedException e) { - throw new BigQueryException(0, e.getMessage(), e); + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ parseRpcDataAsync"); } // rpcResponseQueue will get null tuple if Cancel method is called, so no need to explicitly use @@ -470,6 +496,14 @@ void parseRpcDataAsync( try { boolean hasMorePages = true; while (hasMorePages) { + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown()) { // do not process further data and shutdown + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ parseRpcDataAsync"); + break; + } + // no interrupt received till this point, continue processing Tuple rpcResponse = rpcResponseQueue.take(); TableDataList tabledataList = rpcResponse.x(); hasMorePages = rpcResponse.y(); @@ -482,55 +516,24 @@ void parseRpcDataAsync( } catch (InterruptedException e) { logger.log( Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted", + "\n" + Thread.currentThread().getName() + " Interrupted @ parseRpcDataAsync", e); // Thread might get interrupted while calling the Cancel method, which is // expected, so logging this instead of throwing the exception back } try { - pageCache.put(Tuple.of(null, false)); // no further pages + pageCache.put(Tuple.of(null, false)); // no further pages, graceful exit scenario } catch (InterruptedException e) { logger.log( Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted", + "\n" + Thread.currentThread().getName() + " Interrupted @ parseRpcDataAsync", e); // Thread might get interrupted while calling the Cancel method, which is // expected, so logging this instead of throwing the exception back - } + } // We cannot do queryTaskExecutor.shutdownNow() here as populate buffer method may not + // have finished processing the records and even that will be interrupted }; queryTaskExecutor.execute(parseDataTask); } - /** - * This method is called when the current thread is interrupted, this communicates to ResultSet by - * adding a EoS - * - * @param buffer - */ - @InternalApi - void markEoS(BlockingQueue> buffer) { // package-private - try { - buffer.put(new EndOfFieldValueList()); // All the pages has been processed, put this marker - } catch (InterruptedException e) { - logger.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); - } - } - - /** - * This method is called when the current thread is interrupted, this communicates to ResultSet by - * adding a isLast Row - * - * @param buffer - */ - @InternalApi - void markLast(BlockingQueue buffer) { // package-private - try { - buffer.put( - new BigQueryResultImpl.Row( - null, true)); // All the pages has been processed, put this marker - } catch (InterruptedException e) { - logger.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); - } - } - @VisibleForTesting void populateBufferAsync( BlockingQueue> rpcResponseQueue, @@ -551,25 +554,21 @@ void populateBufferAsync( "\n" + Thread.currentThread().getName() + " Interrupted", e); // Thread might get interrupted while calling the Cancel method, which is // expected, so logging this instead of throwing the exception back - markEoS( - buffer); // Thread has been interrupted, communicate to ResultSet by adding EoS + break; } if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown() || fieldValueLists == null) { // do not process further pages and shutdown (outerloop) - markEoS( - buffer); // Thread has been interrupted, communicate to ResultSet by adding EoS break; } for (FieldValueList fieldValueList : fieldValueLists) { try { - if (Thread.currentThread() - .isInterrupted()) { // do not process further pages and shutdown (inner loop) - markEoS( - buffer); // Thread has been interrupted, communicate to ResultSet by adding - // EoS + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor + .isShutdown()) { // do not process further pages and shutdown (inner loop) break; } buffer.put(fieldValueList); @@ -578,24 +577,55 @@ void populateBufferAsync( } } } - try { - if (Thread.currentThread() - .isInterrupted()) { // clear the buffer for any outstanding records - rpcResponseQueue - .clear(); // IMP - so that if it's full then it unblocks and the interrupt logic - // could trigger - buffer.clear(); - } - markEoS(buffer); // All the pages has been processed, put this marker + buffer.put( + new EndOfFieldValueList()); // All the pages has been processed, put this marker + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ populateBufferAsync", + e); } finally { - queryTaskExecutor.shutdownNow(); // Shutdown the thread pool + queryTaskExecutor + .shutdownNow(); // Shutdown the thread pool. All the records are now processed } }; queryTaskExecutor.execute(populateBufferRunnable); } + /** + * In an interrupt scenario, like when the background threads are still working and the user calls + * `connection.close() then we need to add an End of Stream flag in the buffer so that the + * `ResultSet.next()` stops advancing the cursor. We cannot rely on the `populateBufferAsync` + * method to do this as the `BlockingQueue.put()` call will error out after the interrupt is + * triggerred + */ + @InternalApi + void flagEndOfStream() { // package-private + try { + if (bufferFvl != null) { // that is tabledata.list endpoint is used + bufferFvl.put( + new EndOfFieldValueList()); // All the pages has been processed, put this marker + } else if (bufferRow != null) { + bufferRow.put( + new BigQueryResultImpl.Row( + null, true)); // All the pages has been processed, put this marker + } else { + logger.log( + Level.WARNING, + "\n" + + Thread.currentThread().getName() + + " Could not flag End of Stream, both the buffer types are null. This might happen when the connection is close without executing a query"); + } + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ flagEndOfStream", + e); + } + } + /* Helper method that parse and populate a page with TableRows */ private static Iterable getIterableFieldValueList( Iterable tableDataPb, final Schema schema) { @@ -783,17 +813,17 @@ BigQueryResult highThroughPutRead( ; ReadSession readSession = bqReadClient.createReadSession(builder.build()); - BlockingQueue buffer = new LinkedBlockingDeque<>(bufferSize); + bufferRow = new LinkedBlockingDeque<>(getBufferSize()); Map arrowNameToIndex = new HashMap<>(); // deserialize and populate the buffer async, so that the client isn't blocked processArrowStreamAsync( readSession, - buffer, + bufferRow, new ArrowRowReader(readSession.getArrowSchema(), arrowNameToIndex), schema); logger.log(Level.INFO, "\n Using BigQuery Read API"); - return new BigQueryResultImpl(schema, totalRows, buffer, stats); + return new BigQueryResultImpl(schema, totalRows, bufferRow, stats); } catch (IOException e) { throw BigQueryException.translateAndThrow(e); @@ -827,8 +857,18 @@ private void processArrowStreamAsync( } catch (Exception e) { throw BigQueryException.translateAndThrow(e); - } finally { - markLast(buffer); // marking end of stream + } finally { // logic needed for graceful shutdown + // marking end of stream + try { + buffer.put( + new BigQueryResultImpl.Row( + null, true)); // All the pages has been processed, put this marker + } catch (InterruptedException e) { + logger.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ markLast", + e); + } queryTaskExecutor.shutdownNow(); // Shutdown the thread pool } }; @@ -890,7 +930,6 @@ private void processRows( if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { // do not process and shutdown - markLast(buffer); // puts an isLast Row in the buffer for ResultSet to process break; // exit the loop, root will be cleared in the finally block } @@ -981,9 +1020,6 @@ boolean isFastQuerySupported() { @VisibleForTesting boolean useReadAPI(Long totalRows, Long pageRows, Schema schema, Boolean hasQueryParameters) { - - // TODO(prasmish) get this logic review - totalRows and pageRows are returned null when the job - // is not complete if ((totalRows == null || pageRows == null) && Boolean.TRUE.equals( connectionSettings @@ -992,7 +1028,6 @@ boolean useReadAPI(Long totalRows, Long pageRows, Schema schema, Boolean hasQuer return true; } - // Schema schema = Schema.fromPb(tableSchema); // Read API does not yet support Interval Type or QueryParameters if (containsIntervalType(schema) || hasQueryParameters) { logger.log(Level.INFO, "\n Schema has IntervalType, or QueryParameters. Disabling ReadAPI"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 348749b467..dcfa5265f1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2652,12 +2652,11 @@ public void testConnectionClose() throws SQLException { int cnt = 0; while (rs.next()) { ++cnt; - if (cnt > 57000) { // breaking at 57K, query reads 300K + if (cnt == 57000) { // breaking at 57000th record, query reads 300K assertTrue(connection.close()); // we should be able to cancel the connection } } - assertTrue( - cnt < 60000); // Few extra records are still read (generally ~10) even after canceling, as + assertTrue(cnt < 100000); // Extra records are still read even after canceling, as // the backgrounds threads are still active while the interrupt occurs and the // buffer and pageCache are cleared } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index d672967b14..deabba59f8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -332,7 +332,31 @@ public void testIterateAndOrderDefaultConnSettings() throws SQLException { ++cnt; } assertEquals(LIMIT_RECS, cnt); // all the records were retrieved - connection.close(); + assertTrue(connection.close()); + } + + /* + This tests interrupts the execution in between and checks if it has been interrupted successfully while using ReadAPI + */ + @Test + public void testConnectionClose() throws SQLException { + Connection connection = bigquery.createConnection(); + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { + ++cnt; + if (cnt == 50000) { // interrupt at 50K + assertTrue(connection.close()); + } + } + assertTrue( + LIMIT_RECS + > cnt); // we stopped at 50K but still we can expect additional records (typically ~100) + // to be retrieved + // as a number of records should have been already buffered. less than + // LIMIT_RECS should be retrieved } @Test From 51e7a39982886d135390f4bb2b973da9d3cabd38 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 18:14:14 +0000 Subject: [PATCH 0749/2268] chore(main): release 2.11.2 (#2051) :robot: I have created a release *beep* *boop* --- ### [2.11.2](https://github.com/googleapis/java-bigquery/compare/v2.11.1...v2.11.2) (2022-05-18) ### Bug Fixes * Flaky connenction close issue ([#2044](https://github.com/googleapis/java-bigquery/issues/2044)) ([9993717](https://github.com/googleapis/java-bigquery/commit/9993717d546c4039cb8c846787fdd131cc0c113f)) * NPE issue with testMultipleRuns ([#2050](https://github.com/googleapis/java-bigquery/issues/2050)) ([251d468](https://github.com/googleapis/java-bigquery/commit/251d4686d22e0000982bcd891de68491326558fe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 748304184f..28a298be54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [2.11.2](https://github.com/googleapis/java-bigquery/compare/v2.11.1...v2.11.2) (2022-05-18) + + +### Bug Fixes + +* Flaky connenction close issue ([#2044](https://github.com/googleapis/java-bigquery/issues/2044)) ([9993717](https://github.com/googleapis/java-bigquery/commit/9993717d546c4039cb8c846787fdd131cc0c113f)) +* NPE issue with testMultipleRuns ([#2050](https://github.com/googleapis/java-bigquery/issues/2050)) ([251d468](https://github.com/googleapis/java-bigquery/commit/251d4686d22e0000982bcd891de68491326558fe)) + ### [2.11.1](https://github.com/googleapis/java-bigquery/compare/v2.11.0...v2.11.1) (2022-05-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c1e3382e94..186d89a51e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.2-SNAPSHOT + 2.11.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e2707c1e78..049beb2249 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.2-SNAPSHOT + 2.11.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.2-SNAPSHOT + 2.11.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ebc31870ef..bae36ea406 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.2-SNAPSHOT + 2.11.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2-SNAPSHOT + 2.11.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 40c892c2bb..0c35979670 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2-SNAPSHOT + 2.11.2 diff --git a/versions.txt b/versions.txt index d0677dd3a6..503185ac76 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.1:2.11.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.11.2:2.11.2 \ No newline at end of file From b2099e6c110c339e6a83bcf4f71dea5976133ab9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 18 May 2022 18:28:14 +0000 Subject: [PATCH 0750/2268] chore(main): release 2.11.3-SNAPSHOT (#2052) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 186d89a51e..a1cc3c7dad 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.2 + 2.11.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 049beb2249..4a94c506cc 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.2 + 2.11.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.2 + 2.11.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bae36ea406..7b1f79ab13 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.2 + 2.11.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2 + 2.11.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0c35979670..4e89f7c63b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2 + 2.11.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 503185ac76..c7191337ab 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.2:2.11.2 \ No newline at end of file +google-cloud-bigquery:2.11.2:2.11.3-SNAPSHOT \ No newline at end of file From 065ae78ef20052032c245b3fe991808c24ec8077 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 21:08:18 +0000 Subject: [PATCH 0751/2268] feat: add build scripts for native image testing in Java 17 (#1440) (#2057) Source-Link: https://github.com/googleapis/synthtool/commit/505ce5a7edb58bf6d9d4de10b4bb4e81000ae324 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:2567a120ce90fadb6201999b87d649d9f67459de28815ad239bce9ebfaa18a74 --- .github/.OwlBot.lock.yaml | 4 +-- .kokoro/presubmit/graalvm-native-17.cfg | 33 +++++++++++++++++++++++++ README.md | 4 +-- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .kokoro/presubmit/graalvm-native-17.cfg diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f60d774937..a79f06271b 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:fc52b202aa298a50a12c64efd04fea3884d867947effe2fa85382a246c09e813 -# created: 2022-04-06T16:30:03.627422514Z + digest: sha256:2567a120ce90fadb6201999b87d649d9f67459de28815ad239bce9ebfaa18a74 +# created: 2022-05-19T15:12:45.278246753Z diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg new file mode 100644 index 0000000000..a3f7fb9d49 --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm17" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} \ No newline at end of file diff --git a/README.md b/README.md index ef43a359ad..8f8f9f0d90 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.11.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.11.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.2" ``` ## Authentication From 9667663fbec20f262c218f07cce1ada0c9a4bce0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 19 May 2022 23:32:14 +0200 Subject: [PATCH 0752/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.11.0 (#2055) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.10.0` -> `2.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.12.0/compatibility-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/2.12.0/confidence-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b1f79ab13..566d4be8a3 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220507-1.32.1 - 2.10.0 + 2.11.0 8.0.0 From d2d2ebe2547691737a48a8528361d6cc3df3eebd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 20 May 2022 21:58:21 +0200 Subject: [PATCH 0753/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.2 (#2054) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.11.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f8f9f0d90..0d2537d098 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.11.1 + 2.11.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 906f422e00..8e8b8d2b04 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.11.1 + 2.11.2 From 4571900559ec8689ac3a1bc3b418c879f66a51a5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 24 May 2022 16:52:02 +0200 Subject: [PATCH 0754/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.3.0 (#2062) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8e8b8d2b04..3f175eb16a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.4 + 2.3.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4e89f7c63b..120198737b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.4 + 2.3.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1e8dd6ef9e..6a579c306f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.2.4 + 2.3.0 test From 1c7a0ab157f79772d8da58bfe15f54a7394124e8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 24 May 2022 16:53:04 +0200 Subject: [PATCH 0755/2268] deps: update dependency com.google.cloud:google-cloud-bigtable to v2.7.0 (#2061) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3f175eb16a..55cedc6505 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.6.2 + 2.7.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 120198737b..70d2d2c53e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.6.2 + 2.7.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6a579c306f..821f95718c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.6.2 + 2.7.0 test From 3764b5967c694fa34aef75804333e5a6101d912e Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 24 May 2022 20:26:21 +0530 Subject: [PATCH 0756/2268] fix: Flaky testPositionalQueryParameters (#2059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String comparison of values, eg `1.40845209522E9` vs `1408452095.22` seems to be failing, so comparing the values as epoc (Long) instead Fixes #2056 ☕️ --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index dcfa5265f1..5b2b74ec0b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3438,7 +3438,12 @@ public void testPositionalQueryParameters() throws InterruptedException { assertEquals(QUERY_RESULT_SCHEMA_BIGNUMERIC, result.getSchema()); assertEquals(2, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { - assertEquals("1.40845209522E9", values.get(0).getValue()); + // https://github.com/googleapis/java-bigquery/issues/2056. String comparison of values, eg + // 1.40845209522E9 vs 1408452095.22 seems to be failing, so comparing the values as epoc + // (Long) instead + assertEquals( + (long) Double.parseDouble("1.40845209522E9"), + (long) Double.parseDouble(values.get(0).getValue().toString())); assertEquals("stringValue", values.get(1).getValue()); assertEquals(false, values.get(2).getBooleanValue()); assertEquals("0.33333333333333333333333333333333333333", values.get(3).getValue()); From 6d3f4bead2315703015bd75711fcbf19428fad6e Mon Sep 17 00:00:00 2001 From: Blake Li Date: Tue, 24 May 2022 16:02:11 +0000 Subject: [PATCH 0757/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 (#2063) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 566d4be8a3..a8d4344080 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220507-1.32.1 - 2.11.0 + 2.12.0 8.0.0 From fd47710afdf32fd535f8e2b430156eb4a659a64d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 24 May 2022 23:27:11 +0200 Subject: [PATCH 0758/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.7.0 (#2064) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8d4344080..a9ba290e04 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.6.1 + 2.7.0 test From c4bafeb29f50588b27bc5a86fe53b3938e0cf164 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 17:09:28 +0200 Subject: [PATCH 0759/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.14.0 (#2067) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a9ba290e04..15fe5b9fed 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.13.0 + 2.14.0 pom import From 89962a5e3cec0e5a4334454b1bff83fba3d95d4d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 17:09:45 +0200 Subject: [PATCH 0760/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.7.1 (#2066) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 15fe5b9fed..c342813118 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.7.0 + 2.7.1 test From 7f0bfd4a42c28f3d2a748474e1ec40740311a734 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 25 May 2022 11:15:32 -0400 Subject: [PATCH 0761/2268] fix: add more native image configurations for Arrow tests and enable native image tests (#2053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add more native image configurations for Arrow tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add more necessary configurations * enable native image tests * empty commit * remove exclusion * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * exclude arrow tests in java 17 * restore nightly-it * restore formatting * more formatting changes * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * include tests for exclusion * restore script changes * bring back nightly-it * include IT* and *ClientTest filter from shared-config Co-authored-by: Owl Bot --- .kokoro/build.sh | 15 +++-- .../google-cloud-bigquery/reflect-config.json | 59 +++++++++++++++++++ owlbot.py | 2 +- 3 files changed, 70 insertions(+), 6 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 3c45ad23a2..089ca0e23e 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -80,11 +80,16 @@ nightly-it) verify RETURN_CODE=$? ;; -#graalvm) -# # Run Unit and Integration Tests with Native Image -# mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test -# RETURN_CODE=$? -# ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +graalvm17) + # Run Unit and Integration Tests with Native Image. Skip Arrow tests until https://github.com/googleapis/java-bigquery/issues/2060 is fixed. + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test "-Dtest=!com.google.cloud.bigquery.it.ITBigQueryTest#testBQResultSetPaginationSlowQuery+testReadAPIConnectionMultiClose+testReadAPIIterationAndOrder, !com.google.cloud.bigquery.it.ITNightlyBigQueryTest#testIterateAndOrder+testMultipleRuns+testIterateAndOrderDefaultConnSettings, IT*, *ClientTest" + RETURN_CODE=$? + ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json index f2190122d7..8f6d928da4 100644 --- a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json @@ -3,8 +3,67 @@ "name":"io.netty.buffer.AbstractByteBufAllocator", "queryAllDeclaredMethods":true }, + { + "name":"io.netty.buffer.PooledByteBufAllocator", + "fields":[{"name":"directArenas"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscChunkedArrayQueue", + "queryAllDeclaredMethods":true, + "allDeclaredFields":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField", + "fields":[{"name":"consumerIndex"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField", + "fields":[{"name":"producerIndex"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField", + "fields":[{"name":"producerLimit"}] + }, + { + "name":"java.nio.DirectByteBuffer", + "methods":[{"name":"","parameterTypes":["long","int"] }] + }, { "name":"org.apache.arrow.memory.DefaultAllocationManagerFactory", "fields":[{"name":"FACTORY"}] + }, + { + "name":"org.apache.arrow.vector.types.pojo.ArrowType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.vector.types.pojo.ArrowType$Int", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.vector.types.pojo.ArrowType$PrimitiveType", + "allDeclaredFields":true, + "queryAllDeclaredMethods":true + }, + { + "name":"io.netty.buffer.AbstractReferenceCountedByteBuf", + "fields":[{"name":"refCnt"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields", + "fields":[{"name":"producerLimit"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields", + "fields":[{"name":"consumerIndex"}] + }, + { + "name":"io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields", + "fields":[{"name":"producerIndex"}] } ] \ No newline at end of file diff --git a/owlbot.py b/owlbot.py index 55f7f4101e..54ebff8614 100644 --- a/owlbot.py +++ b/owlbot.py @@ -22,5 +22,5 @@ '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', - '.kokoro/build.sh', + '.kokoro/build.sh' ]) \ No newline at end of file From 5d5d4bb0f5232bc5d65a03591f2e02f1b52802e4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 16:14:13 +0000 Subject: [PATCH 0762/2268] chore(main): release 2.12.0 (#2058) :robot: I have created a release *beep* *boop* --- ## [2.12.0](https://github.com/googleapis/java-bigquery/compare/v2.11.2...v2.12.0) (2022-05-25) ### Features * add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-bigquery/issues/1440)) ([#2057](https://github.com/googleapis/java-bigquery/issues/2057)) ([065ae78](https://github.com/googleapis/java-bigquery/commit/065ae78ef20052032c245b3fe991808c24ec8077)) ### Bug Fixes * add more native image configurations for Arrow tests and enable native image tests ([#2053](https://github.com/googleapis/java-bigquery/issues/2053)) ([7f0bfd4](https://github.com/googleapis/java-bigquery/commit/7f0bfd4a42c28f3d2a748474e1ec40740311a734)) * Flaky testPositionalQueryParameters ([#2059](https://github.com/googleapis/java-bigquery/issues/2059)) ([3764b59](https://github.com/googleapis/java-bigquery/commit/3764b5967c694fa34aef75804333e5a6101d912e)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigtable to v2.7.0 ([#2061](https://github.com/googleapis/java-bigquery/issues/2061)) ([1c7a0ab](https://github.com/googleapis/java-bigquery/commit/1c7a0ab157f79772d8da58bfe15f54a7394124e8)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.11.0 ([#2055](https://github.com/googleapis/java-bigquery/issues/2055)) ([9667663](https://github.com/googleapis/java-bigquery/commit/9667663fbec20f262c218f07cce1ada0c9a4bce0)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#2063](https://github.com/googleapis/java-bigquery/issues/2063)) ([6d3f4be](https://github.com/googleapis/java-bigquery/commit/6d3f4bead2315703015bd75711fcbf19428fad6e)) * update dependency com.google.cloud:google-cloud-storage to v2.7.0 ([#2064](https://github.com/googleapis/java-bigquery/issues/2064)) ([fd47710](https://github.com/googleapis/java-bigquery/commit/fd47710afdf32fd535f8e2b430156eb4a659a64d)) * update dependency com.google.cloud:google-cloud-storage to v2.7.1 ([#2066](https://github.com/googleapis/java-bigquery/issues/2066)) ([89962a5](https://github.com/googleapis/java-bigquery/commit/89962a5e3cec0e5a4334454b1bff83fba3d95d4d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 22 ++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28a298be54..56c529d656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.12.0](https://github.com/googleapis/java-bigquery/compare/v2.11.2...v2.12.0) (2022-05-25) + + +### Features + +* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-bigquery/issues/1440)) ([#2057](https://github.com/googleapis/java-bigquery/issues/2057)) ([065ae78](https://github.com/googleapis/java-bigquery/commit/065ae78ef20052032c245b3fe991808c24ec8077)) + + +### Bug Fixes + +* add more native image configurations for Arrow tests and enable native image tests ([#2053](https://github.com/googleapis/java-bigquery/issues/2053)) ([7f0bfd4](https://github.com/googleapis/java-bigquery/commit/7f0bfd4a42c28f3d2a748474e1ec40740311a734)) +* Flaky testPositionalQueryParameters ([#2059](https://github.com/googleapis/java-bigquery/issues/2059)) ([3764b59](https://github.com/googleapis/java-bigquery/commit/3764b5967c694fa34aef75804333e5a6101d912e)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-bigtable to v2.7.0 ([#2061](https://github.com/googleapis/java-bigquery/issues/2061)) ([1c7a0ab](https://github.com/googleapis/java-bigquery/commit/1c7a0ab157f79772d8da58bfe15f54a7394124e8)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.11.0 ([#2055](https://github.com/googleapis/java-bigquery/issues/2055)) ([9667663](https://github.com/googleapis/java-bigquery/commit/9667663fbec20f262c218f07cce1ada0c9a4bce0)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#2063](https://github.com/googleapis/java-bigquery/issues/2063)) ([6d3f4be](https://github.com/googleapis/java-bigquery/commit/6d3f4bead2315703015bd75711fcbf19428fad6e)) +* update dependency com.google.cloud:google-cloud-storage to v2.7.0 ([#2064](https://github.com/googleapis/java-bigquery/issues/2064)) ([fd47710](https://github.com/googleapis/java-bigquery/commit/fd47710afdf32fd535f8e2b430156eb4a659a64d)) +* update dependency com.google.cloud:google-cloud-storage to v2.7.1 ([#2066](https://github.com/googleapis/java-bigquery/issues/2066)) ([89962a5](https://github.com/googleapis/java-bigquery/commit/89962a5e3cec0e5a4334454b1bff83fba3d95d4d)) + ### [2.11.2](https://github.com/googleapis/java-bigquery/compare/v2.11.1...v2.11.2) (2022-05-18) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a1cc3c7dad..b0d1afe972 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.11.3-SNAPSHOT + 2.12.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4a94c506cc..1736ade47c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.11.3-SNAPSHOT + 2.12.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.11.3-SNAPSHOT + 2.12.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c342813118..05a6ce4737 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.11.3-SNAPSHOT + 2.12.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.11.3-SNAPSHOT + 2.12.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 70d2d2c53e..a6c2f43982 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.11.3-SNAPSHOT + 2.12.0 diff --git a/versions.txt b/versions.txt index c7191337ab..026fbb39e5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.11.2:2.11.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.12.0:2.12.0 \ No newline at end of file From e3e6514bea627b15263043ec3d6f2ca17f1b9860 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 18:23:47 +0200 Subject: [PATCH 0763/2268] test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.0 (#2065) * test(deps): update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.0 * Update pom.xml Co-authored-by: Stephanie Wang --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 05a6ce4737..a246059833 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.6.1 + 1.8.0 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.7.3 + 1.8.0 pom import @@ -293,3 +293,4 @@ + From 9d6b27e5614dd8e3b76bee2da04a1aff87d37ed3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 May 2022 16:28:11 +0000 Subject: [PATCH 0764/2268] chore(main): release 2.12.1-SNAPSHOT (#2068) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b0d1afe972..656ff66fba 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1736ade47c..2d9981c2f4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.12.0 + 2.12.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a246059833..28628a5e77 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.12.0 + 2.12.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a6c2f43982..680e99d810 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.12.0 + 2.12.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 026fbb39e5..d251b42db1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.12.0:2.12.0 \ No newline at end of file +google-cloud-bigquery:2.12.0:2.12.1-SNAPSHOT \ No newline at end of file From d3d09a4e1c5f864c78c1db920e637b2b8c50cfaf Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Wed, 25 May 2022 14:08:14 -0400 Subject: [PATCH 0765/2268] chore: manage dependency updates from renovate-bot (#2069) to address issues like: image which occurs since shared-dependencies updates take different amount of time to roll out in various cloud clients. [Full trace](https://github.com/googleapis/java-bigquery/runs/6578164174?check_suite_focus=true) In this PR, we group the GCP Java client dependencies together so that their updates will be proposed in one single PR when they get updated: ``` "^com.google.cloud:google-cloud-datacatalog", "^com.google.cloud:google-cloud-bigquerystorage-bom", "^com.google.cloud:google-cloud-storage" ``` In addition, we classify `^com.google.cloud:google-cloud-bigtable` as a `chore` dependency update since it is only used in samples and it should not result in a client library version bump. --- README.md | 4 ++-- renovate.json | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0d2537d098..7d474f6c31 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.11.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.12.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.11.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.12.0" ``` ## Authentication diff --git a/renovate.json b/renovate.json index 2b19d40fdf..cd5ba27931 100644 --- a/renovate.json +++ b/renovate.json @@ -39,6 +39,7 @@ { "packagePatterns": [ "^com.google.cloud:google-cloud-bigquery", + "^com.google.cloud:google-cloud-bigtable", "^com.google.cloud:libraries-bom", "^com.google.cloud.samples:shared-configuration" ], @@ -70,10 +71,11 @@ { "packagePatterns": [ "^com.google.api.grpc:proto-google-cloud-datacatalog", - "^com.google.cloud:google-cloud-datacatalog" + "^com.google.cloud:google-cloud-datacatalog", + "^com.google.cloud:google-cloud-bigquerystorage-bom", + "^com.google.cloud:google-cloud-storage" ], - "groupName": "datacatalog dependencies", - "semanticCommitType": "test", + "groupName": "cloud client dependencies", "semanticCommitScope": "deps" } ], From 621d357cc0ed195584f5b49f6f61032d007b2b6f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 25 May 2022 22:12:51 +0200 Subject: [PATCH 0766/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.12.0 (#2071) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.12.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d474f6c31..39d86d4d98 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.11.2 + 2.12.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 55cedc6505..3f4a19322f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.11.2 + 2.12.0 From 4e153f525cc600cecdfabec600b166560ba62607 Mon Sep 17 00:00:00 2001 From: Ayush Walekar Date: Thu, 26 May 2022 20:16:12 +0530 Subject: [PATCH 0767/2268] docs(samples): update querypagination sample (#2074) - Updated example to loop through all remaining pages Changes for the open issue: https://github.com/googleapis/java-bigquery/issues/2073 --- .../java/com/example/bigquery/QueryPagination.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java index dc9a6a24f1..86915bab77 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java @@ -62,19 +62,11 @@ public static void queryPagination(String datasetName, String tableName, String .getValues() .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); - if (results.hasNextPage()) { - // Next Page - results - .getNextPage() - .getValues() - .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); - } - - if (results.hasNextPage()) { + while (results.hasNextPage()) { // Remaining Pages + results = results.getNextPage(); results - .getNextPage() - .iterateAll() + .getValues() .forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString()))); } From 51694d8e07f19a5203f613888a4dd1f907ddb382 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Thu, 26 May 2022 21:01:34 +0530 Subject: [PATCH 0768/2268] chore: NPE in testConnectionClose (#2072) * Added a not null assertion for connection in testConnectionClose * Added testCreateDefaultConnection --- .../com/google/cloud/bigquery/it/ITBigQueryTest.java | 9 +++++++++ .../google/cloud/bigquery/it/ITNightlyBigQueryTest.java | 1 + 2 files changed, 10 insertions(+) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 5b2b74ec0b..3ca11c0c6a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2724,6 +2724,15 @@ public void testReadAPIIterationAndOrder() connection.close(); } + // Ref: https://github.com/googleapis/java-bigquery/issues/2070. Adding a pre-submit test to see + // if bigquery.createConnection() returns null + @Test + public void testCreateDefaultConnection() throws BigQuerySQLException { + Connection connection = bigquery.createConnection(); + assertNotNull("bigquery.createConnection() returned null", connection); + assertTrue(connection.close()); + } + @Test public void testReadAPIConnectionMultiClose() throws diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index deabba59f8..73bd21a30d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -341,6 +341,7 @@ public void testIterateAndOrderDefaultConnSettings() throws SQLException { @Test public void testConnectionClose() throws SQLException { Connection connection = bigquery.createConnection(); + assertNotNull("bigquery.createConnection() returned null", connection); BigQueryResult bigQueryResult = connection.executeSelect(QUERY); logger.log(Level.INFO, "Query used: {0}", QUERY); ResultSet rs = bigQueryResult.getResultSet(); From 38d6baefeebe0dc2858d38f6c44ad727b6beba92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 26 May 2022 22:10:17 +0200 Subject: [PATCH 0769/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 (#2076) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) | `1.8.0` -> `1.8.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/compatibility-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.8.1/confidence-slim/1.8.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-datacatalog ### [`v1.8.1`](https://togithub.com/googleapis/java-datacatalog/blob/HEAD/CHANGELOG.md#​181-httpsgithubcomgoogleapisjava-datacatalogcomparev180v181-2022-05-26) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.8.0...v1.8.1)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 4 ++-- renovate.json | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 28628a5e77..43f7961143 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.0 + 1.8.1 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.0 + 1.8.1 pom import diff --git a/renovate.json b/renovate.json index cd5ba27931..56fe3f2abf 100644 --- a/renovate.json +++ b/renovate.json @@ -75,8 +75,7 @@ "^com.google.cloud:google-cloud-bigquerystorage-bom", "^com.google.cloud:google-cloud-storage" ], - "groupName": "cloud client dependencies", - "semanticCommitScope": "deps" + "groupName": "cloud client dependencies" } ], "semanticCommits": true, From eb443dfd5fd26e9c424dcbb1b00af5260a525679 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 27 May 2022 17:42:23 +0200 Subject: [PATCH 0770/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.7.2 (#2077) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.7.1` -> `2.7.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/compatibility-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.7.2/confidence-slim/2.7.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.7.2`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​272-httpsgithubcomgoogleapisjava-storagecomparev271v272-2022-05-27) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.7.1...v2.7.2)
    --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43f7961143..640b33aa1a 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.7.1 + 2.7.2 test From c6cb5643352aebf892d0f70e0b7d91e46703c759 Mon Sep 17 00:00:00 2001 From: Stephanie Wang Date: Tue, 31 May 2022 11:42:07 -0400 Subject: [PATCH 0771/2268] Revert "deps: update dependency org.assertj:assertj-core to v3 (#1786)" (#2081) This reverts commit 69fcabf478c6fab23c4da3fcc516f820cc178a5b. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 640b33aa1a..eb2a82663d 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.assertj assertj-core - 3.22.0 + 2.9.1 test From 7ec5c041ba405d89cb2c935faa513040dff7c673 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 May 2022 18:30:12 +0200 Subject: [PATCH 0772/2268] test(deps): update dependency org.mockito:mockito-core to v4.6.0 (#2078) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb2a82663d..11de361a70 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.5.1 + 4.6.0 test From 7f0901467037240499996a817be0b84d11b18c86 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 May 2022 20:09:19 +0200 Subject: [PATCH 0773/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.8.0 (#2082) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3f4a19322f..2f65088465 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 680e99d810..de3522f6bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 821f95718c..cda5626510 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.7.0 + 2.8.0 test From 9e0b35136aed6ed489bff4d4ac86c4d5d83274be Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 31 May 2022 23:39:56 +0530 Subject: [PATCH 0774/2268] feat: add destinationExpirationTime to CopyJobConfiguration (#2031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add destinationExpirationTime * Added testDestExpTimeTableCopyJob IT * Added testDestExpTimeTableCopyJob IT * Removed testDestExpTimeTableCopyJob IT. Modified testCopyJobWithLabelsAndExpTime to add destinationExpiryTime * Modified Builder to add destinationExpiryTime * Modified testCopyJobWithLabelsAndExpTime. Added assertion for destinationExpiryTime * 🦉 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 --- .../cloud/bigquery/CopyJobConfiguration.java | 28 +++++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 10 +++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index 0b11bf7bea..fe67986fc6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -39,6 +39,7 @@ public final class CopyJobConfiguration extends JobConfiguration { private final List sourceTables; private final TableId destinationTable; private final String operationType; + private final String destinationExpirationTime; private final JobInfo.CreateDisposition createDisposition; private final JobInfo.WriteDisposition writeDisposition; private final EncryptionConfiguration destinationEncryptionConfiguration; @@ -51,6 +52,7 @@ public static final class Builder private List sourceTables; private TableId destinationTable; private String operationType; + private String destinationExpirationTime; private JobInfo.CreateDisposition createDisposition; private JobInfo.WriteDisposition writeDisposition; private EncryptionConfiguration destinationEncryptionConfiguration; @@ -66,6 +68,7 @@ private Builder(CopyJobConfiguration jobConfiguration) { this.sourceTables = jobConfiguration.sourceTables; this.destinationTable = jobConfiguration.destinationTable; this.operationType = jobConfiguration.operationType; + this.destinationExpirationTime = jobConfiguration.destinationExpirationTime; this.createDisposition = jobConfiguration.createDisposition; this.writeDisposition = jobConfiguration.writeDisposition; this.destinationEncryptionConfiguration = jobConfiguration.destinationEncryptionConfiguration; @@ -80,6 +83,10 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (copyConfigurationPb.getOperationType() != null) { this.operationType = copyConfigurationPb.getOperationType(); } + if (copyConfigurationPb.getDestinationExpirationTime() != null) { + this.destinationExpirationTime = + copyConfigurationPb.getDestinationExpirationTime().toString(); + } if (copyConfigurationPb.getSourceTables() != null) { this.sourceTables = Lists.transform(copyConfigurationPb.getSourceTables(), TableId.FROM_PB_FUNCTION); @@ -129,6 +136,16 @@ public Builder setOperationType(String operationType) { return this; } + /** + * Sets the time when the destination table expires. Expired tables will be deleted and their + * storage reclaimed. More info: + * https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfigurationtablecopy + */ + public Builder setDestinationExpirationTime(String destinationExpirationTime) { + this.destinationExpirationTime = destinationExpirationTime; + return this; + } + public Builder setDestinationEncryptionConfiguration( EncryptionConfiguration encryptionConfiguration) { this.destinationEncryptionConfiguration = encryptionConfiguration; @@ -194,6 +211,7 @@ private CopyJobConfiguration(Builder builder) { this.sourceTables = checkNotNull(builder.sourceTables); this.destinationTable = checkNotNull(builder.destinationTable); this.operationType = builder.operationType; + this.destinationExpirationTime = builder.destinationExpirationTime; this.createDisposition = builder.createDisposition; this.writeDisposition = builder.writeDisposition; this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration; @@ -216,6 +234,11 @@ public String getOperationType() { return operationType; } + /** Returns the time when the destination table expires */ + public String getDestinationExpirationTime() { + return destinationExpirationTime; + } + public EncryptionConfiguration getDestinationEncryptionConfiguration() { return destinationEncryptionConfiguration; } @@ -263,6 +286,7 @@ ToStringHelper toStringHelper() { .add("sourceTables", sourceTables) .add("destinationTable", destinationTable) .add("operationType", operationType) + .add("destinationExpirationTime", destinationExpirationTime) .add("destinationEncryptionConfiguration", destinationEncryptionConfiguration) .add("createDisposition", createDisposition) .add("writeDisposition", writeDisposition) @@ -283,6 +307,7 @@ public int hashCode() { sourceTables, destinationTable, operationType, + destinationExpirationTime, createDisposition, writeDisposition, labels, @@ -322,6 +347,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (operationType != null) { configurationPb.setOperationType(operationType); } + if (destinationExpirationTime != null) { + configurationPb.setDestinationExpirationTime(destinationExpirationTime); + } if (createDisposition != null) { configurationPb.setCreateDisposition(createDisposition.toString()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 3ca11c0c6a..812833d9cb 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3893,7 +3893,8 @@ public void testSnapshotTableCopyJob() throws InterruptedException { } @Test - public void testCopyJobWithLabels() throws InterruptedException { + public void testCopyJobWithLabelsAndExpTime() throws InterruptedException { + String destExpiryTime = "2025-12-31T23:59:59.999999999Z"; String sourceTableName = "test_copy_job_source_table_label"; String destinationTableName = "test_copy_job_destination_table_label"; Map labels = ImmutableMap.of("test_job_name", "test_copy_job"); @@ -3904,12 +3905,17 @@ public void testCopyJobWithLabels() throws InterruptedException { assertNotNull(createdTable); TableId destinationTable = TableId.of(DATASET, destinationTableName); CopyJobConfiguration configuration = - CopyJobConfiguration.newBuilder(destinationTable, sourceTable).setLabels(labels).build(); + CopyJobConfiguration.newBuilder(destinationTable, sourceTable) + .setLabels(labels) + .setDestinationExpirationTime(destExpiryTime) + .build(); Job remoteJob = bigquery.create(JobInfo.of(configuration)); remoteJob = remoteJob.waitFor(); assertNull(remoteJob.getStatus().getError()); CopyJobConfiguration copyJobConfiguration = remoteJob.getConfiguration(); assertEquals(labels, copyJobConfiguration.getLabels()); + assertNotNull(copyJobConfiguration.getDestinationExpirationTime()); + assertEquals(destExpiryTime, copyJobConfiguration.getDestinationExpirationTime()); Table remoteTable = bigquery.getTable(DATASET, destinationTableName); assertNotNull(remoteTable); assertTrue(createdTable.delete()); From 729e69e51385f2e6604c0c226f8b1839511642c9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 18:46:11 +0000 Subject: [PATCH 0775/2268] chore(main): release 2.13.0 (#2075) :robot: I have created a release *beep* *boop* --- ## [2.13.0](https://github.com/googleapis/java-bigquery/compare/v2.12.0...v2.13.0) (2022-05-31) ### Features * add destinationExpirationTime to CopyJobConfiguration ([#2031](https://github.com/googleapis/java-bigquery/issues/2031)) ([9e0b351](https://github.com/googleapis/java-bigquery/commit/9e0b35136aed6ed489bff4d4ac86c4d5d83274be)) ### Documentation * **samples:** update querypagination sample ([#2074](https://github.com/googleapis/java-bigquery/issues/2074)) ([4e153f5](https://github.com/googleapis/java-bigquery/commit/4e153f525cc600cecdfabec600b166560ba62607)) ### Dependencies * update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 ([#2076](https://github.com/googleapis/java-bigquery/issues/2076)) ([38d6bae](https://github.com/googleapis/java-bigquery/commit/38d6baefeebe0dc2858d38f6c44ad727b6beba92)) * update dependency com.google.cloud:google-cloud-storage to v2.7.2 ([#2077](https://github.com/googleapis/java-bigquery/issues/2077)) ([eb443df](https://github.com/googleapis/java-bigquery/commit/eb443dfd5fd26e9c424dcbb1b00af5260a525679)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c529d656..849a6b1196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.13.0](https://github.com/googleapis/java-bigquery/compare/v2.12.0...v2.13.0) (2022-05-31) + + +### Features + +* add destinationExpirationTime to CopyJobConfiguration ([#2031](https://github.com/googleapis/java-bigquery/issues/2031)) ([9e0b351](https://github.com/googleapis/java-bigquery/commit/9e0b35136aed6ed489bff4d4ac86c4d5d83274be)) + + +### Documentation + +* **samples:** update querypagination sample ([#2074](https://github.com/googleapis/java-bigquery/issues/2074)) ([4e153f5](https://github.com/googleapis/java-bigquery/commit/4e153f525cc600cecdfabec600b166560ba62607)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.1 ([#2076](https://github.com/googleapis/java-bigquery/issues/2076)) ([38d6bae](https://github.com/googleapis/java-bigquery/commit/38d6baefeebe0dc2858d38f6c44ad727b6beba92)) +* update dependency com.google.cloud:google-cloud-storage to v2.7.2 ([#2077](https://github.com/googleapis/java-bigquery/issues/2077)) ([eb443df](https://github.com/googleapis/java-bigquery/commit/eb443dfd5fd26e9c424dcbb1b00af5260a525679)) + ## [2.12.0](https://github.com/googleapis/java-bigquery/compare/v2.11.2...v2.12.0) (2022-05-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 656ff66fba..93a03ee188 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2d9981c2f4..ac898f783b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.12.1-SNAPSHOT + 2.13.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 11de361a70..7a1b27941f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.12.1-SNAPSHOT + 2.13.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index de3522f6bc..6b9ccabbb5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.12.1-SNAPSHOT + 2.13.0 diff --git a/versions.txt b/versions.txt index d251b42db1..fca5ef2183 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.12.0:2.12.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.0:2.13.0 \ No newline at end of file From 708b1d02236900124fb1bae88a908743596898d9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 19:00:57 +0000 Subject: [PATCH 0776/2268] chore(main): release 2.13.1-SNAPSHOT (#2084) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 93a03ee188..cc6e29fc97 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.0 + 2.13.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ac898f783b..bbfa00fe17 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.0 + 2.13.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.0 + 2.13.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7a1b27941f..1893be1cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.0 + 2.13.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.0 + 2.13.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6b9ccabbb5..c34108c9a2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.0 + 2.13.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index fca5ef2183..0b63a4fd4e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.0:2.13.0 \ No newline at end of file +google-cloud-bigquery:2.13.0:2.13.1-SNAPSHOT \ No newline at end of file From f3c0aaefd8f87a08035b6b171d11671224c22612 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Jun 2022 16:47:50 +0200 Subject: [PATCH 0777/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.0 (#2085) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.0 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 39d86d4d98..662bcfc6f8 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.12.0 + 2.13.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.12.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.12.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2f65088465..f67b205425 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.12.0 + 2.13.0 From e0b164722ace24b309ceb402eda9578af43e8d22 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:32:11 +0530 Subject: [PATCH 0778/2268] chore: Added benchmarking logic for bigquery.query (#2087) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added benchmarking logic for bigquery.query Fixes #2086 ☕️ --- .../ConnImplBenchmark.java | 93 ++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java index 40c5fc11d4..f202df6669 100644 --- a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java +++ b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java @@ -44,7 +44,7 @@ @State(Scope.Benchmark) @OutputTimeUnit(TimeUnit.MILLISECONDS) public class ConnImplBenchmark { - @Param({"500000", "1000000", "10000000", "100000000"}) // 500K, 1M, 10M, and 100M + @Param({"500000", "1000000", "10000000", "50000000", "100000000"}) // 500K, 1M, 10M, 50M and 100M public int rowLimit; private ConnectionSettings connectionSettingsReadAPIEnabled, connectionSettingsReadAPIDisabled; @@ -71,6 +71,97 @@ public void setUp() throws IOException { .build(); } + @Benchmark + // uses bigquery.query + public void iterateRecordsWithBigQuery_Query(Blackhole blackhole) throws InterruptedException { + String selectQuery = String.format(QUERY, rowLimit); + BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService(); + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(selectQuery).setUseLegacySql(false).build(); + TableResult result = bigQuery.query(config); + long hash = 0L; + int cnt = 0; + System.out.print("\n Running"); + // iterate al the records and compute the hash + for (FieldValueList row : result.iterateAll()) { + hash += + row.get("vendor_id").getStringValue() == null + ? 0 + : row.get("vendor_id").getStringValue().hashCode(); + hash += + row.get("pickup_datetime").getStringValue() == null + ? 0 + : row.get("pickup_datetime").getStringValue().hashCode(); + hash += + row.get("dropoff_datetime").getStringValue() == null + ? 0 + : row.get("dropoff_datetime").getStringValue().hashCode(); + hash += + row.get("passenger_count").getValue() == null + ? 0 + : row.get("passenger_count").getLongValue(); + hash += + row.get("trip_distance").getValue() == null + ? 0 + : row.get("trip_distance").getDoubleValue(); + hash += + row.get("pickup_longitude").getValue() == null + ? 0 + : row.get("pickup_longitude").getDoubleValue(); + hash += + row.get("pickup_latitude").getValue() == null + ? 0 + : row.get("pickup_latitude").getDoubleValue(); + hash += + row.get("rate_code").getStringValue() == null + ? 0 + : row.get("rate_code").getStringValue().hashCode(); + hash += + row.get("store_and_fwd_flag").getStringValue() == null + ? 0 + : row.get("store_and_fwd_flag").getStringValue().hashCode(); + hash += + row.get("payment_type").getStringValue() == null + ? 0 + : row.get("payment_type").getStringValue().hashCode(); + hash += + row.get("pickup_location_id").getStringValue() == null + ? 0 + : row.get("pickup_location_id").getStringValue().hashCode(); + hash += + row.get("dropoff_location_id").getStringValue() == null + ? 0 + : row.get("dropoff_location_id").getStringValue().hashCode(); + hash += + row.get("dropoff_longitude").getValue() == null + ? 0 + : row.get("dropoff_longitude").getDoubleValue(); + hash += + row.get("dropoff_latitude").getValue() == null + ? 0 + : row.get("dropoff_latitude").getDoubleValue(); + hash += + row.get("fare_amount").getValue() == null ? 0 : row.get("fare_amount").getDoubleValue(); + hash += row.get("extra").getValue() == null ? 0 : row.get("extra").getDoubleValue(); + hash += row.get("mta_tax").getValue() == null ? 0 : row.get("mta_tax").getDoubleValue(); + hash += row.get("tip_amount").getValue() == null ? 0 : row.get("tip_amount").getDoubleValue(); + hash += + row.get("tolls_amount").getValue() == null ? 0 : row.get("tolls_amount").getDoubleValue(); + hash += + row.get("imp_surcharge").getValue() == null + ? 0 + : row.get("imp_surcharge").getDoubleValue(); + hash += + row.get("total_amount").getValue() == null ? 0 : row.get("total_amount").getDoubleValue(); + + if (++cnt % 100000 == 0) { // just to indicate the progress while long running benchmarks + System.out.print("."); + } + } + System.out.println(cnt + " records processed using bigquery.query"); + blackhole.consume(hash); + } + @Benchmark public void iterateRecordsUsingReadAPI(Blackhole blackhole) throws InterruptedException, BigQuerySQLException { From ed33496950bb25bb754a7bb71c74d73d99d25209 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Jun 2022 17:08:13 +0200 Subject: [PATCH 0779/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.34.0 (#2088) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f67b205425..23b9d15c1a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.3 + 1.34.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c34108c9a2..7cec28c50b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.3 + 1.34.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cda5626510..c15cb2fc56 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.33.3 + 1.34.0 com.google.oauth-client From 117d3907fcecaf923d200021ff66503a67dec2a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Jun 2022 17:08:30 +0200 Subject: [PATCH 0780/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.34.0 (#2089) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 23b9d15c1a..af511915ee 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.3 + 1.34.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7cec28c50b..983a120eb3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.3 + 1.34.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c15cb2fc56..3582da167e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.33.3 + 1.34.0 From fdad5ceb16dd5fe4a381690e70b1a1e2ddeee9fe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Jun 2022 15:24:21 +0000 Subject: [PATCH 0781/2268] chore(main): release 2.13.1 (#2090) :robot: I have created a release *beep* *boop* --- ## [2.13.1](https://github.com/googleapis/java-bigquery/compare/v2.13.0...v2.13.1) (2022-06-02) ### Dependencies * update dependency com.google.oauth-client:google-oauth-client-java6 to v1.34.0 ([#2088](https://github.com/googleapis/java-bigquery/issues/2088)) ([ed33496](https://github.com/googleapis/java-bigquery/commit/ed33496950bb25bb754a7bb71c74d73d99d25209)) * update dependency com.google.oauth-client:google-oauth-client-jetty to v1.34.0 ([#2089](https://github.com/googleapis/java-bigquery/issues/2089)) ([117d390](https://github.com/googleapis/java-bigquery/commit/117d3907fcecaf923d200021ff66503a67dec2a1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 849a6b1196..4ccbce137e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.13.1](https://github.com/googleapis/java-bigquery/compare/v2.13.0...v2.13.1) (2022-06-02) + + +### Dependencies + +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.34.0 ([#2088](https://github.com/googleapis/java-bigquery/issues/2088)) ([ed33496](https://github.com/googleapis/java-bigquery/commit/ed33496950bb25bb754a7bb71c74d73d99d25209)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.34.0 ([#2089](https://github.com/googleapis/java-bigquery/issues/2089)) ([117d390](https://github.com/googleapis/java-bigquery/commit/117d3907fcecaf923d200021ff66503a67dec2a1)) + ## [2.13.0](https://github.com/googleapis/java-bigquery/compare/v2.12.0...v2.13.0) (2022-05-31) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cc6e29fc97..5ce32e6582 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.1-SNAPSHOT + 2.13.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bbfa00fe17..3a9fb29f9e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.1-SNAPSHOT + 2.13.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.1-SNAPSHOT + 2.13.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1893be1cf3..16648aa517 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.1-SNAPSHOT + 2.13.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.1-SNAPSHOT + 2.13.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 983a120eb3..700d156686 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.1-SNAPSHOT + 2.13.1 diff --git a/versions.txt b/versions.txt index 0b63a4fd4e..98b9c785df 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.0:2.13.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.1:2.13.1 \ No newline at end of file From 668f9db4e9ff937e44884217e8f21f41c43428d3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Jun 2022 15:38:15 +0000 Subject: [PATCH 0782/2268] chore(main): release 2.13.2-SNAPSHOT (#2091) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5ce32e6582..8f73e732fd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.1 + 2.13.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3a9fb29f9e..424365a091 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.1 + 2.13.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.1 + 2.13.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 16648aa517..0f7cbdf7ae 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.1 + 2.13.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.1 + 2.13.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 700d156686..fed346210d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.1 + 2.13.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 98b9c785df..b9082b803f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.1:2.13.1 \ No newline at end of file +google-cloud-bigquery:2.13.1:2.13.2-SNAPSHOT \ No newline at end of file From 66b978a582c8b060ce3fd974d68d6dbd25550883 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Jun 2022 21:53:54 +0200 Subject: [PATCH 0783/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.1 (#2092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 662bcfc6f8..cb6e61b338 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.13.0 + 2.13.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index af511915ee..63409b7f13 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.13.0 + 2.13.1 From e877d4a5a685debf836769655e97813fa9524894 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Jun 2022 21:54:07 +0200 Subject: [PATCH 0784/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.14.1 (#2093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.14.1 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f7cbdf7ae..a4e0cf6c7e 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.14.0 + 2.14.1 pom import From 1f2266f0ff0364689ea52dd1eb5de9bd44a632ac Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 2 Jun 2022 23:11:31 +0200 Subject: [PATCH 0785/2268] test(deps): update dependency org.mockito:mockito-core to v4.6.1 (#2094) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4e0cf6c7e..90b3debace 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.6.0 + 4.6.1 test From 6d866251fd0bdc1c1f68e92bffee53b2db27496a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 3 Jun 2022 16:39:49 +0200 Subject: [PATCH 0786/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v25.4.0 (#2095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v25.4.0 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cb6e61b338..e963b29f54 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 25.3.0 + 25.4.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies ```Groovy -implementation platform('com.google.cloud:libraries-bom:25.3.0') +implementation platform('com.google.cloud:libraries-bom:25.4.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index ad74463cb6..546552eda3 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 25.3.0 + 25.4.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3582da167e..3c039876d0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 25.3.0 + 25.4.0 pom import From 9275750f76938933e4e062d2eae2f8d5cd99c7e1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 5 Jun 2022 22:50:30 +0200 Subject: [PATCH 0787/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220528-1.32.1 (#2096) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 90b3debace..815238994e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220507-1.32.1 + v2-rev20220528-1.32.1 2.12.0 8.0.0 From ec2c282dc82bf2e73bb43097adcd02238666bb7d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:04:11 +0000 Subject: [PATCH 0788/2268] chore(main): release 2.13.2 (#2097) :robot: I have created a release *beep* *boop* --- ## [2.13.2](https://github.com/googleapis/java-bigquery/compare/v2.13.1...v2.13.2) (2022-06-05) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220528-1.32.1 ([#2096](https://github.com/googleapis/java-bigquery/issues/2096)) ([9275750](https://github.com/googleapis/java-bigquery/commit/9275750f76938933e4e062d2eae2f8d5cd99c7e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ccbce137e..5f5f3754da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.13.2](https://github.com/googleapis/java-bigquery/compare/v2.13.1...v2.13.2) (2022-06-05) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220528-1.32.1 ([#2096](https://github.com/googleapis/java-bigquery/issues/2096)) ([9275750](https://github.com/googleapis/java-bigquery/commit/9275750f76938933e4e062d2eae2f8d5cd99c7e1)) + ## [2.13.1](https://github.com/googleapis/java-bigquery/compare/v2.13.0...v2.13.1) (2022-06-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8f73e732fd..d7a522e123 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.2-SNAPSHOT + 2.13.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 424365a091..0e3d7127f8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.2-SNAPSHOT + 2.13.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.2-SNAPSHOT + 2.13.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 815238994e..89a2c4f8c2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.2-SNAPSHOT + 2.13.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.2-SNAPSHOT + 2.13.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fed346210d..597dc71469 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.2-SNAPSHOT + 2.13.2 diff --git a/versions.txt b/versions.txt index b9082b803f..16be3ac318 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.1:2.13.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.2:2.13.2 \ No newline at end of file From f3d6530f752805e108be9ddf1eb2c25c491ef5df Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:18:11 +0000 Subject: [PATCH 0789/2268] chore(main): release 2.13.3-SNAPSHOT (#2098) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d7a522e123..5c4eb94e19 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.2 + 2.13.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0e3d7127f8..399eecfc25 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.2 + 2.13.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.2 + 2.13.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 89a2c4f8c2..2a7c719109 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.2 + 2.13.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.2 + 2.13.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 597dc71469..4f5c420933 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.2 + 2.13.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 16be3ac318..fdb4e69f59 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.2:2.13.2 \ No newline at end of file +google-cloud-bigquery:2.13.2:2.13.3-SNAPSHOT \ No newline at end of file From bdbd3da4c6c8bb7f2363711691edb31c7711d811 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Jun 2022 21:51:34 +0200 Subject: [PATCH 0790/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.2 (#2101) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2a7c719109..9904f051fc 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.1 + 1.8.2 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.1 + 1.8.2 pom import From 4630c50db7428d888b726297408b7a223b39b28a Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Wed, 8 Jun 2022 01:24:10 +0530 Subject: [PATCH 0791/2268] fix: Assertj-core cleanup (#2102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed Assertj-core and refactored related testcase Fixes #2083☕️ --- google-cloud-bigquery/pom.xml | 5 ---- .../cloud/bigquery/QueryRequestInfoTest.java | 24 +++++++++++++++++-- pom.xml | 7 ------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 399eecfc25..e0b608f7fe 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -156,11 +156,6 @@ mockito-core test - - org.assertj - assertj-core - test - com.google.cloud google-cloud-datacatalog diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 5c224af809..a62e3c0a0d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -16,8 +16,8 @@ package com.google.cloud.bigquery; -import static org.assertj.core.api.Assertions.*; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import com.google.api.services.bigquery.model.QueryRequest; import com.google.cloud.bigquery.JobInfo.CreateDisposition; @@ -167,8 +167,28 @@ public void equalTo() { compareQueryRequestInfo(new QueryRequestInfo(QUERY_JOB_CONFIGURATION), REQUEST_INFO); } + /* + Ref: https://github.com/googleapis/java-bigquery/issues/2083 + Refactoring to remove the assert4j dependency which was causing RequireUpperBoundDeps Error + */ private void compareQueryRequestInfo(QueryRequestInfo expected, QueryRequestInfo actual) { + QueryRequest expectedQueryReq = expected.toPb(); + QueryRequest actualQueryReq = actual.toPb(); + // requestId are expected to be different - assertThat(actual).isEqualToIgnoringGivenFields(expected, "requestId"); + assertNotEquals(expectedQueryReq.getRequestId(), actualQueryReq.getRequestId()); + // rest of the attributes should be equal + assertEquals( + expectedQueryReq.getConnectionProperties(), actualQueryReq.getConnectionProperties()); + assertEquals(expectedQueryReq.getDefaultDataset(), actualQueryReq.getDefaultDataset()); + assertEquals(expectedQueryReq.getDryRun(), actualQueryReq.getDryRun()); + assertEquals(expectedQueryReq.getLabels(), actualQueryReq.getLabels()); + assertEquals(expectedQueryReq.getMaximumBytesBilled(), actualQueryReq.getMaximumBytesBilled()); + assertEquals(expectedQueryReq.getMaxResults(), actualQueryReq.getMaxResults()); + assertEquals(expectedQueryReq.getQuery(), actualQueryReq.getQuery()); + assertEquals(expectedQueryReq.getQueryParameters(), actualQueryReq.getQueryParameters()); + assertEquals(expectedQueryReq.getCreateSession(), actualQueryReq.getCreateSession()); + assertEquals(expectedQueryReq.getUseQueryCache(), actualQueryReq.getUseQueryCache()); + assertEquals(expectedQueryReq.getUseLegacySql(), actualQueryReq.getUseLegacySql()); } } diff --git a/pom.xml b/pom.xml index 9904f051fc..a06c2e016f 100644 --- a/pom.xml +++ b/pom.xml @@ -179,13 +179,6 @@ 2.7.2 test - - org.assertj - assertj-core - - 2.9.1 - test -
    From 1de34747d75ce8bf22471bdd057e9fc5cab8d1b3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 8 Jun 2022 16:02:09 +0200 Subject: [PATCH 0792/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.2 (#2105) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.2 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e963b29f54..dd8df0f20c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.13.1 + 2.13.2 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.2' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.2" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 63409b7f13..fa79665488 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.13.1 + 2.13.2 From a30e741ab240746e4acd002b41d0437303e5a4d5 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 14 Jun 2022 09:32:24 +0530 Subject: [PATCH 0793/2268] Disabling testReadAPIIterationAndOrder and testReadAPIConnectionMultiClose (#2118) --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 812833d9cb..891beed92c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2687,7 +2687,8 @@ public void testBQResultSetPagination() throws SQLException { assertEquals(300000, cnt); // total 300000 rows should be read } - @Test + // @Test - Temporarily disabling till https://github.com/googleapis/gax-java/issues/1712 or + // b/235591056 are resolved public void testReadAPIIterationAndOrder() throws SQLException { // use read API to read 300K records and check the order String query = @@ -2733,7 +2734,8 @@ public void testCreateDefaultConnection() throws BigQuerySQLException { assertTrue(connection.close()); } - @Test + // @Test - Temporarily disabling till https://github.com/googleapis/gax-java/issues/1712 or + // b/235591056 are resolved public void testReadAPIConnectionMultiClose() throws SQLException { // use read API to read 300K records, then closes the connection. This test From 1a0235f9cdea0ae37b2e8b1047ca66395b1af3b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jun 2022 07:43:28 +0200 Subject: [PATCH 0794/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.34.1 (#2111) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fa79665488..071f5b459d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.0 + 1.34.1 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4f5c420933..c47e34bdfe 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.0 + 1.34.1 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3c039876d0..97b28c1256 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.0 + 1.34.1 com.google.oauth-client From 30a88f43aea6269e3fbe82544eb2112f25830761 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jun 2022 07:45:23 +0200 Subject: [PATCH 0795/2268] deps: update cloud client dependencies (#2110) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a06c2e016f..b497428cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.14.1 + 2.14.2 pom import @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.7.2 + 2.8.1 test From 7b204eed9d64c73c734bd4f657dcc0bb2b22e5a2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Jun 2022 07:47:50 +0200 Subject: [PATCH 0796/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.0 (#2116) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b497428cf3..61c30d2626 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.4.0 + 1.5.0 From de7b45a52259cec16970e074dd4f526685aa4d09 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 15 Jun 2022 05:01:15 -0400 Subject: [PATCH 0797/2268] docs(sample): clean up native image sample README (#2120) --- samples/native-image-sample/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md index 8d7bce6589..ed54aa6fac 100644 --- a/samples/native-image-sample/README.md +++ b/samples/native-image-sample/README.md @@ -2,7 +2,6 @@ The BigQuery sample application demonstrates some common operations with [Google Cloud BigQuery](https://cloud.google.com/bigquery) and is compatible with Native Image compilation. -## Setup Instructions ## Setup Instructions @@ -22,23 +21,23 @@ You will need to follow these prerequisite steps in order to run the samples: 3. Install the native image compiler. - You can follow [the installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm) from the GraalVM website. + You can follow [the installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm). After following the instructions, ensure that you install the native image extension installed by running: ``` gu install native-image ``` - Once you finish following the instructions, verify that the default version of Java is set to the GraalVM version by running `java -version` in a terminal. + Once you finish following the instructions, verify that the default version of Java is set to the correct version by running `java -version` in a terminal. You will see something similar to the below output: ``` $ java -version - openjdk version "11.0.7" 2020-04-14 - OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02) - OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing) + openjdk version "17.0.3" 2022-04-19 + OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06) + OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing) ``` 2. [Enable the BigQuery APIs](https://console.cloud.google.com/apis/api/bigquery.googleapis.com). @@ -47,7 +46,7 @@ You will need to follow these prerequisite steps in order to run the samples: Navigate to this directory in a new terminal. -1. Compile the application using the Native Image Compiler. This step may take a few minutes. +1. Compile the application using the native image Compiler. This step may take a few minutes. ``` mvn package -P native -DskipTests @@ -79,4 +78,4 @@ In order to run the sample integration test, call the following command: ``` mvn test -Pnative -``` \ No newline at end of file +``` From e52739ffcaeb9ca9dc362f07f117f37ecff220c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 16 Jun 2022 07:33:37 +0200 Subject: [PATCH 0798/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.34.1 (#2112) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 071f5b459d..9a608be2bb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.0 + 1.34.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c47e34bdfe..7adc054c84 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.0 + 1.34.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 97b28c1256..b3c7158021 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.0 + 1.34.1 From 40c084f213e0ac37f92d54fcd9e03594dfaf763a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 12:47:09 -0700 Subject: [PATCH 0799/2268] chore(main): release 2.13.3 (#2104) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f5f3754da..d87e236aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.13.3](https://github.com/googleapis/java-bigquery/compare/v2.13.2...v2.13.3) (2022-06-16) + + +### Bug Fixes + +* Assertj-core cleanup ([#2102](https://github.com/googleapis/java-bigquery/issues/2102)) ([4630c50](https://github.com/googleapis/java-bigquery/commit/4630c50db7428d888b726297408b7a223b39b28a)) + + +### Documentation + +* **sample:** clean up native image sample README ([#2120](https://github.com/googleapis/java-bigquery/issues/2120)) ([de7b45a](https://github.com/googleapis/java-bigquery/commit/de7b45a52259cec16970e074dd4f526685aa4d09)) + + +### Dependencies + +* update cloud client dependencies ([#2110](https://github.com/googleapis/java-bigquery/issues/2110)) ([30a88f4](https://github.com/googleapis/java-bigquery/commit/30a88f43aea6269e3fbe82544eb2112f25830761)) +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.2 ([#2101](https://github.com/googleapis/java-bigquery/issues/2101)) ([bdbd3da](https://github.com/googleapis/java-bigquery/commit/bdbd3da4c6c8bb7f2363711691edb31c7711d811)) +* update dependency com.google.oauth-client:google-oauth-client-java6 to v1.34.1 ([#2111](https://github.com/googleapis/java-bigquery/issues/2111)) ([1a0235f](https://github.com/googleapis/java-bigquery/commit/1a0235f9cdea0ae37b2e8b1047ca66395b1af3b0)) +* update dependency com.google.oauth-client:google-oauth-client-jetty to v1.34.1 ([#2112](https://github.com/googleapis/java-bigquery/issues/2112)) ([e52739f](https://github.com/googleapis/java-bigquery/commit/e52739ffcaeb9ca9dc362f07f117f37ecff220c7)) + ## [2.13.2](https://github.com/googleapis/java-bigquery/compare/v2.13.1...v2.13.2) (2022-06-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5c4eb94e19..07b76c3e38 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.3-SNAPSHOT + 2.13.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e0b608f7fe..9f9e1ebd81 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.3-SNAPSHOT + 2.13.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.3-SNAPSHOT + 2.13.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 61c30d2626..dacb853f5e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.3-SNAPSHOT + 2.13.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.3-SNAPSHOT + 2.13.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7adc054c84..f28648544d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.3-SNAPSHOT + 2.13.3 diff --git a/versions.txt b/versions.txt index fdb4e69f59..ed1f955c04 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.2:2.13.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.3:2.13.3 \ No newline at end of file From a1c3fde2f533fd9959cf39abd9fad419e0b41183 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 19:58:10 +0000 Subject: [PATCH 0800/2268] chore(main): release 2.13.4-SNAPSHOT (#2122) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 07b76c3e38..540086de88 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.3 + 2.13.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9f9e1ebd81..042eef7ad9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.3 + 2.13.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.3 + 2.13.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index dacb853f5e..762934e546 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.3 + 2.13.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.3 + 2.13.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f28648544d..db00f99f1f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.3 + 2.13.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index ed1f955c04..dfbd802a50 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.3:2.13.3 \ No newline at end of file +google-cloud-bigquery:2.13.3:2.13.4-SNAPSHOT \ No newline at end of file From c5c97b0c6fd98978e3e480cd565bf4f832b35e7c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 17 Jun 2022 05:13:10 +0200 Subject: [PATCH 0801/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.3 (#2123) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.13.3 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd8df0f20c..94172a0a21 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.13.2 + 2.13.3 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.3' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9a608be2bb..168fe6daa1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.13.2 + 2.13.3 From 4542ce9a51d9756a8a06d0e33cf3a40d1e321ade Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Jun 2022 02:06:11 +0200 Subject: [PATCH 0802/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 (#2124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.11` -> `0.9.12` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.12/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.12/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.12/compatibility-slim/0.9.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.12/confidence-slim/0.9.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.12`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.12) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.11...0.9.12) ##### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Add Mockito / Byte Buddy support documentation by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/236](https://togithub.com/graalvm/native-build-tools/pull/236) - Prevent builds from failing if no test list is present by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/239](https://togithub.com/graalvm/native-build-tools/pull/239) - Support different agent modes in the native-image Gradle plugin by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/230](https://togithub.com/graalvm/native-build-tools/pull/230) - JVM Reachability Metadata support for Maven by [@​alvarosanchez](https://togithub.com/alvarosanchez) in [https://github.com/graalvm/native-build-tools/pull/240](https://togithub.com/graalvm/native-build-tools/pull/240) - Warn about deprecated agent DSL by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/242](https://togithub.com/graalvm/native-build-tools/pull/242) - Rework Maven plugin by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/247](https://togithub.com/graalvm/native-build-tools/pull/247) - Add Gradle rich output support, configure default metadata URL on Maven by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/249](https://togithub.com/graalvm/native-build-tools/pull/249) - Fix wrong scope for test dependencies by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/251](https://togithub.com/graalvm/native-build-tools/pull/251) - Add documentation for alternative build systems. by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/248](https://togithub.com/graalvm/native-build-tools/pull/248) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.11...0.9.12
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 546552eda3..f34b622b4e 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.11 + 0.9.12 test From 6da965f540a2cdb2eaf845301cfbfbf34b9a6866 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 22 Jun 2022 02:06:15 +0200 Subject: [PATCH 0803/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 (#2125) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.11` -> `0.9.12` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.12/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.12/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.12/compatibility-slim/0.9.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.12/confidence-slim/0.9.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.12`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.12) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.11...0.9.12) ##### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Add Mockito / Byte Buddy support documentation by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/236](https://togithub.com/graalvm/native-build-tools/pull/236) - Prevent builds from failing if no test list is present by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/239](https://togithub.com/graalvm/native-build-tools/pull/239) - Support different agent modes in the native-image Gradle plugin by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/230](https://togithub.com/graalvm/native-build-tools/pull/230) - JVM Reachability Metadata support for Maven by [@​alvarosanchez](https://togithub.com/alvarosanchez) in [https://github.com/graalvm/native-build-tools/pull/240](https://togithub.com/graalvm/native-build-tools/pull/240) - Warn about deprecated agent DSL by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/242](https://togithub.com/graalvm/native-build-tools/pull/242) - Rework Maven plugin by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/247](https://togithub.com/graalvm/native-build-tools/pull/247) - Add Gradle rich output support, configure default metadata URL on Maven by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/249](https://togithub.com/graalvm/native-build-tools/pull/249) - Fix wrong scope for test dependencies by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/251](https://togithub.com/graalvm/native-build-tools/pull/251) - Add documentation for alternative build systems. by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/248](https://togithub.com/graalvm/native-build-tools/pull/248) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.11...0.9.12
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index f34b622b4e..f94b8ac543 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.11 + 0.9.12 true com.example.bigquery.NativeImageBigquerySample From e3ddcf4f1ca0889e4bc2346bde148883657f9bdb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 00:18:13 +0000 Subject: [PATCH 0804/2268] chore(main): release 2.13.4 (#2126) :robot: I have created a release *beep* *boop* --- ## [2.13.4](https://github.com/googleapis/java-bigquery/compare/v2.13.3...v2.13.4) (2022-06-22) ### Dependencies * update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#2124](https://github.com/googleapis/java-bigquery/issues/2124)) ([4542ce9](https://github.com/googleapis/java-bigquery/commit/4542ce9a51d9756a8a06d0e33cf3a40d1e321ade)) * update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#2125](https://github.com/googleapis/java-bigquery/issues/2125)) ([6da965f](https://github.com/googleapis/java-bigquery/commit/6da965f540a2cdb2eaf845301cfbfbf34b9a6866)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87e236aa0..ab1358cff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.13.4](https://github.com/googleapis/java-bigquery/compare/v2.13.3...v2.13.4) (2022-06-22) + + +### Dependencies + +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#2124](https://github.com/googleapis/java-bigquery/issues/2124)) ([4542ce9](https://github.com/googleapis/java-bigquery/commit/4542ce9a51d9756a8a06d0e33cf3a40d1e321ade)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#2125](https://github.com/googleapis/java-bigquery/issues/2125)) ([6da965f](https://github.com/googleapis/java-bigquery/commit/6da965f540a2cdb2eaf845301cfbfbf34b9a6866)) + ## [2.13.3](https://github.com/googleapis/java-bigquery/compare/v2.13.2...v2.13.3) (2022-06-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 540086de88..a1178a6f8e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.4-SNAPSHOT + 2.13.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 042eef7ad9..93510eaded 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.4-SNAPSHOT + 2.13.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.4-SNAPSHOT + 2.13.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 762934e546..509626fdbb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.4-SNAPSHOT + 2.13.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.4-SNAPSHOT + 2.13.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index db00f99f1f..77101b32e4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.4-SNAPSHOT + 2.13.4 diff --git a/versions.txt b/versions.txt index dfbd802a50..e2157bc2bf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.3:2.13.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.4:2.13.4 \ No newline at end of file From f4aca7f3da46f619047742ee7a723afecce9faa8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 00:30:14 +0000 Subject: [PATCH 0805/2268] chore(main): release 2.13.5-SNAPSHOT (#2127) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a1178a6f8e..96f6914b42 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.4 + 2.13.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 93510eaded..55049788ee 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.4 + 2.13.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.4 + 2.13.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 509626fdbb..eb5cbd2cf6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.4 + 2.13.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.4 + 2.13.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 77101b32e4..6ddc29e06c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.4 + 2.13.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index e2157bc2bf..da1e8af5c3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.4:2.13.4 \ No newline at end of file +google-cloud-bigquery:2.13.4:2.13.5-SNAPSHOT \ No newline at end of file From 3043533608c5659be0313f1942d20314d2157fd4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 23 Jun 2022 07:04:52 +0200 Subject: [PATCH 0806/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 (#2128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 * 🦉 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 --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94172a0a21..826d7c7c81 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.4' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.4" ``` ## Authentication diff --git a/pom.xml b/pom.xml index eb5cbd2cf6..433f8cbce3 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220528-1.32.1 - 2.12.0 + 2.13.0 8.0.0 From cb4f76964e82013ca451435eb5b4bd90c13eac8b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 05:16:12 +0000 Subject: [PATCH 0807/2268] chore(main): release 2.13.5 (#2129) :robot: I have created a release *beep* *boop* --- ## [2.13.5](https://github.com/googleapis/java-bigquery/compare/v2.13.4...v2.13.5) (2022-06-23) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#2128](https://github.com/googleapis/java-bigquery/issues/2128)) ([3043533](https://github.com/googleapis/java-bigquery/commit/3043533608c5659be0313f1942d20314d2157fd4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1358cff3..278e14819e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.13.5](https://github.com/googleapis/java-bigquery/compare/v2.13.4...v2.13.5) (2022-06-23) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#2128](https://github.com/googleapis/java-bigquery/issues/2128)) ([3043533](https://github.com/googleapis/java-bigquery/commit/3043533608c5659be0313f1942d20314d2157fd4)) + ## [2.13.4](https://github.com/googleapis/java-bigquery/compare/v2.13.3...v2.13.4) (2022-06-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 96f6914b42..1b09fd6cc2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.5-SNAPSHOT + 2.13.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 55049788ee..709a5b07d0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.5-SNAPSHOT + 2.13.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.5-SNAPSHOT + 2.13.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 433f8cbce3..eb284c9466 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.5-SNAPSHOT + 2.13.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.5-SNAPSHOT + 2.13.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6ddc29e06c..1c9c317c1a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.5-SNAPSHOT + 2.13.5 diff --git a/versions.txt b/versions.txt index da1e8af5c3..219132e729 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.4:2.13.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.5:2.13.5 \ No newline at end of file From 1c8cd0a0bcfbaba44252ed67ca63fb9dafd204ac Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 23 Jun 2022 05:28:12 +0000 Subject: [PATCH 0808/2268] chore(main): release 2.13.6-SNAPSHOT (#2130) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1b09fd6cc2..4b4d7663c3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.5 + 2.13.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 709a5b07d0..a8458ff589 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.5 + 2.13.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.5 + 2.13.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index eb284c9466..a54f07b363 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.5 + 2.13.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.5 + 2.13.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1c9c317c1a..71e41a3ba6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.5 + 2.13.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index 219132e729..6cd334facf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.5:2.13.5 \ No newline at end of file +google-cloud-bigquery:2.13.5:2.13.6-SNAPSHOT \ No newline at end of file From bddefcf647d50ee12fffea80c04613b38b8d02d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 23 Jun 2022 18:12:19 +0200 Subject: [PATCH 0809/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220611-1.32.1 (#2132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220528-1.32.1` -> `v2-rev20220611-1.32.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220611-1.32.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220611-1.32.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220611-1.32.1/compatibility-slim/v2-rev20220528-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220611-1.32.1/confidence-slim/v2-rev20220528-1.32.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 826d7c7c81..f153261024 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.5' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.5" ``` ## Authentication diff --git a/pom.xml b/pom.xml index a54f07b363..a6513f5659 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220528-1.32.1 + v2-rev20220611-1.32.1 2.13.0 8.0.0 From 0bd5ddc0df0a978692252e50c37c94f41a3c4e1d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 24 Jun 2022 08:54:52 +0200 Subject: [PATCH 0810/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.3 (#2135) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a6513f5659..dc1ea51cad 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.2 + 1.8.3 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.2 + 1.8.3 pom import From a6f6b4051144545fb5b61c7d802f7151a778a412 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 07:08:31 +0000 Subject: [PATCH 0811/2268] chore(main): release 2.13.6 (#2134) :robot: I have created a release *beep* *boop* --- ## [2.13.6](https://github.com/googleapis/java-bigquery/compare/v2.13.5...v2.13.6) (2022-06-24) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220611-1.32.1 ([#2132](https://github.com/googleapis/java-bigquery/issues/2132)) ([bddefcf](https://github.com/googleapis/java-bigquery/commit/bddefcf647d50ee12fffea80c04613b38b8d02d0)) * update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.3 ([#2135](https://github.com/googleapis/java-bigquery/issues/2135)) ([0bd5ddc](https://github.com/googleapis/java-bigquery/commit/0bd5ddc0df0a978692252e50c37c94f41a3c4e1d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 278e14819e..b91ba16acf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.13.6](https://github.com/googleapis/java-bigquery/compare/v2.13.5...v2.13.6) (2022-06-24) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220611-1.32.1 ([#2132](https://github.com/googleapis/java-bigquery/issues/2132)) ([bddefcf](https://github.com/googleapis/java-bigquery/commit/bddefcf647d50ee12fffea80c04613b38b8d02d0)) +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.3 ([#2135](https://github.com/googleapis/java-bigquery/issues/2135)) ([0bd5ddc](https://github.com/googleapis/java-bigquery/commit/0bd5ddc0df0a978692252e50c37c94f41a3c4e1d)) + ## [2.13.5](https://github.com/googleapis/java-bigquery/compare/v2.13.4...v2.13.5) (2022-06-23) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4b4d7663c3..c56741afc3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.6-SNAPSHOT + 2.13.6 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a8458ff589..e48548593e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.6-SNAPSHOT + 2.13.6 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.6-SNAPSHOT + 2.13.6 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index dc1ea51cad..c8714c8cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.6-SNAPSHOT + 2.13.6 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.6-SNAPSHOT + 2.13.6 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 71e41a3ba6..9e98d6499e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.6-SNAPSHOT + 2.13.6 diff --git a/versions.txt b/versions.txt index 6cd334facf..f1d89a7b89 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.5:2.13.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.6:2.13.6 \ No newline at end of file From 0965f4d409737f86e5780c2c02d88b15f5887469 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 07:20:11 +0000 Subject: [PATCH 0812/2268] chore(main): release 2.13.7-SNAPSHOT (#2136) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c56741afc3..9cf1a5247e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.6 + 2.13.7-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e48548593e..49dd5f59d3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.6 + 2.13.7-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.6 + 2.13.7-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c8714c8cf9..3155ff7d66 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.6 + 2.13.7-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.6 + 2.13.7-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9e98d6499e..5d0bc312bd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.6 + 2.13.7-SNAPSHOT diff --git a/versions.txt b/versions.txt index f1d89a7b89..35d245cfed 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.6:2.13.6 \ No newline at end of file +google-cloud-bigquery:2.13.6:2.13.7-SNAPSHOT \ No newline at end of file From 2d52c1bb07d60405fd7bd88ccfdcbf0062955657 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 14:05:18 +0530 Subject: [PATCH 0813/2268] chore: update java dependencies in templates (#1465) (#2133) * chore: update java dependencies in templates * chore: fix java golden tests * chore: fix tests * chore: fix tests Source-Link: https://github.com/googleapis/synthtool/commit/875deab8c37423679265ab08df2fffdaeaf476b8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bb0871486fc5f95f969df8fa65e002c0cf952cb7dd3bf647475c1d49ae0535b7 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a79f06271b..8ded1fe927 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:2567a120ce90fadb6201999b87d649d9f67459de28815ad239bce9ebfaa18a74 -# created: 2022-05-19T15:12:45.278246753Z + digest: sha256:bb0871486fc5f95f969df8fa65e002c0cf952cb7dd3bf647475c1d49ae0535b7 +# created: 2022-06-23T15:37:16.246867617Z From e1e58d32e01e6a61348340423cc8f40675249cc9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 11:58:23 -0700 Subject: [PATCH 0814/2268] chore: update dependencies for regapic (#1467) (#2139) * chore: update dependencies for regapic * add more dependencies and trigger comment * update goldens * fix indentation * remove duplicate gax-httpjson dependency * remove duplicated dependencies Source-Link: https://github.com/googleapis/synthtool/commit/fa54eb2a78c6ee48613fd33152e2130e949dcbd9 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/common.sh | 4 +++- README.md | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8ded1fe927..f0625e4d94 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bb0871486fc5f95f969df8fa65e002c0cf952cb7dd3bf647475c1d49ae0535b7 -# created: 2022-06-23T15:37:16.246867617Z + digest: sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906 +# created: 2022-06-27T15:01:06.405564326Z diff --git a/.kokoro/common.sh b/.kokoro/common.sh index ace89f45a9..f8f957af11 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -55,4 +55,6 @@ function retry_with_backoff { ## Helper functionss function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file +function println() { printf '%s\n' "$(now) $*"; } + +## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/README.md b/README.md index f153261024..77905bd2c6 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.5' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.6' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.6" ``` ## Authentication From c7ef597832505e6c05adb38ac1db5dd15e32d024 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 29 Jun 2022 07:08:25 +0200 Subject: [PATCH 0815/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.4 (#2140) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3155ff7d66..7bbf873233 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.3 + 1.8.4 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.3 + 1.8.4 pom import From fca26012be0c65666466076bd419dd9d1c8df1f4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 05:20:11 +0000 Subject: [PATCH 0816/2268] chore(main): release 2.13.7 (#2144) :robot: I have created a release *beep* *boop* --- ## [2.13.7](https://github.com/googleapis/java-bigquery/compare/v2.13.6...v2.13.7) (2022-06-29) ### Dependencies * update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.4 ([#2140](https://github.com/googleapis/java-bigquery/issues/2140)) ([c7ef597](https://github.com/googleapis/java-bigquery/commit/c7ef597832505e6c05adb38ac1db5dd15e32d024)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b91ba16acf..d5f2ac5074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.13.7](https://github.com/googleapis/java-bigquery/compare/v2.13.6...v2.13.7) (2022-06-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.8.4 ([#2140](https://github.com/googleapis/java-bigquery/issues/2140)) ([c7ef597](https://github.com/googleapis/java-bigquery/commit/c7ef597832505e6c05adb38ac1db5dd15e32d024)) + ## [2.13.6](https://github.com/googleapis/java-bigquery/compare/v2.13.5...v2.13.6) (2022-06-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9cf1a5247e..cb98de08b7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.7-SNAPSHOT + 2.13.7 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 49dd5f59d3..e114456969 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.7-SNAPSHOT + 2.13.7 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.7-SNAPSHOT + 2.13.7 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7bbf873233..337f7d7a50 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.7-SNAPSHOT + 2.13.7 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.7-SNAPSHOT + 2.13.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5d0bc312bd..d0913d089f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.7-SNAPSHOT + 2.13.7 diff --git a/versions.txt b/versions.txt index 35d245cfed..8d95a0090b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.6:2.13.7-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.7:2.13.7 \ No newline at end of file From ad1aa20bb1a93e202b0810168c632e94bcb8e4ad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 05:32:12 +0000 Subject: [PATCH 0817/2268] chore(main): release 2.13.8-SNAPSHOT (#2145) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cb98de08b7..7dde2e6992 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.7 + 2.13.8-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e114456969..bc3f340cae 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.7 + 2.13.8-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.7 + 2.13.8-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 337f7d7a50..b0cc38b732 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.7 + 2.13.8-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.7 + 2.13.8-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d0913d089f..5610af1e9c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.7 + 2.13.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8d95a0090b..b0badb302c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.7:2.13.7 \ No newline at end of file +google-cloud-bigquery:2.13.7:2.13.8-SNAPSHOT \ No newline at end of file From 4232684a36e1450a82bae4164043e79559734e8c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 02:24:31 +0000 Subject: [PATCH 0818/2268] chore: Disable CLIRR checks on releas (#1474) (#2150) Source-Link: https://github.com/googleapis/synthtool/commit/7a220e27993a25ab3cda26510d5619d97b6952a9 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28 --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/release/stage.sh | 3 ++- README.md | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f0625e4d94..a454a61e8d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:1ec28a46062b19135b11178ceee60231e5f5a92dab454e23ae0aab72cd875906 -# created: 2022-06-27T15:01:06.405564326Z + digest: sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28 +# created: 2022-06-29T23:17:33.110417661Z diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 77dc4e8f0f..1dba8de108 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -32,6 +32,7 @@ retry_with_backoff 3 10 \ mvn clean deploy -B \ --settings ${MAVEN_SETTINGS_FILE} \ -DskipTests=true \ + -Dclirr.skip=true \ -DperformRelease=true \ -Dgpg.executable=gpg \ -Dgpg.passphrase=${GPG_PASSPHRASE} \ @@ -42,4 +43,4 @@ then mvn nexus-staging:release -B \ -DperformRelease=true \ --settings=settings.xml -fi \ No newline at end of file +fi diff --git a/README.md b/README.md index 77905bd2c6..407a4f613b 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.6' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.7' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.6" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.7" ``` ## Authentication From ce7b0a400063d3d1a1202cf040f4e7f48336a29b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Jul 2022 08:58:41 +0200 Subject: [PATCH 0819/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.9.0 (#2151) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 168fe6daa1..664d17e8f0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.8.0 + 2.9.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5610af1e9c..3c669104eb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.8.0 + 2.9.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b3c7158021..3a0452dc14 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.8.0 + 2.9.0 test From a07c714cb90c7ff62a43f7500abe8d54a5cd0936 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Jul 2022 09:01:02 +0200 Subject: [PATCH 0820/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.9.0 (#2149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.9.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b0cc38b732..d9d615820d 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.8.1 + 2.9.0 test From 4365d29041737612b6ea4d801cd919d150d4d32b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Jul 2022 07:18:11 +0000 Subject: [PATCH 0821/2268] chore(main): release 2.13.8 (#2152) :robot: I have created a release *beep* *boop* --- ## [2.13.8](https://github.com/googleapis/java-bigquery/compare/v2.13.7...v2.13.8) (2022-07-01) ### Dependencies * update dependency com.google.cloud:google-cloud-storage to v2.9.0 ([#2149](https://github.com/googleapis/java-bigquery/issues/2149)) ([a07c714](https://github.com/googleapis/java-bigquery/commit/a07c714cb90c7ff62a43f7500abe8d54a5cd0936)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f2ac5074..707746e0cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.13.8](https://github.com/googleapis/java-bigquery/compare/v2.13.7...v2.13.8) (2022-07-01) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.9.0 ([#2149](https://github.com/googleapis/java-bigquery/issues/2149)) ([a07c714](https://github.com/googleapis/java-bigquery/commit/a07c714cb90c7ff62a43f7500abe8d54a5cd0936)) + ## [2.13.7](https://github.com/googleapis/java-bigquery/compare/v2.13.6...v2.13.7) (2022-06-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7dde2e6992..5053edc667 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.8-SNAPSHOT + 2.13.8 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bc3f340cae..d0f166f79b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.8-SNAPSHOT + 2.13.8 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.8-SNAPSHOT + 2.13.8 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d9d615820d..287bd35397 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.8-SNAPSHOT + 2.13.8 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.8-SNAPSHOT + 2.13.8 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3c669104eb..28d2465d36 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.8-SNAPSHOT + 2.13.8 diff --git a/versions.txt b/versions.txt index b0badb302c..1283a413c7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.7:2.13.8-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.13.8:2.13.8 \ No newline at end of file From 4d0d7b5694b1682a4c9365fa1623eb31820ef1dd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Jul 2022 07:30:11 +0000 Subject: [PATCH 0822/2268] chore(main): release 2.13.9-SNAPSHOT (#2153) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5053edc667..f15d0dc6e2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.8 + 2.13.9-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d0f166f79b..3e2982dcb1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.8 + 2.13.9-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.8 + 2.13.9-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 287bd35397..3214f75717 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.8 + 2.13.9-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.8 + 2.13.9-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 28d2465d36..dbd3e66b93 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.8 + 2.13.9-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1283a413c7..ca1695517b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.8:2.13.8 \ No newline at end of file +google-cloud-bigquery:2.13.8:2.13.9-SNAPSHOT \ No newline at end of file From 2d1c9702ce77adf848de840d689334435a603edd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Jul 2022 23:02:20 +0200 Subject: [PATCH 0823/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.4.0 (#2154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.3.0` -> `2.4.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.4.0/compatibility-slim/2.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.4.0/confidence-slim/2.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.4.0`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​240-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev230v240-2022-07-01) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.3.0...v2.4.0) ##### Features - Enable REST transport for most of Java and Go clients ([#​704](https://togithub.com/googleapis/java-bigqueryconnection/issues/704)) ([c7def69](https://togithub.com/googleapis/java-bigqueryconnection/commit/c7def693dc869d3b25054dc54ac4a26c3060af86)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#​703](https://togithub.com/googleapis/java-bigqueryconnection/issues/703)) ([a385b7b](https://togithub.com/googleapis/java-bigqueryconnection/commit/a385b7b3e2610f8a8396fc7a40415eb8b82498bc)) - update dependency com.google.protobuf:protobuf-java-util to v3.21.0 ([#​698](https://togithub.com/googleapis/java-bigqueryconnection/issues/698)) ([f7d48b6](https://togithub.com/googleapis/java-bigqueryconnection/commit/f7d48b611b134b2dd4cf26f437e4807218207c8f)) - update dependency com.google.protobuf:protobuf-java-util to v3.21.1 ([#​699](https://togithub.com/googleapis/java-bigqueryconnection/issues/699)) ([f631ffb](https://togithub.com/googleapis/java-bigqueryconnection/commit/f631ffbf8c30388a99d1cab5fbd0c114a912f60e)) - update dependency com.google.protobuf:protobuf-java-util to v3.21.2 ([#​705](https://togithub.com/googleapis/java-bigqueryconnection/issues/705)) ([cbb6f03](https://togithub.com/googleapis/java-bigqueryconnection/commit/cbb6f03346e8038e4fe5d5baf0f2817d0a3b4dcc))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 407a4f613b..d04e4b49df 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.7' +implementation 'com.google.cloud:google-cloud-bigquery:2.13.8' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.7" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.8" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 664d17e8f0..8e2ca0fdae 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.3.0 + 2.4.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dbd3e66b93..e277d343b3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.3.0 + 2.4.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3a0452dc14..e423799844 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.3.0 + 2.4.0 test From 302d7671377ba2fa63afeaf4ab2e9037bf567de8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 5 Jul 2022 07:14:24 +0200 Subject: [PATCH 0824/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.1 (#2155) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3214f75717..23ea3191ec 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.0 + 1.5.1 From e7a0568dd45d619d9ad69663201f725471a2ca5a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 09:06:42 -0700 Subject: [PATCH 0825/2268] chore: fix minor typos in README and pom templates (#1479) (#2157) Source-Link: https://github.com/googleapis/synthtool/commit/18d4e9bb50d0dfb3291de18c51b96a2c835e2446 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:f8374176dc59291f05dd3fec927a9da2cda687a9ef4de32e77f699a2be12ab45 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- README.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a454a61e8d..1b645c0129 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28 -# created: 2022-06-29T23:17:33.110417661Z + digest: sha256:f8374176dc59291f05dd3fec927a9da2cda687a9ef4de32e77f699a2be12ab45 +# created: 2022-07-07T14:26:11.880812641Z diff --git a/README.md b/README.md index d04e4b49df..6d0145edcf 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Java idiomatic client for [Cloud BigQuery][product-docs]. ## Quickstart -If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: ```xml - - 7012 - com/google/cloud/bigquery/BigQuery - com.google.cloud.bigquery.Connection createConnection(com.google.cloud.bigquery.ConnectionSettings) - - - 7012 - com/google/cloud/bigquery/BigQuery - com.google.cloud.bigquery.Connection createConnection() - - - 7012 - com/google/cloud/bigquery/spi/v2/BigQueryRpc - com.google.api.services.bigquery.model.Job createJobForQuery(com.google.api.services.bigquery.model.Job) - - - 7012 - com/google/cloud/bigquery/spi/v2/BigQueryRpc - com.google.api.services.bigquery.model.Job getQueryJob(java.lang.String, java.lang.String, java.lang.String) - - + 7012 - com/google/cloud/bigquery/spi/v2/BigQueryRpc - com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) + com/google/cloud/bigquery/LoadConfiguration + java.util.List getDecimalTargetTypes() 7012 - com/google/cloud/bigquery/spi/v2/BigQueryRpc - com.google.api.services.bigquery.model.TableDataList listTableDataWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String) + com/google/cloud/bigquery/LoadConfiguration$Builder + com.google.cloud.bigquery.LoadConfiguration$Builder setDecimalTargetTypes(java.util.List) \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java index 15e82fc914..d4ed810449 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java @@ -125,6 +125,17 @@ interface Builder { */ Builder setUseAvroLogicalTypes(Boolean useAvroLogicalTypes); + /** + * Defines the list of possible SQL data types to which the source decimal values are converted. + * This list and the precision and the scale parameters of the decimal field determine the + * target type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in + * the specified list and if it supports the precision and the scale. STRING supports all + * precision and scale values. + * + * @param decimalTargetTypes decimalTargetType or {@code null} for none + */ + Builder setDecimalTargetTypes(List decimalTargetTypes); + LoadConfiguration build(); } @@ -214,6 +225,15 @@ interface Builder { /** Returns True/False. Indicates whether the logical type is interpreted. */ Boolean getUseAvroLogicalTypes(); + /** + * Returns the list of possible SQL data types to which the source decimal values are converted. + * This list and the precision and the scale parameters of the decimal field determine the target + * type. In the order of NUMERIC, BIGNUMERIC, and STRING, a type is picked if it is in the + * specified list and if it supports the precision and the scale. STRING supports all precision + * and scale values. + */ + List getDecimalTargetTypes(); + /** Returns a builder for the load configuration object. */ Builder toBuilder(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java index 479a680999..ebb5713ef0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java @@ -55,6 +55,7 @@ public final class WriteChannelConfiguration implements LoadConfiguration, Seria private final Clustering clustering; private final Boolean useAvroLogicalTypes; private final Map labels; + private List decimalTargetTypes; public static final class Builder implements LoadConfiguration.Builder { @@ -73,6 +74,7 @@ public static final class Builder implements LoadConfiguration.Builder { private Clustering clustering; private Boolean useAvroLogicalTypes; private Map labels; + private List decimalTargetTypes; private Builder() {} @@ -93,6 +95,7 @@ private Builder(WriteChannelConfiguration writeChannelConfiguration) { this.clustering = writeChannelConfiguration.clustering; this.useAvroLogicalTypes = writeChannelConfiguration.useAvroLogicalTypes; this.labels = writeChannelConfiguration.labels; + this.decimalTargetTypes = writeChannelConfiguration.decimalTargetTypes; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -169,6 +172,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (configurationPb.getLabels() != null) { this.labels = configurationPb.getLabels(); } + if (loadConfigurationPb.getDecimalTargetTypes() != null) { + this.decimalTargetTypes = loadConfigurationPb.getDecimalTargetTypes(); + } } @Override @@ -262,6 +268,12 @@ public Builder setLabels(Map labels) { return this; } + @Override + public Builder setDecimalTargetTypes(List decimalTargetTypes) { + this.decimalTargetTypes = decimalTargetTypes; + return this; + } + @Override public WriteChannelConfiguration build() { return new WriteChannelConfiguration(this); @@ -284,6 +296,7 @@ protected WriteChannelConfiguration(Builder builder) { this.clustering = builder.clustering; this.useAvroLogicalTypes = builder.useAvroLogicalTypes; this.labels = builder.labels; + this.decimalTargetTypes = builder.decimalTargetTypes; } @Override @@ -372,6 +385,11 @@ public Map getLabels() { return labels; } + @Override + public List getDecimalTargetTypes() { + return decimalTargetTypes; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -393,7 +411,8 @@ MoreObjects.ToStringHelper toStringHelper() { .add("timePartitioning", timePartitioning) .add("clustering", clustering) .add("useAvroLogicalTypes", useAvroLogicalTypes) - .add("labels", labels); + .add("labels", labels) + .add("decimalTargetTypes", decimalTargetTypes); } @Override @@ -424,7 +443,8 @@ public int hashCode() { timePartitioning, clustering, useAvroLogicalTypes, - labels); + labels, + decimalTargetTypes); } WriteChannelConfiguration setProjectId(String projectId) { @@ -495,6 +515,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (labels != null) { jobConfiguration.setLabels(labels); } + if (decimalTargetTypes != null) { + loadConfigurationPb.setDecimalTargetTypes(decimalTargetTypes); + } jobConfiguration.setLoad(loadConfigurationPb); return jobConfiguration; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java index dbee1094b6..01c86e8fbf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java @@ -59,6 +59,8 @@ public class WriteChannelConfigurationTest { Clustering.newBuilder().setFields(ImmutableList.of("Foo", "Bar")).build(); private static final Map LABELS = ImmutableMap.of("test-job-name", "test-write-channel"); + private static final List DECIMAL_TARGET_TYPES = + ImmutableList.of("NUMERIC", "BIGNUMERIC"); private static final WriteChannelConfiguration LOAD_CONFIGURATION_CSV = WriteChannelConfiguration.newBuilder(TABLE_ID) .setCreateDisposition(CREATE_DISPOSITION) @@ -73,6 +75,7 @@ public class WriteChannelConfigurationTest { .setTimePartitioning(TIME_PARTITIONING) .setClustering(CLUSTERING) .setLabels(LABELS) + .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) .build(); private static final DatastoreBackupOptions BACKUP_OPTIONS = @@ -104,6 +107,7 @@ public class WriteChannelConfigurationTest { .setTimePartitioning(TIME_PARTITIONING) .setClustering(CLUSTERING) .setUseAvroLogicalTypes(USERAVROLOGICALTYPES) + .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) .build(); @Test @@ -169,7 +173,8 @@ public void testBuilder() { .setMaxBadRecords(MAX_BAD_RECORDS) .setSchemaUpdateOptions(SCHEMA_UPDATE_OPTIONS) .setSchema(TABLE_SCHEMA) - .setAutodetect(AUTODETECT); + .setAutodetect(AUTODETECT) + .setDecimalTargetTypes(DECIMAL_TARGET_TYPES); WriteChannelConfiguration loadConfigurationCSV = builder.build(); assertEquals(TABLE_ID, loadConfigurationCSV.getDestinationTable()); assertEquals(CREATE_DISPOSITION, loadConfigurationCSV.getCreateDisposition()); @@ -182,6 +187,7 @@ public void testBuilder() { assertEquals(TABLE_SCHEMA, loadConfigurationCSV.getSchema()); assertEquals(SCHEMA_UPDATE_OPTIONS, loadConfigurationCSV.getSchemaUpdateOptions()); assertEquals(AUTODETECT, loadConfigurationCSV.getAutodetect()); + assertEquals(DECIMAL_TARGET_TYPES, loadConfigurationCSV.getDecimalTargetTypes()); builder.setFormatOptions(BACKUP_OPTIONS); WriteChannelConfiguration loadConfigurationBackup = builder.build(); assertEquals(BACKUP_OPTIONS, loadConfigurationBackup.getDatastoreBackupOptions()); @@ -225,5 +231,6 @@ private void compareLoadConfiguration( assertEquals(expected.getClustering(), value.getClustering()); assertEquals(expected.getUseAvroLogicalTypes(), value.getUseAvroLogicalTypes()); assertEquals(expected.getLabels(), value.getLabels()); + assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b733026a4d..c5d577c394 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -4374,6 +4374,32 @@ public void testInsertFromFileWithLabels() assertTrue(bigquery.delete(tableId)); } + @Test + public void testInsertWithDecimalTargetTypes() + throws InterruptedException, IOException, TimeoutException { + String destinationTableName = "test_insert_from_file_table_with_decimal_target_type"; + TableId tableId = TableId.of(DATASET, destinationTableName); + WriteChannelConfiguration configuration = + WriteChannelConfiguration.newBuilder(tableId) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setAutodetect(true) + .setDecimalTargetTypes(ImmutableList.of("STRING", "NUMERIC", "BIGNUMERIC")) + .build(); + TableDataWriteChannel channel = bigquery.writer(configuration); + try { + channel.write(ByteBuffer.wrap("foo".getBytes(StandardCharsets.UTF_8))); + } finally { + channel.close(); + } + Job job = channel.getJob().waitFor(); + LoadJobConfiguration jobConfiguration = job.getConfiguration(); + assertNull(job.getStatus().getError()); + assertEquals( + ImmutableList.of("STRING", "NUMERIC", "BIGNUMERIC"), + jobConfiguration.getDecimalTargetTypes()); + assertTrue(bigquery.delete(tableId)); + } + @Test public void testLocation() throws Exception { String location = "EU"; From 6e2f8e73d42bbc97e1e1e49c630535a96c986bf5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Jul 2022 18:22:11 +0200 Subject: [PATCH 0835/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.0 (#2168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) | `3.3.0` -> `3.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/compatibility-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/confidence-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 23ea3191ec..646333fbd5 100644 --- a/pom.xml +++ b/pom.xml @@ -206,7 +206,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.3.0 + 3.4.0 From db70796551228f346954caafe342e34a2cd46961 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Jul 2022 18:24:12 +0200 Subject: [PATCH 0836/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3 (#2172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-deploy-plugin](https://maven.apache.org/plugins/) ([source](https://togithub.com/apache/maven-deploy-plugin)) | `2.8.2` -> `3.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/compatibility-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/confidence-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f15d0dc6e2..54a9546692 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.0.0 true diff --git a/samples/pom.xml b/samples/pom.xml index cb1ba78020..f2bb76550c 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.0.0 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 89b534ac84..9fd6254f36 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.0.0 true From d605b8149954e79c05461630915b674e11793889 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:24:17 -0400 Subject: [PATCH 0837/2268] fix(java): make field accessible to address Java 17 issue with arrow (#2165) * fix(java): troubleshoot Java 17 issue with arrow and exclude nightly tests from presubmits --- .kokoro/build.sh | 8 ++++---- google-cloud-bigquery/pom.xml | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 089ca0e23e..4b1c5de2b3 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -81,13 +81,13 @@ nightly-it) RETURN_CODE=$? ;; graalvm) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; graalvm17) - # Run Unit and Integration Tests with Native Image. Skip Arrow tests until https://github.com/googleapis/java-bigquery/issues/2060 is fixed. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test "-Dtest=!com.google.cloud.bigquery.it.ITBigQueryTest#testBQResultSetPaginationSlowQuery+testReadAPIConnectionMultiClose+testReadAPIIterationAndOrder, !com.google.cloud.bigquery.it.ITNightlyBigQueryTest#testIterateAndOrder+testMultipleRuns+testIterateAndOrderDefaultConnSettings, IT*, *ClientTest" + # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; samples) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3e2982dcb1..a543ca7faa 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -204,4 +204,25 @@ + + + + java17 + + [17,) + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.nio=ALL-UNNAMED + + + + + + + From 8d832233e5b25cb8344db5b0d68b455a2a42e9ab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 11:21:54 +0530 Subject: [PATCH 0838/2268] chore(main): release 2.14.0 (#2162) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 707746e0cc..cc1a4dcbcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [2.14.0](https://github.com/googleapis/java-bigquery/compare/v2.13.8...v2.14.0) (2022-07-22) + + +### Features + +* Add decimal target type ([#2166](https://github.com/googleapis/java-bigquery/issues/2166)) ([ebbd8f5](https://github.com/googleapis/java-bigquery/commit/ebbd8f52853d3c0ca918a47d826474cc5825a58a)) +* **bigquery:** enable use of GEOGRAPHY query params ([#2158](https://github.com/googleapis/java-bigquery/issues/2158)) ([b19ad76](https://github.com/googleapis/java-bigquery/commit/b19ad767a53a9bd5d14b4cb36716cbb1c7b44ed6)) + + +### Bug Fixes + +* Add query dryRun logic to get the schema when null schema is returned from the backend ([#2106](https://github.com/googleapis/java-bigquery/issues/2106)) ([c98d22b](https://github.com/googleapis/java-bigquery/commit/c98d22b2b4f45e20d7d0666c5342cdbfadd30bde)) +* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-bigquery/issues/1485)) ([#2164](https://github.com/googleapis/java-bigquery/issues/2164)) ([e18b9f8](https://github.com/googleapis/java-bigquery/commit/e18b9f8b4d2f194577b1710ad64710fe0f3d88d9)) +* **java:** make field accessible to address Java 17 issue with arrow ([#2165](https://github.com/googleapis/java-bigquery/issues/2165)) ([d605b81](https://github.com/googleapis/java-bigquery/commit/d605b8149954e79c05461630915b674e11793889)) + + +### Dependencies + +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#2160](https://github.com/googleapis/java-bigquery/issues/2160)) ([970135b](https://github.com/googleapis/java-bigquery/commit/970135bec33b831925476855da9a84c34311068d)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#2161](https://github.com/googleapis/java-bigquery/issues/2161)) ([3507bf7](https://github.com/googleapis/java-bigquery/commit/3507bf7c9fc2aef299d06d9771cfcc06e3080b87)) + ## [2.13.8](https://github.com/googleapis/java-bigquery/compare/v2.13.7...v2.13.8) (2022-07-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 54a9546692..79c2e8eff5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.13.9-SNAPSHOT + 2.14.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a543ca7faa..6b1be392da 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.13.9-SNAPSHOT + 2.14.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.13.9-SNAPSHOT + 2.14.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 646333fbd5..4c8da3154b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.13.9-SNAPSHOT + 2.14.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.13.9-SNAPSHOT + 2.14.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e277d343b3..b23481f15a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.13.9-SNAPSHOT + 2.14.0 diff --git a/versions.txt b/versions.txt index ca1695517b..0ac016a536 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.13.8:2.13.9-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.0:2.14.0 \ No newline at end of file From 64789a486236a47fe3d6f35155a2989e5be0908a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:12:26 +0530 Subject: [PATCH 0839/2268] chore(main): release 2.14.1-SNAPSHOT (#2179) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 79c2e8eff5..97a4d0e78e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.0 + 2.14.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6b1be392da..1ac4c55623 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.0 + 2.14.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.0 + 2.14.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4c8da3154b..ff9518d21d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.0 + 2.14.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.0 + 2.14.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b23481f15a..ba84efd896 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.0 + 2.14.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0ac016a536..e9f0b3c152 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.0:2.14.0 \ No newline at end of file +google-cloud-bigquery:2.14.0:2.14.1-SNAPSHOT \ No newline at end of file From e3515dfce98c73711fdb16e280f9c78399cef4b7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Jul 2022 06:43:37 +0200 Subject: [PATCH 0840/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.2 (#2181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.2 * 🦉 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 --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b3ff9d2e5..d2ee7a3f34 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.13.8' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.13.8" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.0" ``` ## Authentication diff --git a/pom.xml b/pom.xml index ff9518d21d..8de80eb66c 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.2 From c0fd4c6fa11b7d86d6c7d7cfd952a45244fdb713 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 27 Jul 2022 08:45:47 -0400 Subject: [PATCH 0841/2268] ci: run ITNightlyBigqueryTest with native image compilation as nightly job (#2180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: run ITNightlyBigqueryTest with native image compilation as nightly job * fix typo * 🦉 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 --- .kokoro/build.sh | 8 ++++++ .kokoro/nightly/graalvm-native-17.cfg | 38 +++++++++++++++++++++++++++ .kokoro/nightly/graalvm-native.cfg | 38 +++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .kokoro/nightly/graalvm-native-17.cfg create mode 100644 .kokoro/nightly/graalvm-native.cfg diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 4b1c5de2b3..6ede96a218 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -90,6 +90,14 @@ graalvm17) mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; +nightly-graalvm) + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; +nightly-graalvm17) + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest -Pnative -Penable-integration-tests test + RETURN_CODE=$? + ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. diff --git a/.kokoro/nightly/graalvm-native-17.cfg b/.kokoro/nightly/graalvm-native-17.cfg new file mode 100644 index 0000000000..15ed86292b --- /dev/null +++ b/.kokoro/nightly/graalvm-native-17.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" +} + +env_vars: { + key: "JOB_TYPE" + value: "nightly-graalvm17" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} \ No newline at end of file diff --git a/.kokoro/nightly/graalvm-native.cfg b/.kokoro/nightly/graalvm-native.cfg new file mode 100644 index 0000000000..57c1e35116 --- /dev/null +++ b/.kokoro/nightly/graalvm-native.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" +} + +env_vars: { + key: "JOB_TYPE" + value: "nightly-graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} From f78193da8c37b5f53538919c7505006d39cd99bb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Jul 2022 20:56:13 +0200 Subject: [PATCH 0842/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.10.0 (#2182) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.9.0` -> `2.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.0/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.0/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.10.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2100-httpsgithubcomgoogleapisjava-bigtablecomparev290v2100-2022-07-26) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.9.0...v2.10.0) ##### Features - add response protos ([#​1246](https://togithub.com/googleapis/java-bigtable/issues/1246)) ([52d59ce](https://togithub.com/googleapis/java-bigtable/commit/52d59ce18fb5536a17a5cb59da39e563e4afede4)) - add response_params proto to clients ([#​1303](https://togithub.com/googleapis/java-bigtable/issues/1303)) ([93edfe1](https://togithub.com/googleapis/java-bigtable/commit/93edfe1e43dcfefda6bba3e9ee53ed80eaf2e5c2)) - add storage utilization gib per node for autoscaling ([#​1317](https://togithub.com/googleapis/java-bigtable/issues/1317)) ([5282589](https://togithub.com/googleapis/java-bigtable/commit/52825891af0e4ec2dd76c0c6fa1379a98a77a08f)) - use PingAndWarm request for channel priming ([#​1179](https://togithub.com/googleapis/java-bigtable/issues/1179)) ([6629821](https://togithub.com/googleapis/java-bigtable/commit/6629821ea3200d3a5b93c9d45aab6d57485fcebf)) ##### Bug Fixes - enable integration test for google-cloud-bigtable-stats ([#​1311](https://togithub.com/googleapis/java-bigtable/issues/1311)) ([7c77879](https://togithub.com/googleapis/java-bigtable/commit/7c7787998b164ceb55472c0d06c083a835e5d000)) - fix race condition in BuiltinMetricsTracer ([#​1320](https://togithub.com/googleapis/java-bigtable/issues/1320)) ([644454a](https://togithub.com/googleapis/java-bigtable/commit/644454a9723da359677052b7a4b9201e91e9a78a)) - ignore repackaged files to fix clirr ([#​1300](https://togithub.com/googleapis/java-bigtable/issues/1300)) ([99b67ba](https://togithub.com/googleapis/java-bigtable/commit/99b67ba5b1625686ac7802a6e40dafc2edceade0)) ##### Dependencies - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#​1306](https://togithub.com/googleapis/java-bigtable/issues/1306)) ([ddae354](https://togithub.com/googleapis/java-bigtable/commit/ddae3540fd68e8f79d94d49c96c5685e1bad2f66)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#​1307](https://togithub.com/googleapis/java-bigtable/issues/1307)) ([c0740fe](https://togithub.com/googleapis/java-bigtable/commit/c0740fe30c5cd2bdf6dedf901e2fdb9a84ce64a1))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8e2ca0fdae..3ed195684a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.9.0 + 2.10.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ba84efd896..bd3b12553d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.9.0 + 2.10.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9fd6254f36..ac0b10c3e0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.9.0 + 2.10.0 test From f8325cff22af3f087b23d6376ab96e78648efd00 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Jul 2022 20:56:26 +0200 Subject: [PATCH 0843/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 (#2183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.junit.vintage:junit-vintage-engine](https://junit.org/junit5/) ([source](https://togithub.com/junit-team/junit5)) | `5.8.2` -> `5.9.0` | [![age](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.0/compatibility-slim/5.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.0/confidence-slim/5.8.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 8fa62b597e..702f489522 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.8.2 + 5.9.0 test From 7033029b496a9fae854116c7a5220b37b4ab3175 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 19:26:14 +0000 Subject: [PATCH 0844/2268] chore(main): release 2.14.1 (#2184) :robot: I have created a release *beep* *boop* --- ## [2.14.1](https://github.com/googleapis/java-bigquery/compare/v2.14.0...v2.14.1) (2022-07-27) ### Dependencies * update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#2183](https://github.com/googleapis/java-bigquery/issues/2183)) ([f8325cf](https://github.com/googleapis/java-bigquery/commit/f8325cff22af3f087b23d6376ab96e78648efd00)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc1a4dcbcf..06758ff660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.14.1](https://github.com/googleapis/java-bigquery/compare/v2.14.0...v2.14.1) (2022-07-27) + + +### Dependencies + +* update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#2183](https://github.com/googleapis/java-bigquery/issues/2183)) ([f8325cf](https://github.com/googleapis/java-bigquery/commit/f8325cff22af3f087b23d6376ab96e78648efd00)) + ## [2.14.0](https://github.com/googleapis/java-bigquery/compare/v2.13.8...v2.14.0) (2022-07-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 97a4d0e78e..33ce866ec2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.1-SNAPSHOT + 2.14.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1ac4c55623..cb2b936591 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.1-SNAPSHOT + 2.14.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.1-SNAPSHOT + 2.14.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8de80eb66c..a94e760934 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.1-SNAPSHOT + 2.14.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.1-SNAPSHOT + 2.14.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bd3b12553d..111251482c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.1-SNAPSHOT + 2.14.1 diff --git a/versions.txt b/versions.txt index e9f0b3c152..3cd4d62df8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.0:2.14.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.1:2.14.1 \ No newline at end of file From 6231be75a537f6a2077c5f6792e4ce492e22ffe8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 19:54:21 +0000 Subject: [PATCH 0845/2268] chore(main): release 2.14.2-SNAPSHOT (#2185) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 33ce866ec2..355cbe91e1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.1 + 2.14.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cb2b936591..7def979092 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.1 + 2.14.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.1 + 2.14.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a94e760934..5270c9b18d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.1 + 2.14.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.1 + 2.14.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 111251482c..6f5cb8e93c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.1 + 2.14.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3cd4d62df8..2909a68f59 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.1:2.14.1 \ No newline at end of file +google-cloud-bigquery:2.14.1:2.14.2-SNAPSHOT \ No newline at end of file From c1ca09e41bb9d4b070e241437b46d717e66f4944 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 4 Aug 2022 17:39:21 -0400 Subject: [PATCH 0846/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220716-2.0.0 (#2202) deps: update dependency org.threeten:threeten-extra to v1.7.1 deps: update dependency com.google.cloud:google-cloud-storage to 2.11.0 deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to 1.9.1 deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to 2.18.0 build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.3 deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3 --- README.md | 4 ++-- .../cloud/bigquery/it/ITBigQueryTest.java | 4 ++++ pom.xml | 18 +++++++++--------- .../bigquery/UpdateModelDescriptionIT.java | 4 ++++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d2ee7a3f34..f1a50ca427 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.1" ``` ## Authentication diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c5d577c394..20afb0b29e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -162,6 +162,7 @@ import java.util.logging.Logger; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; @@ -2008,6 +2009,9 @@ public void testListPageWithStartIndex() { assertEquals(300_000L, totalRows); } + // BQML recently changed the validation behaviour of model update. + // Ignoring this test until a fix for the same is applied to BQ library. + @Ignore @Test public void testModelLifecycle() throws InterruptedException { diff --git a/pom.xml b/pom.xml index 5270c9b18d..8167989189 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.2 + 1.5.3 @@ -53,8 +53,8 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220611-1.32.1 - 2.13.0 + v2-rev20220716-2.0.0 + 3.0.1 8.0.0 @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.14.2 + 2.18.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.4 + 1.9.1 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.8.4 + 1.9.1 pom import @@ -138,14 +138,14 @@ org.threeten threeten-extra - 1.7.0 + 1.7.1 org.threeten threeten-extra - 1.7.0 + 1.7.1 @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.9.0 + 2.11.0 test diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java index 156e83d170..854e2a2cd8 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java @@ -27,8 +27,12 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +// BQML recently changed the validation behaviour of model update. +// Ignoring this test until a fix for the same is applied to BQ library. +@Ignore public class UpdateModelDescriptionIT { private final Logger log = Logger.getLogger(this.getClass().getName()); From 4bd4539be4aa2ced4eeefde4b48fdbaa5faf5801 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 00:13:26 +0200 Subject: [PATCH 0847/2268] deps: update dependency com.google.code.gson:gson to v2.9.1 (#2190) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8167989189..7d0cd19a81 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ com.google.code.gson gson - 2.9.0 + 2.9.1 From 45be00165846010afd43e184d94b81d4254f5cd5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 00:16:13 +0200 Subject: [PATCH 0848/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.11.1 (#2194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.11.0` -> `2.11.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.11.1/compatibility-slim/2.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.11.1/confidence-slim/2.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.11.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2111-httpsgithubcomgoogleapisjava-storagecomparev2110v2111-2022-08-04) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.11.0...v2.11.1) ##### Dependencies - update dependency com.google.cloud:google-cloud-pubsub to v1.120.9 ([#​1537](https://togithub.com/googleapis/java-storage/issues/1537)) ([ae17737](https://togithub.com/googleapis/java-storage/commit/ae17737342e262f7afd404e4c758a7fbf5530da5))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d0cd19a81..28ecba7916 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.11.0 + 2.11.1 test From 3ec5ef987425315a0dc4d2ab9a4dc162cf000156 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 00:18:18 +0200 Subject: [PATCH 0849/2268] deps: update arrow.version to v9 (major) (#2201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `8.0.0` -> `9.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/9.0.0/compatibility-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/9.0.0/confidence-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `8.0.0` -> `9.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/9.0.0/compatibility-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/9.0.0/confidence-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `8.0.0` -> `9.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/9.0.0/compatibility-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/9.0.0/confidence-slim/8.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    apache/arrow ### [`v9.0.0`](https://togithub.com/apache/arrow/compare/2b7143b9596853efc98f9c4da678e08551381c3a...8cac69c809e2ae9d4ba9c10c7b22869c1fd11323)
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28ecba7916..70b2a28895 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20220716-2.0.0 3.0.1 - 8.0.0 + 9.0.0
    From 1848c2621d1983f2ec246c854fb86a0fc272cf77 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 00:22:21 +0200 Subject: [PATCH 0850/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 (#2193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.13.3` -> `2.14.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/compatibility-slim/2.13.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.1/confidence-slim/2.13.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f1a50ca427..70c72fee51 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.13.3 + 2.14.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3ed195684a..eb4f5988a7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.13.3 + 2.14.1 From f26f3b8ed732fe76d685d90af69b0bad8a0c3557 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 00:38:13 +0200 Subject: [PATCH 0851/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.10.1 (#2196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.10.0` -> `2.10.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.1/compatibility-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.10.1/confidence-slim/2.10.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.10.1`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2101-httpsgithubcomgoogleapisjava-bigtablecomparev2100v2101-2022-08-01) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.10.0...v2.10.1) ##### Bug Fixes - retry rst stream in mutations ([#​1327](https://togithub.com/googleapis/java-bigtable/issues/1327)) ([1a5b3a2](https://togithub.com/googleapis/java-bigtable/commit/1a5b3a215b5388678241cadec26a962a512157ac)) ##### Dependencies - update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#​1323](https://togithub.com/googleapis/java-bigtable/issues/1323)) ([7655747](https://togithub.com/googleapis/java-bigtable/commit/76557476744a6404b9df30c97c59f0a7e38a1ed8))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index eb4f5988a7..9b6906a826 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.10.0 + 2.10.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6f5cb8e93c..2423b4661a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.10.0 + 2.10.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ac0b10c3e0..95105f7556 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.10.0 + 2.10.1 test From 7c45aa5bf78e2c15534cdd6d3d9af572ea871e57 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:40:12 +0000 Subject: [PATCH 0852/2268] docs(owlbot-java): explaining why not using formatter in pom.xml (#1511) (#2195) Fixes #1502 Source-Link: https://github.com/googleapis/synthtool/commit/26ea255791c019594c20d88a69b4f9fb8c00f13e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:7a9a7eb50ca2af5bfffab3abd2f38d408735c990a74bacf9b7fde2af0a086a0b --- .github/.OwlBot.lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6610882f83..a20fd63005 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9 -# created: 2022-07-18T21:44:23.94208526Z + digest: sha256:7a9a7eb50ca2af5bfffab3abd2f38d408735c990a74bacf9b7fde2af0a086a0b +# created: 2022-08-01T15:27:14.757266067Z From 6e5fcdcef268b81d04b5a0d29f9d524d2e39cb6c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 23:40:41 +0000 Subject: [PATCH 0853/2268] chore(main): release 2.14.2 (#2204) :robot: I have created a release *beep* *boop* --- ## [2.14.2](https://github.com/googleapis/java-bigquery/compare/v2.14.1...v2.14.2) (2022-08-04) ### Dependencies * update arrow.version to v9 (major) ([#2201](https://github.com/googleapis/java-bigquery/issues/2201)) ([3ec5ef9](https://github.com/googleapis/java-bigquery/commit/3ec5ef987425315a0dc4d2ab9a4dc162cf000156)) * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220716-2.0.0 ([#2202](https://github.com/googleapis/java-bigquery/issues/2202)) ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) * update dependency com.google.cloud:google-cloud-bigquerystorage-bom to 2.18.0 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) * update dependency com.google.cloud:google-cloud-datacatalog-bom to 1.9.1 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) * update dependency com.google.cloud:google-cloud-storage to 2.11.0 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) * update dependency com.google.cloud:google-cloud-storage to v2.11.1 ([#2194](https://github.com/googleapis/java-bigquery/issues/2194)) ([45be001](https://github.com/googleapis/java-bigquery/commit/45be00165846010afd43e184d94b81d4254f5cd5)) * update dependency com.google.code.gson:gson to v2.9.1 ([#2190](https://github.com/googleapis/java-bigquery/issues/2190)) ([4bd4539](https://github.com/googleapis/java-bigquery/commit/4bd4539be4aa2ced4eeefde4b48fdbaa5faf5801)) * update dependency org.threeten:threeten-extra to v1.7.1 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) ### Documentation * **owlbot-java:** explaining why not using formatter in pom.xml ([#1511](https://github.com/googleapis/java-bigquery/issues/1511)) ([#2195](https://github.com/googleapis/java-bigquery/issues/2195)) ([7c45aa5](https://github.com/googleapis/java-bigquery/commit/7c45aa5bf78e2c15534cdd6d3d9af572ea871e57)), closes [#1502](https://github.com/googleapis/java-bigquery/issues/1502) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06758ff660..0189c27707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.14.2](https://github.com/googleapis/java-bigquery/compare/v2.14.1...v2.14.2) (2022-08-04) + + +### Dependencies + +* update arrow.version to v9 (major) ([#2201](https://github.com/googleapis/java-bigquery/issues/2201)) ([3ec5ef9](https://github.com/googleapis/java-bigquery/commit/3ec5ef987425315a0dc4d2ab9a4dc162cf000156)) +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220716-2.0.0 ([#2202](https://github.com/googleapis/java-bigquery/issues/2202)) ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) +* update dependency com.google.cloud:google-cloud-bigquerystorage-bom to 2.18.0 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) +* update dependency com.google.cloud:google-cloud-datacatalog-bom to 1.9.1 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) +* update dependency com.google.cloud:google-cloud-storage to 2.11.0 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) +* update dependency com.google.cloud:google-cloud-storage to v2.11.1 ([#2194](https://github.com/googleapis/java-bigquery/issues/2194)) ([45be001](https://github.com/googleapis/java-bigquery/commit/45be00165846010afd43e184d94b81d4254f5cd5)) +* update dependency com.google.code.gson:gson to v2.9.1 ([#2190](https://github.com/googleapis/java-bigquery/issues/2190)) ([4bd4539](https://github.com/googleapis/java-bigquery/commit/4bd4539be4aa2ced4eeefde4b48fdbaa5faf5801)) +* update dependency org.threeten:threeten-extra to v1.7.1 ([c1ca09e](https://github.com/googleapis/java-bigquery/commit/c1ca09e41bb9d4b070e241437b46d717e66f4944)) + + +### Documentation + +* **owlbot-java:** explaining why not using formatter in pom.xml ([#1511](https://github.com/googleapis/java-bigquery/issues/1511)) ([#2195](https://github.com/googleapis/java-bigquery/issues/2195)) ([7c45aa5](https://github.com/googleapis/java-bigquery/commit/7c45aa5bf78e2c15534cdd6d3d9af572ea871e57)), closes [#1502](https://github.com/googleapis/java-bigquery/issues/1502) + ## [2.14.1](https://github.com/googleapis/java-bigquery/compare/v2.14.0...v2.14.1) (2022-07-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 355cbe91e1..12a4399e64 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.2-SNAPSHOT + 2.14.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7def979092..320521f71e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.2-SNAPSHOT + 2.14.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.2-SNAPSHOT + 2.14.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 70b2a28895..683a518cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.2-SNAPSHOT + 2.14.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.2-SNAPSHOT + 2.14.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2423b4661a..41d65f801e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.2-SNAPSHOT + 2.14.2 diff --git a/versions.txt b/versions.txt index 2909a68f59..4ae351263f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.1:2.14.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.2:2.14.2 \ No newline at end of file From a2df3165811836f48b7d9982427c87bed7de90b4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 5 Aug 2022 00:08:39 +0000 Subject: [PATCH 0854/2268] chore(main): release 2.14.3-SNAPSHOT (#2205) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 12a4399e64..1a342b7013 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.2 + 2.14.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 320521f71e..508d99db7f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.2 + 2.14.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.2 + 2.14.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 683a518cf3..d2a47f2a53 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.2 + 2.14.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.2 + 2.14.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 41d65f801e..a36a554c8e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.2 + 2.14.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4ae351263f..e8cb68fa97 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.2:2.14.2 \ No newline at end of file +google-cloud-bigquery:2.14.2:2.14.3-SNAPSHOT \ No newline at end of file From 5165e2b3d4001d58daa2a60b553926d938848ee6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 16:44:46 +0200 Subject: [PATCH 0855/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220730-2.0.0 (#2208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220730-2.0.0 * 🦉 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 --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 70c72fee51..246d00af3c 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.2" ``` ## Authentication diff --git a/pom.xml b/pom.xml index d2a47f2a53..35f89308b8 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220716-2.0.0 + v2-rev20220730-2.0.0 3.0.1 9.0.0 From da5389d78c5136f01c16d23f4f7ec54c6b4f3010 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 16:45:08 +0200 Subject: [PATCH 0856/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.11.2 (#2207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.11.2 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35f89308b8..3d2e159ae5 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.11.1 + 2.11.2 test From 9317037f9e3917ee584fc237296741a60800a5f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 5 Aug 2022 16:45:29 +0200 Subject: [PATCH 0857/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.2 (#2206) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 246d00af3c..1a98787f38 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.1 + 2.14.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9b6906a826..e67bbb9fd3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.1 + 2.14.2 From 80c1ef55de58d2a1343a903594c82954959137f0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 5 Aug 2022 15:10:31 +0000 Subject: [PATCH 0858/2268] chore(main): release 2.14.3 (#2209) :robot: I have created a release *beep* *boop* --- ## [2.14.3](https://github.com/googleapis/java-bigquery/compare/v2.14.2...v2.14.3) (2022-08-05) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220730-2.0.0 ([#2208](https://github.com/googleapis/java-bigquery/issues/2208)) ([5165e2b](https://github.com/googleapis/java-bigquery/commit/5165e2b3d4001d58daa2a60b553926d938848ee6)) * update dependency com.google.cloud:google-cloud-storage to v2.11.2 ([#2207](https://github.com/googleapis/java-bigquery/issues/2207)) ([da5389d](https://github.com/googleapis/java-bigquery/commit/da5389d78c5136f01c16d23f4f7ec54c6b4f3010)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0189c27707..7fe651cdaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.14.3](https://github.com/googleapis/java-bigquery/compare/v2.14.2...v2.14.3) (2022-08-05) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220730-2.0.0 ([#2208](https://github.com/googleapis/java-bigquery/issues/2208)) ([5165e2b](https://github.com/googleapis/java-bigquery/commit/5165e2b3d4001d58daa2a60b553926d938848ee6)) +* update dependency com.google.cloud:google-cloud-storage to v2.11.2 ([#2207](https://github.com/googleapis/java-bigquery/issues/2207)) ([da5389d](https://github.com/googleapis/java-bigquery/commit/da5389d78c5136f01c16d23f4f7ec54c6b4f3010)) + ## [2.14.2](https://github.com/googleapis/java-bigquery/compare/v2.14.1...v2.14.2) (2022-08-04) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1a342b7013..36ce28bc67 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.3-SNAPSHOT + 2.14.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 508d99db7f..123c0ceed7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.3-SNAPSHOT + 2.14.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.3-SNAPSHOT + 2.14.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d2e159ae5..739d1cab7d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.3-SNAPSHOT + 2.14.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.3-SNAPSHOT + 2.14.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a36a554c8e..ef0d9efd7c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.3-SNAPSHOT + 2.14.3 diff --git a/versions.txt b/versions.txt index e8cb68fa97..4468b814c7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.2:2.14.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.3:2.14.3 \ No newline at end of file From 65a970abf6530c98f40b6ff79e1e0370c40bae64 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 5 Aug 2022 15:36:12 +0000 Subject: [PATCH 0859/2268] chore(main): release 2.14.4-SNAPSHOT (#2210) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 36ce28bc67..790bac459e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.3 + 2.14.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 123c0ceed7..cec2c1252a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.3 + 2.14.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.3 + 2.14.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 739d1cab7d..c851e8b865 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.3 + 2.14.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.3 + 2.14.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ef0d9efd7c..ba38f3bc70 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.3 + 2.14.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4468b814c7..2216e7cc31 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.3:2.14.3 \ No newline at end of file +google-cloud-bigquery:2.14.3:2.14.4-SNAPSHOT \ No newline at end of file From 0ad720c449e24024998106e71a90da1a6cc69e1f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 6 Aug 2022 05:04:20 +0200 Subject: [PATCH 0860/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 (#2211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.2` -> `2.14.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.3/compatibility-slim/2.14.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.3/confidence-slim/2.14.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a98787f38..d01ea50599 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.2 + 2.14.3 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.3" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e67bbb9fd3..2b70a39d5f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.2 + 2.14.3 From 518127cbb4ef6b7f80a7fa418c2aa9112faf1d09 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 6 Aug 2022 05:06:15 +0200 Subject: [PATCH 0861/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.19.0 (#2212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.18.0` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.19.0/compatibility-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.19.0/confidence-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c851e8b865..1777fa5c6a 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.18.0 + 2.19.0 pom import From a293ab56c5455cef8b9731784ddd78cc6162dca8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 8 Aug 2022 22:09:31 +0200 Subject: [PATCH 0862/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.11.3 (#2213) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1777fa5c6a..8382fd3a64 100644 --- a/pom.xml +++ b/pom.xml @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.11.2 + 2.11.3 test From 783f8c3b0e84b01e05569b5ce0bdb0113c68f290 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 8 Aug 2022 22:09:50 +0200 Subject: [PATCH 0863/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.10.2 (#2214) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2b70a39d5f..cb313b9579 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.10.1 + 2.10.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ba38f3bc70..5fae59d528 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.10.1 + 2.10.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 95105f7556..2ba49f9c19 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.10.1 + 2.10.2 test From a281bdf3556a2f302599ed5915fc161e5115590a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 09:21:01 +0530 Subject: [PATCH 0864/2268] chore(main): release 2.14.4 (#2215) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fe651cdaa..3d0de8ea52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.14.4](https://github.com/googleapis/java-bigquery/compare/v2.14.3...v2.14.4) (2022-08-08) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-storage to v2.11.3 ([#2213](https://github.com/googleapis/java-bigquery/issues/2213)) ([a293ab5](https://github.com/googleapis/java-bigquery/commit/a293ab56c5455cef8b9731784ddd78cc6162dca8)) + ## [2.14.3](https://github.com/googleapis/java-bigquery/compare/v2.14.2...v2.14.3) (2022-08-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 790bac459e..7f57a4bdf1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.4-SNAPSHOT + 2.14.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cec2c1252a..06aaee128f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.4-SNAPSHOT + 2.14.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.4-SNAPSHOT + 2.14.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8382fd3a64..fd5104fd6f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.4-SNAPSHOT + 2.14.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.4-SNAPSHOT + 2.14.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5fae59d528..787616e072 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.4-SNAPSHOT + 2.14.4 diff --git a/versions.txt b/versions.txt index 2216e7cc31..99885e5150 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.3:2.14.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.4:2.14.4 \ No newline at end of file From acd2d574a91b997868d0fc7b8931074573e6ff14 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 04:16:38 +0000 Subject: [PATCH 0865/2268] chore(main): release 2.14.5-SNAPSHOT (#2216) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7f57a4bdf1..84eed2b9df 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.4 + 2.14.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 06aaee128f..426a03af04 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.4 + 2.14.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.4 + 2.14.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index fd5104fd6f..e8d796acb6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.4 + 2.14.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.4 + 2.14.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 787616e072..e80ee170e4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.4 + 2.14.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index 99885e5150..1479b973ee 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.4:2.14.4 \ No newline at end of file +google-cloud-bigquery:2.14.4:2.14.5-SNAPSHOT \ No newline at end of file From 3ab4e7e61c033366e96583f32908a0bb44811890 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Aug 2022 15:11:02 +0200 Subject: [PATCH 0866/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.19.1 (#2218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.19.1 * 🦉 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 --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d01ea50599..e01960a1ab 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.4' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.4" ``` ## Authentication diff --git a/pom.xml b/pom.xml index e8d796acb6..931f4fbb45 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.19.0 + 2.19.1 pom import From 76964dc7fdecfac30c75e3e4db858d1b61082865 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 10 Aug 2022 15:21:07 +0200 Subject: [PATCH 0867/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.4 (#2217) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.4 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e01960a1ab..0d76dbd808 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.3 + 2.14.4 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cb313b9579..287cc27969 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.3 + 2.14.4 From 05d1de19488c45ceb202824d9ce2ae0fd290d930 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Aug 2022 14:57:42 +0200 Subject: [PATCH 0868/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220806-2.0.0 (#2223) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 931f4fbb45..4845d8f64b 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220730-2.0.0 + v2-rev20220806-2.0.0 3.0.1 9.0.0 From bf61d6686c51109d4246264de6277a6439a16c14 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:44:11 +0000 Subject: [PATCH 0869/2268] chore(main): release 2.14.5 (#2224) :robot: I have created a release *beep* *boop* --- ## [2.14.5](https://github.com/googleapis/java-bigquery/compare/v2.14.4...v2.14.5) (2022-08-12) ### Dependencies * update dependency com.google.apis:google-api-services-bigquery to v2-rev20220806-2.0.0 ([#2223](https://github.com/googleapis/java-bigquery/issues/2223)) ([05d1de1](https://github.com/googleapis/java-bigquery/commit/05d1de19488c45ceb202824d9ce2ae0fd290d930)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d0de8ea52..126677c263 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.14.5](https://github.com/googleapis/java-bigquery/compare/v2.14.4...v2.14.5) (2022-08-12) + + +### Dependencies + +* update dependency com.google.apis:google-api-services-bigquery to v2-rev20220806-2.0.0 ([#2223](https://github.com/googleapis/java-bigquery/issues/2223)) ([05d1de1](https://github.com/googleapis/java-bigquery/commit/05d1de19488c45ceb202824d9ce2ae0fd290d930)) + ## [2.14.4](https://github.com/googleapis/java-bigquery/compare/v2.14.3...v2.14.4) (2022-08-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 84eed2b9df..29d479f6e0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.5-SNAPSHOT + 2.14.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 426a03af04..d90845125d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.5-SNAPSHOT + 2.14.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.5-SNAPSHOT + 2.14.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4845d8f64b..3d6188e653 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.5-SNAPSHOT + 2.14.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.5-SNAPSHOT + 2.14.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e80ee170e4..86aaa0aa99 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.5-SNAPSHOT + 2.14.5 diff --git a/versions.txt b/versions.txt index 1479b973ee..e881c4481e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.4:2.14.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.5:2.14.5 \ No newline at end of file From a760478adcfa3f1589d1bc95b79b7b675d5bcbd5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 14:12:13 +0000 Subject: [PATCH 0870/2268] chore(main): release 2.14.6-SNAPSHOT (#2225) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 29d479f6e0..5001c96728 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.5 + 2.14.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d90845125d..f519c44f2d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.5 + 2.14.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.5 + 2.14.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d6188e653..e988c5d5dd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.5 + 2.14.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.5 + 2.14.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 86aaa0aa99..cf7ace334a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.5 + 2.14.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index e881c4481e..61f2ae59ca 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.5:2.14.5 \ No newline at end of file +google-cloud-bigquery:2.14.5:2.14.6-SNAPSHOT \ No newline at end of file From 42b4a35562d1132b87beefa009e3fafb2fcff4e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Aug 2022 17:16:23 +0200 Subject: [PATCH 0871/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.0 (#2219) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 287cc27969..03370e2eaa 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.4.0 + 2.5.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cf7ace334a..b8336773cf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.4.0 + 2.5.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2ba49f9c19..f07c2b233d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.4.0 + 2.5.0 test From d31e2ca76fe86bff87e5a184a2b7aaa30674ad01 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Aug 2022 17:16:43 +0200 Subject: [PATCH 0872/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.10.3 (#2220) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 03370e2eaa..82cbeceb85 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.10.2 + 2.10.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b8336773cf..18996e0c47 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.10.2 + 2.10.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f07c2b233d..1711a5a707 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.10.2 + 2.10.3 test From 3292cddeec7c83fa198a96d80a35c13b003a26c8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Aug 2022 17:17:05 +0200 Subject: [PATCH 0873/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.2 (#2221) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e988c5d5dd..af5c859838 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.1 + 1.9.2 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.1 + 1.9.2 pom import From dba9a82afc10450aed5cfacbe5ce078940edeff6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 12 Aug 2022 17:48:10 +0200 Subject: [PATCH 0874/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.5 (#2226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.4` -> `2.14.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.5/compatibility-slim/2.14.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.5/confidence-slim/2.14.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.14.5`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2145-httpsgithubcomgoogleapisjava-bigquerycomparev2144v2145-2022-08-12) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.14.4...v2.14.5) ##### Dependencies - update dependency com.google.apis:google-api-services-bigquery to v2-rev20220806-2.0.0 ([#​2223](https://togithub.com/googleapis/java-bigquery/issues/2223)) ([05d1de1](https://togithub.com/googleapis/java-bigquery/commit/05d1de19488c45ceb202824d9ce2ae0fd290d930))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0d76dbd808..bc481d2de1 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.4 + 2.14.5 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.5' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.5" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 82cbeceb85..00b02fac60 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.4 + 2.14.5 From 9484f958025a1eee24308ff952494b0866a6a790 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 15:50:12 +0000 Subject: [PATCH 0875/2268] chore(main): release 2.14.6 (#2227) :robot: I have created a release *beep* *boop* --- ## [2.14.6](https://github.com/googleapis/java-bigquery/compare/v2.14.5...v2.14.6) (2022-08-12) ### Dependencies * update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.2 ([#2221](https://github.com/googleapis/java-bigquery/issues/2221)) ([3292cdd](https://github.com/googleapis/java-bigquery/commit/3292cddeec7c83fa198a96d80a35c13b003a26c8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 126677c263..68cff6cc02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.14.6](https://github.com/googleapis/java-bigquery/compare/v2.14.5...v2.14.6) (2022-08-12) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.2 ([#2221](https://github.com/googleapis/java-bigquery/issues/2221)) ([3292cdd](https://github.com/googleapis/java-bigquery/commit/3292cddeec7c83fa198a96d80a35c13b003a26c8)) + ## [2.14.5](https://github.com/googleapis/java-bigquery/compare/v2.14.4...v2.14.5) (2022-08-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5001c96728..221cf8ee97 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.6-SNAPSHOT + 2.14.6 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f519c44f2d..7c701ca4b8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.6-SNAPSHOT + 2.14.6 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.6-SNAPSHOT + 2.14.6 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index af5c859838..1f36b5ecbc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.6-SNAPSHOT + 2.14.6 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.6-SNAPSHOT + 2.14.6 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 18996e0c47..535f1b3cb6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.6-SNAPSHOT + 2.14.6 diff --git a/versions.txt b/versions.txt index 61f2ae59ca..44c0bb9f27 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.5:2.14.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.6:2.14.6 \ No newline at end of file From 30e63fb6e0cfb5140022bdda6ea3cef180d986c4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 12:27:30 +0200 Subject: [PATCH 0876/2268] test(deps): update dependency org.mockito:mockito-core to v4.7.0 (#2231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency org.mockito:mockito-core to v4.7.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc481d2de1..d71364f416 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.0.0') +implementation platform('com.google.cloud:libraries-bom:26.1.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.5' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.6' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.6" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 1f36b5ecbc..9fed16acdd 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.6.1 + 4.7.0 test From f4b6ce75e12546560e8bf5b4a81455ac2d4ef633 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 12:27:54 +0200 Subject: [PATCH 0877/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.0 (#2230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d71364f416..2e749205c6 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.0.0 + 26.1.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 702f489522..0f4267c2a8 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.0.0 + 26.1.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1711a5a707..310417efd9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.0.0 + 26.1.0 pom import From 286125e7488b880f2c8010408c034891387c908e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 12:28:15 +0200 Subject: [PATCH 0878/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 (#2229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e749205c6..c2af592689 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.5 + 2.14.6 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 00b02fac60..14727dab21 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.5 + 2.14.6 From abad7f924113e917c98e741c37494a8aa09fe9c0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 18:18:16 +0200 Subject: [PATCH 0879/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.1 (#2233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) | `3.4.0` -> `3.4.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.1/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9fed16acdd..facd5716bb 100644 --- a/pom.xml +++ b/pom.xml @@ -206,7 +206,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.0 + 3.4.1 From e4766acd179e0585aadcdbf09bab949482374e98 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 22:18:22 +0200 Subject: [PATCH 0880/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.4.1 (#2232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-javadoc-plugin](https://maven.apache.org/plugins/) ([source](https://togithub.com/apache/maven-javadoc-plugin)) | `3.4.0` -> `3.4.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/compatibility-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-javadoc-plugin/3.4.1/confidence-slim/3.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index facd5716bb..a9e531a548 100644 --- a/pom.xml +++ b/pom.xml @@ -233,7 +233,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 html From 01f826db243cac69fde09312be67f292a8b3dde3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 17 Aug 2022 15:52:14 +0200 Subject: [PATCH 0881/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.20.0 (#2237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.19.1` -> `2.20.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.20.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.20.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.20.0/compatibility-slim/2.19.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.20.0/confidence-slim/2.19.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage ### [`v2.20.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2200-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2191v2200-2022-08-17) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.19.1...v2.20.0) ##### Features - introduce InflightLimitExceededException ([#​1746](https://togithub.com/googleapis/java-bigquerystorage/issues/1746)) ([449353b](https://togithub.com/googleapis/java-bigquerystorage/commit/449353bd3b1fc78d46990c8203e1607d83f7ad03)) ##### Bug Fixes - Add documentation to Exceptions ([#​1745](https://togithub.com/googleapis/java-bigquerystorage/issues/1745)) ([3bc7aca](https://togithub.com/googleapis/java-bigquerystorage/commit/3bc7acaa4a110a0ce487e3976b5fd4ddb865ea24)) - Add missing field error to row error message ([#​1752](https://togithub.com/googleapis/java-bigquerystorage/issues/1752)) ([186d213](https://togithub.com/googleapis/java-bigquerystorage/commit/186d2135cb7e18410b89c93e909b03dc8e92ac6c)) - Close based on whether connection is active, not status variable ([#​1750](https://togithub.com/googleapis/java-bigquerystorage/issues/1750)) ([ce7f3e0](https://togithub.com/googleapis/java-bigquerystorage/commit/ce7f3e04046be6b4c1321be877034f5d0ab007f4)) ##### Dependencies - fixing the test scope dependency to runtime ([#​1742](https://togithub.com/googleapis/java-bigquerystorage/issues/1742)) ([878020b](https://togithub.com/googleapis/java-bigquerystorage/commit/878020b3667040aef1b8d610b37cd678ef932870)) - update dependency com.google.cloud:google-cloud-bigquery to v2.14.4 ([#​1740](https://togithub.com/googleapis/java-bigquerystorage/issues/1740)) ([f842d51](https://togithub.com/googleapis/java-bigquerystorage/commit/f842d517b70847b8e67359257a213129586513f6)) - update dependency com.google.cloud:google-cloud-bigquery to v2.14.6 ([#​1747](https://togithub.com/googleapis/java-bigquerystorage/issues/1747)) ([329bd9d](https://togithub.com/googleapis/java-bigquerystorage/commit/329bd9da268f48a4d18158845895b07a43c766ab))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a9e531a548..378615d693 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.19.1 + 2.20.0 pom import From de313bdaf5bec240723279fbe331561ac9eeb2ca Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 19 Aug 2022 07:00:28 -0400 Subject: [PATCH 0882/2268] chore: add set user agent sample (#2239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add set user agent sample * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add comments and fix variable names Co-authored-by: Owl Bot --- README.md | 1 + .../com/example/bigquery/SetUserAgent.java | 61 ++++++++++++++ .../example/bigquery/SetUserAgentTest.java | 79 +++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/SetUserAgentTest.java diff --git a/README.md b/README.md index c2af592689..58b11c9c20 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Resource Clean Up | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java) | | Run Legacy Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/RunLegacyQuery.java) | | Save Query To Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SaveQueryToTable.java) | +| Set User Agent | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java) | | Simple App | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | | Simple Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | | Table Exists | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java b/samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java new file mode 100644 index 0000000000..2794305f6a --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_set_user_agent] +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.common.collect.ImmutableMap; +import java.io.IOException; + +public class SetUserAgent { + + private static final String USER_AGENT_HEADER = "user-agent"; + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String customUserAgentValue = "my-custom-user-agent-value"; + setUserAgent(projectId, customUserAgentValue); + } + + public static void setUserAgent(String projectId, String customUserAgentValue) + throws IOException { + // Setup the credentials + GoogleCredentials googleCredentials = GoogleCredentials.getApplicationDefault(); + + // Initialize the HeaderProvider object with custom user agent value + HeaderProvider headerProvider = + FixedHeaderProvider.create(ImmutableMap.of(USER_AGENT_HEADER, customUserAgentValue)); + + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigQuery = + BigQueryOptions.newBuilder() + .setProjectId(projectId) + .setCredentials(googleCredentials) + .setHeaderProvider(headerProvider) + .build() + .getService(); + + System.out.println(bigQuery.getOptions().getUserAgent()); + } +} +// [END bigquery_set_user_agent] diff --git a/samples/snippets/src/test/java/com/example/bigquery/SetUserAgentTest.java b/samples/snippets/src/test/java/com/example/bigquery/SetUserAgentTest.java new file mode 100644 index 0000000000..6c5c9cf6d3 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/SetUserAgentTest.java @@ -0,0 +1,79 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class SetUserAgentTest { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String customUserAgentValue; + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } + + @Before + public void setUp() { + customUserAgentValue = "CUSTOM_USER_AGENT_" + UUID.randomUUID().toString().substring(0, 8); + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // Clean up + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void setUserAgentTest() throws IOException { + SetUserAgent.setUserAgent(PROJECT_ID, customUserAgentValue); + assertThat(bout.toString()).contains("CUSTOM_USER_AGENT_"); + } +} From 487656973fe3e06d838c1b495ac024ab2c6810f6 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:44:47 +0530 Subject: [PATCH 0883/2268] fix: table-not-found issue with executeSelect while running long queries (#2222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added exponential-back-off to create read session to avoid table-not-found error * Added testForTableNotFound IT * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Set recordCnt to 5Mil * Add polling logic @ getQueryResultsFirstPage, Removed retrial logic on table_not_found * Removed getTableNotFoundRetrySettings * Updated getQueryResultsWithRowLimit - Added timeoutMs param * Updated testGetQueryResultsFirstPage * Updated getQueryResultsWithRowLimit - Add timeoutMs * Updated getQueryResultsFirstPage - Modified polling logic and refactor * Removed prev differences. Add getQueryResultsWithRowLimit * Removed prev differences. Add getQueryResultsWithRowLimit Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 16 ++-- .../google/cloud/bigquery/ConnectionImpl.java | 74 ++++++++++++------- .../cloud/bigquery/spi/v2/BigQueryRpc.java | 2 +- .../bigquery/spi/v2/HttpBigQueryRpc.java | 3 +- .../cloud/bigquery/ConnectionImplTest.java | 12 ++- .../bigquery/it/ITNightlyBigQueryTest.java | 62 ++++++++++++++++ 6 files changed, 133 insertions(+), 36 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 1d3d826812..2ad26f9464 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -2,14 +2,16 @@ - - 7012 - com/google/cloud/bigquery/LoadConfiguration - java.util.List getDecimalTargetTypes() + + 7004 + com/google/cloud/bigquery/spi/v2/BigQueryRpc + com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) + getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method - 7012 - com/google/cloud/bigquery/LoadConfiguration$Builder - com.google.cloud.bigquery.LoadConfiguration$Builder setDecimalTargetTypes(java.util.List) + 7004 + com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc + com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) + getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 3a9937a074..da79bd6ba1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -835,8 +835,8 @@ BigQueryResult highThroughPutRead( .setMaxStreamCount(1) // Currently just one stream is allowed // DO a regex check using order by and use multiple streams ; - ReadSession readSession = bqReadClient.createReadSession(builder.build()); + bufferRow = new LinkedBlockingDeque<>(getBufferSize()); Map arrowNameToIndex = new HashMap<>(); // deserialize and populate the buffer async, so that the client isn't blocked @@ -995,33 +995,57 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { jobId.getLocation() == null && bigQueryOptions.getLocation() != null ? bigQueryOptions.getLocation() : jobId.getLocation()); - try { - GetQueryResultsResponse results = - BigQueryRetryHelper.runWithRetries( - () -> - bigQueryRpc.getQueryResultsWithRowLimit( - completeJobId.getProject(), - completeJobId.getJob(), - completeJobId.getLocation(), - connectionSettings.getMaxResultPerPage()), - bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - bigQueryOptions.getClock(), - retryConfig); - if (results.getErrors() != null) { - List bigQueryErrors = - results.getErrors().stream() - .map(BigQueryError.FROM_PB_FUNCTION) - .collect(Collectors.toList()); - // Throwing BigQueryException since there may be no JobId and we want to stay consistent - // with the case where there there is a HTTP error - throw new BigQueryException(bigQueryErrors); + // Implementing logic to poll the Job's status using getQueryResults as + // we do not get rows, rows count and schema unless the job is complete + // Ref: b/241134681 + // This logic relies on backend for poll and wait.BigQuery guarantees that jobs make forward + // progress (a job won't get stuck in pending forever). + boolean jobComplete = false; + GetQueryResultsResponse results = null; + long timeoutMs = + 60000; // defaulting to 60seconds. TODO(prashant): It should be made user configurable + + while (!jobComplete) { + try { + results = + BigQueryRetryHelper.runWithRetries( + () -> + bigQueryRpc.getQueryResultsWithRowLimit( + completeJobId.getProject(), + completeJobId.getJob(), + completeJobId.getLocation(), + connectionSettings.getMaxResultPerPage(), + timeoutMs), + bigQueryOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getClock(), + retryConfig); + + if (results.getErrors() != null) { + List bigQueryErrors = + results.getErrors().stream() + .map(BigQueryError.FROM_PB_FUNCTION) + .collect(Collectors.toList()); + // Throwing BigQueryException since there may be no JobId, and we want to stay consistent + // with the case where there is a HTTP error + throw new BigQueryException(bigQueryErrors); + } + } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); } - return results; - } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { - throw BigQueryException.translateAndThrow(e); + jobComplete = results.getJobComplete(); + + // This log msg at Level.FINE might indicate that the job is still running and not stuck for + // very long running jobs. + logger.log( + Level.FINE, + String.format( + "jobComplete: %s , Polling getQueryResults with timeoutMs: %s", + jobComplete, timeoutMs)); } + + return results; } @VisibleForTesting diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 871590ca4b..eecf5d36f5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -315,7 +315,7 @@ GetQueryResultsResponse getQueryResults( * @throws BigQueryException upon failure */ GetQueryResultsResponse getQueryResultsWithRowLimit( - String projectId, String jobId, String location, Integer preFetchedRowLimit); + String projectId, String jobId, String location, Integer preFetchedRowLimit, Long timeoutMs); /** * Runs a BigQuery SQL query synchronously and returns query results if the query completes within diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index d6b57a3daf..a9ef3a817a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -697,7 +697,7 @@ public GetQueryResultsResponse getQueryResults( @Override public GetQueryResultsResponse getQueryResultsWithRowLimit( - String projectId, String jobId, String location, Integer maxResultPerPage) { + String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) { try { return bigquery .jobs() @@ -705,6 +705,7 @@ public GetQueryResultsResponse getQueryResultsWithRowLimit( .setPrettyPrint(false) .setLocation(location) .setMaxResults(Long.valueOf(maxResultPerPage)) + .setTimeoutMs(timeoutMs) .execute(); } catch (IOException ex) { throw translate(ex); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 9543ccebf7..4b1b93487b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -315,14 +315,22 @@ public void testNextPageTask() throws InterruptedException { @Test public void testGetQueryResultsFirstPage() { when(bigqueryRpcMock.getQueryResultsWithRowLimit( - any(String.class), any(String.class), any(String.class), any(Integer.class))) + any(String.class), + any(String.class), + any(String.class), + any(Integer.class), + any(Long.class))) .thenReturn(GET_QUERY_RESULTS_RESPONSE); GetQueryResultsResponse response = connection.getQueryResultsFirstPage(QUERY_JOB); assertNotNull(response); assertEquals(GET_QUERY_RESULTS_RESPONSE, response); verify(bigqueryRpcMock, times(1)) .getQueryResultsWithRowLimit( - any(String.class), any(String.class), any(String.class), any(Integer.class)); + any(String.class), + any(String.class), + any(String.class), + any(Integer.class), + any(Long.class)); } // calls executeSelect with a nonFast query and exercises createQueryJob diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index 73bd21a30d..006c126b66 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -23,9 +23,11 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryError; import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.BigQueryResult; import com.google.cloud.bigquery.BigQuerySQLException; import com.google.cloud.bigquery.Connection; @@ -60,6 +62,7 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; +import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; @@ -484,6 +487,65 @@ public void testPositionalParams() assertEquals(MULTI_LIMIT_RECS, cnt); } + @Test + // This testcase reads rows in bulk for a public table to make sure we do not get + // table-not-found exception. Ref: b/241134681 . This exception has been seen while reading data + // in bulk + public void testForTableNotFound() throws SQLException { + int recordCnt = 50000000; // 5Mil + String query = + String.format( + "SELECT * FROM `bigquery-samples.wikipedia_benchmark.Wiki10B` LIMIT %s", recordCnt); + + String dataSet = RemoteBigQueryHelper.generateDatasetName(); + String table = "TAB_" + UUID.randomUUID(); + createDataset(dataSet); + TableId targetTable = + TableId.of( + ServiceOptions.getDefaultProjectId(), + dataSet, + table); // table will be created implicitly + + ConnectionSettings conSet = + ConnectionSettings.newBuilder() + .setUseReadAPI(true) // enable read api + .setDestinationTable(targetTable) + .setAllowLargeResults(true) + .build(); + + Connection connection = + BigQueryOptions.getDefaultInstance().getService().createConnection(conSet); + BigQueryResult bigQueryResultSet = connection.executeSelect(query); + assertNotNull(getResultHashWiki(bigQueryResultSet)); // this iterated through all the rows + assertTrue( + (recordCnt == bigQueryResultSet.getTotalRows()) + || (-1 + == bigQueryResultSet + .getTotalRows())); // either job should return the actual count or -1 if the job + // is still running + try { + deleteTable(dataSet, table); + deleteDataset(dataSet); + } catch (Exception e) { + logger.log( + Level.WARNING, + String.format( + "Error [ %s ] while deleting dataset: %s , table: %s", + e.getMessage(), dataSet, table)); + } + } + + // this iterated through all the rows (just reads the title column) + private Long getResultHashWiki(BigQueryResult bigQueryResultSet) throws SQLException { + ResultSet rs = bigQueryResultSet.getResultSet(); + long hash = 0L; + System.out.print("\n Running"); + while (rs.next()) { + hash += rs.getString("title") == null ? 0 : rs.getString("title").hashCode(); + } + return hash; + } + // asserts the value of each row private static void testForAllDataTypeValues(ResultSet rs, int cnt) throws SQLException { // Testing JSON type From e42a5440bd882a40251380b66c42f8312e7bd740 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 14:04:01 -0400 Subject: [PATCH 0884/2268] chore(main): release 2.14.7-SNAPSHOT (#2228) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 221cf8ee97..c67b15083c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.6 + 2.14.7-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7c701ca4b8..d69dd2bfc2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.6 + 2.14.7-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.6 + 2.14.7-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 378615d693..a7177c701a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.6 + 2.14.7-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.6 + 2.14.7-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 535f1b3cb6..c1696f1654 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.6 + 2.14.7-SNAPSHOT diff --git a/versions.txt b/versions.txt index 44c0bb9f27..dcd10147bb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.6:2.14.6 \ No newline at end of file +google-cloud-bigquery:2.14.6:2.14.7-SNAPSHOT \ No newline at end of file From a449ee6a30ca5706fedeee3ae635c08332b2e424 Mon Sep 17 00:00:00 2001 From: Nikunj Bhartia Date: Wed, 24 Aug 2022 04:12:20 +0530 Subject: [PATCH 0885/2268] samples / fixing authorize dataset logic by updating source dataset acl (#2189) Fixes#2188 Fixed the logic for authorizing a bigquery user dataset but updating the source dataset acl with that of the user dataset information. --- .../java/com/example/bigquery/AuthorizeDataset.java | 10 +++++----- .../java/com/example/bigquery/AuthorizeDatasetIT.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java b/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java index f7f28c2182..949e583e48 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java +++ b/samples/snippets/src/main/java/com/example/bigquery/AuthorizeDataset.java @@ -38,7 +38,7 @@ public static void main(String[] args) { DatasetId.of(projectId, sourceDatasetName), DatasetId.of(projectId, userDatasetName)); } - // This method will update userDataset's ACL with sourceDataset's ACL + // This method will update sourceDataset's ACL with userDataset's ACL public static void authorizeDataset(DatasetId sourceDatasetId, DatasetId userDatasetId) { try { // Initialize client that will be used to send requests. This client only needs to be created @@ -58,12 +58,12 @@ public static void authorizeDataset(DatasetId sourceDatasetId, DatasetId userDat new Acl.DatasetAclEntity(userDatasetId, targetTypes); sourceDatasetAcl.add(Acl.of(userDatasetAclEntity)); - // update the user dataset with source dataset's ACL - Dataset updatedUserDataset = - userDataset.toBuilder().setAcl(sourceDatasetAcl).build().update(); + // update the source dataset with user dataset's ACL + Dataset updatedSourceDataset = + sourceDataset.toBuilder().setAcl(sourceDatasetAcl).build().update(); System.out.printf( - "Dataset %s updated with the added authorization\n", updatedUserDataset.getDatasetId()); + "Dataset %s updated with the added authorization\n", updatedSourceDataset.getDatasetId()); } catch (BigQueryException e) { System.out.println("Dataset Authorization failed due to error: \n" + e); diff --git a/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java b/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java index b13c6bb73a..c4facd5ef4 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/AuthorizeDatasetIT.java @@ -80,6 +80,6 @@ public void tearDown() { @Test public void testCreateDataset() { AuthorizeDataset.authorizeDataset(sourceDatasetId, userDatasetId); - assertThat(bout.toString()).contains(userDatasetId + " updated with the added authorization"); + assertThat(bout.toString()).contains(sourceDatasetId + " updated with the added authorization"); } } From 1477562c48e9f993d506d13b140d8d2d9c96cacb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 08:21:36 +0530 Subject: [PATCH 0886/2268] chore(main): release 2.14.7 (#2245) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68cff6cc02..7867073585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.14.7](https://github.com/googleapis/java-bigquery/compare/v2.14.6...v2.14.7) (2022-08-23) + + +### Bug Fixes + +* table-not-found issue with executeSelect while running long queries ([#2222](https://github.com/googleapis/java-bigquery/issues/2222)) ([4876569](https://github.com/googleapis/java-bigquery/commit/487656973fe3e06d838c1b495ac024ab2c6810f6)) + ## [2.14.6](https://github.com/googleapis/java-bigquery/compare/v2.14.5...v2.14.6) (2022-08-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c67b15083c..3c299ff36e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.7-SNAPSHOT + 2.14.7 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d69dd2bfc2..0f87a2b7b3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.7-SNAPSHOT + 2.14.7 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.7-SNAPSHOT + 2.14.7 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a7177c701a..442a2dc4f0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.7-SNAPSHOT + 2.14.7 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7-SNAPSHOT + 2.14.7 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c1696f1654..4e9ddfd3ea 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7-SNAPSHOT + 2.14.7 diff --git a/versions.txt b/versions.txt index dcd10147bb..ddf3790c1f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.6:2.14.7-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.14.7:2.14.7 \ No newline at end of file From bbbc4fe5f9da2ddcaaf70277ac0e6f8f37392ed7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 03:18:16 +0000 Subject: [PATCH 0887/2268] chore(main): release 2.14.8-SNAPSHOT (#2246) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3c299ff36e..3364645f8a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.7 + 2.14.8-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0f87a2b7b3..124b9b16f8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.7 + 2.14.8-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.7 + 2.14.8-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 442a2dc4f0..eb67a028ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.7 + 2.14.8-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.14.8-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4e9ddfd3ea..6cdf817a66 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.14.8-SNAPSHOT diff --git a/versions.txt b/versions.txt index ddf3790c1f..10ce9fe6bd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.7:2.14.7 \ No newline at end of file +google-cloud-bigquery:2.14.7:2.14.8-SNAPSHOT \ No newline at end of file From 9e08a014dd8493c339015005bfe06faff43694a7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 24 Aug 2022 16:30:18 +0200 Subject: [PATCH 0888/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.14.7 (#2247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.6` -> `2.14.7` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.7/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.7/compatibility-slim/2.14.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.14.7/confidence-slim/2.14.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 58b11c9c20..733874da1e 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.6 + 2.14.7 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.6' +implementation 'com.google.cloud:google-cloud-bigquery:2.14.7' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.6" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.7" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 14727dab21..ba3e5fbe58 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.6 + 2.14.7 From 3b4bb67e0f3a3cd0885236015bcf29584fd2652f Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 24 Aug 2022 13:03:54 -0400 Subject: [PATCH 0889/2268] chore: run modelUpdate tests (#2238) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: run modelUpdate tests * 🦉 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 --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 4 ---- .../java/com/example/bigquery/UpdateModelDescriptionIT.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 20afb0b29e..c5d577c394 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -162,7 +162,6 @@ import java.util.logging.Logger; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; @@ -2009,9 +2008,6 @@ public void testListPageWithStartIndex() { assertEquals(300_000L, totalRows); } - // BQML recently changed the validation behaviour of model update. - // Ignoring this test until a fix for the same is applied to BQ library. - @Ignore @Test public void testModelLifecycle() throws InterruptedException { diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java index 854e2a2cd8..156e83d170 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java @@ -27,12 +27,8 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; -// BQML recently changed the validation behaviour of model update. -// Ignoring this test until a fix for the same is applied to BQ library. -@Ignore public class UpdateModelDescriptionIT { private final Logger log = Logger.getLogger(this.getClass().getName()); From 6ae53d186c23dad5567cedca1a689b23e2d232b7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 24 Aug 2022 19:09:19 +0200 Subject: [PATCH 0890/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.11.0 (#2242) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ba3e5fbe58..84b7202250 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.10.3 + 2.11.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6cdf817a66..c279da7a67 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.10.3 + 2.11.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 310417efd9..37fb3f40eb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.10.3 + 2.11.0 test From fd3d3c57afed84b4d00aab438d79472a6afa001b Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 24 Aug 2022 13:14:31 -0400 Subject: [PATCH 0891/2268] feat: add preview support for default values (#2244) --- .../java/com/google/cloud/bigquery/Field.java | 53 ++++++++++++++++ .../com/google/cloud/bigquery/FieldTest.java | 6 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 63 +++++++++++++++++++ 3 files changed, 122 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 20c5acd3fa..928f379d63 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -62,6 +62,7 @@ public TableFieldSchema apply(Field field) { private final Long maxLength; private final Long scale; private final Long precision; + private final String defaultValueExpression; /** * Mode for a BigQuery Table field. {@link Mode#NULLABLE} fields can be set to {@code null}, @@ -85,6 +86,7 @@ public static final class Builder { private Long maxLength; private Long scale; private Long precision; + private String defaultValueExpression; private Builder() {} @@ -98,6 +100,7 @@ private Builder(Field field) { this.maxLength = field.maxLength; this.scale = field.scale; this.precision = field.precision; + this.defaultValueExpression = field.defaultValueExpression; } /** @@ -245,6 +248,43 @@ public Builder setPrecision(Long precision) { return this; } + /** + * DefaultValueExpression is used to specify the default value of a field using a SQL + * expression. It can only be set for top level fields (columns). + * + *

    You can use struct or array expression to specify default value for the entire struct or + * array. The valid SQL expressions are: + * + *

      + *
        + *
      • Literals for all data types, including STRUCT and ARRAY. + *
      + *
        + *
      • The following functions: + *
          + *
        • CURRENT_TIMESTAMP + *
        • CURRENT_TIME + *
        • CURRENT_DATE + *
        • CURRENT_DATETIME + *
        • GENERATE_UUID + *
        • RAND + *
        • SESSION_USER + *
        • ST_GEOGPOINT + *
        + *
      + *
        + *
      • Struct or array composed with the above allowed functions, for example: + *
          + *
        • "[CURRENT_DATE(), DATE '2020-01-01']" + *
        + *
      + *
    + */ + public Builder setDefaultValueExpression(String defaultValueExpression) { + this.defaultValueExpression = defaultValueExpression; + return this; + } + /** Creates a {@code Field} object. */ public Field build() { return new Field(this); @@ -261,6 +301,7 @@ private Field(Builder builder) { this.maxLength = builder.maxLength; this.scale = builder.scale; this.precision = builder.precision; + this.defaultValueExpression = builder.defaultValueExpression; } /** Returns the field name. */ @@ -311,6 +352,11 @@ public Long getPrecision() { return precision; } + /** Return the default value of the field. */ + public String getDefaultValueExpression() { + return defaultValueExpression; + } + /** * Returns the list of sub-fields if {@link #getType()} is a {@link LegacySQLTypeName#RECORD}. * Returns {@code null} otherwise. @@ -335,6 +381,7 @@ public String toString() { .add("maxLength", maxLength) .add("scale", scale) .add("precision", precision) + .add("defaultValueExpression", defaultValueExpression) .toString(); } @@ -414,6 +461,9 @@ TableFieldSchema toPb() { if (precision != null) { fieldSchemaPb.setPrecision(precision); } + if (defaultValueExpression != null) { + fieldSchemaPb.setDefaultValueExpression(defaultValueExpression); + } if (getSubFields() != null) { List fieldsPb = Lists.transform(getSubFields(), TO_PB_FUNCTION); fieldSchemaPb.setFields(fieldsPb); @@ -442,6 +492,9 @@ static Field fromPb(TableFieldSchema fieldSchemaPb) { if (fieldSchemaPb.getPrecision() != null) { fieldBuilder.setPrecision(fieldSchemaPb.getPrecision()); } + if (fieldSchemaPb.getDefaultValueExpression() != null) { + fieldBuilder.setDefaultValueExpression(fieldSchemaPb.getDefaultValueExpression()); + } FieldList subFields = fieldSchemaPb.getFields() != null ? FieldList.of(Lists.transform(fieldSchemaPb.getFields(), FROM_PB_FUNCTION)) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java index cac8ab1b8f..4db2028136 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java @@ -39,10 +39,13 @@ public class FieldTest { private static final String FIELD_DESCRIPTION1 = "FieldDescription1"; private static final String FIELD_DESCRIPTION2 = "FieldDescription2"; private static final String FIELD_DESCRIPTION3 = "FieldDescription3"; + private static final String FIELD_DEFAULT_VALUE_EXPRESSION1 = + "This is default value for this field"; private static final Field FIELD_SCHEMA1 = Field.newBuilder(FIELD_NAME1, FIELD_TYPE1) .setMode(FIELD_MODE1) .setDescription(FIELD_DESCRIPTION1) + .setDefaultValueExpression(FIELD_DEFAULT_VALUE_EXPRESSION1) .build(); private static final Field FIELD_SCHEMA2 = Field.newBuilder(FIELD_NAME2, FIELD_TYPE2) @@ -60,6 +63,7 @@ public class FieldTest { Field.newBuilder(FIELD_NAME1, StandardSQLTypeName.STRING) .setMode(FIELD_MODE1) .setDescription(FIELD_DESCRIPTION1) + .setDefaultValueExpression(FIELD_DEFAULT_VALUE_EXPRESSION1) .build(); private static final Field STANDARD_FIELD_SCHEMA2 = Field.newBuilder(FIELD_NAME2, StandardSQLTypeName.INT64) @@ -137,6 +141,7 @@ public void testBuilder() { assertEquals(FIELD_TYPE1, FIELD_SCHEMA1.getType()); assertEquals(FIELD_MODE1, FIELD_SCHEMA1.getMode()); assertEquals(FIELD_DESCRIPTION1, FIELD_SCHEMA1.getDescription()); + assertEquals(FIELD_DEFAULT_VALUE_EXPRESSION1, FIELD_SCHEMA1.getDefaultValueExpression()); assertEquals(null, FIELD_SCHEMA1.getSubFields()); assertEquals(FIELD_NAME3, FIELD_SCHEMA3.getName()); assertEquals(FIELD_TYPE3, FIELD_SCHEMA3.getType()); @@ -151,6 +156,7 @@ public void testBuilderWithStandardSQLTypeName() { assertEquals(FIELD_TYPE1, STANDARD_FIELD_SCHEMA1.getType()); assertEquals(FIELD_MODE1, STANDARD_FIELD_SCHEMA1.getMode()); assertEquals(FIELD_DESCRIPTION1, STANDARD_FIELD_SCHEMA1.getDescription()); + assertEquals(FIELD_DEFAULT_VALUE_EXPRESSION1, FIELD_SCHEMA1.getDefaultValueExpression()); assertEquals(null, STANDARD_FIELD_SCHEMA1.getSubFields()); assertEquals(FIELD_NAME3, STANDARD_FIELD_SCHEMA3.getName()); assertEquals(FIELD_TYPE3, STANDARD_FIELD_SCHEMA3.getType()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c5d577c394..2777fdabf9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -72,6 +72,7 @@ import com.google.cloud.bigquery.FormatOptions; import com.google.cloud.bigquery.HivePartitioningOptions; import com.google.cloud.bigquery.InsertAllRequest; +import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.InsertAllResponse; import com.google.cloud.bigquery.Job; import com.google.cloud.bigquery.JobId; @@ -1176,6 +1177,68 @@ public void testCreateTableWithConstraints() { bigquery.delete(tableId); } + @Test + public void testCreateTableWithDefaultValueExpression() { + String tableName = "test_create_table_with_default_value_expression"; + TableId tableId = TableId.of(DATASET, tableName); + Field stringFieldWithDefaultValueExpression = + Field.newBuilder("stringFieldWithDefaultValueExpression", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("String field with default value expression") + .setDefaultValueExpression("'FOO'") + .setMaxLength(150L) + .build(); + Field timestampFieldWithDefaultValueExpression = + Field.newBuilder("timestampFieldWithDefaultValueExpression", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .setDescription("Timestamp field with default value expression") + .setDefaultValueExpression("CURRENT_TIMESTAMP") + .build(); + Schema schema = + Schema.of(stringFieldWithDefaultValueExpression, timestampFieldWithDefaultValueExpression); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(schema).build(); + + // Create table with fields that have default value expression + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + + // Fetch the created table and its metadata + // to verify default value expression is assigned to fields + Table remoteTable = bigquery.getTable(DATASET, tableName); + Schema remoteSchema = remoteTable.getDefinition().getSchema(); + assertEquals(schema, remoteSchema); + FieldList fieldList = remoteSchema.getFields(); + for (Field field : fieldList) { + if (field.getName().equals("timestampFieldWithDefaultValueExpression")) { + assertEquals("CURRENT_TIMESTAMP", field.getDefaultValueExpression()); + } + if (field.getName().equals("stringFieldWithDefaultValueExpression")) { + assertEquals("'FOO'", field.getDefaultValueExpression()); + } + } + + // Insert value into the created table + // to verify default values are inserted when value is missing + String rowId1 = "rowId1"; + String rowId2 = "rowId2"; + List rows = new ArrayList<>(); + Map row1 = new HashMap<>(); + row1.put("timestampFieldWithDefaultValueExpression", "2022-08-22 00:45:12 UTC"); + Map row2 = new HashMap<>(); + row2.put("timestampFieldWithDefaultValueExpression", "2022-08-23 00:44:33 UTC"); + rows.add(RowToInsert.of(rowId1, row1)); + rows.add(RowToInsert.of(rowId2, row2)); + InsertAllResponse response1 = remoteTable.insert(rows); + + TableResult tableData = bigquery.listTableData(DATASET, tableName, schema); + String insertedField = "stringFieldWithDefaultValueExpression"; + for (FieldValueList row : tableData.iterateAll()) { + assertEquals("FOO", row.get(insertedField).getValue()); + } + bigquery.delete(tableId); + } + @Test public void testCreateAndUpdateTableWithPolicyTags() throws IOException { // Set up policy tags in the datacatalog service From 1238236ba11e5f0eaaa273ee2b261a606dab1af4 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 24 Aug 2022 16:19:26 -0400 Subject: [PATCH 0892/2268] chore: change library_type to GAPIC_MANUAL (#2250) --- .repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index a2f378081f..d795a9ea62 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -12,6 +12,6 @@ "distribution_name": "com.google.cloud:google-cloud-bigquery", "codeowner_team": "@googleapis/api-bigquery", "api_id": "bigquery.googleapis.com", - "library_type": "REST", + "library_type": "GAPIC_MANUAL", "requires_billing": true } From f524d17b4070e4abfb87ef63a4a1e6e75f083d28 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Aug 2022 16:26:36 +0200 Subject: [PATCH 0893/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.20.1 (#2251) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb67a028ce..22c5019fa6 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.20.0 + 2.20.1 pom import From 7cbc6f8cd9931d9f97e5c6ca86f055cfef3740a2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 11:54:34 +0530 Subject: [PATCH 0894/2268] chore(main): release 2.15.0 (#2249) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7867073585..83e0bea157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.15.0](https://github.com/googleapis/java-bigquery/compare/v2.14.7...v2.15.0) (2022-08-25) + + +### Features + +* add preview support for default values ([#2244](https://github.com/googleapis/java-bigquery/issues/2244)) ([fd3d3c5](https://github.com/googleapis/java-bigquery/commit/fd3d3c57afed84b4d00aab438d79472a6afa001b)) + ## [2.14.7](https://github.com/googleapis/java-bigquery/compare/v2.14.6...v2.14.7) (2022-08-23) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3364645f8a..9b63ff1d80 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.14.8-SNAPSHOT + 2.15.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 124b9b16f8..228ebe157b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.14.8-SNAPSHOT + 2.15.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.14.8-SNAPSHOT + 2.15.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 22c5019fa6..ef266694df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.14.8-SNAPSHOT + 2.15.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.14.8-SNAPSHOT + 2.15.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c279da7a67..d0bb69036a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.14.8-SNAPSHOT + 2.15.0 diff --git a/versions.txt b/versions.txt index 10ce9fe6bd..28e8f2b333 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.14.7:2.14.8-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.15.0:2.15.0 \ No newline at end of file From 22ba242c9e06aeec2bfc52b7f216274d018407c3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 06:50:38 +0000 Subject: [PATCH 0895/2268] chore(main): release 2.15.1-SNAPSHOT (#2252) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9b63ff1d80..ff262b1cbd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.15.0 + 2.15.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 228ebe157b..fe9c140db6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.15.0 + 2.15.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.15.0 + 2.15.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ef266694df..044aa8f71e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.15.0 + 2.15.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.15.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d0bb69036a..5c54badbff 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.15.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 28e8f2b333..0cda752ce8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.15.0:2.15.0 \ No newline at end of file +google-cloud-bigquery:2.15.0:2.15.1-SNAPSHOT \ No newline at end of file From 77f2bae14e97211694706e3a1a123fc1d919002b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 29 Aug 2022 15:38:12 +0200 Subject: [PATCH 0896/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.15.0 (#2253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.14.7` -> `2.15.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/compatibility-slim/2.14.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.15.0/confidence-slim/2.14.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.15.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2150-httpsgithubcomgoogleapisjava-bigquerycomparev2147v2150-2022-08-25) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.14.7...v2.15.0) ##### Features - add preview support for default values ([#​2244](https://togithub.com/googleapis/java-bigquery/issues/2244)) ([fd3d3c5](https://togithub.com/googleapis/java-bigquery/commit/fd3d3c57afed84b4d00aab438d79472a6afa001b))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 733874da1e..2afa89e74d 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.14.7' +implementation 'com.google.cloud:google-cloud-bigquery:2.15.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.14.7" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.15.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 84b7202250..29d9afb801 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.14.7 + 2.15.0 From 856893f4d8f1b419365d8f179ce9f9e571dec718 Mon Sep 17 00:00:00 2001 From: tanaka takaya Date: Tue, 30 Aug 2022 01:42:35 +0900 Subject: [PATCH 0897/2268] feat: Add preserveAsciiControlCharacters to CsvOptions (#2143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add preserveAsciiControlCharacters to CsvOptions * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add IT * 🦉 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 --- .../com/google/cloud/bigquery/CsvOptions.java | 25 +++++++++++++++++- .../bigquery/WriteChannelConfiguration.java | 3 ++- .../google/cloud/bigquery/CsvOptionsTest.java | 5 ++++ .../cloud/bigquery/it/ITBigQueryTest.java | 26 +++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java index 6ef9e77fc1..8a1311faa6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java @@ -34,6 +34,7 @@ public final class CsvOptions extends FormatOptions { private final String fieldDelimiter; private final String quote; private final Long skipLeadingRows; + private final Boolean preserveAsciiControlCharacters; public static final class Builder { @@ -43,6 +44,7 @@ public static final class Builder { private String fieldDelimiter; private String quote; private Long skipLeadingRows; + private Boolean preserveAsciiControlCharacters; private Builder() {} @@ -53,6 +55,7 @@ private Builder(CsvOptions csvOptions) { this.fieldDelimiter = csvOptions.fieldDelimiter; this.quote = csvOptions.quote; this.skipLeadingRows = csvOptions.skipLeadingRows; + this.preserveAsciiControlCharacters = csvOptions.preserveAsciiControlCharacters; } /** @@ -130,6 +133,15 @@ public Builder setSkipLeadingRows(long skipLeadingRows) { return this; } + /** + * Sets whether BigQuery should allow ascii control characters in a CSV file. By default ascii + * control characters are not allowed. + */ + public Builder setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters) { + this.preserveAsciiControlCharacters = preserveAsciiControlCharacters; + return this; + } + /** Creates a {@code CsvOptions} object. */ public CsvOptions build() { return new CsvOptions(this); @@ -144,6 +156,7 @@ private CsvOptions(Builder builder) { this.fieldDelimiter = builder.fieldDelimiter; this.quote = builder.quote; this.skipLeadingRows = builder.skipLeadingRows; + this.preserveAsciiControlCharacters = builder.preserveAsciiControlCharacters; } /** @@ -192,6 +205,14 @@ public Long getSkipLeadingRows() { return skipLeadingRows; } + /** + * Returns whether BigQuery should allow ascii control characters in a CSV file. By default ascii + * control characters are not allowed. + */ + public Boolean getPreserveAsciiControlCharacters() { + return preserveAsciiControlCharacters; + } + /** Returns a builder for the {@code CsvOptions} object. */ public Builder toBuilder() { return new Builder(this); @@ -207,6 +228,7 @@ public String toString() { .add("fieldDelimiter", fieldDelimiter) .add("quote", quote) .add("skipLeadingRows", skipLeadingRows) + .add("preserveAsciiControlCharacters", preserveAsciiControlCharacters) .toString(); } @@ -219,7 +241,8 @@ public int hashCode() { encoding, fieldDelimiter, quote, - skipLeadingRows); + skipLeadingRows, + preserveAsciiControlCharacters); } @Override diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java index ebb5713ef0..cdb9db904e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java @@ -475,7 +475,8 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { .setAllowJaggedRows(csvOptions.allowJaggedRows()) .setAllowQuotedNewlines(csvOptions.allowQuotedNewLines()) .setEncoding(csvOptions.getEncoding()) - .setQuote(csvOptions.getQuote()); + .setQuote(csvOptions.getQuote()) + .setPreserveAsciiControlCharacters(csvOptions.getPreserveAsciiControlCharacters()); if (csvOptions.getSkipLeadingRows() != null) { // todo(mziccard) remove checked cast or comment when #1044 is closed loadConfigurationPb.setSkipLeadingRows(Ints.checkedCast(csvOptions.getSkipLeadingRows())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java index 21ca11fdfc..fa05cddc50 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java @@ -30,6 +30,8 @@ public class CsvOptionsTest { private static final String FIELD_DELIMITER = ","; private static final String QUOTE = "\""; private static final long SKIP_LEADING_ROWS = 42L; + + private static final boolean PRESERVE_ASCII_CONTROL_CHARACTERS = true; private static final CsvOptions CSV_OPTIONS = CsvOptions.newBuilder() .setAllowJaggedRows(ALLOW_JAGGED_ROWS) @@ -38,6 +40,7 @@ public class CsvOptionsTest { .setFieldDelimiter(FIELD_DELIMITER) .setQuote(QUOTE) .setSkipLeadingRows(SKIP_LEADING_ROWS) + .setPreserveAsciiControlCharacters(PRESERVE_ASCII_CONTROL_CHARACTERS) .build(); @Test @@ -64,6 +67,8 @@ public void testBuilder() { assertEquals(FIELD_DELIMITER, CSV_OPTIONS.getFieldDelimiter()); assertEquals(QUOTE, CSV_OPTIONS.getQuote()); assertEquals(SKIP_LEADING_ROWS, (long) CSV_OPTIONS.getSkipLeadingRows()); + assertEquals( + PRESERVE_ASCII_CONTROL_CHARACTERS, CSV_OPTIONS.getPreserveAsciiControlCharacters()); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 2777fdabf9..954ee98a70 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -4560,4 +4560,30 @@ public void testLocation() throws Exception { bigquery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); } } + + @Test + public void testPreserveAsciiControlCharacters() + throws InterruptedException, IOException, TimeoutException { + String destinationTableName = "test_preserve_ascii_control_characters"; + TableId tableId = TableId.of(DATASET, destinationTableName); + WriteChannelConfiguration configuration = + WriteChannelConfiguration.newBuilder(tableId) + .setFormatOptions( + FormatOptions.csv().toBuilder().setPreserveAsciiControlCharacters(true).build()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(SIMPLE_SCHEMA) + .build(); + TableDataWriteChannel channel = bigquery.writer(configuration); + try { + channel.write(ByteBuffer.wrap("\u0000".getBytes(StandardCharsets.UTF_8))); + } finally { + channel.close(); + } + Job job = channel.getJob().waitFor(); + assertNull(job.getStatus().getError()); + Page rows = bigquery.listTableData(tableId); + FieldValueList row = rows.getValues().iterator().next(); + assertEquals("\u0000", row.get(0).getStringValue()); + assertTrue(bigquery.delete(tableId)); + } } From 522ec81c678f169f1b9c89158ed284a632189472 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 29 Aug 2022 15:28:12 -0400 Subject: [PATCH 0898/2268] chore: add PB methods for preserveAsciiCharaters (#2256) --- .../src/main/java/com/google/cloud/bigquery/CsvOptions.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java index 8a1311faa6..cbcce2173e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java @@ -134,7 +134,7 @@ public Builder setSkipLeadingRows(long skipLeadingRows) { } /** - * Sets whether BigQuery should allow ascii control characters in a CSV file. By default ascii + * Sets whether BigQuery should allow ASCII control characters in a CSV file. By default ASCII * control characters are not allowed. */ public Builder setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters) { @@ -260,6 +260,7 @@ com.google.api.services.bigquery.model.CsvOptions toPb() { csvOptions.setFieldDelimiter(fieldDelimiter); csvOptions.setQuote(quote); csvOptions.setSkipLeadingRows(skipLeadingRows); + csvOptions.setPreserveAsciiControlCharacters(preserveAsciiControlCharacters); return csvOptions; } @@ -288,6 +289,9 @@ static CsvOptions fromPb(com.google.api.services.bigquery.model.CsvOptions csvOp if (csvOptions.getSkipLeadingRows() != null) { builder.setSkipLeadingRows(csvOptions.getSkipLeadingRows()); } + if (csvOptions.getPreserveAsciiControlCharacters() != null) { + builder.setPreserveAsciiControlCharacters(csvOptions.getPreserveAsciiControlCharacters()); + } return builder.build(); } } From 777931391d4d73deaac128f98834cdacd5ba77f9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 29 Aug 2022 22:49:16 +0200 Subject: [PATCH 0899/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.11.1 (#2257) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 29d9afb801..b67d136aaf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.11.0 + 2.11.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5c54badbff..75486d9ee1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.11.0 + 2.11.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 37fb3f40eb..71a84afbfc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.11.0 + 2.11.1 test From 9b530cdbce1423376606542cb8cdb0606ec15692 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 31 Aug 2022 22:44:26 +0200 Subject: [PATCH 0900/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.1 (#2258) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.0` -> `26.1.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/compatibility-slim/26.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.1/confidence-slim/26.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2afa89e74d..087f280877 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.0 + 26.1.1 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.0') +implementation platform('com.google.cloud:libraries-bom:26.1.1') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 0f4267c2a8..a181739e02 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.0 + 26.1.1 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 71a84afbfc..8a05c73040 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.0 + 26.1.1 pom import From 5e30a04e5b14b03e60e587787180b27f605d6abd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Sep 2022 07:50:32 +0200 Subject: [PATCH 0901/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.3 (#2259) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 044aa8f71e..612b8c2663 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.2 + 1.9.3 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.2 + 1.9.3 pom import From a9b5fb2c1078788ddb1ac3169c9ce597af228ac0 Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Fri, 2 Sep 2022 08:53:49 +0530 Subject: [PATCH 0902/2268] fix: Socket-timeout at bigquery.it.ITNightlyBigQueryTest: testForTableNotFound (#2260) * Added query logging in testForTableNotFound * Defaulted timeoutMs to 10s & Added additional logging --- .../java/com/google/cloud/bigquery/ConnectionImpl.java | 10 ++++++++-- .../cloud/bigquery/it/ITNightlyBigQueryTest.java | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index da79bd6ba1..0310832c58 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -190,11 +190,13 @@ public BigQueryResult executeSelect(String sql) throws BigQuerySQLException { try { // use jobs.query if all the properties of connectionSettings are supported if (isFastQuerySupported()) { + logger.log(Level.INFO, "\n Using Fast Query Path"); String projectId = bigQueryOptions.getProjectId(); QueryRequest queryRequest = createQueryRequest(connectionSettings, sql, null, null); return queryRpc(projectId, queryRequest, sql, false); } // use jobs.insert otherwise + logger.log(Level.INFO, "\n Not Using Fast Query Path, using jobs.insert"); com.google.api.services.bigquery.model.Job queryJob = createQueryJob(sql, connectionSettings, null, null); JobId jobId = JobId.fromPb(queryJob.getJobReference()); @@ -233,12 +235,14 @@ public BigQueryResult executeSelect( try { // use jobs.query if possible if (isFastQuerySupported()) { + logger.log(Level.INFO, "\n Using Fast Query Path"); final String projectId = bigQueryOptions.getProjectId(); final QueryRequest queryRequest = createQueryRequest(connectionSettings, sql, parameters, labelMap); return queryRpc(projectId, queryRequest, sql, parameters != null); } // use jobs.insert otherwise + logger.log(Level.INFO, "\n Not Using Fast Query Path, using jobs.insert"); com.google.api.services.bigquery.model.Job queryJob = createQueryJob(sql, connectionSettings, parameters, labelMap); JobId jobId = JobId.fromPb(queryJob.getJobReference()); @@ -1003,8 +1007,7 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { // progress (a job won't get stuck in pending forever). boolean jobComplete = false; GetQueryResultsResponse results = null; - long timeoutMs = - 60000; // defaulting to 60seconds. TODO(prashant): It should be made user configurable + long timeoutMs = 10000; // defaulting to 10seconds. while (!jobComplete) { try { @@ -1032,6 +1035,7 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { throw new BigQueryException(bigQueryErrors); } } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + logger.log(Level.WARNING, "\n Error occurred while calling getQueryResultsWithRowLimit", e); throw BigQueryException.translateAndThrow(e); } jobComplete = results.getJobComplete(); @@ -1285,8 +1289,10 @@ com.google.api.services.bigquery.model.Job createQueryJob( bigQueryOptions.getClock(), retryConfig); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + logger.log(Level.WARNING, "\n Error occurred while calling createJobForQuery", e); throw BigQueryException.translateAndThrow(e); } + logger.log(Level.INFO, "\n Query job created"); return queryJob; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index 006c126b66..588484749c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -496,7 +496,7 @@ public void testForTableNotFound() throws SQLException { String query = String.format( "SELECT * FROM `bigquery-samples.wikipedia_benchmark.Wiki10B` LIMIT %s", recordCnt); - + logger.log(Level.INFO, "Query used: {0}", query); String dataSet = RemoteBigQueryHelper.generateDatasetName(); String table = "TAB_" + UUID.randomUUID(); createDataset(dataSet); From 3c67d21c10f66b3c5313a1733f4e81db42c1b7c3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Sep 2022 18:10:17 +0200 Subject: [PATCH 0903/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220827-2.0.0 (#2261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220806-2.0.0` -> `v2-rev20220827-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220827-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220827-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220827-2.0.0/compatibility-slim/v2-rev20220806-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220827-2.0.0/confidence-slim/v2-rev20220806-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 612b8c2663..b7b28d73de 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220806-2.0.0 + v2-rev20220827-2.0.0 3.0.1 9.0.0
    From c84863a2f51c00e9f2e566150f59ee103ea34f11 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Sep 2022 22:24:12 +0200 Subject: [PATCH 0904/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.1 (#2264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.5.0` -> `2.5.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.1/compatibility-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.1/confidence-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.5.1`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​251-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev250v251-2022-09-06) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.0...v2.5.1) ##### Dependencies - Update dependency com.google.protobuf ([9225d58](https://togithub.com/googleapis/java-bigqueryconnection/commit/9225d58be057beec195baa55a48a183f923d1490))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b67d136aaf..8eb3aed362 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.0 + 2.5.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 75486d9ee1..858b5f67ad 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.0 + 2.5.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8a05c73040..62a336e916 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.0 + 2.5.1 test From 09deb29fe05aff72b23c73a486e367c85527f84e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 03:32:13 +0200 Subject: [PATCH 0905/2268] test(deps): update dependency org.mockito:mockito-core to v4.8.0 (#2266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.7.0` -> `4.8.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/compatibility-slim/4.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/confidence-slim/4.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    mockito/mockito ### [`v4.8.0`](https://togithub.com/mockito/mockito/releases/tag/v4.8.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.8.0 - 2022-09-07 - [10 commit(s)](https://togithub.com/mockito/mockito/compare/v4.7.0...v4.8.0) by Alex, James Baker, Johannes Spangenberg, Kurt Alfred Kluever, Rafael Winterhalter, Thibault Helsmoortel, dependabot\[bot] - GitHub Workflows security hardening [(#​2744)](https://togithub.com/mockito/mockito/pull/2744) - Assign GlobalConfiguration initializer to unused variable [(#​2742)](https://togithub.com/mockito/mockito/pull/2742) - Bump com.diffplug.spotless from 6.9.1 to 6.10.0 [(#​2738)](https://togithub.com/mockito/mockito/pull/2738) - Drop varargs collector before invoking a user method. [(#​2736)](https://togithub.com/mockito/mockito/pull/2736) - Bump versions.bytebuddy from 1.12.13 to 1.12.14 [(#​2734)](https://togithub.com/mockito/mockito/pull/2734) - Remove useless thrown exception from constructor [(#​2732)](https://togithub.com/mockito/mockito/pull/2732) - TypeSafeMatching no longer iterates over class methods inefficiently [(#​2729)](https://togithub.com/mockito/mockito/pull/2729) - Fixes [#​2720](https://togithub.com/mockito/mockito/issues/2720): Use StackWalker on Java 9+ to create Locations [(#​2723)](https://togithub.com/mockito/mockito/pull/2723) - LocationImpl adds performance overheads due to instantiating a stack trace [(#​2720)](https://togithub.com/mockito/mockito/issues/2720) - Fixes [#​2626](https://togithub.com/mockito/mockito/issues/2626) : Introduce MockSettings.mockMaker [(#​2701)](https://togithub.com/mockito/mockito/pull/2701) - Introduce option to disable inline-mock-maker for a specific instance [(#​2626)](https://togithub.com/mockito/mockito/issues/2626)
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7b28d73de..3cd8428573 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.7.0 + 4.8.0 test From 2779210ba759f868a507f3266a4e41a98e76f633 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 03:34:13 +0200 Subject: [PATCH 0906/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.11.2 (#2265) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.11.1` -> `2.11.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.11.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.11.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.11.2/compatibility-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.11.2/confidence-slim/2.11.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.11.2`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2112-httpsgithubcomgoogleapisjava-bigtablecomparev2111v2112-2022-09-07) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.11.1...v2.11.2) ##### Bug Fixes - Make cloud-monitoring a runtime dependency ([#​1371](https://togithub.com/googleapis/java-bigtable/issues/1371)) ([930d043](https://togithub.com/googleapis/java-bigtable/commit/930d0439086d2b43735f9583175adf0626952c9b)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.2 ([#​1373](https://togithub.com/googleapis/java-bigtable/issues/1373)) ([43b8052](https://togithub.com/googleapis/java-bigtable/commit/43b80523cc00932a414702ad96cfd86984c0f649)) - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.2 ([#​1374](https://togithub.com/googleapis/java-bigtable/issues/1374)) ([4174f0d](https://togithub.com/googleapis/java-bigtable/commit/4174f0dc1b61f954ccd1c2fcf88066179a4d430b))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8eb3aed362..be34671525 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.11.1 + 2.11.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 858b5f67ad..be1ac4c151 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.11.1 + 2.11.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 62a336e916..b746ce6e51 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.11.1 + 2.11.2 test From dbabfb5e31ac44ec238d206b2610a40179f56794 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 8 Sep 2022 16:22:15 -0400 Subject: [PATCH 0907/2268] chore: add setLocation in dataset creation sample (#2263) --- .../src/main/java/com/example/bigquery/CreateDataset.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java b/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java index 92e73d1131..f567c8df1b 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java @@ -37,7 +37,9 @@ public static void createDataset(String datasetName) { // once, and can be reused for multiple requests. BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); - DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); + String location = "US"; + + DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).setLocation(location).build(); Dataset newDataset = bigquery.create(datasetInfo); String newDatasetName = newDataset.getDatasetId().getDataset(); From 8472fe580a8197aaa3957dd3231fed0a9511fbb5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 05:48:38 +0200 Subject: [PATCH 0908/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 (#2267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.1` -> `3.0.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/compatibility-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.2/confidence-slim/3.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.0.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​302-httpsgithubcomgoogleapisjava-shared-dependenciescomparev301v302-2022-09-08) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.1...v3.0.2) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#​789](https://togithub.com/googleapis/java-shared-dependencies/issues/789)) ([6cf91a9](https://togithub.com/googleapis/java-shared-dependencies/commit/6cf91a96b9ea6af0fb845b50582dac7aa2892cab)) - Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#​781](https://togithub.com/googleapis/java-shared-dependencies/issues/781)) ([8859e61](https://togithub.com/googleapis/java-shared-dependencies/commit/8859e61808bfc5cd9546e27e945fc855b36d2554)) - Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#​790](https://togithub.com/googleapis/java-shared-dependencies/issues/790)) ([3431a47](https://togithub.com/googleapis/java-shared-dependencies/commit/3431a471cbf874a67a4f1a42e31f0ed891dedc92)) - Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#​773](https://togithub.com/googleapis/java-shared-dependencies/issues/773)) ([27fc79f](https://togithub.com/googleapis/java-shared-dependencies/commit/27fc79f00ee70011df6a368bb8fcfad7f0ce41f0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#​776](https://togithub.com/googleapis/java-shared-dependencies/issues/776)) ([bf333b8](https://togithub.com/googleapis/java-shared-dependencies/commit/bf333b8c88072d21cb959db4d3328bbb55d9ef5c)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#​780](https://togithub.com/googleapis/java-shared-dependencies/issues/780)) ([da7f44d](https://togithub.com/googleapis/java-shared-dependencies/commit/da7f44d71d6d7f372b5313dab68ce220308614d4)) - Update dependency io.grpc:grpc-bom to v1.48.1 ([#​768](https://togithub.com/googleapis/java-shared-dependencies/issues/768)) ([5c7768d](https://togithub.com/googleapis/java-shared-dependencies/commit/5c7768d3c9665dd356de6c39c0a6a5fa6e992f2e)) - Update dependency io.grpc:grpc-bom to v1.49.0 ([#​786](https://togithub.com/googleapis/java-shared-dependencies/issues/786)) ([8734812](https://togithub.com/googleapis/java-shared-dependencies/commit/8734812f1b4e2faaa48caf41eff59a85892ae344)) - Update dependency org.checkerframework:checker-qual to v3.24.0 ([#​775](https://togithub.com/googleapis/java-shared-dependencies/issues/775)) ([df74b7b](https://togithub.com/googleapis/java-shared-dependencies/commit/df74b7b0dd5dd592523f302d9fb36adb5991cb0b)) - Update dependency org.checkerframework:checker-qual to v3.25.0 ([#​788](https://togithub.com/googleapis/java-shared-dependencies/issues/788)) ([207035b](https://togithub.com/googleapis/java-shared-dependencies/commit/207035bd04c9305899eea540acbefaf06a7b1ec9)) - Update dependency org.threeten:threetenbp to v1.6.1 ([#​782](https://togithub.com/googleapis/java-shared-dependencies/issues/782)) ([0f218ae](https://togithub.com/googleapis/java-shared-dependencies/commit/0f218aeb6aa33cf1da4a8b1d6c82bbf87946dab9)) - Update gax.version to v2.19.0 ([#​785](https://togithub.com/googleapis/java-shared-dependencies/issues/785)) ([4448331](https://togithub.com/googleapis/java-shared-dependencies/commit/4448331c4c6d88ea8076260776d1d47d24aa19fa)) - Update google.core.version to v2.8.10 ([#​787](https://togithub.com/googleapis/java-shared-dependencies/issues/787)) ([3c344d5](https://togithub.com/googleapis/java-shared-dependencies/commit/3c344d515e3b9215db5a1f8ef550d800d974e558)) - Update google.core.version to v2.8.7 ([#​774](https://togithub.com/googleapis/java-shared-dependencies/issues/774)) ([d0cd5e8](https://togithub.com/googleapis/java-shared-dependencies/commit/d0cd5e8f6ca88787fe0dbf7f30c849cb4c4fae5e)) - Update google.core.version to v2.8.8 ([#​777](https://togithub.com/googleapis/java-shared-dependencies/issues/777)) ([f00571c](https://togithub.com/googleapis/java-shared-dependencies/commit/f00571cd1e9f1c4e011fba4a1e1674c1d8d60200)) - Update google.core.version to v2.8.9 ([#​784](https://togithub.com/googleapis/java-shared-dependencies/issues/784)) ([aa8e505](https://togithub.com/googleapis/java-shared-dependencies/commit/aa8e505dbb1214b2239e55d5ac83b00c167d77e4))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3cd8428573..2303469f12 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220827-2.0.0 - 3.0.1 + 3.0.2 9.0.0
    From 24517ca40e1c3a9d5debcc296781c73a38e5eab4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 17:18:24 +0200 Subject: [PATCH 0909/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.2 (#2268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.5.1` -> `2.5.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.2/compatibility-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.2/confidence-slim/2.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.5.2`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​252-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev251v252-2022-09-09) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.1...v2.5.2) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#​742](https://togithub.com/googleapis/java-bigqueryconnection/issues/742)) ([efad01d](https://togithub.com/googleapis/java-bigqueryconnection/commit/efad01d4579e1573822d593f4852522ccfeb7fc3))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index be34671525..57b8cd4cb0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.1 + 2.5.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index be1ac4c151..890a7f8ec2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.1 + 2.5.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b746ce6e51..ce0a357679 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.1 + 2.5.2 test From 4dd963b3ec7f75ff9b1b3b73b733c09c223f3fb7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 10 Sep 2022 04:22:20 +0000 Subject: [PATCH 0910/2268] chore: Generated snippets should not be owned by samples reviewers (#1575) (#2270) Source-Link: https://github.com/googleapis/synthtool/commit/2e9ac19d5b8181af77cdc5337cf922517813cc49 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 --- .github/.OwlBot.lock.yaml | 3 +-- .github/CODEOWNERS | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a20fd63005..6259292301 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:7a9a7eb50ca2af5bfffab3abd2f38d408735c990a74bacf9b7fde2af0a086a0b -# created: 2022-08-01T15:27:14.757266067Z + digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e5cf90602f..6aaf5360dd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,3 +13,6 @@ # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers + +# Generated snippets should not be owned by samples reviewers +samples/snippets/generated/ @googleapis/yoshi-java From 8c488e64259bd67716342f48f96d2932c5e57c3e Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 12 Sep 2022 15:48:52 -0400 Subject: [PATCH 0911/2268] feat: add reference file schema option for federated formats (#2269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add reference file schema option for federated formats * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix clirr check * chore: add assertion to tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add create external table tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: delete table for external table after testing * comment * cleanup * chore: remove enforced login from library code * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- .../clirr-ignored-differences.xml | 5 + .../bigquery/ExternalTableDefinition.java | 22 ++ .../cloud/bigquery/LoadJobConfiguration.java | 29 ++- .../cloud/bigquery/it/ITBigQueryTest.java | 202 ++++++++++++++++++ 4 files changed, 257 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 2ad26f9464..7a882777a9 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -14,4 +14,9 @@ com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *ReferenceFileSchemaUri(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 6ca64a8d78..cb327a3a9c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -157,6 +157,14 @@ public Builder setHivePartitioningOptions(HivePartitioningOptions hivePartitioni return setHivePartitioningOptionsInner(hivePartitioningOptions); }; + /** + * When creating an external table, the user can provide a reference file with the table schema. + * This is enabled for the following formats: AVRO, PARQUET, ORC. + * + * @param referenceFileSchemaUri or {@code null} for none + */ + public abstract Builder setReferenceFileSchemaUri(String referenceFileSchemaUri); + abstract Builder setHivePartitioningOptionsInner( HivePartitioningOptions hivePartitioningOptions); @@ -250,6 +258,9 @@ public F getFormatOptions() { @Nullable public abstract Boolean getAutodetect(); + @Nullable + public abstract String getReferenceFileSchemaUri(); + /** * [Experimental] Returns the HivePartitioningOptions when the data layout follows Hive * partitioning convention @@ -317,6 +328,10 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getAutodetect() != null) { externalConfigurationPb.setAutodetect(getAutodetect()); } + if (getReferenceFileSchemaUri() != null) { + externalConfigurationPb.setReferenceFileSchemaUri(getReferenceFileSchemaUri()); + } + if (getHivePartitioningOptions() != null) { externalConfigurationPb.setHivePartitioningOptions(getHivePartitioningOptions().toPb()); } @@ -486,6 +501,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { builder.setHivePartitioningOptions( HivePartitioningOptions.fromPb(externalDataConfiguration.getHivePartitioningOptions())); } + if (externalDataConfiguration.getReferenceFileSchemaUri() != null) { + builder.setReferenceFileSchemaUri(externalDataConfiguration.getReferenceFileSchemaUri()); + } } return builder.build(); } @@ -538,10 +556,14 @@ static ExternalTableDefinition fromExternalDataConfiguration( if (externalDataConfiguration.getAutodetect() != null) { builder.setAutodetect(externalDataConfiguration.getAutodetect()); } + if (externalDataConfiguration.getReferenceFileSchemaUri() != null) { + builder.setReferenceFileSchemaUri(externalDataConfiguration.getReferenceFileSchemaUri()); + } if (externalDataConfiguration.getHivePartitioningOptions() != null) { builder.setHivePartitioningOptions( HivePartitioningOptions.fromPb(externalDataConfiguration.getHivePartitioningOptions())); } + return builder.build(); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 2f625acf54..ee142be010 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -56,6 +56,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final Long jobTimeoutMs; private final RangePartitioning rangePartitioning; private final HivePartitioningOptions hivePartitioningOptions; + private final String referenceFileSchemaUri; public static final class Builder extends JobConfiguration.Builder implements LoadConfiguration.Builder { @@ -81,6 +82,7 @@ public static final class Builder extends JobConfiguration.Builder SOURCE_URIS = + ImmutableList.of( + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.avro", + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/b-twitter.avro", + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/c-twitter.avro"); + + // Because referenceFileSchemaUri is set as a-twitter, the table will have a-twitter schema + String referenceFileSchema = + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.avro"; + + LoadJobConfiguration loadJobConfiguration = + LoadJobConfiguration.newBuilder(tableId, SOURCE_URIS, FormatOptions.avro()) + .setReferenceFileSchemaUri(referenceFileSchema) + .build(); + + Job job = bigquery.create(JobInfo.of(loadJobConfiguration)); + // Blocks until this load table job completes its execution, either failing or succeeding. + job = job.waitFor(); + assertEquals(true, job.isDone()); + + LoadJobConfiguration actualLoadJobConfiguration = job.getConfiguration(); + Table generatedTable = bigquery.getTable(actualLoadJobConfiguration.getDestinationTable()); + + assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); + // clean up after test to avoid conflict with other tests + boolean success = bigquery.delete(tableId); + assertEquals(true, success); + } catch (BigQueryException | InterruptedException e) { + System.out.println("Column not added during load append \n" + e.toString()); + } + } + + @Test + public void testReferenceFileSchemaUriForParquet() { + try { + String destinationTableName = "test_reference_file_schema_parquet"; + TableId tableId = TableId.of(DATASET, destinationTableName); + Schema expectedSchema = + Schema.of( + Field.newBuilder("username", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build(), + Field.newBuilder("tweet", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build(), + Field.newBuilder("timestamp", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build(), + Field.newBuilder("likes", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + + // By default, the table should have c-twitter schema because it is lexicographically last. + // a-twitter schema (username, tweet, timestamp, likes) + // b-twitter schema (username, tweet, timestamp) + // c-twitter schema (username, tweet) + List SOURCE_URIS = + ImmutableList.of( + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.parquet", + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/b-twitter.parquet", + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/c-twitter.parquet"); + + // Because referenceFileSchemaUri is set as a-twitter, the table will have a-twitter schema + String referenceFileSchema = + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.parquet"; + + LoadJobConfiguration loadJobConfiguration = + LoadJobConfiguration.newBuilder(tableId, SOURCE_URIS, FormatOptions.parquet()) + .setReferenceFileSchemaUri(referenceFileSchema) + .build(); + + Job job = bigquery.create(JobInfo.of(loadJobConfiguration)); + // Blocks until this load table job completes its execution, either failing or succeeding. + job = job.waitFor(); + assertEquals(true, job.isDone()); + LoadJobConfiguration actualLoadJobConfiguration = job.getConfiguration(); + Table generatedTable = bigquery.getTable(actualLoadJobConfiguration.getDestinationTable()); + + assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); + // clean up after test to avoid conflict with other tests + boolean success = bigquery.delete(tableId); + assertEquals(true, success); + } catch (BigQueryException | InterruptedException e) { + System.out.println("Column not added during load append \n" + e.toString()); + } + } + + @Test + public void testCreateExternalTableWithReferenceFileSchemaAvro() { + String destinationTableName = "test_create_external_table_reference_file_schema_avro"; + TableId tableId = TableId.of(DATASET, destinationTableName); + Schema expectedSchema = + Schema.of( + Field.newBuilder("username", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build(), + Field.newBuilder("tweet", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build(), + Field.newBuilder("timestamp", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build(), + Field.newBuilder("likes", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + String CLOUD_SAMPLES_DATA = "cloud-samples-data"; + + // By default, the table should have c-twitter schema because it is lexicographically last. + // a-twitter schema (username, tweet, timestamp, likes) + // b-twitter schema (username, tweet, timestamp) + // c-twitter schema (username, tweet) + String SOURCE_URI = + "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/federated-formats-reference-file-schema/*.avro"; + + // Because referenceFileSchemaUri is set as a-twitter, the table will have a-twitter schema + String referenceFileSchema = + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.avro"; + + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder(SOURCE_URI, FormatOptions.avro()) + .setReferenceFileSchemaUri(referenceFileSchema) + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + Table generatedTable = bigquery.getTable(createdTable.getTableId()); + assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); + // clean up after test to avoid conflict with other tests + boolean success = bigquery.delete(tableId); + assertEquals(true, success); + } + + @Test + public void testCreateExternalTableWithReferenceFileSchemaParquet() { + String destinationTableName = "test_create_external_table_reference_file_schema_parquet"; + TableId tableId = TableId.of(DATASET, destinationTableName); + Schema expectedSchema = + Schema.of( + Field.newBuilder("username", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build(), + Field.newBuilder("tweet", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build(), + Field.newBuilder("timestamp", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build(), + Field.newBuilder("likes", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + String CLOUD_SAMPLES_DATA = "cloud-samples-data"; + + // By default, the table should have c-twitter schema because it is lexicographically last. + // a-twitter schema (username, tweet, timestamp, likes) + // b-twitter schema (username, tweet, timestamp) + // c-twitter schema (username, tweet) + String SOURCE_URI = + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/*.parquet"; + + // Because referenceFileSchemaUri is set as a-twitter, the table will have a-twitter schema + String referenceFileSchema = + "gs://" + + CLOUD_SAMPLES_DATA + + "/bigquery/federated-formats-reference-file-schema/a-twitter.parquet"; + + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder(SOURCE_URI, FormatOptions.parquet()) + .setReferenceFileSchemaUri(referenceFileSchema) + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + Table generatedTable = bigquery.getTable(createdTable.getTableId()); + assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); + // clean up after test to avoid conflict with other tests + boolean success = bigquery.delete(tableId); + assertEquals(true, success); + } } From 0700ea3c0f1fc8cf2ef05d1c73509be911c65148 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 20:32:12 +0000 Subject: [PATCH 0912/2268] chore(main): release 2.16.0 (#2255) :robot: I have created a release *beep* *boop* --- ## [2.16.0](https://github.com/googleapis/java-bigquery/compare/v2.15.0...v2.16.0) (2022-09-12) ### Features * Add preserveAsciiControlCharacters to CsvOptions ([#2143](https://github.com/googleapis/java-bigquery/issues/2143)) ([856893f](https://github.com/googleapis/java-bigquery/commit/856893f4d8f1b419365d8f179ce9f9e571dec718)) * Add reference file schema option for federated formats ([#2269](https://github.com/googleapis/java-bigquery/issues/2269)) ([8c488e6](https://github.com/googleapis/java-bigquery/commit/8c488e64259bd67716342f48f96d2932c5e57c3e)) ### Bug Fixes * Socket-timeout at bigquery.it.ITNightlyBigQueryTest: testForTableNotFound ([#2260](https://github.com/googleapis/java-bigquery/issues/2260)) ([a9b5fb2](https://github.com/googleapis/java-bigquery/commit/a9b5fb2c1078788ddb1ac3169c9ce597af228ac0)) ### Dependencies * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20220827-2.0.0 ([#2261](https://github.com/googleapis/java-bigquery/issues/2261)) ([3c67d21](https://github.com/googleapis/java-bigquery/commit/3c67d21c10f66b3c5313a1733f4e81db42c1b7c3)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.3 ([#2259](https://github.com/googleapis/java-bigquery/issues/2259)) ([5e30a04](https://github.com/googleapis/java-bigquery/commit/5e30a04e5b14b03e60e587787180b27f605d6abd)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#2267](https://github.com/googleapis/java-bigquery/issues/2267)) ([8472fe5](https://github.com/googleapis/java-bigquery/commit/8472fe580a8197aaa3957dd3231fed0a9511fbb5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83e0bea157..12c388f6a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.16.0](https://github.com/googleapis/java-bigquery/compare/v2.15.0...v2.16.0) (2022-09-12) + + +### Features + +* Add preserveAsciiControlCharacters to CsvOptions ([#2143](https://github.com/googleapis/java-bigquery/issues/2143)) ([856893f](https://github.com/googleapis/java-bigquery/commit/856893f4d8f1b419365d8f179ce9f9e571dec718)) +* Add reference file schema option for federated formats ([#2269](https://github.com/googleapis/java-bigquery/issues/2269)) ([8c488e6](https://github.com/googleapis/java-bigquery/commit/8c488e64259bd67716342f48f96d2932c5e57c3e)) + + +### Bug Fixes + +* Socket-timeout at bigquery.it.ITNightlyBigQueryTest: testForTableNotFound ([#2260](https://github.com/googleapis/java-bigquery/issues/2260)) ([a9b5fb2](https://github.com/googleapis/java-bigquery/commit/a9b5fb2c1078788ddb1ac3169c9ce597af228ac0)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20220827-2.0.0 ([#2261](https://github.com/googleapis/java-bigquery/issues/2261)) ([3c67d21](https://github.com/googleapis/java-bigquery/commit/3c67d21c10f66b3c5313a1733f4e81db42c1b7c3)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.9.3 ([#2259](https://github.com/googleapis/java-bigquery/issues/2259)) ([5e30a04](https://github.com/googleapis/java-bigquery/commit/5e30a04e5b14b03e60e587787180b27f605d6abd)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#2267](https://github.com/googleapis/java-bigquery/issues/2267)) ([8472fe5](https://github.com/googleapis/java-bigquery/commit/8472fe580a8197aaa3957dd3231fed0a9511fbb5)) + ## [2.15.0](https://github.com/googleapis/java-bigquery/compare/v2.14.7...v2.15.0) (2022-08-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ff262b1cbd..1e1c8b411f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.15.1-SNAPSHOT + 2.16.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index fe9c140db6..dd8c38df8a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.15.1-SNAPSHOT + 2.16.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.15.1-SNAPSHOT + 2.16.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2303469f12..3a9cf372ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.15.1-SNAPSHOT + 2.16.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.15.1-SNAPSHOT + 2.16.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 890a7f8ec2..ea71156cf4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.15.1-SNAPSHOT + 2.16.0 diff --git a/versions.txt b/versions.txt index 0cda752ce8..f440a1cfb0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.15.0:2.15.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.16.0:2.16.0 \ No newline at end of file From c04458b0400ed81c95db352e3fd1d9ed94d273f6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 21:00:17 +0000 Subject: [PATCH 0913/2268] chore(main): release 2.16.1-SNAPSHOT (#2271) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1e1c8b411f..520747a1ad 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.16.0 + 2.16.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index dd8c38df8a..f5e19bc059 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.16.0 + 2.16.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3a9cf372ca..f8cce60dda 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.16.0 + 2.16.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ea71156cf4..83cda01d71 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index f440a1cfb0..b75e916903 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.16.0:2.16.0 \ No newline at end of file +google-cloud-bigquery:2.16.0:2.16.1-SNAPSHOT \ No newline at end of file From ae74c1b65f89a55e8a127ffb4a777910265dc190 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 13 Sep 2022 20:56:14 +0200 Subject: [PATCH 0914/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.16.0 (#2272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.15.0` -> `2.16.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.16.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.16.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.16.0/compatibility-slim/2.15.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.16.0/confidence-slim/2.15.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 087f280877..c2a0a89f91 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.15.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.16.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.15.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.16.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 57b8cd4cb0..7efddf8666 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.15.0 + 2.16.0 From 4c9952b4f8bc81a66f2a43ecbb9fa85774ed8a93 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 16:00:35 +0200 Subject: [PATCH 0915/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 (#2274) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.2` -> `3.0.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/compatibility-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.3/confidence-slim/3.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.0.3`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​303-httpsgithubcomgoogleapisjava-shared-dependenciescomparev302v303-2022-09-14) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.2...v3.0.3) ##### Dependencies - Google-cloud-core 2.8.12 ([#​799](https://togithub.com/googleapis/java-shared-dependencies/issues/799)) ([1b3db8d](https://togithub.com/googleapis/java-shared-dependencies/commit/1b3db8d1e17c49ebae79fc96164fa9058e1df6e3)) - Moving gson to first-party-dependencies ([#​800](https://togithub.com/googleapis/java-shared-dependencies/issues/800)) ([a41fcc1](https://togithub.com/googleapis/java-shared-dependencies/commit/a41fcc11d32e02e5af2837561792e3919f6d4b3f)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.6 ([#​797](https://togithub.com/googleapis/java-shared-dependencies/issues/797)) ([bc5fdc9](https://togithub.com/googleapis/java-shared-dependencies/commit/bc5fdc9b3af7973c28f063a9ac156fe2af562814)) - Update gax.version to v2.19.1 ([#​798](https://togithub.com/googleapis/java-shared-dependencies/issues/798)) ([84e5487](https://togithub.com/googleapis/java-shared-dependencies/commit/84e5487b2e3dce4bb60badecebde788c3cb702b8)) - Update google.core.version to v2.8.11 ([#​793](https://togithub.com/googleapis/java-shared-dependencies/issues/793)) ([63c1297](https://togithub.com/googleapis/java-shared-dependencies/commit/63c129722aa0b821031ff5b4c11004adf7b12044))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f8cce60dda..9303114f50 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220827-2.0.0 - 3.0.2 + 3.0.3 9.0.0
    From c689646fb554305e47072c7db7765298fd62b2af Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:28:14 +0000 Subject: [PATCH 0916/2268] chore(main): release 2.16.1 (#2275) :robot: I have created a release *beep* *boop* --- ## [2.16.1](https://github.com/googleapis/java-bigquery/compare/v2.16.0...v2.16.1) (2022-09-15) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#2274](https://github.com/googleapis/java-bigquery/issues/2274)) ([4c9952b](https://github.com/googleapis/java-bigquery/commit/4c9952b4f8bc81a66f2a43ecbb9fa85774ed8a93)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c388f6a6..d3c6eb5732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.16.1](https://github.com/googleapis/java-bigquery/compare/v2.16.0...v2.16.1) (2022-09-15) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#2274](https://github.com/googleapis/java-bigquery/issues/2274)) ([4c9952b](https://github.com/googleapis/java-bigquery/commit/4c9952b4f8bc81a66f2a43ecbb9fa85774ed8a93)) + ## [2.16.0](https://github.com/googleapis/java-bigquery/compare/v2.15.0...v2.16.0) (2022-09-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 520747a1ad..1c16d81713 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.16.1-SNAPSHOT + 2.16.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f5e19bc059..c99cb8f358 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.16.1-SNAPSHOT + 2.16.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.16.1-SNAPSHOT + 2.16.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9303114f50..df4693957b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.16.1-SNAPSHOT + 2.16.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.16.1-SNAPSHOT + 2.16.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 83cda01d71..f782944ad3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.16.1-SNAPSHOT + 2.16.1 diff --git a/versions.txt b/versions.txt index b75e916903..6258721f77 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.16.0:2.16.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.16.1:2.16.1 \ No newline at end of file From cfb8ec8a0d27f977ad5219d521259452ae82ece8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:58:16 +0000 Subject: [PATCH 0917/2268] chore(main): release 2.16.2-SNAPSHOT (#2276) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1c16d81713..6d5c419805 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.16.1 + 2.16.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c99cb8f358..8c1c8fa420 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.16.1 + 2.16.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.16.1 + 2.16.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index df4693957b..b58ea428f9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.16.1 + 2.16.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.16.1 + 2.16.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f782944ad3..ebf31253db 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.16.1 + 2.16.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 6258721f77..4ce606254a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.16.1:2.16.1 \ No newline at end of file +google-cloud-bigquery:2.16.1:2.16.2-SNAPSHOT \ No newline at end of file From ecb22ad203355adb7e3041d314dd3308bc472b02 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 17:31:27 +0200 Subject: [PATCH 0918/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.0 (#2273) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 6d5c419805..2630afedd1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0 + 3.4.0 package From 3db6b05a937488cf7cb8ba7fe4906336a093e331 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 15 Sep 2022 18:18:41 +0200 Subject: [PATCH 0919/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 (#2277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2a0a89f91..36c8474dde 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.16.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.16.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.16.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.16.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7efddf8666..49a66040af 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.16.0 + 2.16.1 From d659efe2618030d4ad23069b65a717c5bba0d5bb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 08:06:20 +0200 Subject: [PATCH 0920/2268] deps: update cloud client dependencies (#2278) --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index b58ea428f9..87fa2e6278 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.20.1 + 2.21.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.3 + 1.9.4 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.3 + 1.9.4 pom import @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.11.3 + 2.12.0 test From 65afbffd66048828563fa691c66e08606637dd31 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 08:07:04 +0200 Subject: [PATCH 0921/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.3 (#2280) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 49a66040af..2fb704bf7a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.2 + 2.5.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ebf31253db..db36f12b34 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.2 + 2.5.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ce0a357679..b79682d267 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.2 + 2.5.3 test From e613c936be4980b26c19f503a7aaa11e733b9da1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 17:44:17 +0200 Subject: [PATCH 0922/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.2 (#2281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.1` -> `26.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/compatibility-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.2/confidence-slim/26.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 36c8474dde..40e670c76c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.1 + 26.1.2 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.1') +implementation platform('com.google.cloud:libraries-bom:26.1.2') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index a181739e02..f0331016ee 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.1 + 26.1.2 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b79682d267..50a3a51216 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.1 + 26.1.2 pom import From 7d3852e7ee1db79d602a526655e19ff1c063102d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 19:08:42 +0200 Subject: [PATCH 0923/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.4 (#2284) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2fb704bf7a..e4f2d09c69 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.3 + 2.5.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index db36f12b34..62ab9ad226 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.3 + 2.5.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 50a3a51216..e514ef6c5a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.3 + 2.5.4 test From 1e3a3009e51c833e0190791015ac9b85de0e470f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 19:32:17 +0200 Subject: [PATCH 0924/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.12.0 (#2279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.11.2` -> `2.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.12.0/compatibility-slim/2.11.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.12.0/confidence-slim/2.11.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.12.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2120-httpsgithubcomgoogleapisjava-bigtablecomparev2112v2120-2022-09-15) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.11.2...v2.12.0) ##### Features - **generated:** Publish CBT deletion_protection field in Table, UpdateTableRequest, and UpdateTable API ([f1f3f05](https://togithub.com/googleapis/java-bigtable/commit/f1f3f05ae2dc84a8dc853eb5467fbd157b7293c3)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.3 ([#​1386](https://togithub.com/googleapis/java-bigtable/issues/1386)) ([f460373](https://togithub.com/googleapis/java-bigtable/commit/f460373eb74776fae1787b74392b508643e6139f)) - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.3 ([#​1387](https://togithub.com/googleapis/java-bigtable/issues/1387)) ([e339cb1](https://togithub.com/googleapis/java-bigtable/commit/e339cb186289fa53a0d65c3d77fb7edbae737882)) - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.4 ([#​1395](https://togithub.com/googleapis/java-bigtable/issues/1395)) ([a2db183](https://togithub.com/googleapis/java-bigtable/commit/a2db183dea46cd83ea70bb89848e0579b9c61fac)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#​1384](https://togithub.com/googleapis/java-bigtable/issues/1384)) ([ee3b256](https://togithub.com/googleapis/java-bigtable/commit/ee3b256a62c2665e2c4230d9acfc14c3d5c2aebf)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#​1393](https://togithub.com/googleapis/java-bigtable/issues/1393)) ([df6c6c7](https://togithub.com/googleapis/java-bigtable/commit/df6c6c79715ecc7b99e026ce8dfa8645765fc9d5))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e4f2d09c69..7dc3230913 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.11.2 + 2.12.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 62ab9ad226..78d8b7bf76 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.11.2 + 2.12.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e514ef6c5a..9fc97ffc1f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.11.2 + 2.12.0 test From 65fac188db2514ae620fb5146055591cfe6ac995 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 21 Sep 2022 16:22:22 +0200 Subject: [PATCH 0925/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 (#2285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.junit.vintage:junit-vintage-engine](https://junit.org/junit5/) ([source](https://togithub.com/junit-team/junit5)) | `5.9.0` -> `5.9.1` | [![age](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.1/compatibility-slim/5.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.1/confidence-slim/5.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index f0331016ee..ef8404d5a7 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.9.0 + 5.9.1 test From fa331844dc1862120867d73ad87d87587a388576 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 22 Sep 2022 18:04:38 +0200 Subject: [PATCH 0926/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220913-2.0.0 (#2287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220827-2.0.0` -> `v2-rev20220913-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220913-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220913-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220913-2.0.0/compatibility-slim/v2-rev20220827-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220913-2.0.0/confidence-slim/v2-rev20220827-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 87fa2e6278..8458ba8724 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220827-2.0.0 + v2-rev20220913-2.0.0 3.0.3 9.0.0
    From 959519cd9e5910ba7d93cce00c318ed322dcaf23 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 22 Sep 2022 18:08:18 +0200 Subject: [PATCH 0927/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.14 (#2288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.13` -> `0.9.14` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.14/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.14/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.14/compatibility-slim/0.9.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.14/confidence-slim/0.9.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.14`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.14) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.13...0.9.14) #### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Fix how the GRAALVM_QUICK_BUILD env var is read by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/278](https://togithub.com/graalvm/native-build-tools/pull/278) - Make it possible to pass env vars to the builder process by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/280](https://togithub.com/graalvm/native-build-tools/pull/280) - Maven plugin fixes by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/274](https://togithub.com/graalvm/native-build-tools/pull/274) - Add support for `test-jar` artifacts by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/281](https://togithub.com/graalvm/native-build-tools/pull/281) - Add Gradle CLI options for quick build and debugging by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/286](https://togithub.com/graalvm/native-build-tools/pull/286) - Add a changelog and docs about build -> compile-no-fork changes by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/290](https://togithub.com/graalvm/native-build-tools/pull/290) - Do not filter out entry values starting with `java.` in the metadata post-processing action by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/289](https://togithub.com/graalvm/native-build-tools/pull/289) - Try to fix snapshot publishing by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/244](https://togithub.com/graalvm/native-build-tools/pull/244) - Fix javadoc and warnings by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/291](https://togithub.com/graalvm/native-build-tools/pull/291) - Bump the default metadata repository version to 0.1.2 by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/294](https://togithub.com/graalvm/native-build-tools/pull/294) - Fix metadata repository crash by [@​dnestoro](https://togithub.com/dnestoro) in [https://github.com/graalvm/native-build-tools/pull/295](https://togithub.com/graalvm/native-build-tools/pull/295) - Add support for override flag by [@​sdeleuze](https://togithub.com/sdeleuze) in [https://github.com/graalvm/native-build-tools/pull/296](https://togithub.com/graalvm/native-build-tools/pull/296) - Fix build time initialization error with JUnit 5.9.0 by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/308](https://togithub.com/graalvm/native-build-tools/pull/308) - Fix compatibility with configuration cache by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/304](https://togithub.com/graalvm/native-build-tools/pull/304) - Bump metadata repository version by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/310](https://togithub.com/graalvm/native-build-tools/pull/310) #### New Contributors - [@​dnestoro](https://togithub.com/dnestoro) made their first contribution in [https://github.com/graalvm/native-build-tools/pull/295](https://togithub.com/graalvm/native-build-tools/pull/295) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.13...0.9.14
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index ef8404d5a7..1daeb21e57 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.13 + 0.9.14 test From 28dd4e86182a4c8a1db9f9015dcdc7256e5b0b5a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:50:35 +0000 Subject: [PATCH 0928/2268] chore: exclude requirements.txt file from renovate-bot (#1594) (#2293) Source-Link: https://github.com/googleapis/synthtool/commit/f58d3135a2fab20e225d98741dbc06d57459b816 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release/publish_javadoc.sh | 2 +- .kokoro/release/publish_javadoc11.sh | 2 +- .kokoro/release/stage.sh | 3 +- .kokoro/requirements.in | 31 ++ .kokoro/requirements.txt | 452 +++++++++++++++++++++++++++ 6 files changed, 488 insertions(+), 4 deletions(-) create mode 100644 .kokoro/requirements.in create mode 100644 .kokoro/requirements.txt diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6259292301..42327db5e2 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:8175681a918181d306d9c370d3262f16b4c724cc73d74111b7d42fc985ca7f93 + digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index 2acd135afe..5d8cd8beec 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -28,7 +28,7 @@ fi pushd $(dirname "$0")/../../ # install docuploader package -python3 -m pip install gcp-docuploader +python3 -m pip install --require-hashes -r .kokoro/requirements.txt # compile all packages mvn clean install -B -q -DskipTests=true diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh index aab9723455..b65cd03b6b 100755 --- a/.kokoro/release/publish_javadoc11.sh +++ b/.kokoro/release/publish_javadoc11.sh @@ -28,7 +28,7 @@ fi pushd $(dirname "$0")/../../ # install docuploader package -python3 -m pip install gcp-docuploader +python3 -m pip install --require-hashes -r .kokoro/requirements.txt # compile all packages mvn clean install -B -q -DskipTests=true diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 1dba8de108..61e714d6ba 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -16,7 +16,8 @@ set -eo pipefail # Start the releasetool reporter -python3 -m pip install gcp-releasetool +requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) +python3 -m pip install --require-hashes -r $requirementsFile python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script source $(dirname "$0")/common.sh diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in new file mode 100644 index 0000000000..cfdc2e7ed9 --- /dev/null +++ b/.kokoro/requirements.in @@ -0,0 +1,31 @@ +gcp-docuploader==0.6.3 +google-crc32c==1.3.0 +googleapis-common-protos==1.56.3 +gcp-releasetool==1.8.7 +cachetools==4.2.4 +cffi==1.15.1 +jeepney==0.7.1 +jinja2==3.0.3 +markupsafe==2.0.1 +keyring==23.4.1 +packaging==21.3 +protobuf==3.19.5 +pyjwt==2.4.0 +pyparsing==3.0.9 +pycparser==2.21 +pyperclip==1.8.2 +python-dateutil==2.8.2 +requests==2.27.1 +importlib-metadata==4.8.3 +zipp==3.6.0 +google_api_core==2.8.2 +google-cloud-storage==2.0.0 +google-cloud-core==2.3.1 +typing-extensions==4.1.1 +urllib3==1.26.12 +zipp==3.6.0 +rsa==4.9 +six==1.16.0 +attrs==22.1.0 +google-auth==2.11.0 +idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt new file mode 100644 index 0000000000..170f1c63ab --- /dev/null +++ b/.kokoro/requirements.txt @@ -0,0 +1,452 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile --allow-unsafe --generate-hashes requirements.in +# +attrs==22.1.0 \ + --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ + --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c + # via + # -r requirements.in + # gcp-releasetool +cachetools==4.2.4 \ + --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ + --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 + # via + # -r requirements.in + # google-auth +certifi==2022.9.14 \ + --hash=sha256:36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5 \ + --hash=sha256:e232343de1ab72c2aa521b625c80f699e356830fd0e2c620b465b304b17b0516 + # via requests +cffi==1.15.1 \ + --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ + --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ + --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ + --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ + --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ + --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ + --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ + --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ + --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ + --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ + --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ + --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ + --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ + --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ + --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ + --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ + --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ + --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ + --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ + --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ + --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ + --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ + --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ + --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ + --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ + --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ + --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ + --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ + --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ + --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ + --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ + --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ + --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ + --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ + --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ + --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ + --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ + --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ + --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ + --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ + --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ + --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ + --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ + --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ + --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ + --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ + --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ + --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ + --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ + --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ + --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ + --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ + --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ + --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ + --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ + --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ + --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ + --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ + --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ + --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ + --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ + --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ + --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ + --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 + # via + # -r requirements.in + # cryptography +charset-normalizer==2.0.12 \ + --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ + --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df + # via requests +click==8.0.4 \ + --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ + --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb + # via + # gcp-docuploader + # gcp-releasetool +colorlog==6.7.0 \ + --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ + --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 + # via gcp-docuploader +cryptography==38.0.1 \ + --hash=sha256:0297ffc478bdd237f5ca3a7dc96fc0d315670bfa099c04dc3a4a2172008a405a \ + --hash=sha256:10d1f29d6292fc95acb597bacefd5b9e812099d75a6469004fd38ba5471a977f \ + --hash=sha256:16fa61e7481f4b77ef53991075de29fc5bacb582a1244046d2e8b4bb72ef66d0 \ + --hash=sha256:194044c6b89a2f9f169df475cc167f6157eb9151cc69af8a2a163481d45cc407 \ + --hash=sha256:1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7 \ + --hash=sha256:3261725c0ef84e7592597606f6583385fed2a5ec3909f43bc475ade9729a41d6 \ + --hash=sha256:3b72c360427889b40f36dc214630e688c2fe03e16c162ef0aa41da7ab1455153 \ + --hash=sha256:3e3a2599e640927089f932295a9a247fc40a5bdf69b0484532f530471a382750 \ + --hash=sha256:3fc26e22840b77326a764ceb5f02ca2d342305fba08f002a8c1f139540cdfaad \ + --hash=sha256:5067ee7f2bce36b11d0e334abcd1ccf8c541fc0bbdaf57cdd511fdee53e879b6 \ + --hash=sha256:52e7bee800ec869b4031093875279f1ff2ed12c1e2f74923e8f49c916afd1d3b \ + --hash=sha256:64760ba5331e3f1794d0bcaabc0d0c39e8c60bf67d09c93dc0e54189dfd7cfe5 \ + --hash=sha256:765fa194a0f3372d83005ab83ab35d7c5526c4e22951e46059b8ac678b44fa5a \ + --hash=sha256:79473cf8a5cbc471979bd9378c9f425384980fcf2ab6534b18ed7d0d9843987d \ + --hash=sha256:896dd3a66959d3a5ddcfc140a53391f69ff1e8f25d93f0e2e7830c6de90ceb9d \ + --hash=sha256:89ed49784ba88c221756ff4d4755dbc03b3c8d2c5103f6d6b4f83a0fb1e85294 \ + --hash=sha256:ac7e48f7e7261207d750fa7e55eac2d45f720027d5703cd9007e9b37bbb59ac0 \ + --hash=sha256:ad7353f6ddf285aeadfaf79e5a6829110106ff8189391704c1d8801aa0bae45a \ + --hash=sha256:b0163a849b6f315bf52815e238bc2b2346604413fa7c1601eea84bcddb5fb9ac \ + --hash=sha256:b6c9b706316d7b5a137c35e14f4103e2115b088c412140fdbd5f87c73284df61 \ + --hash=sha256:c2e5856248a416767322c8668ef1845ad46ee62629266f84a8f007a317141013 \ + --hash=sha256:ca9f6784ea96b55ff41708b92c3f6aeaebde4c560308e5fbbd3173fbc466e94e \ + --hash=sha256:d1a5bd52d684e49a36582193e0b89ff267704cd4025abefb9e26803adeb3e5fb \ + --hash=sha256:d3971e2749a723e9084dd507584e2a2761f78ad2c638aa31e80bc7a15c9db4f9 \ + --hash=sha256:d4ef6cc305394ed669d4d9eebf10d3a101059bdcf2669c366ec1d14e4fb227bd \ + --hash=sha256:d9e69ae01f99abe6ad646947bba8941e896cb3aa805be2597a0400e0764b5818 + # via + # gcp-releasetool + # secretstorage +gcp-docuploader==0.6.3 \ + --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ + --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b + # via -r requirements.in +gcp-releasetool==1.8.7 \ + --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ + --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d + # via -r requirements.in +google-api-core==2.8.2 \ + --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ + --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 + # via + # -r requirements.in + # google-cloud-core + # google-cloud-storage +google-auth==2.11.0 \ + --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ + --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-core + # google-cloud-storage +google-cloud-core==2.3.1 \ + --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ + --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 + # via + # -r requirements.in + # google-cloud-storage +google-cloud-storage==2.0.0 \ + --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ + --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 + # via + # -r requirements.in + # gcp-docuploader +google-crc32c==1.3.0 \ + --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ + --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ + --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ + --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ + --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ + --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ + --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ + --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ + --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ + --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ + --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ + --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ + --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ + --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ + --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ + --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ + --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ + --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ + --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ + --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ + --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ + --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ + --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ + --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ + --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ + --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ + --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ + --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ + --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ + --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ + --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ + --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ + --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ + --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ + --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ + --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ + --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ + --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ + --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ + --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ + --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ + --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ + --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 + # via + # -r requirements.in + # google-resumable-media +google-resumable-media==2.3.3 \ + --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ + --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 + # via google-cloud-storage +googleapis-common-protos==1.56.3 \ + --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ + --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 + # via + # -r requirements.in + # google-api-core +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 + # via + # -r requirements.in + # requests +importlib-metadata==4.8.3 \ + --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ + --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 + # via + # -r requirements.in + # keyring +jeepney==0.7.1 \ + --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ + --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f + # via + # -r requirements.in + # keyring + # secretstorage +jinja2==3.0.3 \ + --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ + --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 + # via + # -r requirements.in + # gcp-releasetool +keyring==23.4.1 \ + --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ + --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 + # via + # -r requirements.in + # gcp-releasetool +markupsafe==2.0.1 \ + --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ + --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ + --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ + --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ + --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ + --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ + --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ + --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ + --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ + --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ + --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ + --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ + --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ + --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ + --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ + --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ + --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ + --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ + --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ + --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ + --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ + --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ + --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ + --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ + --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ + --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ + --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ + --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ + --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ + --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ + --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ + --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ + --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ + --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ + --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ + --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ + --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ + --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ + --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ + --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ + --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ + --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ + --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ + --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ + --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ + --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ + --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ + --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ + --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ + --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ + --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ + --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ + --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ + --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ + --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ + --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ + --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ + --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ + --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ + --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ + --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ + --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ + --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ + --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ + --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ + --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ + --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ + --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ + --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 + # via + # -r requirements.in + # jinja2 +packaging==21.3 \ + --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ + --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 + # via + # -r requirements.in + # gcp-releasetool +protobuf==3.19.5 \ + --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ + --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ + --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ + --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ + --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ + --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ + --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ + --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ + --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ + --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ + --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ + --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ + --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ + --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ + --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ + --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ + --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ + --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ + --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ + --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ + --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ + --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ + --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ + --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ + --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ + --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de + # via + # -r requirements.in + # gcp-docuploader + # gcp-releasetool + # google-api-core + # google-cloud-storage + # googleapis-common-protos +pyasn1==0.4.8 \ + --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ + --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba + # via + # pyasn1-modules + # rsa +pyasn1-modules==0.2.8 \ + --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ + --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 + # via google-auth +pycparser==2.21 \ + --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ + --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 + # via + # -r requirements.in + # cffi +pyjwt==2.4.0 \ + --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ + --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba + # via + # -r requirements.in + # gcp-releasetool +pyparsing==3.0.9 \ + --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ + --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc + # via + # -r requirements.in + # packaging +pyperclip==1.8.2 \ + --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 + # via + # -r requirements.in + # gcp-releasetool +python-dateutil==2.8.2 \ + --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ + --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 + # via + # -r requirements.in + # gcp-releasetool +requests==2.27.1 \ + --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ + --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d + # via + # -r requirements.in + # gcp-releasetool + # google-api-core + # google-cloud-storage +rsa==4.9 \ + --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ + --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 + # via + # -r requirements.in + # google-auth +secretstorage==3.3.3 \ + --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ + --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 + # via keyring +six==1.16.0 \ + --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ + --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 + # via + # -r requirements.in + # gcp-docuploader + # google-auth + # python-dateutil +typing-extensions==4.1.1 \ + --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ + --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 + # via -r requirements.in +urllib3==1.26.12 \ + --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ + --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 + # via + # -r requirements.in + # requests +zipp==3.6.0 \ + --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ + --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc + # via + # -r requirements.in + # importlib-metadata From d30670ee2edf498b0335f3dfdec3487f5627a9f3 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 26 Sep 2022 18:34:19 -0400 Subject: [PATCH 0929/2268] feat: add remote function options to routine metadata (#2291) --- .kokoro/build.sh | 12 +- .../clirr-ignored-differences.xml | 5 + google-cloud-bigquery/pom.xml | 7 +- .../cloud/bigquery/RemoteFunctionOptions.java | 139 ++++++++++++++++++ .../com/google/cloud/bigquery/Routine.java | 6 + .../google/cloud/bigquery/RoutineInfo.java | 34 ++++- .../bigquery/RemoteFunctionOptionsTest.java | 73 +++++++++ .../google/cloud/bigquery/RoutineTest.java | 19 +++ .../cloud/bigquery/it/ITRemoteUDFTest.java | 129 ++++++++++++++++ pom.xml | 12 ++ 10 files changed, 428 insertions(+), 8 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 6ede96a218..0c26eec01a 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,7 +61,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITBigQueryTest \ + -Dtest=ITBigQueryTest,ITRemoteUDFTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -72,7 +72,7 @@ integration) nightly-it) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITNightlyBigQueryTest \ + -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -82,20 +82,20 @@ nightly-it) ;; graalvm) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; graalvm17) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; nightly-graalvm) - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; nightly-graalvm17) - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; samples) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 7a882777a9..6b76f78eb4 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -19,4 +19,9 @@ com/google/cloud/bigquery/ExternalTableDefinition* *ReferenceFileSchemaUri(*) + + 7013 + com/google/cloud/bigquery/RoutineInfo* + *RemoteFunctionOptions(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8c1c8fa420..b3301e0dff 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -131,9 +131,14 @@ google-cloud-datacatalog test
    + + com.google.cloud + google-cloud-bigqueryconnection + test + com.google.api.grpc - proto-google-cloud-datacatalog-v1 + proto-google-cloud-bigqueryconnection-v1 test diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java new file mode 100644 index 0000000000..88496dcb4c --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java @@ -0,0 +1,139 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import java.util.Map; +import javax.annotation.Nullable; + +/** Represents Remote Function Options. Options for a remote user-defined function. */ +@AutoValue +public abstract class RemoteFunctionOptions implements Serializable { + + private static final long serialVersionUID = -7334249450657429792L; + + @AutoValue.Builder + public abstract static class Builder { + + /** + * Sets Endpoint argument Endpoint of the user-provided remote service, e.g. + * ```https://us-east1-my_gcf_project.cloudfunctions.net/remote_add``` + */ + public abstract Builder setEndpoint(String endpoint); + + /** + * Fully qualified name of the user-provided connection object which holds the authentication + * information to send requests to the remote service. Format: + * ```\"projects/{projectId}/locations/{locationId}/connections/{connectionId}\"``` + */ + public abstract Builder setConnection(String connection); + + /** + * User-defined context as a set of key/value pairs, which will be sent as function invocation + * context together with batched arguments in the requests to the remote service. The total + * number of bytes of keys and values must be less than 8KB. + */ + public abstract Builder setUserDefinedContext(Map userDefinedContext); + + /** + * Max number of rows in each batch sent to the remote service. If absent or if 0, BigQuery + * dynamically decides the number of rows in a batch. + */ + public abstract Builder setMaxBatchingRows(Long maxBatchingRows); + + /** Creates a {@code RemoteFunctionOptions} object. */ + public abstract RemoteFunctionOptions build(); + } + + /** + * Returns the endpoint of the user-provided service. + * + * @return String + */ + @Nullable + public abstract String getEndpoint(); + + /** + * Returns the fully qualified name of the user-provided connection object. + * + * @return String + */ + @Nullable + public abstract String getConnection(); + + /** + * Returns the user-defined context as a set of key/value pairs. + * + * @return Map + */ + @Nullable + public abstract Map getUserDefinedContext(); + + /** + * Returns max number of rows in each batch sent to the remote service. + * + * @return Long + */ + @Nullable + public abstract Long getMaxBatchingRows(); + + /** + * Returns a builder pre-populated using the current values of this {@code RemoteFunctionOptions}. + */ + public abstract RemoteFunctionOptions.Builder toBuilder(); + + /** Returns a builder for a {@Code RemoteFunctionOptions} object. */ + public static RemoteFunctionOptions.Builder newBuilder() { + return new AutoValue_RemoteFunctionOptions.Builder(); + } + + public com.google.api.services.bigquery.model.RemoteFunctionOptions toPb() { + com.google.api.services.bigquery.model.RemoteFunctionOptions remoteFunctionOptions = + new com.google.api.services.bigquery.model.RemoteFunctionOptions(); + if (getEndpoint() != null) { + remoteFunctionOptions.setEndpoint(getEndpoint()); + } + if (getConnection() != null) { + remoteFunctionOptions.setConnection(getConnection()); + } + if (getUserDefinedContext() != null) { + remoteFunctionOptions.setUserDefinedContext(getUserDefinedContext()); + } + if (getMaxBatchingRows() != null) { + remoteFunctionOptions.setMaxBatchingRows(getMaxBatchingRows()); + } + return remoteFunctionOptions; + } + + static RemoteFunctionOptions fromPb( + com.google.api.services.bigquery.model.RemoteFunctionOptions remoteFunctionOptionsPb) { + RemoteFunctionOptions.Builder builder = newBuilder(); + if (remoteFunctionOptionsPb.getEndpoint() != null) { + builder.setEndpoint(remoteFunctionOptionsPb.getEndpoint()); + } + if (remoteFunctionOptionsPb.getConnection() != null) { + builder.setConnection(remoteFunctionOptionsPb.getConnection()); + } + if (remoteFunctionOptionsPb.getUserDefinedContext() != null) { + builder.setUserDefinedContext(remoteFunctionOptionsPb.getUserDefinedContext()); + } + if (remoteFunctionOptionsPb.getMaxBatchingRows() != null) { + builder.setMaxBatchingRows(remoteFunctionOptionsPb.getMaxBatchingRows()); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java index a5232c3f91..d2d6ec6837 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java @@ -129,6 +129,12 @@ public Builder setBody(String body) { return this; } + @Override + public Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions) { + infoBuilder.setRemoteFunctionOptions(remoteFunctionOptions); + return this; + } + @Override public Routine build() { return new Routine(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java index daa7455777..3001d2fb97 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java @@ -70,6 +70,7 @@ public Routine apply(RoutineInfo routineInfo) { private final StandardSQLTableType returnTableType; private final List importedLibrariesList; private final String body; + private final RemoteFunctionOptions remoteFunctionOptions; public abstract static class Builder { @@ -148,6 +149,14 @@ public abstract static class Builder { */ public abstract Builder setBody(String body); + /** + * Optional. Remote function specific options. + * + * @param remoteFunctionOptions + * @return + */ + public abstract Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions); + /** Creates a {@code RoutineInfo} object. */ public abstract RoutineInfo build(); } @@ -166,6 +175,7 @@ static class BuilderImpl extends Builder { private StandardSQLTableType returnTableType; private List importedLibrariesList; private String body; + private RemoteFunctionOptions remoteFunctionOptions; BuilderImpl() {} @@ -183,6 +193,7 @@ static class BuilderImpl extends Builder { this.returnTableType = routineInfo.returnTableType; this.importedLibrariesList = routineInfo.importedLibrariesList; this.body = routineInfo.body; + this.remoteFunctionOptions = routineInfo.remoteFunctionOptions; } BuilderImpl(Routine routinePb) { @@ -210,6 +221,10 @@ static class BuilderImpl extends Builder { this.importedLibrariesList = routinePb.getImportedLibraries(); } this.body = routinePb.getDefinitionBody(); + if (routinePb.getRemoteFunctionOptions() != null) { + this.remoteFunctionOptions = + RemoteFunctionOptions.fromPb(routinePb.getRemoteFunctionOptions()); + } } @Override @@ -290,6 +305,12 @@ public Builder setBody(String body) { return this; } + @Override + public Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions) { + this.remoteFunctionOptions = remoteFunctionOptions; + return this; + } + @Override public RoutineInfo build() { return new RoutineInfo(this); @@ -310,6 +331,7 @@ public RoutineInfo build() { this.returnTableType = builder.returnTableType; this.importedLibrariesList = builder.importedLibrariesList; this.body = builder.body; + this.remoteFunctionOptions = builder.remoteFunctionOptions; } /** Returns the RoutineId identified for the routine resource. * */ @@ -384,6 +406,11 @@ public String getBody() { return body; } + /** Returns the Remote function specific options. */ + public RemoteFunctionOptions getRemoteFunctionOptions() { + return remoteFunctionOptions; + }; + /** Returns a builder pre-populated using the current values of this routine. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -405,6 +432,7 @@ public String toString() { .add("returnTableType", returnTableType) .add("importedLibrariesList", importedLibrariesList) .add("body", body) + .add("remoteFunctionOptions", remoteFunctionOptions) .toString(); } @@ -423,7 +451,8 @@ public int hashCode() { returnType, returnTableType, importedLibrariesList, - body); + body, + remoteFunctionOptions); } @Override @@ -474,6 +503,9 @@ Routine toPb() { if (getReturnTableType() != null) { routinePb.setReturnTableType(getReturnTableType().toPb()); } + if (getRemoteFunctionOptions() != null) { + routinePb.setRemoteFunctionOptions(getRemoteFunctionOptions().toPb()); + } return routinePb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java new file mode 100644 index 0000000000..8ee0e4564f --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class RemoteFunctionOptionsTest { + private static final String endpoint = "https://aaabbbccc-uc.a.run.app"; + private static final String connection = + "projects/{projectId}/locations/{locationId}/connections/{connectionId}"; + private static final Map userDefinedContext = + new HashMap() { + { + put("key1", "value1"); + put("key2", "value2"); + } + }; + private static final Long maxBatchingRows = 20L; + + private static final RemoteFunctionOptions REMOTE_FUNCTION_OPTIONS = + RemoteFunctionOptions.newBuilder() + .setEndpoint(endpoint) + .setConnection(connection) + .setUserDefinedContext(userDefinedContext) + .setMaxBatchingRows(maxBatchingRows) + .build(); + + @Test + public void testToBuilder() { + compareRemoteFunctionOptions( + REMOTE_FUNCTION_OPTIONS, REMOTE_FUNCTION_OPTIONS.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals(endpoint, REMOTE_FUNCTION_OPTIONS.getEndpoint()); + assertEquals(connection, REMOTE_FUNCTION_OPTIONS.getConnection()); + assertEquals(userDefinedContext, REMOTE_FUNCTION_OPTIONS.getUserDefinedContext()); + assertEquals(maxBatchingRows, REMOTE_FUNCTION_OPTIONS.getMaxBatchingRows()); + } + + @Test + public void testToAndFromPb() { + compareRemoteFunctionOptions( + REMOTE_FUNCTION_OPTIONS, RemoteFunctionOptions.fromPb(REMOTE_FUNCTION_OPTIONS.toPb())); + } + + public void compareRemoteFunctionOptions( + RemoteFunctionOptions expected, RemoteFunctionOptions actual) { + assertEquals(expected, actual); + assertEquals(expected.getEndpoint(), actual.getEndpoint()); + assertEquals(expected.getConnection(), actual.getConnection()); + assertEquals(expected.getMaxBatchingRows(), actual.getMaxBatchingRows()); + assertEquals(expected.getUserDefinedContext(), actual.getUserDefinedContext()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java index 89bed602ee..c9080e851a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java @@ -26,7 +26,9 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -74,6 +76,20 @@ public class RoutineTest { ImmutableList.of("gs://foo", "gs://bar", "gs://baz"); private static final String BODY = "body"; + private static final Map userDefinedContext = + new HashMap() { + { + put("key1", "value1"); + put("key2", "value2"); + } + }; + private static final RemoteFunctionOptions REMOTE_FUNCTION_OPTIONS = + RemoteFunctionOptions.newBuilder() + .setEndpoint("endpoint") + .setConnection("connection") + .setUserDefinedContext(userDefinedContext) + .setMaxBatchingRows(10L) + .build(); private static final RoutineInfo ROUTINE_INFO = RoutineInfo.newBuilder(ROUTINE_ID) @@ -87,6 +103,7 @@ public class RoutineTest { .setReturnType(RETURN_TYPE) .setImportedLibraries(IMPORTED_LIBRARIES) .setBody(BODY) + .setRemoteFunctionOptions(REMOTE_FUNCTION_OPTIONS) .build(); private static final RoutineInfo ROUTINE_INFO_TVF = @@ -128,6 +145,7 @@ public void testBuilder() { .setReturnType(RETURN_TYPE) .setImportedLibraries(IMPORTED_LIBRARIES) .setBody(BODY) + .setRemoteFunctionOptions(REMOTE_FUNCTION_OPTIONS) .build(); assertEquals(ETAG, builtRoutine.getEtag()); assertEquals(DETERMINISM_LEVEL, builtRoutine.getDeterminismLevel()); @@ -228,5 +246,6 @@ public void compareRoutineInfo(RoutineInfo expected, RoutineInfo value) { assertEquals(expected.getImportedLibraries(), value.getImportedLibraries()); assertEquals(expected.getBody(), value.getBody()); assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.getRemoteFunctionOptions(), value.getRemoteFunctionOptions()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java new file mode 100644 index 0000000000..7e74a8f4cd --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.RemoteFunctionOptions; +import com.google.cloud.bigquery.Routine; +import com.google.cloud.bigquery.RoutineArgument; +import com.google.cloud.bigquery.RoutineId; +import com.google.cloud.bigquery.RoutineInfo; +import com.google.cloud.bigquery.StandardSQLDataType; +import com.google.cloud.bigquery.connection.v1.CloudResourceProperties; +import com.google.cloud.bigquery.connection.v1.Connection; +import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; +import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest; +import com.google.cloud.bigquery.connection.v1.LocationName; +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient; +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Test; + +public class ITRemoteUDFTest { + + private static final String ID = UUID.randomUUID().toString().substring(0, 8); + private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + private static final String CONNECTION_ID = "test-connectin-id-" + ID; + private static final String LOCATION = "US"; + private static final String PARENT = LocationName.of(PROJECT_ID, LOCATION).toString(); + private static final String REMOTE_ENDPOINT = "https://aaabbbccc-uc.a.run.app"; + private static final String ROUTINE_DATASET = RemoteBigQueryHelper.generateDatasetName(); + private static ConnectionServiceClient client; + private static Connection connection; + private static BigQuery bigquery; + + @Before + public void setUp() throws IOException { + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + bigquery = bigqueryHelper.getOptions().getService(); + client = ConnectionServiceClient.create(); + + DatasetInfo info = + DatasetInfo.newBuilder(ROUTINE_DATASET).setDescription("java routine lifecycle").build(); + bigquery.create(info); + CloudResourceProperties cloudResourceProperties = CloudResourceProperties.newBuilder().build(); + CreateConnectionRequest request = + CreateConnectionRequest.newBuilder() + .setParent(PARENT) + .setConnection( + Connection.newBuilder().setCloudResource(cloudResourceProperties).build()) + .setConnectionId(CONNECTION_ID) + .build(); + connection = client.createConnection(request); + } + + @AfterClass + public static void afterClass() { + if (bigquery != null) { + RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); + } + // delete a connection + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder().setName(connection.getName()).build(); + client.deleteConnection(request); + client.close(); + } + + @Test + public void testRoutineRemoteUDF() { + String routineName = RemoteBigQueryHelper.generateRoutineName(); + RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); + Map userDefinedContext = + new HashMap() { + { + put("key1", "value1"); + put("key2", "value2"); + } + }; + + RemoteFunctionOptions remoteFunctionOptions = + RemoteFunctionOptions.newBuilder() + .setEndpoint(REMOTE_ENDPOINT) + .setConnection(connection.getName()) + .setMaxBatchingRows(Long.valueOf(30)) + .setUserDefinedContext(userDefinedContext) + .build(); + RoutineInfo routineInfo = + RoutineInfo.newBuilder(routineId) + .setRoutineType("SCALAR_FUNCTION") + .setArguments( + ImmutableList.of( + RoutineArgument.newBuilder() + .setName("x") + .setDataType(StandardSQLDataType.newBuilder("INT64").build()) + .build())) + .setRemoteFunctionOptions(remoteFunctionOptions) + .setReturnType(StandardSQLDataType.newBuilder("INT64").build()) + .build(); + + Routine routine = bigquery.create(routineInfo); + assertNotNull(routine); + assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); + assertEquals(REMOTE_ENDPOINT, routine.getRemoteFunctionOptions().getEndpoint()); + assertEquals(connection.getName(), routine.getRemoteFunctionOptions().getConnection()); + } +} diff --git a/pom.xml b/pom.xml index 8458ba8724..4a00f4980e 100644 --- a/pom.xml +++ b/pom.xml @@ -179,6 +179,18 @@ 2.12.0 test + + com.google.cloud + google-cloud-bigqueryconnection + 2.4.0 + test + + + com.google.api.grpc + proto-google-cloud-bigqueryconnection-v1 + 2.4.0 + test +
    From 3fe0797aad1e8ff5b7d078479d846503fc2ceaff Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:32:17 +0200 Subject: [PATCH 0930/2268] deps: update dependency requests to v2.28.1 (#2303) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [requests](https://requests.readthedocs.io) ([source](https://togithub.com/psf/requests), [changelog](https://togithub.com/psf/requests/blob/master/HISTORY.md)) | `==2.27.1` -> `==2.28.1` | [![age](https://badges.renovateapi.com/packages/pypi/requests/2.28.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/requests/2.28.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/requests/2.28.1/compatibility-slim/2.27.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/requests/2.28.1/confidence-slim/2.27.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    psf/requests ### [`v2.28.1`](https://togithub.com/psf/requests/blob/HEAD/HISTORY.md#​2281-2022-06-29) [Compare Source](https://togithub.com/psf/requests/compare/v2.28.0...v2.28.1) **Improvements** - Speed optimization in `iter_content` with transition to `yield from`. ([#​6170](https://togithub.com/psf/requests/issues/6170)) **Dependencies** - Added support for chardet 5.0.0 ([#​6179](https://togithub.com/psf/requests/issues/6179)) - Added support for charset-normalizer 2.1.0 ([#​6169](https://togithub.com/psf/requests/issues/6169)) ### [`v2.28.0`](https://togithub.com/psf/requests/blob/HEAD/HISTORY.md#​2280-2022-06-09) [Compare Source](https://togithub.com/psf/requests/compare/v2.27.1...v2.28.0) **Deprecations** - ⚠️ Requests has officially dropped support for Python 2.7. ⚠️ ([#​6091](https://togithub.com/psf/requests/issues/6091)) - Requests has officially dropped support for Python 3.6 (including pypy3.6). ([#​6091](https://togithub.com/psf/requests/issues/6091)) **Improvements** - Wrap JSON parsing issues in Request's JSONDecodeError for payloads without an encoding to make `json()` API consistent. ([#​6097](https://togithub.com/psf/requests/issues/6097)) - Parse header components consistently, raising an InvalidHeader error in all invalid cases. ([#​6154](https://togithub.com/psf/requests/issues/6154)) - Added provisional 3.11 support with current beta build. ([#​6155](https://togithub.com/psf/requests/issues/6155)) - Requests got a makeover and we decided to paint it black. ([#​6095](https://togithub.com/psf/requests/issues/6095)) **Bugfixes** - Fixed bug where setting `CURL_CA_BUNDLE` to an empty string would disable cert verification. All Requests 2.x versions before 2.28.0 are affected. ([#​6074](https://togithub.com/psf/requests/issues/6074)) - Fixed urllib3 exception leak, wrapping `urllib3.exceptions.SSLError` with `requests.exceptions.SSLError` for `content` and `iter_content`. ([#​6057](https://togithub.com/psf/requests/issues/6057)) - Fixed issue where invalid Windows registry entires caused proxy resolution to raise an exception rather than ignoring the entry. ([#​6149](https://togithub.com/psf/requests/issues/6149)) - Fixed issue where entire payload could be included in the error message for JSONDecodeError. ([#​6036](https://togithub.com/psf/requests/issues/6036))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 7f8fdd2d649ff717ffe0921a74aec48e37fcacc8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:32:34 +0200 Subject: [PATCH 0931/2268] deps: update dependency zipp to v3.8.1 (#2305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [zipp](https://togithub.com/jaraco/zipp) | `==3.6.0` -> `==3.8.1` | [![age](https://badges.renovateapi.com/packages/pypi/zipp/3.8.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/zipp/3.8.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/zipp/3.8.1/compatibility-slim/3.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/zipp/3.8.1/confidence-slim/3.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    jaraco/zipp ### [`v3.8.1`](https://togithub.com/jaraco/zipp/blob/HEAD/CHANGES.rst#v381) [Compare Source](https://togithub.com/jaraco/zipp/compare/v3.8.0...v3.8.1) \====== Refreshed packaging. Enrolled with Tidelift. ### [`v3.8.0`](https://togithub.com/jaraco/zipp/blob/HEAD/CHANGES.rst#v380) [Compare Source](https://togithub.com/jaraco/zipp/compare/v3.7.0...v3.8.0) \====== Removed compatibility code. ### [`v3.7.0`](https://togithub.com/jaraco/zipp/blob/HEAD/CHANGES.rst#v370) [Compare Source](https://togithub.com/jaraco/zipp/compare/v3.6.0...v3.7.0) \====== Require Python 3.7 or later.
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 88c2b678f4f914707158e09256dc78e7d6362d93 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:38:25 +0200 Subject: [PATCH 0932/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.13.0 (#2299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.12.0` -> `2.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.13.0/compatibility-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.13.0/confidence-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.13.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2130-httpsgithubcomgoogleapisjava-bigtablecomparev2120v2130-2022-09-27) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.12.0...v2.13.0) ##### Features - Add gRPC RLS dependency ([#​1248](https://togithub.com/googleapis/java-bigtable/issues/1248)) ([e829b92](https://togithub.com/googleapis/java-bigtable/commit/e829b923d97a00dcb55a14b0877bec2c8cf5ece2)) ##### Bug Fixes - Add a UUID in the task value ([#​1430](https://togithub.com/googleapis/java-bigtable/issues/1430)) ([3bfc7bc](https://togithub.com/googleapis/java-bigtable/commit/3bfc7bc246488a37b4470e3a75ffdd34f6761804)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.5 ([#​1406](https://togithub.com/googleapis/java-bigtable/issues/1406)) ([d906729](https://togithub.com/googleapis/java-bigtable/commit/d906729a4bb9a51907bf4879e8d063d5103565ac)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.14 ([#​1411](https://togithub.com/googleapis/java-bigtable/issues/1411)) ([ef7d741](https://togithub.com/googleapis/java-bigtable/commit/ef7d7419293f9f046dcf941148a86da713feae17)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 ([#​1412](https://togithub.com/googleapis/java-bigtable/issues/1412)) ([dcae319](https://togithub.com/googleapis/java-bigtable/commit/dcae3195871b78aa6e102c4bc570b18c303c7760)) - Update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 ([#​1409](https://togithub.com/googleapis/java-bigtable/issues/1409)) ([c1e195d](https://togithub.com/googleapis/java-bigtable/commit/c1e195d4e0470b30d97231c44b09fcb5c4881514))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7dc3230913..63e1851a8e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.12.0 + 2.13.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 78d8b7bf76..2bfa277900 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.12.0 + 2.13.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9fc97ffc1f..5fa40f7d47 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.12.0 + 2.13.0 test From 3f3b2a5d12acbd1bef975d99de96b1f6cbb60c5f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:40:22 +0200 Subject: [PATCH 0933/2268] deps: update dependency protobuf to v4 (#2307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [protobuf](https://developers.google.com/protocol-buffers/) | `==3.19.5` -> `==4.21.6` | [![age](https://badges.renovateapi.com/packages/pypi/protobuf/4.21.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/protobuf/4.21.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/protobuf/4.21.6/compatibility-slim/3.19.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/protobuf/4.21.6/confidence-slim/3.19.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From ebb16ebbffa4fd3a09b2e4c01fb20a91472f469f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:48:25 +0200 Subject: [PATCH 0934/2268] deps: update dependency typing-extensions to v4.3.0 (#2304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [typing-extensions](https://togithub.com/python/typing_extensions) ([changelog](https://togithub.com/python/typing_extensions/blob/main/CHANGELOG.md)) | `==4.1.1` -> `==4.3.0` | [![age](https://badges.renovateapi.com/packages/pypi/typing-extensions/4.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/typing-extensions/4.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/typing-extensions/4.3.0/compatibility-slim/4.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/typing-extensions/4.3.0/confidence-slim/4.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From e0bf11bd14051d0dcf009ad3aab394f0ff7e5d02 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:50:25 +0200 Subject: [PATCH 0935/2268] deps: update dependency google-cloud-core to v2.3.2 (#2297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-core](https://togithub.com/googleapis/python-cloud-core) | `==2.3.1` -> `==2.3.2` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-core/2.3.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-core/2.3.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-core/2.3.2/compatibility-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-core/2.3.2/confidence-slim/2.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 64d5229c6e62cb74224f2bb643fea1c554b6d69f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 06:50:36 +0200 Subject: [PATCH 0936/2268] deps: update dependency charset-normalizer to v2.1.1 (#2300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [charset-normalizer](https://togithub.com/ousret/charset_normalizer) | `==2.0.12` -> `==2.1.1` | [![age](https://badges.renovateapi.com/packages/pypi/charset-normalizer/2.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/charset-normalizer/2.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/charset-normalizer/2.1.1/compatibility-slim/2.0.12)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/charset-normalizer/2.1.1/confidence-slim/2.0.12)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 3cf7ef83d891480bf80fcb1879ca86e9e053304e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 07:00:31 +0200 Subject: [PATCH 0937/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 (#2289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.13` -> `0.9.14` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.14/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.14/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.14/compatibility-slim/0.9.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.14/confidence-slim/0.9.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.14`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.14) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.13...0.9.14) #### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Fix how the GRAALVM_QUICK_BUILD env var is read by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/278](https://togithub.com/graalvm/native-build-tools/pull/278) - Make it possible to pass env vars to the builder process by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/280](https://togithub.com/graalvm/native-build-tools/pull/280) - Maven plugin fixes by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/274](https://togithub.com/graalvm/native-build-tools/pull/274) - Add support for `test-jar` artifacts by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/281](https://togithub.com/graalvm/native-build-tools/pull/281) - Add Gradle CLI options for quick build and debugging by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/286](https://togithub.com/graalvm/native-build-tools/pull/286) - Add a changelog and docs about build -> compile-no-fork changes by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/290](https://togithub.com/graalvm/native-build-tools/pull/290) - Do not filter out entry values starting with `java.` in the metadata post-processing action by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/289](https://togithub.com/graalvm/native-build-tools/pull/289) - Try to fix snapshot publishing by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/244](https://togithub.com/graalvm/native-build-tools/pull/244) - Fix javadoc and warnings by [@​lazar-mitrovic](https://togithub.com/lazar-mitrovic) in [https://github.com/graalvm/native-build-tools/pull/291](https://togithub.com/graalvm/native-build-tools/pull/291) - Bump the default metadata repository version to 0.1.2 by [@​gradinac](https://togithub.com/gradinac) in [https://github.com/graalvm/native-build-tools/pull/294](https://togithub.com/graalvm/native-build-tools/pull/294) - Fix metadata repository crash by [@​dnestoro](https://togithub.com/dnestoro) in [https://github.com/graalvm/native-build-tools/pull/295](https://togithub.com/graalvm/native-build-tools/pull/295) - Add support for override flag by [@​sdeleuze](https://togithub.com/sdeleuze) in [https://github.com/graalvm/native-build-tools/pull/296](https://togithub.com/graalvm/native-build-tools/pull/296) - Fix build time initialization error with JUnit 5.9.0 by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/308](https://togithub.com/graalvm/native-build-tools/pull/308) - Fix compatibility with configuration cache by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/304](https://togithub.com/graalvm/native-build-tools/pull/304) - Bump metadata repository version by [@​melix](https://togithub.com/melix) in [https://github.com/graalvm/native-build-tools/pull/310](https://togithub.com/graalvm/native-build-tools/pull/310) #### New Contributors - [@​dnestoro](https://togithub.com/dnestoro) made their first contribution in [https://github.com/graalvm/native-build-tools/pull/295](https://togithub.com/graalvm/native-build-tools/pull/295) **Full Changelog**: https://github.com/graalvm/native-build-tools/compare/0.9.13...0.9.14
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 1daeb21e57..47b173394d 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.13 + 0.9.14 true com.example.bigquery.NativeImageBigquerySample From 6116cd183d3699f91f47bd797b8a3283c61215d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 07:02:27 +0200 Subject: [PATCH 0938/2268] deps: update dependency googleapis-common-protos to v1.56.4 (#2298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [googleapis-common-protos](https://togithub.com/googleapis/python-api-common-protos) | `==1.56.3` -> `==1.56.4` | [![age](https://badges.renovateapi.com/packages/pypi/googleapis-common-protos/1.56.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/googleapis-common-protos/1.56.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/googleapis-common-protos/1.56.4/compatibility-slim/1.56.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/googleapis-common-protos/1.56.4/confidence-slim/1.56.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 5cc1f6c9ab73281692d767700db4d56ca2aa442c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 07:22:14 +0200 Subject: [PATCH 0939/2268] deps: update dependency gcp-releasetool to v1.8.8 (#2296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | gcp-releasetool | `==1.8.7` -> `==1.8.8` | [![age](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.8/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.8/compatibility-slim/1.8.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.8/confidence-slim/1.8.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 4bfc238d56abedc694b590898a43e22e6bf6947e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 07:28:18 +0200 Subject: [PATCH 0940/2268] deps: update dependency keyring to v23.9.3 (#2302) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [keyring](https://togithub.com/jaraco/keyring) | `==23.4.1` -> `==23.9.3` | [![age](https://badges.renovateapi.com/packages/pypi/keyring/23.9.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/keyring/23.9.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/keyring/23.9.3/compatibility-slim/23.4.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/keyring/23.9.3/confidence-slim/23.4.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From e94c25e702d8f92bb52c21eebd348bebc66b6c0f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 16:42:18 +0200 Subject: [PATCH 0941/2268] deps: update dependency google-crc32c to v1.5.0 (#2316) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-crc32c](https://togithub.com/googleapis/python-crc32c) | `==1.3.0` -> `==1.5.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/compatibility-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-crc32c/1.5.0/confidence-slim/1.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From cb73f23e43bdaef6c6b1e0e82b615394ae851b1e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 16:44:24 +0200 Subject: [PATCH 0942/2268] deps: update dependency google-cloud-storage to v2.5.0 (#2315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-storage](https://togithub.com/googleapis/python-storage) | `==2.0.0` -> `==2.5.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/compatibility-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-storage/2.5.0/confidence-slim/2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 4b57086e991b3bbe88207c339eb48914071fc94c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 16:46:27 +0200 Subject: [PATCH 0943/2268] deps: update dependency jeepney to v0.8.0 (#2318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jeepney](https://gitlab.com/takluyver/jeepney) | `==0.7.1` -> `==0.8.0` | [![age](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/compatibility-slim/0.7.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/jeepney/0.8.0/confidence-slim/0.7.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 7bec0d6a64d4f194ac522bea236f3ec871f0470e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 17:02:13 +0200 Subject: [PATCH 0944/2268] deps: update dependency importlib-metadata to v4.12.0 (#2317) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [importlib-metadata](https://togithub.com/python/importlib_metadata) | `==4.8.3` -> `==4.12.0` | [![age](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/compatibility-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.12.0/confidence-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 078125dfc3d5c397bf63ec651e14c3777ee779f4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 17:04:46 +0200 Subject: [PATCH 0945/2268] deps: update dependency protobuf to v3.20.2 (#2309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [protobuf](https://developers.google.com/protocol-buffers/) | `==3.19.5` -> `==3.20.2` | [![age](https://badges.renovateapi.com/packages/pypi/protobuf/3.20.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/protobuf/3.20.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/protobuf/3.20.2/compatibility-slim/3.19.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/protobuf/3.20.2/confidence-slim/3.19.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From b0feb35415a50fed58883efe06f5e5a8bbc1c74f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Sep 2022 17:14:18 +0200 Subject: [PATCH 0946/2268] deps: update dependency markupsafe to v2.1.1 (#2308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [markupsafe](https://palletsprojects.com/p/markupsafe/) ([changelog](https://markupsafe.palletsprojects.com/changes/)) | `==2.0.1` -> `==2.1.1` | [![age](https://badges.renovateapi.com/packages/pypi/markupsafe/2.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/markupsafe/2.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/markupsafe/2.1.1/compatibility-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/markupsafe/2.1.1/confidence-slim/2.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From bd1f4dd247d7483e3ec16dac522a7662c4e13c08 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Sep 2022 18:10:30 +0200 Subject: [PATCH 0947/2268] deps: update dependency cachetools to v5 (#2306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [cachetools](https://togithub.com/tkem/cachetools) | `==4.2.4` -> `==5.2.0` | [![age](https://badges.renovateapi.com/packages/pypi/cachetools/5.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/cachetools/5.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/cachetools/5.2.0/compatibility-slim/4.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/cachetools/5.2.0/confidence-slim/4.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 7d134e3e7c50fd8762bd522cc1e1fab0fcb4ca20 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Sep 2022 18:12:29 +0200 Subject: [PATCH 0948/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.4 (#2312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/java-bigqueryconnection/proto-google-cloud-bigqueryconnection-v1) ([source](https://togithub.com/googleapis/java-bigqueryconnection)) | `2.4.0` -> `2.5.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.4/compatibility-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.4/confidence-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigqueryconnection ### [`v2.5.4`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​254-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev253v254-2022-09-20) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.3...v2.5.4) ##### Dependencies - Update dependency com.google.protobuf:protobuf-java-util to v3.21.6 ([#​747](https://togithub.com/googleapis/java-bigqueryconnection/issues/747)) ([b862e7e](https://togithub.com/googleapis/java-bigqueryconnection/commit/b862e7e84778b78e943bca3bae60e7a4332b639e)) ### [`v2.5.3`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​253-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev252v253-2022-09-15) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.2...v2.5.3) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#​748](https://togithub.com/googleapis/java-bigqueryconnection/issues/748)) ([a1c7bfa](https://togithub.com/googleapis/java-bigqueryconnection/commit/a1c7bfa45c36ff7cfba7135dea4ad4567a22577b)) ### [`v2.5.2`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​252-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev251v252-2022-09-09) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.1...v2.5.2) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#​742](https://togithub.com/googleapis/java-bigqueryconnection/issues/742)) ([efad01d](https://togithub.com/googleapis/java-bigqueryconnection/commit/efad01d4579e1573822d593f4852522ccfeb7fc3)) ### [`v2.5.1`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​251-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev250v251-2022-09-06) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.5.0...v2.5.1) ##### Dependencies - Update dependency com.google.protobuf ([9225d58](https://togithub.com/googleapis/java-bigqueryconnection/commit/9225d58be057beec195baa55a48a183f923d1490)) ### [`v2.5.0`](https://togithub.com/googleapis/java-bigqueryconnection/blob/HEAD/CHANGELOG.md#​250-httpsgithubcomgoogleapisjava-bigqueryconnectioncomparev241v250-2022-08-09) [Compare Source](https://togithub.com/googleapis/java-bigqueryconnection/compare/v2.4.0...v2.5.0) ##### Features - Add service_account_id output field to CloudSQL properties ([#​724](https://togithub.com/googleapis/java-bigqueryconnection/issues/724)) ([3f82655](https://togithub.com/googleapis/java-bigqueryconnection/commit/3f8265525cce8bc14b359902760d7375239ce616)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#​725](https://togithub.com/googleapis/java-bigqueryconnection/issues/725)) ([7a1a834](https://togithub.com/googleapis/java-bigqueryconnection/commit/7a1a8345035a615028ce68c17c2e67cb14041817)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.1 ([#​728](https://togithub.com/googleapis/java-bigqueryconnection/issues/728)) ([252e904](https://togithub.com/googleapis/java-bigqueryconnection/commit/252e9042b95f5075d7f006e6e18bb9bfebe918e5)) - update dependency com.google.protobuf:protobuf-java-util to v3.21.3 ([#​722](https://togithub.com/googleapis/java-bigqueryconnection/issues/722)) ([780f6d4](https://togithub.com/googleapis/java-bigqueryconnection/commit/780f6d43c9caedd8cfdb173ef2ea68fb371feca1)) - update dependency com.google.protobuf:protobuf-java-util to v3.21.4 ([#​723](https://togithub.com/googleapis/java-bigqueryconnection/issues/723)) ([6bf4073](https://togithub.com/googleapis/java-bigqueryconnection/commit/6bf407399a0eb6f9d56d62ec76caf130e683e3e3))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a00f4980e..4bd85bf8dc 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.4.0 + 2.5.4 test From 683f4ab99751b047ceada3f86afdbe06ceeb5dcd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Sep 2022 18:16:30 +0200 Subject: [PATCH 0949/2268] deps: update dependency click to v8.1.3 (#2311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [click](https://palletsprojects.com/p/click/) ([changelog](https://click.palletsprojects.com/changes/)) | `==8.0.4` -> `==8.1.3` | [![age](https://badges.renovateapi.com/packages/pypi/click/8.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/click/8.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/click/8.1.3/compatibility-slim/8.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/click/8.1.3/confidence-slim/8.0.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 8adaf8e7a891f6c395155a2d8b171f7dfe7f52ad Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Sep 2022 19:30:41 +0200 Subject: [PATCH 0950/2268] deps: update dependency google-api-core to v2.10.1 (#2313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-api-core](https://togithub.com/googleapis/python-api-core) | `==2.8.2` -> `==2.10.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/compatibility-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-api-core/2.10.1/confidence-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From b46cc4ba9c12da99189bb95cb9f3944131dce921 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 30 Sep 2022 16:18:16 +0200 Subject: [PATCH 0951/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.22.0 (#2321) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4bd85bf8dc..f978b692cd 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.21.0 + 2.22.0 pom import From bd43cf42443feba02d7970d3dd17c11d1b64872c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 2 Oct 2022 23:26:33 +0200 Subject: [PATCH 0952/2268] deps: update dependency importlib-metadata to v5 (#2324) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [importlib-metadata](https://togithub.com/python/importlib_metadata) | `==4.8.3` -> `==5.0.0` | [![age](https://badges.renovateapi.com/packages/pypi/importlib-metadata/5.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/importlib-metadata/5.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/importlib-metadata/5.0.0/compatibility-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/importlib-metadata/5.0.0/confidence-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 4c7e089f281c7147cd468fbdbd19cd7238b49be3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 2 Oct 2022 23:28:30 +0200 Subject: [PATCH 0953/2268] deps: update dependency importlib-metadata to v4.13.0 (#2323) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [importlib-metadata](https://togithub.com/python/importlib_metadata) | `==4.8.3` -> `==4.13.0` | [![age](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.13.0/compatibility-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/importlib-metadata/4.13.0/confidence-slim/4.8.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 82c2097a866804ffb95a871087438fc163e8b77c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 2 Oct 2022 23:30:29 +0200 Subject: [PATCH 0954/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20220924-2.0.0 (#2325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220913-2.0.0` -> `v2-rev20220924-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220924-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220924-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220924-2.0.0/compatibility-slim/v2-rev20220913-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20220924-2.0.0/confidence-slim/v2-rev20220913-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f978b692cd..d77857131d 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220913-2.0.0 + v2-rev20220924-2.0.0 3.0.3 9.0.0
    From 52dfd13a4d311526c784397f50ca5cf45b60f2a5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 2 Oct 2022 23:32:13 +0200 Subject: [PATCH 0955/2268] deps: update dependency gcp-releasetool to v1.8.9 (#2326) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | gcp-releasetool | `==1.8.7` -> `==1.8.9` | [![age](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.9/compatibility-slim/1.8.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/gcp-releasetool/1.8.9/confidence-slim/1.8.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). From 188c77995cad31b328cfbf745df164f4ac70b692 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 3 Oct 2022 15:03:03 +0200 Subject: [PATCH 0956/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 (#2327) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d77857131d..6b6cf04797 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220924-2.0.0 - 3.0.3 + 3.0.4 9.0.0
    From 8133a72e3c490cff8d52c8d3aa2394e3e90ae603 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 3 Oct 2022 16:21:51 -0400 Subject: [PATCH 0957/2268] chore: exclude kokoro dependencies from renovate updates (#2322) --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index 56fe3f2abf..c3dedcbe36 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ From 6e48ec22f98f95cc93a6a0e2a068d8a4d8c822ca Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 3 Oct 2022 23:22:32 +0200 Subject: [PATCH 0958/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.5 (#2328) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6b6cf04797..41c6809c8e 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.5.4 + 2.5.5 test From 7fef0c08b02d760cfe4c7e8b99f772b4e20be731 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 3 Oct 2022 23:23:08 +0200 Subject: [PATCH 0959/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.23.0 (#2330) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41c6809c8e..29961a5217 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.22.0 + 2.23.0 pom import From ec8fb878959af6a2c202bdcc11f8ed4499b40268 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:25:09 -0400 Subject: [PATCH 0960/2268] chore(main): release 2.17.0 (#2282) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 21 +++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 6 +++--- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3c6eb5732..ae5344d642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [2.17.0](https://github.com/googleapis/java-bigquery/compare/v2.16.1...v2.17.0) (2022-10-03) + + +### Features + +* Add remote function options to routine metadata ([#2291](https://github.com/googleapis/java-bigquery/issues/2291)) ([d30670e](https://github.com/googleapis/java-bigquery/commit/d30670ee2edf498b0335f3dfdec3487f5627a9f3)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.5 ([#2328](https://github.com/googleapis/java-bigquery/issues/2328)) ([6e48ec2](https://github.com/googleapis/java-bigquery/commit/6e48ec22f98f95cc93a6a0e2a068d8a4d8c822ca)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20220913-2.0.0 ([#2287](https://github.com/googleapis/java-bigquery/issues/2287)) ([fa33184](https://github.com/googleapis/java-bigquery/commit/fa331844dc1862120867d73ad87d87587a388576)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20220924-2.0.0 ([#2325](https://github.com/googleapis/java-bigquery/issues/2325)) ([82c2097](https://github.com/googleapis/java-bigquery/commit/82c2097a866804ffb95a871087438fc163e8b77c)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#2327](https://github.com/googleapis/java-bigquery/issues/2327)) ([188c779](https://github.com/googleapis/java-bigquery/commit/188c77995cad31b328cfbf745df164f4ac70b692)) +* Update dependency gcp-releasetool to v1.8.9 ([#2326](https://github.com/googleapis/java-bigquery/issues/2326)) ([52dfd13](https://github.com/googleapis/java-bigquery/commit/52dfd13a4d311526c784397f50ca5cf45b60f2a5)) +* Update dependency importlib-metadata to v4.13.0 ([#2323](https://github.com/googleapis/java-bigquery/issues/2323)) ([4c7e089](https://github.com/googleapis/java-bigquery/commit/4c7e089f281c7147cd468fbdbd19cd7238b49be3)) +* Update dependency importlib-metadata to v5 ([#2324](https://github.com/googleapis/java-bigquery/issues/2324)) ([bd43cf4](https://github.com/googleapis/java-bigquery/commit/bd43cf42443feba02d7970d3dd17c11d1b64872c)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.14 ([#2288](https://github.com/googleapis/java-bigquery/issues/2288)) ([959519c](https://github.com/googleapis/java-bigquery/commit/959519cd9e5910ba7d93cce00c318ed322dcaf23)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 ([#2289](https://github.com/googleapis/java-bigquery/issues/2289)) ([3cf7ef8](https://github.com/googleapis/java-bigquery/commit/3cf7ef83d891480bf80fcb1879ca86e9e053304e)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 ([#2285](https://github.com/googleapis/java-bigquery/issues/2285)) ([65fac18](https://github.com/googleapis/java-bigquery/commit/65fac188db2514ae620fb5146055591cfe6ac995)) + ## [2.16.1](https://github.com/googleapis/java-bigquery/compare/v2.16.0...v2.16.1) (2022-09-15) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2630afedd1..8d4d1b4fae 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.16.2-SNAPSHOT + 2.17.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b3301e0dff..c0325d099e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.16.2-SNAPSHOT + 2.17.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.16.2-SNAPSHOT + 2.17.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 29961a5217..3d4466b416 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.16.2-SNAPSHOT + 2.17.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.23.0 + 2.22.0 pom import @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.16.2-SNAPSHOT + 2.17.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2bfa277900..04df1cbf05 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.16.2-SNAPSHOT + 2.17.0 diff --git a/versions.txt b/versions.txt index 4ce606254a..6fbb953d37 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.16.1:2.16.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.17.0:2.17.0 \ No newline at end of file From d1c812e1e9e5c9b5463e7918e0c42572f5d06580 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:52:13 +0000 Subject: [PATCH 0961/2268] chore(main): release 2.17.1-SNAPSHOT (#2332) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8d4d1b4fae..5bdc0b4905 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c0325d099e..1c4b0548c8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.17.0 + 2.17.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.17.0 + 2.17.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d4466b416..4dce259177 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.17.0 + 2.17.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 04df1cbf05..8bd55455df 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 6fbb953d37..621e09df71 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.17.0:2.17.0 \ No newline at end of file +google-cloud-bigquery:2.17.0:2.17.1-SNAPSHOT \ No newline at end of file From f8053d7773d225b29e669976c6123b5d30ccd6a8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 03:10:27 +0200 Subject: [PATCH 0962/2268] deps: update cloud client dependencies (#2335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.12.0` -> `2.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.13.0/compatibility-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.13.0/confidence-slim/2.12.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) | `1.9.4` -> `1.9.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/compatibility-slim/1.9.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/confidence-slim/1.9.4)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.22.0` -> `2.23.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/compatibility-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/confidence-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 40e670c76c..0a294f10e4 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.16.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.17.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.16.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.17.0" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 4dce259177..d3befb2ea5 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.22.0 + 2.23.0 pom import @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.12.0 + 2.13.0 test From 8fba36a1e7c2b63531fe86762d2db347e7fd2ba9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 03:14:29 +0200 Subject: [PATCH 0963/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.14.1 (#2331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.13.0` -> `2.14.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.14.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.14.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.14.1/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.14.1/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 63e1851a8e..e6b8a87817 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.13.0 + 2.14.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8bd55455df..7e39753511 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.13.0 + 2.14.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5fa40f7d47..11cf0721f8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.13.0 + 2.14.1 test From e177209b4b797e506f17dd345e8cf0c24713d632 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 03:36:31 +0200 Subject: [PATCH 0964/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.17.0 (#2333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.16.1` -> `2.17.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.17.0/compatibility-slim/2.16.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.17.0/confidence-slim/2.16.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a294f10e4..48b9238e14 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.16.1 + 2.17.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e6b8a87817..90b79e83ce 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.16.1 + 2.17.0 From a86c7594d0c9e8a480297b028e108c86f4a1e12a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 05:26:16 +0200 Subject: [PATCH 0965/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.6 (#2336) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/java-bigqueryconnection/proto-google-cloud-bigqueryconnection-v1) ([source](https://togithub.com/googleapis/java-bigqueryconnection)) | `2.5.5` -> `2.5.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.6/compatibility-slim/2.5.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.5.6/confidence-slim/2.5.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d3befb2ea5..d814ba1778 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.5.5 + 2.5.6 test From 1194eacf23d947a0d923a3b3fd3f9460dfc996b3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 17:20:32 +0200 Subject: [PATCH 0966/2268] deps: update cloud client dependencies (#2337) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) | `1.9.4` -> `1.9.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/compatibility-slim/1.9.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.9.5/confidence-slim/1.9.4)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.23.0` -> `2.23.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/compatibility-slim/2.23.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.23.1/confidence-slim/2.23.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-datacatalog ### [`v1.9.5`](https://togithub.com/googleapis/java-datacatalog/blob/HEAD/CHANGELOG.md#​195-httpsgithubcomgoogleapisjava-datacatalogcomparev194v195-2022-10-05) [Compare Source](https://togithub.com/googleapis/java-datacatalog/compare/v1.9.4...v1.9.5) ##### Dependencies - Update dependency cachetools to v5 ([#​889](https://togithub.com/googleapis/java-datacatalog/issues/889)) ([7cce568](https://togithub.com/googleapis/java-datacatalog/commit/7cce5686c97aed3ced1711b6e0cc63a90d7e38e7)) - Update dependency certifi to v2022.9.24 ([#​869](https://togithub.com/googleapis/java-datacatalog/issues/869)) ([ae9d4e2](https://togithub.com/googleapis/java-datacatalog/commit/ae9d4e2ff9a7d0b5442dc3e2ee1dbe58e51a3f4f)) - Update dependency click to v8.1.3 ([#​874](https://togithub.com/googleapis/java-datacatalog/issues/874)) ([63bfde6](https://togithub.com/googleapis/java-datacatalog/commit/63bfde6058adaad44471cf60c8f5aeb379810c0c)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#​897](https://togithub.com/googleapis/java-datacatalog/issues/897)) ([08ba2f7](https://togithub.com/googleapis/java-datacatalog/commit/08ba2f70f660b553c1998179a201ca58df840467)) - Update dependency com.google.protobuf:protobuf-java-util to v3.21.6 ([#​860](https://togithub.com/googleapis/java-datacatalog/issues/860)) ([2d81181](https://togithub.com/googleapis/java-datacatalog/commit/2d81181c6bbb7e99264d61e1f8391a5a56470d5c)) - Update dependency com.google.protobuf:protobuf-java-util to v3.21.7 ([#​891](https://togithub.com/googleapis/java-datacatalog/issues/891)) ([a5666ab](https://togithub.com/googleapis/java-datacatalog/commit/a5666abb1adf25c4092f76264b0f5ca8943f376d)) - Update dependency google-api-core to v2.10.1 ([#​875](https://togithub.com/googleapis/java-datacatalog/issues/875)) ([8a06f04](https://togithub.com/googleapis/java-datacatalog/commit/8a06f046588b12be9d59adff85422d6d52801524)) - Update dependency googleapis-common-protos to v1.56.4 ([#​872](https://togithub.com/googleapis/java-datacatalog/issues/872)) ([c18ed8c](https://togithub.com/googleapis/java-datacatalog/commit/c18ed8c6710c8b705e460bc6684231243a39393e)) - Update dependency jeepney to v0.8.0 ([#​880](https://togithub.com/googleapis/java-datacatalog/issues/880)) ([5a7a86a](https://togithub.com/googleapis/java-datacatalog/commit/5a7a86a0a25254d35930e39101b297ec4ad4be30)) - Update dependency protobuf to v3.20.2 ([#​884](https://togithub.com/googleapis/java-datacatalog/issues/884)) ([8a3ae10](https://togithub.com/googleapis/java-datacatalog/commit/8a3ae10d76bc08704327575e0f763cfdc3cd1e23)) - Update dependency protobuf to v4 ([#​890](https://togithub.com/googleapis/java-datacatalog/issues/890)) ([8ba310c](https://togithub.com/googleapis/java-datacatalog/commit/8ba310c9fbcabf984595e5e9605174e53a14c709)) - Update dependency pyjwt to v2.5.0 ([#​885](https://togithub.com/googleapis/java-datacatalog/issues/885)) ([ed3bf6e](https://togithub.com/googleapis/java-datacatalog/commit/ed3bf6e482450c37c25b3c6ce288d1800543d45c)) - Update dependency zipp to v3.8.1 ([#​888](https://togithub.com/googleapis/java-datacatalog/issues/888)) ([0b6262a](https://togithub.com/googleapis/java-datacatalog/commit/0b6262a107cbe980351e530e212e50fd558f875c))
    googleapis/java-bigquerystorage ### [`v2.23.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2231-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2230v2231-2022-10-04) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.23.0...v2.23.1) ##### Bug Fixes - update protobuf to v3.21.7 ([77bf65b](https://togithub.com/googleapis/java-bigquerystorage/commit/77bf65b94e324712ff957cb709d393c1f825ebcf)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-bigquery to v2.17.0 ([#​1821](https://togithub.com/googleapis/java-bigquerystorage/issues/1821)) ([8747079](https://togithub.com/googleapis/java-bigquerystorage/commit/87470799a55b60d671af977dca14140e9f6d94c6))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d814ba1778..d07bca95c0 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.23.0 + 2.23.1 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.4 + 1.9.5 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.4 + 1.9.5 pom import From b48a6c901de367514def3fd9415d8c98245f8a39 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 18:12:18 +0200 Subject: [PATCH 0967/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.5.6 (#2329) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.4.0` -> `2.5.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/compatibility-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/confidence-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) | `2.5.4` -> `2.5.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/compatibility-slim/2.5.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.5.6/confidence-slim/2.5.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d07bca95c0..2459a2e9df 100644 --- a/pom.xml +++ b/pom.xml @@ -182,7 +182,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.4.0 + 2.5.6 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 90b79e83ce..266cde92a0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.4 + 2.5.6 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7e39753511..0c2c4f45aa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.4 + 2.5.6 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 11cf0721f8..c273aed7d7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.4 + 2.5.6 test From 8976d58d293f2d973d187833f474594f0912c7c5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 7 Oct 2022 20:04:26 +0200 Subject: [PATCH 0968/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.3 (#2339) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.2` -> `26.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/compatibility-slim/26.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.3/confidence-slim/26.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48b9238e14..a5c83ea6e5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.2 + 26.1.3 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.2') +implementation platform('com.google.cloud:libraries-bom:26.1.3') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 47b173394d..bdf5283df4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.2 + 26.1.3 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c273aed7d7..de68d67ad4 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.2 + 26.1.3 pom import From 4b84192f6ea5b29f1b1c6341e96a1b88deeb1147 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:28:14 +0000 Subject: [PATCH 0969/2268] chore: [java] generation with shared deps 3.0.4 (#1641) (#2334) * chore: [java] generation with shared deps 3.0.4 * fix for tests Source-Link: https://togithub.com/googleapis/synthtool/commit/c3ad3cc9d876a3dd897cc511cf5ef921784851ae Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:5643a4e1b729803e67ddceee450e87052527b37cac394bf900b4f8e3d1bb3e9b --- .github/.OwlBot.lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 42327db5e2..a4f31d13f7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:f14e3fefe8e361e85752bd9890c8e56f2fe25f1e89cbb9597e4e3c7a429203a3 + digest: sha256:5643a4e1b729803e67ddceee450e87052527b37cac394bf900b4f8e3d1bb3e9b From 1177391949960017e7d8dcce28ac52b83dd4d048 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:02:20 +0000 Subject: [PATCH 0970/2268] chore(main): release 2.17.1 (#2338) :robot: I have created a release *beep* *boop* --- ## [2.17.1](https://togithub.com/googleapis/java-bigquery/compare/v2.17.0...v2.17.1) (2022-10-10) ### Dependencies * Update cloud client dependencies ([#2335](https://togithub.com/googleapis/java-bigquery/issues/2335)) ([f8053d7](https://togithub.com/googleapis/java-bigquery/commit/f8053d7773d225b29e669976c6123b5d30ccd6a8)) * Update cloud client dependencies ([#2337](https://togithub.com/googleapis/java-bigquery/issues/2337)) ([1194eac](https://togithub.com/googleapis/java-bigquery/commit/1194eacf23d947a0d923a3b3fd3f9460dfc996b3)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.6 ([#2336](https://togithub.com/googleapis/java-bigquery/issues/2336)) ([a86c759](https://togithub.com/googleapis/java-bigquery/commit/a86c7594d0c9e8a480297b028e108c86f4a1e12a)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5344d642..09caae7e82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.17.1](https://github.com/googleapis/java-bigquery/compare/v2.17.0...v2.17.1) (2022-10-10) + + +### Dependencies + +* Update cloud client dependencies ([#2335](https://github.com/googleapis/java-bigquery/issues/2335)) ([f8053d7](https://github.com/googleapis/java-bigquery/commit/f8053d7773d225b29e669976c6123b5d30ccd6a8)) +* Update cloud client dependencies ([#2337](https://github.com/googleapis/java-bigquery/issues/2337)) ([1194eac](https://github.com/googleapis/java-bigquery/commit/1194eacf23d947a0d923a3b3fd3f9460dfc996b3)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.5.6 ([#2336](https://github.com/googleapis/java-bigquery/issues/2336)) ([a86c759](https://github.com/googleapis/java-bigquery/commit/a86c7594d0c9e8a480297b028e108c86f4a1e12a)) + ## [2.17.0](https://github.com/googleapis/java-bigquery/compare/v2.16.1...v2.17.0) (2022-10-03) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5bdc0b4905..61ece210b1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1c4b0548c8..1dbf15aa57 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.17.1-SNAPSHOT + 2.17.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.17.1-SNAPSHOT + 2.17.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2459a2e9df..d2fa29ded0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.17.1-SNAPSHOT + 2.17.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0c2c4f45aa..aa68e7dacf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/versions.txt b/versions.txt index 621e09df71..c10c65a750 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.17.0:2.17.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.17.1:2.17.1 \ No newline at end of file From 8602e313d40ac907ae75031c1a36127d7d313664 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 15:38:19 +0000 Subject: [PATCH 0971/2268] chore(main): release 2.17.2-SNAPSHOT (#2344) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 61ece210b1..d76d18ece7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.17.1 + 2.17.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1dbf15aa57..7da20925ff 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.17.1 + 2.17.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.17.1 + 2.17.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d2fa29ded0..a8ec5fe37e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.17.1 + 2.17.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.17.1 + 2.17.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index aa68e7dacf..4d46070909 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.17.1 + 2.17.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index c10c65a750..663a2dee6f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.17.1:2.17.1 \ No newline at end of file +google-cloud-bigquery:2.17.1:2.17.2-SNAPSHOT \ No newline at end of file From 7434316873b476c5f7b40ce2e73593de439ba8e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 11 Oct 2022 11:28:42 +0200 Subject: [PATCH 0972/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.17.1 (#2345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.17.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a5c83ea6e5..5d4d46fe72 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.17.0 + 2.17.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.17.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.17.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.17.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.17.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 266cde92a0..14ed71a5fe 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.17.0 + 2.17.1 From 827e5e720c59ca4ba2a0676c1a836002ed5c2b85 Mon Sep 17 00:00:00 2001 From: Michelle Lohr <98989192+chellebodnar-google@users.noreply.github.com> Date: Wed, 12 Oct 2022 06:18:26 -0700 Subject: [PATCH 0973/2268] doc: Add parameter description for datasetListOptions.labelFilter (#2346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc: Add parameter description for datasetListOptions.labelFilter * 🦉 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 --- .../src/main/java/com/google/cloud/bigquery/BigQuery.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index b574df32da..bfcdc542ab 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -232,6 +232,8 @@ private DatasetListOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify a label filter. See * https://cloud.google.com/bigquery/docs/adding-using-labels#filtering_datasets_using_labels + * + * @param labelFilter In the form "labels.key:value" */ public static DatasetListOption labelFilter(String labelFilter) { return new DatasetListOption(BigQueryRpc.Option.LABEL_FILTER, labelFilter); @@ -264,7 +266,7 @@ private DatasetOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify the dataset's fields to be returned by the RPC call. If this - * option is not provided all dataset's fields are returned. {@code DatasetOption.fields} can be + * option is not provided all dataset's fields are returned. { code DatasetOption.fields} can be * used to specify only the fields of interest. {@link Dataset#getDatasetId()} is always * returned, even if not specified. */ From 80fa47834f3ef536f553702dee3ddc80e18981bb Mon Sep 17 00:00:00 2001 From: Prashant Mishra <11733935+prash-mi@users.noreply.github.com> Date: Wed, 12 Oct 2022 19:32:02 +0530 Subject: [PATCH 0974/2268] feat: Add executeSelectAsync and Refactor (#2294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add executeSelectAsync * Add executeSelectAsync * Add ExecuteSelectResponse * Add executeSelectAsync(...) methods * feat: Add executeSelectAsync * implemented ExecuteSelectResponse Builder * Refactored executeSelect. Added getExecuteSelectResponse * marked getExecuteSelectFuture private * marked getExecuteSelectFuture private * Add UT for Async methods * Added IT for async methods * Removed testFastQueryNullSchema as it is no longer needed * removed dryRun calls as now we wait till the job is complete * Added testExecuteSelectAsyncTimeout * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * updated getExecuteSelectFuture * lint * Add getters and setters for BigQuerySQLException * Add javadoc for overloaded executeSelectAsync and refactored getExecuteSelectFuture to handle BigQuerySQLException * Marked ResultSet and BQSQLException optional * minor refactor: getExecuteSelectFuture * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update getExecuteSelectFuture * update javadoc Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 12 +- .../com/google/cloud/bigquery/Connection.java | 100 ++++++++ .../google/cloud/bigquery/ConnectionImpl.java | 235 ++++++++++++++---- .../cloud/bigquery/ExecuteSelectResponse.java | 47 ++++ .../cloud/bigquery/ConnectionImplTest.java | 160 +++++++++--- .../cloud/bigquery/it/ITBigQueryTest.java | 152 +++++++++++ 6 files changed, 613 insertions(+), 93 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExecuteSelectResponse.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 6b76f78eb4..02cfd99670 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -24,4 +24,14 @@ com/google/cloud/bigquery/RoutineInfo* *RemoteFunctionOptions(*) - \ No newline at end of file + + 7012 + com/google/cloud/bigquery/Connection + com.google.common.util.concurrent.ListenableFuture executeSelectAsync(java.lang.String) + + + 7012 + com/google/cloud/bigquery/Connection + com.google.common.util.concurrent.ListenableFuture executeSelectAsync(java.lang.String, java.util.List, java.util.Map[]) + + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java index 109838d8b2..3a30d1f7b2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import com.google.api.core.BetaApi; +import com.google.common.util.concurrent.ListenableFuture; import java.util.List; import java.util.Map; @@ -89,4 +90,103 @@ public interface Connection { BigQueryResult executeSelect( String sql, List parameters, Map... labels) throws BigQuerySQLException; + + /** + * Execute a SQL statement that returns a single ResultSet and returns a ListenableFuture to + * process the response asynchronously. + * + *

    Example of running a query. + * + *

    +   * {
    +   *   @code
    +   *  ConnectionSettings connectionSettings =
    +   *        ConnectionSettings.newBuilder()
    +   *            .setUseReadAPI(true)
    +   *            .build();
    +   *   Connection connection = bigquery.createConnection(connectionSettings);
    +   *   String selectQuery = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    +   * ListenableFuture executeSelectFuture = connection.executeSelectAsync(selectQuery);
    +   * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
    +   *
    +   *  if(!executeSelectRes.getIsSuccessful()){
    +   * throw executeSelectRes.getBigQuerySQLException();
    +   * }
    +   *
    +   *  BigQueryResult bigQueryResult = executeSelectRes.getBigQueryResult();
    +   * ResultSet rs = bigQueryResult.getResultSet();
    +   * while (rs.next()) {
    +   * System.out.println(rs.getString(1));
    +   * }
    +   *
    +   * 
    + * + * @param sql a static SQL SELECT statement + * @return a ListenableFuture that is used to get the data produced by the query + * @throws BigQuerySQLException upon failure + */ + @BetaApi + ListenableFuture executeSelectAsync(String sql) + throws BigQuerySQLException; + + /** + * Execute a SQL statement that returns a single ResultSet and returns a ListenableFuture to + * process the response asynchronously. + * + *

    Example of running a query. + * + *

    +   * {
    +   *   @code
    +   *  ConnectionSettings connectionSettings =
    +   *        ConnectionSettings.newBuilder()
    +   *            ..setUseReadAPI(true)
    +   *            .build();
    +   *   Connection connection = bigquery.createConnection(connectionSettings);
    +   *     String selectQuery =
    +   *         "SELECT TimestampField, StringField, BooleanField FROM "
    +   *             + MY_TABLE
    +   *             + " WHERE StringField = @stringParam"
    +   *             + " AND IntegerField IN UNNEST(@integerList)";
    +   *     QueryParameterValue stringParameter = QueryParameterValue.string("stringValue");
    +   *     QueryParameterValue intArrayParameter =
    +   *         QueryParameterValue.array(new Integer[] {3, 4}, Integer.class);
    +   *     Parameter stringParam =
    +   *         Parameter.newBuilder().setName("stringParam").setValue(stringParameter).build();
    +   *     Parameter intArrayParam =
    +   *         Parameter.newBuilder().setName("integerList").setValue(intArrayParameter).build();
    +   *     List parameters = ImmutableList.of(stringParam, intArrayParam);
    +   *
    +   *     ListenableFuture executeSelectFut =
    +   *         connection.executeSelectAsync(selectQuery, parameters);
    +   * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
    +   *
    +   *  if(!executeSelectRes.getIsSuccessful()){
    +   * throw executeSelectRes.getBigQuerySQLException();
    +   * }
    +   *
    +   *  BigQueryResult bigQueryResult = executeSelectRes.getBigQueryResult();
    +   * ResultSet rs = bigQueryResult.getResultSet();
    +   * while (rs.next()) {
    +   * System.out.println(rs.getString(1));
    +   * }
    +   *
    +   * 
    + * + * @param sql SQL SELECT query + * @param parameters named or positional parameters. The set of query parameters must either be + * all positional or all named parameters. + * @param labels (optional) the labels associated with this query. You can use these to organize + * and group your query jobs. Label keys and values can be no longer than 63 characters, can + * only contain lowercase letters, numeric characters, underscores and dashes. International + * characters are allowed. Label values are optional and Label is a Varargs. You should pass + * all the Labels in a single Map .Label keys must start with a letter and each label in the + * list must have a different key. + * @return a ListenableFuture that is used to get the data produced by the query + * @throws BigQuerySQLException upon failure + */ + @BetaApi + ListenableFuture executeSelectAsync( + String sql, List parameters, Map... labels) + throws BigQuerySQLException; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 0310832c58..eb0072905c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -47,6 +47,11 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListeningExecutorService; +import com.google.common.util.concurrent.MoreExecutors; import java.io.IOException; import java.util.AbstractList; import java.util.ArrayList; @@ -187,24 +192,7 @@ public BigQueryDryRunResult dryRun(String sql) throws BigQuerySQLException { @BetaApi @Override public BigQueryResult executeSelect(String sql) throws BigQuerySQLException { - try { - // use jobs.query if all the properties of connectionSettings are supported - if (isFastQuerySupported()) { - logger.log(Level.INFO, "\n Using Fast Query Path"); - String projectId = bigQueryOptions.getProjectId(); - QueryRequest queryRequest = createQueryRequest(connectionSettings, sql, null, null); - return queryRpc(projectId, queryRequest, sql, false); - } - // use jobs.insert otherwise - logger.log(Level.INFO, "\n Not Using Fast Query Path, using jobs.insert"); - com.google.api.services.bigquery.model.Job queryJob = - createQueryJob(sql, connectionSettings, null, null); - JobId jobId = JobId.fromPb(queryJob.getJobReference()); - GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); - return getResultSet(firstPage, jobId, sql, false); - } catch (BigQueryException e) { - throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); - } + return getExecuteSelectResponse(sql, null, null); } /** @@ -227,6 +215,12 @@ public BigQueryResult executeSelect(String sql) throws BigQuerySQLException { public BigQueryResult executeSelect( String sql, List parameters, Map... labels) throws BigQuerySQLException { + return getExecuteSelectResponse(sql, parameters, labels); + } + + private BigQueryResult getExecuteSelectResponse( + String sql, List parameters, Map... labels) + throws BigQuerySQLException { Map labelMap = null; if (labels != null && labels.length == 1) { // We expect label as a key value pair in a single Map @@ -252,29 +246,181 @@ public BigQueryResult executeSelect( throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); } } + /** + * Execute a SQL statement that returns a single ResultSet and returns a ListenableFuture to + * process the response asynchronously. + * + *

    Example of running a query. + * + *

    +   * {
    +   *   @code
    +   *  ConnectionSettings connectionSettings =
    +   *        ConnectionSettings.newBuilder()
    +   *            .setUseReadAPI(true)
    +   *            .build();
    +   *   Connection connection = bigquery.createConnection(connectionSettings);
    +   *   String selectQuery = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    +   * ListenableFuture executeSelectFuture = connection.executeSelectAsync(selectQuery);
    +   * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
    +   *
    +   *  if(!executeSelectRes.getIsSuccessful()){
    +   * throw executeSelectRes.getBigQuerySQLException();
    +   * }
    +   *
    +   *  BigQueryResult bigQueryResult = executeSelectRes.getBigQueryResult();
    +   * ResultSet rs = bigQueryResult.getResultSet();
    +   * while (rs.next()) {
    +   * System.out.println(rs.getString(1));
    +   * }
    +   *
    +   * 
    + * + * @param sql a static SQL SELECT statement + * @return a ListenableFuture that is used to get the data produced by the query + * @throws BigQuerySQLException upon failure + */ + @BetaApi + @Override + public ListenableFuture executeSelectAsync(String sql) + throws BigQuerySQLException { + return getExecuteSelectFuture(sql, null); + } + + /** This method calls the overloaded executeSelect(...) methods and returns a Future */ + private ListenableFuture getExecuteSelectFuture( + String sql, List parameters, Map... labels) + throws BigQuerySQLException { + ExecutorService execService = + Executors.newFixedThreadPool( + 2); // two fixed threads. One for the async operation and the other for processing the + // callback + ListeningExecutorService lExecService = MoreExecutors.listeningDecorator(execService); + ListenableFuture executeSelectFuture = + lExecService.submit( + () -> { + try { + return ExecuteSelectResponse.newBuilder() + .setResultSet( + this.executeSelect( + sql, + parameters, + labels)) // calling the overloaded executeSelect method, it takes care + // of null parameters and labels + .setIsSuccessful(true) + .build(); + } catch (BigQuerySQLException ex) { + return ExecuteSelectResponse + .newBuilder() // passing back the null result with isSuccessful set to false + .setIsSuccessful(false) + .setBigQuerySQLException(ex) + .build(); + } + }); + + Futures.addCallback( + executeSelectFuture, + new FutureCallback() { + public void onSuccess(ExecuteSelectResponse result) { + execService.shutdownNow(); // shutdown the executor service as we do not need it + } + + public void onFailure(Throwable t) { + logger.log( + Level.WARNING, + "\n" + + String.format( + "Async task failed or cancelled with error %s", t.getMessage())); + try { + close(); // attempt to stop the execution as the developer might have called + // Future.cancel() + } catch (BigQuerySQLException e) { + logger.log( + Level.WARNING, + "\n" + + String.format("Exception while closing the connection %s", e.getMessage())); + } + execService.shutdownNow(); // shutdown the executor service as we do not need it + } + }, + execService); + + return executeSelectFuture; + } + + /** + * Execute a SQL statement that returns a single ResultSet and returns a ListenableFuture to + * process the response asynchronously. + * + *

    Example of running a query. + * + *

    +   * {
    +   *   @code
    +   *  ConnectionSettings connectionSettings =
    +   *        ConnectionSettings.newBuilder()
    +   *            ..setUseReadAPI(true)
    +   *            .build();
    +   *   Connection connection = bigquery.createConnection(connectionSettings);
    +   *     String selectQuery =
    +   *         "SELECT TimestampField, StringField, BooleanField FROM "
    +   *             + MY_TABLE
    +   *             + " WHERE StringField = @stringParam"
    +   *             + " AND IntegerField IN UNNEST(@integerList)";
    +   *     QueryParameterValue stringParameter = QueryParameterValue.string("stringValue");
    +   *     QueryParameterValue intArrayParameter =
    +   *         QueryParameterValue.array(new Integer[] {3, 4}, Integer.class);
    +   *     Parameter stringParam =
    +   *         Parameter.newBuilder().setName("stringParam").setValue(stringParameter).build();
    +   *     Parameter intArrayParam =
    +   *         Parameter.newBuilder().setName("integerList").setValue(intArrayParameter).build();
    +   *     List parameters = ImmutableList.of(stringParam, intArrayParam);
    +   *
    +   *     ListenableFuture executeSelectFut =
    +   *         connection.executeSelectAsync(selectQuery, parameters);
    +   * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
    +   *
    +   *  if(!executeSelectRes.getIsSuccessful()){
    +   * throw executeSelectRes.getBigQuerySQLException();
    +   * }
    +   *
    +   *  BigQueryResult bigQueryResult = executeSelectRes.getBigQueryResult();
    +   * ResultSet rs = bigQueryResult.getResultSet();
    +   * while (rs.next()) {
    +   * System.out.println(rs.getString(1));
    +   * }
    +   *
    +   * 
    + * + * @param sql SQL SELECT query + * @param parameters named or positional parameters. The set of query parameters must either be + * all positional or all named parameters. + * @param labels (optional) the labels associated with this query. You can use these to organize + * and group your query jobs. Label keys and values can be no longer than 63 characters, can + * only contain lowercase letters, numeric characters, underscores and dashes. International + * characters are allowed. Label values are optional and Label is a Varargs. You should pass + * all the Labels in a single Map .Label keys must start with a letter and each label in the + * list must have a different key. + * @return a ListenableFuture that is used to get the data produced by the query + * @throws BigQuerySQLException upon failure + */ + @BetaApi + @Override + public ListenableFuture executeSelectAsync( + String sql, List parameters, Map... labels) + throws BigQuerySQLException { + return getExecuteSelectFuture(sql, parameters, labels); + } @VisibleForTesting BigQueryResult getResultSet( GetQueryResultsResponse firstPage, JobId jobId, String sql, Boolean hasQueryParameters) { - if (firstPage.getJobComplete() - && firstPage.getTotalRows() != null - && firstPage.getSchema() - != null) { // firstPage.getTotalRows() is null if job is not complete. We need to make - // sure that the schema is not null, as it is required for the ResultSet - return getSubsequentQueryResultsWithJob( - firstPage.getTotalRows().longValue(), - (long) firstPage.getRows().size(), - jobId, - firstPage, - hasQueryParameters); - } else { // job is still running, use dryrun to get Schema - com.google.api.services.bigquery.model.Job dryRunJob = createDryRunJob(sql); - Schema schema = Schema.fromPb(dryRunJob.getStatistics().getQuery().getSchema()); - // TODO: check how can we get totalRows and pageRows while the job is still running. - // `firstPage.getTotalRows()` returns null - return getSubsequentQueryResultsWithJob( - null, null, jobId, firstPage, schema, hasQueryParameters); - } + return getSubsequentQueryResultsWithJob( + firstPage.getTotalRows().longValue(), + (long) firstPage.getRows().size(), + jobId, + firstPage, + hasQueryParameters); } static class EndOfFieldValueList @@ -337,21 +483,6 @@ private BigQueryResult queryRpc( results.getJobComplete(), results.getSchema() == null, totalRows, pageRows)); JobId jobId = JobId.fromPb(results.getJobReference()); GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); - // We might get null schema from the backend occasionally. Ref: - // https://github.com/googleapis/java-bigquery/issues/2103/. Using queryDryRun in such cases - // to get the schema - if (firstPage.getSchema() == null) { // get schema using dry run - // Log the status if the job was complete complete - logger.log( - Level.WARNING, - "\n" - + "Received null schema, Using dryRun the get the Schema. jobComplete:" - + firstPage.getJobComplete()); - com.google.api.services.bigquery.model.Job dryRunJob = createDryRunJob(sql); - Schema schema = Schema.fromPb(dryRunJob.getStatistics().getQuery().getSchema()); - return getSubsequentQueryResultsWithJob( - totalRows, pageRows, jobId, firstPage, schema, hasQueryParameters); - } return getSubsequentQueryResultsWithJob( totalRows, pageRows, jobId, firstPage, hasQueryParameters); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExecuteSelectResponse.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExecuteSelectResponse.java new file mode 100644 index 0000000000..59745020f5 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExecuteSelectResponse.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ExecuteSelectResponse implements Serializable { + @Nullable + public abstract BigQueryResult getResultSet(); + + public abstract boolean getIsSuccessful(); + + @Nullable + public abstract BigQuerySQLException getBigQuerySQLException(); + + public static Builder newBuilder() { + return new AutoValue_ExecuteSelectResponse.Builder(); + } + + @AutoValue.Builder + public abstract static class Builder { + public abstract ExecuteSelectResponse build(); + + public abstract Builder setResultSet(BigQueryResult bigQueryResult); + + public abstract Builder setIsSuccessful(boolean isSuccessful); + + public abstract Builder setBigQuerySQLException(BigQuerySQLException bigQuerySQLException); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 4b1b93487b..4b379629cf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -29,6 +29,7 @@ import com.google.cloud.bigquery.spi.BigQueryRpcFactory; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.ListenableFuture; import java.math.BigInteger; import java.sql.SQLException; import java.util.AbstractList; @@ -37,6 +38,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutionException; import java.util.concurrent.LinkedBlockingDeque; import org.junit.Before; import org.junit.Test; @@ -365,62 +367,39 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException { .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); } - // calls executeSelect with a Fast query and emulates that no schema is returned with the first - // page + // exercises getSubsequentQueryResultsWithJob for fast running queries @Test - public void testFastQueryNullSchema() throws BigQuerySQLException { + public void testFastQueryLongRunning() throws SQLException { ConnectionImpl connectionSpy = Mockito.spy(connection); - QueryRequest queryReqMock = new QueryRequest(); - com.google.api.services.bigquery.model.JobStatistics stats = - new com.google.api.services.bigquery.model.JobStatistics() - .setQuery(new JobStatistics2().setSchema(FAST_QUERY_TABLESCHEMA)); - com.google.api.services.bigquery.model.Job jobResponseMock = - new com.google.api.services.bigquery.model.Job() - // .setConfiguration(QUERY_JOB.g) - .setJobReference(QUERY_JOB.toPb()) - .setId(JOB) - .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) - .setStatistics(stats); - // emulating a legacy query + // emulating a fast query doReturn(true).when(connectionSpy).isFastQuerySupported(); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + + doReturn(TABLE_NAME).when(connectionSpy).getDestinationTable(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .tableDataList(any(GetQueryResultsResponse.class), any(JobId.class)); + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse() .setSchema(FAST_QUERY_TABLESCHEMA) - .setJobComplete(false) // so that it goes to the else part in queryRpc + .setJobComplete(false) .setTotalRows(new BigInteger(String.valueOf(4L))) .setJobReference(QUERY_JOB.toPb()) .setRows(TABLE_ROWS); when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); - doReturn(GET_QUERY_RESULTS_RESPONSE_NULL_SCHEMA) // wiring the null schema for the test case - .when(connectionSpy) - .getQueryResultsFirstPage(any(JobId.class)); - doReturn(BQ_RS_MOCK_RES) - .when(connectionSpy) - .getSubsequentQueryResultsWithJob( - any(Long.class), - any(Long.class), - any(JobId.class), - any(GetQueryResultsResponse.class), - any(Schema.class), - any(Boolean.class)); - doReturn(jobResponseMock).when(connectionSpy).createDryRunJob(any(String.class)); BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); - verify(connectionSpy, times(1)) - .getSubsequentQueryResultsWithJob( - any(Long.class), - any(Long.class), - any(JobId.class), - any(GetQueryResultsResponse.class), - any(Schema.class), - any(Boolean.class)); + verify(bigqueryRpcMock, times(1)).queryRpc(any(String.class), any(QueryRequest.class)); } - // exercises getSubsequentQueryResultsWithJob for fast running queries @Test - public void testFastQueryLongRunning() throws SQLException { + public void testFastQueryLongRunningAsync() + throws SQLException, ExecutionException, InterruptedException { ConnectionImpl connectionSpy = Mockito.spy(connection); // emulating a fast query doReturn(true).when(connectionSpy).isFastQuerySupported(); @@ -442,12 +421,113 @@ public void testFastQueryLongRunning() throws SQLException { .setRows(TABLE_ROWS); when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); - BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + ListenableFuture executeSelectFut = + connectionSpy.executeSelectAsync(SQL_QUERY); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult res = exSelRes.getResultSet(); assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); + assertTrue(exSelRes.getIsSuccessful()); verify(bigqueryRpcMock, times(1)).queryRpc(any(String.class), any(QueryRequest.class)); } + @Test + public void testFastQuerySinglePageAsync() + throws BigQuerySQLException, ExecutionException, InterruptedException { + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = + new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); + when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + .thenReturn(mockQueryRes); + ConnectionImpl connectionSpy = Mockito.spy(connection); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .processQueryResponseResults(any(QueryResponse.class)); + + ListenableFuture executeSelectFut = + connectionSpy.executeSelectAsync(SQL_QUERY); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult res = exSelRes.getResultSet(); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + assertTrue(exSelRes.getIsSuccessful()); + verify(connectionSpy, times(1)) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + } + + @Test + public void testExecuteSelectSlowWithParamsAsync() + throws BigQuerySQLException, ExecutionException, InterruptedException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + List parameters = new ArrayList<>(); + Map labels = new HashMap<>(); + doReturn(false).when(connectionSpy).isFastQuerySupported(); + com.google.api.services.bigquery.model.JobStatistics jobStatistics = + new com.google.api.services.bigquery.model.JobStatistics(); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) + .setStatistics(jobStatistics); + + doReturn(jobResponseMock) + .when(connectionSpy) + .createQueryJob(SQL_QUERY, connectionSettings, parameters, labels); + doReturn(GET_QUERY_RESULTS_RESPONSE) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + doReturn(BQ_RS_MOCK_RES) + .when(connectionSpy) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + ListenableFuture executeSelectFut = + connectionSpy.executeSelectAsync(SQL_QUERY, parameters, labels); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult res = exSelRes.getResultSet(); + assertTrue(exSelRes.getIsSuccessful()); + assertEquals(res.getTotalRows(), 2); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .getResultSet( + any(GetQueryResultsResponse.class), + any(JobId.class), + any(String.class), + any(Boolean.class)); + } + + @Test + public void testFastQueryMultiplePagesAsync() + throws BigQuerySQLException, ExecutionException, InterruptedException { + com.google.api.services.bigquery.model.QueryResponse mockQueryRes = + new QueryResponse() + .setSchema(FAST_QUERY_TABLESCHEMA) + .setJobComplete(true) + .setPageToken(PAGE_TOKEN); + when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + .thenReturn(mockQueryRes); + ConnectionImpl connectionSpy = Mockito.spy(connection); + + doReturn(BQ_RS_MOCK_RES_MULTI_PAGE) + .when(connectionSpy) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + + ListenableFuture executeSelectFut = + connectionSpy.executeSelectAsync(SQL_QUERY); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult res = exSelRes.getResultSet(); + assertTrue(exSelRes.getIsSuccessful()); + assertEquals(res.getTotalRows(), 4); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(connectionSpy, times(1)) + .processQueryResponseResults( + any(com.google.api.services.bigquery.model.QueryResponse.class)); + } + @Test // Emulates first page response using getQueryResultsFirstPage(jobId) and then subsequent pages // using getQueryResultsFirstPage(jobId) getSubsequentQueryResultsWithJob( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9a4b18a48e..8e8f4cc0c5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -62,6 +62,7 @@ import com.google.cloud.bigquery.Dataset; import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.ExecuteSelectResponse; import com.google.cloud.bigquery.ExternalTableDefinition; import com.google.cloud.bigquery.ExtractJobConfiguration; import com.google.cloud.bigquery.Field; @@ -135,6 +136,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.common.io.BaseEncoding; +import com.google.common.util.concurrent.ListenableFuture; import com.google.gson.JsonObject; import java.io.IOException; import java.io.InputStream; @@ -157,6 +159,7 @@ import java.util.Map; import java.util.Set; import java.util.UUID; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; @@ -2789,6 +2792,155 @@ public void testReadAPIIterationAndOrder() connection.close(); } + @Test + public void testReadAPIIterationAndOrderAsync() + throws SQLException, ExecutionException, + InterruptedException { // use read API to read 300K records and check the order + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // required for this integration test so that isFastQuerySupported + // returns false + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + + ListenableFuture executeSelectFut = connection.executeSelectAsync(query); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult bigQueryResult = exSelRes.getResultSet(); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + int lasConfirmedCases = Integer.MIN_VALUE; + while (rs.next()) { // pagination starts after approx 120,000 records + assertNotNull(rs.getDate(0)); + assertNotNull(rs.getString(1)); + assertNotNull(rs.getString(2)); + assertTrue(rs.getInt(3) >= 0); + assertTrue(rs.getInt(4) >= 0); + + // check if the records are sorted + assertTrue(rs.getInt(3) >= lasConfirmedCases); + lasConfirmedCases = rs.getInt(3); + ++cnt; + } + assertEquals(300000, cnt); // total 300000 rows should be read + connection.close(); + } + + @Test + // Cancel the future and check if the operations got cancelled. Tests the wiring of future + // callback. + // TODO(prasmish): Remove this test case if it turns out to be flaky, as expecting the process to + // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the + // specified amount of time + public void testExecuteSelectAsyncCancel() + throws SQLException, ExecutionException, + InterruptedException { // use read API to read 300K records and check the order + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // required for this integration test so that isFastQuerySupported + // returns false + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + + ListenableFuture executeSelectFut = connection.executeSelectAsync(query); + + // Cancel the future with 1000ms delay + Thread testCloseAsync = + new Thread( + () -> { + try { + Thread.sleep(1000); + executeSelectFut.cancel(true); + } catch (InterruptedException e) { + assertNotNull(e); + } + }); + testCloseAsync.start(); + + try { + executeSelectFut.get(); + fail(); // this line should not be reached + } catch (CancellationException e) { + assertNotNull(e); + } + } + + @Test + // Timeouts the future and check if the operations got cancelled. + // TODO(prasmish): Remove this test case if it turns out to be flaky, as expecting the process to + // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the + // specified amount of time + public void testExecuteSelectAsyncTimeout() + throws SQLException, ExecutionException, + InterruptedException { // use read API to read 300K records and check the order + String query = + "SELECT date, county, state_name, confirmed_cases, deaths FROM " + + TABLE_ID_LARGE.getTable() + + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setPriority( + QueryJobConfiguration.Priority + .INTERACTIVE) // required for this integration test so that isFastQuerySupported + // returns false + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + + ListenableFuture executeSelectFut = connection.executeSelectAsync(query); + + try { + executeSelectFut.get(1000, TimeUnit.MILLISECONDS); + fail(); // this line should not be reached + } catch (CancellationException | TimeoutException e) { + assertNotNull(e); + } + } + + @Test + public void testExecuteSelectWithNamedQueryParametersAsync() + throws BigQuerySQLException, ExecutionException, InterruptedException { + String query = + "SELECT TimestampField, StringField, BooleanField FROM " + + TABLE_ID.getTable() + + " WHERE StringField = @stringParam" + + " AND IntegerField IN UNNEST(@integerList)"; + QueryParameterValue stringParameter = QueryParameterValue.string("stringValue"); + QueryParameterValue intArrayParameter = + QueryParameterValue.array(new Integer[] {3, 4}, Integer.class); + Parameter stringParam = + Parameter.newBuilder().setName("stringParam").setValue(stringParameter).build(); + Parameter intArrayParam = + Parameter.newBuilder().setName("integerList").setValue(intArrayParameter).build(); + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); + Connection connection = bigquery.createConnection(connectionSettings); + List parameters = ImmutableList.of(stringParam, intArrayParam); + + ListenableFuture executeSelectFut = + connection.executeSelectAsync(query, parameters); + ExecuteSelectResponse exSelRes = executeSelectFut.get(); + BigQueryResult rs = exSelRes.getResultSet(); + assertEquals(2, rs.getTotalRows()); + } + // Ref: https://github.com/googleapis/java-bigquery/issues/2070. Adding a pre-submit test to see // if bigquery.createConnection() returns null @Test From ac9226c7a6297d686c0bd77939f084e3faf6090a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 00:58:57 +0200 Subject: [PATCH 0975/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 (#2353) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index bdf5283df4..929fe4a584 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.14 + 0.9.15 true com.example.bigquery.NativeImageBigquerySample From b0f172c1863bbe66c366a75c4a5c06ee5ba049d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 00:59:10 +0200 Subject: [PATCH 0976/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.15 (#2352) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 929fe4a584..d9af5a2a39 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.14 + 0.9.15 test From 7bc59a77a6f3821ac19088a8ee864f5d24bdee2e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 01:26:14 +0200 Subject: [PATCH 0977/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.6.0 (#2355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/java-bigqueryconnection/proto-google-cloud-bigqueryconnection-v1) ([source](https://togithub.com/googleapis/google-cloud-java)) | `2.5.6` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.6.0/compatibility-slim/2.5.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.6.0/confidence-slim/2.5.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8ec5fe37e..b9fb065f98 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.5.6 + 2.6.0 test From 460ef318297fe5562a983f64c407b7c0fa5a9a8b Mon Sep 17 00:00:00 2001 From: Tim Brown Date: Mon, 17 Oct 2022 16:28:13 -0700 Subject: [PATCH 0978/2268] fix: properly handle external table schema on table update (#2236) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Fixes #2235 ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .../google/cloud/bigquery/BigQueryImpl.java | 18 ++++++--- .../cloud/bigquery/BigQueryImplTest.java | 38 +++++++++++++++++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 3cfbfd6528..01048689fe 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -288,12 +288,7 @@ public Table create(TableInfo tableInfo, TableOption... options) { ? getOptions().getProjectId() : tableInfo.getTableId().getProject()) .toPb(); - // Set schema on the Table for permanent external table - if (tablePb.getExternalDataConfiguration() != null) { - tablePb.setSchema(tablePb.getExternalDataConfiguration().getSchema()); - // clear table schema on ExternalDataConfiguration - tablePb.getExternalDataConfiguration().setSchema(null); - } + handleExternalTableSchema(tablePb); final Map optionsMap = optionMap(options); try { return Table.fromPb( @@ -313,6 +308,16 @@ public com.google.api.services.bigquery.model.Table call() { } } + private void handleExternalTableSchema( + final com.google.api.services.bigquery.model.Table tablePb) { + // Set schema on the Table for permanent external table + if (tablePb.getExternalDataConfiguration() != null) { + tablePb.setSchema(tablePb.getExternalDataConfiguration().getSchema()); + // clear table schema on ExternalDataConfiguration + tablePb.getExternalDataConfiguration().setSchema(null); + } + } + @Override public Routine create(RoutineInfo routineInfo, RoutineOption... options) { final com.google.api.services.bigquery.model.Routine routinePb = @@ -679,6 +684,7 @@ public Table update(TableInfo tableInfo, TableOption... options) { ? getOptions().getProjectId() : tableInfo.getTableId().getProject()) .toPb(); + handleExternalTableSchema(tablePb); final Map optionsMap = optionMap(options); try { return Table.fromPb( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index b00d4b8607..80ba366f81 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -812,6 +812,25 @@ public void testCreateTable() { verify(bigqueryRpcMock).create(tableInfo.toPb(), EMPTY_RPC_OPTIONS); } + @Test + public void tesCreateExternalTable() { + TableInfo createTableInfo = + TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) + .setProjectId(OTHER_PROJECT); + + com.google.api.services.bigquery.model.Table expectedCreateInput = + createTableInfo.toPb().setSchema(TABLE_SCHEMA.toPb()); + expectedCreateInput.getExternalDataConfiguration().setSchema(null); + when(bigqueryRpcMock.create(expectedCreateInput, EMPTY_RPC_OPTIONS)) + .thenReturn(createTableInfo.toPb()); + BigQueryOptions bigQueryOptions = + createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); + bigquery = bigQueryOptions.getService(); + Table table = bigquery.create(createTableInfo); + assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(createTableInfo)), table); + verify(bigqueryRpcMock).create(expectedCreateInput, EMPTY_RPC_OPTIONS); + } + @Test public void testCreateTableWithoutProject() { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); @@ -1189,6 +1208,25 @@ public void testUpdateTable() { verify(bigqueryRpcMock).patch(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS); } + @Test + public void testUpdateExternalTableWithNewSchema() { + TableInfo updatedTableInfo = + TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) + .setProjectId(OTHER_PROJECT); + + com.google.api.services.bigquery.model.Table expectedPatchInput = + updatedTableInfo.toPb().setSchema(TABLE_SCHEMA.toPb()); + expectedPatchInput.getExternalDataConfiguration().setSchema(null); + when(bigqueryRpcMock.patch(expectedPatchInput, EMPTY_RPC_OPTIONS)) + .thenReturn(updatedTableInfo.toPb()); + BigQueryOptions bigQueryOptions = + createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); + bigquery = bigQueryOptions.getService(); + Table table = bigquery.update(updatedTableInfo); + assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfo)), table); + verify(bigqueryRpcMock).patch(expectedPatchInput, EMPTY_RPC_OPTIONS); + } + @Test public void testUpdateTableWithoutProject() { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); From b35d3ce6d4c63c0c3ce731b8e566eab7547250f6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 01:30:16 +0200 Subject: [PATCH 0979/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.6.0 (#2354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/java-bigqueryconnection) ([source](https://togithub.com/googleapis/google-cloud-java)) | `2.5.6` -> `2.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.6.0/compatibility-slim/2.5.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.6.0/confidence-slim/2.5.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index b9fb065f98..11926ec228 100644 --- a/pom.xml +++ b/pom.xml @@ -182,7 +182,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.6 + 2.6.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 14ed71a5fe..1a9a77195d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.6 + 2.6.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4d46070909..eb3eac0359 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.6 + 2.6.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index de68d67ad4..9c555a17ec 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.5.6 + 2.6.0 test From edb2ca03f2e216d6a1083a9dc2bc7f74bed9d3a5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 01:58:18 +0200 Subject: [PATCH 0980/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.10.0 (#2356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/java-datacatalog) ([source](https://togithub.com/googleapis/google-cloud-java)) | `1.9.5` -> `1.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.10.0/compatibility-slim/1.9.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.10.0/confidence-slim/1.9.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 11926ec228..451f766dd5 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.5 + 1.10.0 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.9.5 + 1.10.0 pom import From 52ec31a6dc3705e09e7ce9cd815241a0fb2cc5d6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Oct 2022 18:46:16 +0200 Subject: [PATCH 0981/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 (#2359) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.15` -> `0.9.16` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.16/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.16/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.16/compatibility-slim/0.9.15)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.16/confidence-slim/0.9.15)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.16`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.16) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.15...0.9.16) #### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Test and fix `--exclude-config` regression by [@​sdeleuze](https://togithub.com/sdeleuze) in [https://togithub.com/graalvm/native-build-tools/pull/341](https://togithub.com/graalvm/native-build-tools/pull/341) **Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.15...0.9.16
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d9af5a2a39..21877843b7 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.15 + 0.9.16 true com.example.bigquery.NativeImageBigquerySample From 85fbce9b729c802d3f75ec2695ad71bed599f2c7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 20 Oct 2022 23:05:06 +0200 Subject: [PATCH 0982/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.4 (#2360) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 451f766dd5..8dfde3ae68 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.3 + 1.5.4 From f4e5fc59f4b9bc63c763ec1dc8b75f87defc9ced Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Oct 2022 23:30:25 +0200 Subject: [PATCH 0983/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 (#2358) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.15` -> `0.9.16` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.16/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.16/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.16/compatibility-slim/0.9.15)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.16/confidence-slim/0.9.15)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.16`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.16) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.15...0.9.16) #### What's Changed Read what's new in the [documentation](https://graalvm.github.io/native-build-tools/latest/index.html#changelog). - Test and fix `--exclude-config` regression by [@​sdeleuze](https://togithub.com/sdeleuze) in [https://togithub.com/graalvm/native-build-tools/pull/341](https://togithub.com/graalvm/native-build-tools/pull/341) **Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.15...0.9.16
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 21877843b7..d24a92c38d 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.15 + 0.9.16 test From 8e8b6d70e228a63b5dde00b828765110b0222d20 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 26 Oct 2022 12:14:31 -0400 Subject: [PATCH 0984/2268] fix: add --add-opens arg to native-image command (#2369) --- .../google-cloud-bigquery/native-image.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/native-image.properties diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/native-image.properties b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/native-image.properties new file mode 100644 index 0000000000..f7cce6dec2 --- /dev/null +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/native-image.properties @@ -0,0 +1 @@ +Args = --add-opens=java.base/java.nio=ALL-UNNAMED \ No newline at end of file From 51b2258bbfa542c822668240c8d5f7cc6c63e03c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:10:13 +0200 Subject: [PATCH 0985/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 (#2361) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.4` -> `3.0.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.5/compatibility-slim/3.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.5/confidence-slim/3.0.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.0.5`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​305-httpsgithubcomgoogleapisjava-shared-dependenciescomparev304v305-2022-10-20) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.4...v3.0.5) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4.20221013 ([#​868](https://togithub.com/googleapis/java-shared-dependencies/issues/868)) ([ffa7272](https://togithub.com/googleapis/java-shared-dependencies/commit/ffa7272e6d4775905e64173b3617555ee355019d)) - Update dependency com.google.auth:google-auth-library-bom to v1.12.0 ([#​870](https://togithub.com/googleapis/java-shared-dependencies/issues/870)) ([6e76f19](https://togithub.com/googleapis/java-shared-dependencies/commit/6e76f19133515b755b78185ce0135943e878a368)) - Update dependency com.google.auth:google-auth-library-bom to v1.12.1 ([#​871](https://togithub.com/googleapis/java-shared-dependencies/issues/871)) ([f7f5dc2](https://togithub.com/googleapis/java-shared-dependencies/commit/f7f5dc26dd54f33954bdf5d43314020de58e055b)) - Update dependency com.google.cloud:grpc-gcp to v1.3.0 ([#​867](https://togithub.com/googleapis/java-shared-dependencies/issues/867)) ([1927a92](https://togithub.com/googleapis/java-shared-dependencies/commit/1927a926c615eabbf0e7377c65232e0e5268220e)) - Update dependency com.google.errorprone:error_prone_annotations to v2.16 ([#​865](https://togithub.com/googleapis/java-shared-dependencies/issues/865)) ([b1734ec](https://togithub.com/googleapis/java-shared-dependencies/commit/b1734ec1c20e7bdf2582b31fde4648aa9f8de2fe)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.8 ([#​872](https://togithub.com/googleapis/java-shared-dependencies/issues/872)) ([1c303f2](https://togithub.com/googleapis/java-shared-dependencies/commit/1c303f2aa5145da4c93605a2d1088e8a3884de81)) - Update dependency gcp-releasetool to v1.8.10 ([#​853](https://togithub.com/googleapis/java-shared-dependencies/issues/853)) ([c815a59](https://togithub.com/googleapis/java-shared-dependencies/commit/c815a5996d28676de015d5dd41e2b0405f4bb9dc)) - Update dependency google-api-core to v2.10.2 ([#​858](https://togithub.com/googleapis/java-shared-dependencies/issues/858)) ([387a156](https://togithub.com/googleapis/java-shared-dependencies/commit/387a15662db0b20e72fe5bf961c02eb2bc4e75d9)) - Update dependency io.grpc:grpc-bom to v1.50.0 ([#​866](https://togithub.com/googleapis/java-shared-dependencies/issues/866)) ([3d3d443](https://togithub.com/googleapis/java-shared-dependencies/commit/3d3d4434636e605f47082641e8e495bbce8f9515)) - Update dependency io.grpc:grpc-bom to v1.50.1 ([#​873](https://togithub.com/googleapis/java-shared-dependencies/issues/873)) ([956309d](https://togithub.com/googleapis/java-shared-dependencies/commit/956309d76c9de46885711a77afbfce0d28971096)) - Update dependency org.checkerframework:checker-qual to v3.26.0 ([#​852](https://togithub.com/googleapis/java-shared-dependencies/issues/852)) ([6926b33](https://togithub.com/googleapis/java-shared-dependencies/commit/6926b33b83d1aa63e0c78b7b8c72cd1d80e28ef3)) - Update dependency org.threeten:threetenbp to v1.6.3 ([#​869](https://togithub.com/googleapis/java-shared-dependencies/issues/869)) ([fa4999b](https://togithub.com/googleapis/java-shared-dependencies/commit/fa4999b6310940e62456e83dad3ec76a7406a218)) - Update dependency typing-extensions to v4.4.0 ([#​854](https://togithub.com/googleapis/java-shared-dependencies/issues/854)) ([43bd31b](https://togithub.com/googleapis/java-shared-dependencies/commit/43bd31b66eef50d82ecf8a692053f10eb385d5c1)) - Update dependency zipp to v3.9.0 ([#​859](https://togithub.com/googleapis/java-shared-dependencies/issues/859)) ([a070ad0](https://togithub.com/googleapis/java-shared-dependencies/commit/a070ad04ef1bab5690487ba13dd4060827851edf)) - Update gax.version to v2.19.4 ([#​875](https://togithub.com/googleapis/java-shared-dependencies/issues/875)) ([227bdd8](https://togithub.com/googleapis/java-shared-dependencies/commit/227bdd86f368b89309814c615828544c29871a5d)) - Update google.core.version to v2.8.21 ([#​861](https://togithub.com/googleapis/java-shared-dependencies/issues/861)) ([8b502bd](https://togithub.com/googleapis/java-shared-dependencies/commit/8b502bd43760a2e52cf107567011d9c5132e74bd)) - Update google.core.version to v2.8.22 ([#​879](https://togithub.com/googleapis/java-shared-dependencies/issues/879)) ([0360e93](https://togithub.com/googleapis/java-shared-dependencies/commit/0360e931dc45034d3c3c554f2c29ad7ea4a0a9bb)) - Update iam.version to v1.6.3 ([#​857](https://togithub.com/googleapis/java-shared-dependencies/issues/857)) ([b39e683](https://togithub.com/googleapis/java-shared-dependencies/commit/b39e6838c3f3f6ef2b350efe8aec1b622893421a)) - Update iam.version to v1.6.4 ([#​862](https://togithub.com/googleapis/java-shared-dependencies/issues/862)) ([85c9794](https://togithub.com/googleapis/java-shared-dependencies/commit/85c979401c34454b2d5681eed9d8b3b3679413be))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8dfde3ae68..5541ae7289 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20220924-2.0.0 - 3.0.4 + 3.0.5 9.0.0
    From 02102d3fb873e68827a8630a4eb34d4bcabd5f9d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:16:14 +0200 Subject: [PATCH 0986/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.7.0 (#2366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.6.0` -> `2.7.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.7.0/compatibility-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.7.0/confidence-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5541ae7289..70f31632a2 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.6.0 + 2.7.0 test From 5d2968fbf6626417fb506c14912e24e436261d69 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:18:14 +0200 Subject: [PATCH 0987/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.7.0 (#2365) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.6.0` -> `2.7.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.7.0/compatibility-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.7.0/confidence-slim/2.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 70f31632a2..d9535dd7fe 100644 --- a/pom.xml +++ b/pom.xml @@ -182,7 +182,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.6.0 + 2.7.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1a9a77195d..ddc91a6da7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.6.0 + 2.7.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index eb3eac0359..b282c5a499 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.6.0 + 2.7.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9c555a17ec..d629b2bc83 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.6.0 + 2.7.0 test From 82e3de5f76644e3530ac795a5eafd1dac4c3be07 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:18:15 +0200 Subject: [PATCH 0988/2268] deps: update dependency com.google.code.gson:gson to v2.10 (#2367) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.code.gson:gson](https://togithub.com/google/gson) | `2.9.1` -> `2.10` | [![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10/compatibility-slim/2.9.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.10/confidence-slim/2.9.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d9535dd7fe..67b164b024 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ com.google.code.gson gson - 2.9.1 + 2.10 From 9b796cf0b14094f9442c7e21d7789a673691b87d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:36:15 +0200 Subject: [PATCH 0989/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221015-2.0.0 (#2370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20220924-2.0.0` -> `v2-rev20221015-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20221015-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20221015-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20221015-2.0.0/compatibility-slim/v2-rev20220924-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20221015-2.0.0/confidence-slim/v2-rev20220924-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 67b164b024..0caed4ca65 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20220924-2.0.0 + v2-rev20221015-2.0.0 3.0.5 9.0.0
    From b7873db46e174c755657ddcecbb02c0e495c9a1f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 00:38:14 +0200 Subject: [PATCH 0990/2268] deps: update arrow.version to v10 (major) (#2371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `9.0.0` -> `10.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.0/compatibility-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.0/confidence-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `9.0.0` -> `10.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.0/compatibility-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.0/confidence-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `9.0.0` -> `10.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.0/compatibility-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.0/confidence-slim/9.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    apache/arrow ### [`v10.0.0`](https://togithub.com/apache/arrow/compare/apache-arrow-9.0.0...apache-arrow-10.0.0)
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0caed4ca65..fb3024cb10 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20221015-2.0.0 3.0.5 - 9.0.0 + 10.0.0
    From 7496dec6e853d42471bb5449d47c76364d3a37b5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 05:04:54 +0200 Subject: [PATCH 0991/2268] test(deps): update dependency org.mockito:mockito-core to v4.8.1 (#2363) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fb3024cb10..9023160b64 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,7 @@ org.mockito mockito-core - 4.8.0 + 4.8.1 test From 09366996e281354cc423cbc3ac97a11b0d48eda6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 05:30:16 +0200 Subject: [PATCH 0992/2268] deps: update cloud client dependencies (#2362) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.13.0` -> `2.14.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.14.0/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.14.0/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.10.0` -> `1.11.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.11.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.11.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.11.0/compatibility-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.11.0/confidence-slim/1.10.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.23.1` -> `2.24.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.0/compatibility-slim/2.23.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.0/confidence-slim/2.23.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.14.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2140-httpsgithubcomgoogleapisjava-storagecomparev2131v2140-2022-10-26) ##### Google Cloud Storage gRPC API Preview The first release of `google-cloud-storage` with support for a subset of the Google Cloud Storage gRPC API which is in private preview. The most common operations have all been implemented and are available for experimentation. Given not all public api surface of `google-cloud-storage` classes are supported for gRPC a new annotation `@TransportCompatibility` has been added to various classes, methods and fields/enum values to signal where that thing can be expected to work. As we implement more of the operations these annotations will be updated. All new gRPC related APIs are annotated with `@BetaApi` to denote they are in preview and the possibility of breaking change is present. At this time, opting to use any of the gRPC transport mode means you are okay with the possibility of a breaking change happening. When the APIs are out of preview, we will remove the `@BetaApi` annotation to signal they are now considered stable and will not break outside a major version. ***NOTICE***: Using the gRPC transport is exclusive. Any operations which have not yet been implemented for gRPC will result in a runtime error. For those operations which are not yet implemented, please continue to use the existing HTTP transport. Special thanks (in alphabetical order) to [@​BenWhitehead](https://togithub.com/BenWhitehead), [@​frankyn](https://togithub.com/frankyn), [@​jesselovelace](https://togithub.com/jesselovelace) and [@​sydney-munro](https://togithub.com/sydney-munro) for their hard work on this effort. ##### Notable Improvements 1. For all gRPC media related operations (upload/download) we are now more resource courteous then the corresponding HTTP counterpart. Buffers are fixed to their specified size (can't arbitrarily grow without bounds), are allocated lazily and only if necessary. 1. Investigation into the possibility of backporting these improvements to the HTTP counterparts is ongoing 2. Preview support for Accessing GCS via gRPC 1. Set the environment variable `GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS=true`, then run your program. 2. When configuring your `StorageOptions` mimic the following: StorageOptions.grpc() .setAttemptDirectPath(true) .build() 3. Internally the default host endpoint `https://storage.googleapis.com:443` will be transformed to the applicable `google-c2p-experimental:///storage.googleapis.com` 3. Support for `java.time` types on model classes 1. Points in time are now represented with `java.time.OffsetDateTime`, while durations are represented with `java.time.Duration` 2. All existing `Long` centric methods are still present, but have been deprecated in favor of their corresponding `java.time` variant 3. At the next major version, these deprecated methods will be replaced with types from `java.time` and the `java.time` variant methods will be deprecated 4. `com.google.cloud.storage.Storage` now extends `java.lang.AutoClosable` thereby allowing it to be used in a try-with-resource block. 1. When using gRPC transport be sure to call `Storage#close()` when complete so it can clean up the gRPC middleware and resources. 2. When using HTTP transport calling `Storage#close()` will gracefully no-op, allowing for the same style of use regardless of transport. 5. When downloading an object via gRPC idle stream detection is now present which will restart a stream if it is determined to be idle and has remaining retry budget 6. Update equals()/hashCode() methods to follow the expected contract 7. The new gRPC transport based implementation continues to provide idempotency aware automatic retries the same as HTTP 8. Expanded test suite which should bring improved stability and reliability to both HTTP and gRPC transport implementations 9. New `com.google.cloud:google-cloud-storage-bom` maven bom available to use for coordinated dependency version resolution for multiple storage artifacts ##### Not yet implemented 1. All ACL specific operations. 1. These will be implemented in the near future 2. In the interim, reading and setting of ACLs and Default Object ACLs can be performed via Object/Bucket operations 2. All Notification related operations 1. These will be implemented in the near future 2. In the interim, please continue to use the HTTP transport 3. `ReadChannel#capture()`, `RestorableState#restore()`, `WriteChannel#capture()`, `RestorableState#restore()`, `CopyWriter#capture()` and `RestorableState#capture()` are not yet implemented. - These use cases will be implemented in the near future. We are still determining the route we want to take. 4. Batch and "bulk" operations which depend on batch 1. GCS gRPC does not currently define a batch method whereas HTTP does. This means `Storage#batch()` is only supported for HTTP transport. 2. The following methods which currently depend on `Storage#batch()` are currently only supported for HTTP transport - `com.google.cloud.storage.Storage#get(com.google.cloud.storage.BlobId...)` - `com.google.cloud.storage.Storage#get(java.lang.Iterable)` - `com.google.cloud.storage.Storage#update(com.google.cloud.storage.BlobInfo...)` - `com.google.cloud.storage.Storage#update(java.lang.Iterable)` - `com.google.cloud.storage.Storage#delete(com.google.cloud.storage.BlobId...)` - `com.google.cloud.storage.Storage#delete(java.lang.Iterable)` ##### One-Time Inconveniences 1. All classes under `com.google.cloud.storage` which are `Serializable` have new `serialVersionUIDs` and are incompatible with any previous version. 1. Several classes had to change in order to support both HTTP and gRPC at the same time. We were able to preserve Source and Binary runtime level compatibility but had to break Serialization across versions. 2. If you depend upon Java Serialization, please ensure you are using the same version of `google-cloud-storage` in both locations. 2. The cause chains of some Exceptions have changed. 1. When using gRPC, `StorageException` causes will use the corresponding `com.google.api.gax.rpc.ApiException` for the failure type instead of the HTTP `com.google.api.client.googleapis.json.GoogleJsonError` - In an effort to preserve compatibility of your existing error handling code, we will translate from the gRPC error code to the similar HTTP Status code before constructing the `StorageException` preserving the integrity of `StorageException#getCode()` 2. RetryHelper$RetryHelperException will no longer appear in exception cause chains for either HTTP or gRPC ##### Not Supported Given the nature of the gRPC transport a few things are explicitly not supported when using gRPC, and require HTTP transport. Attempting to use any of the following methods will result in a runtime error stating they are not supported for gRPC transport. 1. `Storage#writer(URL)` does not work for gRPC. gRPC does not provide a means of exchanging an HTTP url for a resumable session id 2. `Storage#signUrl` is not supported for gRPC transport. Signed URLs explicitly generate HTTP urls and are only supported for the HTTP transport based implementation. 3. `Storage#generateSignedPostPolicyV4` is not supported for gRPC transport. Signed URLs explicitly generate HTTP urls and are only supported for the HTTP transport based implementation. ##### Known Issues 1. [https://togithub.com/googleapis/java-storage/issues/1736](https://togithub.com/googleapis/java-storage/issues/1736) 2. [https://togithub.com/googleapis/java-storage/issues/1737](https://togithub.com/googleapis/java-storage/issues/1737) ##### Features - Initial preview implementation of Storage over gRPC ([#​1740](https://togithub.com/googleapis/java-storage/issues/1740)) ([95d7ad9](https://togithub.com/googleapis/java-storage/commit/95d7ad9e5cd4106cadb23d9b2221419797fed5c1)) ##### Bug Fixes - Properly implement GrpcBlobReadChannel#isOpen ([#​1733](https://togithub.com/googleapis/java-storage/issues/1733)) ([04e5166](https://togithub.com/googleapis/java-storage/commit/04e51662d1f62d987e89ec4e221a3a02c02eaec1)) - Update BucketInfo.LifecycleRule.LifecycleCondition equals and hashCode to include match prefix and suffix ([#​1729](https://togithub.com/googleapis/java-storage/issues/1729)) ([9664e8a](https://togithub.com/googleapis/java-storage/commit/9664e8a776dc6c7c59e61c1e59333ba88731fe76)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#​1725](https://togithub.com/googleapis/java-storage/issues/1725)) ([09bc225](https://togithub.com/googleapis/java-storage/commit/09bc22534bb2a401507fa894123affb432a84350)) ### [`v2.13.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2131-httpsgithubcomgoogleapisjava-storagecomparev2130v2131-2022-10-20) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.13.0...v2.13.1) ##### Bug Fixes - Avoid unexpected initialization of `JacksonParser` in Graal 22.2 ([#​1709](https://togithub.com/googleapis/java-storage/issues/1709)) ([eca1a03](https://togithub.com/googleapis/java-storage/commit/eca1a03c5d7656179a04058a2af94300f1dc0930)) - Update BucketInfo.LifecycleRule#fromPb to wire through MatchesPrefix & MatchesSuffix ([#​1717](https://togithub.com/googleapis/java-storage/issues/1717)) ([eae3cf2](https://togithub.com/googleapis/java-storage/commit/eae3cf2735cd4adab598d311fd64b8906972ffc3)) ##### Dependencies - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#​1711](https://togithub.com/googleapis/java-storage/issues/1711)) ([f188a07](https://togithub.com/googleapis/java-storage/commit/f188a07b09e0787f958f714333337fc92657a824)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#​1721](https://togithub.com/googleapis/java-storage/issues/1721)) ([631b98d](https://togithub.com/googleapis/java-storage/commit/631b98df1a7d44358fbeacb95f2e2a3d590198d1))
    googleapis/java-bigquerystorage ### [`v2.24.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2240-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2231v2240-2022-10-25) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.23.1...v2.24.0) ##### Features - Add getInflightWaitSeconds implementation ([#​1835](https://togithub.com/googleapis/java-bigquerystorage/issues/1835)) ([b569116](https://togithub.com/googleapis/java-bigquerystorage/commit/b569116179700123e405eb7712abb136456f2f26)) - **shortsAndBigDecimals:** Add shorts and big decimals ([#​1674](https://togithub.com/googleapis/java-bigquerystorage/issues/1674)) ([604d7df](https://togithub.com/googleapis/java-bigquerystorage/commit/604d7df2afa54e445a4d310e5293d8d19901d565)) ##### Bug Fixes - **java:** Restore native image configurations ([#​1844](https://togithub.com/googleapis/java-bigquerystorage/issues/1844)) ([8ce670a](https://togithub.com/googleapis/java-bigquerystorage/commit/8ce670a487a192807ccfd58613fc271d9402ca7c)) - Remove the client lib header setting since after router migration, it is no longer needed ([#​1842](https://togithub.com/googleapis/java-bigquerystorage/issues/1842)) ([5f3b821](https://togithub.com/googleapis/java-bigquerystorage/commit/5f3b8214116b17b315d589bfde184e0e045cff69)) ##### Dependencies - Update dependency com.google.auto.value:auto-value to v1.10 ([#​1825](https://togithub.com/googleapis/java-bigquerystorage/issues/1825)) ([f7b8f2b](https://togithub.com/googleapis/java-bigquerystorage/commit/f7b8f2b4df8ca9b306a75d46eb223124ac9bdebb)) - Update dependency com.google.auto.value:auto-value-annotations to v1.10 ([#​1826](https://togithub.com/googleapis/java-bigquerystorage/issues/1826)) ([37eb8a1](https://togithub.com/googleapis/java-bigquerystorage/commit/37eb8a1df34e8ae4d5e2849c76d9a591ec5505d4)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.17.1 ([#​1829](https://togithub.com/googleapis/java-bigquerystorage/issues/1829)) ([7e8d900](https://togithub.com/googleapis/java-bigquerystorage/commit/7e8d90037f5ae426882f90ab251d315767b3a6b7)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#​1840](https://togithub.com/googleapis/java-bigquerystorage/issues/1840)) ([474756b](https://togithub.com/googleapis/java-bigquerystorage/commit/474756bd6547254ed6d761a73f2e69920fa79458))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9023160b64..ba852664da 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.23.1 + 2.24.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.10.0 + 1.11.0 pom import @@ -104,7 +104,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.10.0 + 1.11.0 pom import @@ -176,7 +176,7 @@ com.google.cloud google-cloud-storage - 2.13.0 + 2.14.0 test From 1611f5a1004102278542f1c43154f9f4c50bc6a6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 27 Oct 2022 16:55:38 +0200 Subject: [PATCH 0993/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.4.1 (#2373) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d76d18ece7..728aad396a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.0 + 3.4.1 package From db24409c35835fc13d7e40884c91f909a18d7653 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 27 Oct 2022 12:35:29 -0400 Subject: [PATCH 0994/2268] chore: [java] remove flatten plugin dependency check (#1663) (#2374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update .OwlBot.lock.yaml * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 ++ .kokoro/requirements.txt | 14 +++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a4f31d13f7..459487d388 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:5643a4e1b729803e67ddceee450e87052527b37cac394bf900b4f8e3d1bb3e9b + digest: sha256:ae72564aa9c368b9ccd96f4af21f87889fd83b9e60635b80844deb5a2ccd08aa diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index cfdc2e7ed9..6aa7cf2b55 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -16,10 +16,12 @@ pycparser==2.21 pyperclip==1.8.2 python-dateutil==2.8.2 requests==2.27.1 +certifi==2022.9.24 importlib-metadata==4.8.3 zipp==3.6.0 google_api_core==2.8.2 google-cloud-storage==2.0.0 +google-resumable-media==2.3.3 google-cloud-core==2.3.1 typing-extensions==4.1.1 urllib3==1.26.12 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 170f1c63ab..02ae42bb40 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -16,10 +16,12 @@ cachetools==4.2.4 \ # via # -r requirements.in # google-auth -certifi==2022.9.14 \ - --hash=sha256:36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5 \ - --hash=sha256:e232343de1ab72c2aa521b625c80f699e356830fd0e2c620b465b304b17b0516 - # via requests +certifi==2022.9.24 \ + --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ + --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 + # via + # -r requirements.in + # requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ @@ -218,7 +220,9 @@ google-crc32c==1.3.0 \ google-resumable-media==2.3.3 \ --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via google-cloud-storage + # via + # -r requirements.in + # google-cloud-storage googleapis-common-protos==1.56.3 \ --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 From 47fdca63f62fa01e85aee546908f9bfc811235c0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 04:14:14 +0000 Subject: [PATCH 0995/2268] chore(main): release 2.18.0 (#2347) :robot: I have created a release *beep* *boop* --- ## [2.18.0](https://togithub.com/googleapis/java-bigquery/compare/v2.17.1...v2.18.0) (2022-10-27) ### Features * Add executeSelectAsync and Refactor ([#2294](https://togithub.com/googleapis/java-bigquery/issues/2294)) ([80fa478](https://togithub.com/googleapis/java-bigquery/commit/80fa47834f3ef536f553702dee3ddc80e18981bb)) ### Bug Fixes * Add --add-opens arg to native-image command ([#2369](https://togithub.com/googleapis/java-bigquery/issues/2369)) ([8e8b6d7](https://togithub.com/googleapis/java-bigquery/commit/8e8b6d70e228a63b5dde00b828765110b0222d20)) * Properly handle external table schema on table update ([#2236](https://togithub.com/googleapis/java-bigquery/issues/2236)) ([460ef31](https://togithub.com/googleapis/java-bigquery/commit/460ef318297fe5562a983f64c407b7c0fa5a9a8b)) ### Dependencies * Update arrow.version to v10 (major) ([#2371](https://togithub.com/googleapis/java-bigquery/issues/2371)) ([b7873db](https://togithub.com/googleapis/java-bigquery/commit/b7873db46e174c755657ddcecbb02c0e495c9a1f)) * Update cloud client dependencies ([#2362](https://togithub.com/googleapis/java-bigquery/issues/2362)) ([0936699](https://togithub.com/googleapis/java-bigquery/commit/09366996e281354cc423cbc3ac97a11b0d48eda6)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.6.0 ([#2355](https://togithub.com/googleapis/java-bigquery/issues/2355)) ([7bc59a7](https://togithub.com/googleapis/java-bigquery/commit/7bc59a77a6f3821ac19088a8ee864f5d24bdee2e)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.7.0 ([#2366](https://togithub.com/googleapis/java-bigquery/issues/2366)) ([02102d3](https://togithub.com/googleapis/java-bigquery/commit/02102d3fb873e68827a8630a4eb34d4bcabd5f9d)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221015-2.0.0 ([#2370](https://togithub.com/googleapis/java-bigquery/issues/2370)) ([9b796cf](https://togithub.com/googleapis/java-bigquery/commit/9b796cf0b14094f9442c7e21d7789a673691b87d)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.10.0 ([#2356](https://togithub.com/googleapis/java-bigquery/issues/2356)) ([edb2ca0](https://togithub.com/googleapis/java-bigquery/commit/edb2ca03f2e216d6a1083a9dc2bc7f74bed9d3a5)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#2361](https://togithub.com/googleapis/java-bigquery/issues/2361)) ([51b2258](https://togithub.com/googleapis/java-bigquery/commit/51b2258bbfa542c822668240c8d5f7cc6c63e03c)) * Update dependency com.google.code.gson:gson to v2.10 ([#2367](https://togithub.com/googleapis/java-bigquery/issues/2367)) ([82e3de5](https://togithub.com/googleapis/java-bigquery/commit/82e3de5f76644e3530ac795a5eafd1dac4c3be07)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.15 ([#2352](https://togithub.com/googleapis/java-bigquery/issues/2352)) ([b0f172c](https://togithub.com/googleapis/java-bigquery/commit/b0f172c1863bbe66c366a75c4a5c06ee5ba049d0)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 ([#2358](https://togithub.com/googleapis/java-bigquery/issues/2358)) ([f4e5fc5](https://togithub.com/googleapis/java-bigquery/commit/f4e5fc59f4b9bc63c763ec1dc8b75f87defc9ced)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#2353](https://togithub.com/googleapis/java-bigquery/issues/2353)) ([ac9226c](https://togithub.com/googleapis/java-bigquery/commit/ac9226c7a6297d686c0bd77939f084e3faf6090a)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#2359](https://togithub.com/googleapis/java-bigquery/issues/2359)) ([52ec31a](https://togithub.com/googleapis/java-bigquery/commit/52ec31a6dc3705e09e7ce9cd815241a0fb2cc5d6)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09caae7e82..3bd01980b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [2.18.0](https://github.com/googleapis/java-bigquery/compare/v2.17.1...v2.18.0) (2022-10-27) + + +### Features + +* Add executeSelectAsync and Refactor ([#2294](https://github.com/googleapis/java-bigquery/issues/2294)) ([80fa478](https://github.com/googleapis/java-bigquery/commit/80fa47834f3ef536f553702dee3ddc80e18981bb)) + + +### Bug Fixes + +* Add --add-opens arg to native-image command ([#2369](https://github.com/googleapis/java-bigquery/issues/2369)) ([8e8b6d7](https://github.com/googleapis/java-bigquery/commit/8e8b6d70e228a63b5dde00b828765110b0222d20)) +* Properly handle external table schema on table update ([#2236](https://github.com/googleapis/java-bigquery/issues/2236)) ([460ef31](https://github.com/googleapis/java-bigquery/commit/460ef318297fe5562a983f64c407b7c0fa5a9a8b)) + + +### Dependencies + +* Update arrow.version to v10 (major) ([#2371](https://github.com/googleapis/java-bigquery/issues/2371)) ([b7873db](https://github.com/googleapis/java-bigquery/commit/b7873db46e174c755657ddcecbb02c0e495c9a1f)) +* Update cloud client dependencies ([#2362](https://github.com/googleapis/java-bigquery/issues/2362)) ([0936699](https://github.com/googleapis/java-bigquery/commit/09366996e281354cc423cbc3ac97a11b0d48eda6)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.6.0 ([#2355](https://github.com/googleapis/java-bigquery/issues/2355)) ([7bc59a7](https://github.com/googleapis/java-bigquery/commit/7bc59a77a6f3821ac19088a8ee864f5d24bdee2e)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.7.0 ([#2366](https://github.com/googleapis/java-bigquery/issues/2366)) ([02102d3](https://github.com/googleapis/java-bigquery/commit/02102d3fb873e68827a8630a4eb34d4bcabd5f9d)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221015-2.0.0 ([#2370](https://github.com/googleapis/java-bigquery/issues/2370)) ([9b796cf](https://github.com/googleapis/java-bigquery/commit/9b796cf0b14094f9442c7e21d7789a673691b87d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.10.0 ([#2356](https://github.com/googleapis/java-bigquery/issues/2356)) ([edb2ca0](https://github.com/googleapis/java-bigquery/commit/edb2ca03f2e216d6a1083a9dc2bc7f74bed9d3a5)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#2361](https://github.com/googleapis/java-bigquery/issues/2361)) ([51b2258](https://github.com/googleapis/java-bigquery/commit/51b2258bbfa542c822668240c8d5f7cc6c63e03c)) +* Update dependency com.google.code.gson:gson to v2.10 ([#2367](https://github.com/googleapis/java-bigquery/issues/2367)) ([82e3de5](https://github.com/googleapis/java-bigquery/commit/82e3de5f76644e3530ac795a5eafd1dac4c3be07)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.15 ([#2352](https://github.com/googleapis/java-bigquery/issues/2352)) ([b0f172c](https://github.com/googleapis/java-bigquery/commit/b0f172c1863bbe66c366a75c4a5c06ee5ba049d0)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 ([#2358](https://github.com/googleapis/java-bigquery/issues/2358)) ([f4e5fc5](https://github.com/googleapis/java-bigquery/commit/f4e5fc59f4b9bc63c763ec1dc8b75f87defc9ced)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#2353](https://github.com/googleapis/java-bigquery/issues/2353)) ([ac9226c](https://github.com/googleapis/java-bigquery/commit/ac9226c7a6297d686c0bd77939f084e3faf6090a)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#2359](https://github.com/googleapis/java-bigquery/issues/2359)) ([52ec31a](https://github.com/googleapis/java-bigquery/commit/52ec31a6dc3705e09e7ce9cd815241a0fb2cc5d6)) + ## [2.17.1](https://github.com/googleapis/java-bigquery/compare/v2.17.0...v2.17.1) (2022-10-10) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 728aad396a..11dca94553 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.17.2-SNAPSHOT + 2.18.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7da20925ff..08884919b2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.17.2-SNAPSHOT + 2.18.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.17.2-SNAPSHOT + 2.18.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ba852664da..0a3312dcd0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.17.2-SNAPSHOT + 2.18.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.17.2-SNAPSHOT + 2.18.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b282c5a499..3867b8b7f3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.17.2-SNAPSHOT + 2.18.0 diff --git a/versions.txt b/versions.txt index 663a2dee6f..a6b08ce13b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.17.1:2.17.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.18.0:2.18.0 \ No newline at end of file From 5c1584c42b23dd743a2f50b66dd6211ab2afde2a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 04:40:16 +0000 Subject: [PATCH 0996/2268] chore(main): release 2.18.1-SNAPSHOT (#2377) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 11dca94553..01678941d6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 08884919b2..0ba387fa8b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.0 + 2.18.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.0 + 2.18.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0a3312dcd0..4811921708 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.0 + 2.18.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3867b8b7f3..87c793677e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.0 + 2.18.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index a6b08ce13b..dfce1b24cb 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.0:2.18.0 \ No newline at end of file +google-cloud-bigquery:2.18.0:2.18.1-SNAPSHOT \ No newline at end of file From 2ff6d52ee6da9e7a4ca0649572473800bf77e392 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 28 Oct 2022 17:47:48 +0200 Subject: [PATCH 0997/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.18.0 (#2378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.18.0 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d4d46fe72..8a33cf0211 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.17.1 + 2.18.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.17.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.18.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.17.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.18.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ddc91a6da7..a51c490629 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.17.1 + 2.18.0 From d528ac20edc59236042101c8e8454b7836f4dc8b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 28 Oct 2022 17:49:14 +0200 Subject: [PATCH 0998/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.15.0 (#2375) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a51c490629..20a4e3a798 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.14.1 + 2.15.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 87c793677e..b2218241d9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.14.1 + 2.15.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d629b2bc83..790e66014f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.14.1 + 2.15.0 test From cb938c15e65ddb7c3946c8343aec32c5ef601586 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 12:22:40 -0400 Subject: [PATCH 0999/2268] chore(deps): update dependency protobuf to v3.20.2 (#1659) (#2376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency protobuf to v3.20.2 (#1659) Co-authored-by: Jeffrey Rennie Co-authored-by: Tomo Suzuki Source-Link: https://github.com/googleapis/synthtool/commit/b59cf7b5a91ecab29e21fdfbb7e3b81066229be4 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:894d56f45fc3f4f0d5f3bcf790846419ee2d8e44715eae8917d6a1bba2b7283d * 🦉 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 Co-authored-by: Jeffrey Rennie Co-authored-by: Tomo Suzuki --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.txt | 50 ++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 459487d388..82b5a1a2e2 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:ae72564aa9c368b9ccd96f4af21f87889fd83b9e60635b80844deb5a2ccd08aa + digest: sha256:894d56f45fc3f4f0d5f3bcf790846419ee2d8e44715eae8917d6a1bba2b7283d diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 02ae42bb40..4a16dfadf8 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -339,33 +339,29 @@ packaging==21.3 \ # via # -r requirements.in # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de +protobuf==3.20.2 \ + --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ + --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ + --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ + --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ + --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ + --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ + --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ + --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ + --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ + --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ + --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ + --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ + --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ + --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ + --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ + --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ + --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ + --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ + --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ + --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ + --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ + --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 # via # -r requirements.in # gcp-docuploader From 0908652a2e8baf46b142a8ba31c0967e593986d6 Mon Sep 17 00:00:00 2001 From: Blake Li Date: Fri, 28 Oct 2022 19:25:13 +0000 Subject: [PATCH 1000/2268] deps: Remove version declaration for gson (#2379) --- pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pom.xml b/pom.xml index 4811921708..884b93589d 100644 --- a/pom.xml +++ b/pom.xml @@ -127,13 +127,6 @@ ${google-api-services-bigquery.version} - - - com.google.code.gson - gson - 2.10 - - org.threeten From e26d281639eb8a9f95db24e8be9a21529fca847f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 19:50:15 +0000 Subject: [PATCH 1001/2268] chore(main): release 2.18.1 (#2380) :robot: I have created a release *beep* *boop* --- ## [2.18.1](https://togithub.com/googleapis/java-bigquery/compare/v2.18.0...v2.18.1) (2022-10-28) ### Dependencies * Remove version declaration for gson ([#2379](https://togithub.com/googleapis/java-bigquery/issues/2379)) ([0908652](https://togithub.com/googleapis/java-bigquery/commit/0908652a2e8baf46b142a8ba31c0967e593986d6)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd01980b4..5dc380fd8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.18.1](https://github.com/googleapis/java-bigquery/compare/v2.18.0...v2.18.1) (2022-10-28) + + +### Dependencies + +* Remove version declaration for gson ([#2379](https://github.com/googleapis/java-bigquery/issues/2379)) ([0908652](https://github.com/googleapis/java-bigquery/commit/0908652a2e8baf46b142a8ba31c0967e593986d6)) + ## [2.18.0](https://github.com/googleapis/java-bigquery/compare/v2.17.1...v2.18.0) (2022-10-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 01678941d6..3e460f6a08 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0ba387fa8b..14e8986a2b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.1-SNAPSHOT + 2.18.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.1-SNAPSHOT + 2.18.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 884b93589d..9ca815c6f8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.1-SNAPSHOT + 2.18.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b2218241d9..db5c6fa783 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.1-SNAPSHOT + 2.18.1 diff --git a/versions.txt b/versions.txt index dfce1b24cb..afc6ba7b83 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.0:2.18.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.18.1:2.18.1 \ No newline at end of file From 25d87105a2b8c8758553fb24b23fd75ec4a24e62 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 20:16:14 +0000 Subject: [PATCH 1002/2268] chore(main): release 2.18.2-SNAPSHOT (#2381) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3e460f6a08..baf5c40c00 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.1 + 2.18.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 14e8986a2b..43c0f1f3db 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.1 + 2.18.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.1 + 2.18.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9ca815c6f8..04c6ca2902 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.1 + 2.18.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -118,7 +118,7 @@ com.google.cloud google-cloud-bigquery - 2.18.1 + 2.18.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index db5c6fa783..023f0e20ca 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.1 + 2.18.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index afc6ba7b83..87455f98ba 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.1:2.18.1 \ No newline at end of file +google-cloud-bigquery:2.18.1:2.18.2-SNAPSHOT \ No newline at end of file From 9d60bcb568bbca53b6cd7359df6d7ee82ce61adf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 16:42:24 -0400 Subject: [PATCH 1003/2268] Revert "chore(deps): update dependency protobuf to v3.20.2" (#1674) (#2382) --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.txt | 50 +++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 82b5a1a2e2..cb4ea018ec 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:894d56f45fc3f4f0d5f3bcf790846419ee2d8e44715eae8917d6a1bba2b7283d + digest: sha256:bd316b9a591c45264775ecaba72e37d65905925c323b68e51a08c4126e4b6d0a diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 4a16dfadf8..02ae42bb40 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -339,29 +339,33 @@ packaging==21.3 \ # via # -r requirements.in # gcp-releasetool -protobuf==3.20.2 \ - --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ - --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ - --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ - --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ - --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ - --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ - --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ - --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ - --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ - --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ - --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ - --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ - --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ - --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ - --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ - --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ - --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ - --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ - --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ - --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ - --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ - --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 +protobuf==3.19.5 \ + --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ + --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ + --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ + --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ + --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ + --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ + --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ + --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ + --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ + --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ + --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ + --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ + --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ + --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ + --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ + --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ + --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ + --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ + --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ + --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ + --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ + --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ + --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ + --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ + --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ + --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de # via # -r requirements.in # gcp-docuploader From fe164aad572b74c21de2ce492f0f7c28bd07a7df Mon Sep 17 00:00:00 2001 From: Blake Li Date: Fri, 28 Oct 2022 23:12:28 +0000 Subject: [PATCH 1004/2268] deps: Remove duplicated deps in the pom. (#2383) --- pom.xml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 04c6ca2902..6e4a9847a6 100644 --- a/pom.xml +++ b/pom.xml @@ -92,15 +92,7 @@ ${arrow.version} runtime - - - com.google.cloud - google-cloud-datacatalog-bom - 1.11.0 - pom - import - - + com.google.cloud google-cloud-datacatalog-bom @@ -126,14 +118,7 @@ google-api-services-bigquery ${google-api-services-bigquery.version} - - - - org.threeten - threeten-extra - 1.7.1 - - + org.threeten From c81be9a98170b0b598397183088ba185d112f18f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 23:38:14 +0000 Subject: [PATCH 1005/2268] chore(main): release 2.18.2 (#2385) :robot: I have created a release *beep* *boop* --- ## [2.18.2](https://togithub.com/googleapis/java-bigquery/compare/v2.18.1...v2.18.2) (2022-10-28) ### Dependencies * Remove duplicated deps in the pom. ([#2383](https://togithub.com/googleapis/java-bigquery/issues/2383)) ([fe164aa](https://togithub.com/googleapis/java-bigquery/commit/fe164aad572b74c21de2ce492f0f7c28bd07a7df)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dc380fd8e..3a9542d9bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.18.2](https://github.com/googleapis/java-bigquery/compare/v2.18.1...v2.18.2) (2022-10-28) + + +### Dependencies + +* Remove duplicated deps in the pom. ([#2383](https://github.com/googleapis/java-bigquery/issues/2383)) ([fe164aa](https://github.com/googleapis/java-bigquery/commit/fe164aad572b74c21de2ce492f0f7c28bd07a7df)) + ## [2.18.1](https://github.com/googleapis/java-bigquery/compare/v2.18.0...v2.18.1) (2022-10-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index baf5c40c00..33ed64621e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.2-SNAPSHOT + 2.18.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 43c0f1f3db..484020a405 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.2-SNAPSHOT + 2.18.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.2-SNAPSHOT + 2.18.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6e4a9847a6..3ae150b14b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.2-SNAPSHOT + 2.18.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.18.2-SNAPSHOT + 2.18.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 023f0e20ca..0e416dd644 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.2-SNAPSHOT + 2.18.2 diff --git a/versions.txt b/versions.txt index 87455f98ba..f8755e3e23 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.1:2.18.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.18.2:2.18.2 \ No newline at end of file From b7863b5acf3558b6d450a769ba33f0e746c553a3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 00:02:17 +0000 Subject: [PATCH 1006/2268] chore(main): release 2.18.3-SNAPSHOT (#2386) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 33ed64621e..c901acc2b4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.2 + 2.18.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 484020a405..d4a09fd67d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.2 + 2.18.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.2 + 2.18.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3ae150b14b..5f1bb3c4c6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.2 + 2.18.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.18.2 + 2.18.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0e416dd644..2f9e213b62 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.2 + 2.18.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index f8755e3e23..f2401982b7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.2:2.18.2 \ No newline at end of file +google-cloud-bigquery:2.18.2:2.18.3-SNAPSHOT \ No newline at end of file From 3be829d92525bd3bc860c9c3c9a8add5a8869a37 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Oct 2022 16:06:50 +0100 Subject: [PATCH 1007/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.24.2 (#2388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.24.0` -> `2.24.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.2/compatibility-slim/2.24.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.24.2/confidence-slim/2.24.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8a33cf0211..71a4a94c68 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.18.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.18.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.18.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.18.2" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 5f1bb3c4c6..e87cd2ceee 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.24.0 + 2.24.2 pom import From 09863a59cc7772407d6cd128f7986df0069237f4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Oct 2022 16:08:19 +0100 Subject: [PATCH 1008/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.18.2 (#2387) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.18.0` -> `2.18.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.18.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.18.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.18.2/compatibility-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.18.2/confidence-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71a4a94c68..29b0070693 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.18.0 + 2.18.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 20a4e3a798..1c09f063bc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.18.0 + 2.18.2 From 55d5f1f2ab6f52aac0c76b5be1ed22eea1ad2bed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Nov 2022 15:32:29 +0100 Subject: [PATCH 1009/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.4 (#2389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.4 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 29b0070693..0398c2ca49 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.3 + 26.1.4 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.3') +implementation platform('com.google.cloud:libraries-bom:26.1.4') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d24a92c38d..4c835b4562 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.3 + 26.1.4 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 790e66014f..4c4ad69f99 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.3 + 26.1.4 pom import From bc400308fc7964a765daecdd327ec93a5115ca64 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 1 Nov 2022 17:52:37 -0400 Subject: [PATCH 1010/2268] ci: not to check flatten plugin behavior (#2391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: not to check flatten plugin behavior We have had the check for the flatten-maven-plugin in each Cloud Java client repository. However, the behavior of the plugin has been stable and its not each repository's responsibility to assert the plugin's behavior. A new check has added at the googleapis/java-shared-config repository to assert the plugin's behavior when we upgrade its version. * 🦉 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 --- .kokoro/dependencies.sh | 60 +++-------------------------------------- owlbot.py | 1 - 2 files changed, 3 insertions(+), 58 deletions(-) diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 545820622f..bd8960246f 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -14,6 +14,7 @@ # limitations under the License. set -eo pipefail +shopt -s nullglob ## Get the directory of the build script scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) @@ -41,9 +42,9 @@ function determineMavenOpts() { then # MaxPermSize is no longer supported as of jdk 17 echo -n "-Xmx1024m" - else + else echo -n "-Xmx1024m -XX:MaxPermSize=128m" - fi + fi } export MAVEN_OPTS=$(determineMavenOpts) @@ -56,58 +57,3 @@ retry_with_backoff 3 10 \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - # Excluding commons-codec,commons-logging from the comparison as a temp fix - # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 - mvn dependency:list -f pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - # Excluding commons-codec,commons-logging from the comparison as a temp fix - # Explanation and issue filed in maven-dependency-plugin: https://issues.apache.org/jira/browse/MDEP-737 - mvn dependency:list -f .flattened-pom.xml -DexcludeArtifactIds=commons-codec,commons-logging,grpc-googleapis -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in $(find -name ".flattened-pom.xml") -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/owlbot.py b/owlbot.py index 54ebff8614..bf1878a29c 100644 --- a/owlbot.py +++ b/owlbot.py @@ -19,7 +19,6 @@ java.common_templates(excludes=[ '.kokoro/nightly/samples.cfg', '.kokoro/presubmit/samples.cfg', - '.kokoro/dependencies.sh', 'codecov.yaml', 'renovate.json', '.kokoro/build.sh' From d3f6a6bf55697541cfdc3bcdd2c441e8bd21dbc2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 3 Nov 2022 17:15:54 +0100 Subject: [PATCH 1011/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221028-2.0.0 (#2393) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e87cd2ceee..78a5edb83f 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20221015-2.0.0 + v2-rev20221028-2.0.0 3.0.5 10.0.0 From 113303fb41ec4855bb81a5bd3c7f8984bc70da3e Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 4 Nov 2022 12:51:22 -0400 Subject: [PATCH 1012/2268] feat: add getTimestampInstant() method to FieldValue (#2350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add getReadableTimestampValue() method to FieldValue * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: return java.time.Instant * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: change method name * Update FieldValue.java * 🦉 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 --- .../com/google/cloud/bigquery/FieldValue.java | 18 ++++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index aef4728194..58c012a60e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; +import static java.time.temporal.ChronoUnit.MICROS; import com.google.api.client.util.Data; import com.google.api.core.BetaApi; @@ -26,6 +27,7 @@ import java.io.Serializable; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.Instant; import java.util.List; import java.util.Map; import java.util.Objects; @@ -36,6 +38,7 @@ * query or when listing table data. */ public class FieldValue implements Serializable { + private static final int MICROSECONDS = 1000000; private static final long serialVersionUID = 469098630191710061L; @@ -191,6 +194,21 @@ public long getTimestampValue() { return scaled.longValue(); } + /** + * Returns this field's value as a {@code String}, representing a timestamp as an Instant. This + * method should only be used if the corresponding field has {@link LegacySQLTypeName#TIMESTAMP} + * type. + * + * @throws ClassCastException if the field is not a primitive type + * @throws NumberFormatException if the field's value could not be converted to {@link Long} + * @throws NullPointerException if {@link #isNull()} returns {@code true} + */ + @SuppressWarnings("unchecked") + public Instant getTimestampInstant() { + checkNotNull(value); + return Instant.EPOCH.plus(getTimestampValue(), MICROS); + } + /** * Returns this field's value as a {@link java.math.BigDecimal}. This method should only be used * if the corresponding field has {@link LegacySQLTypeName#NUMERIC} type. diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8e8f4cc0c5..4f72e7e66d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2382,6 +2382,23 @@ public void testMultipleStatementsQueryException() throws InterruptedException { } } + @Test + public void testTimestamp() throws InterruptedException { + String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; + String timestampStringValueExpected = "2022-01-24T23:54:25.095574Z"; + + TableResult resultInteractive = + bigquery.query( + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .build()); + for (FieldValueList row : resultInteractive.getValues()) { + FieldValue timeStampCell = row.get(0); + Instant timestampStringValueActual = timeStampCell.getTimestampInstant(); + assertEquals(timestampStringValueExpected, timestampStringValueActual.toString()); + } + } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQuery() throws InterruptedException { From 87f8cdd7b0b005430486e51e4c339a6de95b0011 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Nov 2022 17:37:10 +0100 Subject: [PATCH 1013/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.17 (#2396) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 4c835b4562..20dfb9196c 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.16 + 0.9.17 test From af850568f32afeab185e07db354f4cb529645c99 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:37:30 -0500 Subject: [PATCH 1014/2268] chore(java): update dependencies in java requirements file (#1695) (#2398) * chore(java): update gcp-releasetool and cryptography in java requirements file Source-Link: https://github.com/googleapis/synthtool/commit/74d0956884c1bb9dc901b52de35ca2bca025a74e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:142286d973c7b6d58186070f203b50058a20a7d7b42147996db24921a18da1b0 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 7 ++-- .kokoro/requirements.txt | 75 ++++++++++++++++++++------------------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index cb4ea018ec..c8316751eb 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bd316b9a591c45264775ecaba72e37d65905925c323b68e51a08c4126e4b6d0a + digest: sha256:142286d973c7b6d58186070f203b50058a20a7d7b42147996db24921a18da1b0 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 6aa7cf2b55..9cc4a1baae 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,7 +1,8 @@ -gcp-docuploader==0.6.3 +gcp-docuploader==0.6.4 google-crc32c==1.3.0 googleapis-common-protos==1.56.3 -gcp-releasetool==1.8.7 +gcp-releasetool==1.9.1 +cryptography==38.0.3 cachetools==4.2.4 cffi==1.15.1 jeepney==0.7.1 @@ -29,5 +30,5 @@ zipp==3.6.0 rsa==4.9 six==1.16.0 attrs==22.1.0 -google-auth==2.11.0 +google-auth==2.14.0 idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 02ae42bb40..2dce197bf4 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with python 3.10 # To update, run: # -# pip-compile --allow-unsafe --generate-hashes requirements.in +# pip-compile --generate-hashes requirements.in # attrs==22.1.0 \ --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ @@ -104,43 +104,44 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==38.0.1 \ - --hash=sha256:0297ffc478bdd237f5ca3a7dc96fc0d315670bfa099c04dc3a4a2172008a405a \ - --hash=sha256:10d1f29d6292fc95acb597bacefd5b9e812099d75a6469004fd38ba5471a977f \ - --hash=sha256:16fa61e7481f4b77ef53991075de29fc5bacb582a1244046d2e8b4bb72ef66d0 \ - --hash=sha256:194044c6b89a2f9f169df475cc167f6157eb9151cc69af8a2a163481d45cc407 \ - --hash=sha256:1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7 \ - --hash=sha256:3261725c0ef84e7592597606f6583385fed2a5ec3909f43bc475ade9729a41d6 \ - --hash=sha256:3b72c360427889b40f36dc214630e688c2fe03e16c162ef0aa41da7ab1455153 \ - --hash=sha256:3e3a2599e640927089f932295a9a247fc40a5bdf69b0484532f530471a382750 \ - --hash=sha256:3fc26e22840b77326a764ceb5f02ca2d342305fba08f002a8c1f139540cdfaad \ - --hash=sha256:5067ee7f2bce36b11d0e334abcd1ccf8c541fc0bbdaf57cdd511fdee53e879b6 \ - --hash=sha256:52e7bee800ec869b4031093875279f1ff2ed12c1e2f74923e8f49c916afd1d3b \ - --hash=sha256:64760ba5331e3f1794d0bcaabc0d0c39e8c60bf67d09c93dc0e54189dfd7cfe5 \ - --hash=sha256:765fa194a0f3372d83005ab83ab35d7c5526c4e22951e46059b8ac678b44fa5a \ - --hash=sha256:79473cf8a5cbc471979bd9378c9f425384980fcf2ab6534b18ed7d0d9843987d \ - --hash=sha256:896dd3a66959d3a5ddcfc140a53391f69ff1e8f25d93f0e2e7830c6de90ceb9d \ - --hash=sha256:89ed49784ba88c221756ff4d4755dbc03b3c8d2c5103f6d6b4f83a0fb1e85294 \ - --hash=sha256:ac7e48f7e7261207d750fa7e55eac2d45f720027d5703cd9007e9b37bbb59ac0 \ - --hash=sha256:ad7353f6ddf285aeadfaf79e5a6829110106ff8189391704c1d8801aa0bae45a \ - --hash=sha256:b0163a849b6f315bf52815e238bc2b2346604413fa7c1601eea84bcddb5fb9ac \ - --hash=sha256:b6c9b706316d7b5a137c35e14f4103e2115b088c412140fdbd5f87c73284df61 \ - --hash=sha256:c2e5856248a416767322c8668ef1845ad46ee62629266f84a8f007a317141013 \ - --hash=sha256:ca9f6784ea96b55ff41708b92c3f6aeaebde4c560308e5fbbd3173fbc466e94e \ - --hash=sha256:d1a5bd52d684e49a36582193e0b89ff267704cd4025abefb9e26803adeb3e5fb \ - --hash=sha256:d3971e2749a723e9084dd507584e2a2761f78ad2c638aa31e80bc7a15c9db4f9 \ - --hash=sha256:d4ef6cc305394ed669d4d9eebf10d3a101059bdcf2669c366ec1d14e4fb227bd \ - --hash=sha256:d9e69ae01f99abe6ad646947bba8941e896cb3aa805be2597a0400e0764b5818 +cryptography==38.0.3 \ + --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ + --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ + --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ + --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ + --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ + --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ + --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ + --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ + --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ + --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ + --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ + --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ + --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ + --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ + --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ + --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ + --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ + --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ + --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ + --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ + --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ + --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ + --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ + --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ + --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ + --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 # via + # -r requirements.in # gcp-releasetool # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b +gcp-docuploader==0.6.4 \ + --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ + --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.8.7 \ - --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ - --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d +gcp-releasetool==1.9.1 \ + --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ + --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b # via -r requirements.in google-api-core==2.8.2 \ --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ @@ -149,9 +150,9 @@ google-api-core==2.8.2 \ # -r requirements.in # google-cloud-core # google-cloud-storage -google-auth==2.11.0 \ - --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ - --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb +google-auth==2.14.0 \ + --hash=sha256:1ad5b0e6eba5f69645971abb3d2c197537d5914070a8c6d30299dfdb07c5c700 \ + --hash=sha256:cf24817855d874ede2efd071aa22125445f555de1685b739a9782fcf408c2a3d # via # -r requirements.in # gcp-releasetool From 7927350f562dbdef8774df82c9c0d528118d0213 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Nov 2022 17:37:46 +0100 Subject: [PATCH 1015/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.17 (#2397) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 20dfb9196c..fac75990ef 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.16 + 0.9.17 true com.example.bigquery.NativeImageBigquerySample From 9de9aa8f7eb2e21b88a13df23b65e2aaf6b749cf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Nov 2022 19:46:12 +0100 Subject: [PATCH 1016/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 (#2399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.5` -> `3.0.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/compatibility-slim/3.0.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.6/confidence-slim/3.0.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.0.6`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​306-httpsgithubcomgoogleapisjava-shared-dependenciescomparev305v306-2022-11-07) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.5...v3.0.6) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.14.0 ([#​901](https://togithub.com/googleapis/java-shared-dependencies/issues/901)) ([33c5511](https://togithub.com/googleapis/java-shared-dependencies/commit/33c55112ff485da1d7a0a32d8b6dade33aa04ff8)) - Update dependency com.google.api-client:google-api-client-bom to v2.0.1 ([#​899](https://togithub.com/googleapis/java-shared-dependencies/issues/899)) ([4029e89](https://togithub.com/googleapis/java-shared-dependencies/commit/4029e89be507ddfa030515565fdb6fbf8997324e)) - Update dependency com.google.api:api-common to v2.2.2 ([#​892](https://togithub.com/googleapis/java-shared-dependencies/issues/892)) ([5c59fbd](https://togithub.com/googleapis/java-shared-dependencies/commit/5c59fbd3c3cf3efbfda50420c8048e3ff257084c)) - Update dependency com.google.cloud:grpc-gcp to v1.3.1 ([#​884](https://togithub.com/googleapis/java-shared-dependencies/issues/884)) ([9fffe24](https://togithub.com/googleapis/java-shared-dependencies/commit/9fffe243b631565a00b0a848a6c73163b1dd33a4)) - Update dependency com.google.code.gson:gson to v2.10 ([#​887](https://togithub.com/googleapis/java-shared-dependencies/issues/887)) ([15017de](https://togithub.com/googleapis/java-shared-dependencies/commit/15017de39a35f90bc1b38b828edc23fdce524a07)) - Update dependency com.google.http-client:google-http-client-bom to v1.42.3 ([#​893](https://togithub.com/googleapis/java-shared-dependencies/issues/893)) ([4c0de9b](https://togithub.com/googleapis/java-shared-dependencies/commit/4c0de9bd188bfab5fe126c8b01b4d7168f8a5079)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.9 ([#​889](https://togithub.com/googleapis/java-shared-dependencies/issues/889)) ([8576271](https://togithub.com/googleapis/java-shared-dependencies/commit/85762716d1bbb97c447f86451094fb8af2528470)) - Update dependency io.grpc:grpc-bom to v1.50.2 ([#​878](https://togithub.com/googleapis/java-shared-dependencies/issues/878)) ([fd569af](https://togithub.com/googleapis/java-shared-dependencies/commit/fd569af1e5f1b195e2421fc9e02d8b67afe1c638)) - Update dependency org.checkerframework:checker-qual to v3.27.0 ([#​896](https://togithub.com/googleapis/java-shared-dependencies/issues/896)) ([f0f7931](https://togithub.com/googleapis/java-shared-dependencies/commit/f0f7931937a0ed9a32fd87cd58c82b787d368242)) - Update dependency org.threeten:threetenbp to v1.6.4 ([#​894](https://togithub.com/googleapis/java-shared-dependencies/issues/894)) ([899682d](https://togithub.com/googleapis/java-shared-dependencies/commit/899682d0405645d9d5288b298af2fda228414669)) - Update gax.version to v2.19.5 ([#​903](https://togithub.com/googleapis/java-shared-dependencies/issues/903)) ([3e4d8b3](https://togithub.com/googleapis/java-shared-dependencies/commit/3e4d8b35d3f682b07326ffa0a3e552d097f25a65)) - Update google.common-protos.version to v2.10.0 ([#​900](https://togithub.com/googleapis/java-shared-dependencies/issues/900)) ([53b54c3](https://togithub.com/googleapis/java-shared-dependencies/commit/53b54c35f3a7c19df488921a6077e7a9bfb0b103)) - Update google.core.version to v2.8.23 ([#​885](https://togithub.com/googleapis/java-shared-dependencies/issues/885)) ([686dd7c](https://togithub.com/googleapis/java-shared-dependencies/commit/686dd7c8f541189302e8cac4ae72ed7d967b5b3f)) - Update google.core.version to v2.8.24 ([#​890](https://togithub.com/googleapis/java-shared-dependencies/issues/890)) ([1effda3](https://togithub.com/googleapis/java-shared-dependencies/commit/1effda381c7b886f5ae4d2dac9473da821e655fe)) - Update google.core.version to v2.8.27 ([#​902](https://togithub.com/googleapis/java-shared-dependencies/issues/902)) ([3bcb804](https://togithub.com/googleapis/java-shared-dependencies/commit/3bcb804dec4358ed0a9c6c35cf4c35f817821e9a)) - Update iam.version to v1.6.6 ([#​886](https://togithub.com/googleapis/java-shared-dependencies/issues/886)) ([03d0690](https://togithub.com/googleapis/java-shared-dependencies/commit/03d0690f01f9217e31dd65d55c28a47f2f2deb22)) - Update iam.version to v1.6.7 ([#​895](https://togithub.com/googleapis/java-shared-dependencies/issues/895)) ([6cebc20](https://togithub.com/googleapis/java-shared-dependencies/commit/6cebc205daa98b96a8b27b3fc3cd222319b27e59))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 78a5edb83f..83bd64e30c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20221028-2.0.0 - 3.0.5 + 3.0.6 10.0.0
    From 259e9cafc37d1a8ace0e74228b335897b1729106 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 19:20:15 +0000 Subject: [PATCH 1017/2268] chore(main): release 2.19.0 (#2395) :robot: I have created a release *beep* *boop* --- ## [2.19.0](https://togithub.com/googleapis/java-bigquery/compare/v2.18.2...v2.19.0) (2022-11-07) ### Features * Add getTimestampInstant() method to FieldValue ([#2350](https://togithub.com/googleapis/java-bigquery/issues/2350)) ([113303f](https://togithub.com/googleapis/java-bigquery/commit/113303fb41ec4855bb81a5bd3c7f8984bc70da3e)) ### Dependencies * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221028-2.0.0 ([#2393](https://togithub.com/googleapis/java-bigquery/issues/2393)) ([d3f6a6b](https://togithub.com/googleapis/java-bigquery/commit/d3f6a6bf55697541cfdc3bcdd2c441e8bd21dbc2)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#2399](https://togithub.com/googleapis/java-bigquery/issues/2399)) ([9de9aa8](https://togithub.com/googleapis/java-bigquery/commit/9de9aa8f7eb2e21b88a13df23b65e2aaf6b749cf)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.17 ([#2396](https://togithub.com/googleapis/java-bigquery/issues/2396)) ([87f8cdd](https://togithub.com/googleapis/java-bigquery/commit/87f8cdd7b0b005430486e51e4c339a6de95b0011)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.17 ([#2397](https://togithub.com/googleapis/java-bigquery/issues/2397)) ([7927350](https://togithub.com/googleapis/java-bigquery/commit/7927350f562dbdef8774df82c9c0d528118d0213)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a9542d9bc..0fea0dce4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.19.0](https://github.com/googleapis/java-bigquery/compare/v2.18.2...v2.19.0) (2022-11-07) + + +### Features + +* Add getTimestampInstant() method to FieldValue ([#2350](https://github.com/googleapis/java-bigquery/issues/2350)) ([113303f](https://github.com/googleapis/java-bigquery/commit/113303fb41ec4855bb81a5bd3c7f8984bc70da3e)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221028-2.0.0 ([#2393](https://github.com/googleapis/java-bigquery/issues/2393)) ([d3f6a6b](https://github.com/googleapis/java-bigquery/commit/d3f6a6bf55697541cfdc3bcdd2c441e8bd21dbc2)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#2399](https://github.com/googleapis/java-bigquery/issues/2399)) ([9de9aa8](https://github.com/googleapis/java-bigquery/commit/9de9aa8f7eb2e21b88a13df23b65e2aaf6b749cf)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.17 ([#2396](https://github.com/googleapis/java-bigquery/issues/2396)) ([87f8cdd](https://github.com/googleapis/java-bigquery/commit/87f8cdd7b0b005430486e51e4c339a6de95b0011)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.17 ([#2397](https://github.com/googleapis/java-bigquery/issues/2397)) ([7927350](https://github.com/googleapis/java-bigquery/commit/7927350f562dbdef8774df82c9c0d528118d0213)) + ## [2.18.2](https://github.com/googleapis/java-bigquery/compare/v2.18.1...v2.18.2) (2022-10-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c901acc2b4..e4d171d568 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.18.3-SNAPSHOT + 2.19.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d4a09fd67d..6be84a6e5d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.18.3-SNAPSHOT + 2.19.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.18.3-SNAPSHOT + 2.19.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 83bd64e30c..160ae089ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.18.3-SNAPSHOT + 2.19.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.18.3-SNAPSHOT + 2.19.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2f9e213b62..527b8859e2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.18.3-SNAPSHOT + 2.19.0 diff --git a/versions.txt b/versions.txt index f2401982b7..716eb8d399 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.18.2:2.18.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.19.0:2.19.0 \ No newline at end of file From 8db4d98d0d5e0946488a68a696b82f8ca80c829c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 19:46:15 +0000 Subject: [PATCH 1018/2268] chore(main): release 2.19.1-SNAPSHOT (#2400) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e4d171d568..856419488f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.19.0 + 2.19.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6be84a6e5d..c995fafdb4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.19.0 + 2.19.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.19.0 + 2.19.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 160ae089ee..2376dd4991 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.19.0 + 2.19.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.19.0 + 2.19.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 527b8859e2..3cf6e3361a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.19.0 + 2.19.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 716eb8d399..97c5399044 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.19.0:2.19.0 \ No newline at end of file +google-cloud-bigquery:2.19.0:2.19.1-SNAPSHOT \ No newline at end of file From fde9d7abc134bf85706367a716e5b4e354ce44d9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Nov 2022 17:02:25 +0100 Subject: [PATCH 1019/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.19.0 (#2401) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.18.2` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.0/compatibility-slim/2.18.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.0/confidence-slim/2.18.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0398c2ca49..1373ed0a84 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.18.2 + 2.19.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.18.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.19.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.18.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.19.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1c09f063bc..50502e9f10 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.18.2 + 2.19.0 From aac27119142e1411eb2f8b0270c806262f08d391 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Nov 2022 17:04:15 +0100 Subject: [PATCH 1020/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.15.0 (#2402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.14.0` -> `2.15.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.0/compatibility-slim/2.14.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.0/confidence-slim/2.14.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2376dd4991..bfd267df56 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.14.0 + 2.15.0 test From 92aa0f58edd5dc346cabee46eafe0d4f3c280a34 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:22:46 +0000 Subject: [PATCH 1021/2268] chore(main): release 2.19.1 (#2403) :robot: I have created a release *beep* *boop* --- ## [2.19.1](https://togithub.com/googleapis/java-bigquery/compare/v2.19.0...v2.19.1) (2022-11-08) ### Dependencies * Update dependency com.google.cloud:google-cloud-storage to v2.15.0 ([#2402](https://togithub.com/googleapis/java-bigquery/issues/2402)) ([aac2711](https://togithub.com/googleapis/java-bigquery/commit/aac27119142e1411eb2f8b0270c806262f08d391)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fea0dce4e..2959a5a17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.19.1](https://github.com/googleapis/java-bigquery/compare/v2.19.0...v2.19.1) (2022-11-08) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-storage to v2.15.0 ([#2402](https://github.com/googleapis/java-bigquery/issues/2402)) ([aac2711](https://github.com/googleapis/java-bigquery/commit/aac27119142e1411eb2f8b0270c806262f08d391)) + ## [2.19.0](https://github.com/googleapis/java-bigquery/compare/v2.18.2...v2.19.0) (2022-11-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 856419488f..857ff840f7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.19.1-SNAPSHOT + 2.19.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c995fafdb4..4d172f93c1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.19.1-SNAPSHOT + 2.19.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.19.1-SNAPSHOT + 2.19.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bfd267df56..1883b2ffd1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.19.1-SNAPSHOT + 2.19.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.19.1-SNAPSHOT + 2.19.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3cf6e3361a..d35fbbdefb 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.19.1-SNAPSHOT + 2.19.1 diff --git a/versions.txt b/versions.txt index 97c5399044..9201e38532 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.19.0:2.19.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.19.1:2.19.1 \ No newline at end of file From 59e444a7a447fdbe2db9b0fc67f59c03c83f18bc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:50:27 +0000 Subject: [PATCH 1022/2268] chore(main): release 2.19.2-SNAPSHOT (#2404) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 857ff840f7..1ec05b9c1d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.19.1 + 2.19.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4d172f93c1..ee75b9df38 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.19.1 + 2.19.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.19.1 + 2.19.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1883b2ffd1..cb38a60f6e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.19.1 + 2.19.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.19.1 + 2.19.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d35fbbdefb..98c40a03ee 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.19.1 + 2.19.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9201e38532..6972769118 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.19.1:2.19.1 \ No newline at end of file +google-cloud-bigquery:2.19.1:2.19.2-SNAPSHOT \ No newline at end of file From 9297a4359f7b080a60b6bb5873edfd66cd7d2261 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 8 Nov 2022 15:46:20 -0500 Subject: [PATCH 1023/2268] feat: next release from main branch is 2.20.0 (#2405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: next release from main branch is 2.20.0 * 🦉 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 --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 17 +++++++++++++++++ README.md | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index c87ad8d73c..7abf72a6e2 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -15,6 +15,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.10.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.19.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 7e57974a8b..e3a8af4e90 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -79,6 +79,23 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor + - pattern: 2.19.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' permissionRules: - team: api-bigquery permission: admin diff --git a/README.md b/README.md index 1373ed0a84..dcdc00a286 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.19.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.19.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.19.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.19.1" ``` ## Authentication From 0ed802d1c7f5da40f1b3b172d44b59b161f2d080 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Nov 2022 16:34:17 +0100 Subject: [PATCH 1024/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.19.1 (#2409) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.19.0` -> `2.19.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.1/compatibility-slim/2.19.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.19.1/confidence-slim/2.19.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dcdc00a286..f5cdec8b48 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.19.0 + 2.19.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 50502e9f10..f6938e9e2e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.19.0 + 2.19.1 From 406e29b48298329611e32d1e88a911923789a435 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Nov 2022 17:00:06 +0100 Subject: [PATCH 1025/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.15.1 (#2411) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f6938e9e2e..eb95d67c98 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.15.0 + 2.15.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 98c40a03ee..914a8c154e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.15.0 + 2.15.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4c4ad69f99..68e1098936 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.15.0 + 2.15.1 test From de16f8205f72f540b6bef8edb25da41d388c54cf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Nov 2022 17:40:36 +0100 Subject: [PATCH 1026/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.25.0 (#2410) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.24.2` -> `2.25.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.25.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.25.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.25.0/compatibility-slim/2.24.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.25.0/confidence-slim/2.24.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage ### [`v2.25.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2250-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2242v2250-2022-11-08) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.24.2...v2.25.0) ##### Features - Add schema comparision to the main request loop for multiplexing to correctly update schema ([#​1865](https://togithub.com/googleapis/java-bigquerystorage/issues/1865)) ([cb18d28](https://togithub.com/googleapis/java-bigquerystorage/commit/cb18d288f78773af60b9fddc583f46a571cbc3f4)) ##### Documentation - Remove stale header guidance for AppendRows ([#​1866](https://togithub.com/googleapis/java-bigquerystorage/issues/1866)) ([1de23be](https://togithub.com/googleapis/java-bigquerystorage/commit/1de23be7fe84747a4e7ca5b511458a5b378a1170)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-bigquery to v2.18.2 ([#​1862](https://togithub.com/googleapis/java-bigquerystorage/issues/1862)) ([ca2cafe](https://togithub.com/googleapis/java-bigquerystorage/commit/ca2cafe095eca8b610ec8ca1acf95cf7a561af61)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.19.0 ([#​1871](https://togithub.com/googleapis/java-bigquerystorage/issues/1871)) ([4aa967a](https://togithub.com/googleapis/java-bigquerystorage/commit/4aa967a0a30db0037a04b6b47646ae79dfffaead)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#​1870](https://togithub.com/googleapis/java-bigquerystorage/issues/1870)) ([17b2a80](https://togithub.com/googleapis/java-bigquerystorage/commit/17b2a8036cf5706cb753f7116b1fa424a661ba39)) - Update dependency kr.motd.maven:os-maven-plugin to v1.7.1 ([#​1868](https://togithub.com/googleapis/java-bigquerystorage/issues/1868)) ([08b8468](https://togithub.com/googleapis/java-bigquerystorage/commit/08b8468dc31fe654f5f7a345377b14f51f19eeea))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb38a60f6e..5285aace80 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.24.2 + 2.25.0 pom import From e4b60359181126e4d91e75c67b821a900870a728 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 17:50:15 +0000 Subject: [PATCH 1027/2268] chore: update google-auth to 2.14.1 (#1703) (#2412) Co-authored-by: Anthonios Partheniou Source-Link: https://togithub.com/googleapis/synthtool/commit/9457e69470097f8e71b6b497ceece5bc423eaf3a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:a3fe0b4c75f322520f548e535ed329df1e475ace3cb4a979b78e003cb822636a --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 +- .kokoro/requirements.txt | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index c8316751eb..676aaea0c7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:142286d973c7b6d58186070f203b50058a20a7d7b42147996db24921a18da1b0 + digest: sha256:a3fe0b4c75f322520f548e535ed329df1e475ace3cb4a979b78e003cb822636a diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 9cc4a1baae..ae1d92e680 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -30,5 +30,5 @@ zipp==3.6.0 rsa==4.9 six==1.16.0 attrs==22.1.0 -google-auth==2.14.0 +google-auth==2.14.1 idna==3.4 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 2dce197bf4..9c82529c84 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -150,9 +150,8 @@ google-api-core==2.8.2 \ # -r requirements.in # google-cloud-core # google-cloud-storage -google-auth==2.14.0 \ - --hash=sha256:1ad5b0e6eba5f69645971abb3d2c197537d5914070a8c6d30299dfdb07c5c700 \ - --hash=sha256:cf24817855d874ede2efd071aa22125445f555de1685b739a9782fcf408c2a3d +google-auth==2.14.1 \ + --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 # via # -r requirements.in # gcp-releasetool From 42c083ac680c657bf3f648fbce81004ecac8be87 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 11 Nov 2022 14:16:08 -0500 Subject: [PATCH 1028/2268] feat: add fast query path support when empty jobId object is passed (#2349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add fast query path support with job location * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix NPE * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: respect user specified location * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore add IT tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: allow users to specify project ID with JobID * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix conditions * 🦉 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 --- .../google/cloud/bigquery/BigQueryImpl.java | 23 ++++- .../cloud/bigquery/QueryRequestInfo.java | 10 ++- .../cloud/bigquery/QueryRequestInfoTest.java | 8 +- .../cloud/bigquery/it/ITBigQueryTest.java | 85 +++++++++++++++++++ 4 files changed, 122 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 01048689fe..b5ca2e5776 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1300,7 +1300,7 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); - if (requestInfo.isFastQuerySupported()) { + if (requestInfo.isFastQuerySupported(null)) { String projectId = getOptions().getProjectId(); QueryRequest content = requestInfo.toPb(); return queryRpc(projectId, content, options); @@ -1385,6 +1385,27 @@ public com.google.api.services.bigquery.model.QueryResponse call() { public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... options) throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); + // If all parameters passed in configuration are supported by the query() method on the backend, + // put on fast path + QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); + if (requestInfo.isFastQuerySupported(jobId)) { + // Be careful when setting the projectID in JobId, if a projectID is specified in the JobId, + // the job created by the query method will use that project. This may cause the query to + // fail with "Access denied" if the project do not have enough permissions to run the job. + + String projectId = + jobId.getProject() != null ? jobId.getProject() : getOptions().getProjectId(); + QueryRequest content = requestInfo.toPb(); + // Be careful when setting the location in JobId, if a location is specified in the JobId, + // the job created by the query method will be in that location, even if the table to be + // queried is in a different location. This may cause the query to fail with + // "BigQueryException: Not found" + if (jobId.getLocation() != null) { + content.setLocation(jobId.getLocation()); + } + + return queryRpc(projectId, content, options); + } return create(JobInfo.of(jobId, configuration), options).getQueryResults(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index ccde465af4..00a8983636 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -57,7 +57,15 @@ final class QueryRequestInfo { this.useQueryCache = config.useQueryCache(); } - boolean isFastQuerySupported() { + boolean isFastQuerySupported(JobId jobId) { + // Fast query path is not possible if job is specified in the JobID object + // Respect Job field value in JobId specified by user. + // Specifying it will force the query to take the slower path. + if (jobId != null) { + if (jobId.getJob() != null) { + return false; + } + } return config.getClustering() == null && config.getCreateDisposition() == null && config.getDestinationEncryptionConfiguration() == null diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index a62e3c0a0d..456475597e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -150,8 +150,12 @@ public class QueryRequestInfoTest { @Test public void testIsFastQuerySupported() { - assertEquals(false, REQUEST_INFO.isFastQuerySupported()); - assertEquals(true, REQUEST_INFO_SUPPORTED.isFastQuerySupported()); + JobId jobIdSupported = JobId.newBuilder().build(); + JobId jobIdNotSupported = JobId.newBuilder().setJob("random-job-id").build(); + assertEquals(false, REQUEST_INFO.isFastQuerySupported(jobIdSupported)); + assertEquals(true, REQUEST_INFO_SUPPORTED.isFastQuerySupported(jobIdSupported)); + assertEquals(false, REQUEST_INFO.isFastQuerySupported(jobIdNotSupported)); + assertEquals(false, REQUEST_INFO_SUPPORTED.isFastQuerySupported(jobIdNotSupported)); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 4f72e7e66d..ed073a93ae 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -180,6 +180,7 @@ public class ITBigQueryTest { private static final Long EXPIRATION_MS = 86400000L; private static final Logger LOG = Logger.getLogger(ITBigQueryTest.class.getName()); private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); + private static final String UK_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String DESCRIPTION = "Test dataset"; private static final String OTHER_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String MODEL_DATASET = RemoteBigQueryHelper.generateDatasetName(); @@ -533,6 +534,8 @@ public class ITBigQueryTest { private static final TableId TABLE_ID = TableId.of(DATASET, "testing_table"); private static final TableId TABLE_ID_DDL = TableId.of(DATASET, "ddl_testing_table"); private static final TableId TABLE_ID_FASTQUERY = TableId.of(DATASET, "fastquery_testing_table"); + private static final TableId TABLE_ID_FASTQUERY_UK = + TableId.of(UK_DATASET, "fastquery_testing_table"); private static final TableId TABLE_ID_LARGE = TableId.of(DATASET, "large_data_testing_table"); private static final TableId TABLE_ID_FASTQUERY_BQ_RESULTSET = TableId.of(DATASET, "fastquery_testing_bq_resultset"); @@ -717,6 +720,7 @@ public static void beforeClass() throws InterruptedException, IOException { DatasetInfo info3 = DatasetInfo.newBuilder(ROUTINE_DATASET).setDescription("java routine lifecycle").build(); bigquery.create(info3); + LoadJobConfiguration configuration = LoadJobConfiguration.newBuilder( TABLE_ID, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) @@ -781,6 +785,7 @@ public static void beforeClass() throws InterruptedException, IOException { public static void afterClass() throws ExecutionException, InterruptedException { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, DATASET); + RemoteBigQueryHelper.forceDelete(bigquery, UK_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, MODEL_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); } @@ -3284,6 +3289,86 @@ public void testFastSQLQuery() throws InterruptedException { } } + @Test + public void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { + String random_project_id = "RANDOM_PROJECT_" + UUID.randomUUID().toString().replace('-', '_'); + System.out.println(random_project_id); + String query = + "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); + // With incorrect projectID in jobid + // The job will be created with the specified(incorrect) projectID + // hence failing the operation + JobId jobIdWithProjectId = JobId.newBuilder().setProject(random_project_id).build(); + QueryJobConfiguration configSelect = + QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); + try { + bigquery.query(configSelect, jobIdWithProjectId); + } catch (Exception exception) { + // error message for non-existent project + assertTrue(exception.getMessage().contains("Cannot parse as CloudRegion")); + assertEquals(BigQueryException.class, exception.getClass()); + } + } + + @Test + public void testLocationFastSQLQueryWithJobId() throws InterruptedException { + DatasetInfo infoUK = + DatasetInfo.newBuilder(UK_DATASET) + .setDescription(DESCRIPTION) + .setLocation("europe-west1") + .setLabels(LABELS) + .build(); + bigquery.create(infoUK); + + TableDefinition tableDefinition = StandardTableDefinition.of(SIMPLE_SCHEMA); + TableInfo tableInfo = TableInfo.newBuilder(TABLE_ID_FASTQUERY_UK, tableDefinition).build(); + bigquery.create(tableInfo); + + String insert = + "INSERT " + UK_DATASET + "." + TABLE_ID_FASTQUERY_UK.getTable() + " VALUES('Anna');"; + + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(insert) + .setDefaultDataset(DatasetId.of(UK_DATASET)) + .build(); + TableResult result = bigquery.query(config); + assertEquals(SIMPLE_SCHEMA, result.getSchema()); + assertEquals(1, result.getTotalRows()); + assertNull(result.getNextPage()); + assertNull(result.getNextPageToken()); + assertFalse(result.hasNextPage()); + // Verify correctness of table content + for (FieldValueList row : result.getValues()) { + FieldValue stringCell = row.get(0); + assertEquals(stringCell, row.get("StringField")); + assertEquals("Anna", stringCell.getStringValue()); + } + // With incorrect location in jobid + // The job will be created with the specified(incorrect) location + // hence failing the operation + String query = "SELECT StringField FROM " + TABLE_ID_FASTQUERY_UK.getTable(); + JobId jobIdWithLocation = JobId.newBuilder().setLocation("us-west1").build(); + QueryJobConfiguration configSelect = + QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(UK_DATASET)).build(); + try { + bigquery.query(configSelect, jobIdWithLocation); + } catch (BigQueryException exception) { + assertTrue(exception.getMessage().contains("Not found")); + assertEquals(BigQueryException.class, exception.getClass()); + } + + // Without location in jobID, the query job defaults to the location of the dataset + JobId jobIdNoLocation = JobId.newBuilder().build(); + QueryJobConfiguration configNoLocation = + QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(UK_DATASET)).build(); + TableResult resultNoLocation = bigquery.query(configNoLocation, jobIdNoLocation); + for (FieldValueList row : resultNoLocation.getValues()) { + FieldValue stringCell = row.get(0); + assertEquals(stringCell, row.get("StringField")); + assertEquals("Anna", stringCell.getStringValue()); + } + } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testFastSQLQueryMultiPage() throws InterruptedException { From e4361066252e920d822ea9da525d1cb32fd53196 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Nov 2022 20:16:33 +0100 Subject: [PATCH 1029/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.16.0 (#2414) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index eb95d67c98..47bd53b8ec 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.15.1 + 2.16.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 914a8c154e..ab2496ad0d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.15.1 + 2.16.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 68e1098936..c44e482cb5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.15.1 + 2.16.0 test From 2fa3df6aaf566cdf1fdd5604e32addfe8c217d3d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:44:14 +0000 Subject: [PATCH 1030/2268] chore: use gcp-docuploader 0.6.3 (#1708) (#2413) Source-Link: https://togithub.com/googleapis/synthtool/commit/fbc8bfe364d70c38fbffbf68ebe1cfdae54d3447 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:e76136cc48f90aa19ba29cdfbd4002111467e44a1c9d905867d98dafafbd03bb --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 +- .kokoro/requirements.txt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 676aaea0c7..0f0647b00e 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a3fe0b4c75f322520f548e535ed329df1e475ace3cb4a979b78e003cb822636a + digest: sha256:e76136cc48f90aa19ba29cdfbd4002111467e44a1c9d905867d98dafafbd03bb diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index ae1d92e680..924f94ae6f 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,4 +1,4 @@ -gcp-docuploader==0.6.4 +gcp-docuploader==0.6.3 google-crc32c==1.3.0 googleapis-common-protos==1.56.3 gcp-releasetool==1.9.1 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 9c82529c84..71fcafc703 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -135,9 +135,9 @@ cryptography==38.0.3 \ # -r requirements.in # gcp-releasetool # secretstorage -gcp-docuploader==0.6.4 \ - --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ - --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf +gcp-docuploader==0.6.3 \ + --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ + --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b # via -r requirements.in gcp-releasetool==1.9.1 \ --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ From 996627b3cd1a12d19135c85991aeed2688d0ac0b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 14 Nov 2022 23:14:28 +0100 Subject: [PATCH 1031/2268] test(deps): update dependency org.mockito:mockito-core to v4.9.0 (#2416) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5285aace80..aaae80af5a 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ org.mockito mockito-core - 4.8.1 + 4.9.0 test From 06765866bf4507f8f6ebbaee28e7dc698f9ba14c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 14 Nov 2022 23:15:00 +0100 Subject: [PATCH 1032/2268] deps: update jmh.version to v1.36 (#2415) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1ec05b9c1d..69011291eb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.35 + 1.36 benchmark From c4490315b62606371e134f2a9c2fbfabc60bee03 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 16 Nov 2022 21:40:41 +0100 Subject: [PATCH 1033/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.12.0 (#2419) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aaae80af5a..8aa03927fb 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.11.0 + 1.12.0 pom import From 1ac1653ed705fa7173c4a83ab37169fdb15422e3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 16 Nov 2022 21:40:53 +0100 Subject: [PATCH 1034/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.8.0 (#2418) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8aa03927fb..0d3b4fb8ac 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.7.0 + 2.8.0 test From f6bb264bda0874595c6240226ff99dd21eb9a50a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 16 Nov 2022 21:41:38 +0100 Subject: [PATCH 1035/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.8.0 (#2417) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0d3b4fb8ac..117ca210c9 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.7.0 + 2.8.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 47bd53b8ec..ac3615a830 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.7.0 + 2.8.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ab2496ad0d..d5457a1fef 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.7.0 + 2.8.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c44e482cb5..f58ef14c00 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.7.0 + 2.8.0 test From baf337a12e89af73db0c2494e61f271f32e44ed0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 18 Nov 2022 18:58:35 +0100 Subject: [PATCH 1036/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.15.1 (#2420) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.15.0` -> `2.15.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.1/compatibility-slim/2.15.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.15.1/confidence-slim/2.15.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.15.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2151-httpsgithubcomgoogleapisjava-storagecomparev2150v2151-2022-11-17) ##### Bug Fixes - Disable REGAPIC transport in storage v2 ([#​1762](https://togithub.com/googleapis/java-storage/issues/1762)) ([13d630e](https://togithub.com/googleapis/java-storage/commit/13d630e7ce89273c292acca7a7e048218ece4182)) - Update GrpcStorageImpl#get(BlobId) to return null on 404 ([#​1772](https://togithub.com/googleapis/java-storage/issues/1772)) ([8c59c64](https://togithub.com/googleapis/java-storage/commit/8c59c64ccf0dd7753467b4c0f0bcf5f4b49c5bf0)) ##### Documentation - Annotate all Option factory methods with their Nullability bounds ([#​1775](https://togithub.com/googleapis/java-storage/issues/1775)) ([3b8d137](https://togithub.com/googleapis/java-storage/commit/3b8d137a113376d7dac9010b9207d435df2622f7))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 117ca210c9..5b7df4c906 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.15.0 + 2.15.1 test From 2e1047c8115e294a4454cf34abb3172b3fb1ff69 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 18 Nov 2022 23:12:23 +0100 Subject: [PATCH 1037/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.1.5 (#2421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.1.4` -> `26.1.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.5/compatibility-slim/26.1.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.1.5/confidence-slim/26.1.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f5cdec8b48..7ffa4facb8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.4') +implementation platform('com.google.cloud:libraries-bom:26.1.5') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index fac75990ef..7e534e9d45 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f58ef14c00..263a545482 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.4 + 26.1.5 pom import From 63b51969dc20747d3dd1f127cc0fcb2d27c9c8c0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 21 Nov 2022 22:09:23 +0100 Subject: [PATCH 1038/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 (#2424) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 7e534e9d45..02a82fcb34 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.17 + 0.9.18 test From cd2ae9f3d2c19be8a375e6be57a7e6b805b1ac4e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 21 Nov 2022 22:14:16 +0100 Subject: [PATCH 1039/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 (#2425) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 02a82fcb34..0b96e1f309 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.17 + 0.9.18 true com.example.bigquery.NativeImageBigquerySample From aff901904d04a9a35042126a90e2a2826283a3e7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 23 Nov 2022 15:24:54 +0100 Subject: [PATCH 1040/2268] deps: update arrow.version to v10.0.1 (#2426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.0` -> `10.0.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.1/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/10.0.1/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.0` -> `10.0.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.1/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/10.0.1/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.0` -> `10.0.1` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.1/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/10.0.1/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b7df4c906..710d67be26 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20221028-2.0.0 3.0.6 - 10.0.0 + 10.0.1
    From baba5d6f4061cfa15d13c6f56880d68203e63378 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 13:40:23 +0530 Subject: [PATCH 1041/2268] chore: upgrade native image checks to graalvm-22.3.0 (#1718) (#2428) chore: upgrade native image checks to graalvm-22.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/5e52896b69b145a3fac6827e4e75e617abdc9dd8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:27b1b1884dce60460d7521b23c2a73376cba90c0ef3d9f0d32e4bdb786959cfd Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 0f0647b00e..4ca0036da3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:e76136cc48f90aa19ba29cdfbd4002111467e44a1c9d905867d98dafafbd03bb + digest: sha256:27b1b1884dce60460d7521b23c2a73376cba90c0ef3d9f0d32e4bdb786959cfd diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index a3f7fb9d49..e20330c3ca 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 4c7225ec92..0fd6ba2fa0 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" } env_vars: { From 2effed158af6db27344bc610e20f19e547f6b922 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 13 Dec 2022 13:54:13 -0500 Subject: [PATCH 1042/2268] chore: fix BiEngineReason Message (#2443) --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ed073a93ae..52cb208c69 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -4304,7 +4304,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { statistics.getBiEngineStats().getBiEngineReasons().get(0).getCode(), "OTHER_REASON"); assertEquals( statistics.getBiEngineStats().getBiEngineReasons().get(0).getMessage(), - "Query output to destination table is not supported."); + "Only SELECT queries without a destination table can be accelerated."); } assertNotNull(statistics.getQueryPlan()); } From 567a44147219b5742ed82f56ade48a7613c8764b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:30:26 +0100 Subject: [PATCH 1043/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.5 (#2429) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 710d67be26..5d6cb5f6b1 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.4 + 1.5.5 From f31da3a90f68637df55597cb2ea20477d1b80ba3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:30:47 +0100 Subject: [PATCH 1044/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.9.0 (#2440) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 5d6cb5f6b1..9bbe419e49 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.8.0 + 2.9.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ac3615a830..dfe9f74da4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.8.0 + 2.9.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d5457a1fef..d719d333d1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.8.0 + 2.9.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 263a545482..06110d2d2d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.8.0 + 2.9.0 test From 3ea75f83e15b12c8071c6abd5bc663d6268caf9c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:31:03 -0500 Subject: [PATCH 1045/2268] build(deps): bump certifi from 2022.9.24 to 2022.12.7 in /synthtool/gcp/templates/java_library/.kokoro (#1732) (#2442) build(deps): bump certifi Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7. - [Release notes](https://github.com/certifi/python-certifi/releases) - [Commits](https://github.com/certifi/python-certifi/compare/2022.09.24...2022.12.07) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jeff Ching Source-Link: https://github.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c Signed-off-by: dependabot[bot] Co-authored-by: Owl Bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jeff Ching --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 +- .kokoro/requirements.txt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 4ca0036da3..288e394897 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:27b1b1884dce60460d7521b23c2a73376cba90c0ef3d9f0d32e4bdb786959cfd + digest: sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 924f94ae6f..a5010f77d4 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -17,7 +17,7 @@ pycparser==2.21 pyperclip==1.8.2 python-dateutil==2.8.2 requests==2.27.1 -certifi==2022.9.24 +certifi==2022.12.7 importlib-metadata==4.8.3 zipp==3.6.0 google_api_core==2.8.2 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 71fcafc703..15c404aa5a 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -16,9 +16,9 @@ cachetools==4.2.4 \ # via # -r requirements.in # google-auth -certifi==2022.9.24 \ - --hash=sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14 \ - --hash=sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382 +certifi==2022.12.7 \ + --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ + --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 # via # -r requirements.in # requests From eb52002919843ad9341d3f9b06c10e401637b82a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:32:14 +0100 Subject: [PATCH 1046/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221127-2.0.0 (#2437) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9bbe419e49..a71394f10e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20221028-2.0.0 + v2-rev20221127-2.0.0 3.0.6 10.0.1
    From 54fdc788fd093213a8ac415e0ad3cb620b280c3c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:32:27 +0100 Subject: [PATCH 1047/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.17.1 (#2436) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index dfe9f74da4..93948d4fa0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.16.0 + 2.17.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d719d333d1..c52c2cfd68 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.16.0 + 2.17.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 06110d2d2d..99ac673152 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.16.0 + 2.17.1 test From bf940878a7cf602b7f0736335653bc6c479e2df6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:32:57 +0100 Subject: [PATCH 1048/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 (#2433) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 0b96e1f309..93aec81604 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.18 + 0.9.19 true com.example.bigquery.NativeImageBigquerySample From 396c6dc101837a801c7f693f3a3548eb6685feaf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:33:12 +0100 Subject: [PATCH 1049/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 (#2432) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 93aec81604..4962e9b0e0 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.18 + 0.9.19 test From 01cc3c3d64884c2d7b68c5099de7c0959c1846db Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 20:56:15 +0100 Subject: [PATCH 1050/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.9.0 (#2441) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.8.0` -> `2.9.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.9.0/compatibility-slim/2.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.9.0/confidence-slim/2.8.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a71394f10e..dbde8f86f1 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.8.0 + 2.9.0 test From c99b21552e30a509b6220de7a491566dbab086db Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 21:00:19 +0100 Subject: [PATCH 1051/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 (#2435) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.0.6` -> `3.1.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.0/compatibility-slim/3.0.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.0/confidence-slim/3.0.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.1.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​310-httpsgithubcomgoogleapisjava-shared-dependenciescomparev306v310-2022-12-05) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.6...v3.1.0) ##### Features - Next release from main branch is 3.1.0 ([#​910](https://togithub.com/googleapis/java-shared-dependencies/issues/910)) ([3e36bc6](https://togithub.com/googleapis/java-shared-dependencies/commit/3e36bc6c5a6ffff771480200ecf5908cb347a50a)) ##### Dependencies - Update dependency com.fasterxml.jackson:jackson-bom to v2.14.1 ([#​924](https://togithub.com/googleapis/java-shared-dependencies/issues/924)) ([c630375](https://togithub.com/googleapis/java-shared-dependencies/commit/c630375d5059b4ac367979a2507c3870840c08e4)) - Update dependency com.google.api-client:google-api-client-bom to v2.1.0 ([#​934](https://togithub.com/googleapis/java-shared-dependencies/issues/934)) ([8af7b00](https://togithub.com/googleapis/java-shared-dependencies/commit/8af7b00cf0758df4015b1999d6f824ba1864be00)) - Update dependency com.google.api-client:google-api-client-bom to v2.1.1 ([#​941](https://togithub.com/googleapis/java-shared-dependencies/issues/941)) ([6a6e3e7](https://togithub.com/googleapis/java-shared-dependencies/commit/6a6e3e7d3232c7d74f92849a98e607a6d22b7b4e)) - Update dependency com.google.auth:google-auth-library-bom to v1.13.0 ([#​917](https://togithub.com/googleapis/java-shared-dependencies/issues/917)) ([1e2448c](https://togithub.com/googleapis/java-shared-dependencies/commit/1e2448c60cbe3e215b4f9f772d8e0c7cb1434bd0)) - Update dependency com.google.cloud:grpc-gcp to v1.3.2 ([#​942](https://togithub.com/googleapis/java-shared-dependencies/issues/942)) ([66c3e2a](https://togithub.com/googleapis/java-shared-dependencies/commit/66c3e2acda213fe9aea60b85f8543e3fdeaa2ecf)) - Update dependency com.google.cloud.tools:dependencies to v1.5.13 ([#​914](https://togithub.com/googleapis/java-shared-dependencies/issues/914)) ([9c0fa2c](https://togithub.com/googleapis/java-shared-dependencies/commit/9c0fa2c06ed04a3dddd9f0fd908865279393d373)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.10 ([#​936](https://togithub.com/googleapis/java-shared-dependencies/issues/936)) ([f8abca8](https://togithub.com/googleapis/java-shared-dependencies/commit/f8abca8e075c59461c88b8c79fd1c5cd5eacb509)) - Update dependency io.grpc:grpc-bom to v1.51.0 ([#​919](https://togithub.com/googleapis/java-shared-dependencies/issues/919)) ([713b331](https://togithub.com/googleapis/java-shared-dependencies/commit/713b331a39917725ed4bd95c80c083c23d2a192e)) - Update dependency io.perfmark:perfmark-api to v0.26.0 ([#​907](https://togithub.com/googleapis/java-shared-dependencies/issues/907)) ([950cca6](https://togithub.com/googleapis/java-shared-dependencies/commit/950cca6df2d7e7d24ab8dd7e32c7a264e89d721f)) - Update dependency org.apache.httpcomponents:httpclient to v4.5.14 ([#​943](https://togithub.com/googleapis/java-shared-dependencies/issues/943)) ([7590b65](https://togithub.com/googleapis/java-shared-dependencies/commit/7590b6538290d3f9892b2b302505d3ecfca69530)) - Update dependency org.apache.httpcomponents:httpcore to v4.4.16 ([#​933](https://togithub.com/googleapis/java-shared-dependencies/issues/933)) ([6a68eb9](https://togithub.com/googleapis/java-shared-dependencies/commit/6a68eb96179a13cf324b4a4026ff6877d447a334)) - Update dependency org.checkerframework:checker-qual to v3.28.0 ([#​940](https://togithub.com/googleapis/java-shared-dependencies/issues/940)) ([5ea57c3](https://togithub.com/googleapis/java-shared-dependencies/commit/5ea57c3f5490c3cf7048e71dfab63aba8d7b874f)) - Update gax.version to v2.20.1 ([#​937](https://togithub.com/googleapis/java-shared-dependencies/issues/937)) ([ca30914](https://togithub.com/googleapis/java-shared-dependencies/commit/ca30914b59516c634de24b1fa33c8a6c454a0cef)) - Update google.common-protos.version to v2.11.0 ([#​935](https://togithub.com/googleapis/java-shared-dependencies/issues/935)) ([e92f583](https://togithub.com/googleapis/java-shared-dependencies/commit/e92f58361c0062414c34b669161f9d6284b0903f)) - Update google.core.version to v2.8.28 ([#​909](https://togithub.com/googleapis/java-shared-dependencies/issues/909)) ([79a731e](https://togithub.com/googleapis/java-shared-dependencies/commit/79a731e057fa7b1ac5f4bc6ae15869726bc9c20a)) - Update google.core.version to v2.9.0 ([#​944](https://togithub.com/googleapis/java-shared-dependencies/issues/944)) ([a50513b](https://togithub.com/googleapis/java-shared-dependencies/commit/a50513bc8902d059a7b53dc852b02b7e2f9bc3e6)) - Update iam.version to v1.6.10 ([#​915](https://togithub.com/googleapis/java-shared-dependencies/issues/915)) ([2c06312](https://togithub.com/googleapis/java-shared-dependencies/commit/2c06312732a56fd94f0ce8447062b42b3da15c92)) - Update iam.version to v1.6.11 ([#​916](https://togithub.com/googleapis/java-shared-dependencies/issues/916)) ([10b152d](https://togithub.com/googleapis/java-shared-dependencies/commit/10b152ded8ceded5ae3c60774ea8e75c7b69d9d8)) - Update iam.version to v1.6.12 ([#​918](https://togithub.com/googleapis/java-shared-dependencies/issues/918)) ([db57153](https://togithub.com/googleapis/java-shared-dependencies/commit/db57153752380dacb773530aef8079ff68772fc9)) - Update iam.version to v1.6.13 ([#​920](https://togithub.com/googleapis/java-shared-dependencies/issues/920)) ([763197e](https://togithub.com/googleapis/java-shared-dependencies/commit/763197e94a34620a2e234885fcdbdcb5fba144c2)) - Update iam.version to v1.6.14 ([#​921](https://togithub.com/googleapis/java-shared-dependencies/issues/921)) ([036cf6f](https://togithub.com/googleapis/java-shared-dependencies/commit/036cf6f0df788e9bffd5e21bfd8e560a797ed37d)) - Update iam.version to v1.6.15 ([#​922](https://togithub.com/googleapis/java-shared-dependencies/issues/922)) ([98b11a7](https://togithub.com/googleapis/java-shared-dependencies/commit/98b11a72f3818e4505d468c47b7c8105a3b55847)) - Update iam.version to v1.6.16 ([#​923](https://togithub.com/googleapis/java-shared-dependencies/issues/923)) ([b44d6ba](https://togithub.com/googleapis/java-shared-dependencies/commit/b44d6babd71d89ed27a0d7cac229d04111bb39e7)) - Update iam.version to v1.6.17 ([#​925](https://togithub.com/googleapis/java-shared-dependencies/issues/925)) ([f24a7f8](https://togithub.com/googleapis/java-shared-dependencies/commit/f24a7f8577ca90153d86b9ed3eab5954c1fc5500)) - Update iam.version to v1.6.18 ([#​926](https://togithub.com/googleapis/java-shared-dependencies/issues/926)) ([c77314d](https://togithub.com/googleapis/java-shared-dependencies/commit/c77314d5bdfbe960e6f71fb8dc044a60d1973038)) - Update iam.version to v1.6.19 ([#​927](https://togithub.com/googleapis/java-shared-dependencies/issues/927)) ([2990cf0](https://togithub.com/googleapis/java-shared-dependencies/commit/2990cf020e526ddba54c2a0542ef8e01f4f517f5)) - Update iam.version to v1.6.20 ([#​928](https://togithub.com/googleapis/java-shared-dependencies/issues/928)) ([7dbd204](https://togithub.com/googleapis/java-shared-dependencies/commit/7dbd204cdc0df7107c656e28766afeb14f6793c4)) - Update iam.version to v1.6.21 ([#​929](https://togithub.com/googleapis/java-shared-dependencies/issues/929)) ([cec2265](https://togithub.com/googleapis/java-shared-dependencies/commit/cec2265e43eaac7cc1be3c9bb42c0d93872f4075)) - Update iam.version to v1.6.22 ([#​931](https://togithub.com/googleapis/java-shared-dependencies/issues/931)) ([812ccf4](https://togithub.com/googleapis/java-shared-dependencies/commit/812ccf46fb0ada475dea2f6eb53839be8940dbde)) - Update iam.version to v1.6.8 ([#​906](https://togithub.com/googleapis/java-shared-dependencies/issues/906)) ([68ebe06](https://togithub.com/googleapis/java-shared-dependencies/commit/68ebe06101ec5b24fddb48012e3487c37827ba6a)) - Update iam.version to v1.6.9 ([#​912](https://togithub.com/googleapis/java-shared-dependencies/issues/912)) ([6a3097b](https://togithub.com/googleapis/java-shared-dependencies/commit/6a3097b559319f643f63727bd6d4ce5d30091317))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dbde8f86f1..5e57edcafb 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20221127-2.0.0 - 3.0.6 + 3.1.0 10.0.1
    From 7255357fc3bc715ebe15761acbe83c5e33495fdc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Dec 2022 21:32:15 +0100 Subject: [PATCH 1052/2268] deps: update cloud client dependencies (#2444) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.15.1` -> `2.16.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.16.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.16.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.16.0/compatibility-slim/2.15.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.16.0/confidence-slim/2.15.1)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.12.0` -> `1.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.13.0/compatibility-slim/1.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.13.0/confidence-slim/1.12.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.25.0` -> `2.27.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.27.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.27.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.27.0/compatibility-slim/2.25.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.27.0/confidence-slim/2.25.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.16.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2160-httpsgithubcomgoogleapisjava-storagecomparev2151v2160-2022-12-06) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.15.1...v2.16.0) ##### Features - Add {Compose,Rewrite,StartResumableWrite}Request.object_checksums and Bucket.RetentionPolicy.retention_duration ([#​1790](https://togithub.com/googleapis/java-storage/issues/1790)) ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) - Added a new retention_duration field of Duration type ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) - Added object_checksums for compose/rewrite/startResumableWrite request ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) ##### Bug Fixes - Removed WriteObject routing annotations ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) ##### Documentation - Clarified relative resource names in gRPC IAM RPCs ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) - Clarified the object can be deleted via DeleteObject ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) - Updated the document link for `Naming Guidelines` ([31c1b18](https://togithub.com/googleapis/java-storage/commit/31c1b18acc3c118e39eb613a82ee292f3e246b8f)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#​1797](https://togithub.com/googleapis/java-storage/issues/1797)) ([b1d0266](https://togithub.com/googleapis/java-storage/commit/b1d026608a5e3772e8bf77f25f1daf68b007427a)) - Update dependency org.apache.httpcomponents:httpclient to v4.5.14 ([#​1795](https://togithub.com/googleapis/java-storage/issues/1795)) ([cf900f4](https://togithub.com/googleapis/java-storage/commit/cf900f4139f30f89e3c0784467ddc12cc00cf81c)) - Update dependency org.apache.httpcomponents:httpcore to v4.4.16 ([#​1786](https://togithub.com/googleapis/java-storage/issues/1786)) ([3bf403e](https://togithub.com/googleapis/java-storage/commit/3bf403e94c035e6cf936e062a1ced2b5221b3912)) - Update dependency org.apache.httpcomponents:httpmime to v4.5.14 ([#​1796](https://togithub.com/googleapis/java-storage/issues/1796)) ([c9ee3ca](https://togithub.com/googleapis/java-storage/commit/c9ee3ca8820531cd709bb8f8a58a736813346861)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#​1782](https://togithub.com/googleapis/java-storage/issues/1782)) ([5bc5176](https://togithub.com/googleapis/java-storage/commit/5bc517623ef04bdb9a71a51666754b9f753f4c69)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#​1791](https://togithub.com/googleapis/java-storage/issues/1791)) ([3184d65](https://togithub.com/googleapis/java-storage/commit/3184d65cce1368c2f39ff85a6ed02cf536902244))
    googleapis/java-bigquerystorage ### [`v2.27.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2270-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2260v2270-2022-12-12) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.26.0...v2.27.0) ##### Features - Change one thread per retry to use a thread pool ([#​1898](https://togithub.com/googleapis/java-bigquerystorage/issues/1898)) ([44a4e4d](https://togithub.com/googleapis/java-bigquerystorage/commit/44a4e4d8c70bf910f96d2d2c181d1f23b70f3e52)) - Throw error when using connection pool for explicit stream ([#​1903](https://togithub.com/googleapis/java-bigquerystorage/issues/1903)) ([bd89556](https://togithub.com/googleapis/java-bigquerystorage/commit/bd895567fe33735294065d7043d845f14f33f8a8)) ##### Bug Fixes - Add back the accidentally removed background executor provider ([#​1899](https://togithub.com/googleapis/java-bigquerystorage/issues/1899)) ([065cc4f](https://togithub.com/googleapis/java-bigquerystorage/commit/065cc4f35ad5e5cdc393e01adbea881c6e92dcab)) - Update JsonStreamWriterBuilder comment and update sample to use the latest schema retrieval support ([#​1902](https://togithub.com/googleapis/java-bigquerystorage/issues/1902)) ([2a46ec3](https://togithub.com/googleapis/java-bigquerystorage/commit/2a46ec3df419bbeba6a2e60b2b621dc60f31eab1)) ##### Dependencies - Update arrow.version to v10.0.1 ([#​1894](https://togithub.com/googleapis/java-bigquerystorage/issues/1894)) ([8e90767](https://togithub.com/googleapis/java-bigquerystorage/commit/8e907677bae0c48e8c64be5cbab8fb203645f4ef)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#​1905](https://togithub.com/googleapis/java-bigquerystorage/issues/1905)) ([767be03](https://togithub.com/googleapis/java-bigquerystorage/commit/767be035defbcc5b77f1276bb1a2983b6a7423bd)) - Update dependency org.apache.arrow:arrow-memory-netty to v10.0.1 ([#​1895](https://togithub.com/googleapis/java-bigquerystorage/issues/1895)) ([8b079cc](https://togithub.com/googleapis/java-bigquerystorage/commit/8b079cc47ca914756bd73dda98bd15393754ebb1)) - Update dependency org.apache.arrow:arrow-vector to v10.0.1 ([#​1896](https://togithub.com/googleapis/java-bigquerystorage/issues/1896)) ([087ac6e](https://togithub.com/googleapis/java-bigquerystorage/commit/087ac6e7ad813dc248e9029f91c454299a87b2b3)) ### [`v2.26.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2260-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2250v2260-2022-11-18) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.25.0...v2.26.0) ##### Features - Add missing_value_interpretations to AppendRowsRequest ([#​1885](https://togithub.com/googleapis/java-bigquerystorage/issues/1885)) ([0def62f](https://togithub.com/googleapis/java-bigquerystorage/commit/0def62fb6375d35e753f60dc2ac3b102e15ef336)) - Add update schema support for multiplexing ([#​1867](https://togithub.com/googleapis/java-bigquerystorage/issues/1867)) ([2adf81b](https://togithub.com/googleapis/java-bigquerystorage/commit/2adf81b70da043c6a66e38dbd52ef7aae9cffb9e)) - Fix windows build failure by using nanoSeconds instead of Instant for better accuracy. ([#​1887](https://togithub.com/googleapis/java-bigquerystorage/issues/1887)) ([e5cd7df](https://togithub.com/googleapis/java-bigquerystorage/commit/e5cd7df54e2f6af12c240268a91e0afc2ec27a8a)) - Next release from main branch is 2.26.0 ([#​1874](https://togithub.com/googleapis/java-bigquerystorage/issues/1874)) ([589dd63](https://togithub.com/googleapis/java-bigquerystorage/commit/589dd637dfc16fb9bd3655a0d98115f601983997)) - Provide sample code for row-level error handling ([#​1863](https://togithub.com/googleapis/java-bigquerystorage/issues/1863)) ([027c5bb](https://togithub.com/googleapis/java-bigquerystorage/commit/027c5bb7cc27234bc1e3a552b4896b919921dc71)) ##### Bug Fixes - Fix window build bug caused by Instant resolution. ([#​1884](https://togithub.com/googleapis/java-bigquerystorage/issues/1884)) ([2332dc1](https://togithub.com/googleapis/java-bigquerystorage/commit/2332dc13bb45c7377722a3a289d66a4cf73bb79d)) ##### Dependencies - Update dependency com.google.auto.value:auto-value to v1.10.1 ([#​1888](https://togithub.com/googleapis/java-bigquerystorage/issues/1888)) ([9546298](https://togithub.com/googleapis/java-bigquerystorage/commit/954629811d0b9e942f23e0cb0d1935cd38e4b30b)) - Update dependency com.google.auto.value:auto-value-annotations to v1.10.1 ([#​1889](https://togithub.com/googleapis/java-bigquerystorage/issues/1889)) ([b4eec03](https://togithub.com/googleapis/java-bigquerystorage/commit/b4eec032706f2ed7039b3ad9bfd81b8dea536008)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.19.1 ([#​1878](https://togithub.com/googleapis/java-bigquerystorage/issues/1878)) ([4b1989b](https://togithub.com/googleapis/java-bigquerystorage/commit/4b1989b51d18b081c8e980a59bd6117230c11a9d))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5e57edcafb..4131f87667 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.25.0 + 2.27.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.12.0 + 1.13.0 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.15.1 + 2.16.0 test From e4d1076a623c6f491a57278e22397b79d4d7b0ee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:00:21 +0000 Subject: [PATCH 1053/2268] chore(main): release 2.20.0 (#2408) :robot: I have created a release *beep* *boop* --- ## [2.20.0](https://togithub.com/googleapis/java-bigquery/compare/v2.19.1...v2.20.0) (2022-12-13) ### Features * Add fast query path support when empty jobId object is passed ([#2349](https://togithub.com/googleapis/java-bigquery/issues/2349)) ([42c083a](https://togithub.com/googleapis/java-bigquery/commit/42c083ac680c657bf3f648fbce81004ecac8be87)) * Next release from main branch is 2.20.0 ([#2405](https://togithub.com/googleapis/java-bigquery/issues/2405)) ([9297a43](https://togithub.com/googleapis/java-bigquery/commit/9297a4359f7b080a60b6bb5873edfd66cd7d2261)) ### Dependencies * Update arrow.version to v10.0.1 ([#2426](https://togithub.com/googleapis/java-bigquery/issues/2426)) ([aff9019](https://togithub.com/googleapis/java-bigquery/commit/aff901904d04a9a35042126a90e2a2826283a3e7)) * Update cloud client dependencies ([#2444](https://togithub.com/googleapis/java-bigquery/issues/2444)) ([7255357](https://togithub.com/googleapis/java-bigquery/commit/7255357fc3bc715ebe15761acbe83c5e33495fdc)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.8.0 ([#2418](https://togithub.com/googleapis/java-bigquery/issues/2418)) ([1ac1653](https://togithub.com/googleapis/java-bigquery/commit/1ac1653ed705fa7173c4a83ab37169fdb15422e3)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.9.0 ([#2441](https://togithub.com/googleapis/java-bigquery/issues/2441)) ([01cc3c3](https://togithub.com/googleapis/java-bigquery/commit/01cc3c3d64884c2d7b68c5099de7c0959c1846db)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221127-2.0.0 ([#2437](https://togithub.com/googleapis/java-bigquery/issues/2437)) ([eb52002](https://togithub.com/googleapis/java-bigquery/commit/eb52002919843ad9341d3f9b06c10e401637b82a)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.12.0 ([#2419](https://togithub.com/googleapis/java-bigquery/issues/2419)) ([c449031](https://togithub.com/googleapis/java-bigquery/commit/c4490315b62606371e134f2a9c2fbfabc60bee03)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#2435](https://togithub.com/googleapis/java-bigquery/issues/2435)) ([c99b215](https://togithub.com/googleapis/java-bigquery/commit/c99b21552e30a509b6220de7a491566dbab086db)) * Update dependency com.google.cloud:google-cloud-storage to v2.15.1 ([#2420](https://togithub.com/googleapis/java-bigquery/issues/2420)) ([baf337a](https://togithub.com/googleapis/java-bigquery/commit/baf337a12e89af73db0c2494e61f271f32e44ed0)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#2424](https://togithub.com/googleapis/java-bigquery/issues/2424)) ([63b5196](https://togithub.com/googleapis/java-bigquery/commit/63b51969dc20747d3dd1f127cc0fcb2d27c9c8c0)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#2432](https://togithub.com/googleapis/java-bigquery/issues/2432)) ([396c6dc](https://togithub.com/googleapis/java-bigquery/commit/396c6dc101837a801c7f693f3a3548eb6685feaf)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#2425](https://togithub.com/googleapis/java-bigquery/issues/2425)) ([cd2ae9f](https://togithub.com/googleapis/java-bigquery/commit/cd2ae9f3d2c19be8a375e6be57a7e6b805b1ac4e)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#2433](https://togithub.com/googleapis/java-bigquery/issues/2433)) ([bf94087](https://togithub.com/googleapis/java-bigquery/commit/bf940878a7cf602b7f0736335653bc6c479e2df6)) * Update jmh.version to v1.36 ([#2415](https://togithub.com/googleapis/java-bigquery/issues/2415)) ([0676586](https://togithub.com/googleapis/java-bigquery/commit/06765866bf4507f8f6ebbaee28e7dc698f9ba14c)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 25 +++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2959a5a17d..5c22cf03e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [2.20.0](https://github.com/googleapis/java-bigquery/compare/v2.19.1...v2.20.0) (2022-12-13) + + +### Features + +* Add fast query path support when empty jobId object is passed ([#2349](https://github.com/googleapis/java-bigquery/issues/2349)) ([42c083a](https://github.com/googleapis/java-bigquery/commit/42c083ac680c657bf3f648fbce81004ecac8be87)) +* Next release from main branch is 2.20.0 ([#2405](https://github.com/googleapis/java-bigquery/issues/2405)) ([9297a43](https://github.com/googleapis/java-bigquery/commit/9297a4359f7b080a60b6bb5873edfd66cd7d2261)) + + +### Dependencies + +* Update arrow.version to v10.0.1 ([#2426](https://github.com/googleapis/java-bigquery/issues/2426)) ([aff9019](https://github.com/googleapis/java-bigquery/commit/aff901904d04a9a35042126a90e2a2826283a3e7)) +* Update cloud client dependencies ([#2444](https://github.com/googleapis/java-bigquery/issues/2444)) ([7255357](https://github.com/googleapis/java-bigquery/commit/7255357fc3bc715ebe15761acbe83c5e33495fdc)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.8.0 ([#2418](https://github.com/googleapis/java-bigquery/issues/2418)) ([1ac1653](https://github.com/googleapis/java-bigquery/commit/1ac1653ed705fa7173c4a83ab37169fdb15422e3)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.9.0 ([#2441](https://github.com/googleapis/java-bigquery/issues/2441)) ([01cc3c3](https://github.com/googleapis/java-bigquery/commit/01cc3c3d64884c2d7b68c5099de7c0959c1846db)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221127-2.0.0 ([#2437](https://github.com/googleapis/java-bigquery/issues/2437)) ([eb52002](https://github.com/googleapis/java-bigquery/commit/eb52002919843ad9341d3f9b06c10e401637b82a)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.12.0 ([#2419](https://github.com/googleapis/java-bigquery/issues/2419)) ([c449031](https://github.com/googleapis/java-bigquery/commit/c4490315b62606371e134f2a9c2fbfabc60bee03)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#2435](https://github.com/googleapis/java-bigquery/issues/2435)) ([c99b215](https://github.com/googleapis/java-bigquery/commit/c99b21552e30a509b6220de7a491566dbab086db)) +* Update dependency com.google.cloud:google-cloud-storage to v2.15.1 ([#2420](https://github.com/googleapis/java-bigquery/issues/2420)) ([baf337a](https://github.com/googleapis/java-bigquery/commit/baf337a12e89af73db0c2494e61f271f32e44ed0)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#2424](https://github.com/googleapis/java-bigquery/issues/2424)) ([63b5196](https://github.com/googleapis/java-bigquery/commit/63b51969dc20747d3dd1f127cc0fcb2d27c9c8c0)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#2432](https://github.com/googleapis/java-bigquery/issues/2432)) ([396c6dc](https://github.com/googleapis/java-bigquery/commit/396c6dc101837a801c7f693f3a3548eb6685feaf)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#2425](https://github.com/googleapis/java-bigquery/issues/2425)) ([cd2ae9f](https://github.com/googleapis/java-bigquery/commit/cd2ae9f3d2c19be8a375e6be57a7e6b805b1ac4e)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#2433](https://github.com/googleapis/java-bigquery/issues/2433)) ([bf94087](https://github.com/googleapis/java-bigquery/commit/bf940878a7cf602b7f0736335653bc6c479e2df6)) +* Update jmh.version to v1.36 ([#2415](https://github.com/googleapis/java-bigquery/issues/2415)) ([0676586](https://github.com/googleapis/java-bigquery/commit/06765866bf4507f8f6ebbaee28e7dc698f9ba14c)) + ## [2.19.1](https://github.com/googleapis/java-bigquery/compare/v2.19.0...v2.19.1) (2022-11-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 69011291eb..bb0b93e168 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.19.2-SNAPSHOT + 2.20.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ee75b9df38..78d5997f78 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.19.2-SNAPSHOT + 2.20.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.19.2-SNAPSHOT + 2.20.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4131f87667..0f7fcfbdb4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.19.2-SNAPSHOT + 2.20.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.19.2-SNAPSHOT + 2.20.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c52c2cfd68..e27ce41667 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.19.2-SNAPSHOT + 2.20.0 diff --git a/versions.txt b/versions.txt index 6972769118..400df5cbfd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.19.1:2.19.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.20.0:2.20.0 \ No newline at end of file From 07197ebbdba7ee62dc2e2485cd79a5a9a9b3dfd5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:26:14 +0000 Subject: [PATCH 1054/2268] chore(main): release 2.20.1-SNAPSHOT (#2445) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bb0b93e168..ac436b9ca8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.0 + 2.20.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 78d5997f78..3a423d6de6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.0 + 2.20.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.0 + 2.20.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0f7fcfbdb4..be57a07d7b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.0 + 2.20.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.0 + 2.20.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e27ce41667..747d9a6a11 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.0 + 2.20.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 400df5cbfd..92bdb26c98 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.0:2.20.0 \ No newline at end of file +google-cloud-bigquery:2.20.0:2.20.1-SNAPSHOT \ No newline at end of file From 293082af2451dab0655d8fbf96380a9eac7ac788 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Dec 2022 19:52:32 +0100 Subject: [PATCH 1055/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.0 (#2446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.0 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7ffa4facb8..9c21469bca 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.19.1 + 2.20.0 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.19.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.20.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.19.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.0" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 93948d4fa0..50268f52f8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.19.1 + 2.20.0 From 4b760e1049c6ddbfcb17b7de5905f43a53165c3d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 4 Jan 2023 22:40:46 +0100 Subject: [PATCH 1056/2268] deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.28.0 (#2451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.27.0` -> `2.28.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.28.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.28.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.28.0/compatibility-slim/2.27.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.28.0/confidence-slim/2.27.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage ### [`v2.28.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2280-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2270v2280-2023-01-04) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.27.0...v2.28.0) ##### Features - Add estimated number of rows to CreateReadSession response ([#​1913](https://togithub.com/googleapis/java-bigquerystorage/issues/1913)) ([4840b26](https://togithub.com/googleapis/java-bigquerystorage/commit/4840b26956c22e40b6edcefe57f26dd0386e90e5)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-bigquery to v2.20.0 ([#​1912](https://togithub.com/googleapis/java-bigquerystorage/issues/1912)) ([e9e7ac3](https://togithub.com/googleapis/java-bigquerystorage/commit/e9e7ac3d4e655f7b77d830108226891c45464069)) - Update dependency org.json:json to v20220924 ([#​1799](https://togithub.com/googleapis/java-bigquerystorage/issues/1799)) ([a0a5d52](https://togithub.com/googleapis/java-bigquerystorage/commit/a0a5d52cdd06739992944126a89fe58daf4ee605))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c21469bca..b36b9ac87a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.5') +implementation platform('com.google.cloud:libraries-bom:26.2.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index be57a07d7b..b5f9904a31 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.27.0 + 2.28.0 pom import From feced40273ff0ecdbfa354926513dccba2b68065 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 22:14:45 +0000 Subject: [PATCH 1057/2268] chore(main): release 2.20.1 (#2452) :robot: I have created a release *beep* *boop* --- ## [2.20.1](https://togithub.com/googleapis/java-bigquery/compare/v2.20.0...v2.20.1) (2023-01-04) ### Dependencies * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.28.0 ([#2451](https://togithub.com/googleapis/java-bigquery/issues/2451)) ([4b760e1](https://togithub.com/googleapis/java-bigquery/commit/4b760e1049c6ddbfcb17b7de5905f43a53165c3d)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c22cf03e9..52523cba7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.20.1](https://github.com/googleapis/java-bigquery/compare/v2.20.0...v2.20.1) (2023-01-04) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.28.0 ([#2451](https://github.com/googleapis/java-bigquery/issues/2451)) ([4b760e1](https://github.com/googleapis/java-bigquery/commit/4b760e1049c6ddbfcb17b7de5905f43a53165c3d)) + ## [2.20.0](https://github.com/googleapis/java-bigquery/compare/v2.19.1...v2.20.0) (2022-12-13) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ac436b9ca8..eb6fab5f79 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.1-SNAPSHOT + 2.20.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3a423d6de6..d25baff65e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.1-SNAPSHOT + 2.20.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.1-SNAPSHOT + 2.20.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b5f9904a31..aa022674ce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.1-SNAPSHOT + 2.20.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.1-SNAPSHOT + 2.20.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 747d9a6a11..bc5ff4700b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.1-SNAPSHOT + 2.20.1 diff --git a/versions.txt b/versions.txt index 92bdb26c98..8c97e5bbaf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.0:2.20.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.20.1:2.20.1 \ No newline at end of file From 70d291697c17dc47dceed5dd9152ff5991bf72c1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 22:42:14 +0000 Subject: [PATCH 1058/2268] chore(main): release 2.20.2-SNAPSHOT (#2453) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index eb6fab5f79..2e50cc0c46 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d25baff65e..044cba69d8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.1 + 2.20.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.1 + 2.20.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index aa022674ce..2b1b126869 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.1 + 2.20.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bc5ff4700b..4d1f0c31dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.1 + 2.20.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8c97e5bbaf..804f08a213 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.1:2.20.1 \ No newline at end of file +google-cloud-bigquery:2.20.1:2.20.2-SNAPSHOT \ No newline at end of file From 2e81f7a824c2eb6dbd9bd4aff416628715cb897b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 20:43:38 +0000 Subject: [PATCH 1059/2268] test(deps): update dependency org.mockito:mockito-core to v4.11.0 (#2447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency org.mockito:mockito-core to v4.11.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2b1b126869..7177874d00 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ org.mockito mockito-core - 4.9.0 + 4.11.0 test From e53fb6aac0b5ecb14c9772a7f2d3bc0ee2ad752b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 20:43:59 +0000 Subject: [PATCH 1060/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.2.0 (#2448) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.2.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b36b9ac87a..1b08e744ee 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.1.5 + 26.2.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 4962e9b0e0..610182bdcf 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.1.5 + 26.2.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 99ac673152..c4b6873bf7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.1.5 + 26.2.0 pom import From 9d0a107da5e1e600dddccae79eb83358fd6940c6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 20:44:16 +0000 Subject: [PATCH 1061/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221209-2.0.0 (#2449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221209-2.0.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7177874d00..f510c6bd4f 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20221127-2.0.0 + v2-rev20221209-2.0.0 3.1.0 10.0.1 From c1025090444b64c73d1a461a81c6f4bf6bf243d2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 20:44:36 +0000 Subject: [PATCH 1062/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.1 (#2454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1b08e744ee..3a6a3fc7f9 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.20.0 + 2.20.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.20.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.20.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.1" ``` ## Authentication diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 50268f52f8..110af10862 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.20.0 + 2.20.1 From 485be563ba50974dd40069072b56d319ad40a70a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 20:44:58 +0000 Subject: [PATCH 1063/2268] deps: update dependency org.threeten:threeten-extra to v1.7.2 (#2450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.threeten:threeten-extra to v1.7.2 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f510c6bd4f..32d2925500 100644 --- a/pom.xml +++ b/pom.xml @@ -123,7 +123,7 @@ org.threeten threeten-extra - 1.7.1 + 1.7.2 From 412710c25d637efeac5a2242ad841b11a788708a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 21:14:15 +0000 Subject: [PATCH 1064/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 (#2455) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.1.0` -> `3.1.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.1/compatibility-slim/3.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.1/confidence-slim/3.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.1.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​311-httpsgithubcomgoogleapisjava-shared-dependenciescomparev310v311-2023-01-09) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.1.0...v3.1.1) ##### Dependencies - Adding `gapic-generator-java-bom` to `first-party-dependencies` ([#​957](https://togithub.com/googleapis/java-shared-dependencies/issues/957)) ([f051e6e](https://togithub.com/googleapis/java-shared-dependencies/commit/f051e6ee0ad4a705014d9d2f8211ddad464b3ca4)) - Update dependency com.google.api-client:google-api-client-bom to v2.1.2 ([#​956](https://togithub.com/googleapis/java-shared-dependencies/issues/956)) ([dbfde36](https://togithub.com/googleapis/java-shared-dependencies/commit/dbfde36f5b0806192ea99d45382c84cff518f500)) - Update dependency com.google.api:api-common to v2.3.1 ([#​947](https://togithub.com/googleapis/java-shared-dependencies/issues/947)) ([f35c3bf](https://togithub.com/googleapis/java-shared-dependencies/commit/f35c3bf518e8b488ddeb28a6ff86719b24a62df5)) - Update dependency com.google.auth:google-auth-library-bom to v1.14.0 ([#​950](https://togithub.com/googleapis/java-shared-dependencies/issues/950)) ([e5609ca](https://togithub.com/googleapis/java-shared-dependencies/commit/e5609ca23657e1c37825c6d8930da1fb5080b8a6)) - Update dependency com.google.code.gson:gson to v2.10.1 ([#​958](https://togithub.com/googleapis/java-shared-dependencies/issues/958)) ([bd35327](https://togithub.com/googleapis/java-shared-dependencies/commit/bd353274c16d01915923a6fa34796d0b78672fb0)) - Update dependency com.google.errorprone:error_prone_annotations to v2.17.0 ([#​955](https://togithub.com/googleapis/java-shared-dependencies/issues/955)) ([b656786](https://togithub.com/googleapis/java-shared-dependencies/commit/b6567863e659ff3eb6cc7b4b42a42acc7ebd24ed)) - Update dependency com.google.errorprone:error_prone_annotations to v2.18.0 ([#​961](https://togithub.com/googleapis/java-shared-dependencies/issues/961)) ([0c4ff89](https://togithub.com/googleapis/java-shared-dependencies/commit/0c4ff895e103164dc0c95bc9789f9a3dc6c2f1a4)) - Update dependency com.google.protobuf:protobuf-bom to v3.21.12 ([#​948](https://togithub.com/googleapis/java-shared-dependencies/issues/948)) ([812ce38](https://togithub.com/googleapis/java-shared-dependencies/commit/812ce38e95de4db15184f9dd38bbd4c2affa2133)) - Update dependency io.grpc:grpc-bom to v1.51.1 ([#​953](https://togithub.com/googleapis/java-shared-dependencies/issues/953)) ([a86e70a](https://togithub.com/googleapis/java-shared-dependencies/commit/a86e70ac7be07cdb3b69d0cf4fc1afedbf7048fd)) - Update dependency org.checkerframework:checker-qual to v3.29.0 ([#​959](https://togithub.com/googleapis/java-shared-dependencies/issues/959)) ([784a79b](https://togithub.com/googleapis/java-shared-dependencies/commit/784a79b49b109d18858fd603dbdd37a4947280af)) - Update dependency org.threeten:threetenbp to v1.6.5 ([#​946](https://togithub.com/googleapis/java-shared-dependencies/issues/946)) ([403555e](https://togithub.com/googleapis/java-shared-dependencies/commit/403555e4010aef84e909e0b0e48cf5571d9e3184)) - Update google.core.version to v2.9.1 ([#​962](https://togithub.com/googleapis/java-shared-dependencies/issues/962)) ([c1e648d](https://togithub.com/googleapis/java-shared-dependencies/commit/c1e648d5045f871ed5670f949978430ad2d49484)) - Update iam.version to v1.6.23 ([#​954](https://togithub.com/googleapis/java-shared-dependencies/issues/954)) ([bb4730e](https://togithub.com/googleapis/java-shared-dependencies/commit/bb4730e7dcac57b6653825d63c7408d2182b0a27))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a6a3fc7f9..2ec0f5063b 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.2.0') +implementation platform('com.google.cloud:libraries-bom:26.3.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 32d2925500..5c446f7b9f 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20221209-2.0.0 - 3.1.0 + 3.1.1 10.0.1
    From 23808ea454c403239021acf771e743506f97711b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 21:14:20 +0000 Subject: [PATCH 1065/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.3.0 (#2457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.2.0` -> `26.3.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.3.0/compatibility-slim/26.2.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.3.0/confidence-slim/26.2.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2ec0f5063b..20ef7a46c5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.2.0 + 26.3.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 610182bdcf..d7cf1b50b7 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.2.0 + 26.3.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c4b6873bf7..6c6d5c953c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.2.0 + 26.3.0 pom import From 04d47ad3b8e9b0078884f81c227eb96e87d21aa2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Jan 2023 21:16:15 +0000 Subject: [PATCH 1066/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.9.2 (#2456) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.junit.vintage:junit-vintage-engine](https://junit.org/junit5/) ([source](https://togithub.com/junit-team/junit5)) | `5.9.1` -> `5.9.2` | [![age](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.2/compatibility-slim/5.9.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.2/confidence-slim/5.9.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d7cf1b50b7..c5ad945f06 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.9.1 + 5.9.2 test From 473c7a480b1a6ef2bd9036f37610ed82878b4362 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jan 2023 16:51:22 +0000 Subject: [PATCH 1067/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.2 (#2460) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c446f7b9f..a4ee5e96b4 100644 --- a/pom.xml +++ b/pom.xml @@ -196,7 +196,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.1 + 3.4.2 From 08e2927ecb05ff3fda03493a99f466a6d2417d20 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jan 2023 17:37:29 +0000 Subject: [PATCH 1068/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221217-2.0.0 (#2459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20221217-2.0.0 * 🦉 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 Co-authored-by: Neenu Shaji --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4ee5e96b4..959e2f53bf 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20221209-2.0.0 + v2-rev20221217-2.0.0 3.1.1 10.0.1
    From b62391d9cbf5fab30ff5df488d2835be45c5b8d8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jan 2023 21:28:17 +0000 Subject: [PATCH 1069/2268] deps: update com.google.cloud:google-cloud-bigquerystorage-bom to 2.28.1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 959e2f53bf..d765685def 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.28.0 + 2.28.1 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.16.0 + 2.17.0 test From 084525520c4353fbbdcc5c7bd26ef4635bebe2ea Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jan 2023 21:28:30 +0000 Subject: [PATCH 1070/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.0 (#2462) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 110af10862..784fce0126 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.17.1 + 2.18.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4d1f0c31dd..239ff6102c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.17.1 + 2.18.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6c6d5c953c..487eba2686 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.17.1 + 2.18.0 test From 2d5343a88d171031a2c9a562a653f3d4e72e0e3c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 22:36:11 +0000 Subject: [PATCH 1071/2268] chore(main): release 2.20.2 (#2458) :robot: I have created a release *beep* *boop* --- ## [2.20.2](https://togithub.com/googleapis/java-bigquery/compare/v2.20.1...v2.20.2) (2023-01-12) ### Dependencies * Update com.google.cloud:google-cloud-bigquerystorage-bom to 2.28.1 ([b62391d](https://togithub.com/googleapis/java-bigquery/commit/b62391d9cbf5fab30ff5df488d2835be45c5b8d8)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221209-2.0.0 ([#2449](https://togithub.com/googleapis/java-bigquery/issues/2449)) ([9d0a107](https://togithub.com/googleapis/java-bigquery/commit/9d0a107da5e1e600dddccae79eb83358fd6940c6)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221217-2.0.0 ([#2459](https://togithub.com/googleapis/java-bigquery/issues/2459)) ([08e2927](https://togithub.com/googleapis/java-bigquery/commit/08e2927ecb05ff3fda03493a99f466a6d2417d20)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 ([#2455](https://togithub.com/googleapis/java-bigquery/issues/2455)) ([412710c](https://togithub.com/googleapis/java-bigquery/commit/412710c25d637efeac5a2242ad841b11a788708a)) * Update dependency org.junit.vintage:junit-vintage-engine to v5.9.2 ([#2456](https://togithub.com/googleapis/java-bigquery/issues/2456)) ([04d47ad](https://togithub.com/googleapis/java-bigquery/commit/04d47ad3b8e9b0078884f81c227eb96e87d21aa2)) * Update dependency org.threeten:threeten-extra to v1.7.2 ([#2450](https://togithub.com/googleapis/java-bigquery/issues/2450)) ([485be56](https://togithub.com/googleapis/java-bigquery/commit/485be563ba50974dd40069072b56d319ad40a70a)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52523cba7b..c8264ee4a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.20.2](https://github.com/googleapis/java-bigquery/compare/v2.20.1...v2.20.2) (2023-01-12) + + +### Dependencies + +* Update com.google.cloud:google-cloud-bigquerystorage-bom to 2.28.1 ([b62391d](https://github.com/googleapis/java-bigquery/commit/b62391d9cbf5fab30ff5df488d2835be45c5b8d8)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221209-2.0.0 ([#2449](https://github.com/googleapis/java-bigquery/issues/2449)) ([9d0a107](https://github.com/googleapis/java-bigquery/commit/9d0a107da5e1e600dddccae79eb83358fd6940c6)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20221217-2.0.0 ([#2459](https://github.com/googleapis/java-bigquery/issues/2459)) ([08e2927](https://github.com/googleapis/java-bigquery/commit/08e2927ecb05ff3fda03493a99f466a6d2417d20)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 ([#2455](https://github.com/googleapis/java-bigquery/issues/2455)) ([412710c](https://github.com/googleapis/java-bigquery/commit/412710c25d637efeac5a2242ad841b11a788708a)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.2 ([#2456](https://github.com/googleapis/java-bigquery/issues/2456)) ([04d47ad](https://github.com/googleapis/java-bigquery/commit/04d47ad3b8e9b0078884f81c227eb96e87d21aa2)) +* Update dependency org.threeten:threeten-extra to v1.7.2 ([#2450](https://github.com/googleapis/java-bigquery/issues/2450)) ([485be56](https://github.com/googleapis/java-bigquery/commit/485be563ba50974dd40069072b56d319ad40a70a)) + ## [2.20.1](https://github.com/googleapis/java-bigquery/compare/v2.20.0...v2.20.1) (2023-01-04) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2e50cc0c46..93dc714e4a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.2-SNAPSHOT + 2.20.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 044cba69d8..74df29f487 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.2-SNAPSHOT + 2.20.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.2-SNAPSHOT + 2.20.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d765685def..cbdb7af061 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.2-SNAPSHOT + 2.20.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.2-SNAPSHOT + 2.20.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 239ff6102c..3d711d3d70 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.2-SNAPSHOT + 2.20.2 diff --git a/versions.txt b/versions.txt index 804f08a213..9e9b820845 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.1:2.20.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.20.2:2.20.2 \ No newline at end of file From 8d349f6693d955c702628f20376bbc03f9f41d9b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 23:04:11 +0000 Subject: [PATCH 1072/2268] chore(main): release 2.20.3-SNAPSHOT (#2466) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 93dc714e4a..a782578109 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.2 + 2.20.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 74df29f487..e59fe63f39 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.2 + 2.20.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.2 + 2.20.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cbdb7af061..33f535db19 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.2 + 2.20.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.2 + 2.20.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3d711d3d70..11e24fdb84 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.2 + 2.20.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 9e9b820845..1b8e8fe545 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.2:2.20.2 \ No newline at end of file +google-cloud-bigquery:2.20.2:2.20.3-SNAPSHOT \ No newline at end of file From 4e8bbe0808b2aabea889042135e3a388d2f8ecff Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:20:09 -0500 Subject: [PATCH 1073/2268] fix(java): skip fixing poms for special modules (#1744) (#2474) fix(java): handle empty modules Fixes https://github.com/googleapis/synthtool/issues/1743 Source-Link: https://github.com/googleapis/synthtool/commit/482d649d5d705c18028076985f64b214f6b6c14e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bd5071596a47614d1fe15eb766c4255bae330f823b606e1196a3b0c8d2e96fd1 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- .kokoro/requirements.in | 40 ++------- .kokoro/requirements.txt | 184 ++++++++++++++------------------------ README.md | 6 +- 4 files changed, 79 insertions(+), 155 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 288e394897..f8a8575314 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c + digest: sha256:bd5071596a47614d1fe15eb766c4255bae330f823b606e1196a3b0c8d2e96fd1 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index a5010f77d4..b19a8dbfdd 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,34 +1,6 @@ -gcp-docuploader==0.6.3 -google-crc32c==1.3.0 -googleapis-common-protos==1.56.3 -gcp-releasetool==1.9.1 -cryptography==38.0.3 -cachetools==4.2.4 -cffi==1.15.1 -jeepney==0.7.1 -jinja2==3.0.3 -markupsafe==2.0.1 -keyring==23.4.1 -packaging==21.3 -protobuf==3.19.5 -pyjwt==2.4.0 -pyparsing==3.0.9 -pycparser==2.21 -pyperclip==1.8.2 -python-dateutil==2.8.2 -requests==2.27.1 -certifi==2022.12.7 -importlib-metadata==4.8.3 -zipp==3.6.0 -google_api_core==2.8.2 -google-cloud-storage==2.0.0 -google-resumable-media==2.3.3 -google-cloud-core==2.3.1 -typing-extensions==4.1.1 -urllib3==1.26.12 -zipp==3.6.0 -rsa==4.9 -six==1.16.0 -attrs==22.1.0 -google-auth==2.14.1 -idna==3.4 \ No newline at end of file +gcp-docuploader +gcp-releasetool +wheel +setuptools +typing-extensions +click<8.1.0 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 15c404aa5a..4895c9631f 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,27 +1,21 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # -# pip-compile --generate-hashes requirements.in +# pip-compile --allow-unsafe --generate-hashes requirements.in # attrs==22.1.0 \ --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool cachetools==4.2.4 \ --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 - # via - # -r requirements.in - # google-auth + # via google-auth certifi==2022.12.7 \ --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 - # via - # -r requirements.in - # requests + # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ @@ -87,9 +81,7 @@ cffi==1.15.1 \ --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via - # -r requirements.in - # cryptography + # via cryptography charset-normalizer==2.0.12 \ --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df @@ -98,6 +90,7 @@ click==8.0.4 \ --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb # via + # -r requirements.in # gcp-docuploader # gcp-releasetool colorlog==6.7.0 \ @@ -132,12 +125,11 @@ cryptography==38.0.3 \ --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 # via - # -r requirements.in # gcp-releasetool # secretstorage -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b +gcp-docuploader==0.6.4 \ + --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ + --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in gcp-releasetool==1.9.1 \ --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ @@ -147,13 +139,12 @@ google-api-core==2.8.2 \ --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 # via - # -r requirements.in # google-cloud-core # google-cloud-storage google-auth==2.14.1 \ + --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 # via - # -r requirements.in # gcp-releasetool # google-api-core # google-cloud-core @@ -161,15 +152,11 @@ google-auth==2.14.1 \ google-cloud-core==2.3.1 \ --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 - # via - # -r requirements.in - # google-cloud-storage + # via google-cloud-storage google-cloud-storage==2.0.0 \ --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 - # via - # -r requirements.in - # gcp-docuploader + # via gcp-docuploader google-crc32c==1.3.0 \ --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ @@ -214,52 +201,37 @@ google-crc32c==1.3.0 \ --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 - # via - # -r requirements.in - # google-resumable-media + # via google-resumable-media google-resumable-media==2.3.3 \ --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 - # via - # -r requirements.in - # google-cloud-storage + # via google-cloud-storage googleapis-common-protos==1.56.3 \ --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 - # via - # -r requirements.in - # google-api-core + # via google-api-core idna==3.4 \ --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via - # -r requirements.in - # requests + # via requests importlib-metadata==4.8.3 \ --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 + # via keyring +jeepney==0.8.0 \ + --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ + --hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755 # via - # -r requirements.in - # keyring -jeepney==0.7.1 \ - --hash=sha256:1b5a0ea5c0e7b166b2f5895b91a08c14de8915afda4407fb5022a195224958ac \ - --hash=sha256:fa9e232dfa0c498bd0b8a3a73b8d8a31978304dcef0515adc859d4e096f96f4f - # via - # -r requirements.in # keyring # secretstorage jinja2==3.0.3 \ --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool keyring==23.4.1 \ --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool markupsafe==2.0.1 \ --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ @@ -330,49 +302,39 @@ markupsafe==2.0.1 \ --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 - # via - # -r requirements.in - # jinja2 + # via jinja2 packaging==21.3 \ --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 + # via gcp-releasetool +protobuf==3.20.2 \ + --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ + --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ + --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ + --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ + --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ + --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ + --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ + --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ + --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ + --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ + --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ + --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ + --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ + --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ + --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ + --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ + --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ + --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ + --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ + --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ + --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ + --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 # via - # -r requirements.in - # gcp-releasetool -protobuf==3.19.5 \ - --hash=sha256:1867f93b06a183f87696871bb8d1e99ee71dbb69d468ce1f0cc8bf3d30f982f3 \ - --hash=sha256:3c4160b601220627f7e91154e572baf5e161a9c3f445a8242d536ee3d0b7b17c \ - --hash=sha256:4ee2af7051d3b10c8a4fe6fd1a2c69f201fea36aeee7086cf202a692e1b99ee1 \ - --hash=sha256:5266c36cc0af3bb3dbf44f199d225b33da66a9a5c3bdc2b14865ad10eddf0e37 \ - --hash=sha256:5470f892961af464ae6eaf0f3099e2c1190ae8c7f36f174b89491281341f79ca \ - --hash=sha256:66d14b5b90090353efe75c9fb1bf65ef7267383034688d255b500822e37d5c2f \ - --hash=sha256:67efb5d20618020aa9596e17bfc37ca068c28ec0c1507d9507f73c93d46c9855 \ - --hash=sha256:696e6cfab94cc15a14946f2bf72719dced087d437adbd994fff34f38986628bc \ - --hash=sha256:6a02172b9650f819d01fb8e224fc69b0706458fc1ab4f1c669281243c71c1a5e \ - --hash=sha256:6eca9ae238ba615d702387a2ddea635d535d769994a9968c09a4ca920c487ab9 \ - --hash=sha256:950abd6c00e7b51f87ae8b18a0ce4d69fea217f62f171426e77de5061f6d9850 \ - --hash=sha256:9e1d74032f56ff25f417cfe84c8147047732e5059137ca42efad20cbbd25f5e0 \ - --hash=sha256:9e42b1cf2ecd8a1bd161239e693f22035ba99905ae6d7efeac8a0546c7ec1a27 \ - --hash=sha256:9f957ef53e872d58a0afd3bf6d80d48535d28c99b40e75e6634cbc33ea42fd54 \ - --hash=sha256:a89aa0c042e61e11ade320b802d6db4ee5391d8d973e46d3a48172c1597789f8 \ - --hash=sha256:c0f80876a8ff0ae7064084ed094eb86497bd5a3812e6fc96a05318b92301674e \ - --hash=sha256:c44e3282cff74ad18c7e8a0375f407f69ee50c2116364b44492a196293e08b21 \ - --hash=sha256:d249519ba5ecf5dd6b18150c9b6bcde510b273714b696f3923ff8308fc11ae49 \ - --hash=sha256:d3973a2d58aefc7d1230725c2447ce7f86a71cbc094b86a77c6ee1505ac7cdb1 \ - --hash=sha256:dca2284378a5f2a86ffed35c6ac147d14c48b525eefcd1083e5a9ce28dfa8657 \ - --hash=sha256:e63b0b3c42e51c94add62b010366cd4979cb6d5f06158bcae8faac4c294f91e1 \ - --hash=sha256:f2b599a21c9a32e171ec29a2ac54e03297736c578698e11b099d031f79da114b \ - --hash=sha256:f2bde37667b18c2b5280df83bc799204394a5d2d774e4deaf9de0eb741df6833 \ - --hash=sha256:f4f909f4dde413dec435a44b0894956d55bb928ded7d6e3c726556ca4c796e84 \ - --hash=sha256:f976234e20ab2785f54224bcdafa027674e23663b132fa3ca0caa291a6cfbde7 \ - --hash=sha256:f9cebda093c2f6bfed88f1c17cdade09d4d96096421b344026feee236532d4de - # via - # -r requirements.in # gcp-docuploader # gcp-releasetool # google-api-core # google-cloud-storage - # googleapis-common-protos pyasn1==0.4.8 \ --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba @@ -386,71 +348,61 @@ pyasn1-modules==0.2.8 \ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via - # -r requirements.in - # cffi + # via cffi pyjwt==2.4.0 \ --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool pyparsing==3.0.9 \ --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via - # -r requirements.in - # packaging + # via packaging pyperclip==1.8.2 \ --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # -r requirements.in - # gcp-releasetool + # via gcp-releasetool requests==2.27.1 \ --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d # via - # -r requirements.in # gcp-releasetool # google-api-core # google-cloud-storage rsa==4.9 \ --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via - # -r requirements.in - # google-auth + # via google-auth secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring +setuptools==65.6.3 \ + --hash=sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54 \ + --hash=sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75 + # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 # via - # -r requirements.in # gcp-docuploader # google-auth # python-dateutil -typing-extensions==4.1.1 \ - --hash=sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42 \ - --hash=sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2 +typing-extensions==4.4.0 \ + --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ + --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in urllib3==1.26.12 \ --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via - # -r requirements.in - # requests + # via requests +wheel==0.38.4 \ + --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ + --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 + # via -r requirements.in zipp==3.6.0 \ --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc - # via - # -r requirements.in - # importlib-metadata + # via importlib-metadata diff --git a/README.md b/README.md index 20ef7a46c5..10b6da28c8 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.3.0') +implementation platform('com.google.cloud:libraries-bom:26.4.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.20.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.20.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.2" ``` ## Authentication From b6409d52adde116bf073ec71e8968fd68b983e65 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:21:06 +0000 Subject: [PATCH 1074/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230114-2.0.0 (#2477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230114-2.0.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 33f535db19..0dc380e859 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20221217-2.0.0 + v2-rev20230114-2.0.0 3.1.1 10.0.1 From 0e23759066b5270e74aabfb028dcb4cba59dbf33 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:22:42 +0000 Subject: [PATCH 1075/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.4.0 (#2470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.4.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10b6da28c8..25ff30030f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.3.0 + 26.4.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index c5ad945f06..3c6935a907 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.3.0 + 26.4.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 487eba2686..4e59026680 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.3.0 + 26.4.0 pom import From 089e67622109c977a5f6da44ef1283dc5ce04ccc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:23:05 +0000 Subject: [PATCH 1076/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.1 (#2469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.1 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 784fce0126..50e96c3fa7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.18.0 + 2.18.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 11e24fdb84..bf79fac659 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.18.0 + 2.18.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4e59026680..5f897fa74f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.18.0 + 2.18.1 test From ae5ed9be637a55192602c9bc2b80724cefe63bd7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:23:32 +0000 Subject: [PATCH 1077/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.2 (#2467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.20.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 25ff30030f..7d1013d298 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.20.1 + 2.20.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 50e96c3fa7..0f314246e8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.20.1 + 2.20.2 From f1cd2cbccae6e0593cfa9577e016b3f8a1a7cc26 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:25:11 +0000 Subject: [PATCH 1078/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.10.0 (#2464) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0dc380e859..dcd06df032 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.9.0 + 2.10.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0f314246e8..630e4ae196 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.9.0 + 2.10.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bf79fac659..d6ad4c5b2e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.9.0 + 2.10.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5f897fa74f..d1b340a7b2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.9.0 + 2.10.0 test From 606fc1e26c7c6f407a1938058b07699d84615bc7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:26:30 +0000 Subject: [PATCH 1079/2268] deps: update com.google.cloud:google-cloud-storage to v2.17.1 (#2465) deps: update com.google.cloud:google-cloud-datacatalog-bom to v1.14.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dcd06df032..c50ad6fcdd 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.13.0 + 1.14.0 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.17.0 + 2.17.1 test From 688b6a65b890668591451e8f3d01f9f15527c80d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 17:46:12 +0000 Subject: [PATCH 1080/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.2 (#2476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `3.1.1` -> `3.1.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.2/compatibility-slim/3.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.1.2/confidence-slim/3.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-shared-dependencies ### [`v3.1.2`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​312-httpsgithubcomgoogleapisjava-shared-dependenciescomparev311v312-2023-01-20) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.1.1...v3.1.2) ##### Bug Fixes - **java:** Skip fixing poms for special modules ([#​1744](https://togithub.com/googleapis/java-shared-dependencies/issues/1744)) ([#​971](https://togithub.com/googleapis/java-shared-dependencies/issues/971)) ([74a96f1](https://togithub.com/googleapis/java-shared-dependencies/commit/74a96f1155418bde285877b72b4d7e600d08beb6)) ##### Dependencies - Update dependency com.google.api:gapic-generator-java-bom to v2.14.0 ([#​972](https://togithub.com/googleapis/java-shared-dependencies/issues/972)) ([2c742b5](https://togithub.com/googleapis/java-shared-dependencies/commit/2c742b56afc441f4922e6f6c737d3c3374ceadec)) - Update dependency com.google.cloud:google-cloud-core-bom to v2.9.3 ([#​974](https://togithub.com/googleapis/java-shared-dependencies/issues/974)) ([e4cb2ae](https://togithub.com/googleapis/java-shared-dependencies/commit/e4cb2ae34648c61ac40b7c9628e4ec088186fd57)) - Update google.core.version to v2.9.2 ([#​969](https://togithub.com/googleapis/java-shared-dependencies/issues/969)) ([aa946a6](https://togithub.com/googleapis/java-shared-dependencies/commit/aa946a6e33a5c8c3d6ae37bb07c3872c0bab793b)) - Update google.core.version to v2.9.4 ([#​976](https://togithub.com/googleapis/java-shared-dependencies/issues/976)) ([718246c](https://togithub.com/googleapis/java-shared-dependencies/commit/718246c985488b138eb0113b5a3200d3eb2af31d))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c50ad6fcdd..bf3e801140 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20230114-2.0.0 - 3.1.1 + 3.1.2 10.0.1
    From 09a8382222e1174c46989e797e0941cc36d387f1 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 23 Jan 2023 14:31:05 -0500 Subject: [PATCH 1081/2268] feat: migrate from google-http-client-jackson2 to google-http-client-gson (#2471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: test gson compatibility * chore: update imports in samples * chore: fix lint * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- google-cloud-bigquery/pom.xml | 2 +- .../java/com/google/cloud/bigquery/benchmark/Benchmark.java | 4 ++-- .../com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java | 4 ++-- .../src/main/java/com/example/bigquery/AuthUserFlow.java | 4 ++-- .../src/main/java/com/example/bigquery/AuthUserQuery.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e59fe63f39..8cd9bc77f1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -27,7 +27,7 @@
    com.google.http-client - google-http-client-jackson2 + google-http-client-gson com.google.cloud diff --git a/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java b/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java index e6fc16e176..caec16676f 100644 --- a/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java +++ b/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java @@ -16,7 +16,7 @@ package com.google.cloud.bigquery.benchmark; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.FieldValue; @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception { return; } String[] requests = - new JacksonFactory() + new GsonFactory() .createJsonParser(new FileInputStream(args[0])) .parseAndClose(String[].class); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index a9ef3a817a..6bad06199b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -30,7 +30,7 @@ import com.google.api.client.http.HttpTransport; import com.google.api.client.http.json.JsonHttpContent; import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import com.google.api.core.InternalApi; import com.google.api.core.InternalExtensionOnly; import com.google.api.services.bigquery.Bigquery; @@ -105,7 +105,7 @@ public HttpBigQueryRpc(BigQueryOptions options) { HttpRequestInitializer initializer = transportOptions.getHttpRequestInitializer(options); this.options = options; bigquery = - new Bigquery.Builder(transport, new JacksonFactory(), initializer) + new Bigquery.Builder(transport, new GsonFactory(), initializer) .setRootUrl(options.getHost()) .setApplicationName(options.getApplicationName()) .build(); diff --git a/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java b/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java index 0dd37f0d63..606a3916e3 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java +++ b/samples/snippets/src/main/java/com/example/bigquery/AuthUserFlow.java @@ -24,7 +24,7 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import com.google.api.client.util.store.FileDataStoreFactory; import com.google.api.gax.paging.Page; import com.google.auth.oauth2.GoogleCredentials; @@ -49,7 +49,7 @@ public class AuthUserFlow { private static final File DATA_STORE_DIR = new File(AuthUserFlow.class.getResource("/").getPath(), "credentials"); - private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); + private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); // i.e redirect_uri http://localhost:61984/Callback private static final int LOCAL_RECEIVER_PORT = 61984; diff --git a/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java b/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java index 508759620c..bed9159c90 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java +++ b/samples/snippets/src/main/java/com/example/bigquery/AuthUserQuery.java @@ -24,7 +24,7 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.json.JsonFactory; -import com.google.api.client.json.jackson2.JacksonFactory; +import com.google.api.client.json.gson.GsonFactory; import com.google.api.client.util.store.FileDataStoreFactory; import com.google.auth.oauth2.GoogleCredentials; import com.google.auth.oauth2.UserCredentials; @@ -49,7 +49,7 @@ public class AuthUserQuery { private static final File DATA_STORE_DIR = new File(AuthUserQuery.class.getResource("/").getPath(), "credentials"); - private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance(); + private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance(); // i.e redirect_uri http://localhost:61984/Callback private static final int LOCAL_RECEIVER_PORT = 61984; From 5a20c327d9b863fbde9a8fb10f61f4c706b446a8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 19:32:20 +0000 Subject: [PATCH 1082/2268] deps: update com.google.cloud:google-cloud-storage to v2.17.2 (#2479) deps: update com.google.cloud:google-cloud-bigquerystorage-bom to v2.28.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bf3e801140..82ba4e487c 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.28.1 + 2.28.3 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.17.1 + 2.17.2 test From 5bfa7aeb8ca48fab438d03b2ba1a19a8673d85a9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Jan 2023 19:32:41 +0000 Subject: [PATCH 1083/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.10.0 (#2463) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 82ba4e487c..2fe1920568 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.9.0 + 2.10.0 test From baa0abc359a9337a769b972b6241eed3292dedfc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:24:19 -0500 Subject: [PATCH 1084/2268] chore(main): release 2.21.0 (#2478) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 23 +++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8264ee4a4..c58633bf48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.21.0](https://github.com/googleapis/java-bigquery/compare/v2.20.2...v2.21.0) (2023-01-23) + + +### Features + +* Migrate from google-http-client-jackson2 to google-http-client-gson ([#2471](https://github.com/googleapis/java-bigquery/issues/2471)) ([09a8382](https://github.com/googleapis/java-bigquery/commit/09a8382222e1174c46989e797e0941cc36d387f1)) + + +### Bug Fixes + +* **java:** Skip fixing poms for special modules ([#1744](https://github.com/googleapis/java-bigquery/issues/1744)) ([#2474](https://github.com/googleapis/java-bigquery/issues/2474)) ([4e8bbe0](https://github.com/googleapis/java-bigquery/commit/4e8bbe0808b2aabea889042135e3a388d2f8ecff)) + + +### Dependencies + +* Update com.google.cloud:google-cloud-bigquerystorage-bom to v2.28.3 ([5a20c32](https://github.com/googleapis/java-bigquery/commit/5a20c327d9b863fbde9a8fb10f61f4c706b446a8)) +* Update com.google.cloud:google-cloud-datacatalog-bom to v1.14.0 ([606fc1e](https://github.com/googleapis/java-bigquery/commit/606fc1e26c7c6f407a1938058b07699d84615bc7)) +* Update com.google.cloud:google-cloud-storage to v2.17.1 ([#2465](https://github.com/googleapis/java-bigquery/issues/2465)) ([606fc1e](https://github.com/googleapis/java-bigquery/commit/606fc1e26c7c6f407a1938058b07699d84615bc7)) +* Update com.google.cloud:google-cloud-storage to v2.17.2 ([#2479](https://github.com/googleapis/java-bigquery/issues/2479)) ([5a20c32](https://github.com/googleapis/java-bigquery/commit/5a20c327d9b863fbde9a8fb10f61f4c706b446a8)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.10.0 ([#2463](https://github.com/googleapis/java-bigquery/issues/2463)) ([5bfa7ae](https://github.com/googleapis/java-bigquery/commit/5bfa7aeb8ca48fab438d03b2ba1a19a8673d85a9)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230114-2.0.0 ([#2477](https://github.com/googleapis/java-bigquery/issues/2477)) ([b6409d5](https://github.com/googleapis/java-bigquery/commit/b6409d52adde116bf073ec71e8968fd68b983e65)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.2 ([#2476](https://github.com/googleapis/java-bigquery/issues/2476)) ([688b6a6](https://github.com/googleapis/java-bigquery/commit/688b6a65b890668591451e8f3d01f9f15527c80d)) + ## [2.20.2](https://github.com/googleapis/java-bigquery/compare/v2.20.1...v2.20.2) (2023-01-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a782578109..2ea3e2e425 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.20.3-SNAPSHOT + 2.21.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8cd9bc77f1..6f2a7d6bb5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.20.3-SNAPSHOT + 2.21.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.20.3-SNAPSHOT + 2.21.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2fe1920568..4c8a7c40ff 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.20.3-SNAPSHOT + 2.21.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.20.3-SNAPSHOT + 2.21.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d6ad4c5b2e..9d5de76ee9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.20.3-SNAPSHOT + 2.21.0 diff --git a/versions.txt b/versions.txt index 1b8e8fe545..221417ba8e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.20.2:2.20.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.21.0:2.21.0 \ No newline at end of file From cd8b3ae0cd5da2f80b2a1eec140f802c8b0511d0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 20:50:12 +0000 Subject: [PATCH 1085/2268] chore(main): release 2.21.1-SNAPSHOT (#2480) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2ea3e2e425..f5e2426d67 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.21.0 + 2.21.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6f2a7d6bb5..ad82b14fc1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.21.0 + 2.21.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.21.0 + 2.21.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4c8a7c40ff..12816f4605 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.21.0 + 2.21.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.21.0 + 2.21.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9d5de76ee9..1a6a2ed963 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.21.0 + 2.21.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 221417ba8e..a84c62037e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.21.0:2.21.0 \ No newline at end of file +google-cloud-bigquery:2.21.0:2.21.1-SNAPSHOT \ No newline at end of file From 325773757e811172236eb3221926025b82f5db64 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 26 Jan 2023 13:31:58 -0500 Subject: [PATCH 1086/2268] feat: add collation for Case sensitive string column (#2490) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add collation for Case sensitive string column * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix typo Co-authored-by: Owl Bot --- README.md | 4 +- .../clirr-ignored-differences.xml | 10 ++ .../com/google/cloud/bigquery/Dataset.java | 6 ++ .../google/cloud/bigquery/DatasetInfo.java | 32 +++++++ .../java/com/google/cloud/bigquery/Field.java | 28 ++++++ .../java/com/google/cloud/bigquery/Table.java | 6 ++ .../com/google/cloud/bigquery/TableInfo.java | 23 ++++- .../cloud/bigquery/it/ITBigQueryTest.java | 92 +++++++++++++++++++ 8 files changed, 198 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7d1013d298..8d80a84706 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.20.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.21.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.21.0" ``` ## Authentication diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 02cfd99670..6386c50371 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -34,4 +34,14 @@ com/google/cloud/bigquery/Connection com.google.common.util.concurrent.ListenableFuture executeSelectAsync(java.lang.String, java.util.List, java.util.Map[]) + + 7013 + com/google/cloud/bigquery/DatasetInfo* + *DefaultCollation(*) + + + 7013 + com/google/cloud/bigquery/TableInfo* + *DefaultCollation(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index 48ccd43142..5f9fea892f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -146,6 +146,12 @@ public Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs return this; } + @Override + public Builder setDefaultCollation(String defaultCollation) { + infoBuilder.setDefaultCollation(defaultCollation); + return this; + } + @Override public Dataset build() { return new Dataset(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index c7c6d0c19f..bd209952e8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -72,6 +72,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final Labels labels; private final EncryptionConfiguration defaultEncryptionConfiguration; private final Long defaultPartitionExpirationMs; + private final String defaultCollation; /** A builder for {@code DatasetInfo} objects. */ public abstract static class Builder { @@ -148,6 +149,19 @@ public abstract Builder setDefaultEncryptionConfiguration( */ public abstract Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs); + /** + * Optional. Defines the default collation specification of future tables created in the + * dataset. If a table is created in this dataset without table-level default collation, then + * the table inherits the dataset default collation, which is applied to the string fields that + * do not have explicit collation specified. A change to this field affects only tables created + * afterwards, and does not alter the existing tables. The following values are supported: + * + *

    * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to + * case-sensitive behavior. (-- A wrapper is used here because it is possible to set the value + * to the empty string. --) (-- api-linter: standard-fields=disabled --) + */ + public abstract Builder setDefaultCollation(String defaultCollation); + /** Creates a {@code DatasetInfo} object. */ public abstract DatasetInfo build(); } @@ -168,6 +182,7 @@ static final class BuilderImpl extends Builder { private Labels labels = Labels.ZERO; private EncryptionConfiguration defaultEncryptionConfiguration; private Long defaultPartitionExpirationMs; + private String defaultCollation; BuilderImpl() {} @@ -186,6 +201,7 @@ static final class BuilderImpl extends Builder { this.labels = datasetInfo.labels; this.defaultEncryptionConfiguration = datasetInfo.defaultEncryptionConfiguration; this.defaultPartitionExpirationMs = datasetInfo.defaultPartitionExpirationMs; + this.defaultCollation = datasetInfo.defaultCollation; } BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) { @@ -219,6 +235,7 @@ public Acl apply(Dataset.Access accessPb) { .build(); } this.defaultPartitionExpirationMs = datasetPb.getDefaultPartitionExpirationMs(); + this.defaultCollation = datasetPb.getDefaultCollation(); } @Override @@ -313,6 +330,12 @@ public Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs return this; } + @Override + public Builder setDefaultCollation(String defaultCollation) { + this.defaultCollation = defaultCollation; + return this; + } + @Override public DatasetInfo build() { return new DatasetInfo(this); @@ -334,6 +357,7 @@ public DatasetInfo build() { labels = builder.labels; defaultEncryptionConfiguration = builder.defaultEncryptionConfiguration; defaultPartitionExpirationMs = builder.defaultPartitionExpirationMs; + defaultCollation = builder.defaultCollation; } /** Returns the dataset identity. */ @@ -459,6 +483,10 @@ public Long getDefaultPartitionExpirationMs() { return defaultPartitionExpirationMs; } + public String getDefaultCollation() { + return defaultCollation; + } + /** Returns a builder for the dataset object. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -481,6 +509,7 @@ public String toString() { .add("labels", labels) .add("defaultEncryptionConfiguration", defaultEncryptionConfiguration) .add("defaultPartitionExpirationMs", defaultPartitionExpirationMs) + .add("defaultCollation", defaultCollation) .toString(); } @@ -556,6 +585,9 @@ public Dataset.Access apply(Acl acl) { if (defaultPartitionExpirationMs != null) { datasetPb.setDefaultPartitionExpirationMs(defaultPartitionExpirationMs); } + if (defaultCollation != null) { + datasetPb.setDefaultCollation(defaultCollation); + } return datasetPb; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 928f379d63..e151b501ba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -63,6 +63,7 @@ public TableFieldSchema apply(Field field) { private final Long scale; private final Long precision; private final String defaultValueExpression; + private final String collation; /** * Mode for a BigQuery Table field. {@link Mode#NULLABLE} fields can be set to {@code null}, @@ -87,6 +88,7 @@ public static final class Builder { private Long scale; private Long precision; private String defaultValueExpression; + private String collation; private Builder() {} @@ -101,6 +103,7 @@ private Builder(Field field) { this.scale = field.scale; this.precision = field.precision; this.defaultValueExpression = field.defaultValueExpression; + this.collation = field.collation; } /** @@ -285,6 +288,19 @@ public Builder setDefaultValueExpression(String defaultValueExpression) { return this; } + /** + * Optional. Field collation can be set only when the type of field is STRING. The following + * values are supported: + * + *

    * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to + * case-sensitive behavior. (-- A wrapper is used here because it is possible to set the value + * to the empty string. --) + */ + public Builder setCollation(String collation) { + this.collation = collation; + return this; + } + /** Creates a {@code Field} object. */ public Field build() { return new Field(this); @@ -302,6 +318,7 @@ private Field(Builder builder) { this.scale = builder.scale; this.precision = builder.precision; this.defaultValueExpression = builder.defaultValueExpression; + this.collation = builder.collation; } /** Returns the field name. */ @@ -357,6 +374,10 @@ public String getDefaultValueExpression() { return defaultValueExpression; } + public String getCollation() { + return collation; + } + /** * Returns the list of sub-fields if {@link #getType()} is a {@link LegacySQLTypeName#RECORD}. * Returns {@code null} otherwise. @@ -382,6 +403,7 @@ public String toString() { .add("scale", scale) .add("precision", precision) .add("defaultValueExpression", defaultValueExpression) + .add("collation", collation) .toString(); } @@ -468,6 +490,9 @@ TableFieldSchema toPb() { List fieldsPb = Lists.transform(getSubFields(), TO_PB_FUNCTION); fieldSchemaPb.setFields(fieldsPb); } + if (collation != null) { + fieldSchemaPb.setCollation(collation); + } return fieldSchemaPb; } @@ -500,6 +525,9 @@ static Field fromPb(TableFieldSchema fieldSchemaPb) { ? FieldList.of(Lists.transform(fieldSchemaPb.getFields(), FROM_PB_FUNCTION)) : null; fieldBuilder.setType(LegacySQLTypeName.valueOf(fieldSchemaPb.getType()), subFields); + if (fieldSchemaPb.getCollation() != null) { + fieldBuilder.setCollation(fieldSchemaPb.getCollation()); + } return fieldBuilder.build(); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index 5e1f1a2c03..8303566d2a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -156,6 +156,12 @@ public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { return this; } + @Override + public Builder setDefaultCollation(String defaultCollation) { + infoBuilder.setDefaultCollation(defaultCollation); + return this; + } + @Override public Table build() { return new Table(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index d3e58f9802..cfe7003006 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -72,6 +72,7 @@ public Table apply(TableInfo tableInfo) { private final EncryptionConfiguration encryptionConfiguration; private final Labels labels; private final Boolean requirePartitionFilter; + private final String defaultCollation; /** A builder for {@code TableInfo} objects. */ public abstract static class Builder { @@ -135,6 +136,8 @@ public abstract static class Builder { public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { return this; } + + public abstract Builder setDefaultCollation(String defaultCollation); } static class BuilderImpl extends Builder { @@ -155,6 +158,7 @@ static class BuilderImpl extends Builder { private EncryptionConfiguration encryptionConfiguration; private Labels labels = Labels.ZERO; private Boolean requirePartitionFilter; + private String defaultCollation; BuilderImpl() {} @@ -175,6 +179,7 @@ static class BuilderImpl extends Builder { this.encryptionConfiguration = tableInfo.encryptionConfiguration; this.labels = tableInfo.labels; this.requirePartitionFilter = tableInfo.requirePartitionFilter; + this.defaultCollation = tableInfo.defaultCollation; } BuilderImpl(Table tablePb) { @@ -199,6 +204,7 @@ static class BuilderImpl extends Builder { } this.labels = Labels.fromPb(tablePb.getLabels()); this.requirePartitionFilter = tablePb.getRequirePartitionFilter(); + this.defaultCollation = tablePb.getDefaultCollation(); } @Override @@ -297,6 +303,12 @@ public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { return this; } + @Override + public Builder setDefaultCollation(String defaultCollation) { + this.defaultCollation = defaultCollation; + return this; + } + @Override public TableInfo build() { return new TableInfo(this); @@ -318,8 +330,9 @@ public TableInfo build() { this.numRows = builder.numRows; this.definition = builder.definition; this.encryptionConfiguration = builder.encryptionConfiguration; - labels = builder.labels; + this.labels = builder.labels; this.requirePartitionFilter = builder.requirePartitionFilter; + this.defaultCollation = builder.defaultCollation; } /** Returns the hash of the table resource. */ @@ -422,6 +435,10 @@ public Boolean getRequirePartitionFilter() { return requirePartitionFilter; } + public String getDefaultCollation() { + return defaultCollation; + } + /** Returns a builder for the table object. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -446,6 +463,7 @@ public String toString() { .add("encryptionConfiguration", encryptionConfiguration) .add("labels", labels) .add("requirePartitionFilter", requirePartitionFilter) + .add("defaultCollation", defaultCollation) .toString(); } @@ -507,6 +525,9 @@ Table toPb() { } tablePb.setLabels(labels.toPb()); tablePb.setRequirePartitionFilter(requirePartitionFilter); + if (defaultCollation != null) { + tablePb.setDefaultCollation(defaultCollation); + } return tablePb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 52cb208c69..39cfa529ca 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1186,6 +1186,98 @@ public void testCreateTableWithConstraints() { bigquery.delete(tableId); } + @Test + public void testCreateDatasetWithDefaultCollation() { + String collationDataset = "collation_dataset"; + DatasetInfo info = + DatasetInfo.newBuilder(collationDataset) + .setDescription(DESCRIPTION) + .setDefaultCollation("und:ci") + .setLabels(LABELS) + .build(); + bigquery.create(info); + + Dataset dataset = bigquery.getDataset(DatasetId.of(collationDataset)); + assertEquals("und:ci", dataset.getDefaultCollation()); + + RemoteBigQueryHelper.forceDelete(bigquery, collationDataset); + } + + @Test + public void testCreateTableWithDefaultCollation() { + String tableName = "test_create_table_with_default_collation"; + TableId tableId = TableId.of(DATASET, tableName); + Field stringFieldWithoutCollation = + Field.newBuilder("stringFieldWithoutDefaultCollation", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("String field") + .setMaxLength(150L) + .build(); + + Schema schema = Schema.of(stringFieldWithoutCollation); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(schema).build(); + TableInfo tableInfo = + TableInfo.newBuilder(tableId, tableDefinition).setDefaultCollation("und:ci").build(); + + // Create table with default collation but fields do not have collation. + Table createdTable = bigquery.create(tableInfo); + assertNotNull(createdTable); + + // Fetch the created table and its metadata + // to verify default collation is assigned to fields + Table remoteTable = bigquery.getTable(DATASET, tableName); + Schema remoteSchema = remoteTable.getDefinition().getSchema(); + // Schema should not be equal because default collation has been added to the fields. + assertNotEquals(schema, remoteSchema); + assertEquals("und:ci", remoteTable.getDefaultCollation()); + FieldList fieldList = remoteSchema.getFields(); + for (Field field : fieldList) { + if (field.getName().equals("stringFieldWithoutDefaultCollation")) { + assertEquals("und:ci", field.getCollation()); + } + } + + bigquery.delete(tableId); + } + + @Test + public void testCreateFieldWithDefaultCollation() { + String tableName = "test_create_field_with_default_collation"; + TableId tableId = TableId.of(DATASET, tableName); + Field stringFieldWithCollation = + Field.newBuilder("stringFieldWithDefaultCollation", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("String field") + .setCollation("und:ci") + .setMaxLength(150L) + .build(); + + Schema schema = Schema.of(stringFieldWithCollation); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(schema).build(); + TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); + + // Create table with not default collation and fields that have collation + Table createdTable = bigquery.create(tableInfo); + assertNotNull(createdTable); + + // Fetch the created table and its metadata + // to verify collation is assigned to fields + Table remoteTable = bigquery.getTable(DATASET, tableName); + Schema remoteSchema = remoteTable.getDefinition().getSchema(); + // Schema should be equal because collation has been added to the fields. + assertEquals(schema, remoteSchema); + assertEquals(null, remoteTable.getDefaultCollation()); + FieldList fieldList = remoteSchema.getFields(); + for (Field field : fieldList) { + if (field.getName().equals("stringFieldWithoutDefaultCollation")) { + assertEquals("und:ci", field.getCollation()); + } + } + bigquery.delete(tableId); + } + @Test public void testCreateTableWithDefaultValueExpression() { String tableName = "test_create_table_with_default_value_expression"; From 9363f978d74912f12957e816708feeaf4776442b Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 27 Jan 2023 10:32:50 -0500 Subject: [PATCH 1087/2268] chore: fix dataset deletion in test (#2494) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: fix dataset deletion in test * 🦉 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 --- README.md | 2 +- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8d80a84706..32c592167a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.4.0') +implementation platform('com.google.cloud:libraries-bom:26.5.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 39cfa529ca..c277a75d82 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1188,7 +1188,7 @@ public void testCreateTableWithConstraints() { @Test public void testCreateDatasetWithDefaultCollation() { - String collationDataset = "collation_dataset"; + String collationDataset = RemoteBigQueryHelper.generateDatasetName(); DatasetInfo info = DatasetInfo.newBuilder(collationDataset) .setDescription(DESCRIPTION) From 5a02a9072b979f10ca7b08d988be1c3f1ff53203 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:55:34 +0000 Subject: [PATCH 1088/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.11.0 (#2481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.11.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 12816f4605..56bdd26d0f 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.10.0 + 2.11.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 630e4ae196..5eb5bf18b8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.10.0 + 2.11.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1a6a2ed963..48fd7d6b92 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.10.0 + 2.11.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d1b340a7b2..ea14f5d979 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.10.0 + 2.11.0 test From e6ffb9b594e3bb680c4904f822c39653d626c4d3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:55:55 +0000 Subject: [PATCH 1089/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.11.0 (#2482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.11.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 56bdd26d0f..3b043d7d33 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.10.0 + 2.11.0 test From 5c2bf69b227ca4efb55b42c06a747426183f8ae5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:56:15 +0000 Subject: [PATCH 1090/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.15.0 (#2483) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.15.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3b043d7d33..64a32d95c7 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.14.0 + 1.15.0 pom import From dceeaa08bc4c540ba20dd4438b256aa4ae6d0912 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:56:32 +0000 Subject: [PATCH 1091/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.21.0 (#2484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.21.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32c592167a..d948e6b82b 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.20.2 + 2.21.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5eb5bf18b8..4c22fbebba 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.20.2 + 2.21.0 From 3bf5ffc54bacf94774b7cba9a8523d35d9d8496f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:56:55 +0000 Subject: [PATCH 1092/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.2 (#2486) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4c22fbebba..92aecb92ed 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.18.1 + 2.18.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 48fd7d6b92..010d2c1e2d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.18.1 + 2.18.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ea14f5d979..3f7a858df9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.18.1 + 2.18.2 test From d638d5eed12058b6296396a807d8b3bb14fb2803 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Jan 2023 18:57:15 +0000 Subject: [PATCH 1093/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.5.0 (#2492) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.5.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d948e6b82b..a1dfe4b043 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.4.0 + 26.5.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 3c6935a907..eb7f66736c 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.4.0 + 26.5.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3f7a858df9..1afddfd99e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.4.0 + 26.5.0 pom import From 6b7c0a9780a72cff1250253b8d20ae889941a295 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 1 Feb 2023 15:46:11 -0500 Subject: [PATCH 1094/2268] chore: fix named query parameter struct tests (#2504) Fixes #2485 Fixes #2496 Fixes #2498 Fixes #2497 --- .kokoro/build.sh | 6 ++-- .../cloud/bigquery/it/ITBigQueryTest.java | 29 ++++++++----------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 0c26eec01a..525dbaa62b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,7 +61,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITBigQueryTest,ITRemoteUDFTest \ + -Dtest=ITBigQueryTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -82,12 +82,12 @@ nightly-it) ;; graalvm) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; graalvm17) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; nightly-graalvm) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c277a75d82..69c69f1718 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3956,7 +3956,7 @@ public void testStructNamedQueryParameters() throws InterruptedException { struct.put("integerField", integerValue); struct.put("stringField", stringValue); QueryParameterValue recordValue = QueryParameterValue.struct(struct); - String query = "SELECT STRUCT(@recordField) AS record"; + String query = "SELECT @recordField AS record"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query) .setDefaultDataset(DATASET) @@ -3967,9 +3967,7 @@ public void testStructNamedQueryParameters() throws InterruptedException { assertEquals(1, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { - for (FieldValue record : value.getRecordValue()) { - assertsFieldValue(record); - } + assertsFieldValue(value); } } } @@ -4017,7 +4015,7 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { structValue.put("string", stringValue); structValue.put("struct", recordValue); QueryParameterValue nestedRecordField = QueryParameterValue.struct(structValue); - String query = "SELECT STRUCT(@nestedRecordField) AS record"; + String query = "SELECT @nestedRecordField AS record"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query) .setDefaultDataset(DATASET) @@ -4028,18 +4026,15 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { assertEquals(1, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { - assertEquals(FieldValue.Attribute.RECORD, value.getAttribute()); - for (FieldValue record : value.getRecordValue()) { - assertEquals( - true, record.getRecordValue().get(0).getRecordValue().get(0).getBooleanValue()); - assertEquals(10, record.getRecordValue().get(0).getRecordValue().get(1).getLongValue()); - assertEquals( - "test-stringField", - record.getRecordValue().get(0).getRecordValue().get(2).getStringValue()); - assertEquals(true, record.getRecordValue().get(1).getBooleanValue()); - assertEquals("test-stringField", record.getRecordValue().get(2).getStringValue()); - assertEquals(10, record.getRecordValue().get(3).getLongValue()); - } + assertEquals(Attribute.RECORD, value.getAttribute()); + assertEquals(true, value.getRecordValue().get(0).getRecordValue().get(0).getBooleanValue()); + assertEquals(10, value.getRecordValue().get(0).getRecordValue().get(1).getLongValue()); + assertEquals( + "test-stringField", + value.getRecordValue().get(0).getRecordValue().get(2).getStringValue()); + assertEquals(true, value.getRecordValue().get(1).getBooleanValue()); + assertEquals("test-stringField", value.getRecordValue().get(2).getStringValue()); + assertEquals(10, value.getRecordValue().get(3).getLongValue()); } } } From 2a3d07cd7c51b2a62b33a7aa9b28b08ccb7461ab Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:00:31 +0000 Subject: [PATCH 1095/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.6.0 (#2507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.6.0 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a1dfe4b043..f6391253aa 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.5.0 + 26.6.0 pom import @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.5.0') +implementation platform('com.google.cloud:libraries-bom:26.6.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index eb7f66736c..3206ba2460 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.5.0 + 26.6.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1afddfd99e..cd9ac14e27 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.5.0 + 26.6.0 pom import From 0a99673c12fbb9cdf8d0a550dc4cbac72c355145 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:00:49 +0000 Subject: [PATCH 1096/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.12.0 (#2511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.12.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 64a32d95c7..7dc9aede8c 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.11.0 + 2.12.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 92aecb92ed..10da02933a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.11.0 + 2.12.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 010d2c1e2d..e8698abd2a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.11.0 + 2.12.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cd9ac14e27..c9320c15d3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.11.0 + 2.12.0 test From 6793175eda5778aee731c7f4b901b92108068109 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:02:55 +0000 Subject: [PATCH 1097/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.4 (#2500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.18.4 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 10da02933a..3ed939c6b1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.18.2 + 2.18.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e8698abd2a..ed89f51fa7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.18.2 + 2.18.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c9320c15d3..d70de3027e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.18.2 + 2.18.4 test From 09f280d15389838dcc7ff9d8c1f485041559051e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:03:51 +0000 Subject: [PATCH 1098/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.12.0 (#2512) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.12.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7dc9aede8c..53d3430683 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.11.0 + 2.12.0 test From 02832ddcb62d4701cd3568eae806586917b359b5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:16:15 +0000 Subject: [PATCH 1099/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 (#2513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/google-cloud-java) | `3.1.2` -> `3.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.2.0/compatibility-slim/3.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.2.0/confidence-slim/3.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 53d3430683..de43a8292c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20230114-2.0.0 - 3.1.2 + 3.2.0 10.0.1 From c0a393ca3aae372dd42477c9b54bd785fc17ab20 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:56:13 +0000 Subject: [PATCH 1100/2268] deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.31.0 (#2499) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deps: update dependency com.google.cloud:google-cloud-storage to v2.18.0 deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.16.0 [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.17.2` -> `2.18.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.18.0/compatibility-slim/2.17.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.18.0/confidence-slim/2.17.2)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.15.0` -> `1.16.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.16.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.16.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.16.0/compatibility-slim/1.15.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.16.0/confidence-slim/1.15.0)](https://docs.renovatebot.com/merge-confidence/) | | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.28.3` -> `2.31.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.31.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.31.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.31.0/compatibility-slim/2.28.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.31.0/confidence-slim/2.28.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

    googleapis/java-storage ### [`v2.18.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2180-httpsgithubcomgoogleapisjava-storagecomparev2172v2180-2023-02-06) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.17.2...v2.18.0) ##### Features - Add Storage.BlobWriteOption.{meta,}generation{Not,}Match(long) methods to allow literal value construction ([#​1875](https://togithub.com/googleapis/java-storage/issues/1875)) ([a9fab09](https://togithub.com/googleapis/java-storage/commit/a9fab098e23c93887f0aae8a5de6e3477d5f0f0c)) - Setting up 2.15.x ([#​1880](https://togithub.com/googleapis/java-storage/issues/1880)) ([1c88e83](https://togithub.com/googleapis/java-storage/commit/1c88e83974798d39a63ea4dd85d8f5bb9cb8f88c)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#​1886](https://togithub.com/googleapis/java-storage/issues/1886)) ([6928556](https://togithub.com/googleapis/java-storage/commit/6928556f0a0a61e8c68d9bf98403ce5b27a3bee2))
    googleapis/java-bigquerystorage ### [`v2.31.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2310-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2300v2310-2023-02-08) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.30.0...v2.31.0) ##### Features - Add isDone to JsonWriter to indicate a JsonWriter is no longer usable and needs to be recreated. ([#​1978](https://togithub.com/googleapis/java-bigquerystorage/issues/1978)) ([dc07ed8](https://togithub.com/googleapis/java-bigquerystorage/commit/dc07ed84778028f149cab3883af9bb9a7929efd1)) - Add isUserClosed to indicate that user explicitly closed the StreamWriter ([#​1983](https://togithub.com/googleapis/java-bigquerystorage/issues/1983)) ([abd6627](https://togithub.com/googleapis/java-bigquerystorage/commit/abd66274abca2315739c1b388dd363e107baad85)) ##### Dependencies - Update arrow.version to v11 (major) ([#​1961](https://togithub.com/googleapis/java-bigquerystorage/issues/1961)) ([c13ab23](https://togithub.com/googleapis/java-bigquerystorage/commit/c13ab23a96d72d5087653ebaf0a0635863a526a9)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.21.0 ([#​1956](https://togithub.com/googleapis/java-bigquerystorage/issues/1956)) ([6a1d783](https://togithub.com/googleapis/java-bigquerystorage/commit/6a1d783b80bdd0e1846ee667e2a15d41e3f6980f)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#​1974](https://togithub.com/googleapis/java-bigquerystorage/issues/1974)) ([8e2c1e3](https://togithub.com/googleapis/java-bigquerystorage/commit/8e2c1e326d6a65ba814ef826cfcb98c58395f01f)) - Update dependency org.apache.arrow:arrow-memory-netty to v11 ([#​1962](https://togithub.com/googleapis/java-bigquerystorage/issues/1962)) ([48abc75](https://togithub.com/googleapis/java-bigquerystorage/commit/48abc75cdd2c372751790c197b83cf3aa59f1055)) - Update dependency org.apache.arrow:arrow-vector to v11 ([#​1963](https://togithub.com/googleapis/java-bigquerystorage/issues/1963)) ([e872723](https://togithub.com/googleapis/java-bigquerystorage/commit/e87272323a0267771f3ffbc857fbaf06c6656f90)) ### [`v2.30.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2300-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2290v2300-2023-02-06) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.29.0...v2.30.0) ##### Features - Add userClose flag back to StreamWriter ([#​1973](https://togithub.com/googleapis/java-bigquerystorage/issues/1973)) ([4b51acd](https://togithub.com/googleapis/java-bigquerystorage/commit/4b51acd49292d99e1c3cd670bec695b8bcd3b5c4)) ##### Bug Fixes - Close stream connection before each retry ([#​1975](https://togithub.com/googleapis/java-bigquerystorage/issues/1975)) ([54e9bb9](https://togithub.com/googleapis/java-bigquerystorage/commit/54e9bb9116eb9781b6f2266f98de4d3853a469b8)) - Improve ConnectionWorker fine logging ([#​1972](https://togithub.com/googleapis/java-bigquerystorage/issues/1972)) ([812bcf1](https://togithub.com/googleapis/java-bigquerystorage/commit/812bcf16efdc7a1797435f0b87430c35f27f7245)) ### [`v2.29.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2290-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2284v2290-2023-02-01) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.28.4...v2.29.0) ##### Features - Add timeout to inflight queue waiting ([#​1957](https://togithub.com/googleapis/java-bigquerystorage/issues/1957)) ([3159b12](https://togithub.com/googleapis/java-bigquerystorage/commit/3159b120e5cd388cf9776a1fa928a3e6ae105d9d)) - Allow java client to handle schema change during same stream name ([#​1964](https://togithub.com/googleapis/java-bigquerystorage/issues/1964)) ([305f71e](https://togithub.com/googleapis/java-bigquerystorage/commit/305f71ee4b274df58388fc3000e9f5da9fc908e1)) ##### Bug Fixes - At connection level, retry for internal errors ([#​1965](https://togithub.com/googleapis/java-bigquerystorage/issues/1965)) ([9c01bc1](https://togithub.com/googleapis/java-bigquerystorage/commit/9c01bc11b51dc1e3e209e4d6b666b9ddd3212cf5)) - Reduce visibility of the ConnectionPool and ConnectionWorker, so… ([#​1954](https://togithub.com/googleapis/java-bigquerystorage/issues/1954)) ([dcb234b](https://togithub.com/googleapis/java-bigquerystorage/commit/dcb234b95d0812d4d91b0c206d0b7e0fb30ab0fa)) - Remove unrecoverable connection from connection pool during multiplexing ([#​1967](https://togithub.com/googleapis/java-bigquerystorage/issues/1967)) ([091dddb](https://togithub.com/googleapis/java-bigquerystorage/commit/091dddb9b2baf1f4b481e8d7961d451b71a8508b)) ### [`v2.28.4`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2284-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2283v2284-2023-01-25) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.28.3...v2.28.4) ##### Bug Fixes - Fix one potential root cause of deadlock in connection worker ([#​1955](https://togithub.com/googleapis/java-bigquerystorage/issues/1955)) ([598ce5e](https://togithub.com/googleapis/java-bigquerystorage/commit/598ce5eb5e8d5efaaa841495794be4d39c6c0fce))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index de43a8292c..5970b4b330 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.28.3 + 2.31.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.15.0 + 1.16.0 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.17.2 + 2.18.0 test From 94ed06089239a0df0ffebf7f8470a38c16be95bf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Feb 2023 19:58:14 +0000 Subject: [PATCH 1101/2268] deps: update arrow.version to v11 (major) (#2495) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.1` -> `11.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/11.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/11.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/11.0.0/compatibility-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/11.0.0/confidence-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.1` -> `11.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/11.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/11.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/11.0.0/compatibility-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/11.0.0/confidence-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `10.0.1` -> `11.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/11.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/11.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/11.0.0/compatibility-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/11.0.0/confidence-slim/10.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5970b4b330..cd510bac72 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ google-cloud-bigquery-parent v2-rev20230114-2.0.0 3.2.0 - 10.0.1 + 11.0.0
    From cca93a223a9b935bc75d19ddf38023637e4ec3d9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 21:56:13 +0000 Subject: [PATCH 1102/2268] chore(main): release 2.22.0 (#2491) :robot: I have created a release *beep* *boop* --- ## [2.22.0](https://togithub.com/googleapis/java-bigquery/compare/v2.21.0...v2.22.0) (2023-02-08) ### Features * Add collation for Case sensitive string column ([#2490](https://togithub.com/googleapis/java-bigquery/issues/2490)) ([3257737](https://togithub.com/googleapis/java-bigquery/commit/325773757e811172236eb3221926025b82f5db64)) ### Dependencies * Update arrow.version to v11 (major) ([#2495](https://togithub.com/googleapis/java-bigquery/issues/2495)) ([94ed060](https://togithub.com/googleapis/java-bigquery/commit/94ed06089239a0df0ffebf7f8470a38c16be95bf)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.11.0 ([#2482](https://togithub.com/googleapis/java-bigquery/issues/2482)) ([e6ffb9b](https://togithub.com/googleapis/java-bigquery/commit/e6ffb9b594e3bb680c4904f822c39653d626c4d3)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.12.0 ([#2512](https://togithub.com/googleapis/java-bigquery/issues/2512)) ([09f280d](https://togithub.com/googleapis/java-bigquery/commit/09f280d15389838dcc7ff9d8c1f485041559051e)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.31.0 ([#2499](https://togithub.com/googleapis/java-bigquery/issues/2499)) ([c0a393c](https://togithub.com/googleapis/java-bigquery/commit/c0a393ca3aae372dd42477c9b54bd785fc17ab20)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.15.0 ([#2483](https://togithub.com/googleapis/java-bigquery/issues/2483)) ([5c2bf69](https://togithub.com/googleapis/java-bigquery/commit/5c2bf69b227ca4efb55b42c06a747426183f8ae5)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#2513](https://togithub.com/googleapis/java-bigquery/issues/2513)) ([02832dd](https://togithub.com/googleapis/java-bigquery/commit/02832ddcb62d4701cd3568eae806586917b359b5)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c58633bf48..3c7bceabcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.22.0](https://github.com/googleapis/java-bigquery/compare/v2.21.0...v2.22.0) (2023-02-08) + + +### Features + +* Add collation for Case sensitive string column ([#2490](https://github.com/googleapis/java-bigquery/issues/2490)) ([3257737](https://github.com/googleapis/java-bigquery/commit/325773757e811172236eb3221926025b82f5db64)) + + +### Dependencies + +* Update arrow.version to v11 (major) ([#2495](https://github.com/googleapis/java-bigquery/issues/2495)) ([94ed060](https://github.com/googleapis/java-bigquery/commit/94ed06089239a0df0ffebf7f8470a38c16be95bf)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.11.0 ([#2482](https://github.com/googleapis/java-bigquery/issues/2482)) ([e6ffb9b](https://github.com/googleapis/java-bigquery/commit/e6ffb9b594e3bb680c4904f822c39653d626c4d3)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.12.0 ([#2512](https://github.com/googleapis/java-bigquery/issues/2512)) ([09f280d](https://github.com/googleapis/java-bigquery/commit/09f280d15389838dcc7ff9d8c1f485041559051e)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.31.0 ([#2499](https://github.com/googleapis/java-bigquery/issues/2499)) ([c0a393c](https://github.com/googleapis/java-bigquery/commit/c0a393ca3aae372dd42477c9b54bd785fc17ab20)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.15.0 ([#2483](https://github.com/googleapis/java-bigquery/issues/2483)) ([5c2bf69](https://github.com/googleapis/java-bigquery/commit/5c2bf69b227ca4efb55b42c06a747426183f8ae5)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#2513](https://github.com/googleapis/java-bigquery/issues/2513)) ([02832dd](https://github.com/googleapis/java-bigquery/commit/02832ddcb62d4701cd3568eae806586917b359b5)) + ## [2.21.0](https://github.com/googleapis/java-bigquery/compare/v2.20.2...v2.21.0) (2023-01-23) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f5e2426d67..e10dd137fc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.21.1-SNAPSHOT + 2.22.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ad82b14fc1..746402f62f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.21.1-SNAPSHOT + 2.22.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.21.1-SNAPSHOT + 2.22.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cd510bac72..6c4766ee17 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.21.1-SNAPSHOT + 2.22.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.21.1-SNAPSHOT + 2.22.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ed89f51fa7..b1adbf2d23 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.21.1-SNAPSHOT + 2.22.0 diff --git a/versions.txt b/versions.txt index a84c62037e..53dbb595a2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.21.0:2.21.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.22.0:2.22.0 \ No newline at end of file From 3c433070c47169ec529f03f2d517c227b40c19d6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 22:28:11 +0000 Subject: [PATCH 1103/2268] chore(main): release 2.22.1-SNAPSHOT (#2515) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e10dd137fc..bca0b8ae5a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.22.0 + 2.22.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 746402f62f..74c1d14bfa 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.22.0 + 2.22.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.22.0 + 2.22.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6c4766ee17..9c425e9a50 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.22.0 + 2.22.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.22.0 + 2.22.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b1adbf2d23..930b63e417 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.22.0 + 2.22.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 53dbb595a2..e739f30978 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.22.0:2.22.0 \ No newline at end of file +google-cloud-bigquery:2.22.0:2.22.1-SNAPSHOT \ No newline at end of file From 712dada2bbef60828315c781865d9290cd4dde1a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 14:59:25 -0500 Subject: [PATCH 1104/2268] build(deps): bump cryptography from 38.0.3 to 39.0.1 in /synthtool/gcp/templates/java_library/.kokoro (#1761) (#2520) * build(deps): bump cryptography Bumps [cryptography](https://github.com/pyca/cryptography) from 38.0.3 to 39.0.1. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/38.0.3...39.0.1) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... * chore: disabling dependabot --------- Source-Link: https://github.com/googleapis/synthtool/commit/0c6f8d4ac5358553ee734e26574f390bc43a736e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:5ee35ee919254a3d1e7d4f8abbf1b8c8869ade317ceb2e4df709af1b4b3e9ca1 Signed-off-by: dependabot[bot] Co-authored-by: Owl Bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tomo Suzuki Co-authored-by: ddixit14 --- .github/.OwlBot.lock.yaml | 2 +- .github/dependabot.yml | 14 +++++++++++ .kokoro/requirements.txt | 53 ++++++++++++++++----------------------- README.md | 6 ++--- 4 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f8a8575314..090264303f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bd5071596a47614d1fe15eb766c4255bae330f823b606e1196a3b0c8d2e96fd1 + digest: sha256:5ee35ee919254a3d1e7d4f8abbf1b8c8869ade317ceb2e4df709af1b4b3e9ca1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..c8f413b0da --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + open-pull-requests-limit: 0 + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 4895c9631f..cfadd22ce9 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -97,33 +97,28 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 +cryptography==39.0.1 \ + --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ + --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ + --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ + --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ + --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ + --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ + --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ + --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ + --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ + --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ + --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ + --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ + --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ + --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ + --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ + --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ + --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ + --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ + --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ + --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ + --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 # via # gcp-releasetool # secretstorage @@ -379,10 +374,6 @@ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring -setuptools==65.6.3 \ - --hash=sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54 \ - --hash=sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75 - # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 diff --git a/README.md b/README.md index f6391253aa..dc58898af6 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.6.0') +implementation platform('com.google.cloud:libraries-bom:26.7.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.21.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.22.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.21.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.22.0" ``` ## Authentication From 747d01deb0c8b014bb1519378a8e9657dc647cc9 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 13 Feb 2023 15:39:23 -0500 Subject: [PATCH 1105/2268] chore: move graalVM checks to continuous build (#2522) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: move graalVM checks to continuous build * chore: remove graalvm checks from required checks * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * enable flakybot for graalvm checks --------- Co-authored-by: Owl Bot --- .github/sync-repo-settings.yaml | 4 --- .kokoro/build.sh | 6 ++-- .kokoro/continuous/graalvm-native-17.cfg | 38 ++++++++++++++++++++++++ .kokoro/continuous/graalvm-native.cfg | 38 ++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 .kokoro/continuous/graalvm-native-17.cfg create mode 100644 .kokoro/continuous/graalvm-native.cfg diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index e3a8af4e90..223b72e8a6 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -17,8 +17,6 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor - - 'Kokoro - Test: Java GraalVM Native Image' - - 'Kokoro - Test: Java 17 GraalVM Native Image' - pattern: 1.127.12-sp isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -94,8 +92,6 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor - - 'Kokoro - Test: Java GraalVM Native Image' - - 'Kokoro - Test: Java 17 GraalVM Native Image' permissionRules: - team: api-bigquery permission: admin diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 525dbaa62b..0c26eec01a 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,7 +61,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITBigQueryTest \ + -Dtest=ITBigQueryTest,ITRemoteUDFTest \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -82,12 +82,12 @@ nightly-it) ;; graalvm) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; graalvm17) # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test RETURN_CODE=$? ;; nightly-graalvm) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg new file mode 100644 index 0000000000..9c1849588c --- /dev/null +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm17" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg new file mode 100644 index 0000000000..de44999b8e --- /dev/null +++ b/.kokoro/continuous/graalvm-native.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file From 59b933ef6324494dfc4c9b7a77b749dc72123b8c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 13 Feb 2023 20:40:55 +0000 Subject: [PATCH 1106/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.7.0 (#2518) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.7.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dc58898af6..6a865c912f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.6.0 + 26.7.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 3206ba2460..abf6496356 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.6.0 + 26.7.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d70de3027e..36754f625e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.6.0 + 26.7.0 pom import From e431c17efe0f69d084f119463ca8bdb25047a7fe Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 14 Feb 2023 14:02:53 -0500 Subject: [PATCH 1107/2268] feat: add support for session_id in load jobs (#2519) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add support for session_id in load jobs * chore: fix variable change * 🦉 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 --- .../cloud/bigquery/LoadJobConfiguration.java | 47 ++++++++++++++++- .../bigquery/LoadJobConfigurationTest.java | 13 +++++ .../cloud/bigquery/it/ITBigQueryTest.java | 50 +++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index ee142be010..321d542a67 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -22,6 +22,7 @@ import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import java.util.List; import java.util.Map; @@ -58,6 +59,10 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final HivePartitioningOptions hivePartitioningOptions; private final String referenceFileSchemaUri; + private final List connectionProperties; + + private final Boolean createSession; + public static final class Builder extends JobConfiguration.Builder implements LoadConfiguration.Builder { @@ -83,6 +88,8 @@ public static final class Builder extends JobConfiguration.Builder connectionProperties; + private Boolean createSession; private Builder() { super(Type.LOAD); @@ -112,6 +119,8 @@ private Builder(LoadJobConfiguration loadConfiguration) { this.rangePartitioning = loadConfiguration.rangePartitioning; this.hivePartitioningOptions = loadConfiguration.hivePartitioningOptions; this.referenceFileSchemaUri = loadConfiguration.referenceFileSchemaUri; + this.connectionProperties = loadConfiguration.connectionProperties; + this.createSession = loadConfiguration.createSession; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -205,6 +214,13 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getReferenceFileSchemaUri() != null) { this.referenceFileSchemaUri = loadConfigurationPb.getReferenceFileSchemaUri(); } + if (loadConfigurationPb.getConnectionProperties() != null) { + + this.connectionProperties = + Lists.transform( + loadConfigurationPb.getConnectionProperties(), ConnectionProperty.FROM_PB_FUNCTION); + } + createSession = loadConfigurationPb.getCreateSession(); } @Override @@ -368,6 +384,16 @@ public Builder setReferenceFileSchemaUri(String referenceFileSchemaUri) { return this; } + public Builder setConnectionProperties(List connectionProperties) { + this.connectionProperties = ImmutableList.copyOf(connectionProperties); + return this; + } + + public Builder setCreateSession(Boolean createSession) { + this.createSession = createSession; + return this; + } + @Override public LoadJobConfiguration build() { return new LoadJobConfiguration(this); @@ -397,6 +423,8 @@ private LoadJobConfiguration(Builder builder) { this.rangePartitioning = builder.rangePartitioning; this.hivePartitioningOptions = builder.hivePartitioningOptions; this.referenceFileSchemaUri = builder.referenceFileSchemaUri; + this.connectionProperties = builder.connectionProperties; + this.createSession = builder.createSession; } @Override @@ -520,6 +548,14 @@ public String getReferenceFileSchemaUri() { return referenceFileSchemaUri; } + public List getConnectionProperties() { + return connectionProperties; + } + + public Boolean getCreateSession() { + return createSession; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -548,7 +584,9 @@ ToStringHelper toStringHelper() { .add("jobTimeoutMs", jobTimeoutMs) .add("rangePartitioning", rangePartitioning) .add("hivePartitioningOptions", hivePartitioningOptions) - .add("referenceFileSchemaUri", referenceFileSchemaUri); + .add("referenceFileSchemaUri", referenceFileSchemaUri) + .add("connectionProperties", connectionProperties) + .add("createSession", createSession); } @Override @@ -654,6 +692,13 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (referenceFileSchemaUri != null) { loadConfigurationPb.setReferenceFileSchemaUri(referenceFileSchemaUri); } + if (connectionProperties != null) { + loadConfigurationPb.setConnectionProperties( + Lists.transform(connectionProperties, ConnectionProperty.TO_PB_FUNCTION)); + } + if (createSession != null) { + loadConfigurationPb.setCreateSession(createSession); + } jobConfiguration.setLoad(loadConfigurationPb); return jobConfiguration; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index deed2f11b4..341965fb80 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -57,6 +57,8 @@ public class LoadJobConfigurationTest { private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA); private static final Boolean AUTODETECT = true; private static final Boolean USE_AVRO_LOGICAL_TYPES = true; + + private static final boolean CREATE_SESSION = true; private static final EncryptionConfiguration JOB_ENCRYPTION_CONFIGURATION = EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); private static final TimePartitioning TIME_PARTITIONING = TimePartitioning.of(Type.DAY); @@ -71,6 +73,13 @@ public class LoadJobConfigurationTest { RangePartitioning.newBuilder().setField("IntegerField").setRange(RANGE).build(); private static final String MODE = "STRING"; private static final String SOURCE_URI_PREFIX = "gs://bucket/path_to_table"; + + private static final String KEY = "session_id"; + private static final String VALUE = "session_id_1234567890"; + private static final ConnectionProperty CONNECTION_PROPERTY = + ConnectionProperty.newBuilder().setKey(KEY).setValue(VALUE).build(); + private static final List CONNECTION_PROPERTIES = + ImmutableList.of(CONNECTION_PROPERTY); private static final HivePartitioningOptions HIVE_PARTITIONING_OPTIONS = HivePartitioningOptions.newBuilder() .setMode(MODE) @@ -95,6 +104,8 @@ public class LoadJobConfigurationTest { .setRangePartitioning(RANGE_PARTITIONING) .setNullMarker("nullMarker") .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) + .setConnectionProperties(CONNECTION_PROPERTIES) + .setCreateSession(CREATE_SESSION) .build(); private static final DatastoreBackupOptions BACKUP_OPTIONS = @@ -253,5 +264,7 @@ private void compareLoadJobConfiguration( assertEquals(expected.getRangePartitioning(), value.getRangePartitioning()); assertEquals(expected.getNullMarker(), value.getNullMarker()); assertEquals(expected.getHivePartitioningOptions(), value.getHivePartitioningOptions()); + assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); + assertEquals(expected.getCreateSession(), value.getCreateSession()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 69c69f1718..0bbe1efdd1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3655,6 +3655,56 @@ public void testQuerySessionSupport() throws InterruptedException { assertEquals(sessionId, statisticsWithSession.getSessionInfo().getSessionId()); } + @Test + public void testLoadSessionSupport() throws InterruptedException { + // Start the session + TableId sessionTableId = TableId.of("_SESSION", "test_temp_destination_table"); + LoadJobConfiguration configuration = + LoadJobConfiguration.newBuilder( + sessionTableId, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(TABLE_SCHEMA) + .setCreateSession(true) + .build(); + Job job = bigquery.create(JobInfo.of(configuration)); + job = job.waitFor(); + assertNull(job.getStatus().getError()); + + Job loadJob = bigquery.getJob(job.getJobId()); + JobStatistics.LoadStatistics statistics = loadJob.getStatistics(); + String sessionId = statistics.getSessionInfo().getSessionId(); + assertNotNull(sessionId); + + // Load job in the same session. + // Should load the data to a temp table. + ConnectionProperty sessionConnectionProperty = + ConnectionProperty.newBuilder().setKey("session_id").setValue(sessionId).build(); + LoadJobConfiguration loadJobConfigurationWithSession = + LoadJobConfiguration.newBuilder( + sessionTableId, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(TABLE_SCHEMA) + .setConnectionProperties(ImmutableList.of(sessionConnectionProperty)) + .build(); + Job remoteJobWithSession = bigquery.create(JobInfo.of(loadJobConfigurationWithSession)); + remoteJobWithSession = remoteJobWithSession.waitFor(); + assertNull(remoteJobWithSession.getStatus().getError()); + Job queryJobWithSession = bigquery.getJob(remoteJobWithSession.getJobId()); + LoadStatistics statisticsWithSession = queryJobWithSession.getStatistics(); + assertNotNull(statisticsWithSession.getSessionInfo().getSessionId()); + + // Checking if the data loaded to the temp table in the session + String queryTempTable = "SELECT * FROM _SESSION.test_temp_destination_table;"; + QueryJobConfiguration queryJobConfigurationWithSession = + QueryJobConfiguration.newBuilder(queryTempTable) + .setConnectionProperties(ImmutableList.of(sessionConnectionProperty)) + .build(); + Job queryTempTableJob = bigquery.create(JobInfo.of(queryJobConfigurationWithSession)); + queryTempTableJob = queryTempTableJob.waitFor(); + assertNull(queryTempTableJob.getStatus().getError()); + assertNotNull(queryTempTableJob.getQueryResults()); + } + // TODO: uncomment this testcase when executeUpdate is implemented // @Test // public void testExecuteSelectWithSession() throws BigQuerySQLException { From f150bce869821a4cd7706e4c3f2ad38dec476be7 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 14 Feb 2023 14:03:13 -0500 Subject: [PATCH 1108/2268] chore: update SimpleApp sample code to use stackoverflow public dataset (#2523) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update SimpleApp sample code to use stackoverflow public dataset * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * sample checkstyle fix * chore: rename SimpleApp to App * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: revert file name change * chore: revert filename changes * 🦉 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 --- README.md | 2 +- .../java/com/example/bigquery/SimpleApp.java | 22 ++++++++----------- .../com/example/bigquery/SimpleAppIT.java | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6a865c912f..1883965cdf 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.7.0') +implementation platform('com.google.cloud:libraries-bom:26.8.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java index dfabf71f30..65ebbc241d 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java +++ b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java @@ -39,10 +39,12 @@ public static void main(String... args) throws Exception { // [START bigquery_simple_app_query] QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder( - "SELECT commit, author, repo_name " - + "FROM `bigquery-public-data.github_repos.commits` " - + "WHERE subject like '%bigquery%' " - + "ORDER BY subject DESC LIMIT 10") + "SELECT CONCAT('https://stackoverflow.com/questions/', " + + "CAST(id as STRING)) as url, view_count " + + "FROM `bigquery-public-data.stackoverflow.posts_questions` " + + "WHERE tags like '%google-bigquery%' " + + "ORDER BY view_count DESC " + + "LIMIT 10") // Use standard SQL syntax for queries. // See: https://cloud.google.com/bigquery/sql-reference/ .setUseLegacySql(false) @@ -72,15 +74,9 @@ public static void main(String... args) throws Exception { // Print all pages of the results. for (FieldValueList row : result.iterateAll()) { // String type - String commit = row.get("commit").getStringValue(); - // Record type - FieldValueList author = row.get("author").getRecordValue(); - String name = author.get("name").getStringValue(); - String email = author.get("email").getStringValue(); - // String Repeated type - String repoName = row.get("repo_name").getRecordValue().get(0).getStringValue(); - System.out.printf( - "Repo name: %s Author name: %s email: %s commit: %s\n", repoName, name, email, commit); + String url = row.get("url").getStringValue(); + String viewCount = row.get("view_count").getStringValue(); + System.out.printf("%s : %s views\n", url, viewCount); } // [END bigquery_simple_app_print] } diff --git a/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java b/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java index 5ac54beebb..cfb77f1079 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java @@ -58,6 +58,6 @@ public void tearDown() { public void testQuickstart() throws Exception { SimpleApp.main(); String got = bout.toString(); - assertThat(got).contains("Repo name:"); + assertThat(got).contains("https://stackoverflow.com/questions/"); } } From 23ed39fa5d0015ed829303fcc567cc7577ab6c6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:45:20 -0500 Subject: [PATCH 1109/2268] build(deps): update releasetool version for release scripts (#1768) (#2536) This should fix release script reporting back to the release PRs Source-Link: https://github.com/googleapis/synthtool/commit/4c15ec0960687db8e6da43535fa1ee0e92fbb817 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:e62f3ea524b11c1cd6ff7f80362736d86c0056631346b5b106a421686fce2726 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/requirements.in | 2 +- .kokoro/requirements.txt | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 090264303f..a5361a30a3 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:5ee35ee919254a3d1e7d4f8abbf1b8c8869ade317ceb2e4df709af1b4b3e9ca1 + digest: sha256:e62f3ea524b11c1cd6ff7f80362736d86c0056631346b5b106a421686fce2726 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index b19a8dbfdd..2092cc741d 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,5 +1,5 @@ gcp-docuploader -gcp-releasetool +gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x wheel setuptools typing-extensions diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index cfadd22ce9..c80f0a87cc 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # # pip-compile --allow-unsafe --generate-hashes requirements.in @@ -126,9 +126,9 @@ gcp-docuploader==0.6.4 \ --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.9.1 \ - --hash=sha256:952f4055d5d986b070ae2a71c4410b250000f9cc5a1e26398fcd55a5bbc5a15f \ - --hash=sha256:d0d3c814a97c1a237517e837d8cfa668ced8df4b882452578ecef4a4e79c583b +gcp-releasetool==1.10.5 \ + --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ + --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 # via -r requirements.in google-api-core==2.8.2 \ --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ @@ -374,6 +374,10 @@ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring +setuptools==67.3.2 \ + --hash=sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012 \ + --hash=sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48 + # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 From f1bcc331d61f966f9c0c29dd3dccb122cafc874d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 18:47:04 +0000 Subject: [PATCH 1110/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 (#2534) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9c425e9a50..9e77dfe535 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20230114-2.0.0 - 3.2.0 + 3.3.0 11.0.0 From ed2cb7436c2ba38bdc4975abd12ba88d231087db Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 18:47:44 +0000 Subject: [PATCH 1111/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.13.0 (#2533) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9e77dfe535..4f188faa9c 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.12.0 + 2.13.0 test From a32a650bf5eb3ac002a29baa5bb5f1a90a5ba02a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 19:22:23 +0000 Subject: [PATCH 1112/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.13.0 (#2532) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 4f188faa9c..5a5ca18815 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.12.0 + 2.13.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3ed939c6b1..8cd02e07f0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.12.0 + 2.13.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 930b63e417..f4ad58b54e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.12.0 + 2.13.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 36754f625e..0b7d3ebe83 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.12.0 + 2.13.0 test From 4d88ccc22b86ae83220324c53c2430f7878473bd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 19:58:37 +0000 Subject: [PATCH 1113/2268] deps: update cloud client dependencies (#2526) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5a5ca18815..2d6bcf6bda 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.31.0 + 2.32.1 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.16.0 + 1.17.0 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.18.0 + 2.19.0 test From 62ff092908bbc2cf26e8cb9426bdc0f45d1b2b9e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 19:59:45 +0000 Subject: [PATCH 1114/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230210-2.0.0 (#2530) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2d6bcf6bda..351ab4451c 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230114-2.0.0 + v2-rev20230210-2.0.0 3.3.0 11.0.0 From 56fa0be00a47bb8fda34cd8fbea79b48e141dc74 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:06:57 +0000 Subject: [PATCH 1115/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.5.0 (#2529) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 351ab4451c..7641422d55 100644 --- a/pom.xml +++ b/pom.xml @@ -223,7 +223,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 html From 554e75df92aa0dbd16d65d51a6c845c914062059 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:07:12 +0000 Subject: [PATCH 1116/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 (#2528) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index abf6496356..251420f50b 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.19 + 0.9.20 true com.example.bigquery.NativeImageBigquerySample From 5fe5e74afd4af873213455010b73dcf8240e008d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:07:27 +0000 Subject: [PATCH 1117/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 (#2527) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 251420f50b..dade350044 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.19 + 0.9.20 test From 74893e45f49dae5a3c090bb3d865eee0380f73da Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:07:44 +0000 Subject: [PATCH 1118/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.8.0 (#2524) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.8.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1883965cdf..e4f766990d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.7.0 + 26.8.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index dade350044..eafb3e8f39 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.7.0 + 26.8.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0b7d3ebe83..a6c3affef9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.7.0 + 26.8.0 pom import From 5f2899d1835faa0ccb2cbccc8060d2b86596fc2e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:08:43 +0000 Subject: [PATCH 1119/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.0 (#2517) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.0 * 🦉 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 --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bca0b8ae5a..9925971798 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.0 true diff --git a/samples/pom.xml b/samples/pom.xml index f2bb76550c..508f6975ea 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.0 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a6c3affef9..371c5e835d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.0 true From a537806dc4440c0c6c90f5543d5a3c63dbd5fb75 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Feb 2023 20:09:02 +0000 Subject: [PATCH 1120/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.22.0 (#2516) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.22.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4f766990d..932091b321 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.21.0 + 2.22.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8cd02e07f0..f86a702216 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.21.0 + 2.22.0 From 1de74f879c4ff037cc9e045873ba83f325da1682 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:20:17 +0000 Subject: [PATCH 1121/2268] chore(main): release 2.23.0 (#2525) :robot: I have created a release *beep* *boop* --- ## [2.23.0](https://togithub.com/googleapis/java-bigquery/compare/v2.22.0...v2.23.0) (2023-02-22) ### Features * Add support for session_id in load jobs ([#2519](https://togithub.com/googleapis/java-bigquery/issues/2519)) ([e431c17](https://togithub.com/googleapis/java-bigquery/commit/e431c17efe0f69d084f119463ca8bdb25047a7fe)) ### Dependencies * Update cloud client dependencies ([#2526](https://togithub.com/googleapis/java-bigquery/issues/2526)) ([4d88ccc](https://togithub.com/googleapis/java-bigquery/commit/4d88ccc22b86ae83220324c53c2430f7878473bd)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.13.0 ([#2533](https://togithub.com/googleapis/java-bigquery/issues/2533)) ([ed2cb74](https://togithub.com/googleapis/java-bigquery/commit/ed2cb7436c2ba38bdc4975abd12ba88d231087db)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230210-2.0.0 ([#2530](https://togithub.com/googleapis/java-bigquery/issues/2530)) ([62ff092](https://togithub.com/googleapis/java-bigquery/commit/62ff092908bbc2cf26e8cb9426bdc0f45d1b2b9e)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 ([#2534](https://togithub.com/googleapis/java-bigquery/issues/2534)) ([f1bcc33](https://togithub.com/googleapis/java-bigquery/commit/f1bcc331d61f966f9c0c29dd3dccb122cafc874d)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#2527](https://togithub.com/googleapis/java-bigquery/issues/2527)) ([5fe5e74](https://togithub.com/googleapis/java-bigquery/commit/5fe5e74afd4af873213455010b73dcf8240e008d)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#2528](https://togithub.com/googleapis/java-bigquery/issues/2528)) ([554e75d](https://togithub.com/googleapis/java-bigquery/commit/554e75df92aa0dbd16d65d51a6c845c914062059)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7bceabcc..6e7623e2c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.23.0](https://github.com/googleapis/java-bigquery/compare/v2.22.0...v2.23.0) (2023-02-22) + + +### Features + +* Add support for session_id in load jobs ([#2519](https://github.com/googleapis/java-bigquery/issues/2519)) ([e431c17](https://github.com/googleapis/java-bigquery/commit/e431c17efe0f69d084f119463ca8bdb25047a7fe)) + + +### Dependencies + +* Update cloud client dependencies ([#2526](https://github.com/googleapis/java-bigquery/issues/2526)) ([4d88ccc](https://github.com/googleapis/java-bigquery/commit/4d88ccc22b86ae83220324c53c2430f7878473bd)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.13.0 ([#2533](https://github.com/googleapis/java-bigquery/issues/2533)) ([ed2cb74](https://github.com/googleapis/java-bigquery/commit/ed2cb7436c2ba38bdc4975abd12ba88d231087db)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230210-2.0.0 ([#2530](https://github.com/googleapis/java-bigquery/issues/2530)) ([62ff092](https://github.com/googleapis/java-bigquery/commit/62ff092908bbc2cf26e8cb9426bdc0f45d1b2b9e)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 ([#2534](https://github.com/googleapis/java-bigquery/issues/2534)) ([f1bcc33](https://github.com/googleapis/java-bigquery/commit/f1bcc331d61f966f9c0c29dd3dccb122cafc874d)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#2527](https://github.com/googleapis/java-bigquery/issues/2527)) ([5fe5e74](https://github.com/googleapis/java-bigquery/commit/5fe5e74afd4af873213455010b73dcf8240e008d)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#2528](https://github.com/googleapis/java-bigquery/issues/2528)) ([554e75d](https://github.com/googleapis/java-bigquery/commit/554e75df92aa0dbd16d65d51a6c845c914062059)) + ## [2.22.0](https://github.com/googleapis/java-bigquery/compare/v2.21.0...v2.22.0) (2023-02-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9925971798..56aed65ead 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.22.1-SNAPSHOT + 2.23.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 74c1d14bfa..6751960f63 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.22.1-SNAPSHOT + 2.23.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.22.1-SNAPSHOT + 2.23.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7641422d55..1d753411a5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.22.1-SNAPSHOT + 2.23.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.22.1-SNAPSHOT + 2.23.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f4ad58b54e..a0bf0b65b7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.22.1-SNAPSHOT + 2.23.0 diff --git a/versions.txt b/versions.txt index e739f30978..5079a64ff5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.22.0:2.22.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.23.0:2.23.0 \ No newline at end of file From e393728a2afb7fb65e6be3ddb06cf23c68f4ab69 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 20:36:41 +0000 Subject: [PATCH 1122/2268] chore(main): release 2.23.1-SNAPSHOT (#2537) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 56aed65ead..49baafaadf 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.0 + 2.23.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6751960f63..b2231c9ace 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.0 + 2.23.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.0 + 2.23.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1d753411a5..270619d8d0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.0 + 2.23.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.0 + 2.23.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a0bf0b65b7..959798bfa5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.0 + 2.23.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5079a64ff5..581e895c4d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.0:2.23.0 \ No newline at end of file +google-cloud-bigquery:2.23.0:2.23.1-SNAPSHOT \ No newline at end of file From 25885821328ecb72c57d9ebeb548a6710d186381 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 18:40:58 +0000 Subject: [PATCH 1123/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 (#2547) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 932091b321..224e74b241 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,20 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.8.0') +implementation platform('com.google.cloud:libraries-bom:26.9.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.22.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.23.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.22.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.0" ``` ## Authentication diff --git a/pom.xml b/pom.xml index 270619d8d0..073a9a02ca 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20230210-2.0.0 - 3.3.0 + 3.4.0 11.0.0 From 2c09c8736e1bcf544068f95fc23cc50cb04a2d9b Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Thu, 2 Mar 2023 13:43:34 -0500 Subject: [PATCH 1124/2268] doc: Array of Structure Query Code sample (#2540) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Array of Structure Query Code sample * 🦉 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 --- README.md | 1 + ...ueryWithArrayOfStructsNamedParameters.java | 68 +++++++++++++++++++ ...ryWithArrayOfStructsNamedParametersIT.java | 58 ++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/QueryWithArrayOfStructsNamedParametersIT.java diff --git a/README.md b/README.md index 224e74b241..c5175984b0 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Query Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | | Query Script | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | | Query Total Rows | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | +| Query With Array Of Structs Named Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java) | | Query With Array Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | | Query With Named Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedParameters.java) | | Query With Named Types Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithNamedTypesParameters.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java b/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java new file mode 100644 index 0000000000..00cae0aa9c --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_query_array_structs_params_named] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.TableResult; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class QueryWithArrayOfStructsNamedParameters { + + public static void main(String[] args) { + queryWithArrayOfStructsNamedParameters(); + } + + public static void queryWithArrayOfStructsNamedParameters() { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + Map structMap = new HashMap<>(); + structMap.put("stringField", QueryParameterValue.string("test-stringField")); + QueryParameterValue structQueryParam = QueryParameterValue.struct(structMap); + List arrayOfStructs = new ArrayList<>(); + arrayOfStructs.add(structQueryParam); + + String query = "SELECT (@arrayOfStructField) AS record"; + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setUseLegacySql(false) + .addNamedParameter( + "arrayOfStructField", + QueryParameterValue.array(arrayOfStructs.toArray(), StandardSQLTypeName.STRING)) + .build(); + TableResult results = bigquery.query(queryConfig); + results + .iterateAll() + .forEach(row -> row.forEach(val -> System.out.printf("%s", val.toString()))); + System.out.println("Query with Array of struct parameters performed successfully."); + } catch (BigQueryException | InterruptedException e) { + System.out.println("Query not performed \n" + e.toString()); + } + } +} +// [END bigquery_query_array_structs_params_named] diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryWithArrayOfStructsNamedParametersIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryWithArrayOfStructsNamedParametersIT.java new file mode 100644 index 0000000000..f0b524dda4 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryWithArrayOfStructsNamedParametersIT.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class QueryWithArrayOfStructsNamedParametersIT { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testQueryWithNamedParameters() { + QueryWithArrayOfStructsNamedParameters.queryWithArrayOfStructsNamedParameters(); + assertThat(bout.toString()) + .contains("Query with Array of struct parameters performed successfully."); + } +} From 60e45e457edfd257e16e37f0c0d5049dd722f0e3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 18:43:59 +0000 Subject: [PATCH 1125/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.18.0 (#2546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.18.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 073a9a02ca..2efe9ad5f9 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.17.0 + 1.18.0 pom import From fedb96b3c5c2366061ce3e4bb5714b847b2d7111 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 20:48:50 +0000 Subject: [PATCH 1126/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.33.1 (#2552) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2efe9ad5f9..be0443a300 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.32.1 + 2.33.1 pom import From 12750896a18504730688a5d3e726d55ccd6adc12 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 21:01:18 +0000 Subject: [PATCH 1127/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.11.0 (#2542) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 49baafaadf..f23f2797c0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 org.apache.maven.plugins From 4eb7332aa8488e9bc8f04998a524e6df491d78af Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 21:02:12 +0000 Subject: [PATCH 1128/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.14.0 (#2544) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.13.0` -> `2.14.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.14.0/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.14.0/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index be0443a300..6080df3d4f 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.13.0 + 2.14.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f86a702216..cb388961f5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.13.0 + 2.14.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 959798bfa5..842ab47305 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.13.0 + 2.14.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 371c5e835d..218555cee9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.13.0 + 2.14.0 test From 317601fc2164ee42c443c73b700866bab121218d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 21:02:48 +0000 Subject: [PATCH 1129/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.0 (#2521) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cb388961f5..834a2a1a4e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.18.4 + 2.20.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 842ab47305..b0182f5a6e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.18.4 + 2.20.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 218555cee9..7321e13386 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.18.4 + 2.20.0 test From 20496e3cdb138c1955d63494c356f98941dd888d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 21:04:14 +0000 Subject: [PATCH 1130/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.23.0 (#2538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.22.0` -> `2.23.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.23.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.23.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.23.0/compatibility-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.23.0/confidence-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.23.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2230-httpsgithubcomgoogleapisjava-bigquerycomparev2220v2230-2023-02-22) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.22.0...v2.23.0) ##### Features - Add support for session_id in load jobs ([#​2519](https://togithub.com/googleapis/java-bigquery/issues/2519)) ([e431c17](https://togithub.com/googleapis/java-bigquery/commit/e431c17efe0f69d084f119463ca8bdb25047a7fe)) ##### Dependencies - Update cloud client dependencies ([#​2526](https://togithub.com/googleapis/java-bigquery/issues/2526)) ([4d88ccc](https://togithub.com/googleapis/java-bigquery/commit/4d88ccc22b86ae83220324c53c2430f7878473bd)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.13.0 ([#​2533](https://togithub.com/googleapis/java-bigquery/issues/2533)) ([ed2cb74](https://togithub.com/googleapis/java-bigquery/commit/ed2cb7436c2ba38bdc4975abd12ba88d231087db)) - Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230210-2.0.0 ([#​2530](https://togithub.com/googleapis/java-bigquery/issues/2530)) ([62ff092](https://togithub.com/googleapis/java-bigquery/commit/62ff092908bbc2cf26e8cb9426bdc0f45d1b2b9e)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 ([#​2534](https://togithub.com/googleapis/java-bigquery/issues/2534)) ([f1bcc33](https://togithub.com/googleapis/java-bigquery/commit/f1bcc331d61f966f9c0c29dd3dccb122cafc874d)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#​2527](https://togithub.com/googleapis/java-bigquery/issues/2527)) ([5fe5e74](https://togithub.com/googleapis/java-bigquery/commit/5fe5e74afd4af873213455010b73dcf8240e008d)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#​2528](https://togithub.com/googleapis/java-bigquery/issues/2528)) ([554e75d](https://togithub.com/googleapis/java-bigquery/commit/554e75df92aa0dbd16d65d51a6c845c914062059))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5175984b0..b01a38c0ed 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.22.0 + 2.23.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 834a2a1a4e..d896f4f2bc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.22.0 + 2.23.0 From ad78ebb35a5b6d7d86d59e6c0fa078c68a65a275 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 2 Mar 2023 21:06:12 +0000 Subject: [PATCH 1131/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.14.0 (#2545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.13.0` -> `2.14.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.14.0/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.14.0/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6080df3d4f..40faa824c9 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.13.0 + 2.14.0 test From 5507b94b9747d17d23f7774e6e39774c10aa0c61 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:18:12 +0000 Subject: [PATCH 1132/2268] chore(main): release 2.23.1 (#2551) :robot: I have created a release *beep* *boop* --- ## [2.23.1](https://togithub.com/googleapis/java-bigquery/compare/v2.23.0...v2.23.1) (2023-03-02) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.14.0 ([#2545](https://togithub.com/googleapis/java-bigquery/issues/2545)) ([ad78ebb](https://togithub.com/googleapis/java-bigquery/commit/ad78ebb35a5b6d7d86d59e6c0fa078c68a65a275)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.18.0 ([#2546](https://togithub.com/googleapis/java-bigquery/issues/2546)) ([60e45e4](https://togithub.com/googleapis/java-bigquery/commit/60e45e457edfd257e16e37f0c0d5049dd722f0e3)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 ([#2547](https://togithub.com/googleapis/java-bigquery/issues/2547)) ([2588582](https://togithub.com/googleapis/java-bigquery/commit/25885821328ecb72c57d9ebeb548a6710d186381)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7623e2c0..af053e1b52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.23.1](https://github.com/googleapis/java-bigquery/compare/v2.23.0...v2.23.1) (2023-03-02) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.14.0 ([#2545](https://github.com/googleapis/java-bigquery/issues/2545)) ([ad78ebb](https://github.com/googleapis/java-bigquery/commit/ad78ebb35a5b6d7d86d59e6c0fa078c68a65a275)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.18.0 ([#2546](https://github.com/googleapis/java-bigquery/issues/2546)) ([60e45e4](https://github.com/googleapis/java-bigquery/commit/60e45e457edfd257e16e37f0c0d5049dd722f0e3)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 ([#2547](https://github.com/googleapis/java-bigquery/issues/2547)) ([2588582](https://github.com/googleapis/java-bigquery/commit/25885821328ecb72c57d9ebeb548a6710d186381)) + ## [2.23.0](https://github.com/googleapis/java-bigquery/compare/v2.22.0...v2.23.0) (2023-02-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f23f2797c0..947efa2a71 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.1-SNAPSHOT + 2.23.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b2231c9ace..089818e9a5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.1-SNAPSHOT + 2.23.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.1-SNAPSHOT + 2.23.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 40faa824c9..a64de01b4e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.1-SNAPSHOT + 2.23.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.1-SNAPSHOT + 2.23.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b0182f5a6e..2ed46c36ea 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.1-SNAPSHOT + 2.23.1 diff --git a/versions.txt b/versions.txt index 581e895c4d..f25ff49768 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.0:2.23.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.23.1:2.23.1 \ No newline at end of file From 2448d11e70c975b7ba22565315e1783c2bc62c4b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:30:23 +0000 Subject: [PATCH 1133/2268] chore(main): release 2.23.2-SNAPSHOT (#2554) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 947efa2a71..b759488e31 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.1 + 2.23.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 089818e9a5..258dd7d79e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.1 + 2.23.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.1 + 2.23.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a64de01b4e..9662f000d5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.1 + 2.23.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.1 + 2.23.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2ed46c36ea..00f705c006 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.1 + 2.23.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index f25ff49768..ab456e075e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.1:2.23.1 \ No newline at end of file +google-cloud-bigquery:2.23.1:2.23.2-SNAPSHOT \ No newline at end of file From a71b1b2abb568bd1ed088f7bd4b77f93a68ec95e Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 2 Mar 2023 13:54:12 -0800 Subject: [PATCH 1134/2268] docs: remove stale snippet comment (#2555) related: internal issue 270264394 --- .../src/main/java/com/example/bigquery/CreateDatasetAws.java | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java b/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java index f5b4f0cdc8..19ef0eca24 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java @@ -30,7 +30,6 @@ public static void main(String[] args) { // TODO(developer): Replace these variables before running the sample. String projectId = "MY_PROJECT_ID"; String datasetName = "MY_DATASET_NAME"; - // Note: As of now location only supports aws-us-east-1 String location = "aws-us-east-1"; createDatasetAws(projectId, datasetName, location); } From f4b841265d81c63a7e76bc60b0d30f20beb74634 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 17:01:09 -0500 Subject: [PATCH 1135/2268] chore: generate non-cloud client library (#1770) (#2541) * chore: add proto group prefix * add test case for generating google maps * run new tests in ci * parameterize group id for proto artifacts * use helper to compute group id of proto artifacts * verify non cloud library generation * change artifact name in golden * restore new client test * change description * change description * add comments to _proto_group_id Source-Link: https://github.com/googleapis/synthtool/commit/269a915036d3523ad357af5af597a8b0f0f783cc Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9bf82029163bc06d58f56682afd1893a42ace3e04b0359accb86f79c6ecdc9f9 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a5361a30a3..6b83f060e7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:e62f3ea524b11c1cd6ff7f80362736d86c0056631346b5b106a421686fce2726 + digest: sha256:9bf82029163bc06d58f56682afd1893a42ace3e04b0359accb86f79c6ecdc9f9 From eb4597314fad72bbdb666a832f0f15f732f40817 Mon Sep 17 00:00:00 2001 From: Jonathan Beluch Date: Tue, 7 Mar 2023 12:28:58 -0700 Subject: [PATCH 1136/2268] fix: external table definition parquet format options (#2535) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: set parquet format options for external tables * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: set parquet format options for external tables * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: set parquet format options for external tables --------- Co-authored-by: Owl Bot Co-authored-by: Neenu Shaji --- README.md | 4 ++-- .../cloud/bigquery/ExternalTableDefinition.java | 3 +++ .../com/google/cloud/bigquery/FormatOptions.java | 2 +- .../bigquery/ExternalTableDefinitionTest.java | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b01a38c0ed..907a391fb0 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.23.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.23.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.1" ``` ## Authentication diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index cb327a3a9c..18c78e7503 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -311,6 +311,9 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getDecimalTargetTypes() != null) { externalConfigurationPb.setDecimalTargetTypes(getDecimalTargetTypes()); } + if (getFormatOptions() != null && FormatOptions.PARQUET.equals(getFormatOptions().getType())) { + externalConfigurationPb.setParquetOptions(((ParquetOptions) getFormatOptions()).toPb()); + } if (getFormatOptions() != null && FormatOptions.AVRO.equals(getFormatOptions().getType())) { externalConfigurationPb.setAvroOptions(((AvroOptions) getFormatOptions()).toPb()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java index c4f4111752..9ea5600ddc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java @@ -107,7 +107,7 @@ public static FormatOptions googleSheets() { /** Default options for PARQUET format. */ public static FormatOptions parquet() { - return new FormatOptions(PARQUET); + return ParquetOptions.newBuilder().build(); } /** Default options for the ORC format. */ diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index b7b9531e55..4a74091620 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -52,6 +52,7 @@ public class ExternalTableDefinitionTest { private static final Boolean AUTODETECT = true; private static final AvroOptions AVRO_OPTIONS = AvroOptions.newBuilder().build(); private static final CsvOptions CSV_OPTIONS = CsvOptions.newBuilder().build(); + private static final ParquetOptions PARQUET_OPTIONS = ParquetOptions.newBuilder().build(); private static final HivePartitioningOptions HIVE_PARTITIONING_OPTIONS = HivePartitioningOptions.newBuilder() .setMode("AUTO") @@ -71,6 +72,9 @@ public class ExternalTableDefinitionTest { private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, AVRO_OPTIONS).build(); + private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_PARQUET = + ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, PARQUET_OPTIONS).build(); + @Test public void testToBuilder() { compareExternalTableDefinition( @@ -136,6 +140,17 @@ public void testToAndFromPb() { externalTableDefinition, ExternalTableDefinition.fromPb(externalTableDefinition.toPb())); } + @Test + public void testToAndFromPbParquet() { + compareExternalTableDefinition( + EXTERNAL_TABLE_DEFINITION_PARQUET, + ExternalTableDefinition.fromPb(EXTERNAL_TABLE_DEFINITION_PARQUET.toPb())); + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, PARQUET_OPTIONS).build(); + compareExternalTableDefinition( + externalTableDefinition, ExternalTableDefinition.fromPb(externalTableDefinition.toPb())); + } + private void compareExternalTableDefinition( ExternalTableDefinition expected, ExternalTableDefinition value) { assertEquals(expected, value); From 19385e63ddc29b178009eb15edcd724c2fdb4252 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 18:28:13 +0000 Subject: [PATCH 1137/2268] chore(main): release 2.23.2 (#2556) :robot: I have created a release *beep* *boop* --- ## [2.23.2](https://togithub.com/googleapis/java-bigquery/compare/v2.23.1...v2.23.2) (2023-03-07) ### Bug Fixes * External table definition parquet format options ([#2535](https://togithub.com/googleapis/java-bigquery/issues/2535)) ([eb45973](https://togithub.com/googleapis/java-bigquery/commit/eb4597314fad72bbdb666a832f0f15f732f40817)) ### Documentation * Remove stale snippet comment ([#2555](https://togithub.com/googleapis/java-bigquery/issues/2555)) ([a71b1b2](https://togithub.com/googleapis/java-bigquery/commit/a71b1b2abb568bd1ed088f7bd4b77f93a68ec95e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af053e1b52..7757dfd594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.23.2](https://github.com/googleapis/java-bigquery/compare/v2.23.1...v2.23.2) (2023-03-07) + + +### Bug Fixes + +* External table definition parquet format options ([#2535](https://github.com/googleapis/java-bigquery/issues/2535)) ([eb45973](https://github.com/googleapis/java-bigquery/commit/eb4597314fad72bbdb666a832f0f15f732f40817)) + + +### Documentation + +* Remove stale snippet comment ([#2555](https://github.com/googleapis/java-bigquery/issues/2555)) ([a71b1b2](https://github.com/googleapis/java-bigquery/commit/a71b1b2abb568bd1ed088f7bd4b77f93a68ec95e)) + ## [2.23.1](https://github.com/googleapis/java-bigquery/compare/v2.23.0...v2.23.1) (2023-03-02) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b759488e31..177ce5af81 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.2-SNAPSHOT + 2.23.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 258dd7d79e..2f7613e524 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.2-SNAPSHOT + 2.23.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.2-SNAPSHOT + 2.23.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9662f000d5..1a0439262b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.2-SNAPSHOT + 2.23.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.2-SNAPSHOT + 2.23.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 00f705c006..8bdcef7c0e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.2-SNAPSHOT + 2.23.2 diff --git a/versions.txt b/versions.txt index ab456e075e..777c200678 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.1:2.23.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.23.2:2.23.2 \ No newline at end of file From 9daab1720ca973a6045b0287468bd05204c24ab4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 18:42:15 +0000 Subject: [PATCH 1138/2268] chore(main): release 2.23.3-SNAPSHOT (#2560) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- README.md | 2 +- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 907a391fb0..6647510df0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.9.0') +implementation platform('com.google.cloud:libraries-bom:26.10.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 177ce5af81..8d973a3fa5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.2 + 2.23.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2f7613e524..c2c9ff6914 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.2 + 2.23.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.2 + 2.23.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1a0439262b..a69d6b715a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.2 + 2.23.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.2 + 2.23.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8bdcef7c0e..b64cc4a38e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.2 + 2.23.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 777c200678..ffccc8c3d5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.2:2.23.2 \ No newline at end of file +google-cloud-bigquery:2.23.2:2.23.3-SNAPSHOT \ No newline at end of file From 2186c64e523e030a777eec447bc1f22802f56617 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 10 Mar 2023 15:43:44 -0500 Subject: [PATCH 1139/2268] feat: add support for clone (#2553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat add cupport for clone * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Clone definition is not a table definition * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: remove CLONE from Table definition * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix license header * chore: check for null * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add clirr ignored differences * chore: fix test --------- Co-authored-by: Owl Bot --- README.md | 4 +- .../clirr-ignored-differences.xml | 6 ++ .../cloud/bigquery/CloneDefinition.java | 85 +++++++++++++++++++ .../cloud/bigquery/CopyJobConfiguration.java | 4 +- .../java/com/google/cloud/bigquery/Table.java | 6 ++ .../com/google/cloud/bigquery/TableInfo.java | 23 +++++ .../cloud/bigquery/CloneDefinitionTest.java | 58 +++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 54 ++++++++++++ .../cloud/bigquery/it/ITRemoteUDFTest.java | 2 +- 9 files changed, 237 insertions(+), 5 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CloneDefinition.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java diff --git a/README.md b/README.md index 6647510df0..7eb7929c1e 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.23.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.23.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.2" ``` ## Authentication diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 6386c50371..5fe634cca7 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -44,4 +44,10 @@ com/google/cloud/bigquery/TableInfo* *DefaultCollation(*) + + + 7013 + com/google/cloud/bigquery/TableInfo* + *CloneDefinition(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CloneDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CloneDefinition.java new file mode 100644 index 0000000000..58594fe321 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CloneDefinition.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.client.util.DateTime; +import com.google.api.core.BetaApi; +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import java.io.Serializable; +import javax.annotation.Nullable; + +@AutoValue +@BetaApi +public abstract class CloneDefinition implements Serializable { + + private static final long serialVersionUID = 1460853787400450649L; + + public static Builder newBuilder() { + return new AutoValue_CloneDefinition.Builder(); + } + + static CloneDefinition fromPb( + com.google.api.services.bigquery.model.CloneDefinition cloneDefinition) { + Builder builder = newBuilder(); + + if (cloneDefinition.getCloneTime() != null) { + builder.setCloneTime(cloneDefinition.getCloneTime().toString()); + } + if (cloneDefinition.getBaseTableReference() != null) { + builder.setBaseTableId(TableId.fromPb(cloneDefinition.getBaseTableReference())); + } + + return builder.build(); + } + + @Nullable + public abstract TableId getBaseTableId(); + + @Nullable + public abstract String getCloneTime(); + + /** Returns a builder for a Clone table definition. */ + @VisibleForTesting + public abstract Builder toBuilder(); + + com.google.api.services.bigquery.model.CloneDefinition toPb() { + + com.google.api.services.bigquery.model.CloneDefinition cloneDefinition = + new com.google.api.services.bigquery.model.CloneDefinition(); + cloneDefinition.setBaseTableReference(getBaseTableId().toPb()); + cloneDefinition.setCloneTime(DateTime.parseRfc3339(getCloneTime())); + + return cloneDefinition; + } + + @AutoValue.Builder + public abstract static class Builder { + + /** Reference describing the ID of the table that was Cloned. * */ + public abstract Builder setBaseTableId(TableId baseTableId); + + /** + * The time at which the base table was Cloned. This value is reported in the JSON response + * using RFC3339 format. * + */ + public abstract Builder setCloneTime(String dateTime); + + /** Creates a {@code CloneDefinition} object. */ + public abstract CloneDefinition build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index fe67986fc6..37955fec09 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -128,8 +128,8 @@ public Builder setDestinationTable(TableId destinationTable) { } /** - * Sets the supported operation types (COPY, SNAPSHOT or RESTORE) in table copy job. More info: - * https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype + * Sets the supported operation types (COPY, CLONE, SNAPSHOT or RESTORE) in table copy job. More + * info: https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype */ public Builder setOperationType(String operationType) { this.operationType = operationType; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index 8303566d2a..3e67e8d750 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -162,6 +162,12 @@ public Builder setDefaultCollation(String defaultCollation) { return this; } + @Override + public TableInfo.Builder setCloneDefinition(CloneDefinition cloneDefinition) { + infoBuilder.setCloneDefinition(cloneDefinition); + return this; + } + @Override public Table build() { return new Table(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index cfe7003006..19e9de2b79 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -74,6 +74,8 @@ public Table apply(TableInfo tableInfo) { private final Boolean requirePartitionFilter; private final String defaultCollation; + private final CloneDefinition cloneDefinition; + /** A builder for {@code TableInfo} objects. */ public abstract static class Builder { @@ -138,6 +140,8 @@ public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { } public abstract Builder setDefaultCollation(String defaultCollation); + + public abstract Builder setCloneDefinition(CloneDefinition cloneDefinition); } static class BuilderImpl extends Builder { @@ -159,6 +163,7 @@ static class BuilderImpl extends Builder { private Labels labels = Labels.ZERO; private Boolean requirePartitionFilter; private String defaultCollation; + private CloneDefinition cloneDefinition; BuilderImpl() {} @@ -180,6 +185,7 @@ static class BuilderImpl extends Builder { this.labels = tableInfo.labels; this.requirePartitionFilter = tableInfo.requirePartitionFilter; this.defaultCollation = tableInfo.defaultCollation; + this.cloneDefinition = tableInfo.cloneDefinition; } BuilderImpl(Table tablePb) { @@ -205,6 +211,9 @@ static class BuilderImpl extends Builder { this.labels = Labels.fromPb(tablePb.getLabels()); this.requirePartitionFilter = tablePb.getRequirePartitionFilter(); this.defaultCollation = tablePb.getDefaultCollation(); + if (tablePb.getCloneDefinition() != null) { + this.cloneDefinition = CloneDefinition.fromPb(tablePb.getCloneDefinition()); + } } @Override @@ -309,6 +318,11 @@ public Builder setDefaultCollation(String defaultCollation) { return this; } + public Builder setCloneDefinition(CloneDefinition cloneDefinition) { + this.cloneDefinition = cloneDefinition; + return this; + } + @Override public TableInfo build() { return new TableInfo(this); @@ -333,6 +347,7 @@ public TableInfo build() { this.labels = builder.labels; this.requirePartitionFilter = builder.requirePartitionFilter; this.defaultCollation = builder.defaultCollation; + this.cloneDefinition = builder.cloneDefinition; } /** Returns the hash of the table resource. */ @@ -439,6 +454,10 @@ public String getDefaultCollation() { return defaultCollation; } + public CloneDefinition getCloneDefinition() { + return cloneDefinition; + } + /** Returns a builder for the table object. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -464,6 +483,7 @@ public String toString() { .add("labels", labels) .add("requirePartitionFilter", requirePartitionFilter) .add("defaultCollation", defaultCollation) + .add("cloneDefinition", cloneDefinition) .toString(); } @@ -528,6 +548,9 @@ Table toPb() { if (defaultCollation != null) { tablePb.setDefaultCollation(defaultCollation); } + if (cloneDefinition != null) { + tablePb.setCloneDefinition(cloneDefinition.toPb()); + } return tablePb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java new file mode 100644 index 0000000000..33bcf5f405 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class CloneDefinitionTest { + private static final TableId BASE_TABLE_ID = TableId.of("DATASET_NAME", "BASE_TABLE_NAME"); + private static final String CLONE_TIME = "2021-05-19T11:32:26.553Z"; + private static final CloneDefinition CLONETABLE_DEFINITION = + CloneDefinition.newBuilder().setBaseTableId(BASE_TABLE_ID).setCloneTime(CLONE_TIME).build(); + + @Test + public void testToBuilder() { + compareCloneTableDefinition(CLONETABLE_DEFINITION, CLONETABLE_DEFINITION.toBuilder().build()); + CloneDefinition cloneTableDefinition = + CLONETABLE_DEFINITION.toBuilder().setCloneTime("2021-05-20T11:32:26.553Z").build(); + assertEquals("2021-05-20T11:32:26.553Z", cloneTableDefinition.getCloneTime()); + } + + @Test + public void testBuilder() { + assertEquals(BASE_TABLE_ID, CLONETABLE_DEFINITION.getBaseTableId()); + assertEquals(CLONE_TIME, CLONETABLE_DEFINITION.getCloneTime()); + CloneDefinition cloneDefinition = + CloneDefinition.newBuilder().setBaseTableId(BASE_TABLE_ID).setCloneTime(CLONE_TIME).build(); + assertEquals(CLONETABLE_DEFINITION, cloneDefinition); + } + + @Test + public void testToAndFromPb() { + CloneDefinition cloneDefinition = CLONETABLE_DEFINITION.toBuilder().build(); + assertTrue(CloneDefinition.fromPb(cloneDefinition.toPb()) instanceof CloneDefinition); + compareCloneTableDefinition(cloneDefinition, CloneDefinition.fromPb(cloneDefinition.toPb())); + } + + private void compareCloneTableDefinition(CloneDefinition expected, CloneDefinition value) { + assertEquals(expected.getBaseTableId(), value.getBaseTableId()); + assertEquals(expected.getCloneTime(), value.getCloneTime()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 0bbe1efdd1..bf59c2b67e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -54,6 +54,7 @@ import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryResult; import com.google.cloud.bigquery.BigQuerySQLException; +import com.google.cloud.bigquery.CloneDefinition; import com.google.cloud.bigquery.Clustering; import com.google.cloud.bigquery.Connection; import com.google.cloud.bigquery.ConnectionProperty; @@ -4334,6 +4335,7 @@ public void testSnapshotTableCopyJob() throws InterruptedException { assertNotNull(snapshotTable); assertEquals(snapshotTableId.getDataset(), snapshotTable.getTableId().getDataset()); assertEquals(snapshotTableName, snapshotTable.getTableId().getTable()); + System.out.println(snapshotTable.getDefinition()); assertTrue(snapshotTable.getDefinition() instanceof SnapshotTableDefinition); assertEquals(DDL_TABLE_SCHEMA, snapshotTable.getDefinition().getSchema()); assertNotNull(((SnapshotTableDefinition) snapshotTable.getDefinition()).getSnapshotTime()); @@ -5179,4 +5181,56 @@ public void testCreateExternalTableWithReferenceFileSchemaParquet() { boolean success = bigquery.delete(tableId); assertEquals(true, success); } + + @Test + public void testCloneTableCopyJob() throws InterruptedException { + String sourceTableName = "test_copy_job_base_table"; + String ddlTableName = TABLE_ID_DDL.getTable(); + String cloneTableName = String.format("test_clone_table"); + // Create source table with some data in it + String ddlQuery = + String.format( + "CREATE OR REPLACE TABLE %s (" + + "TimestampField TIMESTAMP OPTIONS(description='TimestampDescription'), " + + "StringField STRING OPTIONS(description='StringDescription'), " + + "BooleanField BOOLEAN OPTIONS(description='BooleanDescription') " + + ") AS SELECT * FROM %s", + sourceTableName, ddlTableName); + QueryJobConfiguration ddlConfig = + QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); + TableId sourceTableId = TableId.of(DATASET, sourceTableName); + TableResult result = bigquery.query(ddlConfig); + assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); + Table remoteTable = bigquery.getTable(DATASET, sourceTableName); + assertNotNull(remoteTable); + + // Create clone table using source table as the base table + TableId cloneTableId = TableId.of(DATASET, cloneTableName); + CopyJobConfiguration cloneConfiguration = + CopyJobConfiguration.newBuilder(cloneTableId, sourceTableId) + .setOperationType("CLONE") + .build(); + Job createdJob = bigquery.create(JobInfo.of(cloneConfiguration)); + CopyJobConfiguration createdConfiguration = createdJob.getConfiguration(); + assertNotNull(createdConfiguration.getSourceTables()); + assertNotNull(createdConfiguration.getOperationType()); + assertNotNull(createdConfiguration.getDestinationTable()); + Job completedJob = createdJob.waitFor(); + assertNull(completedJob.getStatus().getError()); + + Table cloneTable = bigquery.getTable(DATASET, cloneTableName); + assertNotNull(cloneTable); + assertEquals(cloneTableId.getDataset(), cloneTable.getTableId().getDataset()); + assertEquals(cloneTableName, cloneTable.getTableId().getTable()); + assertEquals(TableDefinition.Type.TABLE, cloneTable.getDefinition().getType()); + assertTrue(cloneTable.getDefinition() instanceof StandardTableDefinition); + assertEquals(DDL_TABLE_SCHEMA, cloneTable.getDefinition().getSchema()); + assertTrue(cloneTable.getCloneDefinition() instanceof CloneDefinition); + assertEquals(sourceTableName, cloneTable.getCloneDefinition().getBaseTableId().getTable()); + assertNotNull(cloneTable.getCloneDefinition().getCloneTime()); + + // Clean up + assertTrue(remoteTable.delete()); + assertTrue(cloneTable.delete()); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java index 7e74a8f4cd..7a3194e525 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java @@ -47,7 +47,7 @@ public class ITRemoteUDFTest { private static final String ID = UUID.randomUUID().toString().substring(0, 8); private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); - private static final String CONNECTION_ID = "test-connectin-id-" + ID; + private static final String CONNECTION_ID = "test-connection-id-" + ID; private static final String LOCATION = "US"; private static final String PARENT = LocationName.of(PROJECT_ID, LOCATION).toString(); private static final String REMOTE_ENDPOINT = "https://aaabbbccc-uc.a.run.app"; From 0ba67e2a558a3702771a6229b2fe62ddf4531c8c Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Mon, 13 Mar 2023 10:21:55 -0700 Subject: [PATCH 1140/2268] doc: Creating regional dataset sample (#2563) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc: Creating regional dataset sample * 🦉 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 --- README.md | 1 + .../CreateDatasetWithRegionalEndpoint.java | 49 ++++++++++++++++ .../CreateDatasetWithRegionalEndpointIT.java | 56 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/CreateDatasetWithRegionalEndpointIT.java diff --git a/README.md b/README.md index 7eb7929c1e..a3721c7f90 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Create Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | | Create Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | | Create Dataset Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | +| Create Dataset With Regional Endpoint | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java) | | Create External Table Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateExternalTableAws.java) | | Create Iam Policy | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java) | | Create Job | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateJob.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java b/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java new file mode 100644 index 0000000000..c19a93b42f --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetWithRegionalEndpoint.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_create_dataset_with_regional_endpoint] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetInfo; + +public class CreateDatasetWithRegionalEndpoint { + public static void createDatasetWithRegionalEndpoint() { + BigQuery bigquery; + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + bigquery = + BigQueryOptions.newBuilder() + .setHost("https://us-east4-bigquery.googleapis.com/") + .build() + .getService(); + String datasetName = "MyRegionalDataset"; + + DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); + + Dataset newDataset = bigquery.create(datasetInfo); + System.out.println("Region of dataset: " + newDataset.getLocation()); + bigquery.delete("MyRegionalDataset"); + } catch (BigQueryException e) { + System.out.println("Dataset was not created. \n" + e); + } + } +} +// [END bigquery_create_dataset_with_regional_endpoint] diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetWithRegionalEndpointIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetWithRegionalEndpointIT.java new file mode 100644 index 0000000000..da6f4afd7d --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetWithRegionalEndpointIT.java @@ -0,0 +1,56 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class CreateDatasetWithRegionalEndpointIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testCreateDatasetWithRegionalEndpoint() { + CreateDatasetWithRegionalEndpoint.createDatasetWithRegionalEndpoint(); + assertThat(bout.toString().contains("Region of dataset: us-east4")); + } +} From be53e9d88833f9fa5fed28812f9c30db24c21a0b Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Thu, 16 Mar 2023 14:36:12 -0400 Subject: [PATCH 1141/2268] chore: Create scorecard.yaml (#2568) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .github/workflows/scorecard.yml | 72 +++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000000..17e5bb9d95 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,72 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '0 0 * * *' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + with: + sarif_file: results.sarif From 8309c1b4a4ae40f1ba85e4e5713477bae2d86a31 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 20 Mar 2023 14:30:41 -0400 Subject: [PATCH 1142/2268] chore: fix broken links in doc site (#2573) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: fix broken links in doc site * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update package-info.java * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- .../google/cloud/bigquery/package-info.java | 40 +++++++++---------- .../cloud/bigquery/testing/package-info.java | 13 +++--- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java index 65f801357f..cbd283fca2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java @@ -18,30 +18,26 @@ * A client for BigQuery – A fully managed, petabyte scale, low cost enterprise data warehouse for * analytics. * - *

    A simple usage example showing how to create a table if it does not exist and load data into - * it. For the complete source code see - * CreateTableAndLoadData.java. + *

    A simple usage example showing how to create a table in Bigquery. For the complete source code see + * CreateTable.java. * *

    {@code
    - * BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
    - * TableId tableId = TableId.of("dataset", "table");
    - * Table table = bigquery.getTable(tableId);
    - * if (table == null) {
    - *   System.out.println("Creating table " + tableId);
    - *   Field integerField = Field.of("fieldName", Field.Type.integer());
    - *   Schema schema = Schema.of(integerField);
    - *   table = bigquery.create(TableInfo.of(tableId, StandardTableDefinition.of(schema)));
    - * }
    - * System.out.println("Loading data into table " + tableId);
    - * Job loadJob = table.load(FormatOptions.csv(), "gs://bucket/path");
    - * loadJob = loadJob.waitFor();
    - * if (loadJob.getStatus().getError() != null) {
    - *   System.out.println("Job completed with errors");
    - * } else {
    - *   System.out.println("Job succeeded");
    - * }
    - * }
    + * try { + * // Initialize client that will be used to send requests. This client only needs to be created + * // once, and can be reused for multiple requests. + * BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + * + * TableId tableId = TableId.of(datasetName, tableName); + * TableDefinition tableDefinition = StandardTableDefinition.of(schema); + * TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); + * + * bigquery.create(tableInfo); + * System.out.println("Table created successfully"); + * } catch (BigQueryException e) { + * System.out.println("Table was not created. \n" + e.toString()); + * } + * * * @see Google Cloud BigQuery */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/package-info.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/package-info.java index 6e5b32419d..c2e6c03f50 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/package-info.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/package-info.java @@ -17,7 +17,14 @@ /** * A testing helper for Google BigQuery. * - *

    A simple usage example: + *

    A simple usage example: 1. Create a test Google Cloud project. + * + *

    2. Download a JSON service account credentials file from the Google Developer's Console. + * + *

    3. Create a RemoteBigQueryHelper object using your project ID and JSON key. Here is an example + * that uses the RemoteBigQueryHelper to create a dataset. + * + *

    4. Run tests. * *

    Before the test: * @@ -33,9 +40,5 @@ *

    {@code
      * RemoteBigQueryHelper.forceDelete(bigquery, DATASET);
      * }
    - * - * @see - * Google Cloud Java tools for testing */ package com.google.cloud.bigquery.testing; From 93e358afe38c90b7bbe20d2756aec204fdeb28eb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:42:05 +0000 Subject: [PATCH 1143/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.9.0 (#2539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.9.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a3721c7f90..30d19ee1b8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.8.0 + 26.9.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index eafb3e8f39..2b5c26d1fd 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.8.0 + 26.9.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7321e13386..0ab8753a75 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.8.0 + 26.9.0 pom import From 1764eeb8d56ab3e5bda9b554414b5fe4d022fb72 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:45:24 +0000 Subject: [PATCH 1144/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 (#2580) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a69d6b715a..041543e9d9 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ github google-cloud-bigquery-parent v2-rev20230210-2.0.0 - 3.4.0 + 3.5.0 11.0.0
    From eaf09d65c00a742732b918478021dde3b12ac1bd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:45:40 +0000 Subject: [PATCH 1145/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.15.0 (#2577) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 041543e9d9..37e7ca2086 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.14.0 + 2.15.0 test From 6935a1e353d496e6de656de3431563b3527456e5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:45:59 +0000 Subject: [PATCH 1146/2268] deps: update actions/checkout action to v3.4.0 (#2575) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 17e5bb9d95..dd55abf84d 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 with: persist-credentials: false From 105f5ee8d8882f79688dec685f20f44817bf313a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:46:14 +0000 Subject: [PATCH 1147/2268] deps: update github/codeql-action action to v2.2.7 (#2572) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index dd55abf84d..7345ff52e2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7 with: sarif_file: results.sarif From aa0c70ec6fe0ae859b0944101373ebabb0bb4600 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:46:31 +0000 Subject: [PATCH 1148/2268] deps: update actions/upload-artifact action to v3.1.2 (#2571) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 7345ff52e2..66048b5a0a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: SARIF file path: results.sarif From c899ac842e23a1d946cc0ba6e646348c061be776 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 13:46:40 +0000 Subject: [PATCH 1149/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3 (#2565) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 2b5c26d1fd..1cbbadfcfc 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.0.0 **/*IT From aab037c8eb676b42231c99b5890c991095d2f8c2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 14:16:41 +0000 Subject: [PATCH 1150/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230311-2.0.0 (#2578) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 37e7ca2086..8ffbb9892e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230210-2.0.0 + v2-rev20230311-2.0.0 3.5.0 11.0.0
    From 27f37bf543b044cb34ffc1adabdab7bedc4722d8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 14:40:32 +0000 Subject: [PATCH 1151/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.15.0 (#2576) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8ffbb9892e..1e1d072de4 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.14.0 + 2.15.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d896f4f2bc..67a82c69e3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.14.0 + 2.15.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b64cc4a38e..6f47b2f6cc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.14.0 + 2.15.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0ab8753a75..1f3a1ebf78 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.14.0 + 2.15.0 test From f07e8658076b353517a0527632d2eed8849b5dae Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 14:44:10 +0000 Subject: [PATCH 1152/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.10.0 (#2581) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.10.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 30d19ee1b8..3c5d7b4878 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.9.0 + 26.10.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 1cbbadfcfc..5fe55f3936 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.9.0 + 26.10.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 1f3a1ebf78..76715c4cc4 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.9.0 + 26.10.0 pom import From 2d84344de7c682963739751c96e76172f623c108 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 14:52:56 +0000 Subject: [PATCH 1153/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.23.1 (#2558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.23.1 * 🦉 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 Co-authored-by: Farhan Ahmed --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c5d7b4878..b9b76a2a13 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.23.0 + 2.23.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 67a82c69e3..a4b7fe4d39 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.23.0 + 2.23.1 From 8a854dbdcb676e2b2873ddfadf514f2e401fe987 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 14:54:04 +0000 Subject: [PATCH 1154/2268] deps: update dependency com.google.cloud:google-cloud-storage to v2.20.0 (#2559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-storage to v2.20.0 * 🦉 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 Co-authored-by: Farhan Ahmed --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1e1d072de4..4cf689b0dd 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.19.0 + 2.20.0 test From 44c1cfe2b4a5a8c036ac4c42ff066b58d37509c0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 10:54:19 -0400 Subject: [PATCH 1155/2268] chore: Adding release-please annotations to readme files (#1781) (#2579) * chore: Adding release-please annotations to readme files Source-Link: https://github.com/googleapis/synthtool/commit/327d46fbfc2c02ff9237c3107513bfa682a94da0 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bf5639d265d70f6137d57d42ae781a6f4e26d4085ff4e018e71350480f9b3996 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- README.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6b83f060e7..91bb69e63c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:9bf82029163bc06d58f56682afd1893a42ace3e04b0359accb86f79c6ecdc9f9 + digest: sha256:bf5639d265d70f6137d57d42ae781a6f4e26d4085ff4e018e71350480f9b3996 diff --git a/README.md b/README.md index b9b76a2a13..5e7f16f34d 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.2" ``` + ## Authentication @@ -83,7 +84,7 @@ The client application making API calls must be granted [authorization scopes][a You will need a [Google Cloud Platform Console][developer-console] project with the Cloud BigQuery [API enabled][enable-api]. You will need to [enable billing][enable-billing] to use Google Cloud BigQuery. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by -[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. ### Installation and setup @@ -347,14 +348,14 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigquery&core=gav +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.23.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles [iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects -[cloud-sdk]: https://cloud.google.com/sdk/ +[cloud-cli]: https://cloud.google.com/cli [troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting [contributing]: https://github.com/googleapis/java-bigquery/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/java-bigquery/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct From dcacc3150b3dbcd9c54038035cec3a7b1946af6c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 15:15:10 +0000 Subject: [PATCH 1156/2268] deps: update cloud client dependencies (#2583) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4cf689b0dd..675119528c 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.33.1 + 2.34.0 pom import @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.18.0 + 1.19.0 pom import @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.20.0 + 2.20.1 test From dab8be0898586792b474559a9c40e1c91033939c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 15:24:11 +0000 Subject: [PATCH 1157/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.23.2 (#2582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.23.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e7f16f34d..daeb668e57 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.23.1 + 2.23.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a4b7fe4d39..520236a792 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.23.1 + 2.23.2 From 5b3beea48cd37a26262c0c53b686789aa7211a20 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 12:39:37 -0400 Subject: [PATCH 1158/2268] chore(main): release 2.24.0 (#2564) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7757dfd594..0f8c0eca52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.24.0](https://github.com/googleapis/java-bigquery/compare/v2.23.2...v2.24.0) (2023-03-21) + + +### Features + +* Add support for clone ([#2553](https://github.com/googleapis/java-bigquery/issues/2553)) ([2186c64](https://github.com/googleapis/java-bigquery/commit/2186c64e523e030a777eec447bc1f22802f56617)) + + +### Dependencies + +* Update actions/checkout action to v3.4.0 ([#2575](https://github.com/googleapis/java-bigquery/issues/2575)) ([6935a1e](https://github.com/googleapis/java-bigquery/commit/6935a1e353d496e6de656de3431563b3527456e5)) +* Update actions/upload-artifact action to v3.1.2 ([#2571](https://github.com/googleapis/java-bigquery/issues/2571)) ([aa0c70e](https://github.com/googleapis/java-bigquery/commit/aa0c70ec6fe0ae859b0944101373ebabb0bb4600)) +* Update cloud client dependencies ([#2583](https://github.com/googleapis/java-bigquery/issues/2583)) ([dcacc31](https://github.com/googleapis/java-bigquery/commit/dcacc3150b3dbcd9c54038035cec3a7b1946af6c)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.15.0 ([#2577](https://github.com/googleapis/java-bigquery/issues/2577)) ([eaf09d6](https://github.com/googleapis/java-bigquery/commit/eaf09d65c00a742732b918478021dde3b12ac1bd)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230311-2.0.0 ([#2578](https://github.com/googleapis/java-bigquery/issues/2578)) ([aab037c](https://github.com/googleapis/java-bigquery/commit/aab037c8eb676b42231c99b5890c991095d2f8c2)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([#2580](https://github.com/googleapis/java-bigquery/issues/2580)) ([1764eeb](https://github.com/googleapis/java-bigquery/commit/1764eeb8d56ab3e5bda9b554414b5fe4d022fb72)) +* Update dependency com.google.cloud:google-cloud-storage to v2.20.0 ([#2559](https://github.com/googleapis/java-bigquery/issues/2559)) ([8a854db](https://github.com/googleapis/java-bigquery/commit/8a854dbdcb676e2b2873ddfadf514f2e401fe987)) +* Update github/codeql-action action to v2.2.7 ([#2572](https://github.com/googleapis/java-bigquery/issues/2572)) ([105f5ee](https://github.com/googleapis/java-bigquery/commit/105f5ee8d8882f79688dec685f20f44817bf313a)) + ## [2.23.2](https://github.com/googleapis/java-bigquery/compare/v2.23.1...v2.23.2) (2023-03-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8d973a3fa5..28835f3c61 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.23.3-SNAPSHOT + 2.24.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c2c9ff6914..f4555ed2b1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.23.3-SNAPSHOT + 2.24.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.23.3-SNAPSHOT + 2.24.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 675119528c..cb264307ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.23.3-SNAPSHOT + 2.24.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.23.3-SNAPSHOT + 2.24.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6f47b2f6cc..456b40bd09 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.23.3-SNAPSHOT + 2.24.0 diff --git a/versions.txt b/versions.txt index ffccc8c3d5..167ebdeebd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.23.2:2.23.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.0:2.24.0 \ No newline at end of file From cfcd4f3480916d46706857da1231e4c6b5ba8e88 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:52:12 +0000 Subject: [PATCH 1159/2268] chore(main): release 2.24.1-SNAPSHOT (#2585) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 28835f3c61..bf78dee0c6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.0 + 2.24.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f4555ed2b1..23a7f4c263 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.0 + 2.24.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.0 + 2.24.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cb264307ee..0a98633c2f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.0 + 2.24.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.0 + 2.24.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 456b40bd09..f5a5741e83 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.0 + 2.24.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 167ebdeebd..8f424596fa 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.0:2.24.0 \ No newline at end of file +google-cloud-bigquery:2.24.0:2.24.1-SNAPSHOT \ No newline at end of file From a53e5a7ea901ce0d53cced58882cdeab956fe6d8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 19:45:01 +0000 Subject: [PATCH 1160/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.1 (#2584) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0a98633c2f..c7ee92a715 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.34.0 + 2.34.1 pom import From 7269edd158051d738977e49a4eb7fe758c1a0611 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 19:45:41 +0000 Subject: [PATCH 1161/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.1 (#2586) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.1 * 🦉 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 --- README.md | 6 +++--- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index daeb668e57..9c1d361afd 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.23.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.23.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.0" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.23.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 520236a792..47a1dbb88a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.20.0 + 2.20.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f5a5741e83..f83eb078cd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.20.0 + 2.20.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 76715c4cc4..752e03c27d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.20.0 + 2.20.1 test From 7b0777924103a711f9e3066c0a52adc551f24fca Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Mar 2023 19:46:15 +0000 Subject: [PATCH 1162/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.0 (#2587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c1d361afd..162ab529ab 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.23.2 + 2.24.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 47a1dbb88a..59e537bf55 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.23.2 + 2.24.0 From 6f931d90664d41f9b07c809072b64bffedb67e04 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 20:20:12 +0000 Subject: [PATCH 1163/2268] chore(main): release 2.24.1 (#2588) :robot: I have created a release *beep* *boop* --- ## [2.24.1](https://togithub.com/googleapis/java-bigquery/compare/v2.24.0...v2.24.1) (2023-03-21) ### Dependencies * Update cloud client dependencies ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.23.2 ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) * Update dependency com.google.cloud:google-cloud-bigquery to v2.24.0 ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.1 ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) * Update dependency com.google.cloud:google-cloud-bigtable to v2.20.1 ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) * Update dependency com.google.cloud:libraries-bom to v26.10.0 ([7b07779](https://togithub.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8c0eca52..9eb79a07ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.24.1](https://github.com/googleapis/java-bigquery/compare/v2.24.0...v2.24.1) (2023-03-21) + + +### Dependencies + +* Update cloud client dependencies ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) +* Update dependency com.google.cloud:google-cloud-bigquery to v2.23.2 ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) +* Update dependency com.google.cloud:google-cloud-bigquery to v2.24.0 ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.1 ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) +* Update dependency com.google.cloud:google-cloud-bigtable to v2.20.1 ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) +* Update dependency com.google.cloud:libraries-bom to v26.10.0 ([7b07779](https://github.com/googleapis/java-bigquery/commit/7b0777924103a711f9e3066c0a52adc551f24fca)) + ## [2.24.0](https://github.com/googleapis/java-bigquery/compare/v2.23.2...v2.24.0) (2023-03-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bf78dee0c6..23c0f679ab 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.1-SNAPSHOT + 2.24.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 23a7f4c263..bf0d19c800 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.1-SNAPSHOT + 2.24.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.1-SNAPSHOT + 2.24.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c7ee92a715..55fc025211 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.1-SNAPSHOT + 2.24.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.1-SNAPSHOT + 2.24.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f83eb078cd..adab85ef5a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.1-SNAPSHOT + 2.24.1 diff --git a/versions.txt b/versions.txt index 8f424596fa..3d032fccb0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.0:2.24.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.1:2.24.1 \ No newline at end of file From cfb143cfa7302bca1f7efd69930dce211c20447a Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 21 Mar 2023 16:31:22 -0400 Subject: [PATCH 1164/2268] chore: re-configure renovate (#2589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: re-configure renovate * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- renovate.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/renovate.json b/renovate.json index c3dedcbe36..8e7ebb5b94 100644 --- a/renovate.json +++ b/renovate.json @@ -52,7 +52,8 @@ "^junit:junit", "^com.google.truth:truth", "^org.mockito:mockito-core", - "^org.objenesis:objenesis" + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-storage" ], "semanticCommitType": "test", "semanticCommitScope": "deps" @@ -68,15 +69,6 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" - }, - { - "packagePatterns": [ - "^com.google.api.grpc:proto-google-cloud-datacatalog", - "^com.google.cloud:google-cloud-datacatalog", - "^com.google.cloud:google-cloud-bigquerystorage-bom", - "^com.google.cloud:google-cloud-storage" - ], - "groupName": "cloud client dependencies" } ], "semanticCommits": true, From b42818165d258f1526950b3a9b095aed01e1354d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:31:36 -0400 Subject: [PATCH 1165/2268] chore(main): release 2.24.2-SNAPSHOT (#2590) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 23c0f679ab..4f933bf235 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.1 + 2.24.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bf0d19c800..073ca11377 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.1 + 2.24.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.1 + 2.24.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 55fc025211..c3b5d89e27 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.1 + 2.24.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.1 + 2.24.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index adab85ef5a..f6c0cd8581 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.1 + 2.24.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3d032fccb0..4a6cfd2342 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.1:2.24.1 \ No newline at end of file +google-cloud-bigquery:2.24.1:2.24.2-SNAPSHOT \ No newline at end of file From 42cffdccfddf30c72fd8e90bd78b177c9fa17e9f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Mar 2023 13:21:29 +0000 Subject: [PATCH 1166/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.1 (#2591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.1 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 162ab529ab..54881721b0 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.0 + 2.24.1 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.1" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 59e537bf55..12d661d4b0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.0 + 2.24.1 From d714b72ca0c4015af045283e12607bf33b1214b9 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 22 Mar 2023 13:01:24 -0400 Subject: [PATCH 1167/2268] chore: fix code snippet (#2592) --- .../main/java/com/google/cloud/bigquery/package-info.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java index cbd283fca2..ac3c26980f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java @@ -23,9 +23,6 @@ * CreateTable.java. * *
    {@code
    - *  try {
    - *       // Initialize client that will be used to send requests. This client only needs to be created
    - *       // once, and can be reused for multiple requests.
      *       BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
      *
      *       TableId tableId = TableId.of(datasetName, tableName);
    @@ -34,9 +31,6 @@
      *
      *       bigquery.create(tableInfo);
      *       System.out.println("Table created successfully");
    - *     } catch (BigQueryException e) {
    - *       System.out.println("Table was not created. \n" + e.toString());
    - *     }
      * 
    * * @see Google Cloud BigQuery From d306ad8189a44c066ad5305596c86fae71251055 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 22 Mar 2023 21:50:42 +0000 Subject: [PATCH 1168/2268] deps: update github/codeql-action action to v2.2.8 (#2593) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 66048b5a0a..9b3906ea5f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7 + uses: github/codeql-action/upload-sarif@67a35a08586135a9573f4327e904ecbf517a882d # v2.2.8 with: sarif_file: results.sarif From 3b047f4afdc3bd98e079e976d9f2255ccbba01c6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:04:11 +0000 Subject: [PATCH 1169/2268] chore(main): release 2.24.2 (#2594) :robot: I have created a release *beep* *boop* --- ## [2.24.2](https://togithub.com/googleapis/java-bigquery/compare/v2.24.1...v2.24.2) (2023-03-22) ### Dependencies * Update github/codeql-action action to v2.2.8 ([#2593](https://togithub.com/googleapis/java-bigquery/issues/2593)) ([d306ad8](https://togithub.com/googleapis/java-bigquery/commit/d306ad8189a44c066ad5305596c86fae71251055)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb79a07ae..4e9d216dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.24.2](https://github.com/googleapis/java-bigquery/compare/v2.24.1...v2.24.2) (2023-03-22) + + +### Dependencies + +* Update github/codeql-action action to v2.2.8 ([#2593](https://github.com/googleapis/java-bigquery/issues/2593)) ([d306ad8](https://github.com/googleapis/java-bigquery/commit/d306ad8189a44c066ad5305596c86fae71251055)) + ## [2.24.1](https://github.com/googleapis/java-bigquery/compare/v2.24.0...v2.24.1) (2023-03-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4f933bf235..d406a79d76 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.2-SNAPSHOT + 2.24.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 073ca11377..16cf036727 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.2-SNAPSHOT + 2.24.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.2-SNAPSHOT + 2.24.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c3b5d89e27..a883a26705 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.2-SNAPSHOT + 2.24.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.2-SNAPSHOT + 2.24.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f6c0cd8581..f0396cd931 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.2-SNAPSHOT + 2.24.2 diff --git a/versions.txt b/versions.txt index 4a6cfd2342..3470e6db27 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.1:2.24.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.2:2.24.2 \ No newline at end of file From 648f72e5a2cc060415c21d73b20a624f536a6c99 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:16:12 +0000 Subject: [PATCH 1170/2268] chore(main): release 2.24.3-SNAPSHOT (#2595) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d406a79d76..2072af4ed9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.2 + 2.24.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 16cf036727..93049ddd59 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.2 + 2.24.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.2 + 2.24.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a883a26705..7e9db82d99 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.2 + 2.24.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.2 + 2.24.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f0396cd931..c6ec3727da 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.2 + 2.24.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3470e6db27..f38ec96165 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.2:2.24.2 \ No newline at end of file +google-cloud-bigquery:2.24.2:2.24.3-SNAPSHOT \ No newline at end of file From 5cba6ee572c864dd645a95fee2714034c3d7877b Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 23 Mar 2023 11:28:33 -0400 Subject: [PATCH 1171/2268] chore: fix snippet (#2597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: fix snippet * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- README.md | 6 +++--- .../google/cloud/bigquery/package-info.java | 19 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 54881721b0..0cc37b56dd 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.2" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java index ac3c26980f..85c3584fd6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/package-info.java @@ -18,20 +18,19 @@ * A client for BigQuery – A fully managed, petabyte scale, low cost enterprise data warehouse for * analytics. * - *

    A simple usage example showing how to create a table in Bigquery. For the complete source code see A simple usage example showing how to create a table in Bigquery. For the complete source code + * see * CreateTable.java. * *

    {@code
    - *       BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
    - *
    - *       TableId tableId = TableId.of(datasetName, tableName);
    - *       TableDefinition tableDefinition = StandardTableDefinition.of(schema);
    - *       TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();
    - *
    - *       bigquery.create(tableInfo);
    - *       System.out.println("Table created successfully");
    - * 
    + * BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); * + * TableId tableId = TableId.of(datasetName, tableName); + * TableDefinition tableDefinition = StandardTableDefinition.of(schema); + * TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); * + * bigquery.create(tableInfo); + * System.out.println("Table created successfully"); + * } * * @see Google Cloud BigQuery */ From e191a133bce96948800a8e30e02d569c9d4c6db9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 14:28:04 +0000 Subject: [PATCH 1172/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.2 (#2596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0cc37b56dd..c89c1c068f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.1 + 2.24.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 12d661d4b0..0da5e170d4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.1 + 2.24.2 From 18891137250b16dda009fa0d1919892dde5ca99e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 14:29:17 +0000 Subject: [PATCH 1173/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.1 (#2601) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.1 * 🦉 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 --- README.md | 2 +- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c89c1c068f..d31ee1f78d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.10.0') +implementation platform('com.google.cloud:libraries-bom:26.11.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2072af4ed9..670091ed67 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.0 + 3.1.1 true diff --git a/samples/pom.xml b/samples/pom.xml index 508f6975ea..43d03461c5 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.0 + 3.1.1 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 752e03c27d..e8d8a7261d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.0 + 3.1.1 true From 9d4f2683ddf3af8313d2d10ae76a2bc99a4b17ff Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 14:29:32 +0000 Subject: [PATCH 1174/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.20.2 (#2598) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e9db82d99..1e18a3ccce 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.20.1 + 2.20.2 test From b200e512db7d14f4d796cd83c5623c010bf9dbdb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 14:29:44 +0000 Subject: [PATCH 1175/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.11.0 (#2599) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.11.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d31ee1f78d..f60689997c 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.10.0 + 26.11.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 5fe55f3936..503b1b5195 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.10.0 + 26.11.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e8d8a7261d..7a50fb2d80 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.10.0 + 26.11.0 pom import From f38d9f17fdc067392631ee3c2d2a6c658985f68d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 14:29:55 +0000 Subject: [PATCH 1176/2268] deps: update actions/checkout action to v3.5.0 (#2600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action to v3.5.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9b3906ea5f..0cb4a1e2dd 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 with: persist-credentials: false From 2015f2be679875076e7656242dad5536bf214197 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:44:12 +0000 Subject: [PATCH 1177/2268] chore(main): release 2.24.3 (#2602) :robot: I have created a release *beep* *boop* --- ## [2.24.3](https://togithub.com/googleapis/java-bigquery/compare/v2.24.2...v2.24.3) (2023-03-24) ### Dependencies * Update actions/checkout action to v3.5.0 ([#2600](https://togithub.com/googleapis/java-bigquery/issues/2600)) ([f38d9f1](https://togithub.com/googleapis/java-bigquery/commit/f38d9f17fdc067392631ee3c2d2a6c658985f68d)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e9d216dd1..4f80efbb5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.24.3](https://github.com/googleapis/java-bigquery/compare/v2.24.2...v2.24.3) (2023-03-24) + + +### Dependencies + +* Update actions/checkout action to v3.5.0 ([#2600](https://github.com/googleapis/java-bigquery/issues/2600)) ([f38d9f1](https://github.com/googleapis/java-bigquery/commit/f38d9f17fdc067392631ee3c2d2a6c658985f68d)) + ## [2.24.2](https://github.com/googleapis/java-bigquery/compare/v2.24.1...v2.24.2) (2023-03-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 670091ed67..a5ebff1c4a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.3-SNAPSHOT + 2.24.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 93049ddd59..84155099bb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.3-SNAPSHOT + 2.24.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.3-SNAPSHOT + 2.24.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1e18a3ccce..b75c2e7e6f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.3-SNAPSHOT + 2.24.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.3-SNAPSHOT + 2.24.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c6ec3727da..41f607b196 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.3-SNAPSHOT + 2.24.3 diff --git a/versions.txt b/versions.txt index f38ec96165..1a67fab33a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.2:2.24.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.3:2.24.3 \ No newline at end of file From c1e277f3b7d8f0ab60e0af52248761aa0e2903e5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:56:38 +0000 Subject: [PATCH 1178/2268] chore(main): release 2.24.4-SNAPSHOT (#2603) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a5ebff1c4a..b074dd0b31 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.3 + 2.24.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 84155099bb..d6d3d59939 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.3 + 2.24.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.3 + 2.24.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b75c2e7e6f..1242a778aa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.3 + 2.24.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.24.3 + 2.24.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 41f607b196..bbe8d734c9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.3 + 2.24.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 1a67fab33a..4a1ab356ed 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.3:2.24.3 \ No newline at end of file +google-cloud-bigquery:2.24.3:2.24.4-SNAPSHOT \ No newline at end of file From af71482ff5477b9c6989219b0e5291aa6dfddd8c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 24 Mar 2023 18:31:19 +0000 Subject: [PATCH 1179/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.3 (#2604) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.3 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f60689997c..4080d95579 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.2 + 2.24.3 ``` @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.3" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.3 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0da5e170d4..8d36fea985 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.2 + 2.24.3 From 4ff4c7069e642def8cdcd31394dfb6a8e5766774 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 27 Mar 2023 13:58:16 -0400 Subject: [PATCH 1180/2268] chore: fix scm in maven central (#2609) Fixes #2438 --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1242a778aa..63b746093f 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,8 @@ Google LLC - + scm:git:git@github.com:googleapis/java-bigquery.git scm:git:git@github.com:googleapis/java-bigquery.git https://github.com/googleapis/java-bigquery From 71f9f55225eac6d7d4a3d5f0960b28bf8769d03d Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Mon, 27 Mar 2023 15:42:21 -0400 Subject: [PATCH 1181/2268] fix: QueryWithStructsParameters sample mismatch (#2610) --- .../com/example/bigquery/QueryWithStructsParameters.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java b/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java index 10ef6c316c..5cf3ebeb69 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryWithStructsParameters.java @@ -40,15 +40,13 @@ public static void queryWithStructsParameters() { // Create struct Map struct = new HashMap<>(); - struct.put("booleanField", QueryParameterValue.bool(true)); - struct.put("integerField", QueryParameterValue.string("test-stringField")); - struct.put("stringField", QueryParameterValue.int64(10)); + struct.put("x", QueryParameterValue.int64(1)); + struct.put("y", QueryParameterValue.string("foo")); QueryParameterValue recordValue = QueryParameterValue.struct(struct); - String query = "SELECT STRUCT(@recordField) AS record"; + String query = "SELECT STRUCT(@recordField) AS s"; QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query) - .setUseLegacySql(false) .addNamedParameter("recordField", recordValue) .build(); From a328eb285b6007e0e01b059a03e71a2b5a6e7399 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 Mar 2023 15:39:09 +0100 Subject: [PATCH 1182/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230318-2.0.0 (#2607) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 63b746093f..98a381a121 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230311-2.0.0 + v2-rev20230318-2.0.0 3.5.0 11.0.0 From 24aac1489dd99ebd0133e80a21dd7309f2c17494 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 Mar 2023 15:39:40 +0100 Subject: [PATCH 1183/2268] deps: update github/codeql-action action to v2.2.9 (#2608) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 0cb4a1e2dd..6fc750d575 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@67a35a08586135a9573f4327e904ecbf517a882d # v2.2.8 + uses: github/codeql-action/upload-sarif@04df1262e6247151b5ac09cd2c303ac36ad3f62b # v2.2.9 with: sarif_file: results.sarif From 092783598ff13a187a595d307479c6969be8dca2 Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Thu, 30 Mar 2023 11:37:14 -0400 Subject: [PATCH 1184/2268] chore: Adding top and job level permissions to auto-release workflow (#2616) --- .github/workflows/auto-release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 7a106d007e..92c69857f6 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -16,7 +16,10 @@ on: pull_request: name: auto-release +permissions: + contents: read jobs: + permissions: write-all approve: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') From eac97ac03007b52e6c242f427ac21e491bfefb13 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Mar 2023 19:19:00 +0100 Subject: [PATCH 1185/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.6.0 (#2612) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 98a381a121..020848fa93 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230318-2.0.0 - 3.5.0 + 3.6.0 11.0.0 From e4aa0fef53f9eebbe09d878318521df5d070fd70 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Mar 2023 19:32:12 +0100 Subject: [PATCH 1186/2268] deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.2 (#2619) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 020848fa93..55325a60be 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.34.1 + 2.34.2 pom import From a3f98f99ab9d4508580daaeb94bea8268a3573ef Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 30 Mar 2023 14:34:12 -0400 Subject: [PATCH 1187/2268] chore: add bigquery storage dependency to deps (#2620) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- renovate.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 8e7ebb5b94..274ec500cd 100644 --- a/renovate.json +++ b/renovate.json @@ -20,7 +20,8 @@ }, { "packagePatterns": [ - "*" + "*", + "^com.google.cloud:google-cloud-bigquerystorage" ], "semanticCommitType": "deps", "semanticCommitScope": null From d3ea5467aee288fb1674a78118aa3e3c575d0711 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 18:48:12 +0000 Subject: [PATCH 1188/2268] chore(main): release 2.24.4 (#2611) :robot: I have created a release *beep* *boop* --- ## [2.24.4](https://togithub.com/googleapis/java-bigquery/compare/v2.24.3...v2.24.4) (2023-03-30) ### Bug Fixes * QueryWithStructsParameters sample mismatch ([#2610](https://togithub.com/googleapis/java-bigquery/issues/2610)) ([71f9f55](https://togithub.com/googleapis/java-bigquery/commit/71f9f55225eac6d7d4a3d5f0960b28bf8769d03d)) ### Dependencies * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230318-2.0.0 ([#2607](https://togithub.com/googleapis/java-bigquery/issues/2607)) ([a328eb2](https://togithub.com/googleapis/java-bigquery/commit/a328eb285b6007e0e01b059a03e71a2b5a6e7399)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.2 ([#2619](https://togithub.com/googleapis/java-bigquery/issues/2619)) ([e4aa0fe](https://togithub.com/googleapis/java-bigquery/commit/e4aa0fef53f9eebbe09d878318521df5d070fd70)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.6.0 ([#2612](https://togithub.com/googleapis/java-bigquery/issues/2612)) ([eac97ac](https://togithub.com/googleapis/java-bigquery/commit/eac97ac03007b52e6c242f427ac21e491bfefb13)) * Update github/codeql-action action to v2.2.9 ([#2608](https://togithub.com/googleapis/java-bigquery/issues/2608)) ([24aac14](https://togithub.com/googleapis/java-bigquery/commit/24aac1489dd99ebd0133e80a21dd7309f2c17494)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f80efbb5b..732c671f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.24.4](https://github.com/googleapis/java-bigquery/compare/v2.24.3...v2.24.4) (2023-03-30) + + +### Bug Fixes + +* QueryWithStructsParameters sample mismatch ([#2610](https://github.com/googleapis/java-bigquery/issues/2610)) ([71f9f55](https://github.com/googleapis/java-bigquery/commit/71f9f55225eac6d7d4a3d5f0960b28bf8769d03d)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230318-2.0.0 ([#2607](https://github.com/googleapis/java-bigquery/issues/2607)) ([a328eb2](https://github.com/googleapis/java-bigquery/commit/a328eb285b6007e0e01b059a03e71a2b5a6e7399)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.34.2 ([#2619](https://github.com/googleapis/java-bigquery/issues/2619)) ([e4aa0fe](https://github.com/googleapis/java-bigquery/commit/e4aa0fef53f9eebbe09d878318521df5d070fd70)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.6.0 ([#2612](https://github.com/googleapis/java-bigquery/issues/2612)) ([eac97ac](https://github.com/googleapis/java-bigquery/commit/eac97ac03007b52e6c242f427ac21e491bfefb13)) +* Update github/codeql-action action to v2.2.9 ([#2608](https://github.com/googleapis/java-bigquery/issues/2608)) ([24aac14](https://github.com/googleapis/java-bigquery/commit/24aac1489dd99ebd0133e80a21dd7309f2c17494)) + ## [2.24.3](https://github.com/googleapis/java-bigquery/compare/v2.24.2...v2.24.3) (2023-03-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b074dd0b31..9a6085c1d5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.4-SNAPSHOT + 2.24.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d6d3d59939..9b139c3a59 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.4-SNAPSHOT + 2.24.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.4-SNAPSHOT + 2.24.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 55325a60be..61d17edc46 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.4-SNAPSHOT + 2.24.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.24.4-SNAPSHOT + 2.24.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bbe8d734c9..6b5692fce8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.4-SNAPSHOT + 2.24.4 diff --git a/versions.txt b/versions.txt index 4a1ab356ed..2e734c9d64 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.3:2.24.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.4:2.24.4 \ No newline at end of file From faeb9fae08e1a10a578e080bc4e581f667c0ef96 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 19:20:13 +0000 Subject: [PATCH 1189/2268] chore(main): release 2.24.5-SNAPSHOT (#2621) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9a6085c1d5..9fd0525e26 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.4 + 2.24.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9b139c3a59..bec749a929 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.4 + 2.24.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.4 + 2.24.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 61d17edc46..b9440046cd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.4 + 2.24.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.24.4 + 2.24.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6b5692fce8..bbb21e93ed 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.4 + 2.24.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index 2e734c9d64..11a84493f8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.4:2.24.4 \ No newline at end of file +google-cloud-bigquery:2.24.4:2.24.5-SNAPSHOT \ No newline at end of file From 06af1ecc976faba0e661ec8f73b97e6c44c9a3bc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:34:26 -0400 Subject: [PATCH 1190/2268] chore: make exception for non-cloud artifacts (#1787) (#2628) * bugfix: make exception for non-cloud artifacts * change format Source-Link: https://github.com/googleapis/synthtool/commit/a86e18975db26d8e94055382c624d84643fafb86 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:944c07e458ce227ca49a423affedf088e31e2ee70908dd21682238d58f1beb60 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- README.md | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 91bb69e63c..48ad11d440 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bf5639d265d70f6137d57d42ae781a6f4e26d4085ff4e018e71350480f9b3996 + digest: sha256:944c07e458ce227ca49a423affedf088e31e2ee70908dd21682238d58f1beb60 diff --git a/README.md b/README.md index 4080d95579..9674370741 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,9 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google ``` -If you are using Maven without BOM, add this to your dependencies: +If you are using Maven without the BOM, add this to your dependencies: + ```xml @@ -59,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.4' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.4" ``` @@ -348,7 +349,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.3 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.4 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles @@ -356,7 +357,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [developer-console]: https://console.developers.google.com/ [create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects [cloud-cli]: https://cloud.google.com/cli -[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md [contributing]: https://github.com/googleapis/java-bigquery/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/java-bigquery/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/java-bigquery/blob/main/LICENSE From 594a7b4bf150a5963c149f8f5f6edd18adbf99fe Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Apr 2023 22:35:03 +0100 Subject: [PATCH 1191/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.16.0 (#2625) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.16.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9440046cd..63a2e75092 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.15.0 + 2.16.0 test From 778d872386f5868c56e3c85ba75dde3abf999600 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Apr 2023 22:35:41 +0100 Subject: [PATCH 1192/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.4 (#2622) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.4 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9674370741..0cf1a83c1f 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.3 + 2.24.4 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8d36fea985..5e392dc729 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.3 + 2.24.4 From 1a91d610aec130c90b2e80f6cf15d0f1a80889d8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Apr 2023 22:41:02 +0100 Subject: [PATCH 1193/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.2 (#2624) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5e392dc729..37a042781f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.20.1 + 2.20.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bbb21e93ed..fe20e6301f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.20.1 + 2.20.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7a50fb2d80..b1038ba757 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.20.1 + 2.20.2 test From e8f07d70f754bb6a5937af7af436714bf2301af0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:24:32 +0100 Subject: [PATCH 1194/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 (#2637) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 * 🦉 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 --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0cf1a83c1f..e684023c11 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.11.0') +implementation platform('com.google.cloud:libraries-bom:26.12.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 63a2e75092..f11e1e9b33 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230318-2.0.0 - 3.6.0 + 3.7.0 11.0.0 From d166401edd01d6d9306027d601d26d66b661de02 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:30:43 +0100 Subject: [PATCH 1195/2268] deps: update ossf/scorecard-action action to v2.1.3 (#2618) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update ossf/scorecard-action action to v2.1.3 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6fc750d575..a9b91733e2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 + uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 with: results_file: results.sarif results_format: sarif From d2ecbe4ac979ac395c4aeeebfd469e90851bed95 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:31:14 +0100 Subject: [PATCH 1196/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.16.0 (#2623) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.16.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f11e1e9b33..109fec4fcb 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.15.0 + 2.16.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 37a042781f..9af92eae8b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.15.0 + 2.16.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fe20e6301f..08876559b6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.15.0 + 2.16.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b1038ba757..0269726437 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.15.0 + 2.16.0 test From f466b514fed248b1193900ac65be3d9a5154a858 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:31:32 +0100 Subject: [PATCH 1197/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.20.0 (#2626) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.20.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.20.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 109fec4fcb..55fee069bb 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.19.0 + 1.20.0 pom import From 95e49fd47648ff1574e60ed3a1ab8dacb75df654 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:31:49 +0100 Subject: [PATCH 1198/2268] deps: update actions/checkout action to v3.5.2 (#2630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action to v3.5.2 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index a9b91733e2..0e457a6f89 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: persist-credentials: false From 3e376b146dd5dfd38ae03dd48fa1e12bc7d12ead Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:32:22 +0100 Subject: [PATCH 1199/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 (#2633) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 503b1b5195..83bf935429 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.20 + 0.9.21 test From 000f72026e1464ec698032eff6eeb31afcfa963a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:32:40 +0100 Subject: [PATCH 1200/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 (#2634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 83bf935429..74c54e3770 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.20 + 0.9.21 true com.example.bigquery.NativeImageBigquerySample From 5d8d9a6dadb901b6b89b992965f0d1af332a6328 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:40:12 +0100 Subject: [PATCH 1201/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230401-2.0.0 (#2631) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20230318-2.0.0` -> `v2-rev20230401-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230401-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230401-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230401-2.0.0/compatibility-slim/v2-rev20230318-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230401-2.0.0/confidence-slim/v2-rev20230318-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55fee069bb..1556624770 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230318-2.0.0 + v2-rev20230401-2.0.0 3.7.0 11.0.0 From 3fc62bcad9412025f7466ac4aa1c67bd0b578d08 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:43:42 +0100 Subject: [PATCH 1202/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.12.0 (#2636) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.12.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e684023c11..dd6c28296d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.11.0 + 26.12.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 74c54e3770..eb5fe378f9 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.11.0 + 26.12.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0269726437..f36407f7a4 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.11.0 + 26.12.0 pom import From 843902051342889e6d6f23a84385441f1f173930 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:44:04 +0100 Subject: [PATCH 1203/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.35.0 (#2640) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1556624770..a60d6322ae 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.34.2 + 2.35.0 pom import From aa2bc07f75db2ce4527ef2c5b4f7727b72459312 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:44:25 +0100 Subject: [PATCH 1204/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.0 (#2638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a60d6322ae..81572a0ca0 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.20.2 + 2.22.0 test From b47cf2ab7eb4e26f8f5968f8f4c5a9e13452a805 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:44:50 +0100 Subject: [PATCH 1205/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.3 (#2639) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.3 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9af92eae8b..e78385a102 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.20.2 + 2.20.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 08876559b6..be09e37f8d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.20.2 + 2.20.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f36407f7a4..0c31faaa8b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.20.2 + 2.20.3 test From b2f97e90da2891ddb59fc0291b54ebcd3d945709 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Apr 2023 16:45:08 +0100 Subject: [PATCH 1206/2268] deps: update github/codeql-action action to v2.2.12 (#2635) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.2.12 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 0e457a6f89..bfefa0e971 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@04df1262e6247151b5ac09cd2c303ac36ad3f62b # v2.2.9 + uses: github/codeql-action/upload-sarif@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # v2.2.12 with: sarif_file: results.sarif From 936ef1c5d0417698a1e06a40b785a1ffa9fc5d75 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 16:10:35 +0000 Subject: [PATCH 1207/2268] chore(main): release 2.24.5 (#2632) :robot: I have created a release *beep* *boop* --- ## [2.24.5](https://togithub.com/googleapis/java-bigquery/compare/v2.24.4...v2.24.5) (2023-04-14) ### Dependencies * Update actions/checkout action to v3.5.2 ([#2630](https://togithub.com/googleapis/java-bigquery/issues/2630)) ([95e49fd](https://togithub.com/googleapis/java-bigquery/commit/95e49fd47648ff1574e60ed3a1ab8dacb75df654)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.16.0 ([#2625](https://togithub.com/googleapis/java-bigquery/issues/2625)) ([594a7b4](https://togithub.com/googleapis/java-bigquery/commit/594a7b4bf150a5963c149f8f5f6edd18adbf99fe)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230401-2.0.0 ([#2631](https://togithub.com/googleapis/java-bigquery/issues/2631)) ([5d8d9a6](https://togithub.com/googleapis/java-bigquery/commit/5d8d9a6dadb901b6b89b992965f0d1af332a6328)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.35.0 ([8439020](https://togithub.com/googleapis/java-bigquery/commit/843902051342889e6d6f23a84385441f1f173930)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.20.0 ([#2626](https://togithub.com/googleapis/java-bigquery/issues/2626)) ([f466b51](https://togithub.com/googleapis/java-bigquery/commit/f466b514fed248b1193900ac65be3d9a5154a858)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 ([#2637](https://togithub.com/googleapis/java-bigquery/issues/2637)) ([e8f07d7](https://togithub.com/googleapis/java-bigquery/commit/e8f07d70f754bb6a5937af7af436714bf2301af0)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 ([#2633](https://togithub.com/googleapis/java-bigquery/issues/2633)) ([3e376b1](https://togithub.com/googleapis/java-bigquery/commit/3e376b146dd5dfd38ae03dd48fa1e12bc7d12ead)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 ([#2634](https://togithub.com/googleapis/java-bigquery/issues/2634)) ([000f720](https://togithub.com/googleapis/java-bigquery/commit/000f72026e1464ec698032eff6eeb31afcfa963a)) * Update github/codeql-action action to v2.2.12 ([#2635](https://togithub.com/googleapis/java-bigquery/issues/2635)) ([b2f97e9](https://togithub.com/googleapis/java-bigquery/commit/b2f97e90da2891ddb59fc0291b54ebcd3d945709)) * Update ossf/scorecard-action action to v2.1.3 ([#2618](https://togithub.com/googleapis/java-bigquery/issues/2618)) ([d166401](https://togithub.com/googleapis/java-bigquery/commit/d166401edd01d6d9306027d601d26d66b661de02)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 16 ++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 732c671f1e..3acd1ed152 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.24.5](https://github.com/googleapis/java-bigquery/compare/v2.24.4...v2.24.5) (2023-04-14) + + +### Dependencies + +* Update actions/checkout action to v3.5.2 ([#2630](https://github.com/googleapis/java-bigquery/issues/2630)) ([95e49fd](https://github.com/googleapis/java-bigquery/commit/95e49fd47648ff1574e60ed3a1ab8dacb75df654)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.16.0 ([#2625](https://github.com/googleapis/java-bigquery/issues/2625)) ([594a7b4](https://github.com/googleapis/java-bigquery/commit/594a7b4bf150a5963c149f8f5f6edd18adbf99fe)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230401-2.0.0 ([#2631](https://github.com/googleapis/java-bigquery/issues/2631)) ([5d8d9a6](https://github.com/googleapis/java-bigquery/commit/5d8d9a6dadb901b6b89b992965f0d1af332a6328)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.35.0 ([8439020](https://github.com/googleapis/java-bigquery/commit/843902051342889e6d6f23a84385441f1f173930)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.20.0 ([#2626](https://github.com/googleapis/java-bigquery/issues/2626)) ([f466b51](https://github.com/googleapis/java-bigquery/commit/f466b514fed248b1193900ac65be3d9a5154a858)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 ([#2637](https://github.com/googleapis/java-bigquery/issues/2637)) ([e8f07d7](https://github.com/googleapis/java-bigquery/commit/e8f07d70f754bb6a5937af7af436714bf2301af0)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 ([#2633](https://github.com/googleapis/java-bigquery/issues/2633)) ([3e376b1](https://github.com/googleapis/java-bigquery/commit/3e376b146dd5dfd38ae03dd48fa1e12bc7d12ead)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 ([#2634](https://github.com/googleapis/java-bigquery/issues/2634)) ([000f720](https://github.com/googleapis/java-bigquery/commit/000f72026e1464ec698032eff6eeb31afcfa963a)) +* Update github/codeql-action action to v2.2.12 ([#2635](https://github.com/googleapis/java-bigquery/issues/2635)) ([b2f97e9](https://github.com/googleapis/java-bigquery/commit/b2f97e90da2891ddb59fc0291b54ebcd3d945709)) +* Update ossf/scorecard-action action to v2.1.3 ([#2618](https://github.com/googleapis/java-bigquery/issues/2618)) ([d166401](https://github.com/googleapis/java-bigquery/commit/d166401edd01d6d9306027d601d26d66b661de02)) + ## [2.24.4](https://github.com/googleapis/java-bigquery/compare/v2.24.3...v2.24.4) (2023-03-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9fd0525e26..38b954e4a0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.5-SNAPSHOT + 2.24.5 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bec749a929..f6ee7e14a9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.5-SNAPSHOT + 2.24.5 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.5-SNAPSHOT + 2.24.5 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 81572a0ca0..feed67da2a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.5-SNAPSHOT + 2.24.5 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.24.5-SNAPSHOT + 2.24.5 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index be09e37f8d..6d3aa9bcf6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.5-SNAPSHOT + 2.24.5 diff --git a/versions.txt b/versions.txt index 11a84493f8..7ea227bbc0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.4:2.24.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.24.5:2.24.5 \ No newline at end of file From b9c2f60cb296f488cc4095b54fbcc459dc2f3fa5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Apr 2023 19:12:35 +0100 Subject: [PATCH 1208/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230408-2.0.0 (#2650) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230408-2.0.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dd6c28296d..f1b945082d 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.4' +implementation 'com.google.cloud:google-cloud-bigquery:2.24.5' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.5" ``` @@ -349,7 +349,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.4 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.5 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/pom.xml b/pom.xml index feed67da2a..9fa0174fad 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230401-2.0.0 + v2-rev20230408-2.0.0 3.7.0 11.0.0 From cc843a9c9296266380511a72ba593875dae56c43 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 19:04:37 +0000 Subject: [PATCH 1209/2268] chore(main): release 2.24.6-SNAPSHOT (#2641) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 38b954e4a0..d13800bb95 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.5 + 2.24.6-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f6ee7e14a9..ba6ab0dd36 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.5 + 2.24.6-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.5 + 2.24.6-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9fa0174fad..0db1d68be6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.5 + 2.24.6-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.24.5 + 2.24.6-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6d3aa9bcf6..6f1e9958c3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.5 + 2.24.6-SNAPSHOT diff --git a/versions.txt b/versions.txt index 7ea227bbc0..910b4bda75 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.5:2.24.5 \ No newline at end of file +google-cloud-bigquery:2.24.5:2.24.6-SNAPSHOT \ No newline at end of file From 885ecfedcac5565c7e2b3a6d931fc0ff0d55a5fe Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 16:58:47 +0200 Subject: [PATCH 1210/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.5 (#2646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.24.5 * 🦉 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 --- README.md | 4 ++-- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1b945082d..501e366f38 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.4 + 2.24.5 ``` @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.12.0') +implementation platform('com.google.cloud:libraries-bom:26.13.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e78385a102..f7975045a9 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.4 + 2.24.5 From 3ef58b1e846c9f2d875202ac523a4aa47c444a9f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 16:59:09 +0200 Subject: [PATCH 1211/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.18.0 (#2647) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.18.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0db1d68be6..27777032bd 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.16.0 + 2.18.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f7975045a9..0d3821b679 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.16.0 + 2.18.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6f1e9958c3..5c16f25099 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.16.0 + 2.18.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0c31faaa8b..f602601ce5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.16.0 + 2.18.0 test From 29bd415c5c3d3f3c433821277fcd831796daa3d2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 17:02:31 +0200 Subject: [PATCH 1212/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.18.0 (#2648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.18.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 27777032bd..39b1571cd2 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.16.0 + 2.18.0 test From b6326f3aed15d312987109009af66c7aa5a30a1d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 17:39:49 +0200 Subject: [PATCH 1213/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.22.0 (#2649) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39b1571cd2..0d5128acab 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.20.0 + 1.22.0 pom import From 87dec51c690e6a129b302691b9d795dc3dd60abe Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 17:40:16 +0200 Subject: [PATCH 1214/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.20.4 (#2651) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0d3821b679..50fe58e88b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.20.3 + 2.20.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5c16f25099..ddbeaabc5e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.20.3 + 2.20.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f602601ce5..bc9a572aaf 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.20.3 + 2.20.4 test From 22d0871851af505cae28845924ce6d244bd82cc9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 17:40:41 +0200 Subject: [PATCH 1215/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.3 (#2655) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d5128acab..054cf0f764 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.2 + 3.4.3 From 6182a3cc119abc40e963d56953af0dfb879ddf7f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 17:43:15 +0200 Subject: [PATCH 1216/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.13.0 (#2656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.13.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 501e366f38..c986a14291 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.12.0 + 26.13.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index eb5fe378f9..09fe062baf 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.12.0 + 26.13.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bc9a572aaf..0918a625c3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.12.0 + 26.13.0 pom import From d8f041b216d74e02f655a21814be03101c022e83 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 18:14:13 +0200 Subject: [PATCH 1217/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.1 (#2663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.22.0` -> `2.22.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.1/compatibility-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.1/confidence-slim/2.22.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.22.1`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2221-httpsgithubcomgoogleapisjava-storagecomparev2220v2221-2023-04-26) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.22.0...v2.22.1) ##### Bug Fixes - Introduce new BlobId#toGsUtilUriWithGeneration ([#​1998](https://togithub.com/googleapis/java-storage/issues/1998)) ([68de5c7](https://togithub.com/googleapis/java-storage/commit/68de5c7fae6df2f3df5c8c413b206bd7c7e230ea)) - Update grpc x-goog-user-project handling gracefulness ([#​1983](https://togithub.com/googleapis/java-storage/issues/1983)) ([f274739](https://togithub.com/googleapis/java-storage/commit/f2747391b6daadd6a12a2dcb54714cce237eb1ac)) ##### Documentation - Update routing annotations for CancelResumableWriteRequest and QueryWriteStatusRequest ([#​1992](https://togithub.com/googleapis/java-storage/issues/1992)) ([e36f8f1](https://togithub.com/googleapis/java-storage/commit/e36f8f1822d1290b984a8ae57efedd0276ca39f5)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 ([#​1995](https://togithub.com/googleapis/java-storage/issues/1995)) ([b7fb037](https://togithub.com/googleapis/java-storage/commit/b7fb0373955cf9d60ce46a3827152041c19e943e))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 054cf0f764..84881f0b90 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.22.0 + 2.22.1 test From 319f98eee611a10cf26582e32c9e6f8e24385565 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 18:16:52 +0200 Subject: [PATCH 1218/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.9.3 (#2660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.junit.vintage:junit-vintage-engine](https://junit.org/junit5/) ([source](https://togithub.com/junit-team/junit5)) | `5.9.2` -> `5.9.3` | [![age](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.3/compatibility-slim/5.9.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.junit.vintage:junit-vintage-engine/5.9.3/confidence-slim/5.9.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 09fe062baf..436adc9b24 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.9.2 + 5.9.3 test From 691a47abb63bd34b5c5c57439124d4713013b94c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 18:18:12 +0200 Subject: [PATCH 1219/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 (#2659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/gapic-generator-java) | `3.7.0` -> `3.8.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.8.0/compatibility-slim/3.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.8.0/confidence-slim/3.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84881f0b90..4e727fef16 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230408-2.0.0 - 3.7.0 + 3.8.0 11.0.0
    From dfd15cd575d7126f3b0ba7a91f0f5a5094db428a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 18:37:16 +0200 Subject: [PATCH 1220/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.36.0 (#2664) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e727fef16..98bd630bbd 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.35.0 + 2.36.0 pom import From 5c10a48c62fc27f248a9f497103a35731ea41d55 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Apr 2023 18:37:48 +0200 Subject: [PATCH 1221/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.21.0 (#2665) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 50fe58e88b..67034532a2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.20.4 + 2.21.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ddbeaabc5e..6c32629f1a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.20.4 + 2.21.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0918a625c3..4727327d7e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.20.4 + 2.21.0 test From 55048caf6b308dca3a0961595a4a735c44d99bbb Mon Sep 17 00:00:00 2001 From: emkornfield Date: Thu, 27 Apr 2023 14:26:13 -0400 Subject: [PATCH 1222/2268] feat: add ICEBERG format options (#2662) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) --- .../java/com/google/cloud/bigquery/FormatOptions.java | 8 ++++++++ .../java/com/google/cloud/bigquery/FormatOptionsTest.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java index 9ea5600ddc..c5acd48f6a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java @@ -43,6 +43,7 @@ public class FormatOptions implements Serializable { static final String GOOGLE_SHEETS = "GOOGLE_SHEETS"; static final String PARQUET = "PARQUET"; static final String ORC = "ORC"; + static final String ICEBERG = "ICEBERG"; private static final long serialVersionUID = -443376052020423691L; @@ -115,6 +116,11 @@ public static FormatOptions orc() { return new FormatOptions(ORC); } + /** Default options for the Apache Iceberg table format. */ + public static FormatOptions iceberg() { + return new FormatOptions(ICEBERG); + } + /** Default options for the provided format. */ public static FormatOptions of(String format) { checkArgument(!isNullOrEmpty(format), "Provided format is null or empty"); @@ -130,6 +136,8 @@ public static FormatOptions of(String format) { return bigtable(); } else if (format.equals(PARQUET)) { return parquet(); + } else if (format.equals(ICEBERG)) { + return iceberg(); } return new FormatOptions(format); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java index 2427b90abd..d3cfb6e330 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java @@ -41,6 +41,7 @@ public void testFactoryMethods() { assertEquals(FormatOptions.DATASTORE_BACKUP, FormatOptions.datastoreBackup().getType()); assertEquals(FormatOptions.AVRO, FormatOptions.avro().getType()); assertEquals(FormatOptions.GOOGLE_SHEETS, FormatOptions.googleSheets().getType()); + assertEquals(FormatOptions.ICEBERG, FormatOptions.iceberg().getType()); } @Test @@ -53,5 +54,6 @@ public void testEquals() { assertEquals( FormatOptions.datastoreBackup().hashCode(), FormatOptions.datastoreBackup().hashCode()); assertEquals(FormatOptions.googleSheets(), FormatOptions.googleSheets()); + assertEquals(FormatOptions.iceberg(), FormatOptions.iceberg()); } } From fea119b79eea54e9f0d221e1e71a2ca77957c657 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Apr 2023 00:40:12 +0200 Subject: [PATCH 1223/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.36.1 (#2668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.36.0` -> `2.36.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.36.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.36.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.36.1/compatibility-slim/2.36.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.36.1/confidence-slim/2.36.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage ### [`v2.36.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2361-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2360v2361-2023-04-27) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.36.0...v2.36.1) ##### Bug Fixes - Remove teh 30 minutes wait trying to refresh schema. Customers s… ([#​2088](https://togithub.com/googleapis/java-bigquerystorage/issues/2088)) ([3ec294f](https://togithub.com/googleapis/java-bigquerystorage/commit/3ec294f4b7db34bb44d862224189d8fc42821b7d))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 98bd630bbd..cce87ec25c 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.36.0 + 2.36.1 pom import From 02b1f23f4e8f78cef5d3cb7ae40432fcf1214f30 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 19:11:13 -0400 Subject: [PATCH 1224/2268] chore(main): release 2.25.0 (#2654) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3acd1ed152..d66330e23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.25.0](https://github.com/googleapis/java-bigquery/compare/v2.24.5...v2.25.0) (2023-04-27) + + +### Features + +* Add ICEBERG format options ([#2662](https://github.com/googleapis/java-bigquery/issues/2662)) ([55048ca](https://github.com/googleapis/java-bigquery/commit/55048caf6b308dca3a0961595a4a735c44d99bbb)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.18.0 ([#2648](https://github.com/googleapis/java-bigquery/issues/2648)) ([29bd415](https://github.com/googleapis/java-bigquery/commit/29bd415c5c3d3f3c433821277fcd831796daa3d2)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230408-2.0.0 ([#2650](https://github.com/googleapis/java-bigquery/issues/2650)) ([b9c2f60](https://github.com/googleapis/java-bigquery/commit/b9c2f60cb296f488cc4095b54fbcc459dc2f3fa5)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.36.1 ([fea119b](https://github.com/googleapis/java-bigquery/commit/fea119b79eea54e9f0d221e1e71a2ca77957c657)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.22.0 ([#2649](https://github.com/googleapis/java-bigquery/issues/2649)) ([b6326f3](https://github.com/googleapis/java-bigquery/commit/b6326f3aed15d312987109009af66c7aa5a30a1d)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 ([#2659](https://github.com/googleapis/java-bigquery/issues/2659)) ([691a47a](https://github.com/googleapis/java-bigquery/commit/691a47abb63bd34b5c5c57439124d4713013b94c)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.3 ([#2660](https://github.com/googleapis/java-bigquery/issues/2660)) ([319f98e](https://github.com/googleapis/java-bigquery/commit/319f98eee611a10cf26582e32c9e6f8e24385565)) + ## [2.24.5](https://github.com/googleapis/java-bigquery/compare/v2.24.4...v2.24.5) (2023-04-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d13800bb95..7d6dd7019d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.24.6-SNAPSHOT + 2.25.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ba6ab0dd36..cea6e7198d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.24.6-SNAPSHOT + 2.25.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.24.6-SNAPSHOT + 2.25.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cce87ec25c..c558493301 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.24.6-SNAPSHOT + 2.25.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.24.6-SNAPSHOT + 2.25.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6c32629f1a..818668ba04 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.24.6-SNAPSHOT + 2.25.0 diff --git a/versions.txt b/versions.txt index 910b4bda75..79e1d92763 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.24.5:2.24.6-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.25.0:2.25.0 \ No newline at end of file From 909a574e6857332dfc71c746c4500b601de57dcf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 13:28:38 +0000 Subject: [PATCH 1225/2268] chore(main): release 2.25.1-SNAPSHOT (#2669) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- README.md | 6 +++--- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c986a14291..949a73cc42 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.24.5' +implementation 'com.google.cloud:google-cloud-bigquery:2.25.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.24.5" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.25.0" ``` @@ -349,7 +349,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.24.5 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.25.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7d6dd7019d..ab1738a2d7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.25.0 + 2.25.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cea6e7198d..82186f4764 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.25.0 + 2.25.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.25.0 + 2.25.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c558493301..d458d7aac9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.25.0 + 2.25.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.25.0 + 2.25.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 818668ba04..9c920c12cf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.25.0 + 2.25.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 79e1d92763..7fc5c0eadf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.25.0:2.25.0 \ No newline at end of file +google-cloud-bigquery:2.25.0:2.25.1-SNAPSHOT \ No newline at end of file From e1326c8b615f392f80a09d36a1b4cef79dfea662 Mon Sep 17 00:00:00 2001 From: Jonathan Swenson Date: Thu, 4 May 2023 05:16:13 -0700 Subject: [PATCH 1226/2268] fix: Move ratio calculation for whether to use read API to avoid NPE with setUseReadAPI(false) (#2509) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Fixes #2508 ☕️ --- README.md | 2 +- .../google/cloud/bigquery/ConnectionImpl.java | 14 +++----- .../cloud/bigquery/ConnectionImplTest.java | 32 +++++++++++++++++++ 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 949a73cc42..9d3f2494c9 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.13.0') +implementation platform('com.google.cloud:libraries-bom:26.14.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index eb0072905c..17a459312b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -1203,22 +1203,18 @@ boolean isFastQuerySupported() { @VisibleForTesting boolean useReadAPI(Long totalRows, Long pageRows, Schema schema, Boolean hasQueryParameters) { - if ((totalRows == null || pageRows == null) - && Boolean.TRUE.equals( - connectionSettings - .getUseReadAPI())) { // totalRows and pageRows are returned null when the job is not - // complete - return true; - } - // Read API does not yet support Interval Type or QueryParameters if (containsIntervalType(schema) || hasQueryParameters) { logger.log(Level.INFO, "\n Schema has IntervalType, or QueryParameters. Disabling ReadAPI"); return false; } - long resultRatio = totalRows / pageRows; + if (totalRows == null || pageRows == null) { + return connectionSettings.getUseReadAPI(); + } + if (Boolean.TRUE.equals(connectionSettings.getUseReadAPI())) { + long resultRatio = totalRows / pageRows; return resultRatio >= connectionSettings.getTotalToPageRowCountRatio() && totalRows > connectionSettings.getMinResultSize(); } else { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 4b379629cf..d6348f053e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -76,6 +76,12 @@ public class ConnectionImplTest { Field.newBuilder("state_name", StandardSQLTypeName.STRING) .setMode(Field.Mode.NULLABLE) .build()); + + private static final Schema QUERY_SCHEMA_WITH_INTERVAL_FIELD = + Schema.of( + Field.newBuilder("interval", StandardSQLTypeName.INTERVAL) + .setMode(Field.Mode.NULLABLE) + .build()); private static final TableSchema FAST_QUERY_TABLESCHEMA = QUERY_SCHEMA.toPb(); private static final BigQueryResult BQ_RS_MOCK_RES = new BigQueryResultImpl(QUERY_SCHEMA, 2, null, null); @@ -661,6 +667,32 @@ public void testGetSubsequentQueryResultsWithJob() { .getSubsequentQueryResultsWithJob(10000L, 100L, jobId, GET_QUERY_RESULTS_RESPONSE, false); } + @Test + public void testUseReadApi() { + ConnectionSettings connectionSettingsSpy = Mockito.spy(ConnectionSettings.class); + doReturn(true).when(connectionSettingsSpy).getUseReadAPI(); + doReturn(2).when(connectionSettingsSpy).getTotalToPageRowCountRatio(); + doReturn(100).when(connectionSettingsSpy).getMinResultSize(); + + connection = (ConnectionImpl) bigquery.createConnection(connectionSettingsSpy); + + // defaults to connectionSettings.getUseReadAPI() when total/page rows are null (job is still + // running) + assertTrue(connection.useReadAPI(null, null, QUERY_SCHEMA, false)); + + assertFalse(connection.useReadAPI(10000L, 10000L, QUERY_SCHEMA, false)); + assertFalse(connection.useReadAPI(50L, 10L, QUERY_SCHEMA, false)); + assertTrue(connection.useReadAPI(10000L, 10L, QUERY_SCHEMA, false)); + + // interval and query parameters not supported + assertFalse(connection.useReadAPI(10000L, 10L, QUERY_SCHEMA_WITH_INTERVAL_FIELD, false)); + assertFalse(connection.useReadAPI(10000L, 10L, QUERY_SCHEMA, true)); + + doReturn(false).when(connectionSettingsSpy).getUseReadAPI(); + assertFalse(connection.useReadAPI(null, null, QUERY_SCHEMA, false)); + assertFalse(connection.useReadAPI(10000L, 10L, QUERY_SCHEMA, false)); + } + @Test public void testGetPageCacheSize() { ConnectionImpl connectionSpy = Mockito.spy(connection); From 4165e5549d7a8e8e011d7700bc791e9b470c670d Mon Sep 17 00:00:00 2001 From: David Rabinowitz Date: Thu, 4 May 2023 09:32:12 -0700 Subject: [PATCH 1227/2268] feat: add field in HivePartitioningOptions (#2678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ v] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ v] Ensure the tests and linter pass - [ v] Code coverage does not decrease (if any source code was changed) - [v ] Appropriate docs were updated (if necessary) Fixes #2677 ☕️ --- .../bigquery/HivePartitioningOptions.java | 33 ++++++++++++-- .../bigquery/HivePartitioningOptionsTest.java | 4 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 44 +++++++++++++++++++ pom.xml | 2 +- 4 files changed, 79 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/HivePartitioningOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/HivePartitioningOptions.java index db6e434ce6..7df046ee11 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/HivePartitioningOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/HivePartitioningOptions.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import com.google.common.base.MoreObjects; +import java.util.List; import java.util.Objects; /** HivePartitioningOptions currently supported types include: AVRO, CSV, JSON, ORC and Parquet. */ @@ -25,12 +26,14 @@ public final class HivePartitioningOptions { private final String mode; private final Boolean requirePartitionFilter; private final String sourceUriPrefix; + private final List fields; public static final class Builder { private String mode; private Boolean requirePartitionFilter; private String sourceUriPrefix; + private List fields; private Builder() {} @@ -38,6 +41,7 @@ private Builder(HivePartitioningOptions options) { this.mode = options.mode; this.requirePartitionFilter = options.requirePartitionFilter; this.sourceUriPrefix = options.sourceUriPrefix; + this.fields = options.fields; } /** @@ -78,6 +82,19 @@ public Builder setSourceUriPrefix(String sourceUriPrefix) { return this; } + /** + * [Output-only] For permanent external tables, this field is populated with the hive partition + * keys in the order they were inferred. + * + *

    The types of the partition keys can be deduced by checking the table schema (which will + * include the partition keys). Not every API will populate this field in the output. For + * example, Tables.Get will populate it, but Tables.List will not contain this field. + */ + public Builder setFields(List fields) { + this.fields = fields; + return this; + } + /** Creates a {@link HivePartitioningOptions} object. */ public HivePartitioningOptions build() { return new HivePartitioningOptions(this); @@ -88,6 +105,7 @@ private HivePartitioningOptions(Builder builder) { this.mode = builder.mode; this.requirePartitionFilter = builder.requirePartitionFilter; this.sourceUriPrefix = builder.sourceUriPrefix; + this.fields = builder.fields; } /* Returns the mode of hive partitioning */ @@ -108,6 +126,11 @@ public String getSourceUriPrefix() { return sourceUriPrefix; } + /* Returns the fields of hive partitioning */ + public List getFields() { + return fields; + } + /** Returns a builder for the {@link HivePartitioningOptions} object. */ public Builder toBuilder() { return new Builder(this); @@ -135,13 +158,13 @@ public boolean equals(Object obj) { && Objects.equals(mode, ((HivePartitioningOptions) obj).getMode()) && Objects.equals( requirePartitionFilter, ((HivePartitioningOptions) obj).getRequirePartitionFilter()) - && Objects.equals( - sourceUriPrefix, ((HivePartitioningOptions) obj).getSourceUriPrefix()); + && Objects.equals(sourceUriPrefix, ((HivePartitioningOptions) obj).getSourceUriPrefix()) + && Objects.equals(fields, ((HivePartitioningOptions) obj).getFields()); } @Override public int hashCode() { - return Objects.hash(mode, sourceUriPrefix); + return Objects.hash(mode, sourceUriPrefix, fields); } com.google.api.services.bigquery.model.HivePartitioningOptions toPb() { @@ -150,6 +173,7 @@ com.google.api.services.bigquery.model.HivePartitioningOptions toPb() { options.setMode(mode); options.setRequirePartitionFilter(requirePartitionFilter); options.setSourceUriPrefix(sourceUriPrefix); + options.setFields(fields); return options; } @@ -165,6 +189,9 @@ static HivePartitioningOptions fromPb( if (options.getSourceUriPrefix() != null) { builder.setSourceUriPrefix(options.getSourceUriPrefix()); } + if (options.getFields() != null) { + builder.setFields(options.getFields()); + } return builder.build(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java index 05bf05b9a1..51baf918b8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java @@ -18,6 +18,8 @@ import static com.google.common.truth.Truth.assertThat; +import java.util.Arrays; +import java.util.List; import org.junit.Test; public class HivePartitioningOptionsTest { @@ -25,11 +27,13 @@ public class HivePartitioningOptionsTest { private static final String MODE = "STRING"; private static final String SOURCE_URI_PREFIX = "gs://bucket/path_to_table"; private static final Boolean REQUIRE_PARTITION_FILTER = true; + private static final List FIELDS = Arrays.asList("FIELD1", "FIELD2"); private static final HivePartitioningOptions HIVE_PARTITIONING_OPTIONS = HivePartitioningOptions.newBuilder() .setMode(MODE) .setRequirePartitionFilter(REQUIRE_PARTITION_FILTER) .setSourceUriPrefix(SOURCE_URI_PREFIX) + .setFields(FIELDS) .build(); @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index bf59c2b67e..fda089c0ea 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5233,4 +5233,48 @@ public void testCloneTableCopyJob() throws InterruptedException { assertTrue(remoteTable.delete()); assertTrue(cloneTable.delete()); } + + @Test + public void testHivePartitioningOptionsFieldsFieldExistence() throws InterruptedException { + String tableName = "hive_partitioned_external_table"; + + // Create data on GCS + String sourceDirectory = "bigquery/hive-partitioning-table/example"; + BlobInfo blobInfo = BlobInfo.newBuilder(BUCKET, sourceDirectory + "/key=foo/data.json").build(); + assertNotNull( + "Failed to upload JSON to GCS", + storage.create(blobInfo, "{\"name\":\"bar\"}".getBytes(StandardCharsets.UTF_8))); + String sourceUri = "gs://" + BUCKET + "/" + sourceDirectory + "/*"; + String sourceUriPrefix = "gs://" + BUCKET + "/" + sourceDirectory + "/"; + + // Create the external table + HivePartitioningOptions hivePartitioningOptions = + HivePartitioningOptions.newBuilder() + .setMode("AUTO") + .setRequirePartitionFilter(true) + .setSourceUriPrefix(sourceUriPrefix) + .build(); + + TableId tableId = TableId.of(DATASET, tableName); + ExternalTableDefinition customTable = + ExternalTableDefinition.newBuilder(sourceUri, FormatOptions.json()) + .setAutodetect(true) + .setHivePartitioningOptions(hivePartitioningOptions) + .build(); + bigquery.create(TableInfo.of(tableId, customTable)); + + // Validate the existence of the field HivePartitioningOptions.fields + Table table = bigquery.getTable(tableId); + assertThat(table).isNotNull(); + HivePartitioningOptions options = + ((ExternalTableDefinition) table.getDefinition()).getHivePartitioningOptions(); + List fields = options.getFields(); + assertThat(fields).isNotNull(); + assertThat(fields).hasSize(1); + assertThat(fields).contains("key"); + + // Clean up + assertTrue(table.delete()); + assertTrue(storage.delete(blobInfo.getBlobId())); + } } diff --git a/pom.xml b/pom.xml index d458d7aac9..22615bb3cb 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230408-2.0.0 + v2-rev20230422-2.0.0 3.8.0 11.0.0 From 4c01698e571d7adbaf914984cdf65f6c35e4edb8 Mon Sep 17 00:00:00 2001 From: emkornfield Date: Fri, 5 May 2023 11:48:12 -0400 Subject: [PATCH 1228/2268] feat: Allow passing autodetect_schema on table update (#2661) Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - Didn't open an issue because this seems trivial, happy to adapt if necessary. - [x ] Ensure the tests and linter pass (mvn test verify - [x ] Code coverage does not decrease (if any source code was changed) - [x ] Appropriate docs were updated (if necessary) --- .../com/google/cloud/bigquery/BigQuery.java | 8 ++++ .../cloud/bigquery/spi/v2/BigQueryRpc.java | 1 + .../bigquery/spi/v2/HttpBigQueryRpc.java | 1 + .../cloud/bigquery/BigQueryImplTest.java | 18 +++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 39 +++++++++++++++++++ 5 files changed, 67 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index bfcdc542ab..8f11d03fa0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -376,6 +376,14 @@ public static TableOption fields(TableField... fields) { return new TableOption( BigQueryRpc.Option.FIELDS, Helper.selector(TableField.REQUIRED_FIELDS, fields)); } + + /** + * Returns an option to specify the schema of the table (only applicable for external tables) + * should be autodetected when updating the table from the underlying source. + */ + public static TableOption autodetectSchema(boolean autodetect) { + return new TableOption(BigQueryRpc.Option.AUTODETECT_SCHEMA, autodetect); + } } /* Class for specifying IAM options. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index eecf5d36f5..33480a91b3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -46,6 +46,7 @@ enum Option { DELETE_CONTENTS("deleteContents"), ALL_DATASETS("all"), ALL_USERS("allUsers"), + AUTODETECT_SCHEMA("autodetectSchema"), LABEL_FILTER("filter"), MIN_CREATION_TIME("minCreationTime"), MAX_CREATION_TIME("maxCreationTime"), diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 6bad06199b..a85e4b6bfe 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -279,6 +279,7 @@ public Table patch(Table table, Map options) { .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)) + .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)) .execute(); } catch (IOException ex) { throw translate(ex); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 80ba366f81..3bbdb98fd3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -1260,6 +1260,24 @@ public void testUpdateTableWithSelectedFields() { .patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); } + @Test + public void testUpdateTableWithAutoDetectSchema() { + TableInfo updatedTableInfo = TABLE_INFO.toBuilder().setDescription("newDescription").build(); + TableInfo updatedTableInfoWithProject = + TABLE_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); + when(bigqueryRpcMock.patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture())) + .thenReturn(updatedTableInfoWithProject.toPb()); + bigquery = options.getService(); + Table table = bigquery.update(updatedTableInfo, BigQuery.TableOption.autodetectSchema(true)); + Boolean selector = + (Boolean) capturedOptions.getValue().get(BigQueryRpc.Option.AUTODETECT_SCHEMA); + assertTrue(selector); + assertEquals( + new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfoWithProject)), table); + verify(bigqueryRpcMock) + .patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); + } + @Test public void testInsertAllWithRowIdShouldRetry() { Map row1 = ImmutableMap.of("field", "value1"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index fda089c0ea..6d61fd2114 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1566,6 +1566,45 @@ public void testSetPermExternalTableSchema() { assertTrue(remoteTable.delete()); } + @Test + public void testUpdatePermExternableTableWithAutodetectSchemaUpdatesSchema() { + String tableName = "test_create_external_table_perm_with_auto_detect"; + TableId tableId = TableId.of(DATASET, tableName); + Schema setSchema = Schema.of(TIMESTAMP_FIELD_SCHEMA, STRING_FIELD_SCHEMA); + + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder( + "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) + .setSchema(setSchema) + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertEquals(setSchema, remoteTable.getDefinition().getSchema()); + + Table updatedTable = + bigquery.update( + createdTable + .toBuilder() + .setDefinition( + ((ExternalTableDefinition) createdTable.getDefinition()) + .toBuilder() + .setSchema(null) + .setAutodetect(true) + .build()) + .build(), + BigQuery.TableOption.autodetectSchema(true)); + // Schema should change. + assertTrue(!updatedTable.getDefinition().getSchema().equals(setSchema)); + + assertTrue(remoteTable.delete()); + } + @Test public void testCreateViewTable() throws InterruptedException { String tableName = "test_create_view_table"; From 92e47622e31a036be1504c571623610c3b3d8562 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Tue, 9 May 2023 10:00:23 -0400 Subject: [PATCH 1229/2268] chore(deps): update ghcr.io/graalvm/graalvm-ce docker tag to v22.3.2 (#2684) Native Image checks run as continuous jobs in bigquery. --- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 9c1849588c..9eea05bada 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index de44999b8e..5150fb2924 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2" } env_vars: { From cf5d758fe6aad4b374c34940aa93f8060f779505 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:20:23 +0200 Subject: [PATCH 1230/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.22 (#2687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.21` -> `0.9.22` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.22/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.22/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.22/compatibility-slim/0.9.21)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.22/confidence-slim/0.9.21)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes

    graalvm/native-build-tools ### [`v0.9.22`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.22) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.21...0.9.22) #### What's Changed - Fix lookup of metadata repository by [@​melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/425](https://togithub.com/graalvm/native-build-tools/pull/425) - Add support for `default-for` attribute by [@​sdeleuze](https://togithub.com/sdeleuze) in [https://togithub.com/graalvm/native-build-tools/pull/432](https://togithub.com/graalvm/native-build-tools/pull/432) - Bump metadata version to 0.3.0 by [@​dnestoro](https://togithub.com/dnestoro) in [https://togithub.com/graalvm/native-build-tools/pull/434](https://togithub.com/graalvm/native-build-tools/pull/434) **Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.21...0.9.22
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 436adc9b24..47cff01698 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.21 + 0.9.22 test From 55596590e0d0c7018201468a4b11911b1cdc3f4b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:20:28 +0200 Subject: [PATCH 1231/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.2 (#2686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.22.1` -> `2.22.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.2/compatibility-slim/2.22.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.22.2/confidence-slim/2.22.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.22.2`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2222-httpsgithubcomgoogleapisjava-storagecomparev2221v2222-2023-05-09) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.22.1...v2.22.2) ##### Bug Fixes - Make Blob and Bucket update diff aware ([#​1994](https://togithub.com/googleapis/java-storage/issues/1994)) ([0adeb14](https://togithub.com/googleapis/java-storage/commit/0adeb14479fc9aef35e32d286bcd9ae414eda25a)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 ([#​2010](https://togithub.com/googleapis/java-storage/issues/2010)) ([27b9014](https://togithub.com/googleapis/java-storage/commit/27b9014a9dd67ee209c2ef59b0347a1a8beab257)) - Update dependency org.junit.vintage:junit-vintage-engine to v5.9.3 ([#​1996](https://togithub.com/googleapis/java-storage/issues/1996)) ([7839768](https://togithub.com/googleapis/java-storage/commit/7839768123d7e8a5a28076b6cc32dc0cd983d540)) - Update junit-platform.version to v5.9.3 ([#​1997](https://togithub.com/googleapis/java-storage/issues/1997)) ([5683340](https://togithub.com/googleapis/java-storage/commit/56833407f12f7efba423c0b7779a66c6f956777c))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 22615bb3cb..395a38d44e 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.22.1 + 2.22.2 test From 36abdcf7c3ceabe4861aeda8a008f9730784602d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:22:12 +0200 Subject: [PATCH 1232/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.23.1 (#2676) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.21.0` -> `2.23.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.23.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.23.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.23.1/compatibility-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.23.1/confidence-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable ### [`v2.23.1`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2231-httpsgithubcomgoogleapisjava-bigtablecomparev2230v2231-2023-05-11) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.23.0...v2.23.1) ##### Dependencies - Update dependency com.google.cloud:google-cloud-monitoring-bom to v3.18.0 ([#​1749](https://togithub.com/googleapis/java-bigtable/issues/1749)) ([1d7d391](https://togithub.com/googleapis/java-bigtable/commit/1d7d39145eefc5cbf6d015fd60a4d49441f88d1f)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 ([#​1744](https://togithub.com/googleapis/java-bigtable/issues/1744)) ([60df07f](https://togithub.com/googleapis/java-bigtable/commit/60df07fcfa653291d9e5882cf3386f13813e2883)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.22 ([#​1746](https://togithub.com/googleapis/java-bigtable/issues/1746)) ([86ea9db](https://togithub.com/googleapis/java-bigtable/commit/86ea9db830f6d5f7dc0b08886bce084b4650d281)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.22 ([#​1747](https://togithub.com/googleapis/java-bigtable/issues/1747)) ([caa4462](https://togithub.com/googleapis/java-bigtable/commit/caa44627d6a124d1a58d85a510962c8a7caee69b)) ### [`v2.23.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2230-httpsgithubcomgoogleapisjava-bigtablecomparev2220v2230-2023-05-09) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.22.0...v2.23.0) ##### Features - Resizing channel pool size based on the work load ([#​1271](https://togithub.com/googleapis/java-bigtable/issues/1271)) ([7fb1a09](https://togithub.com/googleapis/java-bigtable/commit/7fb1a09224e1ea05cfec6eb35deaba670d1d82d2)) ##### Documentation - Clean up BetaApi annotations from built in metrics API ([#​1741](https://togithub.com/googleapis/java-bigtable/issues/1741)) ([c2fbd04](https://togithub.com/googleapis/java-bigtable/commit/c2fbd04eb64ddcfe7ea0f234f22d0691094646a4)) ### [`v2.22.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2220-httpsgithubcomgoogleapisjava-bigtablecomparev2210v2220-2023-05-02) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.21.0...v2.22.0) ##### Features - Add APIs to enable batch write flow control ([#​1730](https://togithub.com/googleapis/java-bigtable/issues/1730)) ([b518d68](https://togithub.com/googleapis/java-bigtable/commit/b518d6851429db640e80ab78b3f827bb334f5409)) - Add rate limiting callable ([#​1729](https://togithub.com/googleapis/java-bigtable/issues/1729)) ([ee0da11](https://togithub.com/googleapis/java-bigtable/commit/ee0da11664d978e808d1088a419cdbd2270da147)) - Send feature flag when flow control is enabled ([#​1731](https://togithub.com/googleapis/java-bigtable/issues/1731)) ([ba147c3](https://togithub.com/googleapis/java-bigtable/commit/ba147c3520be27f4f3e622f3ef69fab716895dbe)) ##### Bug Fixes - Add feature flag proto to BUILD file ([#​1726](https://togithub.com/googleapis/java-bigtable/issues/1726)) ([7e5c646](https://togithub.com/googleapis/java-bigtable/commit/7e5c646031de22c42bb3dd81774ccd6762bd91ed))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 67034532a2..a5d7de566b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.21.0 + 2.23.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9c920c12cf..6230c8e37c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.21.0 + 2.23.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4727327d7e..11cc92d82c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.21.0 + 2.23.1 test From b74da296e2d2739adb481cda417d51569d1acc51 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:22:17 +0200 Subject: [PATCH 1233/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 (#2685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/gapic-generator-java) | `3.8.0` -> `3.9.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.9.0/compatibility-slim/3.8.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.9.0/confidence-slim/3.8.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 395a38d44e..76059ba9ae 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230422-2.0.0 - 3.8.0 + 3.9.0 11.0.0
    From 3c06abbccd61bf910873489ebf2ac0b9a3f2faf7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:24:22 +0200 Subject: [PATCH 1234/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.14.0 (#2679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.13.0` -> `26.14.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.14.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.14.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.14.0/compatibility-slim/26.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.14.0/confidence-slim/26.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-cloud-bom ### [`v26.14.0`](https://togithub.com/googleapis/java-cloud-bom/blob/HEAD/CHANGELOG.md#​26140-httpsgithubcomgoogleapisjava-cloud-bomcomparev26130v26140-2023-05-02) [Compare Source](https://togithub.com/googleapis/java-cloud-bom/compare/v26.13.0...v26.14.0) ##### Dependencies - update dependency com.google.cloud:first-party-dependencies to v3.8.0 ([#​5943](https://togithub.com/googleapis/java-cloud-bom/issues/5943)) ([a21b99b](https://togithub.com/googleapis/java-cloud-bom/commit/a21b99bfb952b3a8387a02bf69c755b8f987b88c)) - update dependency com.google.cloud:gapic-libraries-bom to v1.10.0 ([#​5949](https://togithub.com/googleapis/java-cloud-bom/issues/5949)) ([86615dd](https://togithub.com/googleapis/java-cloud-bom/commit/86615dd3713b75f0f9e3c13e14722ea18ef9869d)) - update dependency com.google.cloud:google-cloud-bigquery to v2.25.0 ([#​5958](https://togithub.com/googleapis/java-cloud-bom/issues/5958)) ([1589569](https://togithub.com/googleapis/java-cloud-bom/commit/1589569398ac0f52e0ab0588e1dad0c872197d93)) - update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.36.1 ([#​5948](https://togithub.com/googleapis/java-cloud-bom/issues/5948)) ([48d7962](https://togithub.com/googleapis/java-cloud-bom/commit/48d7962fd5d3d075c0bef4490970a19a3a025da5)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.21.0 ([#​5953](https://togithub.com/googleapis/java-cloud-bom/issues/5953)) ([4477816](https://togithub.com/googleapis/java-cloud-bom/commit/4477816136ad21dd116febf87e141ccab9491379)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.22.0 ([#​5966](https://togithub.com/googleapis/java-cloud-bom/issues/5966)) ([3ebccb6](https://togithub.com/googleapis/java-cloud-bom/commit/3ebccb64233350248ddc8db16dcab01e20c009f8)) - update dependency com.google.cloud:google-cloud-datastore-bom to v2.14.5 ([#​5945](https://togithub.com/googleapis/java-cloud-bom/issues/5945)) ([9c88e22](https://togithub.com/googleapis/java-cloud-bom/commit/9c88e2244ecdb285aeb55879c1f329cd7d797487)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.10.0 ([#​5965](https://togithub.com/googleapis/java-cloud-bom/issues/5965)) ([3c34d63](https://togithub.com/googleapis/java-cloud-bom/commit/3c34d63e89e39c3043137d4c1be4ce0ad95e2775)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.9.6 ([#​5944](https://togithub.com/googleapis/java-cloud-bom/issues/5944)) ([82a8435](https://togithub.com/googleapis/java-cloud-bom/commit/82a84356e440e00c16cb5928ec802239b31d3151)) - update dependency com.google.cloud:google-cloud-logging-bom to v3.14.9 ([#​5947](https://togithub.com/googleapis/java-cloud-bom/issues/5947)) ([9f7a645](https://togithub.com/googleapis/java-cloud-bom/commit/9f7a645b75ac24a3e5f5973ae267e16676f314e9)) - update dependency com.google.cloud:google-cloud-logging-logback to v0.130.11-alpha ([#​5954](https://togithub.com/googleapis/java-cloud-bom/issues/5954)) ([4c1e32c](https://togithub.com/googleapis/java-cloud-bom/commit/4c1e32c21c912a94846671f69d22cd9b5144d84b)) - update dependency com.google.cloud:google-cloud-nio to v0.126.14 ([#​5955](https://togithub.com/googleapis/java-cloud-bom/issues/5955)) ([866a0fe](https://togithub.com/googleapis/java-cloud-bom/commit/866a0fe28eb1ae9dcdaa6dd08617d90493bc1a62)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.11 ([#​5952](https://togithub.com/googleapis/java-cloud-bom/issues/5952)) ([4a2a6ce](https://togithub.com/googleapis/java-cloud-bom/commit/4a2a6ce2972a30809cdc0647b716021fc4b6484b)) - update dependency com.google.cloud:google-cloud-pubsublite-bom to v1.12.4 ([#​5956](https://togithub.com/googleapis/java-cloud-bom/issues/5956)) ([865229e](https://togithub.com/googleapis/java-cloud-bom/commit/865229e9c951d7f99f5d372ef8d1978887bb6a18)) - update dependency com.google.cloud:google-cloud-spanner-bom to v6.41.0 ([#​5959](https://togithub.com/googleapis/java-cloud-bom/issues/5959)) ([7c07f17](https://togithub.com/googleapis/java-cloud-bom/commit/7c07f174e1580f2e52536af23e49aef482db96dc)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.9.13 ([#​5957](https://togithub.com/googleapis/java-cloud-bom/issues/5957)) ([bd5c9db](https://togithub.com/googleapis/java-cloud-bom/commit/bd5c9db91de214fa67dee7dcc3644c2e67a7e06b)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.9.14 ([#​5964](https://togithub.com/googleapis/java-cloud-bom/issues/5964)) ([d36fff1](https://togithub.com/googleapis/java-cloud-bom/commit/d36fff18b0d0ca894dd1a2c1eada50ad87c29d1a)) - update dependency com.google.cloud:google-cloud-storage-bom to v2.22.1 ([#​5946](https://togithub.com/googleapis/java-cloud-bom/issues/5946)) ([c5ed86b](https://togithub.com/googleapis/java-cloud-bom/commit/c5ed86be206459fbca0b52cf2adc4f1d8bac421f)) - update dependency com.google.googlejavaformat:google-java-format to v1.17.0 ([#​5963](https://togithub.com/googleapis/java-cloud-bom/issues/5963)) ([6579e69](https://togithub.com/googleapis/java-cloud-bom/commit/6579e69e0c00e8c8fa9fc2edaea8988b0ee43ba7))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9d3f2494c9..71679584f0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.13.0 + 26.14.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 47cff01698..05451a9fa0 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.13.0 + 26.14.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 11cc92d82c..877ac0e067 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.13.0 + 26.14.0 pom import From 50a52a159b69cd0d04f0a6955a58d9067c523d74 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:26:12 +0200 Subject: [PATCH 1235/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.25.0 (#2670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.24.5` -> `2.25.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.25.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.25.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.25.0/compatibility-slim/2.24.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.25.0/confidence-slim/2.24.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery ### [`v2.25.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2250-httpsgithubcomgoogleapisjava-bigquerycomparev2245v2250-2023-04-27) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.24.5...v2.25.0) ##### Features - Add ICEBERG format options ([#​2662](https://togithub.com/googleapis/java-bigquery/issues/2662)) ([55048ca](https://togithub.com/googleapis/java-bigquery/commit/55048caf6b308dca3a0961595a4a735c44d99bbb)) ##### Dependencies - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.18.0 ([#​2648](https://togithub.com/googleapis/java-bigquery/issues/2648)) ([29bd415](https://togithub.com/googleapis/java-bigquery/commit/29bd415c5c3d3f3c433821277fcd831796daa3d2)) - Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230408-2.0.0 ([#​2650](https://togithub.com/googleapis/java-bigquery/issues/2650)) ([b9c2f60](https://togithub.com/googleapis/java-bigquery/commit/b9c2f60cb296f488cc4095b54fbcc459dc2f3fa5)) - Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.36.1 ([fea119b](https://togithub.com/googleapis/java-bigquery/commit/fea119b79eea54e9f0d221e1e71a2ca77957c657)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.22.0 ([#​2649](https://togithub.com/googleapis/java-bigquery/issues/2649)) ([b6326f3](https://togithub.com/googleapis/java-bigquery/commit/b6326f3aed15d312987109009af66c7aa5a30a1d)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 ([#​2659](https://togithub.com/googleapis/java-bigquery/issues/2659)) ([691a47a](https://togithub.com/googleapis/java-bigquery/commit/691a47abb63bd34b5c5c57439124d4713013b94c)) - Update dependency org.junit.vintage:junit-vintage-engine to v5.9.3 ([#​2660](https://togithub.com/googleapis/java-bigquery/issues/2660)) ([319f98e](https://togithub.com/googleapis/java-bigquery/commit/319f98eee611a10cf26582e32c9e6f8e24385565))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71679584f0..0f0544b7ef 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.24.5 + 2.25.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a5d7de566b..c60c1d8334 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.24.5 + 2.25.0 From 0c445b4525b9b56b2c8b66de3a46dc44dd5f31ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:28:18 +0200 Subject: [PATCH 1236/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.1.0 (#2682) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-surefire-plugin](https://maven.apache.org/surefire/) | `3.0.0` -> `3.1.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.1.0/compatibility-slim/3.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-surefire-plugin/3.1.0/confidence-slim/3.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 05451a9fa0..9cfe8fc884 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0 + 3.1.0 **/*IT From 7700cf588d4a6d3b3267d8fd51eaf8aed1752506 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 May 2023 22:34:21 +0200 Subject: [PATCH 1237/2268] deps: update arrow.version to v12 (major) (#2675) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `11.0.0` -> `12.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/12.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/12.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/12.0.0/compatibility-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-netty/12.0.0/confidence-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `11.0.0` -> `12.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/12.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/12.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/12.0.0/compatibility-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-memory-core/12.0.0/confidence-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `11.0.0` -> `12.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/12.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/12.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/12.0.0/compatibility-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.arrow:arrow-vector/12.0.0/confidence-slim/11.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 76059ba9ae..c0b548d613 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ google-cloud-bigquery-parent v2-rev20230422-2.0.0 3.9.0 - 11.0.0 + 12.0.0
    From a8ee5b3b3b16c5f7cf50ce851359e23ced0aae50 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 May 2023 15:32:18 +0200 Subject: [PATCH 1238/2268] build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.4.0 (#2693) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.codehaus.mojo:build-helper-maven-plugin](https://www.mojohaus.org/build-helper-maven-plugin/) ([source](https://togithub.com/mojohaus/build-helper-maven-plugin)) | `3.3.0` -> `3.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.codehaus.mojo:build-helper-maven-plugin/3.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.codehaus.mojo:build-helper-maven-plugin/3.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.codehaus.mojo:build-helper-maven-plugin/3.4.0/compatibility-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.codehaus.mojo:build-helper-maven-plugin/3.4.0/confidence-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    mojohaus/build-helper-maven-plugin ### [`v3.4.0`](https://togithub.com/mojohaus/build-helper-maven-plugin/releases/tag/3.4.0) ##### Changes ##### 🚀 New features and improvements - Get rid of ArtifactRepository - ${localRepository} ([#​179](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/179)) [@​slawekjaranowski](https://togithub.com/slawekjaranowski) - Added a property name to the "sources" parameter for CLI usage ([#​157](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/157)) [@​gjd6640](https://togithub.com/gjd6640) ##### 🐛 Bug Fixes - Use UTF-8 for the pom ([#​173](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/173)) [@​gnodet](https://togithub.com/gnodet) ##### 📦 Dependency updates - Bump maven-plugin-annotations from 3.8.1 to 3.8.2 ([#​177](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/177)) [@​dependabot](https://togithub.com/dependabot) - Bump parent from 72 to 74 ([#​175](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/175)) [@​slawekjaranowski](https://togithub.com/slawekjaranowski) - Bump maven-invoker-plugin to 3.5.1 - add support to run its with Java 20 ([#​172](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/172)) [@​slachiewicz](https://togithub.com/slachiewicz) - Bump actions/stale from 7 to 8 ([#​171](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/171)) [@​dependabot](https://togithub.com/dependabot) - Bump maven-plugin-annotations from 3.7.1 to 3.8.1 ([#​169](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/169)) [@​dependabot](https://togithub.com/dependabot) - Bump plexus-utils from 3.5.0 to 3.5.1 ([#​170](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/170)) [@​dependabot](https://togithub.com/dependabot) - Bump mojo-parent from 70 to 72 ([#​165](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/165)) [@​dependabot](https://togithub.com/dependabot) - Bump assertj-core from 3.24.1 to 3.24.2 ([#​164](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/164)) [@​dependabot](https://togithub.com/dependabot) - Bump maven-plugin-annotations from 3.7.0 to 3.7.1 ([#​163](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/163)) [@​dependabot](https://togithub.com/dependabot) - Bump assertj-core from 3.24.0 to 3.24.1 ([#​162](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/162)) [@​dependabot](https://togithub.com/dependabot) - Bump assertj-core from 3.23.1 to 3.24.0 ([#​161](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/161)) [@​dependabot](https://togithub.com/dependabot) - Bump actions/stale from 6 to 7 ([#​160](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/160)) [@​dependabot](https://togithub.com/dependabot) - Bump maven-plugin-annotations from 3.6.4 to 3.7.0 ([#​158](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/158)) [@​dependabot](https://togithub.com/dependabot) - Bump plexus-utils from 3.4.2 to 3.5.0 ([#​151](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/151)) [@​dependabot](https://togithub.com/dependabot) - Bump mojo-parent from 69 to 70 ([#​141](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/141)) [@​dependabot](https://togithub.com/dependabot) - Bump mojo-parent from 68 to 69 ([#​140](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/140)) [@​dependabot](https://togithub.com/dependabot) - Bump mojo-parent from 67 to 68 ([#​138](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/138)) [@​dependabot](https://togithub.com/dependabot) - Bump assertj-core from 3.22.0 to 3.23.1 ([#​137](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/137)) [@​dependabot](https://togithub.com/dependabot) - Bump plexus-utils from 3.4.1 to 3.4.2 ([#​135](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/135)) [@​dependabot](https://togithub.com/dependabot) - Bump actions/stale from 4 to 5 ([#​132](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/132)) [@​dependabot](https://togithub.com/dependabot) - Bump actions/setup-java from 2 to 3 ([#​133](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/133)) [@​dependabot](https://togithub.com/dependabot) - Bump mojo-parent from 65 to 67 ([#​130](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/130)) [@​dependabot](https://togithub.com/dependabot) - Bump actions/checkout from 2 to 3 ([#​128](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/128)) [@​dependabot](https://togithub.com/dependabot) - Bump maven-plugin-annotations from 3.6.2 to 3.6.4 ([#​126](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/126)) [@​dependabot](https://togithub.com/dependabot) - Bump release-drafter/release-drafter from 5.15.0 to 5.16.1 ([#​123](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/123)) [@​dependabot](https://togithub.com/dependabot) - Bump testng from 7.4.0 to 7.5 ([#​122](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/122)) [@​dependabot](https://togithub.com/dependabot) - Bump plexus-utils from 3.0.24 to 3.4.1 ([#​121](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/121)) [@​dependabot](https://togithub.com/dependabot) ##### 👻 Maintenance - Enable spotless for code formatting ([#​180](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/180)) [@​slawekjaranowski](https://togithub.com/slawekjaranowski) - Move tests to Junit 5 ([#​174](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/174)) [@​slachiewicz](https://togithub.com/slachiewicz) - Declare Maven Core dependencies as provided ([#​125](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/125)) [@​stefanseifert](https://togithub.com/stefanseifert) - Use only major version (v5) of release drafter ([#​124](https://togithub.com/mojohaus/build-helper-maven-plugin/pull/124)) [@​stefanseifert](https://togithub.com/stefanseifert)
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- google-cloud-bigquery/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 82186f4764..442051a5a3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -187,7 +187,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.4.0 add-source diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c60c1d8334..303481bd7d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -92,7 +92,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.4.0 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6230c8e37c..ab5c1a16a9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.4.0 add-snippets-source From f56e54161894c3be6e975ac102454afca4c9b058 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 May 2023 15:36:13 +0200 Subject: [PATCH 1239/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.23.0 (#2692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.22.0` -> `1.23.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.23.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.23.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.23.0/compatibility-slim/1.22.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.23.0/confidence-slim/1.22.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0b548d613..085fbe7557 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.22.0 + 1.23.0 pom import From 1dd31e4f8743757d4a0d62b87e8afa36f1a0eb83 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 May 2023 15:36:22 +0200 Subject: [PATCH 1240/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.19.0 (#2690) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.18.0` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.19.0/compatibility-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.19.0/confidence-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 085fbe7557..49b7b10488 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.18.0 + 2.19.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 303481bd7d..331ac4ea1e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.18.0 + 2.19.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ab5c1a16a9..f5625554f8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.18.0 + 2.19.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 877ac0e067..330260257c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.18.0 + 2.19.0 test From 193980319cb743e6b6c67648ddb21432e5e69ff8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 May 2023 15:40:20 +0200 Subject: [PATCH 1241/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.19.0 (#2691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.18.0` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.19.0/compatibility-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.19.0/confidence-slim/2.18.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 49b7b10488..2aff0d2691 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.18.0 + 2.19.0 test From c4eba81bf0cd1b8916824931ca00313de40d4cba Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 12 May 2023 14:56:15 -0400 Subject: [PATCH 1242/2268] chore: remove duplicate Query sample (#2697) --- README.md | 1 - .../main/java/com/example/bigquery/Query.java | 70 ------------------- .../java/com/example/bigquery/QueryIT.java | 65 ----------------- 3 files changed, 136 deletions(-) delete mode 100644 samples/snippets/src/main/java/com/example/bigquery/Query.java delete mode 100644 samples/snippets/src/test/java/com/example/bigquery/QueryIT.java diff --git a/README.md b/README.md index 0f0544b7ef..e7c05fa680 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Load Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadPartitionedTable.java) | | Load Table Clustered | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadTableClustered.java) | | Nested Repeated Schema | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/NestedRepeatedSchema.java) | -| Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/Query.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/Query.java) | | Query Batch | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryBatch.java) | | Query Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryClusteredTable.java) | | Query Destination Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryDestinationTableCmek.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/Query.java b/samples/snippets/src/main/java/com/example/bigquery/Query.java deleted file mode 100644 index 8b293cd0b5..0000000000 --- a/samples/snippets/src/main/java/com/example/bigquery/Query.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.bigquery; - -// [START bigquery_query] -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryException; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.QueryJobConfiguration; -import com.google.cloud.bigquery.TableResult; - -// Sample to query in a table -public class Query { - - public static void main(String[] args) { - // TODO(developer): Replace these variables before running the sample. - String projectId = "MY_PROJECT_ID"; - String datasetName = "MY_DATASET_NAME"; - String tableName = "MY_TABLE_NAME"; - String query = - "SELECT name, SUM(number) as total_people\n" - + " FROM `" - + projectId - + "." - + datasetName - + "." - + tableName - + "`" - + " WHERE state = 'TX'" - + " GROUP BY name, state" - + " ORDER BY total_people DESC" - + " LIMIT 20"; - query(query); - } - - public static void query(String query) { - try { - // Initialize client that will be used to send requests. This client only needs to be created - // once, and can be reused for multiple requests. - BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); - - QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build(); - - TableResult results = bigquery.query(queryConfig); - - results - .iterateAll() - .forEach(row -> row.forEach(val -> System.out.printf("%s,", val.toString()))); - - System.out.println("Query performed successfully."); - } catch (BigQueryException | InterruptedException e) { - System.out.println("Query not performed \n" + e.toString()); - } - } -} -// [END bigquery_query] diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryIT.java deleted file mode 100644 index 23aa8d409c..0000000000 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryIT.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.bigquery; - -import static com.google.common.truth.Truth.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class QueryIT { - - private final Logger log = Logger.getLogger(this.getClass().getName()); - private ByteArrayOutputStream bout; - private PrintStream out; - private PrintStream originalPrintStream; - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); - originalPrintStream = System.out; - System.setOut(out); - } - - @After - public void tearDown() { - // restores print statements in the original method - System.out.flush(); - System.setOut(originalPrintStream); - log.log(Level.INFO, "\n" + bout.toString()); - } - - @Test - public void testQuery() { - String query = - "SELECT name, SUM(number) as total_people" - + " FROM `bigquery-public-data.usa_names.usa_1910_2013`" - + " WHERE state = 'TX'" - + " GROUP BY name, state" - + " ORDER BY total_people DESC" - + " LIMIT 20"; - - Query.query(query); - assertThat(bout.toString()).contains("Query performed successfully."); - } -} From 487f20707c9b320a68100f85b2a1277cad9b37ea Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 May 2023 17:02:12 +0200 Subject: [PATCH 1243/2268] deps: update github/codeql-action action to v2.3.3 (#2658) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index bfefa0e971..658dc2f530 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@7df0ce34898d659f95c0c4a09eaa8d4e32ee64db # v2.2.12 + uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 with: sarif_file: results.sarif From fd2a558352341ff49725c57776c64f0c58102572 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 May 2023 17:30:28 +0200 Subject: [PATCH 1244/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.0 (#2699) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2aff0d2691..817bfc485f 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.36.1 + 2.37.0 pom import From 32ea8ab19bff86d8183ddd9d6e6d06303eb9d83f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 May 2023 18:35:53 +0200 Subject: [PATCH 1245/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.22 (#2688) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 9cfe8fc884..6cf142b53c 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.21 + 0.9.22 true com.example.bigquery.NativeImageBigquerySample From 61bb3854d3443811001d86ad650882d70003dc06 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 13:00:44 -0400 Subject: [PATCH 1246/2268] chore(main): release 2.26.0 (#2680) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d66330e23a..246e1cfb0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.26.0](https://github.com/googleapis/java-bigquery/compare/v2.25.0...v2.26.0) (2023-05-15) + + +### Features + +* Add field in HivePartitioningOptions ([#2678](https://github.com/googleapis/java-bigquery/issues/2678)) ([4165e55](https://github.com/googleapis/java-bigquery/commit/4165e5549d7a8e8e011d7700bc791e9b470c670d)) +* Allow passing autodetect_schema on table update ([#2661](https://github.com/googleapis/java-bigquery/issues/2661)) ([4c01698](https://github.com/googleapis/java-bigquery/commit/4c01698e571d7adbaf914984cdf65f6c35e4edb8)) + + +### Bug Fixes + +* Move ratio calculation for whether to use read API to avoid NPE with setUseReadAPI(false) ([#2509](https://github.com/googleapis/java-bigquery/issues/2509)) ([e1326c8](https://github.com/googleapis/java-bigquery/commit/e1326c8b615f392f80a09d36a1b4cef79dfea662)) + + +### Dependencies + +* Update arrow.version to v12 (major) ([#2675](https://github.com/googleapis/java-bigquery/issues/2675)) ([7700cf5](https://github.com/googleapis/java-bigquery/commit/7700cf588d4a6d3b3267d8fd51eaf8aed1752506)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.19.0 ([#2691](https://github.com/googleapis/java-bigquery/issues/2691)) ([1939803](https://github.com/googleapis/java-bigquery/commit/193980319cb743e6b6c67648ddb21432e5e69ff8)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.23.0 ([#2692](https://github.com/googleapis/java-bigquery/issues/2692)) ([f56e541](https://github.com/googleapis/java-bigquery/commit/f56e54161894c3be6e975ac102454afca4c9b058)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 ([#2685](https://github.com/googleapis/java-bigquery/issues/2685)) ([b74da29](https://github.com/googleapis/java-bigquery/commit/b74da296e2d2739adb481cda417d51569d1acc51)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.22 ([#2687](https://github.com/googleapis/java-bigquery/issues/2687)) ([cf5d758](https://github.com/googleapis/java-bigquery/commit/cf5d758fe6aad4b374c34940aa93f8060f779505)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.22 ([#2688](https://github.com/googleapis/java-bigquery/issues/2688)) ([32ea8ab](https://github.com/googleapis/java-bigquery/commit/32ea8ab19bff86d8183ddd9d6e6d06303eb9d83f)) +* Update github/codeql-action action to v2.3.3 ([#2658](https://github.com/googleapis/java-bigquery/issues/2658)) ([487f207](https://github.com/googleapis/java-bigquery/commit/487f20707c9b320a68100f85b2a1277cad9b37ea)) + ## [2.25.0](https://github.com/googleapis/java-bigquery/compare/v2.24.5...v2.25.0) (2023-04-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ab1738a2d7..7c7b34e7d1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.25.1-SNAPSHOT + 2.26.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 442051a5a3..bb1be97869 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.25.1-SNAPSHOT + 2.26.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.25.1-SNAPSHOT + 2.26.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 817bfc485f..e4274a5fce 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.25.1-SNAPSHOT + 2.26.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.25.1-SNAPSHOT + 2.26.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f5625554f8..32ee1f6c75 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.25.1-SNAPSHOT + 2.26.0 diff --git a/versions.txt b/versions.txt index 7fc5c0eadf..013c169f58 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.25.0:2.25.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.26.0:2.26.0 \ No newline at end of file From 2b4eff1fed8b1ac9bf24bd69440377e904bc66e1 Mon Sep 17 00:00:00 2001 From: Tlaquetzal Date: Mon, 15 May 2023 21:40:28 +0000 Subject: [PATCH 1247/2268] fix: custom host for resumable uploads (#2696) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- README.md | 6 +++--- .../google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e7c05fa680..266800c7ab 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.25.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.26.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.25.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.26.0" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.25.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.26.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index a85e4b6bfe..a63e3cc2ba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -77,8 +77,7 @@ public class HttpBigQueryRpc implements BigQueryRpc { public static final String DEFAULT_PROJECTION = "full"; - private static final String BASE_RESUMABLE_URI = - "https://www.googleapis.com/upload/bigquery/v2/projects/"; + private static final String BASE_RESUMABLE_URI = "upload/bigquery/v2/projects/"; // see: // https://cloud.google.com/bigquery/loading-data-post-request#resume-upload private static final int HTTP_RESUME_INCOMPLETE = 308; @@ -725,7 +724,11 @@ public QueryResponse queryRpc(String projectId, QueryRequest content) { @Override public String open(Job loadJob) { try { - String builder = BASE_RESUMABLE_URI + options.getProjectId() + "/jobs"; + String builder = options.getHost(); + if (!builder.endsWith("/")) { + builder += "/"; + } + builder += BASE_RESUMABLE_URI + options.getProjectId() + "/jobs"; GenericUrl url = new GenericUrl(builder); url.set("uploadType", "resumable"); JsonFactory jsonFactory = bigquery.getJsonFactory(); From de38336c0ad6e345e2a55e5d3dbdee9465eb2a59 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 14:56:13 +0000 Subject: [PATCH 1248/2268] chore(main): release 2.26.1-SNAPSHOT (#2700) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7c7b34e7d1..d1af496813 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.26.0 + 2.26.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bb1be97869..95406c2426 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.26.0 + 2.26.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.26.0 + 2.26.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e4274a5fce..5d942d131d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.26.0 + 2.26.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.26.0 + 2.26.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 32ee1f6c75..f331803af3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.26.0 + 2.26.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 013c169f58..ec699e8286 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.26.0:2.26.0 \ No newline at end of file +google-cloud-bigquery:2.26.0:2.26.1-SNAPSHOT \ No newline at end of file From 768dd34a8846027c099c2a266e2833cb0aa306d0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 May 2023 18:19:48 +0200 Subject: [PATCH 1249/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.26.0 (#2701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.26.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 266800c7ab..d2f41c510c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.25.0 + 2.26.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 331ac4ea1e..c4f504c321 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.25.0 + 2.26.0 From 76a0bd979cced80adbbb521f3cd7d0fcffe3f63b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 16:32:14 +0000 Subject: [PATCH 1250/2268] chore(main): release 2.26.1 (#2703) :robot: I have created a release *beep* *boop* --- ## [2.26.1](https://togithub.com/googleapis/java-bigquery/compare/v2.26.0...v2.26.1) (2023-05-16) ### Bug Fixes * Custom host for resumable uploads ([#2696](https://togithub.com/googleapis/java-bigquery/issues/2696)) ([2b4eff1](https://togithub.com/googleapis/java-bigquery/commit/2b4eff1fed8b1ac9bf24bd69440377e904bc66e1)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ README.md | 2 +- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 246e1cfb0e..3f8d687142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.26.1](https://github.com/googleapis/java-bigquery/compare/v2.26.0...v2.26.1) (2023-05-16) + + +### Bug Fixes + +* Custom host for resumable uploads ([#2696](https://github.com/googleapis/java-bigquery/issues/2696)) ([2b4eff1](https://github.com/googleapis/java-bigquery/commit/2b4eff1fed8b1ac9bf24bd69440377e904bc66e1)) + ## [2.26.0](https://github.com/googleapis/java-bigquery/compare/v2.25.0...v2.26.0) (2023-05-15) diff --git a/README.md b/README.md index d2f41c510c..9f50f9a51a 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.14.0') +implementation platform('com.google.cloud:libraries-bom:26.15.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d1af496813..977aaf3a41 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.26.1-SNAPSHOT + 2.26.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 95406c2426..0bef4df312 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.26.1-SNAPSHOT + 2.26.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.26.1-SNAPSHOT + 2.26.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5d942d131d..e72403209e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.26.1-SNAPSHOT + 2.26.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.26.1-SNAPSHOT + 2.26.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f331803af3..c0f3ac06bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.26.1-SNAPSHOT + 2.26.1 diff --git a/versions.txt b/versions.txt index ec699e8286..c376a508f8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.26.0:2.26.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.26.1:2.26.1 \ No newline at end of file From 27fa7b12ea55ec70f4b59d4e99b34744f46e1fd9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 12:00:35 -0400 Subject: [PATCH 1251/2268] build: migrate release scripts (#1799) (#2708) Source-Link: https://github.com/googleapis/synthtool/commit/1fd6dff029bb3d873a4780e616388f802f086907 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:ad9cabee4c022f1aab04a71332369e0c23841062124818a4490f73337f790337 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-trigger.yml | 1 + .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- README.md | 6 +++--- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 48ad11d440..aadf54f643 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:944c07e458ce227ca49a423affedf088e31e2ee70908dd21682238d58f1beb60 + digest: sha256:ad9cabee4c022f1aab04a71332369e0c23841062124818a4490f73337f790337 diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index d4ca94189e..57d2b0f830 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ enabled: true +multiScmName: java-bigquery diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index e20330c3ca..f525335458 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.0" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 0fd6ba2fa0..44b1004875 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.0" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2" } env_vars: { diff --git a/README.md b/README.md index 9f50f9a51a..8aca06dac6 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.26.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.26.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.26.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.26.1" ``` @@ -348,7 +348,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.26.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.26.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From 38554b120f9cc208c8840cdd691a54cb62427af4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 15:08:13 +0000 Subject: [PATCH 1252/2268] chore(main): release 2.26.2-SNAPSHOT (#2704) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 977aaf3a41..d797a46ead 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.26.1 + 2.26.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0bef4df312..a2876e5b71 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.26.1 + 2.26.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.26.1 + 2.26.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e72403209e..60a0f3cb6a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.26.1 + 2.26.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.26.1 + 2.26.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c0f3ac06bc..5a4eca90f7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.26.1 + 2.26.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index c376a508f8..4fe31fe109 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.26.1:2.26.1 \ No newline at end of file +google-cloud-bigquery:2.26.1:2.26.2-SNAPSHOT \ No newline at end of file From 499af3fdbc4b308aaf03ccf9d569607eefe2d8f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 15:10:13 +0000 Subject: [PATCH 1253/2268] build(deps): bump requests from 2.27.1 to 2.31.0 in /.kokoro (#2710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [requests](https://togithub.com/psf/requests) from 2.27.1 to 2.31.0.
    Release notes

    Sourced from requests's releases.

    v2.31.0

    2.31.0 (2023-05-22)

    Security

    • Versions of Requests between v2.3.0 and v2.30.0 are vulnerable to potential forwarding of Proxy-Authorization headers to destination servers when following HTTPS redirects.

      When proxies are defined with user info (https://user:pass@proxy:8080), Requests will construct a Proxy-Authorization header that is attached to the request to authenticate with the proxy.

      In cases where Requests receives a redirect response, it previously reattached the Proxy-Authorization header incorrectly, resulting in the value being sent through the tunneled connection to the destination server. Users who rely on defining their proxy credentials in the URL are strongly encouraged to upgrade to Requests 2.31.0+ to prevent unintentional leakage and rotate their proxy credentials once the change has been fully deployed.

      Users who do not use a proxy or do not supply their proxy credentials through the user information portion of their proxy URL are not subject to this vulnerability.

      Full details can be read in our Github Security Advisory and CVE-2023-32681.

    v2.30.0

    2.30.0 (2023-05-03)

    Dependencies

    v2.29.0

    2.29.0 (2023-04-26)

    Improvements

    • Requests now defers chunked requests to the urllib3 implementation to improve standardization. (#6226)
    • Requests relaxes header component requirements to support bytes/str subclasses. (#6356)

    ... (truncated)

    Changelog

    Sourced from requests's changelog.

    2.31.0 (2023-05-22)

    Security

    • Versions of Requests between v2.3.0 and v2.30.0 are vulnerable to potential forwarding of Proxy-Authorization headers to destination servers when following HTTPS redirects.

      When proxies are defined with user info (https://user:pass@proxy:8080), Requests will construct a Proxy-Authorization header that is attached to the request to authenticate with the proxy.

      In cases where Requests receives a redirect response, it previously reattached the Proxy-Authorization header incorrectly, resulting in the value being sent through the tunneled connection to the destination server. Users who rely on defining their proxy credentials in the URL are strongly encouraged to upgrade to Requests 2.31.0+ to prevent unintentional leakage and rotate their proxy credentials once the change has been fully deployed.

      Users who do not use a proxy or do not supply their proxy credentials through the user information portion of their proxy URL are not subject to this vulnerability.

      Full details can be read in our Github Security Advisory and CVE-2023-32681.

    2.30.0 (2023-05-03)

    Dependencies

    2.29.0 (2023-04-26)

    Improvements

    • Requests now defers chunked requests to the urllib3 implementation to improve standardization. (#6226)
    • Requests relaxes header component requirements to support bytes/str subclasses. (#6356)

    2.28.2 (2023-01-12)

    ... (truncated)

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=requests&package-manager=pip&previous-version=2.27.1&new-version=2.31.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://togithub.com/googleapis/java-bigquery/network/alerts).
    From 51aff502215d69bd0151030421cd18646c6ead36 Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Thu, 25 May 2023 19:18:14 +0200 Subject: [PATCH 1254/2268] fix: add support for repeated record query parameters (#2698) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for array of struct query parameters which are used to query repeated record fields Fixes #2485 ☕️ --- README.md | 1 + .../cloud/bigquery/QueryParameterValue.java | 18 +- .../bigquery/QueryParameterValueTest.java | 43 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 246 ++++++++++++++++++ .../CreateAndQueryRepeatedRecordField.java | 196 ++++++++++++++ ...ueryWithArrayOfStructsNamedParameters.java | 2 +- .../CreateAndQueryRepeatedRecordFieldIT.java | 79 ++++++ 7 files changed, 580 insertions(+), 5 deletions(-) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/CreateAndQueryRepeatedRecordFieldIT.java diff --git a/README.md b/README.md index 8aca06dac6..775b3d27d5 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Copy Multiple Tables | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyMultipleTables.java) | | Copy Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTable.java) | | Copy Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CopyTableCmek.java) | +| Create And Query Repeated Record Field | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java) | | Create Clustered Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateClusteredTable.java) | | Create Dataset | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDataset.java) | | Create Dataset Aws | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateDatasetAws.java) | diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index b92cb734c5..b21445d383 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -349,7 +349,11 @@ public static QueryParameterValue array(T[] array, Class clazz) { public static QueryParameterValue array(T[] array, StandardSQLTypeName type) { List listValues = new ArrayList<>(); for (T obj : array) { - listValues.add(QueryParameterValue.of(obj, type)); + if (type == StandardSQLTypeName.STRUCT) { + listValues.add((QueryParameterValue) obj); + } else { + listValues.add(QueryParameterValue.of(obj, type)); + } } return QueryParameterValue.newBuilder() .setArrayValues(listValues) @@ -522,9 +526,15 @@ QueryParameterType toTypePb() { QueryParameterType typePb = new QueryParameterType(); typePb.setType(getType().toString()); if (getArrayType() != null) { - QueryParameterType arrayTypePb = new QueryParameterType(); - arrayTypePb.setType(getArrayType().toString()); - typePb.setArrayType(arrayTypePb); + List values = getArrayValues(); + if (getArrayType() == StandardSQLTypeName.STRUCT && values != null && values.size() != 0) { + QueryParameterType structType = values.get(0).toTypePb(); + typePb.setArrayType(structType); + } else { + QueryParameterType arrayTypePb = new QueryParameterType(); + arrayTypePb.setType(getArrayType().toString()); + typePb.setArrayType(arrayTypePb); + } } if (getStructTypes() != null) { List structTypes = new ArrayList<>(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index 05920df237..0534865b23 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -28,6 +28,7 @@ import java.math.BigDecimal; import java.text.ParseException; import java.time.Period; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -563,6 +564,48 @@ public void testNestedStruct() { assertThat(nestedRecordField.getStructValues().size()).isEqualTo(structValue.size()); } + @Test + public void testStructArray() { + Boolean[] boolValues = new Boolean[] {true, false}; + Integer[] intValues = new Integer[] {15, 20}; + String[] stringValues = new String[] {"test-string", "test-string2"}; + List> fieldMaps = new ArrayList<>(); + List tuples = new ArrayList<>(); + for (int i = 0; i < 2; i++) { + QueryParameterValue booleanField = QueryParameterValue.bool(boolValues[i]); + QueryParameterValue integerField = QueryParameterValue.int64(intValues[i]); + QueryParameterValue stringField = QueryParameterValue.string(stringValues[i]); + ImmutableMap fieldMap = + ImmutableMap.of( + "booleanField", + booleanField, + "integerField", + integerField, + "stringField", + stringField); + fieldMaps.add(fieldMap); + QueryParameterValue recordField = QueryParameterValue.struct(fieldMap); + tuples.add(recordField); + } + QueryParameterValue repeatedRecordField = + QueryParameterValue.array(tuples.toArray(), StandardSQLTypeName.STRUCT); + com.google.api.services.bigquery.model.QueryParameterValue parameterValue = + repeatedRecordField.toValuePb(); + QueryParameterType parameterType = repeatedRecordField.toTypePb(); + QueryParameterValue queryParameterValue = + QueryParameterValue.fromPb(parameterValue, parameterType); + assertThat(queryParameterValue.getValue()).isNull(); + assertThat(queryParameterValue.getType()).isEqualTo(StandardSQLTypeName.ARRAY); + assertThat(queryParameterValue.getArrayType()).isEqualTo(StandardSQLTypeName.STRUCT); + assertThat(queryParameterValue.getArrayValues().size()).isEqualTo(2); + for (int i = 0; i < 2; i++) { + QueryParameterValue record = queryParameterValue.getArrayValues().get(i); + assertThat(record.getType()).isEqualTo(StandardSQLTypeName.STRUCT); + assertThat(record.getStructTypes()).isNotNull(); + assertThat(record.getStructValues()).isEqualTo(fieldMaps.get(i)); + } + } + private static void assertArrayDataEquals( String[] expectedValues, StandardSQLTypeName expectedType, diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 6d61fd2114..b0dab85764 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -156,6 +156,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -231,6 +232,31 @@ public class ITBigQueryTest { .setMode(Field.Mode.REQUIRED) .setDescription("RecordDescription") .build(); + + private static final Field REPEATED_RECORD_FIELD_SCHEMA = + Field.newBuilder( + "Addresses", + LegacySQLTypeName.RECORD, + Field.newBuilder("Status", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("Address", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("City", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("State", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("Zip", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("NumberOfYears", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()) + .setMode(Field.Mode.REPEATED) + .build(); private static final Field INTEGER_FIELD_SCHEMA = Field.newBuilder("IntegerField", LegacySQLTypeName.INTEGER) .setMode(Field.Mode.NULLABLE) @@ -422,6 +448,18 @@ public class ITBigQueryTest { .setMode(Field.Mode.NULLABLE) .build()); + private static final Schema REPEATED_RECORD_TABLE_SCHEMA = + Schema.of( + Field.newBuilder("ID", LegacySQLTypeName.STRING).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("FirstName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("LastName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("DOB", LegacySQLTypeName.DATE).setMode(Field.Mode.NULLABLE).build(), + REPEATED_RECORD_FIELD_SCHEMA); + private static final Schema SIMPLE_SCHEMA = Schema.of(STRING_FIELD_SCHEMA); private static final Schema QUERY_RESULT_SCHEMA = Schema.of( @@ -4062,6 +4100,214 @@ public void testStructNamedQueryParameters() throws InterruptedException { } } + @Test + public void testRepeatedRecordNamedQueryParameters() throws InterruptedException { + String[] stringValues = new String[] {"test-stringField", "test-stringField2"}; + List tuples = new ArrayList<>(); + for (int i = 0; i < 2; i++) { + QueryParameterValue stringValue = QueryParameterValue.string(stringValues[i]); + Map struct = new HashMap<>(); + struct.put("stringField", stringValue); + QueryParameterValue recordValue = QueryParameterValue.struct(struct); + tuples.add(recordValue); + } + + QueryParameterValue repeatedRecord = + QueryParameterValue.array(tuples.toArray(), StandardSQLTypeName.STRUCT); + String query = "SELECT @repeatedRecordField AS repeatedRecord"; + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter("repeatedRecordField", repeatedRecord) + .build(); + TableResult result = bigquery.query(config); + assertEquals(1, Iterables.size(result.getValues())); + + FieldList subSchema = result.getSchema().getFields().get("repeatedRecord").getSubFields(); + for (FieldValueList values : result.iterateAll()) { + for (FieldValue value : values) { + assertEquals(FieldValue.Attribute.REPEATED, value.getAttribute()); + assertEquals(2, value.getRepeatedValue().size()); + for (int i = 0; i < 2; i++) { + FieldValue record = value.getRepeatedValue().get(i); + assertEquals(FieldValue.Attribute.RECORD, record.getAttribute()); + FieldValueList recordValue = record.getRecordValue(); + assertEquals( + stringValues[i], + FieldValueList.of(recordValue, subSchema).get("stringField").getValue()); + } + } + } + } + + @Test + public void testUnnestRepeatedRecordNamedQueryParameter() throws InterruptedException { + Boolean[] boolValues = new Boolean[] {true, false}; + List tuples = new ArrayList<>(); + for (int i = 0; i < 2; i++) { + QueryParameterValue boolValue = QueryParameterValue.bool(boolValues[i]); + Map struct = new HashMap<>(); + struct.put("boolField", boolValue); + QueryParameterValue recordValue = QueryParameterValue.struct(struct); + tuples.add(recordValue); + } + + QueryParameterValue repeatedRecord = + QueryParameterValue.array(tuples.toArray(), StandardSQLTypeName.STRUCT); + String query = + "SELECT * FROM (SELECT STRUCT(" + + boolValues[0] + + " AS boolField) AS repeatedRecord) WHERE repeatedRecord IN UNNEST(@repeatedRecordField)"; + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter("repeatedRecordField", repeatedRecord) + .build(); + TableResult result = bigquery.query(config); + assertEquals(1, Iterables.size(result.getValues())); + + FieldList subSchema = result.getSchema().getFields().get("repeatedRecord").getSubFields(); + for (FieldValueList values : result.iterateAll()) { + for (FieldValue value : values) { + assertEquals(FieldValue.Attribute.RECORD, value.getAttribute()); + FieldValueList recordValue = value.getRecordValue(); + assertEquals( + boolValues[0], + FieldValueList.of(recordValue, subSchema).get("boolField").getBooleanValue()); + } + } + } + + @Test + public void testUnnestRepeatedRecordNamedQueryParameterFromDataset() throws InterruptedException { + TableId tableId = TableId.of(DATASET, "test_repeated_record_table"); + setUpRepeatedRecordTable(tableId); + + List tuples = new ArrayList<>(); + QueryParameterValue statusValue = QueryParameterValue.string("single"); + QueryParameterValue addressValue = QueryParameterValue.string("123 this lane"); + QueryParameterValue cityValue = QueryParameterValue.string("Toronto"); + QueryParameterValue stateValue = QueryParameterValue.string("ON"); + QueryParameterValue zipValue = QueryParameterValue.string("1h2j34"); + QueryParameterValue numberOfYearsValue = QueryParameterValue.string("3"); + + Map struct = new LinkedHashMap<>(); + struct.put("statusValue", statusValue); + struct.put("addressValue", addressValue); + struct.put("cityValue", cityValue); + struct.put("stateValue", stateValue); + struct.put("zipValue", zipValue); + struct.put("numberOfYearsValue", numberOfYearsValue); + QueryParameterValue recordValue = QueryParameterValue.struct(struct); + tuples.add(recordValue); + + QueryParameterValue repeatedRecord = + QueryParameterValue.array(tuples.toArray(), StandardSQLTypeName.STRUCT); + + String query = + "SELECT * FROM " + + tableId.getTable() + + ", UNNEST(@repeatedRecord) AS TEMP where TEMP IN UNNEST(addresses);"; + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter("repeatedRecord", repeatedRecord) + .build(); + TableResult results = bigquery.query(queryConfig); + + assertEquals(1, Iterables.size(results.getValues())); + for (FieldValueList values : results.iterateAll()) { + assertEquals("1", values.get("ID").getStringValue()); + assertEquals("first_name1", values.get("FirstName").getStringValue()); + assertEquals(2, values.get("Addresses").getRecordValue().size()); + } + } + + private void setUpRepeatedRecordTable(TableId tableId) { + StandardTableDefinition tableDefinition = + StandardTableDefinition.of(REPEATED_RECORD_TABLE_SCHEMA); + TableInfo tableInfo = TableInfo.of(tableId, tableDefinition); + bigquery.create(tableInfo); + + ImmutableMap.Builder builder1 = ImmutableMap.builder(); + builder1.put("ID", "1"); + builder1.put("FirstName", "first_name1"); + builder1.put("LastName", "last_name1"); + builder1.put("DOB", "1995-08-09"); + builder1.put( + "Addresses", + ImmutableList.of( + ImmutableMap.of( + "Status", "single", + "Address", "123 this lane", + "City", "Toronto", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "3"), + ImmutableMap.of( + "Status", "couple", + "Address", "345 that lane", + "City", "Maple", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "5"))); + + ImmutableMap.Builder builder2 = ImmutableMap.builder(); + builder2.put("ID", "2"); + builder2.put("FirstName", "first_name2"); + builder2.put("LastName", "last_name2"); + builder2.put("DOB", "1992-03-19"); + builder2.put( + "Addresses", + ImmutableList.of( + ImmutableMap.of( + "Status", "single", + "Address", "97 Kota lane", + "City", "Ottawa", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "3"), + ImmutableMap.of( + "Status", "couple", + "Address", "75 Malta lane", + "City", "Victoria", + "State", "AL", + "Zip", "1h2j34", + "NumberOfYears", "5"))); + + InsertAllRequest request = + InsertAllRequest.newBuilder(tableInfo.getTableId()) + .addRow(builder1.build()) + .addRow(builder2.build()) + .build(); + bigquery.insertAll(request); + } + + @Test + public void testEmptyRepeatedRecordNamedQueryParameters() throws InterruptedException { + QueryParameterValue[] tuples = {}; + + QueryParameterValue repeatedRecord = + QueryParameterValue.array(tuples, StandardSQLTypeName.STRUCT); + String query = + "SELECT * FROM (SELECT STRUCT(false AS boolField) AS repeatedRecord) WHERE repeatedRecord IN UNNEST(@repeatedRecordField)"; + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter("repeatedRecordField", repeatedRecord) + .build(); + try { + bigquery.query(config); + fail("an empty array of struct query parameter shouldn't work with 'IN UNNEST'"); + } catch (BigQueryException e) { + // Nothing to do + } + } + @Test public void testStructQuery() throws InterruptedException { // query into a table diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java b/samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java new file mode 100644 index 0000000000..2bb13eb121 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateAndQueryRepeatedRecordField.java @@ -0,0 +1,196 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_create_and_query_repeated_record] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.InsertAllRequest; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.TableResult; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +// Create a table with a repeated record field and query it using an array of struct named parameter +public class CreateAndQueryRepeatedRecordField { + + private static final Field REPEATED_RECORD_FIELD_SCHEMA = + Field.newBuilder( + "Addresses", + LegacySQLTypeName.RECORD, + Field.newBuilder("Status", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("Address", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("City", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("State", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("Zip", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("NumberOfYears", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()) + .setMode(Field.Mode.REPEATED) + .build(); + private static final Schema REPEATED_RECORD_TABLE_SCHEMA = + Schema.of( + Field.newBuilder("ID", LegacySQLTypeName.STRING).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("FirstName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("LastName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("DOB", LegacySQLTypeName.DATE).setMode(Field.Mode.NULLABLE).build(), + REPEATED_RECORD_FIELD_SCHEMA); + + public static void main(String[] args) { + // TODO(developer): Replace these variables before running the sample. + String datasetName = "MY_DATASET_NAME"; + String tableName = "MY_TABLE_NAME"; + createAndQueryRepeatedRecordField(datasetName, tableName); + } + + public static void createAndQueryRepeatedRecordField(String datasetName, String tableName) { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + TableId tableId = TableId.of(datasetName, tableName); + + // Create a table with a repeated record field + StandardTableDefinition tableDefinition = + StandardTableDefinition.of(REPEATED_RECORD_TABLE_SCHEMA); + TableInfo tableInfo = TableInfo.of(tableId, tableDefinition); + bigquery.create(tableInfo); + + // Insert some data + ImmutableMap.Builder builder1 = ImmutableMap.builder(); + builder1.put("ID", "1"); + builder1.put("FirstName", "first_name1"); + builder1.put("LastName", "last_name1"); + builder1.put("DOB", "1995-08-09"); + builder1.put( + "Addresses", + ImmutableList.of( + ImmutableMap.of( + "Status", "single", + "Address", "123 this lane", + "City", "Toronto", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "3"), + ImmutableMap.of( + "Status", "couple", + "Address", "345 that lane", + "City", "Maple", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "5"))); + + ImmutableMap.Builder builder2 = ImmutableMap.builder(); + builder2.put("ID", "2"); + builder2.put("FirstName", "first_name2"); + builder2.put("LastName", "last_name2"); + builder2.put("DOB", "1992-03-19"); + builder2.put( + "Addresses", + ImmutableList.of( + ImmutableMap.of( + "Status", "single", + "Address", "97 Kota lane", + "City", "Ottawa", + "State", "ON", + "Zip", "1h2j34", + "NumberOfYears", "3"), + ImmutableMap.of( + "Status", "couple", + "Address", "75 Malta lane", + "City", "Victoria", + "State", "AL", + "Zip", "1h2j34", + "NumberOfYears", "5"))); + + InsertAllRequest request = + InsertAllRequest.newBuilder(tableInfo.getTableId()) + .addRow(builder1.build()) + .addRow(builder2.build()) + .build(); + bigquery.insertAll(request); + + // Query using a named parameter + QueryParameterValue statusValue = QueryParameterValue.string("single"); + QueryParameterValue addressValue = QueryParameterValue.string("123 this lane"); + QueryParameterValue cityValue = QueryParameterValue.string("Toronto"); + QueryParameterValue stateValue = QueryParameterValue.string("ON"); + QueryParameterValue zipValue = QueryParameterValue.string("1h2j34"); + QueryParameterValue numberOfYearsValue = QueryParameterValue.string("3"); + + Map struct = new LinkedHashMap<>(); + struct.put("statusValue", statusValue); + struct.put("addressValue", addressValue); + struct.put("cityValue", cityValue); + struct.put("stateValue", stateValue); + struct.put("zipValue", zipValue); + struct.put("numberOfYearsValue", numberOfYearsValue); + QueryParameterValue recordValue = QueryParameterValue.struct(struct); + List tuples = new ArrayList<>(); + tuples.add(recordValue); + + QueryParameterValue repeatedRecord = + QueryParameterValue.array(tuples.toArray(), StandardSQLTypeName.STRUCT); + + String query = + "SELECT * FROM " + + tableId.getTable() + + ", UNNEST(@repeatedRecord) AS TEMP where TEMP IN UNNEST(addresses);"; + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(datasetName) + .setUseLegacySql(false) + .addNamedParameter("repeatedRecord", repeatedRecord) + .build(); + TableResult results = bigquery.query(queryConfig); + results + .iterateAll() + .forEach(row -> row.forEach(val -> System.out.printf("%s\n", val.toString()))); + System.out.println("Query with Array of struct parameters performed successfully."); + } catch (BigQueryException | InterruptedException e) { + System.out.println("Query not performed \n" + e.toString()); + } + } +} +// [END bigquery_create_and_query_repeated_record] diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java b/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java index 00cae0aa9c..3a2074f9ac 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java @@ -53,7 +53,7 @@ public static void queryWithArrayOfStructsNamedParameters() { .setUseLegacySql(false) .addNamedParameter( "arrayOfStructField", - QueryParameterValue.array(arrayOfStructs.toArray(), StandardSQLTypeName.STRING)) + QueryParameterValue.array(arrayOfStructs.toArray(), StandardSQLTypeName.STRUCT)) .build(); TableResult results = bigquery.query(queryConfig); results diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateAndQueryRepeatedRecordFieldIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateAndQueryRepeatedRecordFieldIT.java new file mode 100644 index 0000000000..56ad47a5d8 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateAndQueryRepeatedRecordFieldIT.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CreateAndQueryRepeatedRecordFieldIT { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String tableName; + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); + + private static void requireEnvVar(String varName) { + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("BIGQUERY_DATASET_NAME"); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + tableName = "MY_TABLE_NAME_" + UUID.randomUUID().toString().replace("-", "_"); + } + + @After + public void tearDown() { + // Clean up + DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableName); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testCreateAndQueryRepeatedRecordField() { + CreateAndQueryRepeatedRecordField.createAndQueryRepeatedRecordField( + BIGQUERY_DATASET_NAME, tableName); + assertThat(bout.toString()) + .contains("Query with Array of struct parameters performed successfully."); + } +} From c8bc1c5446122ea0c639e997f2eb1e22fff073f4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:47:48 +0200 Subject: [PATCH 1255/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.4 (#2722) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 60a0f3cb6a..7ad0a0562e 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.3 + 3.4.4 From 7c357fb414d45fde734c09c88ee3023d8d8f5822 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:48:51 +0200 Subject: [PATCH 1256/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.24.0 (#2721) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7ad0a0562e..9cf3a7ef24 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.23.0 + 1.24.0 pom import From 4962cac8fb3fe8d77a136eaf1b579cd79304acfb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:49:29 +0200 Subject: [PATCH 1257/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.20.0 (#2720) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9cf3a7ef24..73f544dcf3 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.19.0 + 2.20.0 test From 40c03c59c11484811b62dbf1d3ef9abb9f06c7ea Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:49:47 +0200 Subject: [PATCH 1258/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.20.0 (#2719) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 73f544dcf3..7d614dd250 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.19.0 + 2.20.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c4f504c321..be05c5bf6f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.19.0 + 2.20.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5a4eca90f7..045fabf2ff 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.19.0 + 2.20.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 330260257c..d313d4e8d9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.19.0 + 2.20.0 test From 17525bb26092749cfc1eee63993faa0725a84efb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:50:44 +0200 Subject: [PATCH 1259/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.1 (#2718) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d614dd250..2968f594e2 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.37.0 + 2.37.1 pom import From 744e83a3da5323bc2cff2bcc6368a3eec39f392e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 17:54:47 +0200 Subject: [PATCH 1260/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.10.1 (#2713) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2968f594e2..c716caf2d5 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230422-2.0.0 - 3.9.0 + 3.10.1 12.0.0
    From 4d2ec0716287e9624949cbcdf6605c127c209be4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 18:06:17 +0200 Subject: [PATCH 1261/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230506-2.0.0 (#2707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20230422-2.0.0` -> `v2-rev20230506-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230506-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230506-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230506-2.0.0/compatibility-slim/v2-rev20230422-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230506-2.0.0/confidence-slim/v2-rev20230422-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c716caf2d5..c6ec32071c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230422-2.0.0 + v2-rev20230506-2.0.0 3.10.1 12.0.0
    From 5c64797c603343408849535b2dbf8080cd11ca32 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 18:18:13 +0200 Subject: [PATCH 1262/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230520-2.0.0 (#2723) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20230506-2.0.0` -> `v2-rev20230520-2.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230520-2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230520-2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230520-2.0.0/compatibility-slim/v2-rev20230506-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.apis:google-api-services-bigquery/v2-rev20230520-2.0.0/confidence-slim/v2-rev20230506-2.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c6ec32071c..83a12f29ae 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230506-2.0.0 + v2-rev20230520-2.0.0 3.10.1 12.0.0
    From 42851d818ee825d7c4141d40d116e1da43c11f14 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 30 May 2023 12:54:10 -0400 Subject: [PATCH 1263/2268] feat: add support for session id on TableDataWriteChannel (#2715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add support for session id on TableDataWriteChannel * chore: change csv file name * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: remove struct tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: fix graalvm tests * chore: make path absolute * chore: try streams * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add IOUtils * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: nit * cleanup --------- Co-authored-by: Owl Bot --- .../bigquery/WriteChannelConfiguration.java | 52 ++++++++- .../WriteChannelConfigurationTest.java | 12 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 110 ++++++++++++++++++ .../native-image/resource-config.json | 3 +- .../src/test/resources/sessionTest.csv | 51 ++++++++ 5 files changed, 224 insertions(+), 4 deletions(-) create mode 100644 google-cloud-bigquery/src/test/resources/sessionTest.csv diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java index cdb9db904e..114c6dadd4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java @@ -25,6 +25,7 @@ import com.google.cloud.bigquery.JobInfo.WriteDisposition; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import java.io.Serializable; import java.util.List; @@ -56,9 +57,11 @@ public final class WriteChannelConfiguration implements LoadConfiguration, Seria private final Boolean useAvroLogicalTypes; private final Map labels; private List decimalTargetTypes; + private final List connectionProperties; - public static final class Builder implements LoadConfiguration.Builder { + private final Boolean createSession; + public static final class Builder implements LoadConfiguration.Builder { private TableId destinationTable; private CreateDisposition createDisposition; private WriteDisposition writeDisposition; @@ -75,6 +78,9 @@ public static final class Builder implements LoadConfiguration.Builder { private Boolean useAvroLogicalTypes; private Map labels; private List decimalTargetTypes; + private List connectionProperties; + + private Boolean createSession; private Builder() {} @@ -96,6 +102,8 @@ private Builder(WriteChannelConfiguration writeChannelConfiguration) { this.useAvroLogicalTypes = writeChannelConfiguration.useAvroLogicalTypes; this.labels = writeChannelConfiguration.labels; this.decimalTargetTypes = writeChannelConfiguration.decimalTargetTypes; + this.connectionProperties = writeChannelConfiguration.connectionProperties; + this.createSession = writeChannelConfiguration.createSession; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -175,6 +183,13 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getDecimalTargetTypes() != null) { this.decimalTargetTypes = loadConfigurationPb.getDecimalTargetTypes(); } + if (loadConfigurationPb.getConnectionProperties() != null) { + + this.connectionProperties = + Lists.transform( + loadConfigurationPb.getConnectionProperties(), ConnectionProperty.FROM_PB_FUNCTION); + } + createSession = loadConfigurationPb.getCreateSession(); } @Override @@ -274,6 +289,16 @@ public Builder setDecimalTargetTypes(List decimalTargetTypes) { return this; } + public Builder setConnectionProperties(List connectionProperties) { + this.connectionProperties = ImmutableList.copyOf(connectionProperties); + return this; + } + + public Builder setCreateSession(Boolean createSession) { + this.createSession = createSession; + return this; + } + @Override public WriteChannelConfiguration build() { return new WriteChannelConfiguration(this); @@ -297,6 +322,8 @@ protected WriteChannelConfiguration(Builder builder) { this.useAvroLogicalTypes = builder.useAvroLogicalTypes; this.labels = builder.labels; this.decimalTargetTypes = builder.decimalTargetTypes; + this.connectionProperties = builder.connectionProperties; + this.createSession = builder.createSession; } @Override @@ -390,6 +417,14 @@ public List getDecimalTargetTypes() { return decimalTargetTypes; } + public List getConnectionProperties() { + return connectionProperties; + } + + public Boolean getCreateSession() { + return createSession; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -412,7 +447,9 @@ MoreObjects.ToStringHelper toStringHelper() { .add("clustering", clustering) .add("useAvroLogicalTypes", useAvroLogicalTypes) .add("labels", labels) - .add("decimalTargetTypes", decimalTargetTypes); + .add("decimalTargetTypes", decimalTargetTypes) + .add("connectionProperties", connectionProperties) + .add("createSession", createSession); } @Override @@ -444,7 +481,9 @@ public int hashCode() { clustering, useAvroLogicalTypes, labels, - decimalTargetTypes); + decimalTargetTypes, + connectionProperties, + createSession); } WriteChannelConfiguration setProjectId(String projectId) { @@ -519,6 +558,13 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (decimalTargetTypes != null) { loadConfigurationPb.setDecimalTargetTypes(decimalTargetTypes); } + if (connectionProperties != null) { + loadConfigurationPb.setConnectionProperties( + Lists.transform(connectionProperties, ConnectionProperty.TO_PB_FUNCTION)); + } + if (createSession != null) { + loadConfigurationPb.setCreateSession(createSession); + } jobConfiguration.setLoad(loadConfigurationPb); return jobConfiguration; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java index 01c86e8fbf..7b912ce2bb 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java @@ -61,6 +61,14 @@ public class WriteChannelConfigurationTest { ImmutableMap.of("test-job-name", "test-write-channel"); private static final List DECIMAL_TARGET_TYPES = ImmutableList.of("NUMERIC", "BIGNUMERIC"); + + private static final boolean CREATE_SESSION = true; + private static final String KEY = "session_id"; + private static final String VALUE = "session_id_1234567890"; + private static final ConnectionProperty CONNECTION_PROPERTY = + ConnectionProperty.newBuilder().setKey(KEY).setValue(VALUE).build(); + private static final List CONNECTION_PROPERTIES = + ImmutableList.of(CONNECTION_PROPERTY); private static final WriteChannelConfiguration LOAD_CONFIGURATION_CSV = WriteChannelConfiguration.newBuilder(TABLE_ID) .setCreateDisposition(CREATE_DISPOSITION) @@ -76,6 +84,8 @@ public class WriteChannelConfigurationTest { .setClustering(CLUSTERING) .setLabels(LABELS) .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) + .setConnectionProperties(CONNECTION_PROPERTIES) + .setCreateSession(CREATE_SESSION) .build(); private static final DatastoreBackupOptions BACKUP_OPTIONS = @@ -232,5 +242,7 @@ private void compareLoadConfiguration( assertEquals(expected.getUseAvroLogicalTypes(), value.getUseAvroLogicalTypes()); assertEquals(expected.getLabels(), value.getLabels()); assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); + assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); + assertEquals(expected.getCreateSession(), value.getCreateSession()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b0dab85764..cdfcb80033 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -28,6 +28,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import com.google.api.client.util.IOUtils; import com.google.api.gax.paging.Page; import com.google.auth.oauth2.GoogleCredentials; import com.google.auth.oauth2.ServiceAccountCredentials; @@ -60,6 +61,7 @@ import com.google.cloud.bigquery.ConnectionProperty; import com.google.cloud.bigquery.ConnectionSettings; import com.google.cloud.bigquery.CopyJobConfiguration; +import com.google.cloud.bigquery.CsvOptions; import com.google.cloud.bigquery.Dataset; import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.DatasetInfo; @@ -141,9 +143,13 @@ import com.google.gson.JsonObject; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.math.BigDecimal; import java.nio.ByteBuffer; +import java.nio.channels.Channels; import java.nio.charset.StandardCharsets; +import java.nio.file.FileSystems; +import java.nio.file.Path; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Time; @@ -711,6 +717,36 @@ public class ITBigQueryTest { private static final List CONNECTION_PROPERTIES = ImmutableList.of(CONNECTION_PROPERTY); + private static final Field ID_SCHEMA = + Field.newBuilder("id", LegacySQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .setDescription("id") + .build(); + private static final Field FIRST_NAME_SCHEMA = + Field.newBuilder("firstname", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("First Name") + .build(); + private static final Field LAST_NAME_SCHEMA = + Field.newBuilder("lastname", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("LAST NAME") + .build(); + private static final Field EMAIL_SCHEMA = + Field.newBuilder("email", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("email") + .build(); + private static final Field PROFESSION_SCHEMA = + Field.newBuilder("profession", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("profession") + .build(); + private static final Schema SESSION_TABLE_SCHEMA = + Schema.of(ID_SCHEMA, FIRST_NAME_SCHEMA, LAST_NAME_SCHEMA, EMAIL_SCHEMA, PROFESSION_SCHEMA); + private static final Path csvPath = + FileSystems.getDefault().getPath("src/test/resources", "sessionTest.csv").toAbsolutePath(); + private static final Set PUBLIC_DATASETS = ImmutableSet.of("github_repos", "hacker_news", "noaa_gsod", "samples", "usa_names"); @@ -3733,6 +3769,80 @@ public void testQuerySessionSupport() throws InterruptedException { assertEquals(sessionId, statisticsWithSession.getSessionInfo().getSessionId()); } + @Test + public void testLoadSessionSupportWriteChannelConfiguration() throws InterruptedException { + TableId sessionTableId = TableId.of("_SESSION", "test_temp_destination_table_from_file"); + + WriteChannelConfiguration configuration = + WriteChannelConfiguration.newBuilder(sessionTableId) + .setFormatOptions(CsvOptions.newBuilder().setFieldDelimiter(",").build()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(SESSION_TABLE_SCHEMA) + .setCreateSession(true) + .build(); + String jobName = "jobId_" + UUID.randomUUID().toString(); + JobId jobId = JobId.newBuilder().setLocation("us").setJob(jobName).build(); + String sessionId; + + // Imports a local file into a table. + try (TableDataWriteChannel writer = bigquery.writer(jobId, configuration); + OutputStream stream = Channels.newOutputStream(writer)) { + InputStream inputStream = + ITBigQueryTest.class.getClassLoader().getResourceAsStream("sessionTest.csv"); + // Can use `Files.copy(csvPath, stream);` instead. + // Using IOUtils here because graalvm can't handle resource files. + IOUtils.copy(inputStream, stream); + + } catch (IOException e) { + throw new RuntimeException(e); + } + Job loadJob = bigquery.getJob(jobId); + Job completedJob = loadJob.waitFor(); + + assertNotNull(completedJob); + assertEquals(jobId.getJob(), completedJob.getJobId().getJob()); + JobStatistics.LoadStatistics statistics = completedJob.getStatistics(); + + sessionId = statistics.getSessionInfo().getSessionId(); + assertNotNull(sessionId); + + // Load job in the same session. + // Should load the data to a temp table. + ConnectionProperty sessionConnectionProperty = + ConnectionProperty.newBuilder().setKey("session_id").setValue(sessionId).build(); + WriteChannelConfiguration sessionConfiguration = + WriteChannelConfiguration.newBuilder(sessionTableId) + .setConnectionProperties(ImmutableList.of(sessionConnectionProperty)) + .setFormatOptions(CsvOptions.newBuilder().setFieldDelimiter(",").build()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setSchema(SESSION_TABLE_SCHEMA) + .build(); + String sessionJobName = "jobId_" + UUID.randomUUID().toString(); + JobId sessionJobId = JobId.newBuilder().setLocation("us").setJob(sessionJobName).build(); + try (TableDataWriteChannel writer = bigquery.writer(sessionJobId, sessionConfiguration); + OutputStream stream = Channels.newOutputStream(writer)) { + InputStream inputStream = + ITBigQueryTest.class.getClassLoader().getResourceAsStream("sessionTest.csv"); + IOUtils.copy(inputStream, stream); + } catch (IOException e) { + throw new RuntimeException(e); + } + Job queryJobWithSession = bigquery.getJob(sessionJobId); + queryJobWithSession = queryJobWithSession.waitFor(); + LoadStatistics statisticsWithSession = queryJobWithSession.getStatistics(); + assertNotNull(statisticsWithSession.getSessionInfo().getSessionId()); + + // Checking if the data loaded to the temp table in the session + String queryTempTable = "SELECT * FROM _SESSION.test_temp_destination_table_from_file;"; + QueryJobConfiguration queryJobConfigurationWithSession = + QueryJobConfiguration.newBuilder(queryTempTable) + .setConnectionProperties(ImmutableList.of(sessionConnectionProperty)) + .build(); + Job queryTempTableJob = bigquery.create(JobInfo.of(queryJobConfigurationWithSession)); + queryTempTableJob = queryTempTableJob.waitFor(); + assertNotNull(queryTempTableJob.getQueryResults()); + } + @Test public void testLoadSessionSupport() throws InterruptedException { // Start the session diff --git a/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json b/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json index e00ed1f1c5..97298417ac 100644 --- a/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json +++ b/google-cloud-bigquery/src/test/resources/META-INF/native-image/resource-config.json @@ -1,3 +1,4 @@ { - "resources":[{"pattern": ".*.csv"}] + "resources":[{"pattern": ".*.csv"}, + {"pattern": ".*src/test/resources/sessionTest.csv"}] } \ No newline at end of file diff --git a/google-cloud-bigquery/src/test/resources/sessionTest.csv b/google-cloud-bigquery/src/test/resources/sessionTest.csv new file mode 100644 index 0000000000..f500c80c14 --- /dev/null +++ b/google-cloud-bigquery/src/test/resources/sessionTest.csv @@ -0,0 +1,51 @@ +id,firstname,lastname,email,profession +100,Rani,Merell,Rani.Merell@yopmail.com,firefighter +101,Goldie,Dex,Goldie.Dex@yopmail.com,developer +102,Cristabel,Munn,Cristabel.Munn@yopmail.com,developer +103,Genevra,Strephon,Genevra.Strephon@yopmail.com,firefighter +104,Augustine,Thema,Augustine.Thema@yopmail.com,doctor +105,Jemie,Gombach,Jemie.Gombach@yopmail.com,police officer +106,Maye,Stuart,Maye.Stuart@yopmail.com,developer +107,Ayn,Carmena,Ayn.Carmena@yopmail.com,worker +108,Gale,Celestine,Gale.Celestine@yopmail.com,doctor +109,Alex,Jerold,Alex.Jerold@yopmail.com,firefighter +110,Violet,Giule,Violet.Giule@yopmail.com,firefighter +111,Starla,Uird,Starla.Uird@yopmail.com,doctor +112,Tarra,Pelagias,Tarra.Pelagias@yopmail.com,police officer +113,Eugine,Deny,Eugine.Deny@yopmail.com,doctor +114,Shirlee,Ricarda,Shirlee.Ricarda@yopmail.com,doctor +115,Ariela,Penelopa,Ariela.Penelopa@yopmail.com,worker +116,Lelah,Astra,Lelah.Astra@yopmail.com,police officer +117,Debee,Deegan,Debee.Deegan@yopmail.com,developer +118,Pollyanna,Euridice,Pollyanna.Euridice@yopmail.com,worker +119,Cathie,Halsey,Cathie.Halsey@yopmail.com,firefighter +120,Rebeca,Quinn,Rebeca.Quinn@yopmail.com,doctor +121,Paulita,Arquit,Paulita.Arquit@yopmail.com,police officer +122,Rebeca,Emanuel,Rebeca.Emanuel@yopmail.com,firefighter +123,Tera,Ilka,Tera.Ilka@yopmail.com,firefighter +124,Orsola,Briney,Orsola.Briney@yopmail.com,doctor +125,Paulita,Wyn,Paulita.Wyn@yopmail.com,doctor +126,Constance,Christine,Constance.Christine@yopmail.com,firefighter +127,Claresta,Kinnard,Claresta.Kinnard@yopmail.com,developer +128,Leanna,Mendez,Leanna.Mendez@yopmail.com,developer +129,Corina,Chabot,Corina.Chabot@yopmail.com,developer +130,Romona,Audly,Romona.Audly@yopmail.com,worker +131,Cordi,Lynn,Cordi.Lynn@yopmail.com,firefighter +132,Sheree,Tyson,Sheree.Tyson@yopmail.com,worker +133,Jinny,Bevin,Jinny.Bevin@yopmail.com,police officer +134,Kassey,Havens,Kassey.Havens@yopmail.com,firefighter +135,Wanda,Thema,Wanda.Thema@yopmail.com,developer +136,Vita,Jagir,Vita.Jagir@yopmail.com,developer +137,Alie,Aprile,Alie.Aprile@yopmail.com,firefighter +138,Modestia,Jena,Modestia.Jena@yopmail.com,doctor +139,Cyndie,Pelagias,Cyndie.Pelagias@yopmail.com,worker +140,Ariela,Lilybelle,Ariela.Lilybelle@yopmail.com,firefighter +141,Jan,Parette,Jan.Parette@yopmail.com,firefighter +142,Merry,Horan,Merry.Horan@yopmail.com,developer +143,Katuscha,Candy,Katuscha.Candy@yopmail.com,police officer +144,Kerrin,Heisel,Kerrin.Heisel@yopmail.com,developer +145,Nollie,Magdalen,Nollie.Magdalen@yopmail.com,doctor +146,Karlee,Gordon,Karlee.Gordon@yopmail.com,developer +147,Dolli,Fadiman,Dolli.Fadiman@yopmail.com,firefighter +148,Leontine,Delp,Leontine.Delp@yopmail.com,worker +149,Ricky,Nadia,Ricky.Nadia@yopmail.com,doctor From 6818198a6f41f57b5cc3a2f43733ce3b06b34b90 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 21:25:53 +0200 Subject: [PATCH 1264/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.3 (#2724) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 83a12f29ae..eaaa0a5d06 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.22.2 + 2.22.3 test From 24bb64a85497c2201cc3ca35710e9d06d4bf2202 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 21:26:15 +0200 Subject: [PATCH 1265/2268] test(deps): update dependency com.google.truth:truth to v1.1.4 (#2725) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index eaaa0a5d06..e040d96d35 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.truth truth - 1.1.3 + 1.1.4 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index be05c5bf6f..22c1bf2b54 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.1.3 + 1.1.4 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 6cf142b53c..d0e8644dd2 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.1.3 + 1.1.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 045fabf2ff..711f37a779 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.1.3 + 1.1.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d313d4e8d9..c3acecf5f2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.1.3 + 1.1.4 test From cbd5d3f25d79f69bd1731704ba6ba5fe02d1d926 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 21:26:31 +0200 Subject: [PATCH 1266/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.26.1 (#2705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.26.1 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 775b3d27d5..4abf39d8bc 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.26.0 + 2.26.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 22c1bf2b54..241d1b12bf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.26.0 + 2.26.1 From c8d9fabc4a597f640b138a10dc3891e977da748b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 May 2023 21:38:15 +0200 Subject: [PATCH 1267/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.15.0 (#2702) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.14.0` -> `26.15.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.15.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.15.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.15.0/compatibility-slim/26.14.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/26.15.0/confidence-slim/26.14.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-cloud-bom ### [`v26.15.0`](https://togithub.com/googleapis/java-cloud-bom/blob/HEAD/CHANGELOG.md#​26150-httpsgithubcomgoogleapisjava-cloud-bomcomparev26140v26150-2023-05-16) [Compare Source](https://togithub.com/googleapis/java-cloud-bom/compare/v26.14.0...v26.15.0) ##### Dependencies - update dependency com.google.cloud:first-party-dependencies to v3.9.0 ([#​5974](https://togithub.com/googleapis/java-cloud-bom/issues/5974)) ([3730711](https://togithub.com/googleapis/java-cloud-bom/commit/3730711dbf7616fcc914a65a1e956b26a13beee3)) - update dependency com.google.cloud:gapic-libraries-bom to v1.11.0 ([#​5981](https://togithub.com/googleapis/java-cloud-bom/issues/5981)) ([26d29e3](https://togithub.com/googleapis/java-cloud-bom/commit/26d29e38e2ee6e46fce204e001f6ac292c1d1ab3)) - update dependency com.google.cloud:google-cloud-bigquery to v2.26.0 ([#​5989](https://togithub.com/googleapis/java-cloud-bom/issues/5989)) ([7cbc31a](https://togithub.com/googleapis/java-cloud-bom/commit/7cbc31ac30d95fdd31b6e94d7af79fc1a021b059)) - update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.0 ([#​5986](https://togithub.com/googleapis/java-cloud-bom/issues/5986)) ([e72a9b9](https://togithub.com/googleapis/java-cloud-bom/commit/e72a9b9a7282e87d68de1465e61310814476debe)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.23.0 ([#​5975](https://togithub.com/googleapis/java-cloud-bom/issues/5975)) ([7670085](https://togithub.com/googleapis/java-cloud-bom/commit/7670085733f6803849fa027da53d956d55a0afa6)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.23.1 ([#​5982](https://togithub.com/googleapis/java-cloud-bom/issues/5982)) ([6555f26](https://togithub.com/googleapis/java-cloud-bom/commit/6555f26029d1cbfa21898cd0b25cd19728d588c6)) - update dependency com.google.cloud:google-cloud-datastore-bom to v2.14.6 ([#​5976](https://togithub.com/googleapis/java-cloud-bom/issues/5976)) ([4b33ff3](https://togithub.com/googleapis/java-cloud-bom/commit/4b33ff3331897654215d306925aa10c11bfff5a5)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.11.0 ([#​5990](https://togithub.com/googleapis/java-cloud-bom/issues/5990)) ([34e6d13](https://togithub.com/googleapis/java-cloud-bom/commit/34e6d13eb868a2578752b4468dc0df03e27768c2)) - update dependency com.google.cloud:google-cloud-logging-bom to v3.15.0 ([#​5973](https://togithub.com/googleapis/java-cloud-bom/issues/5973)) ([6b5e212](https://togithub.com/googleapis/java-cloud-bom/commit/6b5e21232feb9b44fa9943ac7efb78544d88cae0)) - update dependency com.google.cloud:google-cloud-logging-bom to v3.15.1 ([#​5983](https://togithub.com/googleapis/java-cloud-bom/issues/5983)) ([ab7420a](https://togithub.com/googleapis/java-cloud-bom/commit/ab7420a3e05b121c4a4f12d0ef1a0029aa116738)) - update dependency com.google.cloud:google-cloud-logging-logback to v0.130.12-alpha ([#​5987](https://togithub.com/googleapis/java-cloud-bom/issues/5987)) ([903db64](https://togithub.com/googleapis/java-cloud-bom/commit/903db645e4cc353cfdf4bf1f2ddc03de0c029bba)) - update dependency com.google.cloud:google-cloud-nio to v0.126.15 ([#​5980](https://togithub.com/googleapis/java-cloud-bom/issues/5980)) ([c30c6db](https://togithub.com/googleapis/java-cloud-bom/commit/c30c6db9a14ed16039f55cdb3ae53f736c300bda)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.12 ([#​5984](https://togithub.com/googleapis/java-cloud-bom/issues/5984)) ([f0c8b46](https://togithub.com/googleapis/java-cloud-bom/commit/f0c8b46d8003d9eabd72f99e37a3c0e66cd00521)) - update dependency com.google.cloud:google-cloud-pubsublite-bom to v1.12.5 ([#​5988](https://togithub.com/googleapis/java-cloud-bom/issues/5988)) ([d537c53](https://togithub.com/googleapis/java-cloud-bom/commit/d537c532eef156625281e4bf8ef4712c97af4ebb)) - update dependency com.google.cloud:google-cloud-spanner-bom to v6.42.0 ([#​5991](https://togithub.com/googleapis/java-cloud-bom/issues/5991)) ([530dc1b](https://togithub.com/googleapis/java-cloud-bom/commit/530dc1b7358b980dad755d1fe4624e0f46c89f4d)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.9.16 ([#​5985](https://togithub.com/googleapis/java-cloud-bom/issues/5985)) ([f47314a](https://togithub.com/googleapis/java-cloud-bom/commit/f47314a7f5590983a0b3ebb1c0394aa2572fa94a)) - update dependency com.google.cloud:google-cloud-storage-bom to v2.22.2 ([#​5978](https://togithub.com/googleapis/java-cloud-bom/issues/5978)) ([f61a097](https://togithub.com/googleapis/java-cloud-bom/commit/f61a097ee841ec5176f797c86a4f60ba519110bb))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4abf39d8bc..d26c0dbcf0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.14.0 + 26.15.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d0e8644dd2..d48ceb280b 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.14.0 + 26.15.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c3acecf5f2..274942702d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.14.0 + 26.15.0 pom import From 052c47aa43b0f50414db3031914e8a775ae98925 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 31 May 2023 01:17:46 +0200 Subject: [PATCH 1268/2268] deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.2 (#2726) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e040d96d35..6de72c050b 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.37.1 + 2.37.2 pom import From 7f519897391238b8c3087ffa6100a07a0358d17d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 03:28:12 +0000 Subject: [PATCH 1269/2268] chore(main): release 2.27.0 (#2717) :robot: I have created a release *beep* *boop* --- ## [2.27.0](https://togithub.com/googleapis/java-bigquery/compare/v2.26.1...v2.27.0) (2023-05-30) ### Features * Add support for session id on TableDataWriteChannel ([#2715](https://togithub.com/googleapis/java-bigquery/issues/2715)) ([42851d8](https://togithub.com/googleapis/java-bigquery/commit/42851d818ee825d7c4141d40d116e1da43c11f14)) ### Bug Fixes * Add support for repeated record query parameters ([#2698](https://togithub.com/googleapis/java-bigquery/issues/2698)) ([51aff50](https://togithub.com/googleapis/java-bigquery/commit/51aff502215d69bd0151030421cd18646c6ead36)) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.20.0 ([#2720](https://togithub.com/googleapis/java-bigquery/issues/2720)) ([4962cac](https://togithub.com/googleapis/java-bigquery/commit/4962cac8fb3fe8d77a136eaf1b579cd79304acfb)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230506-2.0.0 ([#2707](https://togithub.com/googleapis/java-bigquery/issues/2707)) ([4d2ec07](https://togithub.com/googleapis/java-bigquery/commit/4d2ec0716287e9624949cbcdf6605c127c209be4)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230520-2.0.0 ([#2723](https://togithub.com/googleapis/java-bigquery/issues/2723)) ([5c64797](https://togithub.com/googleapis/java-bigquery/commit/5c64797c603343408849535b2dbf8080cd11ca32)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.2 ([#2726](https://togithub.com/googleapis/java-bigquery/issues/2726)) ([052c47a](https://togithub.com/googleapis/java-bigquery/commit/052c47aa43b0f50414db3031914e8a775ae98925)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.24.0 ([#2721](https://togithub.com/googleapis/java-bigquery/issues/2721)) ([7c357fb](https://togithub.com/googleapis/java-bigquery/commit/7c357fb414d45fde734c09c88ee3023d8d8f5822)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.10.1 ([#2713](https://togithub.com/googleapis/java-bigquery/issues/2713)) ([744e83a](https://togithub.com/googleapis/java-bigquery/commit/744e83a3da5323bc2cff2bcc6368a3eec39f392e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 22 ++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f8d687142..cceeee3b35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.27.0](https://github.com/googleapis/java-bigquery/compare/v2.26.1...v2.27.0) (2023-05-30) + + +### Features + +* Add support for session id on TableDataWriteChannel ([#2715](https://github.com/googleapis/java-bigquery/issues/2715)) ([42851d8](https://github.com/googleapis/java-bigquery/commit/42851d818ee825d7c4141d40d116e1da43c11f14)) + + +### Bug Fixes + +* Add support for repeated record query parameters ([#2698](https://github.com/googleapis/java-bigquery/issues/2698)) ([51aff50](https://github.com/googleapis/java-bigquery/commit/51aff502215d69bd0151030421cd18646c6ead36)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.20.0 ([#2720](https://github.com/googleapis/java-bigquery/issues/2720)) ([4962cac](https://github.com/googleapis/java-bigquery/commit/4962cac8fb3fe8d77a136eaf1b579cd79304acfb)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230506-2.0.0 ([#2707](https://github.com/googleapis/java-bigquery/issues/2707)) ([4d2ec07](https://github.com/googleapis/java-bigquery/commit/4d2ec0716287e9624949cbcdf6605c127c209be4)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230520-2.0.0 ([#2723](https://github.com/googleapis/java-bigquery/issues/2723)) ([5c64797](https://github.com/googleapis/java-bigquery/commit/5c64797c603343408849535b2dbf8080cd11ca32)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.37.2 ([#2726](https://github.com/googleapis/java-bigquery/issues/2726)) ([052c47a](https://github.com/googleapis/java-bigquery/commit/052c47aa43b0f50414db3031914e8a775ae98925)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.24.0 ([#2721](https://github.com/googleapis/java-bigquery/issues/2721)) ([7c357fb](https://github.com/googleapis/java-bigquery/commit/7c357fb414d45fde734c09c88ee3023d8d8f5822)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.10.1 ([#2713](https://github.com/googleapis/java-bigquery/issues/2713)) ([744e83a](https://github.com/googleapis/java-bigquery/commit/744e83a3da5323bc2cff2bcc6368a3eec39f392e)) + ## [2.26.1](https://github.com/googleapis/java-bigquery/compare/v2.26.0...v2.26.1) (2023-05-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d797a46ead..1f8ff6a03c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.26.2-SNAPSHOT + 2.27.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a2876e5b71..32757e5029 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.26.2-SNAPSHOT + 2.27.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.26.2-SNAPSHOT + 2.27.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6de72c050b..a7cedc04df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.26.2-SNAPSHOT + 2.27.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.26.2-SNAPSHOT + 2.27.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 711f37a779..eb260b372a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.26.2-SNAPSHOT + 2.27.0 diff --git a/versions.txt b/versions.txt index 4fe31fe109..2427ff3366 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.26.1:2.26.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.27.0:2.27.0 \ No newline at end of file From 5703b70d3612c901e9361dc0a3954706fbe85aec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 14:34:12 +0000 Subject: [PATCH 1270/2268] chore(main): release 2.27.1-SNAPSHOT (#2727) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1f8ff6a03c..a576ba45de 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.27.0 + 2.27.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 32757e5029..2d4106ee28 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.27.0 + 2.27.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.27.0 + 2.27.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a7cedc04df..bd7389243d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.27.0 + 2.27.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.27.0 + 2.27.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index eb260b372a..838503b805 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.27.0 + 2.27.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 2427ff3366..e08c2401d4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.27.0:2.27.0 \ No newline at end of file +google-cloud-bigquery:2.27.0:2.27.1-SNAPSHOT \ No newline at end of file From f7a03636a1a92897b66a3db1f972b0eb173535fc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 1 Jun 2023 23:31:59 +0200 Subject: [PATCH 1271/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.16.0 (#2732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.16.0 * 🦉 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 --- README.md | 10 +++++----- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d26c0dbcf0..a3fe8f1583 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.15.0 + 26.16.0 pom import @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.15.0') +implementation platform('com.google.cloud:libraries-bom:26.16.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.26.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.27.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.26.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.27.0" ``` @@ -349,7 +349,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.26.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.27.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d48ceb280b..edaeb5f0ab 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.15.0 + 26.16.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 274942702d..dc5f6e31ea 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.15.0 + 26.16.0 pom import From fbb2bbc6b962ca1591e3545e0b6b92dbcce6194c Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Fri, 2 Jun 2023 10:48:15 -0400 Subject: [PATCH 1272/2268] chore: add add samples for sessionID support in Load jobs (#2731) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Chore: add add samples for sessionID support in Load jobs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * lint fixes * Update pom.xml * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 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 --- README.md | 1 + .../bigquery/LoadLocalFileInSession.java | 163 ++++++++++++++++++ .../bigquery/LoadLocalFileInSessionIT.java | 97 +++++++++++ 3 files changed, 261 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/LoadLocalFileInSessionIT.java diff --git a/README.md b/README.md index a3fe8f1583..b7a5c463fc 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Load Json From Gcs Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsCmek.java) | | Load Json From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadJsonFromGcsTruncate.java) | | Load Local File | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadLocalFile.java) | +| Load Local File In Session | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java) | | Load Orc From Gcs | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcs.java) | | Load Orc From Gcs Truncate | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadOrcFromGcsTruncate.java) | | Load Parquet | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/LoadParquet.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java b/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java new file mode 100644 index 0000000000..8efef5c405 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/LoadLocalFileInSession.java @@ -0,0 +1,163 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.ConnectionProperty; +import com.google.cloud.bigquery.CsvOptions; +import com.google.cloud.bigquery.FormatOptions; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobStatistics.LoadStatistics; +import com.google.cloud.bigquery.TableDataWriteChannel; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.WriteChannelConfiguration; +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.channels.Channels; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.UUID; + +public class LoadLocalFileInSession { + + public static void main(String[] args) throws IOException, InterruptedException { + // Use _SESSION if the table is a temporary table + String datasetName = "MY_DATASET_NAME"; + String tableName = "MY_TABLE_NAME"; + Path csvPath = FileSystems.getDefault().getPath(".", "my-data.csv"); + String sessionId = + createSessionForLoading(datasetName, tableName, csvPath, FormatOptions.csv()); + loadLocalFileInSession(datasetName, tableName, csvPath, FormatOptions.csv(), sessionId); + } + + // [START bigquery_load_from_file_create_session] + + public static String createSessionForLoading( + String datasetName, String tableName, Path csvPath, CsvOptions formatOptions) + throws IOException, InterruptedException { + LoadStatistics loadStatistics = null; + try { + + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + TableId tableId = TableId.of(datasetName, tableName); + + // Enable createSession in the configuration + WriteChannelConfiguration writeChannelConfiguration = + WriteChannelConfiguration.newBuilder(tableId) + .setFormatOptions(formatOptions) + .setCreateSession(true) + .build(); + + // The location and JobName must be specified; other fields can be auto-detected. + String jobName = "jobId_" + UUID.randomUUID().toString(); + JobId jobId = JobId.newBuilder().setLocation("us").setJob(jobName).build(); + + // Imports a local file into a table. + try (TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration); + OutputStream stream = Channels.newOutputStream(writer)) { + Files.copy(csvPath, stream); + } + + // Get the Job created by the TableDataWriteChannel and wait for it to complete. + // Then retrieve the session ID + Job job = bigquery.getJob(jobId); + Job completedJob = job.waitFor(); + loadStatistics = completedJob.getStatistics(); + if (completedJob == null) { + System.out.println("Job not executed since it no longer exists."); + return ""; + } else if (completedJob.getStatus().getError() != null) { + System.out.println( + "BigQuery was unable to load local file to the table due to an error: \n" + + job.getStatus().getError()); + return ""; + } + + } catch (BigQueryException e) { + System.out.println("Local file not loaded. \n" + e.toString()); + } + return loadStatistics.getSessionInfo().getSessionId(); + } + + // [END bigquery_load_from_file_create_session] + + // [START bigquery_load_from_file_with_session] + public static void loadLocalFileInSession( + String datasetName, + String tableName, + Path csvPath, + FormatOptions formatOptions, + String sessionId) + throws IOException, InterruptedException { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + TableId tableId = TableId.of(datasetName, tableName); + + // Create ConnectionProperty with sessionID + ConnectionProperty sessionConnectionProperty = + ConnectionProperty.newBuilder().setKey("session_id").setValue(sessionId).build(); + + // Set the Connection Property with the SessionID in the Configuration. + WriteChannelConfiguration writeChannelConfiguration = + WriteChannelConfiguration.newBuilder(tableId) + .setFormatOptions(formatOptions) + .setConnectionProperties(ImmutableList.of(sessionConnectionProperty)) + .build(); + + // The location and JobName must be specified; other fields can be auto-detected. + String jobName = "jobId_" + UUID.randomUUID().toString(); + JobId jobId = JobId.newBuilder().setLocation("us").setJob(jobName).build(); + + // Imports a local file into a table. + try (TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration); + OutputStream stream = Channels.newOutputStream(writer)) { + Files.copy(csvPath, stream); + } + + // Get the Job created by the TableDataWriteChannel and wait for it to complete. + Job job = bigquery.getJob(jobId); + Job completedJob = job.waitFor(); + if (completedJob == null) { + System.out.println("Job not executed since it no longer exists."); + return; + } else if (completedJob.getStatus().getError() != null) { + System.out.println( + "BigQuery was unable to load local file to the table due to an error: \n" + + job.getStatus().getError()); + return; + } + + // Get output status + LoadStatistics stats = job.getStatistics(); + System.out.printf( + "Successfully loaded to Session %s. \n", stats.getSessionInfo().getSessionId()); + } catch (BigQueryException e) { + System.out.println("Local file not loaded. \n" + e.toString()); + } + } + // [END bigquery_load_from_file_with_session] +} diff --git a/samples/snippets/src/test/java/com/example/bigquery/LoadLocalFileInSessionIT.java b/samples/snippets/src/test/java/com/example/bigquery/LoadLocalFileInSessionIT.java new file mode 100644 index 0000000000..1bf6128784 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/LoadLocalFileInSessionIT.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertFalse; +import static junit.framework.TestCase.assertNotNull; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FormatOptions; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.Schema; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class LoadLocalFileInSessionIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String tableName; + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); + + private static void requireEnvVar(String varName) { + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("BIGQUERY_DATASET_NAME"); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + tableName = "LOADLOCALFILETESTTABLE_" + UUID.randomUUID().toString().substring(0, 8); + Schema schema = + Schema.of( + Field.of("Name", LegacySQLTypeName.STRING), + Field.of("Age", LegacySQLTypeName.NUMERIC), + Field.of("Weight", LegacySQLTypeName.NUMERIC), + Field.of("IsMagic", LegacySQLTypeName.BOOLEAN)); + CreateTable.createTable(BIGQUERY_DATASET_NAME, tableName, schema); + } + + @After + public void tearDown() { + // Clean up + DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableName); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void loadLocalFileInSession() throws IOException, InterruptedException { + Path csvPath = FileSystems.getDefault().getPath("src/test/resources", "bigquery_noheader.csv"); + String sessionId = + LoadLocalFileInSession.createSessionForLoading( + BIGQUERY_DATASET_NAME, tableName, csvPath, FormatOptions.csv()); + assertFalse(sessionId.isEmpty()); + LoadLocalFileInSession.loadLocalFileInSession( + BIGQUERY_DATASET_NAME, tableName, csvPath, FormatOptions.csv(), sessionId); + assertThat(bout.toString()).contains("Successfully loaded to Session"); + } +} From d178593c0eb5b9f516861bb93415293c0c4764b3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 Jun 2023 04:08:00 +0200 Subject: [PATCH 1273/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.6 (#2734) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bd7389243d..cf8b0deb4d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.5 + 1.5.6 From d665e523b2c393c17a734ff4714aeb85f8d61dd7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Jun 2023 21:45:11 +0200 Subject: [PATCH 1274/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.21.0 (#2741) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf8b0deb4d..e662828850 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.20.0 + 2.21.0 test From 5b3b4569a28e7a5b967a77822c89408fec79a029 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Jun 2023 21:46:00 +0200 Subject: [PATCH 1275/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.22.4 (#2740) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e662828850..4fef5dbefc 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.22.3 + 2.22.4 test From 3b564458eef9df2173c47e26e2399a6a6cad6eee Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Jun 2023 21:46:19 +0200 Subject: [PATCH 1276/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.11.0 (#2738) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fef5dbefc..d4ffb83278 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230520-2.0.0 - 3.10.1 + 3.11.0 12.0.0 From f1036b39d1989fbf94f01a7ac0acc11b71a9efe5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Jun 2023 21:46:27 +0200 Subject: [PATCH 1277/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.1.2 (#2737) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index edaeb5f0ab..2a02c3c613 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.0 + 3.1.2 **/*IT From 01dab9f1ae94d0f2b829d55c962a40f57bb0dba6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Jun 2023 21:46:34 +0200 Subject: [PATCH 1278/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.5 (#2736) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d4ffb83278..8324f62310 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.4 + 3.4.5 From 0dfbe1f887f2bcb73e2a53c9bdc5fc163aae9fa7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 00:11:45 +0200 Subject: [PATCH 1279/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.27.0 (#2729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.27.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7a5c463fc..359e63f783 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.26.1 + 2.27.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 241d1b12bf..69a9c29fba 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.26.1 + 2.27.0 From 8013426ad04b00638ac70679c91937ef7aa6716b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 00:11:52 +0200 Subject: [PATCH 1280/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.23.2 (#2728) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.23.2 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 69a9c29fba..128ad4400b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.23.1 + 2.23.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 838503b805..e904257fc0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.23.1 + 2.23.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index dc5f6e31ea..f0e9db1845 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.23.1 + 2.23.2 test From f043ed61dacf4ea66eedaf0a6faada06057b7d50 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 00:11:58 +0200 Subject: [PATCH 1281/2268] deps: update github/codeql-action action to v2.3.6 (#2712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.3.6 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 658dc2f530..0a91fbb205 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 + uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 with: sarif_file: results.sarif From 42ae18134b972c1694a7e012d2f51c916e663c83 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 22:13:34 +0200 Subject: [PATCH 1282/2268] deps: update github/codeql-action action to v2.20.0 (#2751) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 0a91fbb205..d19cd9ae9b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 + uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.20.0 with: sarif_file: results.sarif From 16d5ab3918fef14a4e34023e12b2f9d0efa43471 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 22:15:35 +0200 Subject: [PATCH 1283/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.23.3 (#2748) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 128ad4400b..773fd5851f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.23.2 + 2.23.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e904257fc0..38f7acd8e7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.23.2 + 2.23.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f0e9db1845..fc84cf1d93 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.23.2 + 2.23.3 test From 1c492bb63ddafbb4aff9354f706b5d816d3b2319 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 22:34:17 +0200 Subject: [PATCH 1284/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.21.0 (#2742) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8324f62310..9df7af47a3 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.20.0 + 2.21.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 773fd5851f..f608c7f393 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.20.0 + 2.21.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 38f7acd8e7..7e9b1b634f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.20.0 + 2.21.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index fc84cf1d93..974421e08e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.20.0 + 2.21.0 test From 5d38d2375cedd29e35d75881a206cab3fdcdd6a5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 22:34:24 +0200 Subject: [PATCH 1285/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.25.0 (#2743) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9df7af47a3..f1118e7a3b 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.24.0 + 1.25.0 pom import From 17f843880f5633b602de5221c26b830e7e304d2b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 22:48:47 +0200 Subject: [PATCH 1286/2268] deps: update actions/checkout action to v3.5.3 (#2746) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d19cd9ae9b..b87a7d0110 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 with: persist-credentials: false From a7b8334491853c61cd1f5eac2c6c20845f12be53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 16:48:54 -0400 Subject: [PATCH 1287/2268] build(deps): bump cryptography from 39.0.1 to 41.0.0 in /.kokoro (#2733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): bump cryptography from 39.0.1 to 41.0.0 in /.kokoro Bumps [cryptography](https://github.com/pyca/cryptography) from 39.0.1 to 41.0.0. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/39.0.1...41.0.0) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot From ce0c42e04892924b647b703757f1eedb7607b429 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Jun 2023 23:00:13 +0200 Subject: [PATCH 1288/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.38.0 (#2752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `2.37.2` -> `2.38.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.38.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.38.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.38.0/compatibility-slim/2.37.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerystorage-bom/2.38.0/confidence-slim/2.37.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage ### [`v2.38.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#​2380-httpsgithubcomgoogleapisjava-bigquerystoragecomparev2372v2380-2023-06-13) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v2.37.2...v2.38.0) ##### Features - Add storage error codes for KMS ([5d2d3c6](https://togithub.com/googleapis/java-bigquerystorage/commit/5d2d3c6fc6be14a3cb79cf0ce0e82b48699a97c4)) - Add table sampling to ReadAPI v1 ([5d2d3c6](https://togithub.com/googleapis/java-bigquerystorage/commit/5d2d3c6fc6be14a3cb79cf0ce0e82b48699a97c4)) ##### Bug Fixes - Update copyright year in Java license header replacement template ([#​1810](https://togithub.com/googleapis/java-bigquerystorage/issues/1810)) ([#​2138](https://togithub.com/googleapis/java-bigquerystorage/issues/2138)) ([af99efe](https://togithub.com/googleapis/java-bigquerystorage/commit/af99efe938302e0d09c98308ad081244d9c5633e)) ##### Dependencies - Update arrow.version to v12.0.1 ([#​2143](https://togithub.com/googleapis/java-bigquerystorage/issues/2143)) ([7fb618e](https://togithub.com/googleapis/java-bigquerystorage/commit/7fb618e16b6a06278d511e771b8b46ebf4658aa9)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.27.0 ([#​2131](https://togithub.com/googleapis/java-bigquerystorage/issues/2131)) ([e459348](https://togithub.com/googleapis/java-bigquerystorage/commit/e4593486959e86808255517861361805dc8769aa)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.11.0 ([#​2137](https://togithub.com/googleapis/java-bigquerystorage/issues/2137)) ([5fe7cdb](https://togithub.com/googleapis/java-bigquerystorage/commit/5fe7cdb6c9b6899a13b0fdde0a5a436d68a509e2)) - Update dependency org.apache.arrow:arrow-memory-netty to v12.0.1 ([#​2144](https://togithub.com/googleapis/java-bigquerystorage/issues/2144)) ([e738bff](https://togithub.com/googleapis/java-bigquerystorage/commit/e738bff88e3efaf0f6beb5f2d93057a175671d3e)) - Update dependency org.apache.arrow:arrow-vector to v12.0.1 ([#​2145](https://togithub.com/googleapis/java-bigquerystorage/issues/2145)) ([34dfda6](https://togithub.com/googleapis/java-bigquerystorage/commit/34dfda6aeec700c0722ad559e71e85bdedd04bfb)) - Update dependency org.mockito:mockito-core to v3.12.4 ([#​2146](https://togithub.com/googleapis/java-bigquerystorage/issues/2146)) ([1434fc0](https://togithub.com/googleapis/java-bigquerystorage/commit/1434fc0b995f5d6c8039acca8ca530e9d11f490b))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1118e7a3b..b68182b761 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.37.2 + 2.38.0 pom import From 2be7f8106ac9f566b924a3f0b4ae85be5a42eb1e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 17:15:45 -0400 Subject: [PATCH 1289/2268] chore(main): release 2.27.1 (#2747) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cceeee3b35..80bac768be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.27.1](https://github.com/googleapis/java-bigquery/compare/v2.27.0...v2.27.1) (2023-06-13) + + +### Dependencies + +* Update actions/checkout action to v3.5.3 ([#2746](https://github.com/googleapis/java-bigquery/issues/2746)) ([17f8438](https://github.com/googleapis/java-bigquery/commit/17f843880f5633b602de5221c26b830e7e304d2b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.21.0 ([#2741](https://github.com/googleapis/java-bigquery/issues/2741)) ([d665e52](https://github.com/googleapis/java-bigquery/commit/d665e523b2c393c17a734ff4714aeb85f8d61dd7)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.25.0 ([#2743](https://github.com/googleapis/java-bigquery/issues/2743)) ([5d38d23](https://github.com/googleapis/java-bigquery/commit/5d38d2375cedd29e35d75881a206cab3fdcdd6a5)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.11.0 ([#2738](https://github.com/googleapis/java-bigquery/issues/2738)) ([3b56445](https://github.com/googleapis/java-bigquery/commit/3b564458eef9df2173c47e26e2399a6a6cad6eee)) +* Update github/codeql-action action to v2.20.0 ([#2751](https://github.com/googleapis/java-bigquery/issues/2751)) ([42ae181](https://github.com/googleapis/java-bigquery/commit/42ae18134b972c1694a7e012d2f51c916e663c83)) +* Update github/codeql-action action to v2.3.6 ([#2712](https://github.com/googleapis/java-bigquery/issues/2712)) ([f043ed6](https://github.com/googleapis/java-bigquery/commit/f043ed61dacf4ea66eedaf0a6faada06057b7d50)) + ## [2.27.0](https://github.com/googleapis/java-bigquery/compare/v2.26.1...v2.27.0) (2023-05-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a576ba45de..d7ecf96cfc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.27.1-SNAPSHOT + 2.27.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2d4106ee28..7c18b2e595 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.27.1-SNAPSHOT + 2.27.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.27.1-SNAPSHOT + 2.27.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b68182b761..17592c2e18 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.27.1-SNAPSHOT + 2.27.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.27.1-SNAPSHOT + 2.27.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7e9b1b634f..d5ecc32715 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.27.1-SNAPSHOT + 2.27.1 diff --git a/versions.txt b/versions.txt index e08c2401d4..b89a2104af 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.27.0:2.27.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.27.1:2.27.1 \ No newline at end of file From e371e65379711a0c2feffd9809721e7941503bea Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:16:13 +0000 Subject: [PATCH 1290/2268] chore(main): release 2.27.2-SNAPSHOT (#2753) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d7ecf96cfc..36158d2258 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.27.1 + 2.27.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7c18b2e595..2a6c2dfd4f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.27.1 + 2.27.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.27.1 + 2.27.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 17592c2e18..8fa726a483 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.27.1 + 2.27.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.27.1 + 2.27.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d5ecc32715..b226b12b21 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.27.1 + 2.27.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index b89a2104af..e2ff381f41 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.27.1:2.27.1 \ No newline at end of file +google-cloud-bigquery:2.27.1:2.27.2-SNAPSHOT \ No newline at end of file From aa38428ad26b64d2566b33f4b2ca3dcc102c3247 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 14 Jun 2023 16:13:51 -0400 Subject: [PATCH 1291/2268] feat: return JobID with TableResult (#2689) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: improve job create retry * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: remove option 2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: pass jobid from job.getQUeryResults() * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * choreL set jobID as null when empty * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add IT tests * chore: complete tests * chore: make setJobId package private * chore: remove redundant job ID setting * 🦉 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 --- README.md | 8 ++-- .../google/cloud/bigquery/BigQueryImpl.java | 12 ++++-- .../java/com/google/cloud/bigquery/Job.java | 11 ++++-- .../google/cloud/bigquery/TableResult.java | 19 +++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 39 +++++++++++++++++++ 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 359e63f783..7ab4f1f6c1 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.16.0') +implementation platform('com.google.cloud:libraries-bom:26.17.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.27.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.27.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.27.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.27.1" ``` @@ -350,7 +350,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.27.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.27.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index b5ca2e5776..d1bbcb5e2c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -411,7 +411,7 @@ public com.google.api.services.bigquery.model.Job call() { } }, getOptions().getRetrySettings(), - EXCEPTION_HANDLER, + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), DEFAULT_RETRY_CONFIG)); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { @@ -1334,7 +1334,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() { List bigQueryErrors = Lists.transform(results.getErrors(), BigQueryError.FROM_PB_FUNCTION); // Throwing BigQueryException since there may be no JobId and we want to stay consistent - // with the case where there there is a HTTP error + // with the case where there is an HTTP error throw new BigQueryException(bigQueryErrors); } @@ -1369,7 +1369,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() { new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), cursor, // cache first page of result - transformTableData(results.getRows(), schema))); + transformTableData(results.getRows(), schema)), + // Return the JobID of the successful job + jobId); } // only 1 page of result return new TableResult( @@ -1378,7 +1380,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() { new PageImpl<>( new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), null, - transformTableData(results.getRows(), schema))); + transformTableData(results.getRows(), schema)), + // Return the JobID of the successful job + results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null); } @Override diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 7ed27676ce..db9b4b1736 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -311,15 +311,20 @@ public TableResult getQueryResults(QueryResultsOption... options) // Listing table data might fail, such as with CREATE VIEW queries. // Avoid a tabledata.list API request by returning an empty TableResult. if (response.getTotalRows() == 0) { - return new EmptyTableResult(response.getSchema()); + TableResult emptyTableResult = new EmptyTableResult(response.getSchema()); + emptyTableResult.setJobId(job.getJobId()); + return emptyTableResult; } TableId table = ((QueryJobConfiguration) getConfiguration()).getDestinationTable() == null ? ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable() : ((QueryJobConfiguration) getConfiguration()).getDestinationTable(); - return bigquery.listTableData( - table, response.getSchema(), listOptions.toArray(new TableDataListOption[0])); + TableResult tableResult = + bigquery.listTableData( + table, response.getSchema(), listOptions.toArray(new TableDataListOption[0])); + tableResult.setJobId(job.getJobId()); + return tableResult; } private QueryResponse waitForQueryResults( diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index a7be10d7d2..325e1fd0bd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -35,6 +35,16 @@ public class TableResult implements Page, Serializable { @Nullable private final Schema schema; private final long totalRows; private final Page pageNoSchema; + @Nullable private JobId jobId = null; + + // package-private so job id is not set outside the package. + void setJobId(@Nullable JobId jobId) { + this.jobId = jobId; + } + + public JobId getJobId() { + return jobId; + } /** * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s @@ -47,6 +57,15 @@ public TableResult(Schema schema, long totalRows, Page pageNoSch this.pageNoSchema = checkNotNull(pageNoSchema); } + @InternalApi("Exposed for testing") + public TableResult( + Schema schema, long totalRows, Page pageNoSchema, JobId jobId) { + this.schema = schema; + this.totalRows = totalRows; + this.pageNoSchema = checkNotNull(pageNoSchema); + this.jobId = jobId; + } + /** Returns the schema of the results. Null if the schema is not supplied. */ public Schema getSchema() { return schema; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index cdfcb80033..c9edbf585a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1085,6 +1085,7 @@ public void testJsonType() throws InterruptedException { .addPositionalParameter(stringParameter) .build(); TableResult result = bigquery.query(queryJobConfiguration); + assertNotNull(result.getJobId()); for (FieldValueList values : result.iterateAll()) { assertEquals("10", values.get(0).getValue()); } @@ -1209,6 +1210,7 @@ public void testIntervalType() throws InterruptedException { .addPositionalParameter(intervalParameter2) .build(); TableResult result = bigquery.query(queryJobConfiguration); + assertNotNull(result.getJobId()); for (FieldValueList values : result.iterateAll()) { assertEquals("125-7 -19 0:24:12.000006", values.get(0).getValue()); } @@ -1706,6 +1708,7 @@ public void testCreateViewTable() throws InterruptedException { .setUseLegacySql(true) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); int rowCount = 0; for (FieldValueList row : result.getValues()) { FieldValue timestampCell = row.get(0); @@ -2603,6 +2606,7 @@ public void testTimestamp() throws InterruptedException { QueryJobConfiguration.newBuilder(query) .setDefaultDataset(DatasetId.of(DATASET)) .build()); + assertNotNull(resultInteractive.getJobId()); for (FieldValueList row : resultInteractive.getValues()) { FieldValue timeStampCell = row.get(0); Instant timestampStringValueActual = timeStampCell.getTimestampInstant(); @@ -2619,6 +2623,7 @@ public void testQuery() throws InterruptedException { Job job = bigquery.create(JobInfo.of(JobId.of(), config)); TableResult result = job.getQueryResults(); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); int rowCount = 0; for (FieldValueList row : result.getValues()) { @@ -2668,6 +2673,7 @@ public void testQueryTimeStamp() throws InterruptedException { .setDefaultDataset(DatasetId.of(DATASET)) .setPriority(QueryJobConfiguration.Priority.INTERACTIVE) .build()); + assertNotNull(result.getJobId()); for (FieldValueList row : result.getValues()) { FieldValue timeStampCell = row.get(0); long microsAfterQuery = timeStampCell.getTimestampValue(); @@ -2680,6 +2686,7 @@ public void testQueryTimeStamp() throws InterruptedException { QueryJobConfiguration.newBuilder(query) .setDefaultDataset(DatasetId.of(DATASET)) .build()); + assertNotNull(resultInteractive.getJobId()); for (FieldValueList row : resultInteractive.getValues()) { FieldValue timeStampCell = row.get(0); long microsAfterQuery = timeStampCell.getTimestampValue(); @@ -2696,6 +2703,7 @@ public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedExc Job job = bigquery.create(JobInfo.of(JobId.of(), config)); TableResult result = job.getQueryResults(); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); int rowCount = 0; for (FieldValueList row : result.getValues()) { @@ -2744,6 +2752,7 @@ public void testQueryExternalHivePartitioningOptionAutoLayout() throws Interrupt String.format( "SELECT COUNT(*) as ct FROM %s.%s WHERE dt=\"2020-11-15\"", DATASET, tableName); TableResult result = bigquery.query(QueryJobConfiguration.of(query)); + assertNotNull(result.getJobId()); for (FieldValueList fieldValues : result.iterateAll()) { assertEquals(50, fieldValues.get("ct").getLongValue()); } @@ -2780,6 +2789,7 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru String query = String.format("SELECT COUNT(*) as ct FROM %s.%s WHERE pkey=\"foo\"", DATASET, tableName); TableResult result = bigquery.query(QueryJobConfiguration.of(query)); + assertNotNull(result.getJobId()); for (FieldValueList fieldValues : result.iterateAll()) { assertEquals(50, fieldValues.get("ct").getLongValue()); } @@ -3410,6 +3420,7 @@ public void testFastQueryMultipleRuns() throws InterruptedException { QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); assertEquals(2, result.getTotalRows()); assertNull(result.getNextPage()); @@ -3418,6 +3429,8 @@ public void testFastQueryMultipleRuns() throws InterruptedException { // running the same QueryJobConfiguration with the same query again TableResult result1Duplicate = bigquery.query(config); + assertNotNull(result1Duplicate.getJobId()); + assertNotEquals(result.getJobId(), result1Duplicate.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result1Duplicate.getSchema()); assertEquals(2, result.getTotalRows()); assertNull(result1Duplicate.getNextPage()); @@ -3428,6 +3441,7 @@ public void testFastQueryMultipleRuns() throws InterruptedException { QueryJobConfiguration config2 = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result2 = bigquery.query(config2); + assertNotNull(result2.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result2.getSchema()); assertEquals(2, result2.getTotalRows()); assertNull(result2.getNextPage()); @@ -3443,6 +3457,7 @@ public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedExcep QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); assertEquals(2, result.getTotalRows()); assertNull(result.getNextPage()); @@ -3450,6 +3465,7 @@ public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedExcep assertFalse(result.hasNextPage()); TableResult result1 = bigquery.query(config); + assertNotNull(result1.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result1.getSchema()); assertEquals(2, result1.getTotalRows()); assertNull(result1.getNextPage()); @@ -3458,6 +3474,7 @@ public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedExcep config.toBuilder().setQuery(query).build(); TableResult result2 = bigquery.query(config); + assertNotNull(result2.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result2.getSchema()); assertEquals(2, result2.getTotalRows()); assertNull(result2.getNextPage()); @@ -3473,6 +3490,7 @@ public void testFastSQLQuery() throws InterruptedException { QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); assertEquals(2, result.getTotalRows()); assertNull(result.getNextPage()); @@ -3538,6 +3556,7 @@ public void testLocationFastSQLQueryWithJobId() throws InterruptedException { .setDefaultDataset(DatasetId.of(UK_DATASET)) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(SIMPLE_SCHEMA, result.getSchema()); assertEquals(1, result.getTotalRows()); assertNull(result.getNextPage()); @@ -3584,6 +3603,7 @@ public void testFastSQLQueryMultiPage() throws InterruptedException { QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(LARGE_TABLE_SCHEMA, result.getSchema()); assertEquals(313348, result.getTotalRows()); assertNotNull(result.getNextPage()); @@ -3591,6 +3611,7 @@ public void testFastSQLQueryMultiPage() throws InterruptedException { assertTrue(result.hasNextPage()); TableResult result1 = bigquery.query(config); + assertNotNull(result1.getJobId()); assertEquals(LARGE_TABLE_SCHEMA, result.getSchema()); assertEquals(313348, result.getTotalRows()); assertNotNull(result1.getNextPage()); @@ -3599,6 +3620,7 @@ public void testFastSQLQueryMultiPage() throws InterruptedException { config.toBuilder().setQuery(query).build(); TableResult result2 = bigquery.query(config); + assertNotNull(result2.getJobId()); assertEquals(LARGE_TABLE_SCHEMA, result2.getSchema()); assertEquals(313348, result2.getTotalRows()); assertNotNull(result2.getNextPage()); @@ -3613,12 +3635,14 @@ public void testFastDMLQuery() throws InterruptedException { String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); QueryJobConfiguration dmlConfig = QueryJobConfiguration.newBuilder(dmlQuery).build(); TableResult result = bigquery.query(dmlConfig); + assertNotNull(result.getJobId()); assertEquals(TABLE_SCHEMA, result.getSchema()); assertEquals(2, result.getTotalRows()); // Verify correctness of table content String sqlQuery = String.format("SELECT * FROM %s.%s", DATASET, tableName); QueryJobConfiguration sqlConfig = QueryJobConfiguration.newBuilder(sqlQuery).build(); TableResult resultAfterDML = bigquery.query(sqlConfig); + assertNotNull(resultAfterDML.getJobId()); for (FieldValueList row : resultAfterDML.getValues()) { FieldValue timestampCell = row.get(0); assertEquals(timestampCell, row.get("TimestampField")); @@ -3650,12 +3674,14 @@ public void testFastDDLQuery() throws InterruptedException { QueryJobConfiguration ddlConfig = QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); assertEquals(0, result.getTotalRows()); // Verify correctness of table content String sqlQuery = String.format("SELECT * FROM %s.%s", DATASET, tableName); QueryJobConfiguration sqlConfig = QueryJobConfiguration.newBuilder(sqlQuery).build(); TableResult resultAfterDDL = bigquery.query(sqlConfig); + assertNotNull(resultAfterDDL.getJobId()); for (FieldValueList row : resultAfterDDL.getValues()) { FieldValue timestampCell = row.get(0); assertEquals(timestampCell, row.get("TimestampField")); @@ -3686,12 +3712,14 @@ public void testFastQuerySlowDDL() throws InterruptedException { .setDefaultDataset(DatasetId.of(DATASET)) .build(); TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); assertEquals(0, result.getTotalRows()); assertNotNull(result.getSchema()); // Verify correctness of table content String sqlQuery = String.format("SELECT * FROM %s.%s", DATASET, tableName); QueryJobConfiguration sqlConfig = QueryJobConfiguration.newBuilder(sqlQuery).build(); TableResult resultAfterDDL = bigquery.query(sqlConfig); + assertNotNull(resultAfterDDL.getJobId()); for (FieldValueList row : resultAfterDDL.getValues()) { FieldValue unique_key = row.get(0); assertEquals(unique_key, row.get("unique_key")); @@ -3931,6 +3959,7 @@ public void testDmlStatistics() throws InterruptedException { assertNull(remoteJob.getStatus().getError()); TableResult result = remoteJob.getQueryResults(); + assertNotNull(result.getJobId()); assertEquals(TABLE_SCHEMA, result.getSchema()); Job queryJob = bigquery.getJob(remoteJob.getJobId()); @@ -4094,6 +4123,7 @@ public void testPositionalQueryParameters() throws InterruptedException { .addPositionalParameter(bigNumericParameter4) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA_BIGNUMERIC, result.getSchema()); assertEquals(2, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { @@ -4156,6 +4186,7 @@ public void testNamedQueryParameters() throws InterruptedException { .addNamedParameter("integerList", intArrayParameter) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); assertEquals(2, Iterables.size(result.getValues())); } @@ -4202,6 +4233,7 @@ public void testStructNamedQueryParameters() throws InterruptedException { .addNamedParameter("recordField", recordValue) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(1, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { @@ -4428,6 +4460,7 @@ public void testStructQuery() throws InterruptedException { .setUseLegacySql(false) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(2, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { @@ -4469,6 +4502,7 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { .addNamedParameter("nestedRecordField", nestedRecordField) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); assertEquals(1, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { @@ -4497,6 +4531,7 @@ public void testBytesParameter() throws Exception { .addNamedParameter("p", bytesParameter) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); int rowCount = 0; for (FieldValueList row : result.getValues()) { rowCount++; @@ -4520,6 +4555,7 @@ public void testGeographyParameter() throws Exception { .addNamedParameter("geo", geoParameterValue) .build(); TableResult result = bigquery.query(config); + assertNotNull(result.getJobId()); int rowCount = 0; for (FieldValueList row : result.getValues()) { rowCount++; @@ -4709,6 +4745,7 @@ public void testSnapshotTableCopyJob() throws InterruptedException { QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); TableId sourceTableId = TableId.of(DATASET, sourceTableName); TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); Table remoteTable = bigquery.getTable(DATASET, sourceTableName); assertNotNull(remoteTable); @@ -4814,6 +4851,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { assertNull(remoteJob.getStatus().getError()); TableResult result = remoteJob.getQueryResults(); + assertNotNull(result.getJobId()); assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); int rowCount = 0; for (FieldValueList row : result.getValues()) { @@ -5595,6 +5633,7 @@ public void testCloneTableCopyJob() throws InterruptedException { QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); TableId sourceTableId = TableId.of(DATASET, sourceTableName); TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); Table remoteTable = bigquery.getTable(DATASET, sourceTableName); assertNotNull(remoteTable); From afb571c97edb13f93df9ac140af4516205d27a49 Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Fri, 16 Jun 2023 21:00:22 +0200 Subject: [PATCH 1292/2268] feat: add primary key and foreign keys (#2744) Add support for creating/updating primary and foreign keys Internal b/284849902 --- README.md | 1 + .../clirr-ignored-differences.xml | 11 +- .../cloud/bigquery/ColumnReference.java | 79 +++++++ .../com/google/cloud/bigquery/ForeignKey.java | 110 +++++++++ .../com/google/cloud/bigquery/PrimaryKey.java | 68 ++++++ .../bigquery/StandardTableDefinition.java | 15 ++ .../java/com/google/cloud/bigquery/Table.java | 6 + .../cloud/bigquery/TableConstraints.java | 86 +++++++ .../com/google/cloud/bigquery/TableInfo.java | 22 ++ .../cloud/bigquery/ColumnReferenceTest.java | 69 ++++++ .../google/cloud/bigquery/ForeignKeyTest.java | 95 ++++++++ .../google/cloud/bigquery/PrimaryKeyTest.java | 55 +++++ .../cloud/bigquery/TableConstraintsTest.java | 119 ++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 217 ++++++++++++++++++ ...CreateTablesWithPrimaryAndForeignKeys.java | 109 +++++++++ ...eateTablesWithPrimaryAndForeignKeysIT.java | 82 +++++++ 16 files changed, 1143 insertions(+), 1 deletion(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ColumnReference.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ForeignKey.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/PrimaryKey.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableConstraints.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java create mode 100644 samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeysIT.java diff --git a/README.md b/README.md index 7ab4f1f6c1..63bd09cfee 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Create Table Cmek | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableCmek.java) | | Create Table External Hive Partitioned | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableExternalHivePartitioned.java) | | Create Table Without Schema | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTableWithoutSchema.java) | +| Create Tables With Primary And Foreign Keys | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java) | | Create View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/CreateView.java) | | Dataset Exists | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DatasetExists.java) | | Ddl Create View | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/DdlCreateView.java) | diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 5fe634cca7..784a3c9626 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -44,10 +44,19 @@ com/google/cloud/bigquery/TableInfo* *DefaultCollation(*) - 7013 com/google/cloud/bigquery/TableInfo* *CloneDefinition(*) + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *TableConstraints(*) + + + 7013 + com/google/cloud/bigquery/TableInfo* + *TableConstraints(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ColumnReference.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ColumnReference.java new file mode 100644 index 0000000000..3dc688be5f --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ColumnReference.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ColumnReference { + public static ColumnReference.Builder newBuilder() { + return new AutoValue_ColumnReference.Builder(); + } + + static ColumnReference fromPb( + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys.ColumnReferences + columnReference) { + ColumnReference.Builder builder = newBuilder(); + + if (columnReference.getReferencedColumn() != null) { + builder.setReferencedColumn(columnReference.getReferencedColumn()); + } + + if (columnReference.getReferencingColumn() != null) { + builder.setReferencingColumn(columnReference.getReferencingColumn()); + } + + return builder.build(); + } + + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys.ColumnReferences toPb() { + + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys.ColumnReferences + columnReference = + new com.google.api.services.bigquery.model.TableConstraints.ForeignKeys + .ColumnReferences(); + columnReference.setReferencedColumn(getReferencedColumn()); + columnReference.setReferencingColumn(getReferencingColumn()); + + return columnReference; + } + + @Nullable + public abstract String getReferencedColumn(); + + @Nullable + public abstract String getReferencingColumn(); + + /** Returns a builder for column reference. */ + @VisibleForTesting + public abstract ColumnReference.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + /** The target column of this reference. * */ + public abstract ColumnReference.Builder setReferencedColumn(String referencedColumn); + + /** The source column of this reference. * */ + public abstract ColumnReference.Builder setReferencingColumn(String referencingColumn); + + /** Creates a {@code ColumnReference} object. */ + public abstract ColumnReference build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ForeignKey.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ForeignKey.java new file mode 100644 index 0000000000..69c2f74346 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ForeignKey.java @@ -0,0 +1,110 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +@AutoValue +public abstract class ForeignKey implements Serializable { + public static ForeignKey.Builder newBuilder() { + return new AutoValue_ForeignKey.Builder(); + } + + static ForeignKey fromPb( + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys foreignKey) { + ForeignKey.Builder builder = newBuilder(); + + if (foreignKey.getName() != null) { + builder.setName(foreignKey.getName()); + } + + if (foreignKey.getReferencedTable() != null) { + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys.ReferencedTable + referencedTable = foreignKey.getReferencedTable(); + builder.setReferencedTable( + TableId.of( + referencedTable.getProjectId(), + referencedTable.getDatasetId(), + referencedTable.getTableId())); + } + + if (foreignKey.getColumnReferences() != null) { + builder.setColumnReferences( + foreignKey.getColumnReferences().stream() + .map(ColumnReference::fromPb) + .collect(Collectors.toList())); + } + + return builder.build(); + } + + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys toPb() { + + com.google.api.services.bigquery.model.TableConstraints.ForeignKeys foreignKey = + new com.google.api.services.bigquery.model.TableConstraints.ForeignKeys(); + if (getName() != null) { + foreignKey.setName(getName()); + } + if (getReferencedTable() != null) { + TableId referencedTableId = getReferencedTable(); + foreignKey.setReferencedTable( + new com.google.api.services.bigquery.model.TableConstraints.ForeignKeys.ReferencedTable() + .setTableId(referencedTableId.getTable()) + .setDatasetId(referencedTableId.getDataset()) + .setProjectId(referencedTableId.getProject())); + } + if (getColumnReferences() != null) { + foreignKey.setColumnReferences( + getColumnReferences().stream().map(ColumnReference::toPb).collect(Collectors.toList())); + } + return foreignKey; + } + + @Nullable + public abstract String getName(); + + @Nullable + public abstract TableId getReferencedTable(); + + @Nullable + public abstract List getColumnReferences(); + + /** Returns a builder for foreign key. */ + @VisibleForTesting + public abstract ForeignKey.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + /** The name of the foreign key. * */ + public abstract ForeignKey.Builder setName(String name); + + /** The table referenced by this foreign key. * */ + public abstract ForeignKey.Builder setReferencedTable(TableId referencedTable); + + /** The set of column references for this foreign key. * */ + public abstract ForeignKey.Builder setColumnReferences(List columnReferences); + + /** Creates a {@code ForignKey} object. */ + public abstract ForeignKey build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/PrimaryKey.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/PrimaryKey.java new file mode 100644 index 0000000000..a8474cf0fb --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/PrimaryKey.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import java.io.Serializable; +import java.util.List; +import javax.annotation.Nullable; + +@AutoValue +public abstract class PrimaryKey implements Serializable { + public static PrimaryKey.Builder newBuilder() { + return new AutoValue_PrimaryKey.Builder(); + } + + static PrimaryKey fromPb( + com.google.api.services.bigquery.model.TableConstraints.PrimaryKey primaryKey) { + PrimaryKey.Builder builder = newBuilder(); + + if (primaryKey.getColumns() != null) { + builder.setColumns(primaryKey.getColumns()); + } + + return builder.build(); + } + + com.google.api.services.bigquery.model.TableConstraints.PrimaryKey toPb() { + + com.google.api.services.bigquery.model.TableConstraints.PrimaryKey primaryKey = + new com.google.api.services.bigquery.model.TableConstraints.PrimaryKey(); + if (getColumns() != null) { + primaryKey.setColumns(getColumns()); + } + return primaryKey; + } + + @Nullable + public abstract List getColumns(); + + /** Returns a builder for primary key. */ + @VisibleForTesting + public abstract PrimaryKey.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + /** The column names that are primary keys. * */ + public abstract PrimaryKey.Builder setColumns(List columns); + + /** Creates a {@code PrimaryKey} object. */ + public abstract PrimaryKey build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java index 4b09fe3c40..8242147df3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java @@ -161,6 +161,8 @@ public abstract static class Builder */ public abstract Builder setClustering(Clustering clustering); + public abstract Builder setTableConstraints(TableConstraints tableConstraints); + /** Creates a {@code StandardTableDefinition} object. */ public abstract StandardTableDefinition build(); } @@ -221,6 +223,13 @@ public abstract static class Builder @Nullable public abstract Clustering getClustering(); + /** + * Returns the table constraints for this table. Returns {@code null} if no table constraints are + * set for this table. + */ + @Nullable + public abstract TableConstraints getTableConstraints(); + /** Returns a builder for a BigQuery standard table definition. */ public static Builder newBuilder() { return new AutoValue_StandardTableDefinition.Builder().setType(Type.TABLE); @@ -259,6 +268,9 @@ Table toPb() { if (getClustering() != null) { tablePb.setClustering(getClustering().toPb()); } + if (getTableConstraints() != null) { + tablePb.setTableConstraints(getTableConstraints().toPb()); + } return tablePb; } @@ -296,6 +308,9 @@ static StandardTableDefinition fromPb(Table tablePb) { if (tablePb.getNumLongTermBytes() != null) { builder.setNumLongTermBytes(tablePb.getNumLongTermBytes()); } + if (tablePb.getTableConstraints() != null) { + builder.setTableConstraints(TableConstraints.fromPb(tablePb.getTableConstraints())); + } return builder.setNumBytes(tablePb.getNumBytes()).setLocation(tablePb.getLocation()).build(); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index 3e67e8d750..cf1dfb4f7f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -168,6 +168,12 @@ public TableInfo.Builder setCloneDefinition(CloneDefinition cloneDefinition) { return this; } + @Override + public Builder setTableConstraints(TableConstraints tableConstraints) { + infoBuilder.setTableConstraints(tableConstraints); + return this; + } + @Override public Table build() { return new Table(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableConstraints.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableConstraints.java new file mode 100644 index 0000000000..ad30eafcc2 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableConstraints.java @@ -0,0 +1,86 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +@AutoValue +public abstract class TableConstraints implements Serializable { + public static TableConstraints.Builder newBuilder() { + return new AutoValue_TableConstraints.Builder(); + } + + static TableConstraints fromPb( + com.google.api.services.bigquery.model.TableConstraints tableConstraints) { + TableConstraints.Builder builder = newBuilder(); + + if (tableConstraints.getForeignKeys() != null) { + builder.setForeignKeys( + tableConstraints.getForeignKeys().stream() + .map(ForeignKey::fromPb) + .collect(Collectors.toList())); + } + if (tableConstraints.getPrimaryKey() != null) { + builder.setPrimaryKey(PrimaryKey.fromPb(tableConstraints.getPrimaryKey())); + } + + return builder.build(); + } + + com.google.api.services.bigquery.model.TableConstraints toPb() { + + com.google.api.services.bigquery.model.TableConstraints tableConstraints = + new com.google.api.services.bigquery.model.TableConstraints(); + if (getForeignKeys() != null) { + tableConstraints.setForeignKeys( + getForeignKeys().stream().map(ForeignKey::toPb).collect(Collectors.toList())); + } + if (getPrimaryKey() != null) { + tableConstraints.setPrimaryKey(getPrimaryKey().toPb()); + } + + return tableConstraints; + } + + @Nullable + public abstract List getForeignKeys(); + + @Nullable + public abstract PrimaryKey getPrimaryKey(); + + /** Returns a builder for table constraints. */ + @VisibleForTesting + public abstract TableConstraints.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + /** The list of foreign keys for the table constraints. * */ + public abstract TableConstraints.Builder setForeignKeys(List foreignKeys); + + /** The primary key for the table constraints. * */ + public abstract TableConstraints.Builder setPrimaryKey(PrimaryKey primaryKey); + + /** Creates a {@code TableConstraints} object. */ + public abstract TableConstraints build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index 19e9de2b79..abfe21ec46 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -75,6 +75,7 @@ public Table apply(TableInfo tableInfo) { private final String defaultCollation; private final CloneDefinition cloneDefinition; + private final TableConstraints tableConstraints; /** A builder for {@code TableInfo} objects. */ public abstract static class Builder { @@ -142,6 +143,8 @@ public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { public abstract Builder setDefaultCollation(String defaultCollation); public abstract Builder setCloneDefinition(CloneDefinition cloneDefinition); + + public abstract Builder setTableConstraints(TableConstraints tableConstraints); } static class BuilderImpl extends Builder { @@ -164,6 +167,7 @@ static class BuilderImpl extends Builder { private Boolean requirePartitionFilter; private String defaultCollation; private CloneDefinition cloneDefinition; + private TableConstraints tableConstraints; BuilderImpl() {} @@ -186,6 +190,7 @@ static class BuilderImpl extends Builder { this.requirePartitionFilter = tableInfo.requirePartitionFilter; this.defaultCollation = tableInfo.defaultCollation; this.cloneDefinition = tableInfo.cloneDefinition; + this.tableConstraints = tableInfo.tableConstraints; } BuilderImpl(Table tablePb) { @@ -214,6 +219,9 @@ static class BuilderImpl extends Builder { if (tablePb.getCloneDefinition() != null) { this.cloneDefinition = CloneDefinition.fromPb(tablePb.getCloneDefinition()); } + if (tablePb.getTableConstraints() != null) { + this.tableConstraints = TableConstraints.fromPb(tablePb.getTableConstraints()); + } } @Override @@ -323,6 +331,11 @@ public Builder setCloneDefinition(CloneDefinition cloneDefinition) { return this; } + public Builder setTableConstraints(TableConstraints tableConstraints) { + this.tableConstraints = tableConstraints; + return this; + } + @Override public TableInfo build() { return new TableInfo(this); @@ -348,6 +361,7 @@ public TableInfo build() { this.requirePartitionFilter = builder.requirePartitionFilter; this.defaultCollation = builder.defaultCollation; this.cloneDefinition = builder.cloneDefinition; + this.tableConstraints = builder.tableConstraints; } /** Returns the hash of the table resource. */ @@ -458,6 +472,10 @@ public CloneDefinition getCloneDefinition() { return cloneDefinition; } + public TableConstraints getTableConstraints() { + return tableConstraints; + } + /** Returns a builder for the table object. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -484,6 +502,7 @@ public String toString() { .add("requirePartitionFilter", requirePartitionFilter) .add("defaultCollation", defaultCollation) .add("cloneDefinition", cloneDefinition) + .add("tableConstraints", tableConstraints) .toString(); } @@ -551,6 +570,9 @@ Table toPb() { if (cloneDefinition != null) { tablePb.setCloneDefinition(cloneDefinition.toPb()); } + if (tableConstraints != null) { + tablePb.setTableConstraints(tableConstraints.toPb()); + } return tablePb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java new file mode 100644 index 0000000000..7a6cac30f6 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ColumnReferenceTest { + private static final ColumnReference COLUMN_REFERENCE = + ColumnReference.newBuilder() + .setReferencingColumn("column1") + .setReferencedColumn("column2") + .build(); + + @Test + public void testToBuilder() { + compareColumnReferenceDefinition(COLUMN_REFERENCE, COLUMN_REFERENCE.toBuilder().build()); + ColumnReference columnReference = + COLUMN_REFERENCE + .toBuilder() + .setReferencingColumn("col1") + .setReferencedColumn("col2") + .build(); + assertEquals("col1", columnReference.getReferencingColumn()); + assertEquals("col2", columnReference.getReferencedColumn()); + } + + @Test + public void testBuilder() { + assertEquals("column1", COLUMN_REFERENCE.getReferencingColumn()); + assertEquals("column2", COLUMN_REFERENCE.getReferencedColumn()); + ColumnReference columnReference = + COLUMN_REFERENCE + .newBuilder() + .setReferencingColumn("column1") + .setReferencedColumn("column2") + .build(); + assertEquals(COLUMN_REFERENCE, columnReference); + } + + @Test + public void testToAndFromPb() { + ColumnReference columnReference = COLUMN_REFERENCE.toBuilder().build(); + assertTrue(ColumnReference.fromPb(columnReference.toPb()) instanceof ColumnReference); + compareColumnReferenceDefinition( + columnReference, ColumnReference.fromPb(columnReference.toPb())); + } + + private void compareColumnReferenceDefinition(ColumnReference expected, ColumnReference value) { + assertEquals(expected.getReferencingColumn(), value.getReferencingColumn()); + assertEquals(expected.getReferencedColumn(), value.getReferencedColumn()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java new file mode 100644 index 0000000000..5cb2b418f2 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java @@ -0,0 +1,95 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Collections; +import org.junit.Test; + +public class ForeignKeyTest { + private static final TableId TABLE_ID = TableId.of("project", "dataset", "table"); + + private static final ColumnReference COLUMN_REFERENCE = + ColumnReference.newBuilder() + .setReferencingColumn("column1") + .setReferencedColumn("column2") + .build(); + private static final ForeignKey FOREIGN_KEY = + ForeignKey.newBuilder() + .setName("foreign_key") + .setReferencedTable(TABLE_ID) + .setColumnReferences(Collections.singletonList(COLUMN_REFERENCE)) + .build(); + + @Test + public void testToBuilder() { + compareForeignKeyDefinition(FOREIGN_KEY, FOREIGN_KEY.toBuilder().build()); + TableId referencedTable = TableId.of("project1", "dataset1", "table1"); + ArrayList columnReferences = new ArrayList<>(); + columnReferences.add( + ColumnReference.newBuilder() + .setReferencingColumn("from") + .setReferencedColumn("to") + .build()); + columnReferences.add( + ColumnReference.newBuilder() + .setReferencingColumn("from2") + .setReferencedColumn("to2") + .build()); + ForeignKey foreignKey = + FOREIGN_KEY + .toBuilder() + .setName("test") + .setReferencedTable(referencedTable) + .setColumnReferences(columnReferences) + .build(); + assertEquals("test", foreignKey.getName()); + assertEquals(referencedTable, foreignKey.getReferencedTable()); + assertEquals(columnReferences, foreignKey.getColumnReferences()); + } + + @Test + public void testBuilder() { + assertEquals("foreign_key", FOREIGN_KEY.getName()); + assertEquals(TABLE_ID, FOREIGN_KEY.getReferencedTable()); + assertEquals(Collections.singletonList(COLUMN_REFERENCE), FOREIGN_KEY.getColumnReferences()); + ForeignKey foreignKey = + FOREIGN_KEY + .newBuilder() + .setName("foreign_key") + .setReferencedTable(TABLE_ID) + .setColumnReferences(Collections.singletonList(COLUMN_REFERENCE)) + .build(); + assertEquals(FOREIGN_KEY, foreignKey); + } + + @Test + public void testToAndFromPb() { + ForeignKey foreignKey = FOREIGN_KEY.toBuilder().build(); + assertTrue(ForeignKey.fromPb(foreignKey.toPb()) instanceof ForeignKey); + compareForeignKeyDefinition(foreignKey, ForeignKey.fromPb(foreignKey.toPb())); + } + + private void compareForeignKeyDefinition(ForeignKey expected, ForeignKey value) { + assertEquals(expected.getName(), value.getName()); + assertEquals(expected.getReferencedTable(), value.getReferencedTable()); + assertEquals(expected.getColumnReferences(), value.getColumnReferences()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java new file mode 100644 index 0000000000..2de87a0258 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java @@ -0,0 +1,55 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import org.junit.Test; + +public class PrimaryKeyTest { + private static final List COLUMNS = Arrays.asList("column1", "column2"); + private static final PrimaryKey PRIMARY_KEY = PrimaryKey.newBuilder().setColumns(COLUMNS).build(); + + @Test + public void testToBuilder() { + comparePrimaryKeyDefinition(PRIMARY_KEY, PRIMARY_KEY.toBuilder().build()); + PrimaryKey primaryKey = + PRIMARY_KEY.toBuilder().setColumns(Arrays.asList("col1", "col2", "col3")).build(); + assertEquals(Arrays.asList("col1", "col2", "col3"), primaryKey.getColumns()); + } + + @Test + public void testBuilder() { + assertEquals(COLUMNS, PRIMARY_KEY.getColumns()); + PrimaryKey primaryKey = PRIMARY_KEY.newBuilder().setColumns(COLUMNS).build(); + assertEquals(PRIMARY_KEY, primaryKey); + } + + @Test + public void testToAndFromPb() { + PrimaryKey primaryKey = PRIMARY_KEY.toBuilder().build(); + assertTrue(PrimaryKey.fromPb(primaryKey.toPb()) instanceof PrimaryKey); + comparePrimaryKeyDefinition(primaryKey, PrimaryKey.fromPb(primaryKey.toPb())); + } + + private void comparePrimaryKeyDefinition(PrimaryKey expected, PrimaryKey value) { + assertEquals(expected.getColumns(), value.getColumns()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java new file mode 100644 index 0000000000..05f3bbf41c --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java @@ -0,0 +1,119 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.Test; + +public class TableConstraintsTest { + private static final List COLUMNS_PK = Arrays.asList("column1", "column2"); + private static final PrimaryKey PRIMARY_KEY = + PrimaryKey.newBuilder().setColumns(COLUMNS_PK).build(); + private static final TableId TABLE_ID_PK = TableId.of("project", "dataset", "table"); + + private static final ColumnReference COLUMN_REFERENCE = + ColumnReference.newBuilder() + .setReferencingColumn("column1") + .setReferencedColumn("column2") + .build(); + private static final ForeignKey FOREIGN_KEY = + ForeignKey.newBuilder() + .setName("foreign_key") + .setReferencedTable(TABLE_ID_PK) + .setColumnReferences(Collections.singletonList(COLUMN_REFERENCE)) + .build(); + + private static final TableConstraints TABLE_CONSTRAINTS = + TableConstraints.newBuilder() + .setPrimaryKey(PRIMARY_KEY) + .setForeignKeys(Collections.singletonList(FOREIGN_KEY)) + .build(); + + @Test + public void testToBuilder() { + compareTableConstraintsDefinition(TABLE_CONSTRAINTS, TABLE_CONSTRAINTS.toBuilder().build()); + List columnsPk = Arrays.asList("col1", "col2", "col3"); + PrimaryKey primaryKey = PrimaryKey.newBuilder().setColumns(columnsPk).build(); + TableId referencedTable = TableId.of("project1", "dataset1", "table1"); + TableId referencedTable2 = TableId.of("project2", "dataset2", "table2"); + ArrayList columnReferences = new ArrayList<>(); + columnReferences.add( + ColumnReference.newBuilder() + .setReferencingColumn("from") + .setReferencedColumn("to") + .build()); + columnReferences.add( + ColumnReference.newBuilder() + .setReferencingColumn("from2") + .setReferencedColumn("to2") + .build()); + ForeignKey foreignKey1 = + ForeignKey.newBuilder() + .setName("test") + .setReferencedTable(referencedTable) + .setColumnReferences(columnReferences) + .build(); + ForeignKey foreignKey2 = + ForeignKey.newBuilder() + .setName("test") + .setReferencedTable(referencedTable2) + .setColumnReferences(columnReferences) + .build(); + + TableConstraints tableConstraints = + TABLE_CONSTRAINTS + .toBuilder() + .setForeignKeys(Arrays.asList(foreignKey1, foreignKey2)) + .setPrimaryKey(primaryKey) + .build(); + assertEquals(Arrays.asList(foreignKey1, foreignKey2), tableConstraints.getForeignKeys()); + assertEquals(primaryKey, tableConstraints.getPrimaryKey()); + } + + @Test + public void testBuilder() { + assertEquals(Collections.singletonList(FOREIGN_KEY), TABLE_CONSTRAINTS.getForeignKeys()); + assertEquals(PRIMARY_KEY, TABLE_CONSTRAINTS.getPrimaryKey()); + TableConstraints tableConstraints = + TABLE_CONSTRAINTS + .newBuilder() + .setForeignKeys(Collections.singletonList(FOREIGN_KEY)) + .setPrimaryKey(PRIMARY_KEY) + .build(); + assertEquals(TABLE_CONSTRAINTS, tableConstraints); + } + + @Test + public void testToAndFromPb() { + TableConstraints tableConstraints = TABLE_CONSTRAINTS.toBuilder().build(); + assertTrue(TableConstraints.fromPb(tableConstraints.toPb()) instanceof TableConstraints); + compareTableConstraintsDefinition( + tableConstraints, TableConstraints.fromPb(tableConstraints.toPb())); + } + + private void compareTableConstraintsDefinition( + TableConstraints expected, TableConstraints value) { + assertEquals(expected.getForeignKeys(), value.getForeignKeys()); + assertEquals(expected.getPrimaryKey(), value.getPrimaryKey()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c9edbf585a..1bb395e27a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -57,6 +57,7 @@ import com.google.cloud.bigquery.BigQuerySQLException; import com.google.cloud.bigquery.CloneDefinition; import com.google.cloud.bigquery.Clustering; +import com.google.cloud.bigquery.ColumnReference; import com.google.cloud.bigquery.Connection; import com.google.cloud.bigquery.ConnectionProperty; import com.google.cloud.bigquery.ConnectionSettings; @@ -74,6 +75,7 @@ import com.google.cloud.bigquery.FieldValue; import com.google.cloud.bigquery.FieldValue.Attribute; import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.ForeignKey; import com.google.cloud.bigquery.FormatOptions; import com.google.cloud.bigquery.HivePartitioningOptions; import com.google.cloud.bigquery.InsertAllRequest; @@ -97,6 +99,7 @@ import com.google.cloud.bigquery.Parameter; import com.google.cloud.bigquery.ParquetOptions; import com.google.cloud.bigquery.PolicyTags; +import com.google.cloud.bigquery.PrimaryKey; import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.QueryParameterValue; import com.google.cloud.bigquery.RangePartitioning; @@ -112,6 +115,7 @@ import com.google.cloud.bigquery.StandardSQLTypeName; import com.google.cloud.bigquery.StandardTableDefinition; import com.google.cloud.bigquery.Table; +import com.google.cloud.bigquery.TableConstraints; import com.google.cloud.bigquery.TableDataWriteChannel; import com.google.cloud.bigquery.TableDefinition; import com.google.cloud.bigquery.TableId; @@ -157,6 +161,7 @@ import java.time.LocalTime; import java.time.Period; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -744,6 +749,16 @@ public class ITBigQueryTest { .build(); private static final Schema SESSION_TABLE_SCHEMA = Schema.of(ID_SCHEMA, FIRST_NAME_SCHEMA, LAST_NAME_SCHEMA, EMAIL_SCHEMA, PROFESSION_SCHEMA); + + private static final Schema CONSTRAINTS_TABLE_SCHEMA = + Schema.of( + Field.newBuilder("ID", LegacySQLTypeName.STRING).setMode(Mode.REQUIRED).build(), + Field.newBuilder("FirstName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("LastName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); private static final Path csvPath = FileSystems.getDefault().getPath("src/test/resources", "sessionTest.csv").toAbsolutePath(); @@ -5711,4 +5726,206 @@ public void testHivePartitioningOptionsFieldsFieldExistence() throws Interrupted assertTrue(table.delete()); assertTrue(storage.delete(blobInfo.getBlobId())); } + + @Test + public void testPrimaryKey() { + String tableName = "test_primary_key"; + TableId tableId = TableId.of(DATASET, tableName); + PrimaryKey primaryKey = PrimaryKey.newBuilder().setColumns(Arrays.asList("ID")).build(); + TableConstraints tableConstraintsPk = + TableConstraints.newBuilder().setPrimaryKey(primaryKey).build(); + + try { + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(CONSTRAINTS_TABLE_SCHEMA) + .setTableConstraints(tableConstraintsPk) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertEquals( + tableConstraintsPk, + remoteTable.getDefinition().getTableConstraints()); + } finally { + bigquery.delete(tableId); + } + } + + @Test + public void testPrimaryKeyUpdate() { + String tableName = "test_primary_key_update"; + TableId tableId = TableId.of(DATASET, tableName); + PrimaryKey primaryKey = + PrimaryKey.newBuilder().setColumns(Arrays.asList("FirstName", "LastName")).build(); + TableConstraints tableConstraintsPk = + TableConstraints.newBuilder().setPrimaryKey(primaryKey).build(); + + try { + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(CONSTRAINTS_TABLE_SCHEMA).build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNull(remoteTable.getDefinition().getTableConstraints()); + + Table updatedTable = + remoteTable.toBuilder().setTableConstraints(tableConstraintsPk).build().update(); + assertNotNull(updatedTable); + Table remoteUpdatedTable = bigquery.getTable(DATASET, tableName); + assertEquals( + tableConstraintsPk, + remoteUpdatedTable.getDefinition().getTableConstraints()); + } finally { + bigquery.delete(tableId); + } + } + + @Test + public void testForeignKeys() { + String tableNamePk = "test_foreign_key"; + String tableNameFk = "test_foreign_key2"; + // TableIds referenced by foreign keys need project id to be specified + TableId tableIdPk = TableId.of(PROJECT_ID, DATASET, tableNamePk); + TableId tableIdFk = TableId.of(DATASET, tableNameFk); + ColumnReference columnReference = + ColumnReference.newBuilder().setReferencingColumn("ID").setReferencedColumn("ID").build(); + + PrimaryKey primaryKey = + PrimaryKey.newBuilder().setColumns(Collections.singletonList("ID")).build(); + TableConstraints tableConstraintsPk = + TableConstraints.newBuilder().setPrimaryKey(primaryKey).build(); + + ForeignKey foreignKey = + ForeignKey.newBuilder() + .setName("foreign_key") + .setReferencedTable(tableIdPk) + .setColumnReferences(Collections.singletonList(columnReference)) + .build(); + TableConstraints tableConstraintsFk = + TableConstraints.newBuilder().setForeignKeys(Collections.singletonList(foreignKey)).build(); + + try { + StandardTableDefinition tableDefinitionPk = + StandardTableDefinition.newBuilder() + .setSchema(CONSTRAINTS_TABLE_SCHEMA) + .setTableConstraints(tableConstraintsPk) + .build(); + Table createdTablePk = bigquery.create(TableInfo.of(tableIdPk, tableDefinitionPk)); + assertNotNull(createdTablePk); + + StandardTableDefinition tableDefinitionFk = + StandardTableDefinition.newBuilder() + .setSchema(CONSTRAINTS_TABLE_SCHEMA) + .setTableConstraints(tableConstraintsFk) + .build(); + Table createdTableFk = bigquery.create(TableInfo.of(tableIdFk, tableDefinitionFk)); + assertNotNull(createdTableFk); + Table remoteTable = bigquery.getTable(DATASET, tableNameFk); + assertEquals( + tableConstraintsFk, + remoteTable.getDefinition().getTableConstraints()); + } finally { + bigquery.delete(tableIdPk); + bigquery.delete(tableIdFk); + } + } + + @Test + public void testForeignKeysUpdate() { + String tableNameFk = "test_foreign_key"; + String tableNamePk1 = "test_foreign_key2"; + String tableNamePk2 = "test_foreign_key3"; + TableId tableIdFk = TableId.of(DATASET, tableNameFk); + // TableIds referenced by foreign keys need project id to be specified + TableId tableIdPk1 = TableId.of(PROJECT_ID, DATASET, tableNamePk1); + TableId tableIdPk2 = TableId.of(PROJECT_ID, DATASET, tableNamePk2); + + ArrayList foreignKeys = new ArrayList<>(); + + // set up ID in tableFk as a foreign key to tablePk1 + ColumnReference columnReferencePk1 = + ColumnReference.newBuilder().setReferencingColumn("ID").setReferencedColumn("ID").build(); + PrimaryKey primaryKey1 = + PrimaryKey.newBuilder().setColumns(Collections.singletonList("ID")).build(); + TableConstraints tableConstraintsPk1 = + TableConstraints.newBuilder().setPrimaryKey(primaryKey1).build(); + + ForeignKey foreignKey1 = + ForeignKey.newBuilder() + .setName("foreign_key1") + .setReferencedTable(tableIdPk1) + .setColumnReferences(Collections.singletonList(columnReferencePk1)) + .build(); + foreignKeys.add(foreignKey1); + + // set up First and last names in tableFk as foreign keys to TablePk2 + ArrayList columnReferencesPk2 = new ArrayList<>(); + columnReferencesPk2.add( + ColumnReference.newBuilder() + .setReferencingColumn("FirstName") + .setReferencedColumn("FirstName") + .build()); + columnReferencesPk2.add( + ColumnReference.newBuilder() + .setReferencingColumn("LastName") + .setReferencedColumn("LastName") + .build()); + + ArrayList primaryKey2Columns = new ArrayList<>(); + primaryKey2Columns.add("FirstName"); + primaryKey2Columns.add("LastName"); + + PrimaryKey primaryKey2 = PrimaryKey.newBuilder().setColumns(primaryKey2Columns).build(); + TableConstraints tableConstraintsPk2 = + TableConstraints.newBuilder().setPrimaryKey(primaryKey2).build(); + ForeignKey foreignKey2 = + ForeignKey.newBuilder() + .setName("foreign_key2") + .setReferencedTable(tableIdPk2) + .setColumnReferences(columnReferencesPk2) + .build(); + foreignKeys.add(foreignKey2); + TableConstraints tableConstraintsFk = + TableConstraints.newBuilder().setForeignKeys(foreignKeys).build(); + + try { + StandardTableDefinition tableDefinitionFk = + StandardTableDefinition.newBuilder().setSchema(CONSTRAINTS_TABLE_SCHEMA).build(); + Table createdTableFk = bigquery.create(TableInfo.of(tableIdFk, tableDefinitionFk)); + assertNotNull(createdTableFk); + + StandardTableDefinition tableDefinitionPk1 = + StandardTableDefinition.newBuilder() + .setSchema(CONSTRAINTS_TABLE_SCHEMA) + .setTableConstraints(tableConstraintsPk1) + .build(); + Table createdTablePk1 = bigquery.create(TableInfo.of(tableIdPk1, tableDefinitionPk1)); + assertNotNull(createdTablePk1); + + StandardTableDefinition tableDefinitionPk2 = + StandardTableDefinition.newBuilder() + .setSchema(CONSTRAINTS_TABLE_SCHEMA) + .setTableConstraints(tableConstraintsPk2) + .build(); + Table createdTablePk2 = bigquery.create(TableInfo.of(tableIdPk2, tableDefinitionPk2)); + assertNotNull(createdTablePk2); + + Table remoteTable = bigquery.getTable(DATASET, tableNameFk); + assertNull(remoteTable.getDefinition().getTableConstraints()); + + Table updatedTable = + remoteTable.toBuilder().setTableConstraints(tableConstraintsFk).build().update(); + + assertNotNull(updatedTable); + Table remoteUpdatedTable = bigquery.getTable(DATASET, tableNameFk); + assertEquals( + tableConstraintsFk, + remoteUpdatedTable.getDefinition().getTableConstraints()); + } finally { + bigquery.delete(tableIdFk); + bigquery.delete(tableIdPk1); + bigquery.delete(tableIdPk2); + } + } } diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java b/samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java new file mode 100644 index 0000000000..36e32bc216 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeys.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_create_tables_with_primary_and_foreign_keys] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.ColumnReference; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.ForeignKey; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.PrimaryKey; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.TableConstraints; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import java.util.Arrays; +import java.util.Collections; + +// Create tables with primary/foreign key columns +public class CreateTablesWithPrimaryAndForeignKeys { + + private static final Schema PK_FK_SCHEMA = + Schema.of( + Field.newBuilder("ID", LegacySQLTypeName.STRING).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("FirstName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("LastName", LegacySQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + + public static void main(String[] args) { + // TODO(developer): Replace these variables before running the sample. + String datasetName = "MY_DATASET_NAME"; + String tableNamePk = "PK_TABLE"; + String tableNameFk = "FK_TABLE"; + createTablesWithPrimaryAndForeignKeys(datasetName, tableNamePk, tableNameFk); + } + + public static void createTablesWithPrimaryAndForeignKeys( + String datasetName, String tableNamePk, String tableNameFk) { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + // TableIds referenced by foreign keys need project id to be set + TableId tableIdPk = + TableId.of(bigquery.getOptions().getProjectId(), datasetName, tableNamePk); + TableId tableIdFk = TableId.of(datasetName, tableNameFk); + + PrimaryKey primaryKey = + PrimaryKey.newBuilder().setColumns(Collections.singletonList("ID")).build(); + TableConstraints tableConstraintsPk = + TableConstraints.newBuilder().setPrimaryKey(primaryKey).build(); + + ColumnReference columnReference = + ColumnReference.newBuilder().setReferencingColumn("ID").setReferencedColumn("ID").build(); + ForeignKey foreignKey = + ForeignKey.newBuilder() + .setName("foreign_key") + .setColumnReferences(Collections.singletonList(columnReference)) + .setReferencedTable(tableIdPk) + .build(); + TableConstraints tableConstraintsFk = + TableConstraints.newBuilder().setForeignKeys(Arrays.asList(foreignKey)).build(); + + // Create a table with a primary key + StandardTableDefinition tableDefinitionPk = + StandardTableDefinition.newBuilder() + .setSchema(PK_FK_SCHEMA) + .setTableConstraints(tableConstraintsPk) + .build(); + TableInfo tableInfoPk = TableInfo.of(tableIdPk, tableDefinitionPk); + bigquery.create(tableInfoPk); + + // Create a table with a foreign key + StandardTableDefinition tableDefinitionFk = + StandardTableDefinition.newBuilder() + .setSchema(PK_FK_SCHEMA) + .setTableConstraints(tableConstraintsFk) + .build(); + TableInfo tableInfoFk = TableInfo.of(tableIdFk, tableDefinitionFk); + bigquery.create(tableInfoFk); + + System.out.println("Tables with primary and foreign keys created successfully."); + } catch (BigQueryException e) { + System.out.println("Tables not created \n" + e.toString()); + } + } +} +// [END bigquery_create_tables_with_primary_and_foreign_keys] diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeysIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeysIT.java new file mode 100644 index 0000000000..00ba8fa441 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateTablesWithPrimaryAndForeignKeysIT.java @@ -0,0 +1,82 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CreateTablesWithPrimaryAndForeignKeysIT { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String tableNamePk; + private String tableNameFk; + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); + + private static void requireEnvVar(String varName) { + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("BIGQUERY_DATASET_NAME"); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + tableNamePk = "MY_TABLE_NAME_" + UUID.randomUUID().toString().replace("-", "_"); + tableNameFk = "MY_TABLE_NAME_" + UUID.randomUUID().toString().replace("-", "_"); + } + + @After + public void tearDown() { + // Clean up + DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableNamePk); + DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableNameFk); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testCreateAndQueryRepeatedRecordField() { + CreateTablesWithPrimaryAndForeignKeys.createTablesWithPrimaryAndForeignKeys( + BIGQUERY_DATASET_NAME, tableNamePk, tableNameFk); + assertThat(bout.toString()) + .contains("Tables with primary and foreign keys created successfully."); + } +} From 92077437d759705151f7778207616ecf024371ba Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Mon, 19 Jun 2023 10:56:18 -0400 Subject: [PATCH 1293/2268] feat: Partial Projection of Table Metadata (#2756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes # ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). --- .../com/google/cloud/bigquery/BigQuery.java | 19 +++ .../java/com/google/cloud/bigquery/Table.java | 4 +- .../cloud/bigquery/spi/v2/BigQueryRpc.java | 5 +- .../bigquery/spi/v2/HttpBigQueryRpc.java | 8 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 128 ++++++++++++++++++ 5 files changed, 160 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 8f11d03fa0..2712783576 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -121,6 +121,20 @@ public String getSelector() { } } + /** + * Metadata of a BigQuery Table. + * + * @see Table + * Resource + */ + enum TableMetadataView { + BASIC, + FULL, + STORAGE_STATS, + TABLE_METADATA_VIEW_UNSPECIFIED; + } + /** * Fields of a BigQuery Model resource. * @@ -384,6 +398,11 @@ public static TableOption fields(TableField... fields) { public static TableOption autodetectSchema(boolean autodetect) { return new TableOption(BigQueryRpc.Option.AUTODETECT_SCHEMA, autodetect); } + + /** Returns an option to specify the metadata of the table. */ + public static TableOption tableMetadataView(TableMetadataView tableMetadataView) { + return new TableOption(BigQueryRpc.Option.TABLE_METADATA_VIEW, tableMetadataView); + } } /* Class for specifying IAM options. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index cf1dfb4f7f..3a58005acc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -49,10 +49,10 @@ public static class Builder extends TableInfo.Builder { private final BigQuery bigquery; private final TableInfo.BuilderImpl infoBuilder; - Builder(BigQuery bigquery, TableId tableId, TableDefinition defintion) { + Builder(BigQuery bigquery, TableId tableId, TableDefinition definition) { this.bigquery = bigquery; this.infoBuilder = new TableInfo.BuilderImpl(); - this.infoBuilder.setTableId(tableId).setDefinition(defintion); + this.infoBuilder.setTableId(tableId).setDefinition(definition); } Builder(Table table) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 33480a91b3..3416409190 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -40,7 +40,7 @@ @InternalExtensionOnly public interface BigQueryRpc extends ServiceRpc { - // These options are part of the Google Cloud BigQuery query parameters + // These options are part of the Google Cloud BigQuery query parameters. enum Option { FIELDS("fields"), DELETE_CONTENTS("deleteContents"), @@ -56,7 +56,8 @@ enum Option { START_INDEX("startIndex"), STATE_FILTER("stateFilter"), TIMEOUT("timeoutMs"), - REQUESTED_POLICY_VERSION("requestedPolicyVersion"); + REQUESTED_POLICY_VERSION("requestedPolicyVersion"), + TABLE_METADATA_VIEW("view"); private final String value; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index a63e3cc2ba..96a10deb33 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -294,6 +294,7 @@ public Table getTable( .get(projectId, datasetId, tableId) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)) + .setView(getTableMetadataOption(options)) .execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); @@ -304,6 +305,13 @@ public Table getTable( } } + private String getTableMetadataOption(Map options) { + if (options.containsKey(Option.TABLE_METADATA_VIEW)) { + return options.get(Option.TABLE_METADATA_VIEW).toString(); + } + return "STORAGE_STATS"; + } + @Override public Tuple> listTables( String projectId, String datasetId, Map options) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 1bb395e27a..9d68e8710f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -49,6 +49,7 @@ import com.google.cloud.bigquery.BigQuery.JobListOption; import com.google.cloud.bigquery.BigQuery.JobOption; import com.google.cloud.bigquery.BigQuery.TableField; +import com.google.cloud.bigquery.BigQuery.TableMetadataView; import com.google.cloud.bigquery.BigQuery.TableOption; import com.google.cloud.bigquery.BigQueryDryRunResult; import com.google.cloud.bigquery.BigQueryError; @@ -1549,6 +1550,133 @@ public void testCreateAndGetTable() { assertTrue(remoteTable.delete()); } + @Test + public void testCreateAndGetTableWithBasicTableMetadataView() { + String tableName = "test_create_and_get_table_with_basic_metadata_view"; + TableId tableId = TableId.of(DATASET, tableName); + TimePartitioning partitioning = TimePartitioning.of(Type.DAY); + Clustering clustering = + Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build(); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(partitioning) + .setClustering(clustering) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + TableOption tableOption = BigQuery.TableOption.tableMetadataView(TableMetadataView.BASIC); + Table remoteTable = bigquery.getTable(DATASET, tableName, tableOption); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof StandardTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals(TableDefinition.Type.TABLE, remoteTable.getDefinition().getType()); + assertEquals(TABLE_SCHEMA, remoteTable.getDefinition().getSchema()); + // Next four values are considered transient fields that should not be calculated + assertNull(remoteTable.getLastModifiedTime()); + assertNull(remoteTable.getDefinition().getNumBytes()); + assertNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNull(remoteTable.getDefinition().getNumRows()); + assertTrue(remoteTable.delete()); + } + + @Test + public void testCreateAndGetTableWithFullTableMetadataView() { + String tableName = "test_create_and_get_table_with_full_metadata_view"; + TableId tableId = TableId.of(DATASET, tableName); + TimePartitioning partitioning = TimePartitioning.of(Type.DAY); + Clustering clustering = + Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build(); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(partitioning) + .setClustering(clustering) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + TableOption tableOption = BigQuery.TableOption.tableMetadataView(TableMetadataView.FULL); + Table remoteTable = bigquery.getTable(DATASET, tableName, tableOption); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof StandardTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals(TableDefinition.Type.TABLE, remoteTable.getDefinition().getType()); + assertEquals(TABLE_SCHEMA, remoteTable.getDefinition().getSchema()); + assertNotNull(remoteTable.getLastModifiedTime()); + assertNotNull(remoteTable.getDefinition().getNumBytes()); + assertNotNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNotNull(remoteTable.getDefinition().getNumRows()); + assertTrue(remoteTable.delete()); + } + + @Test + public void testCreateAndGetTableWithStorageStatsTableMetadataView() { + String tableName = "test_create_and_get_table_with_storage_stats_metadata_view"; + TableId tableId = TableId.of(DATASET, tableName); + TimePartitioning partitioning = TimePartitioning.of(Type.DAY); + Clustering clustering = + Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build(); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(partitioning) + .setClustering(clustering) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + TableOption tableOption = + BigQuery.TableOption.tableMetadataView(TableMetadataView.STORAGE_STATS); + Table remoteTable = bigquery.getTable(DATASET, tableName, tableOption); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof StandardTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals(TableDefinition.Type.TABLE, remoteTable.getDefinition().getType()); + assertEquals(TABLE_SCHEMA, remoteTable.getDefinition().getSchema()); + assertNotNull(remoteTable.getLastModifiedTime()); + assertNotNull(remoteTable.getDefinition().getNumBytes()); + assertNotNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNotNull(remoteTable.getDefinition().getNumRows()); + assertTrue(remoteTable.delete()); + } + + @Test + public void testCreateAndGetTableWithUnspecifiedTableMetadataView() { + String tableName = "test_create_and_get_table_with_unspecified_metadata_view"; + TableId tableId = TableId.of(DATASET, tableName); + TimePartitioning partitioning = TimePartitioning.of(Type.DAY); + Clustering clustering = + Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build(); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(partitioning) + .setClustering(clustering) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + TableOption tableOption = + BigQuery.TableOption.tableMetadataView(TableMetadataView.TABLE_METADATA_VIEW_UNSPECIFIED); + Table remoteTable = bigquery.getTable(DATASET, tableName, tableOption); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof StandardTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals(TableDefinition.Type.TABLE, remoteTable.getDefinition().getType()); + assertEquals(TABLE_SCHEMA, remoteTable.getDefinition().getSchema()); + assertNotNull(remoteTable.getLastModifiedTime()); + assertNotNull(remoteTable.getDefinition().getNumBytes()); + assertNotNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNotNull(remoteTable.getDefinition().getNumRows()); + assertTrue(remoteTable.delete()); + } + @Test public void testCreateAndGetTableWithSelectedField() { String tableName = "test_create_and_get_selected_fields_table"; From f629127b5949396420130f99d6a2538e5f7b4ab0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 17:42:12 +0000 Subject: [PATCH 1294/2268] chore(main): release 2.28.0 (#2757) :robot: I have created a release *beep* *boop* --- ## [2.28.0](https://togithub.com/googleapis/java-bigquery/compare/v2.27.1...v2.28.0) (2023-06-19) ### Features * Add primary key and foreign keys ([#2744](https://togithub.com/googleapis/java-bigquery/issues/2744)) ([afb571c](https://togithub.com/googleapis/java-bigquery/commit/afb571c97edb13f93df9ac140af4516205d27a49)) * Partial Projection of Table Metadata ([#2756](https://togithub.com/googleapis/java-bigquery/issues/2756)) ([9207743](https://togithub.com/googleapis/java-bigquery/commit/92077437d759705151f7778207616ecf024371ba)) * Return JobID with TableResult ([#2689](https://togithub.com/googleapis/java-bigquery/issues/2689)) ([aa38428](https://togithub.com/googleapis/java-bigquery/commit/aa38428ad26b64d2566b33f4b2ca3dcc102c3247)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 9 +++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80bac768be..3cb9164d60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.28.0](https://github.com/googleapis/java-bigquery/compare/v2.27.1...v2.28.0) (2023-06-19) + + +### Features + +* Add primary key and foreign keys ([#2744](https://github.com/googleapis/java-bigquery/issues/2744)) ([afb571c](https://github.com/googleapis/java-bigquery/commit/afb571c97edb13f93df9ac140af4516205d27a49)) +* Partial Projection of Table Metadata ([#2756](https://github.com/googleapis/java-bigquery/issues/2756)) ([9207743](https://github.com/googleapis/java-bigquery/commit/92077437d759705151f7778207616ecf024371ba)) +* Return JobID with TableResult ([#2689](https://github.com/googleapis/java-bigquery/issues/2689)) ([aa38428](https://github.com/googleapis/java-bigquery/commit/aa38428ad26b64d2566b33f4b2ca3dcc102c3247)) + ## [2.27.1](https://github.com/googleapis/java-bigquery/compare/v2.27.0...v2.27.1) (2023-06-13) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 36158d2258..4931d9fccc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.27.2-SNAPSHOT + 2.28.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2a6c2dfd4f..c97f64bba2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.27.2-SNAPSHOT + 2.28.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.27.2-SNAPSHOT + 2.28.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8fa726a483..d9eb8f9782 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.27.2-SNAPSHOT + 2.28.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.27.2-SNAPSHOT + 2.28.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b226b12b21..e995689f5c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.27.2-SNAPSHOT + 2.28.0 diff --git a/versions.txt b/versions.txt index e2ff381f41..92533f2bfe 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.27.1:2.27.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.28.0:2.28.0 \ No newline at end of file From 50bef38068dc9c93919b4f0b1941e0fd3b4defb5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 15:26:15 +0000 Subject: [PATCH 1295/2268] chore(main): release 2.28.1-SNAPSHOT (#2763) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4931d9fccc..06b7222a59 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.28.0 + 2.28.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c97f64bba2..8ec75d746f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.28.0 + 2.28.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.28.0 + 2.28.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d9eb8f9782..b46b5ac6d4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.28.0 + 2.28.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.28.0 + 2.28.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e995689f5c..46fb5e1fa9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.28.0 + 2.28.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 92533f2bfe..b6e28e235b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.28.0:2.28.0 \ No newline at end of file +google-cloud-bigquery:2.28.0:2.28.1-SNAPSHOT \ No newline at end of file From f606d0b28ca8f65654413a99ab698f35e3befce1 Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Wed, 21 Jun 2023 11:19:44 -0700 Subject: [PATCH 1296/2268] feat: Increase default Read API timeout to 60s (#2764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Increase default Read API timeout to 60s * 🦉 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 --- README.md | 6 +++--- .../java/com/google/cloud/bigquery/BigQueryOptions.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 63bd09cfee..a023ae3cd6 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.27.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.28.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.27.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.28.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.27.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.28.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 5687d78989..2e22ba9224 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -30,6 +30,7 @@ public class BigQueryOptions extends ServiceOptions { private static final String API_SHORT_NAME = "BigQuery"; + private static final int DEFAULT_READ_API_TIME_OUT = 60000; private static final String BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery"; private static final Set SCOPES = ImmutableSet.of(BIGQUERY_SCOPE); private static final long serialVersionUID = -2437598817433266049L; @@ -113,7 +114,7 @@ public TransportOptions getDefaultTransportOptions() { } public static HttpTransportOptions getDefaultHttpTransportOptions() { - return HttpTransportOptions.newBuilder().build(); + return HttpTransportOptions.newBuilder().setReadTimeout(DEFAULT_READ_API_TIME_OUT).build(); } @Override From 7537e0f31d8f4696559ef09c7bd284bf78217280 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:34:15 +0200 Subject: [PATCH 1297/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.12.0 (#2771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/sdk-platform-java) | `3.11.0` -> `3.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.12.0/compatibility-slim/3.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.12.0/confidence-slim/3.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b46b5ac6d4..e0235ad4b0 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230520-2.0.0 - 3.11.0 + 3.12.0 12.0.0 From 792fb27e8354de9e0049411ecd56ca2889e5f815 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:34:20 +0200 Subject: [PATCH 1298/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.23.0 (#2769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.22.4` -> `2.23.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.23.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.23.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.23.0/compatibility-slim/2.22.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-storage/2.23.0/confidence-slim/2.22.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-storage ### [`v2.23.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#​2230-httpsgithubcomgoogleapisjava-storagecomparev2224v2230-2023-06-21) [Compare Source](https://togithub.com/googleapis/java-storage/compare/v2.22.4...v2.23.0) ##### Features - Add new dedup utility method to Option classes ([#​2063](https://togithub.com/googleapis/java-storage/issues/2063)) ([2ad196c](https://togithub.com/googleapis/java-storage/commit/2ad196c063e67c7efdac344792b67de3479d789d)) ##### Dependencies - Update dependencies io.grpc:\* to v1.56.0 ([#​2072](https://togithub.com/googleapis/java-storage/issues/2072)) ([e10bde2](https://togithub.com/googleapis/java-storage/commit/e10bde26416bcf17401516e43949e12246f4831c)) - Update dependency com.google.apis:google-api-services-storage to v1-rev20230617-2.0.0 ([#​2077](https://togithub.com/googleapis/java-storage/issues/2077)) ([9f618cd](https://togithub.com/googleapis/java-storage/commit/9f618cddbeb471f7bd0f2332c70e501afbaccc36)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 ([#​2074](https://togithub.com/googleapis/java-storage/issues/2074)) ([427f330](https://togithub.com/googleapis/java-storage/commit/427f330793a20b0c3da4cbe5e85984a0df508c79))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e0235ad4b0..cfe1662b2d 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.22.4 + 2.23.0 test From dc5b58fa2ec3ff71dfb36e8d6f3000b13707cc2f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 18:34:25 +0000 Subject: [PATCH 1299/2268] chore: Update `dependabot.yml` template (#1813) (#2758) * chore: Update `dependabot.yml` template not to touch pip dependencies Source-Link: https://togithub.com/googleapis/synthtool/commit/f961eb0fe51109238128055897ccba1b70dbd804 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:af2eda87a54601ae7b7b2be5055c17b43ac98a7805b586772db314de8a7d4a1d --- .github/.OwlBot.lock.yaml | 3 ++- .github/dependabot.yml | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index aadf54f643..73568a1e99 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:ad9cabee4c022f1aab04a71332369e0c23841062124818a4490f73337f790337 + digest: sha256:af2eda87a54601ae7b7b2be5055c17b43ac98a7805b586772db314de8a7d4a1d +# created: 2023-06-16T02:10:09.149325782Z diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c8f413b0da..fde1ced49f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,10 +5,13 @@ updates: schedule: interval: "daily" # Disable version updates for Maven dependencies - open-pull-requests-limit: 0 + # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. + ignore: "*" - package-ecosystem: "pip" directory: "/" schedule: interval: "daily" # Disable version updates for pip dependencies - open-pull-requests-limit: 0 \ No newline at end of file + # If a security vulnerability comes in, we will be notified about + # it via template in the synthtool repository. + ignore: "*" From 27ba48a0cab331f2d233ba96fed710c11d31dc53 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:36:17 +0200 Subject: [PATCH 1300/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.23 (#2759) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:junit-platform-native](https://togithub.com/graalvm/native-build-tools) | `0.9.22` -> `0.9.23` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.23/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.23/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.23/compatibility-slim/0.9.22)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.23/confidence-slim/0.9.22)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.23`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.23) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.22...0.9.23) #### What's Changed - Fix "collect reachability metadata" with config cache by [@​melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/438](https://togithub.com/graalvm/native-build-tools/pull/438) - Remove use of GFileUtils by [@​melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/437](https://togithub.com/graalvm/native-build-tools/pull/437) - Display the GraalVM logo on the generated NBT docs by [@​gradinac](https://togithub.com/gradinac) in [https://togithub.com/graalvm/native-build-tools/pull/447](https://togithub.com/graalvm/native-build-tools/pull/447) **Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.22...0.9.23
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 2a02c3c613..d6fd2e7aeb 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.22 + 0.9.23 test From d8e2ad1b4fe0f9fd0addde5cc104249b5784181f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:36:22 +0200 Subject: [PATCH 1301/2268] test(deps): update dependency com.google.truth:truth to v1.1.5 (#2762) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.truth:truth](https://togithub.com/google/truth) | `1.1.4` -> `1.1.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.5/compatibility-slim/1.1.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.5/confidence-slim/1.1.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    google/truth ### [`v1.1.5`](https://togithub.com/google/truth/releases/tag/v1.1.5): 1.1.5 - Updated Truth to depend on [Guava 32.0.1](https://togithub.com/google/guava/releases/tag/v32.0.1). The previous Guava version, 32.0.0, contained a bug under Windows, which did not affect Truth's functionality but [could cause problems](https://togithub.com/google/truth/issues/1137) for people who use Guava's I/O functionality in their codebase. Affected users can already manually update their Guava dependency to 32.0.1, but if they don't depend directly on Guava, they may find it easier to upgrade to this new Truth release instead. - Fixed `IterableOfProtosSubject` to produce a proper failure message instead of NPE when the actual value is `null`.
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index cfe1662b2d..d25dcc2dab 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f608c7f393..80cd7172b1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index d6fd2e7aeb..2030dea291 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 46fb5e1fa9..2aafff8272 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 974421e08e..14fae2f6c3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test From 967386d45d1b026b937bdbecd3d5dbff7a03c9bd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:38:16 +0200 Subject: [PATCH 1302/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.0 (#2761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-shade-plugin](https://maven.apache.org/plugins/) | `3.4.1` -> `3.5.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-shade-plugin/3.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-shade-plugin/3.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-shade-plugin/3.5.0/compatibility-slim/3.4.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-shade-plugin/3.5.0/confidence-slim/3.4.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 06b7222a59..c44818176e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.5.0 package From 8cddf8fd286f51cd75aba0da6a52cbc12cab7e2a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Jun 2023 20:40:17 +0200 Subject: [PATCH 1303/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 (#2760) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.graalvm.buildtools:native-maven-plugin](https://togithub.com/graalvm/native-build-tools) | `0.9.22` -> `0.9.23` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.23/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.23/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.23/compatibility-slim/0.9.22)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:native-maven-plugin/0.9.23/confidence-slim/0.9.22)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    graalvm/native-build-tools ### [`v0.9.23`](https://togithub.com/graalvm/native-build-tools/releases/tag/0.9.23) [Compare Source](https://togithub.com/graalvm/native-build-tools/compare/0.9.22...0.9.23) #### What's Changed - Fix "collect reachability metadata" with config cache by [@​melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/438](https://togithub.com/graalvm/native-build-tools/pull/438) - Remove use of GFileUtils by [@​melix](https://togithub.com/melix) in [https://togithub.com/graalvm/native-build-tools/pull/437](https://togithub.com/graalvm/native-build-tools/pull/437) - Display the GraalVM logo on the generated NBT docs by [@​gradinac](https://togithub.com/gradinac) in [https://togithub.com/graalvm/native-build-tools/pull/447](https://togithub.com/graalvm/native-build-tools/pull/447) **Full Changelog**: https://togithub.com/graalvm/native-build-tools/compare/0.9.22...0.9.23
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 2030dea291..c23c4bd42b 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.22 + 0.9.23 true com.example.bigquery.NativeImageBigquerySample From 8c6b9e5a51602fa9b9dfea75c9920f900611921b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:46:14 +0000 Subject: [PATCH 1304/2268] chore: Java 8 unit test to build code in Java 17 and run tests on Java 8 (#1800) (#2770) * Our Java projects are configured to produce Java 8-compatible bytecode via https://togithub.com/googleapis/java-shared-config/blob/main/pom.xml#L848. This unit test change ensures this config is applied correctly. * This change also switches the JDK distribution of GitHub Actions to temurin from zulu. * For the repositories that mark "dependencies (8)" and "dependencies (11)" as required, they should point to only "dependencies (17)" via `.github/sync-repo-settings.yaml` and repo's Settings tab. Source-Link: https://togithub.com/googleapis/synthtool/commit/cbe010084fc59dc15730c86e9b8e03ddac1de050 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 Closes https://togithub.com/googleapis/java-bigquery/pull/2768 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/dependabot.yml | 6 ++++-- .github/sync-repo-settings.yaml | 3 +-- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++-- .kokoro/build.sh | 3 ++- google-cloud-bigquery/pom.xml | 7 +++++++ 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 73568a1e99..47a70ea40c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:af2eda87a54601ae7b7b2be5055c17b43ac98a7805b586772db314de8a7d4a1d -# created: 2023-06-16T02:10:09.149325782Z + digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 +# created: 2023-06-22T15:06:52.039318836Z diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fde1ced49f..203f9eaccf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,8 @@ updates: interval: "daily" # Disable version updates for Maven dependencies # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. - ignore: "*" + ignore: + - dependency-name: "*" - package-ecosystem: "pip" directory: "/" schedule: @@ -14,4 +15,5 @@ updates: # Disable version updates for pip dependencies # If a security vulnerability comes in, we will be notified about # it via template in the synthtool repository. - ignore: "*" + ignore: + - dependency-name: "*" diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 223b72e8a6..a37ac497e1 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -8,8 +8,7 @@ branchProtectionRules: requiresCodeOwnerReviews: true requiresStrictStatusChecks: false requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) + - dependencies (17) - lint - clirr - units (8) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3bb26e377..65436cde41 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [11, 17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -36,6 +36,28 @@ jobs: - run: .kokoro/build.sh env: JOB_TYPE: test + units-java8: + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: zulu + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: zulu + - run: .kokoro/build.sh + env: + JOB_TYPE: test windows: runs-on: windows-latest steps: @@ -54,7 +76,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 0c26eec01a..1b59f5bc3f 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,7 +47,8 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} RETURN_CODE=$? ;; lint) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8ec75d746f..cd67ff7c86 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -215,6 +215,13 @@ java17 [17,) + + + !jvm + From 35f7924fb12c6a5d32f90b704921108a50c48037 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Jun 2023 15:56:09 +0200 Subject: [PATCH 1305/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.39.1 (#2772) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d25dcc2dab..c25c88143f 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.38.0 + 2.39.1 pom import From 08061f14ccfd05b28800c482179804604cd42088 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 11:12:28 -0400 Subject: [PATCH 1306/2268] chore(main): release 2.29.0 (#2767) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb9164d60..7ac6658099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.29.0](https://github.com/googleapis/java-bigquery/compare/v2.28.0...v2.29.0) (2023-06-23) + + +### Features + +* Increase default Read API timeout to 60s ([#2764](https://github.com/googleapis/java-bigquery/issues/2764)) ([f606d0b](https://github.com/googleapis/java-bigquery/commit/f606d0b28ca8f65654413a99ab698f35e3befce1)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.12.0 ([#2771](https://github.com/googleapis/java-bigquery/issues/2771)) ([7537e0f](https://github.com/googleapis/java-bigquery/commit/7537e0f31d8f4696559ef09c7bd284bf78217280)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.23 ([#2759](https://github.com/googleapis/java-bigquery/issues/2759)) ([27ba48a](https://github.com/googleapis/java-bigquery/commit/27ba48a0cab331f2d233ba96fed710c11d31dc53)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 ([#2760](https://github.com/googleapis/java-bigquery/issues/2760)) ([8cddf8f](https://github.com/googleapis/java-bigquery/commit/8cddf8fd286f51cd75aba0da6a52cbc12cab7e2a)) + ## [2.28.0](https://github.com/googleapis/java-bigquery/compare/v2.27.1...v2.28.0) (2023-06-19) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c44818176e..aa215e50c8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.28.1-SNAPSHOT + 2.29.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cd67ff7c86..05d6111103 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.28.1-SNAPSHOT + 2.29.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.28.1-SNAPSHOT + 2.29.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c25c88143f..3350f0f129 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.28.1-SNAPSHOT + 2.29.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.28.1-SNAPSHOT + 2.29.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2aafff8272..8157326fa2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.28.1-SNAPSHOT + 2.29.0 diff --git a/versions.txt b/versions.txt index b6e28e235b..4a877f47de 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.28.0:2.28.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.29.0:2.29.0 \ No newline at end of file From e3003f48df9cca2bd549d893ffef3bb198a3b2aa Mon Sep 17 00:00:00 2001 From: Sumeet Gajjar Date: Fri, 23 Jun 2023 10:24:13 -0700 Subject: [PATCH 1307/2268] feat: Add missing storage related fields to Table, TableInfo and StandardTableDefinition (#2673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Fixes #2672 ☕️ --- .../clirr-ignored-differences.xml | 35 ++++ .../bigquery/StandardTableDefinition.java | 98 +++++++++++ .../java/com/google/cloud/bigquery/Table.java | 42 +++++ .../com/google/cloud/bigquery/TableInfo.java | 161 ++++++++++++++++++ .../bigquery/StandardTableDefinitionTest.java | 35 ++++ .../google/cloud/bigquery/TableInfoTest.java | 35 ++++ .../cloud/bigquery/it/ITBigQueryTest.java | 20 +++ 7 files changed, 426 insertions(+) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 784a3c9626..500ce3f58d 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -54,6 +54,41 @@ com/google/cloud/bigquery/StandardTableDefinition* *TableConstraints(*) + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumActiveLogicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumActivePhysicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumLongTermLogicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumLongTermPhysicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumTimeTravelPhysicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumTotalLogicalBytes(*) + + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *NumTotalPhysicalBytes(*) + 7013 com/google/cloud/bigquery/TableInfo* diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java index 8242147df3..f4459d734a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java @@ -132,6 +132,20 @@ public abstract static class Builder public abstract Builder setNumLongTermBytes(Long numLongTermBytes); + public abstract Builder setNumTimeTravelPhysicalBytes(Long numTimeTravelPhysicalBytes); + + public abstract Builder setNumTotalLogicalBytes(Long numTotalLogicalBytes); + + public abstract Builder setNumActiveLogicalBytes(Long numActiveLogicalBytes); + + public abstract Builder setNumLongTermLogicalBytes(Long numLongTermLogicalBytes); + + public abstract Builder setNumTotalPhysicalBytes(Long numTotalPhysicalBytes); + + public abstract Builder setNumActivePhysicalBytes(Long numActivePhysicalBytes); + + public abstract Builder setNumLongTermPhysicalBytes(Long numLongTermPhysicalBytes); + public abstract Builder setNumRows(Long numRows); public abstract Builder setLocation(String location); @@ -180,6 +194,62 @@ public abstract static class Builder @Nullable public abstract Long getNumLongTermBytes(); + /** + * Returns the number of time travel physical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumTimeTravelPhysicalBytes(); + + /** + * Returns the number of total logical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumTotalLogicalBytes(); + + /** + * Returns the number of active logical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumActiveLogicalBytes(); + + /** + * Returns the number of long term logical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumLongTermLogicalBytes(); + + /** + * Returns the number of total physical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumTotalPhysicalBytes(); + + /** + * Returns the number of active physical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumActivePhysicalBytes(); + + /** + * Returns the number of long term physical bytes. + * + * @see Storage Pricing + */ + @Nullable + public abstract Long getNumLongTermPhysicalBytes(); + /** Returns the number of rows in this table, excluding any data in the streaming buffer. */ @Nullable public abstract Long getNumRows(); @@ -255,6 +325,13 @@ Table toPb() { } tablePb.setNumBytes(getNumBytes()); tablePb.setNumLongTermBytes(getNumLongTermBytes()); + tablePb.setNumTimeTravelPhysicalBytes(getNumTimeTravelPhysicalBytes()); + tablePb.setNumTotalLogicalBytes(getNumTotalLogicalBytes()); + tablePb.setNumActiveLogicalBytes(getNumActiveLogicalBytes()); + tablePb.setNumLongTermLogicalBytes(getNumLongTermLogicalBytes()); + tablePb.setNumTotalPhysicalBytes(getNumTotalPhysicalBytes()); + tablePb.setNumActivePhysicalBytes(getNumActivePhysicalBytes()); + tablePb.setNumLongTermPhysicalBytes(getNumLongTermPhysicalBytes()); tablePb.setLocation(getLocation()); if (getStreamingBuffer() != null) { tablePb.setStreamingBuffer(getStreamingBuffer().toPb()); @@ -308,6 +385,27 @@ static StandardTableDefinition fromPb(Table tablePb) { if (tablePb.getNumLongTermBytes() != null) { builder.setNumLongTermBytes(tablePb.getNumLongTermBytes()); } + if (tablePb.getNumTimeTravelPhysicalBytes() != null) { + builder.setNumTimeTravelPhysicalBytes(tablePb.getNumTimeTravelPhysicalBytes()); + } + if (tablePb.getNumTotalLogicalBytes() != null) { + builder.setNumTotalLogicalBytes(tablePb.getNumTotalLogicalBytes()); + } + if (tablePb.getNumActiveLogicalBytes() != null) { + builder.setNumActiveLogicalBytes(tablePb.getNumActiveLogicalBytes()); + } + if (tablePb.getNumLongTermLogicalBytes() != null) { + builder.setNumLongTermLogicalBytes(tablePb.getNumLongTermLogicalBytes()); + } + if (tablePb.getNumTotalPhysicalBytes() != null) { + builder.setNumTotalPhysicalBytes(tablePb.getNumTotalPhysicalBytes()); + } + if (tablePb.getNumActivePhysicalBytes() != null) { + builder.setNumActivePhysicalBytes(tablePb.getNumActivePhysicalBytes()); + } + if (tablePb.getNumLongTermPhysicalBytes() != null) { + builder.setNumLongTermPhysicalBytes(tablePb.getNumLongTermPhysicalBytes()); + } if (tablePb.getTableConstraints() != null) { builder.setTableConstraints(TableConstraints.fromPb(tablePb.getTableConstraints())); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index 3a58005acc..fdf0bad668 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -114,6 +114,48 @@ Builder setNumLongTermBytes(Long numLongTermBytes) { return this; } + @Override + Builder setNumTimeTravelPhysicalBytes(Long numTimeTravelPhysicalBytes) { + infoBuilder.setNumTimeTravelPhysicalBytes(numTimeTravelPhysicalBytes); + return this; + } + + @Override + Builder setNumTotalLogicalBytes(Long numTotalLogicalBytes) { + infoBuilder.setNumTotalLogicalBytes(numTotalLogicalBytes); + return this; + } + + @Override + Builder setNumActiveLogicalBytes(Long numActiveLogicalBytes) { + infoBuilder.setNumActiveLogicalBytes(numActiveLogicalBytes); + return this; + } + + @Override + Builder setNumLongTermLogicalBytes(Long numLongTermLogicalBytes) { + infoBuilder.setNumLongTermLogicalBytes(numLongTermLogicalBytes); + return this; + } + + @Override + Builder setNumTotalPhysicalBytes(Long numTotalPhysicalBytes) { + infoBuilder.setNumTotalPhysicalBytes(numTotalPhysicalBytes); + return this; + } + + @Override + Builder setNumActivePhysicalBytes(Long numActivePhysicalBytes) { + infoBuilder.setNumActivePhysicalBytes(numActivePhysicalBytes); + return this; + } + + @Override + Builder setNumLongTermPhysicalBytes(Long numLongTermPhysicalBytes) { + infoBuilder.setNumLongTermPhysicalBytes(numLongTermPhysicalBytes); + return this; + } + @Override Builder setNumRows(BigInteger numRows) { infoBuilder.setNumRows(numRows); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index abfe21ec46..c00ba84410 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -67,6 +67,13 @@ public Table apply(TableInfo tableInfo) { private final Long lastModifiedTime; private final Long numBytes; private final Long numLongTermBytes; + private final Long numTimeTravelPhysicalBytes; + private final Long numTotalLogicalBytes; + private final Long numActiveLogicalBytes; + private final Long numLongTermLogicalBytes; + private final Long numTotalPhysicalBytes; + private final Long numActivePhysicalBytes; + private final Long numLongTermPhysicalBytes; private final BigInteger numRows; private final TableDefinition definition; private final EncryptionConfiguration encryptionConfiguration; @@ -104,6 +111,20 @@ public abstract static class Builder { abstract Builder setNumLongTermBytes(Long numLongTermBytes); + abstract Builder setNumTimeTravelPhysicalBytes(Long numTimeTravelPhysicalBytes); + + abstract Builder setNumTotalLogicalBytes(Long numTotalLogicalBytes); + + abstract Builder setNumActiveLogicalBytes(Long numActiveLogicalBytes); + + abstract Builder setNumLongTermLogicalBytes(Long numLongTermLogicalBytes); + + abstract Builder setNumTotalPhysicalBytes(Long numTotalPhysicalBytes); + + abstract Builder setNumActivePhysicalBytes(Long numActivePhysicalBytes); + + abstract Builder setNumLongTermPhysicalBytes(Long numLongTermPhysicalBytes); + abstract Builder setNumRows(BigInteger numRows); abstract Builder setSelfLink(String selfLink); @@ -160,6 +181,13 @@ static class BuilderImpl extends Builder { private Long lastModifiedTime; private Long numBytes; private Long numLongTermBytes; + private Long numTimeTravelPhysicalBytes; + private Long numTotalLogicalBytes; + private Long numActiveLogicalBytes; + private Long numLongTermLogicalBytes; + private Long numTotalPhysicalBytes; + private Long numActivePhysicalBytes; + private Long numLongTermPhysicalBytes; private BigInteger numRows; private TableDefinition definition; private EncryptionConfiguration encryptionConfiguration; @@ -183,6 +211,13 @@ static class BuilderImpl extends Builder { this.lastModifiedTime = tableInfo.lastModifiedTime; this.numBytes = tableInfo.numBytes; this.numLongTermBytes = tableInfo.numLongTermBytes; + this.numTimeTravelPhysicalBytes = tableInfo.numTimeTravelPhysicalBytes; + this.numTotalLogicalBytes = tableInfo.numTotalLogicalBytes; + this.numActiveLogicalBytes = tableInfo.numActiveLogicalBytes; + this.numLongTermLogicalBytes = tableInfo.numLongTermLogicalBytes; + this.numTotalPhysicalBytes = tableInfo.numTotalPhysicalBytes; + this.numActivePhysicalBytes = tableInfo.numActivePhysicalBytes; + this.numLongTermPhysicalBytes = tableInfo.numLongTermPhysicalBytes; this.numRows = tableInfo.numRows; this.definition = tableInfo.definition; this.encryptionConfiguration = tableInfo.encryptionConfiguration; @@ -207,6 +242,13 @@ static class BuilderImpl extends Builder { this.selfLink = tablePb.getSelfLink(); this.numBytes = tablePb.getNumBytes(); this.numLongTermBytes = tablePb.getNumLongTermBytes(); + this.numTimeTravelPhysicalBytes = tablePb.getNumTimeTravelPhysicalBytes(); + this.numTotalLogicalBytes = tablePb.getNumTotalLogicalBytes(); + this.numActiveLogicalBytes = tablePb.getNumActiveLogicalBytes(); + this.numLongTermLogicalBytes = tablePb.getNumLongTermLogicalBytes(); + this.numTotalPhysicalBytes = tablePb.getNumTotalPhysicalBytes(); + this.numActivePhysicalBytes = tablePb.getNumActivePhysicalBytes(); + this.numLongTermPhysicalBytes = tablePb.getNumLongTermPhysicalBytes(); this.numRows = tablePb.getNumRows(); this.definition = TableDefinition.fromPb(tablePb); if (tablePb.getEncryptionConfiguration() != null) { @@ -278,6 +320,48 @@ Builder setNumLongTermBytes(Long numLongTermBytes) { return this; } + @Override + Builder setNumTimeTravelPhysicalBytes(Long numTimeTravelPhysicalBytes) { + this.numTimeTravelPhysicalBytes = numTimeTravelPhysicalBytes; + return this; + } + + @Override + Builder setNumTotalLogicalBytes(Long numTotalLogicalBytes) { + this.numTotalLogicalBytes = numTotalLogicalBytes; + return this; + } + + @Override + Builder setNumActiveLogicalBytes(Long numActiveLogicalBytes) { + this.numActiveLogicalBytes = numActiveLogicalBytes; + return this; + } + + @Override + Builder setNumLongTermLogicalBytes(Long numLongTermLogicalBytes) { + this.numLongTermLogicalBytes = numLongTermLogicalBytes; + return this; + } + + @Override + Builder setNumTotalPhysicalBytes(Long numTotalPhysicalBytes) { + this.numTotalPhysicalBytes = numTotalPhysicalBytes; + return this; + } + + @Override + Builder setNumActivePhysicalBytes(Long numActivePhysicalBytes) { + this.numActivePhysicalBytes = numActivePhysicalBytes; + return this; + } + + @Override + Builder setNumLongTermPhysicalBytes(Long numLongTermPhysicalBytes) { + this.numLongTermPhysicalBytes = numLongTermPhysicalBytes; + return this; + } + @Override Builder setNumRows(BigInteger numRows) { this.numRows = numRows; @@ -354,6 +438,13 @@ public TableInfo build() { this.lastModifiedTime = builder.lastModifiedTime; this.numBytes = builder.numBytes; this.numLongTermBytes = builder.numLongTermBytes; + this.numTimeTravelPhysicalBytes = builder.numTimeTravelPhysicalBytes; + this.numTotalLogicalBytes = builder.numTotalLogicalBytes; + this.numActiveLogicalBytes = builder.numActiveLogicalBytes; + this.numLongTermLogicalBytes = builder.numLongTermLogicalBytes; + this.numTotalPhysicalBytes = builder.numTotalPhysicalBytes; + this.numActivePhysicalBytes = builder.numActivePhysicalBytes; + this.numLongTermPhysicalBytes = builder.numLongTermPhysicalBytes; this.numRows = builder.numRows; this.definition = builder.definition; this.encryptionConfiguration = builder.encryptionConfiguration; @@ -440,6 +531,69 @@ public Long getNumLongTermBytes() { return numLongTermBytes; } + /** + * Returns the number of time travel physical bytes. + * + * @see Storage Pricing + */ + public Long getNumTimeTravelPhysicalBytes() { + return this.numTimeTravelPhysicalBytes; + } + + /** + * Returns the number of total logical bytes. + * + * @see Storage Pricing + */ + public Long getNumTotalLogicalBytes() { + return this.numTotalLogicalBytes; + } + + /** + * Returns the number of active logical bytes. + * + * @see Storage Pricing + */ + public Long getNumActiveLogicalBytes() { + return this.numActiveLogicalBytes; + } + + /** + * Returns the number of long term logical bytes. + * + * @see Storage Pricing + */ + public Long getNumLongTermLogicalBytes() { + return this.numLongTermLogicalBytes; + } + + /** + * Returns the number of total physical bytes. + * + * @see Storage Pricing + */ + public Long getNumTotalPhysicalBytes() { + return this.numTotalPhysicalBytes; + } + + /** + * Returns the number of active physical bytes. + * + * @see Storage Pricing + */ + public Long getNumActivePhysicalBytes() { + return this.numActivePhysicalBytes; + } + + /** + * Returns the number of long term physical bytes. + * + * @see Storage Pricing + */ + public Long getNumLongTermPhysicalBytes() { + return this.numLongTermPhysicalBytes; + } + /** Returns the number of rows of data in this table */ public BigInteger getNumRows() { return numRows; @@ -495,6 +649,13 @@ public String toString() { .add("lastModifiedTime", lastModifiedTime) .add("numBytes", numBytes) .add("numLongTermBytes", numLongTermBytes) + .add("numTimeTravelPhysicalBytes", numTimeTravelPhysicalBytes) + .add("numTotalLogicalBytes", numTotalLogicalBytes) + .add("numActiveLogicalBytes", numActiveLogicalBytes) + .add("numLongTermLogicalBytes", numLongTermLogicalBytes) + .add("numTotalPhysicalBytes", numTotalPhysicalBytes) + .add("numActivePhysicalBytes", numActivePhysicalBytes) + .add("numLongTermPhysicalBytes", numLongTermPhysicalBytes) .add("numRows", numRows) .add("definition", definition) .add("encryptionConfiguration", encryptionConfiguration) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java index 393b7fbc65..df0e5d79b0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java @@ -51,6 +51,13 @@ public class StandardTableDefinitionTest { private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA1, FIELD_SCHEMA2, FIELD_SCHEMA3); private static final Long NUM_BYTES = 42L; private static final Long NUM_LONG_TERM_BYTES = 18L; + private static final Long NUM_TIME_TRAVEL_PHYSICAL_BYTES = 21L; + private static final Long NUM_TOTAL_LOGICAL_BYTES = 22L; + private static final Long NUM_ACTIVE_LOGICAL_BYTES = 23L; + private static final Long NUM_LONG_TERM_LOGICAL_BYTES = 24L; + private static final Long NUM_TOTAL_PHYSICAL_BYTES = 25L; + private static final Long NUM_ACTIVE_PHYSICAL_BYTES = 26L; + private static final Long NUM_LONG_TERM_PHYSICAL_BYTES = 27L; private static final Long NUM_ROWS = 43L; private static final String LOCATION = "US"; private static final StreamingBuffer STREAMING_BUFFER = new StreamingBuffer(1L, 2L, 3L); @@ -64,6 +71,13 @@ public class StandardTableDefinitionTest { .setNumBytes(NUM_BYTES) .setNumRows(NUM_ROWS) .setNumLongTermBytes(NUM_LONG_TERM_BYTES) + .setNumTimeTravelPhysicalBytes(NUM_TIME_TRAVEL_PHYSICAL_BYTES) + .setNumTotalLogicalBytes(NUM_TOTAL_LOGICAL_BYTES) + .setNumActiveLogicalBytes(NUM_ACTIVE_LOGICAL_BYTES) + .setNumLongTermLogicalBytes(NUM_LONG_TERM_LOGICAL_BYTES) + .setNumTotalPhysicalBytes(NUM_TOTAL_PHYSICAL_BYTES) + .setNumActivePhysicalBytes(NUM_ACTIVE_PHYSICAL_BYTES) + .setNumLongTermPhysicalBytes(NUM_LONG_TERM_PHYSICAL_BYTES) .setStreamingBuffer(STREAMING_BUFFER) .setSchema(TABLE_SCHEMA) .setTimePartitioning(TIME_PARTITIONING) @@ -93,6 +107,13 @@ public void testBuilder() { assertEquals(LOCATION, TABLE_DEFINITION.getLocation()); assertEquals(NUM_BYTES, TABLE_DEFINITION.getNumBytes()); assertEquals(NUM_LONG_TERM_BYTES, TABLE_DEFINITION.getNumLongTermBytes()); + assertEquals(NUM_TIME_TRAVEL_PHYSICAL_BYTES, TABLE_DEFINITION.getNumTimeTravelPhysicalBytes()); + assertEquals(NUM_TOTAL_LOGICAL_BYTES, TABLE_DEFINITION.getNumTotalLogicalBytes()); + assertEquals(NUM_ACTIVE_LOGICAL_BYTES, TABLE_DEFINITION.getNumActiveLogicalBytes()); + assertEquals(NUM_LONG_TERM_LOGICAL_BYTES, TABLE_DEFINITION.getNumLongTermLogicalBytes()); + assertEquals(NUM_TOTAL_PHYSICAL_BYTES, TABLE_DEFINITION.getNumTotalPhysicalBytes()); + assertEquals(NUM_ACTIVE_PHYSICAL_BYTES, TABLE_DEFINITION.getNumActivePhysicalBytes()); + assertEquals(NUM_LONG_TERM_PHYSICAL_BYTES, TABLE_DEFINITION.getNumLongTermPhysicalBytes()); assertEquals(NUM_ROWS, TABLE_DEFINITION.getNumRows()); assertEquals(STREAMING_BUFFER, TABLE_DEFINITION.getStreamingBuffer()); assertEquals(TIME_PARTITIONING, TABLE_DEFINITION.getTimePartitioning()); @@ -118,6 +139,13 @@ public void testOf() { assertNull(definition.getLocation()); assertNull(definition.getNumBytes()); assertNull(definition.getNumLongTermBytes()); + assertNull(definition.getNumTimeTravelPhysicalBytes()); + assertNull(definition.getNumTotalLogicalBytes()); + assertNull(definition.getNumActiveLogicalBytes()); + assertNull(definition.getNumLongTermLogicalBytes()); + assertNull(definition.getNumTotalPhysicalBytes()); + assertNull(definition.getNumActivePhysicalBytes()); + assertNull(definition.getNumLongTermPhysicalBytes()); assertNull(definition.getNumRows()); assertNull(definition.getStreamingBuffer()); assertNull(definition.getTimePartitioning()); @@ -176,6 +204,13 @@ private void compareStandardTableDefinition( assertEquals(expected.getType(), value.getType()); assertEquals(expected.getNumBytes(), value.getNumBytes()); assertEquals(expected.getNumLongTermBytes(), value.getNumLongTermBytes()); + assertEquals(expected.getNumTimeTravelPhysicalBytes(), value.getNumTimeTravelPhysicalBytes()); + assertEquals(expected.getNumTotalLogicalBytes(), value.getNumTotalLogicalBytes()); + assertEquals(expected.getNumActiveLogicalBytes(), value.getNumActiveLogicalBytes()); + assertEquals(expected.getNumLongTermLogicalBytes(), value.getNumLongTermLogicalBytes()); + assertEquals(expected.getNumTotalPhysicalBytes(), value.getNumTotalPhysicalBytes()); + assertEquals(expected.getNumActivePhysicalBytes(), value.getNumActivePhysicalBytes()); + assertEquals(expected.getNumLongTermPhysicalBytes(), value.getNumLongTermPhysicalBytes()); assertEquals(expected.getNumRows(), value.getNumRows()); assertEquals(expected.getLocation(), value.getLocation()); assertEquals(expected.getStreamingBuffer(), value.getStreamingBuffer()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java index a44f700391..6283f71c21 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java @@ -58,6 +58,13 @@ public class TableInfoTest { private static final Schema TABLE_SCHEMA = Schema.of(FIELD_SCHEMA1, FIELD_SCHEMA2, FIELD_SCHEMA3); private static final Long NUM_BYTES = 42L; private static final Long NUM_LONG_TERM_BYTES = 21L; + private static final Long NUM_TIME_TRAVEL_PHYSICAL_BYTES = 21L; + private static final Long NUM_TOTAL_LOGICAL_BYTES = 22L; + private static final Long NUM_ACTIVE_LOGICAL_BYTES = 23L; + private static final Long NUM_LONG_TERM_LOGICAL_BYTES = 24L; + private static final Long NUM_TOTAL_PHYSICAL_BYTES = 25L; + private static final Long NUM_ACTIVE_PHYSICAL_BYTES = 26L; + private static final Long NUM_LONG_TERM_PHYSICAL_BYTES = 27L; private static final Long NUM_ROWS = 43L; private static final String LOCATION = "US"; private static final StandardTableDefinition.StreamingBuffer STREAMING_BUFFER = @@ -67,6 +74,13 @@ public class TableInfoTest { .setLocation(LOCATION) .setNumBytes(NUM_BYTES) .setNumLongTermBytes(NUM_LONG_TERM_BYTES) + .setNumTimeTravelPhysicalBytes(NUM_TIME_TRAVEL_PHYSICAL_BYTES) + .setNumTotalLogicalBytes(NUM_TOTAL_LOGICAL_BYTES) + .setNumActiveLogicalBytes(NUM_ACTIVE_LOGICAL_BYTES) + .setNumLongTermLogicalBytes(NUM_LONG_TERM_LOGICAL_BYTES) + .setNumTotalPhysicalBytes(NUM_TOTAL_PHYSICAL_BYTES) + .setNumActivePhysicalBytes(NUM_ACTIVE_PHYSICAL_BYTES) + .setNumLongTermPhysicalBytes(NUM_LONG_TERM_PHYSICAL_BYTES) .setNumRows(NUM_ROWS) .setStreamingBuffer(STREAMING_BUFFER) .setSchema(TABLE_SCHEMA) @@ -102,6 +116,13 @@ public class TableInfoTest { .setLastModifiedTime(LAST_MODIFIED_TIME) .setNumBytes(NUM_BYTES) .setNumLongTermBytes(NUM_LONG_TERM_BYTES) + .setNumTimeTravelPhysicalBytes(NUM_TIME_TRAVEL_PHYSICAL_BYTES) + .setNumTotalLogicalBytes(NUM_TOTAL_LOGICAL_BYTES) + .setNumActiveLogicalBytes(NUM_ACTIVE_LOGICAL_BYTES) + .setNumLongTermLogicalBytes(NUM_LONG_TERM_LOGICAL_BYTES) + .setNumTotalPhysicalBytes(NUM_TOTAL_PHYSICAL_BYTES) + .setNumActivePhysicalBytes(NUM_ACTIVE_PHYSICAL_BYTES) + .setNumLongTermPhysicalBytes(NUM_LONG_TERM_PHYSICAL_BYTES) .setNumRows(BigInteger.valueOf(NUM_ROWS)) .setSelfLink(SELF_LINK) .setLabels(Collections.singletonMap("a", "b")) @@ -166,6 +187,13 @@ public void testBuilder() { assertEquals(SELF_LINK, TABLE_INFO.getSelfLink()); assertEquals(NUM_BYTES, TABLE_INFO.getNumBytes()); assertEquals(NUM_LONG_TERM_BYTES, TABLE_INFO.getNumLongTermBytes()); + assertEquals(NUM_TIME_TRAVEL_PHYSICAL_BYTES, TABLE_INFO.getNumTimeTravelPhysicalBytes()); + assertEquals(NUM_TOTAL_LOGICAL_BYTES, TABLE_INFO.getNumTotalLogicalBytes()); + assertEquals(NUM_ACTIVE_LOGICAL_BYTES, TABLE_INFO.getNumActiveLogicalBytes()); + assertEquals(NUM_LONG_TERM_LOGICAL_BYTES, TABLE_INFO.getNumLongTermLogicalBytes()); + assertEquals(NUM_TOTAL_PHYSICAL_BYTES, TABLE_INFO.getNumTotalPhysicalBytes()); + assertEquals(NUM_ACTIVE_PHYSICAL_BYTES, TABLE_INFO.getNumActivePhysicalBytes()); + assertEquals(NUM_LONG_TERM_PHYSICAL_BYTES, TABLE_INFO.getNumLongTermPhysicalBytes()); assertEquals(BigInteger.valueOf(NUM_ROWS), TABLE_INFO.getNumRows()); assertEquals(REQUIRE_PARTITION_FILTER, TABLE_INFO.getRequirePartitionFilter()); @@ -271,6 +299,13 @@ private void compareTableInfo(TableInfo expected, TableInfo value) { assertEquals(expected.getLastModifiedTime(), value.getLastModifiedTime()); assertEquals(expected.getNumBytes(), value.getNumBytes()); assertEquals(expected.getNumLongTermBytes(), value.getNumLongTermBytes()); + assertEquals(expected.getNumTimeTravelPhysicalBytes(), value.getNumTimeTravelPhysicalBytes()); + assertEquals(expected.getNumTotalLogicalBytes(), value.getNumTotalLogicalBytes()); + assertEquals(expected.getNumActiveLogicalBytes(), value.getNumActiveLogicalBytes()); + assertEquals(expected.getNumLongTermLogicalBytes(), value.getNumLongTermLogicalBytes()); + assertEquals(expected.getNumTotalPhysicalBytes(), value.getNumTotalPhysicalBytes()); + assertEquals(expected.getNumActivePhysicalBytes(), value.getNumActivePhysicalBytes()); + assertEquals(expected.getNumLongTermPhysicalBytes(), value.getNumLongTermPhysicalBytes()); assertEquals(expected.getNumRows(), value.getNumRows()); assertEquals(expected.getSelfLink(), value.getSelfLink()); assertEquals(expected.getLabels(), value.getLabels()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9d68e8710f..b80fb02dfb 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1543,6 +1543,10 @@ public void testCreateAndGetTable() { assertNotNull(remoteTable.getLastModifiedTime()); assertNotNull(remoteTable.getDefinition().getNumBytes()); assertNotNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNotNull(remoteTable.getDefinition().getNumTotalLogicalBytes()); + assertNotNull(remoteTable.getDefinition().getNumActiveLogicalBytes()); + assertNotNull( + remoteTable.getDefinition().getNumLongTermLogicalBytes()); assertNotNull(remoteTable.getDefinition().getNumRows()); assertEquals( partitioning, remoteTable.getDefinition().getTimePartitioning()); @@ -1703,6 +1707,14 @@ public void testCreateAndGetTableWithSelectedField() { assertNull(remoteTable.getLastModifiedTime()); assertNull(remoteTable.getDefinition().getNumBytes()); assertNull(remoteTable.getDefinition().getNumLongTermBytes()); + assertNull( + remoteTable.getDefinition().getNumTimeTravelPhysicalBytes()); + assertNull(remoteTable.getDefinition().getNumTotalLogicalBytes()); + assertNull(remoteTable.getDefinition().getNumActiveLogicalBytes()); + assertNull(remoteTable.getDefinition().getNumLongTermLogicalBytes()); + assertNull(remoteTable.getDefinition().getNumTotalPhysicalBytes()); + assertNull(remoteTable.getDefinition().getNumActivePhysicalBytes()); + assertNull(remoteTable.getDefinition().getNumLongTermPhysicalBytes()); assertNull(remoteTable.getDefinition().getNumRows()); assertNull(remoteTable.getDefinition().getTimePartitioning()); assertNull(remoteTable.getDefinition().getClustering()); @@ -2131,6 +2143,14 @@ public void testUpdateTableWithSelectedFields() { assertNull(updatedTable.getLastModifiedTime()); assertNull(updatedTable.getDefinition().getNumBytes()); assertNull(updatedTable.getDefinition().getNumLongTermBytes()); + assertNull( + updatedTable.getDefinition().getNumTimeTravelPhysicalBytes()); + assertNull(updatedTable.getDefinition().getNumTotalLogicalBytes()); + assertNull(updatedTable.getDefinition().getNumActiveLogicalBytes()); + assertNull(updatedTable.getDefinition().getNumLongTermLogicalBytes()); + assertNull(updatedTable.getDefinition().getNumTotalPhysicalBytes()); + assertNull(updatedTable.getDefinition().getNumActivePhysicalBytes()); + assertNull(updatedTable.getDefinition().getNumLongTermPhysicalBytes()); assertNull(updatedTable.getDefinition().getNumRows()); assertTrue(createdTable.delete()); } From e2098180c8af7427fd626a0d6543ade2d45ce801 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 18:16:12 +0000 Subject: [PATCH 1308/2268] chore(main): release 2.29.1-SNAPSHOT (#2773) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- README.md | 6 +++--- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a023ae3cd6..1f076bdda6 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.28.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.29.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.28.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.29.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.28.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.29.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmark/pom.xml b/benchmark/pom.xml index aa215e50c8..b4368fe912 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.29.0 + 2.29.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 05d6111103..049721806d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.29.0 + 2.29.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.29.0 + 2.29.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3350f0f129..14af71e076 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.29.0 + 2.29.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.29.0 + 2.29.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8157326fa2..246fe9a065 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.29.0 + 2.29.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4a877f47de..ea803ee5bd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.29.0:2.29.0 \ No newline at end of file +google-cloud-bigquery:2.29.0:2.29.1-SNAPSHOT \ No newline at end of file From 654993846197e7bb1aa091c251a84fd066b8711d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 22:14:17 +0200 Subject: [PATCH 1309/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.22.0 (#2776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.21.0` -> `2.22.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.22.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.22.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.22.0/compatibility-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigqueryconnection/2.22.0/confidence-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 14af71e076..e70c285ba8 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.21.0 + 2.22.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 80cd7172b1..5bdc1f9fa3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.21.0 + 2.22.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 246fe9a065..51927f1412 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.21.0 + 2.22.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 14fae2f6c3..55cc772546 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.21.0 + 2.22.0 test From 2ee52c934d253d29c16b25d498ebe8e968cda481 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 22:16:13 +0200 Subject: [PATCH 1310/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.26.0 (#2778) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.25.0` -> `1.26.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.26.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.26.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.26.0/compatibility-slim/1.25.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-datacatalog-bom/1.26.0/confidence-slim/1.25.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e70c285ba8..eda83eead9 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.25.0 + 1.26.0 pom import From 078f244572db7484471d2c55a0db4533de0d1dc7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 22:18:12 +0200 Subject: [PATCH 1311/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.22.0 (#2777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.21.0` -> `2.22.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.22.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.22.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.22.0/compatibility-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.22.0/confidence-slim/2.21.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eda83eead9..974a9eed46 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.21.0 + 2.22.0 test From 201461351ac9813f6d11e6f5c3b9ec4dd01c001b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 23:22:39 +0200 Subject: [PATCH 1312/2268] deps: update github/codeql-action action to v2.20.1 (#2766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.20.1 * 🦉 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 Co-authored-by: Min Zhu --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b87a7d0110..d9f0fe96a4 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@6c089f53dd51dc3fc7e599c3cb5356453a52ca9e # v2.20.0 + uses: github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1 with: sarif_file: results.sarif From 688b2a0b16b578dc0784094608b35cb3a68f151b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Jun 2023 23:23:35 +0200 Subject: [PATCH 1313/2268] deps: update ossf/scorecard-action action to v2.2.0 (#2775) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d9f0fe96a4..e4da88c4a0 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 + uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 with: results_file: results.sarif results_format: sarif From eab62bf1f9b7736fb167e0f066bfcd52293e5206 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Jun 2023 23:18:12 +0200 Subject: [PATCH 1314/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.29.0 (#2779) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.27.0` -> `2.29.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.29.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.29.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.29.0/compatibility-slim/2.27.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquery/2.29.0/confidence-slim/2.27.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.29.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2290-httpsgithubcomgoogleapisjava-bigquerycomparev2280v2290-2023-06-23) ##### Features - Increase default Read API timeout to 60s ([#​2764](https://togithub.com/googleapis/java-bigquery/issues/2764)) ([f606d0b](https://togithub.com/googleapis/java-bigquery/commit/f606d0b28ca8f65654413a99ab698f35e3befce1)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.12.0 ([#​2771](https://togithub.com/googleapis/java-bigquery/issues/2771)) ([7537e0f](https://togithub.com/googleapis/java-bigquery/commit/7537e0f31d8f4696559ef09c7bd284bf78217280)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.23 ([#​2759](https://togithub.com/googleapis/java-bigquery/issues/2759)) ([27ba48a](https://togithub.com/googleapis/java-bigquery/commit/27ba48a0cab331f2d233ba96fed710c11d31dc53)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 ([#​2760](https://togithub.com/googleapis/java-bigquery/issues/2760)) ([8cddf8f](https://togithub.com/googleapis/java-bigquery/commit/8cddf8fd286f51cd75aba0da6a52cbc12cab7e2a)) ### [`v2.28.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2280-httpsgithubcomgoogleapisjava-bigquerycomparev2271v2280-2023-06-19) ##### Features - Add primary key and foreign keys ([#​2744](https://togithub.com/googleapis/java-bigquery/issues/2744)) ([afb571c](https://togithub.com/googleapis/java-bigquery/commit/afb571c97edb13f93df9ac140af4516205d27a49)) - Partial Projection of Table Metadata ([#​2756](https://togithub.com/googleapis/java-bigquery/issues/2756)) ([9207743](https://togithub.com/googleapis/java-bigquery/commit/92077437d759705151f7778207616ecf024371ba)) - Return JobID with TableResult ([#​2689](https://togithub.com/googleapis/java-bigquery/issues/2689)) ([aa38428](https://togithub.com/googleapis/java-bigquery/commit/aa38428ad26b64d2566b33f4b2ca3dcc102c3247)) ### [`v2.27.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#​2271-httpsgithubcomgoogleapisjava-bigquerycomparev2270v2271-2023-06-13) ##### Dependencies - Update actions/checkout action to v3.5.3 ([#​2746](https://togithub.com/googleapis/java-bigquery/issues/2746)) ([17f8438](https://togithub.com/googleapis/java-bigquery/commit/17f843880f5633b602de5221c26b830e7e304d2b)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.21.0 ([#​2741](https://togithub.com/googleapis/java-bigquery/issues/2741)) ([d665e52](https://togithub.com/googleapis/java-bigquery/commit/d665e523b2c393c17a734ff4714aeb85f8d61dd7)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.25.0 ([#​2743](https://togithub.com/googleapis/java-bigquery/issues/2743)) ([5d38d23](https://togithub.com/googleapis/java-bigquery/commit/5d38d2375cedd29e35d75881a206cab3fdcdd6a5)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.11.0 ([#​2738](https://togithub.com/googleapis/java-bigquery/issues/2738)) ([3b56445](https://togithub.com/googleapis/java-bigquery/commit/3b564458eef9df2173c47e26e2399a6a6cad6eee)) - Update github/codeql-action action to v2.20.0 ([#​2751](https://togithub.com/googleapis/java-bigquery/issues/2751)) ([42ae181](https://togithub.com/googleapis/java-bigquery/commit/42ae18134b972c1694a7e012d2f51c916e663c83)) - Update github/codeql-action action to v2.3.6 ([#​2712](https://togithub.com/googleapis/java-bigquery/issues/2712)) ([f043ed6](https://togithub.com/googleapis/java-bigquery/commit/f043ed61dacf4ea66eedaf0a6faada06057b7d50))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f076bdda6..bcee504a53 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.27.0 + 2.29.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5bdc1f9fa3..93cb7d0c6b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.27.0 + 2.29.0 From 7fcfa63a1bd9c1782aca7f6f32f26f0df67c3f5d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Jun 2023 20:52:17 +0200 Subject: [PATCH 1315/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.24.1 (#2782) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.23.3` -> `2.24.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.24.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.24.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.24.1/compatibility-slim/2.23.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigtable/2.24.1/confidence-slim/2.23.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigtable (com.google.cloud:google-cloud-bigtable) ### [`v2.24.1`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#​2241-httpsgithubcomgoogleapisjava-bigtablecomparev2240v2241-2023-06-27) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.23.3...v2.24.1) ##### Bug Fixes - Remove javadoc external link configuration ([#​1815](https://togithub.com/googleapis/java-bigtable/issues/1815)) ([9c71a93](https://togithub.com/googleapis/java-bigtable/commit/9c71a934f8354477b0e229b83047c8203d4ab978))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 93cb7d0c6b..c2ae4f6562 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.23.3 + 2.24.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 51927f1412..4c5ed35c23 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.23.3 + 2.24.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 55cc772546..e0a46cc27b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.23.3 + 2.24.1 test From 07760b7c0837f48bb1e7875a894323e7cfc4d6af Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:30:35 -0400 Subject: [PATCH 1316/2268] ci: javadoc job (JDK 17) in ci.yaml (#1819) (#2781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: javadoc job (JDK 17) in ci.yaml (#1819) This also changes the JDK distribution from zulu to temurin https://github.com/actions/setup-java#eclipse-temurin Source-Link: https://github.com/googleapis/synthtool/commit/ef9fe2ef6d92c7ff967d9d4f704035b3f5c9051d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:31c8276a1bfb43766597d32645721c029cb94571f1b8d996cb2c290744fe52f9 * fix errors * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix error --------- Co-authored-by: Owl Bot Co-authored-by: Neenu1995 --- .github/.OwlBot.lock.yaml | 4 +- .github/workflows/ci.yaml | 26 ++++++-- .github/workflows/samples.yaml | 2 +- README.md | 2 +- .../java/com/google/cloud/bigquery/Acl.java | 64 ++++++++++++------- .../com/google/cloud/bigquery/BigQuery.java | 54 +++++++--------- .../com/google/cloud/bigquery/Connection.java | 6 +- .../cloud/bigquery/ConnectionSettings.java | 2 +- .../java/com/google/cloud/bigquery/Field.java | 39 +++++------ .../cloud/bigquery/QueryParameterValue.java | 2 - .../cloud/bigquery/RemoteFunctionOptions.java | 4 +- .../cloud/bigquery/RoutineArgument.java | 2 +- 12 files changed, 107 insertions(+), 100 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 47a70ea40c..258389d1aa 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 -# created: 2023-06-22T15:06:52.039318836Z + digest: sha256:31c8276a1bfb43766597d32645721c029cb94571f1b8d996cb2c290744fe52f9 +# created: 2023-06-27T18:51:58.922150125Z diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 65436cde41..e27b2c5756 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh @@ -45,7 +45,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 8 - distribution: zulu + distribution: temurin - name: "Set jvm system property environment variable for surefire plugin (unit tests)" # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm @@ -54,7 +54,7 @@ jobs: - uses: actions/setup-java@v3 with: java-version: 17 - distribution: zulu + distribution: temurin - run: .kokoro/build.sh env: JOB_TYPE: test @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -81,17 +81,29 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh + javadoc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 11 - run: java -version - run: .kokoro/build.sh @@ -103,7 +115,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.sh diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index 912ed8b2b0..10d252d775 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - distribution: zulu + distribution: temurin java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check diff --git a/README.md b/README.md index bcee504a53..707158574e 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.17.0') +implementation platform('com.google.cloud:libraries-bom:26.18.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index 3fad689206..e4107cdfda 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -31,7 +31,7 @@ * Access Control for a BigQuery Dataset. BigQuery uses ACLs to manage permissions on datasets. ACLs * are not directly supported on tables. A table inherits its ACL from the dataset that contains it. * Project roles affect your ability to run jobs or manage the project, while dataset roles affect - * how you can access or modify the data inside of a project. + * how you can access or modify the data inside a project. * * @see Access Control */ @@ -82,12 +82,15 @@ public static Role valueOfStrict(String constant) { return type.valueOfStrict(constant); } - /** Get the Role for the given String constant, and allow unrecognized values. */ + /** + * @param constant + * @return Get the Role for the given String constant, and allow unrecognized values. + */ public static Role valueOf(String constant) { return type.valueOf(constant); } - /** Return the known values for Role. */ + /** @return Return the known values for Role. */ public static Role[] values() { return type.values(); } @@ -167,14 +170,19 @@ public static final class DatasetAclEntity extends Entity { private final DatasetId id; private final List targetTypes; - /** Creates a DatasetAclEntity given the DatasetAclEntity's id. */ + /** + * Creates a DatasetAclEntity given the DatasetAclEntity's id. + * + * @param id + * @param targetTypes + */ public DatasetAclEntity(DatasetId id, List targetTypes) { super(Type.DATASET); this.id = id; this.targetTypes = targetTypes; } - /** Returns DatasetAclEntity's identity. */ + /** @return Returns DatasetAclEntity's identity. */ public DatasetId getId() { return id; } @@ -230,7 +238,7 @@ public Domain(String domain) { this.domain = domain; } - /** Returns the domain name. */ + /** @return Returns the domain name. */ public String getDomain() { return domain; } @@ -291,9 +299,9 @@ public Group(String identifier) { } /** - * Returns group's identifier, can be either a - * special group identifier or a group email. + * @return Returns group's identifier, can be either a + * special group identifier or a group email. */ public String getIdentifier() { return identifier; @@ -338,22 +346,22 @@ Access toPb() { } } - /** Returns a Group entity representing all project's owners. */ + /** @return Returns a Group entity representing all project's owners. */ public static Group ofProjectOwners() { return new Group(PROJECT_OWNERS); } - /** Returns a Group entity representing all project's readers. */ + /** @return Returns a Group entity representing all project's readers. */ public static Group ofProjectReaders() { return new Group(PROJECT_READERS); } - /** Returns a Group entity representing all project's writers. */ + /** @return Returns a Group entity representing all project's writers. */ public static Group ofProjectWriters() { return new Group(PROJECT_WRITERS); } - /** Returns a Group entity representing all BigQuery authenticated users. */ + /** @return Returns a Group entity representing all BigQuery authenticated users. */ public static Group ofAllAuthenticatedUsers() { return new Group(ALL_AUTHENTICATED_USERS); } @@ -375,7 +383,7 @@ public User(String email) { this.email = email; } - /** Returns user's email. */ + /** @return Returns user's email. */ public String getEmail() { return email; } @@ -427,7 +435,7 @@ public View(TableId id) { this.id = id; } - /** Returns table's identity. */ + /** @return Returns table's identity. */ public TableId getId() { return id; } @@ -479,7 +487,7 @@ public Routine(RoutineId id) { this.id = id; } - /** Returns routine's identity. */ + /** @return Returns routine's identity. */ public RoutineId getId() { return id; } @@ -527,7 +535,7 @@ public IamMember(String iamMember) { this.iamMember = iamMember; } - /** Returns iamMember. */ + /** @return Returns iamMember. */ public String getIamMember() { return iamMember; } @@ -565,19 +573,18 @@ private Acl(Entity entity, Role role) { this.role = role; } - /** Returns the entity for this ACL. */ + /** @return Returns the entity for this ACL. */ public Entity getEntity() { return entity; } - /** Returns the role specified by this ACL. */ + /** @return Returns the role specified by this ACL. */ public Role getRole() { return role; } /** - * Returns an Acl object. - * + * @return Returns an Acl object. * @param entity the entity for this ACL object * @param role the role to associate to the {@code entity} object */ @@ -585,17 +592,26 @@ public static Acl of(Entity entity, Role role) { return new Acl(entity, role); } - /** Returns an Acl object for a datasetAclEntity. */ + /** + * @param datasetAclEntity + * @return Returns an Acl object for a datasetAclEntity. + */ public static Acl of(DatasetAclEntity datasetAclEntity) { return new Acl(datasetAclEntity, null); } - /** Returns an Acl object for a view entity. */ + /** + * @param view + * @return Returns an Acl object for a view entity. + */ public static Acl of(View view) { return new Acl(view, null); } - /** Returns an Acl object for a routine entity. */ + /** + * @param routine + * @return Returns an Acl object for a routine entity. + */ public static Acl of(Routine routine) { return new Acl(routine, null); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 2712783576..ac6262e69d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -886,7 +886,7 @@ public int hashCode() { * { * @code * // List datasets in the default project - * Page datasets = bigquery.listDatasets(DatasetListOption.pageSize(100)); + * Page<Dataset> datasets = bigquery.listDatasets(DatasetListOption.pageSize(100)); * for (Dataset dataset : datasets.iterateAll()) { * // do something with the dataset * } @@ -910,7 +910,7 @@ public int hashCode() { * @code * String projectId = "my_project_id"; * // List datasets in a specified project - * Page datasets = bigquery.listDatasets(projectId, DatasetListOption.pageSize(100)); + * Page<{@link Dataset}> datasets = bigquery.listDatasets(projectId, DatasetListOption.pageSize(100)); * for (Dataset dataset : datasets.iterateAll()) { * // do something with the dataset * } @@ -1036,11 +1036,9 @@ public int hashCode() { /** * Deletes the requested routine. * - *

    - * Example of deleting a routine. + *

    Example of deleting a routine. * - *

    -   * {@code
    +   * 
    {@code
        * String projectId = "my_project_id";
        * String datasetId = "my_dataset_id";
        * String routineId = "my_routine_id";
    @@ -1051,11 +1049,9 @@ public int hashCode() {
        * } else {
        *   // the routine was not found
        * }
    -   * 
    - * - * @return {@code true} if routine was deleted, {@code false} if it was not - * found + * }
    * + * @return {@code true} if routine was deleted, {@code false} if it was not found * @throws BigQueryException upon failure */ boolean delete(RoutineId routineId); @@ -1262,21 +1258,18 @@ public int hashCode() { Page listRoutines(DatasetId datasetId, RoutineListOption... options); /** - * Lists the tables in the dataset. This method returns partial information on - * each table: ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, - * {@link Table#getGeneratedId()} and type, which is part of - * {@link Table#getDefinition()}). To get complete information use either - * {@link #getTable(TableId, TableOption...)} or - * {@link #getTable(String, String, TableOption...)}. + * Lists the tables in the dataset. This method returns partial information on each table: ({@link + * Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type, + * which is part of {@link Table#getDefinition()}). To get complete information use either {@link + * #getTable(TableId, TableOption...)} or {@link #getTable(String, String, TableOption...)}. * - *

    - * Example of listing the tables in a dataset, specifying the page size. + *

    Example of listing the tables in a dataset, specifying the page size. * *

        * {
        *   @code
        *   String datasetName = "my_dataset_name";
    -   *   Page
  • tables = bigquery.listTables(datasetName, TableListOption.pageSize(100)); + * Page<Table> tables = bigquery.listTables(datasetName, TableListOption.pageSize(100)); * for (Table table : tables.iterateAll()) { * // do something with the table * } @@ -1288,15 +1281,12 @@ public int hashCode() { Page
    listTables(String datasetId, TableListOption... options); /** - * Lists the tables in the dataset. This method returns partial information on - * each table: ({@link Table#getTableId()}, {@link Table#getFriendlyName()}, - * {@link Table#getGeneratedId()} and type, which is part of - * {@link Table#getDefinition()}). To get complete information use either - * {@link #getTable(TableId, TableOption...)} or - * {@link #getTable(String, String, TableOption...)}. + * Lists the tables in the dataset. This method returns partial information on each table: ({@link + * Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type, + * which is part of {@link Table#getDefinition()}). To get complete information use either {@link + * #getTable(TableId, TableOption...)} or {@link #getTable(String, String, TableOption...)}. * - *

    - * Example of listing the tables in a dataset. + *

    Example of listing the tables in a dataset. * *

        * {
    @@ -1304,7 +1294,7 @@ public int hashCode() {
        *   String projectId = "my_project_id";
        *   String datasetName = "my_dataset_name";
        *   DatasetId datasetId = DatasetId.of(projectId, datasetName);
    -   *   Page
    tables = bigquery.listTables(datasetId, TableListOption.pageSize(100)); + * Page<Table> tables = bigquery.listTables(datasetId, TableListOption.pageSize(100)); * for (Table table : tables.iterateAll()) { * // do something with the table * } @@ -1339,12 +1329,12 @@ public int hashCode() { * String tableName = "my_table_name"; * TableId tableId = TableId.of(datasetName, tableName); * // Values of the row to insert - * Map rowContent = new HashMap<>(); + * Map<String, Object> rowContent = new HashMap<>(); * rowContent.put("booleanField", true); * // Bytes are passed in base64 * rowContent.put("bytesField", "Cg0NDg0="); // 0xA, 0xD, 0xD, 0xE, 0xD in base64 * // Records are passed as a map - * Map recordsContent = new HashMap<>(); + * Map<String, Object> recordsContent = new HashMap<>(); * recordsContent.put("stringField", "Hello, World!"); * rowContent.put("recordField", recordsContent); * InsertAllResponse response = bigquery.insertAll(InsertAllRequest.newBuilder(tableId).addRow("rowId", rowContent) @@ -1353,7 +1343,7 @@ public int hashCode() { * .build()); * if (response.hasErrors()) { * // If any of the insertions failed, this lets you inspect the errors - * for (Entry> entry : response.getInsertErrors().entrySet()) { + * for (Entry<Long, List<BigQueryError>> entry : response.getInsertErrors().entrySet()) { * // inspect row error * } * } @@ -1509,7 +1499,7 @@ TableResult listTableData( *
        * {
        *   @code
    -   *   Page jobs = bigquery.listJobs(JobListOption.pageSize(100));
    +   *   Page<Job> jobs = bigquery.listJobs(JobListOption.pageSize(100));
        *   for (Job job : jobs.iterateAll()) {
        *     // do something with the job
        *   }
    diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java
    index 3a30d1f7b2..afc8eb848b 100644
    --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java
    +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java
    @@ -106,7 +106,7 @@ BigQueryResult executeSelect(
        *            .build();
        *   Connection connection = bigquery.createConnection(connectionSettings);
        *   String selectQuery = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    -   * ListenableFuture executeSelectFuture = connection.executeSelectAsync(selectQuery);
    +   * ListenableFuture<ExecuteSelectResponse> executeSelectFuture = connection.executeSelectAsync(selectQuery);
        * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
        *
        *  if(!executeSelectRes.getIsSuccessful()){
    @@ -155,9 +155,9 @@ ListenableFuture executeSelectAsync(String sql)
        *         Parameter.newBuilder().setName("stringParam").setValue(stringParameter).build();
        *     Parameter intArrayParam =
        *         Parameter.newBuilder().setName("integerList").setValue(intArrayParameter).build();
    -   *     List parameters = ImmutableList.of(stringParam, intArrayParam);
    +   *     List<Parameter> parameters = ImmutableList.of(stringParam, intArrayParam);
        *
    -   *     ListenableFuture executeSelectFut =
    +   *     ListenableFuture<ExecuteSelectResponse> executeSelectFut =
        *         connection.executeSelectAsync(selectQuery, parameters);
        * ExecuteSelectResponse executeSelectRes = executeSelectFuture.get();
        *
    diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java
    index ac3b1b1e05..a9aabe038d 100644
    --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java
    +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java
    @@ -115,7 +115,7 @@ public abstract class ConnectionSettings {
     
       /**
        * Returns the table where to put query results. If not provided a new table is created. This
    -   * value is required if {@link # allowLargeResults()} is {@code true}.
    +   * value is required if {@link #getAllowLargeResults()} is {@code true}.
        */
       @Nullable
       public abstract TableId getDestinationTable();
    diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java
    index e151b501ba..7496530dd6 100644
    --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java
    +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java
    @@ -258,30 +258,21 @@ public Builder setPrecision(Long precision) {
          * 

    You can use struct or array expression to specify default value for the entire struct or * array. The valid SQL expressions are: * - *

      - *
        - *
      • Literals for all data types, including STRUCT and ARRAY. - *
      - *
        - *
      • The following functions: - *
          - *
        • CURRENT_TIMESTAMP - *
        • CURRENT_TIME - *
        • CURRENT_DATE - *
        • CURRENT_DATETIME - *
        • GENERATE_UUID - *
        • RAND - *
        • SESSION_USER - *
        • ST_GEOGPOINT - *
        - *
      - *
        - *
      • Struct or array composed with the above allowed functions, for example: - *
          - *
        • "[CURRENT_DATE(), DATE '2020-01-01']" - *
        - *
      - *
    + *
    +     *   Literals for all data types, including STRUCT and ARRAY.
    +     *   The following functions:
    +     *      - CURRENT_TIMESTAMP
    +     *      - CURRENT_TIME
    +     *      - CURRENT_DATE
    +     *      - CURRENT_DATETIME
    +     *      - GENERATE_UUID
    +     *      - RAND
    +     *      - SESSION_USER
    +     *      - ST_GEOGPOINT
    +     *
    +     *   Struct or array composed with the above allowed functions, for example:
    +     *      "[CURRENT_DATE(), DATE '2020-01-01']"
    +     * 
    */ public Builder setDefaultValueExpression(String defaultValueExpression) { this.defaultValueExpression = defaultValueExpression; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index b21445d383..85ebd2957b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -52,8 +52,6 @@ * for StandardSQLTypeName.INT64). Alternatively, an instance can be constructed by calling {@link * #of(Object, Class)} with the value and a Class object, which will use these mappings: * - *

    - * *

      *
    • Boolean: StandardSQLTypeName.BOOL *
    • String: StandardSQLTypeName.STRING diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java index 88496dcb4c..0f31e9c662 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RemoteFunctionOptions.java @@ -78,7 +78,7 @@ public abstract static class Builder { /** * Returns the user-defined context as a set of key/value pairs. * - * @return Map + * @return Map<String, String> */ @Nullable public abstract Map getUserDefinedContext(); @@ -96,7 +96,7 @@ public abstract static class Builder { */ public abstract RemoteFunctionOptions.Builder toBuilder(); - /** Returns a builder for a {@Code RemoteFunctionOptions} object. */ + /** Returns a builder for a {@code RemoteFunctionOptions} object. */ public static RemoteFunctionOptions.Builder newBuilder() { return new AutoValue_RemoteFunctionOptions.Builder(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineArgument.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineArgument.java index d36d1f2295..4bc17e6ae2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineArgument.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineArgument.java @@ -90,7 +90,7 @@ public abstract static class Builder { /** Returns a builder pre-populated using the current values of this {@code RoutineArgument}. */ public abstract Builder toBuilder(); - /** Returns a builder for a {@Code RoutineArgument} object. */ + /** Returns a builder for a {@code RoutineArgument} object. */ public static Builder newBuilder() { return new AutoValue_RoutineArgument.Builder(); } From 344f695e319470acf350ebdd56d643c03704ea1f Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Mon, 17 Jul 2023 10:02:21 -0400 Subject: [PATCH 1317/2268] feat: add support for Search statistics (#2787) --- .../cloud/bigquery/IndexUnusedReason.java | 136 ++++++++++++++++++ .../google/cloud/bigquery/JobStatistics.java | 25 ++++ .../google/cloud/bigquery/SearchStats.java | 92 ++++++++++++ .../cloud/bigquery/JobStatisticsTest.java | 7 + .../cloud/bigquery/it/ITBigQueryTest.java | 25 ++++ 5 files changed, 285 insertions(+) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java new file mode 100644 index 0000000000..06a88b068e --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java @@ -0,0 +1,136 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.TableReference; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +/** Represents Reason of why the index was not used in a SQL search. */ +@AutoValue +public abstract class IndexUnusedReason implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + + /** + * Specifies the name of the unused search index, if available. + * + * @param indexName indexName or {@code null} for none + */ + public abstract Builder setIndexName(String indexName); + + /** + * Specifies the high-level reason for the scenario when no search index was used. + * + * @param code code or {@code null} for none + */ + public abstract Builder setCode(String code); + + /** + * Free form human-readable reason for the scenario when no search index was used. + * + * @param message message or {@code null} for none + */ + public abstract Builder setMessage(String message); + + /** + * Specifies the base table involved in the reason that no search index was used. + * + * @param tableReference tableReference or {@code null} for none + */ + public abstract Builder setBaseTable(TableReference tableReference); + + /** Creates a @code IndexUnusedReason} object. */ + public abstract IndexUnusedReason build(); + } + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_IndexUnusedReason.Builder(); + } + + /** + * Returns the name of the unused search index, if available. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getIndexName(); + + /** + * Returns the high-level reason for the scenario when no search index was used. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getCode(); + + /** + * Returns free form human-readable reason for the scenario when no search index was used. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getMessage(); + + /** + * Returns the base table involved in the reason that no search index was used. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract TableReference getBaseTable(); + + com.google.api.services.bigquery.model.IndexUnusedReason toPb() { + com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason = + new com.google.api.services.bigquery.model.IndexUnusedReason(); + if (getIndexName() != null) { + indexUnusedReason.setIndexName(indexUnusedReason.getIndexName()); + } + if (getCode() != null) { + indexUnusedReason.setCode(indexUnusedReason.getCode()); + } + if (getMessage() != null) { + indexUnusedReason.setMessage(indexUnusedReason.getMessage()); + } + if (getBaseTable() != null) { + indexUnusedReason.setBaseTable(indexUnusedReason.getBaseTable()); + } + return indexUnusedReason; + } + + static IndexUnusedReason fromPb( + com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason) { + Builder builder = newBuilder(); + if (indexUnusedReason.getIndexName() != null) { + builder.setIndexName(indexUnusedReason.getIndexName()); + } + if (indexUnusedReason.getCode() != null) { + builder.setCode(indexUnusedReason.getCode()); + } + if (indexUnusedReason.getMessage() != null) { + builder.setMessage(indexUnusedReason.getMessage()); + } + if (indexUnusedReason.getBaseTable() != null) { + builder.setBaseTable(indexUnusedReason.getBaseTable()); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 0ef1d1f947..59c48615fd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -340,6 +340,7 @@ public static class QueryStatistics extends JobStatistics { private final List queryPlan; private final List timeline; private final Schema schema; + private final SearchStats searchStats; private final List queryParameters; /** @@ -424,6 +425,7 @@ static final class Builder extends JobStatistics.Builder timeline; private Schema schema; private List queryParameters; + private SearchStats searchStats; private Builder() {} @@ -471,6 +473,9 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP if (statisticsPb.getQuery().getSchema() != null) { this.schema = Schema.fromPb(statisticsPb.getQuery().getSchema()); } + if (statisticsPb.getQuery().getSearchStatistics() != null) { + this.searchStats = SearchStats.fromPb(statisticsPb.getQuery().getSearchStatistics()); + } if (statisticsPb.getQuery().getDmlStats() != null) { this.dmlStats = DmlStats.fromPb(statisticsPb.getQuery().getDmlStats()); } @@ -572,6 +577,11 @@ Builder setSchema(Schema schema) { return self(); } + Builder setSearchStats(SearchStats searchStats) { + this.searchStats = searchStats; + return self(); + } + Builder setQueryParameters(List queryParameters) { this.queryParameters = queryParameters; return self(); @@ -603,6 +613,7 @@ private QueryStatistics(Builder builder) { this.queryPlan = builder.queryPlan; this.timeline = builder.timeline; this.schema = builder.schema; + this.searchStats = builder.searchStats; this.queryParameters = builder.queryParameters; } @@ -724,6 +735,15 @@ public Schema getSchema() { return schema; } + /** + * Statistics for a search query. Populated as part of JobStatistics2. Provides information + * about how indexes are used in search queries. If an index is not used, you can retrieve + * debugging information about the reason why. + */ + public SearchStats getSearchStats() { + return searchStats; + } + /** * Standard SQL only: Returns a list of undeclared query parameters detected during a dry run * validation. @@ -743,6 +763,7 @@ ToStringHelper toStringHelper() { .add("queryPlan", queryPlan) .add("timeline", timeline) .add("schema", schema) + .add("searchStats", searchStats) .add("queryParameters", queryParameters); } @@ -765,6 +786,7 @@ public final int hashCode() { totalBytesProcessed, queryPlan, schema, + searchStats, queryParameters); } @@ -807,6 +829,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (schema != null) { queryStatisticsPb.setSchema(schema.toPb()); } + if (searchStats != null) { + queryStatisticsPb.setSearchStatistics(searchStats.toPb()); + } if (queryParameters != null) { queryStatisticsPb.setUndeclaredQueryParameters(queryParameters); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java new file mode 100644 index 0000000000..73b812383b --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java @@ -0,0 +1,92 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.SearchStatistics; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** Represents Search statistics information of a search query. */ +@AutoValue +public abstract class SearchStats implements Serializable { + + @AutoValue.Builder + public abstract static class Builder { + + /** + * Specifies index usage mode for the query. + * + * @param indexUsageMode, has three modes UNUSED, PARTIALLY_USED, and FULLY_USED + */ + public abstract Builder setIndexUsageMode(String indexUsageMode); + + /** + * When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used + * in all or part of the search query. If index_usage_mode is FULLY_USED, this field is not + * populated. + * + * @param indexUnusedReasons + */ + public abstract Builder setIndexUnusedReasons(List indexUnusedReasons); + + /** Creates a @code SearchStats} object. */ + public abstract SearchStats build(); + } + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_SearchStats.Builder(); + } + + @Nullable + public abstract String getIndexUsageMode(); + + @Nullable + public abstract List getIndexUnusedReasons(); + + SearchStatistics toPb() { + SearchStatistics searchStatistics = new SearchStatistics(); + if (getIndexUsageMode() != null) { + searchStatistics.setIndexUsageMode(getIndexUsageMode()); + } + if (getIndexUnusedReasons() != null) { + searchStatistics.setIndexUnusedReason( + getIndexUnusedReasons().stream() + .map(IndexUnusedReason::toPb) + .collect(Collectors.toList())); + } + return searchStatistics; + } + + static SearchStats fromPb(SearchStatistics searchStatistics) { + Builder builder = newBuilder(); + if (searchStatistics.getIndexUsageMode() != null) { + builder.setIndexUsageMode(searchStatistics.getIndexUsageMode()); + } + if (searchStatistics.getIndexUnusedReason() != null) { + builder.setIndexUnusedReasons( + searchStatistics.getIndexUnusedReason().stream() + .map(IndexUnusedReason::fromPb) + .collect(Collectors.toList())); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 0dad46e9e8..af75a2391e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -159,6 +159,9 @@ public class JobStatisticsTest { ImmutableList.of(TIMELINE_SAMPLE1, TIMELINE_SAMPLE2); private static final List QUERY_PLAN = ImmutableList.of(QUERY_STAGE); private static final Schema SCHEMA = Schema.of(Field.of("column", LegacySQLTypeName.DATETIME)); + private static final String UNUSED_INDEX_USAGE_MODE = "UNUSED"; + private static final SearchStats SEARCH_STATS = + SearchStats.newBuilder().setIndexUsageMode(UNUSED_INDEX_USAGE_MODE).build(); private static final QueryStatistics QUERY_STATISTICS = QueryStatistics.newBuilder() .setCreationTimestamp(CREATION_TIME) @@ -182,6 +185,7 @@ public class JobStatisticsTest { .setQueryPlan(QUERY_PLAN) .setTimeline(TIMELINE) .setSchema(SCHEMA) + .setSearchStats(SEARCH_STATS) .build(); private static final QueryStatistics QUERY_STATISTICS_INCOMPLETE = QueryStatistics.newBuilder() @@ -190,6 +194,7 @@ public class JobStatisticsTest { .setStartTime(START_TIME) .setBillingTier(BILLING_TIER) .setCacheHit(CACHE_HIT) + .setSearchStats(SEARCH_STATS) .build(); private static final ScriptStackFrame STATEMENT_STACK_FRAME = ScriptStackFrame.newBuilder() @@ -407,6 +412,8 @@ private void compareQueryStatistics(QueryStatistics expected, QueryStatistics va assertEquals(expected.getQueryPlan(), value.getQueryPlan()); assertEquals(expected.getReferencedTables(), value.getReferencedTables()); assertEquals(expected.getSchema(), value.getSchema()); + assertEquals( + expected.getSearchStats().getIndexUsageMode(), value.getSearchStats().getIndexUsageMode()); assertEquals(expected.getStatementType(), value.getStatementType()); assertEquals(expected.getTimeline(), value.getTimeline()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b80fb02dfb..97db5fc203 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5088,6 +5088,31 @@ public void testQueryJobWithLabels() throws InterruptedException, TimeoutExcepti } } + @Test + public void testQueryJobWithSearchReturnsSearchStatistics() throws InterruptedException { + String tableName = "test_query_job_table"; + String query = + "SELECT * FROM " + + TABLE_ID.getTable() + + " WHERE search(StringField, \"stringValue\")"; + TableId destinationTable = TableId.of(DATASET, tableName); + try { + QueryJobConfiguration configuration = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .setDestinationTable(destinationTable) + .build(); + Job remoteJob = bigquery.create(JobInfo.of(configuration)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + JobStatistics.QueryStatistics stats = remoteJob.getStatistics(); + assertNotNull(stats.getSearchStats()); + assertEquals(stats.getSearchStats().getIndexUsageMode(), "UNUSED"); + } finally { + bigquery.delete(destinationTable); + } + } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJobWithRangePartitioning() throws InterruptedException { From e886f5fa79aee469fe7b8860b5e87951635b6ce7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 18:37:10 +0200 Subject: [PATCH 1318/2268] deps: update github/codeql-action action to v2.20.4 (#2784) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e4da88c4a0..1d53ee053b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1 + uses: github/codeql-action/upload-sarif@489225d82a57396c6f426a40e66d461b16b3461d # v2.20.4 with: sarif_file: results.sarif From dd14eee126f3cb6be7c943157e65acd5d4a088d4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 18:37:57 +0200 Subject: [PATCH 1319/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 (#2786) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 974a9eed46..d0540ac1af 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230520-2.0.0 - 3.12.0 + 3.13.0 12.0.0 From fbba253600a0eb2c5eb48b051c7f865ffbf7aaa1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 16:58:12 +0000 Subject: [PATCH 1320/2268] chore(main): release 2.30.0 (#2774) :robot: I have created a release *beep* *boop* --- ## [2.30.0](https://togithub.com/googleapis/java-bigquery/compare/v2.29.0...v2.30.0) (2023-07-17) ### Features * Add missing storage related fields to Table, TableInfo and StandardTableDefinition ([#2673](https://togithub.com/googleapis/java-bigquery/issues/2673)) ([e3003f4](https://togithub.com/googleapis/java-bigquery/commit/e3003f48df9cca2bd549d893ffef3bb198a3b2aa)) * Add support for Search statistics ([#2787](https://togithub.com/googleapis/java-bigquery/issues/2787)) ([344f695](https://togithub.com/googleapis/java-bigquery/commit/344f695e319470acf350ebdd56d643c03704ea1f)) ### Dependencies * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.22.0 ([#2777](https://togithub.com/googleapis/java-bigquery/issues/2777)) ([078f244](https://togithub.com/googleapis/java-bigquery/commit/078f244572db7484471d2c55a0db4533de0d1dc7)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.26.0 ([#2778](https://togithub.com/googleapis/java-bigquery/issues/2778)) ([2ee52c9](https://togithub.com/googleapis/java-bigquery/commit/2ee52c934d253d29c16b25d498ebe8e968cda481)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#2786](https://togithub.com/googleapis/java-bigquery/issues/2786)) ([dd14eee](https://togithub.com/googleapis/java-bigquery/commit/dd14eee126f3cb6be7c943157e65acd5d4a088d4)) * Update github/codeql-action action to v2.20.1 ([#2766](https://togithub.com/googleapis/java-bigquery/issues/2766)) ([2014613](https://togithub.com/googleapis/java-bigquery/commit/201461351ac9813f6d11e6f5c3b9ec4dd01c001b)) * Update github/codeql-action action to v2.20.4 ([#2784](https://togithub.com/googleapis/java-bigquery/issues/2784)) ([e886f5f](https://togithub.com/googleapis/java-bigquery/commit/e886f5fa79aee469fe7b8860b5e87951635b6ce7)) * Update ossf/scorecard-action action to v2.2.0 ([#2775](https://togithub.com/googleapis/java-bigquery/issues/2775)) ([688b2a0](https://togithub.com/googleapis/java-bigquery/commit/688b2a0b16b578dc0784094608b35cb3a68f151b)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ac6658099..8ff8aebbf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.30.0](https://github.com/googleapis/java-bigquery/compare/v2.29.0...v2.30.0) (2023-07-17) + + +### Features + +* Add missing storage related fields to Table, TableInfo and StandardTableDefinition ([#2673](https://github.com/googleapis/java-bigquery/issues/2673)) ([e3003f4](https://github.com/googleapis/java-bigquery/commit/e3003f48df9cca2bd549d893ffef3bb198a3b2aa)) +* Add support for Search statistics ([#2787](https://github.com/googleapis/java-bigquery/issues/2787)) ([344f695](https://github.com/googleapis/java-bigquery/commit/344f695e319470acf350ebdd56d643c03704ea1f)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.22.0 ([#2777](https://github.com/googleapis/java-bigquery/issues/2777)) ([078f244](https://github.com/googleapis/java-bigquery/commit/078f244572db7484471d2c55a0db4533de0d1dc7)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.26.0 ([#2778](https://github.com/googleapis/java-bigquery/issues/2778)) ([2ee52c9](https://github.com/googleapis/java-bigquery/commit/2ee52c934d253d29c16b25d498ebe8e968cda481)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#2786](https://github.com/googleapis/java-bigquery/issues/2786)) ([dd14eee](https://github.com/googleapis/java-bigquery/commit/dd14eee126f3cb6be7c943157e65acd5d4a088d4)) +* Update github/codeql-action action to v2.20.1 ([#2766](https://github.com/googleapis/java-bigquery/issues/2766)) ([2014613](https://github.com/googleapis/java-bigquery/commit/201461351ac9813f6d11e6f5c3b9ec4dd01c001b)) +* Update github/codeql-action action to v2.20.4 ([#2784](https://github.com/googleapis/java-bigquery/issues/2784)) ([e886f5f](https://github.com/googleapis/java-bigquery/commit/e886f5fa79aee469fe7b8860b5e87951635b6ce7)) +* Update ossf/scorecard-action action to v2.2.0 ([#2775](https://github.com/googleapis/java-bigquery/issues/2775)) ([688b2a0](https://github.com/googleapis/java-bigquery/commit/688b2a0b16b578dc0784094608b35cb3a68f151b)) + ## [2.29.0](https://github.com/googleapis/java-bigquery/compare/v2.28.0...v2.29.0) (2023-06-23) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b4368fe912..48c65dbced 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.29.1-SNAPSHOT + 2.30.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 049721806d..5df9bcc1f0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.29.1-SNAPSHOT + 2.30.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.29.1-SNAPSHOT + 2.30.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d0540ac1af..83db76cb94 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.29.1-SNAPSHOT + 2.30.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.29.1-SNAPSHOT + 2.30.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4c5ed35c23..bd7b2f257b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.29.1-SNAPSHOT + 2.30.0 diff --git a/versions.txt b/versions.txt index ea803ee5bd..4c6eda6a00 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.29.0:2.29.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.30.0:2.30.0 \ No newline at end of file From c83ea0d5b51bcb84b40952391315be1b87e677ea Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:22:13 +0000 Subject: [PATCH 1321/2268] chore(main): release 2.30.1-SNAPSHOT (#2796) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 48c65dbced..1c7041f90d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.30.0 + 2.30.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5df9bcc1f0..daed8ee450 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.30.0 + 2.30.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.30.0 + 2.30.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 83db76cb94..39c53a31a4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.30.0 + 2.30.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.30.0 + 2.30.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bd7b2f257b..7f94b52c41 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.30.0 + 2.30.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4c6eda6a00..3d3faa27f4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.30.0:2.30.0 \ No newline at end of file +google-cloud-bigquery:2.30.0:2.30.1-SNAPSHOT \ No newline at end of file From 005ee5355e1929d1ef92289de6b355b7d98aac36 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:29:26 +0200 Subject: [PATCH 1322/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.23.0 (#2790) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 39c53a31a4..c09b7bad53 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.22.0 + 2.23.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c2ae4f6562..07963cbe07 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.22.0 + 2.23.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7f94b52c41..1b47b1932b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.22.0 + 2.23.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e0a46cc27b..24c4b44c8a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.22.0 + 2.23.0 test From 940301b327bf941cfab56d68759b6f1494fda22f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:29:43 +0200 Subject: [PATCH 1323/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.23.0 (#2791) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c09b7bad53..b977361aaa 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.22.0 + 2.23.0 test From 494cff5421bd1db109bb1af4159a1f37890f045d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:30:11 +0200 Subject: [PATCH 1324/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.25.0 (#2795) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 07963cbe07..1ba89d59d7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.24.1 + 2.25.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1b47b1932b..550696217b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.24.1 + 2.25.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 24c4b44c8a..a6e26c0e24 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.24.1 + 2.25.0 test From c79106678a0ac62b34605f19ca2baea296ea531c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:30:24 +0200 Subject: [PATCH 1325/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.27.0 (#2792) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b977361aaa..4a71725b36 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.26.0 + 1.27.0 pom import From bfe6754a17dcc3ba13a2e0bd35773c4ca76f0320 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:32:38 +0200 Subject: [PATCH 1326/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.24.0 (#2793) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4a71725b36..7a3139f36e 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.23.0 + 2.24.0 test From f85e57a4ef4db22070a171c8fe4bef4092e902ee Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Jul 2023 21:46:14 +0200 Subject: [PATCH 1327/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.30.0 (#2797) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.29.0` -> `2.30.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.30.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2300-2023-07-17) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.29.0...v2.30.0) ##### Features - Add missing storage related fields to Table, TableInfo and StandardTableDefinition ([#​2673](https://togithub.com/googleapis/java-bigquery/issues/2673)) ([e3003f4](https://togithub.com/googleapis/java-bigquery/commit/e3003f48df9cca2bd549d893ffef3bb198a3b2aa)) - Add support for Search statistics ([#​2787](https://togithub.com/googleapis/java-bigquery/issues/2787)) ([344f695](https://togithub.com/googleapis/java-bigquery/commit/344f695e319470acf350ebdd56d643c03704ea1f)) ##### Dependencies - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.22.0 ([#​2777](https://togithub.com/googleapis/java-bigquery/issues/2777)) ([078f244](https://togithub.com/googleapis/java-bigquery/commit/078f244572db7484471d2c55a0db4533de0d1dc7)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.26.0 ([#​2778](https://togithub.com/googleapis/java-bigquery/issues/2778)) ([2ee52c9](https://togithub.com/googleapis/java-bigquery/commit/2ee52c934d253d29c16b25d498ebe8e968cda481)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#​2786](https://togithub.com/googleapis/java-bigquery/issues/2786)) ([dd14eee](https://togithub.com/googleapis/java-bigquery/commit/dd14eee126f3cb6be7c943157e65acd5d4a088d4)) - Update github/codeql-action action to v2.20.1 ([#​2766](https://togithub.com/googleapis/java-bigquery/issues/2766)) ([2014613](https://togithub.com/googleapis/java-bigquery/commit/201461351ac9813f6d11e6f5c3b9ec4dd01c001b)) - Update github/codeql-action action to v2.20.4 ([#​2784](https://togithub.com/googleapis/java-bigquery/issues/2784)) ([e886f5f](https://togithub.com/googleapis/java-bigquery/commit/e886f5fa79aee469fe7b8860b5e87951635b6ce7)) - Update ossf/scorecard-action action to v2.2.0 ([#​2775](https://togithub.com/googleapis/java-bigquery/issues/2775)) ([688b2a0](https://togithub.com/googleapis/java-bigquery/commit/688b2a0b16b578dc0784094608b35cb3a68f151b))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 707158574e..20b5af17e2 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.29.0 + 2.30.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.29.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.30.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.29.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.30.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.29.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.30.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1ba89d59d7..d4b485f0bf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.29.0 + 2.30.0 From d7402b3dc6f08651b81c3a993e76af30cc10baf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 19:48:13 +0000 Subject: [PATCH 1328/2268] build(deps): bump cryptography from 39.0.1 to 41.0.2 in /.kokoro (#2789) Bumps [cryptography](https://togithub.com/pyca/cryptography) from 39.0.1 to 41.0.2.
      Changelog

      Sourced from cryptography's changelog.

      41.0.2 - 2023-07-10

      
      * Fixed bugs in creating and parsing SSH certificates where critical options
        with values were handled incorrectly. Certificates are now created correctly
        and parsing accepts correct values as well as the previously generated
        invalid forms with a warning. In the next release, support for parsing these
        invalid forms will be removed.
      

      .. _v41-0-1:

      41.0.1 - 2023-06-01

      • Temporarily allow invalid ECDSA signature algorithm parameters in X.509 certificates, which are generated by older versions of Java.
      • Allow null bytes in pass phrases when serializing private keys.

      .. _v41-0-0:

      41.0.0 - 2023-05-30

      
      * **BACKWARDS INCOMPATIBLE:** Support for OpenSSL less than 1.1.1d has been
        removed.  Users on older version of OpenSSL will need to upgrade.
      * **BACKWARDS INCOMPATIBLE:** Support for Python 3.6 has been removed.
      * **BACKWARDS INCOMPATIBLE:** Dropped support for LibreSSL < 3.6.
      * Updated the minimum supported Rust version (MSRV) to 1.56.0, from 1.48.0.
      * Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.1.
      * Added support for the :class:`~cryptography.x509.OCSPAcceptableResponses`
        OCSP extension.
      * Added support for the :class:`~cryptography.x509.MSCertificateTemplate`
        proprietary Microsoft certificate extension.
      * Implemented support for equality checks on all asymmetric public key types.
      * Added support for ``aes256-gcm@openssh.com`` encrypted keys in
        :func:`~cryptography.hazmat.primitives.serialization.load_ssh_private_key`.
      * Added support for obtaining X.509 certificate signature algorithm parameters
        (including PSS) via
        :meth:`~cryptography.x509.Certificate.signature_algorithm_parameters`.
      * Support signing :class:`~cryptography.hazmat.primitives.asymmetric.padding.PSS`
        X.509 certificates via the new keyword-only argument ``rsa_padding`` on
        :meth:`~cryptography.x509.CertificateBuilder.sign`.
      * Added support for
        :class:`~cryptography.hazmat.primitives.ciphers.aead.ChaCha20Poly1305`
        on BoringSSL.
      

      .. _v40-0-2:

      40.0.2 - 2023-04-14

      ... (truncated)

      Commits

      [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cryptography&package-manager=pip&previous-version=39.0.1&new-version=41.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
      Dependabot commands and options
      You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://togithub.com/googleapis/java-bigquery/network/alerts).
      From 46f7fe013a120fa0e91652a14f75c8305bf51b23 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jul 2023 15:44:54 +0200 Subject: [PATCH 1329/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.18.0 (#2755) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.18.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20b5af17e2..2f72429bd5 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.16.0 + 26.18.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index c23c4bd42b..713d8edaa4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.16.0 + 26.18.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a6e26c0e24..7b8c2fe8ee 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.16.0 + 26.18.0 pom import From ce88123032b305c0103a52462143930f6fd0c65d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Jul 2023 19:33:02 +0200 Subject: [PATCH 1330/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.40.1 (#2799) * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.40.0 * chore: Manually updating to 2.40.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a3139f36e..cecfda78a0 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.39.1 + 2.40.1 pom import From abc0ddf703245f7da5864c5fccc92382c67c206b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:47:06 -0400 Subject: [PATCH 1331/2268] chore(main): release 2.30.1 (#2798) * chore(main): release 2.30.1 * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.40.1 (#2799) * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.40.0 * chore: Manually updating to 2.40.1 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Mend Renovate --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ff8aebbf3..1b03b37d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.30.1](https://github.com/googleapis/java-bigquery/compare/v2.30.0...v2.30.1) (2023-07-18) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.23.0 ([#2791](https://github.com/googleapis/java-bigquery/issues/2791)) ([940301b](https://github.com/googleapis/java-bigquery/commit/940301b327bf941cfab56d68759b6f1494fda22f)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.27.0 ([#2792](https://github.com/googleapis/java-bigquery/issues/2792)) ([c791066](https://github.com/googleapis/java-bigquery/commit/c79106678a0ac62b34605f19ca2baea296ea531c)) + ## [2.30.0](https://github.com/googleapis/java-bigquery/compare/v2.29.0...v2.30.0) (2023-07-17) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1c7041f90d..52cba8543e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.30.1-SNAPSHOT + 2.30.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index daed8ee450..ec846bb21d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.30.1-SNAPSHOT + 2.30.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.30.1-SNAPSHOT + 2.30.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cecfda78a0..744526dab7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.30.1-SNAPSHOT + 2.30.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.30.1-SNAPSHOT + 2.30.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 550696217b..35cde3b51f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.30.1-SNAPSHOT + 2.30.1 diff --git a/versions.txt b/versions.txt index 3d3faa27f4..117674a6ed 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.30.0:2.30.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.30.1:2.30.1 \ No newline at end of file From 67a07ea45c4635a2e9d43220d4bc34780eb512ef Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Mon, 24 Jul 2023 11:24:11 -0400 Subject: [PATCH 1332/2268] feat: adds Exception handling to handle ALREADY EXISTS error (#2788) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: adds Exception handling to handle ALREADy EXISTS error * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: add more conditions * chore: format * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: don't ad extra dependency * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * nit * 🦉 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 --- README.md | 8 ++--- .../google/cloud/bigquery/BigQueryImpl.java | 35 ++++++++++++++++--- .../cloud/bigquery/it/ITBigQueryTest.java | 28 +++++++++++++++ 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2f72429bd5..2fa3805989 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.18.0') +implementation platform('com.google.cloud:libraries-bom:26.19.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.30.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.30.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.30.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.30.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.30.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.30.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index d1bbcb5e2c..ef7e8cb8b8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -55,7 +55,11 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Callable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.checkerframework.checker.nullness.qual.NonNull; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; final class BigQueryImpl extends BaseService implements BigQuery { @@ -422,15 +426,38 @@ public com.google.api.services.bigquery.model.Job call() { } if (!idRandom) { + if (createException instanceof BigQueryException && createException.getCause() != null) { + + /*GoogleJsonResponseException createExceptionCause = + (GoogleJsonResponseException) createException.getCause();*/ + + Pattern pattern = Pattern.compile(".*Already.*Exists:.*Job.*", Pattern.CASE_INSENSITIVE); + Matcher matcher = pattern.matcher(createException.getCause().getMessage()); + + if (matcher.find()) { + // If the Job ALREADY EXISTS, retrieve it. + Job job = this.getJob(jobInfo.getJobId()); + + long jobCreationTime = job.getStatistics().getCreationTime(); + long jobMinStaleTime = System.currentTimeMillis(); + long jobMaxStaleTime = + Instant.ofEpochMilli(jobMinStaleTime).minus(1, ChronoUnit.DAYS).toEpochMilli(); + + // Only return the job if it has been created in the past 24 hours. + // This is assuming any job older than 24 hours is a valid duplicate JobID + // and not a false positive like b/290419183 + if (jobCreationTime >= jobMaxStaleTime && jobCreationTime <= jobMinStaleTime) { + return job; + } + } + } throw createException; } // If create RPC fails, it's still possible that the job has been successfully - // created, - // and get might work. + // created, and get might work. // We can only do this if we randomly generated the ID. Otherwise we might - // mistakenly - // fetch a job created by someone else. + // mistakenly fetch a job created by someone else. Job job; try { job = getJob(finalJobId[0]); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 97db5fc203..8c5742e57d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -83,6 +83,7 @@ import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.InsertAllResponse; import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobConfiguration; import com.google.cloud.bigquery.JobId; import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; @@ -6101,4 +6102,31 @@ public void testForeignKeysUpdate() { bigquery.delete(tableIdPk2); } } + + @Test + public void testAlreadyExistJobExceptionHandling() throws InterruptedException { + String query = + "SELECT TimestampField, StringField, BooleanField FROM " + + DATASET + + "." + + TABLE_ID.getTable(); + JobId jobId = JobId.newBuilder().setRandomJob().build(); + + JobConfiguration queryJobConfiguration = QueryJobConfiguration.newBuilder(query).build(); + // Creating the job with the explicit jobID + bigquery.create(JobInfo.of(jobId, queryJobConfiguration)); + // Calling the query method with the job that has already been created. + // This should throw ALREADY_EXISTS error without the exception handling added + // or if the job is older than 24 hours. + try { + bigquery.query(QueryJobConfiguration.newBuilder(query).build(), jobId); + // Test succeeds if Exception is not thrown and code flow reaches this statement. + assertTrue(true); + } catch (BigQueryException ex) { + // test fails if an exception is thrown + if (ex.getCause() != null && ex.getCause().getMessage().contains("Already Exists: Job")) { + fail("Already exists error should not be thrown"); + } + } + } } From 983811cef9d4ea8078c04dfbb021787b1df6bad8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 17:42:58 +0200 Subject: [PATCH 1333/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.7 (#2804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.7 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 744526dab7..357cf0f45e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.6 + 1.5.7 From 694f7111d7497126d429c5dda17f44f661279582 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 20:48:14 +0200 Subject: [PATCH 1334/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 (#2808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.junit.vintage:junit-vintage-engine](https://junit.org/junit5/) ([source](https://togithub.com/junit-team/junit5)) | `5.9.3` -> `5.10.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.junit.vintage:junit-vintage-engine/5.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.junit.vintage:junit-vintage-engine/5.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.junit.vintage:junit-vintage-engine/5.9.3/5.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.junit.vintage:junit-vintage-engine/5.9.3/5.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 713d8edaa4..ba4d6785d4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.9.3 + 5.10.0 test From 145ab78a407181316b7a0b523eed40db6f6054fd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 21:15:18 +0200 Subject: [PATCH 1335/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.19.0 (#2802) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.19.0 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2fa3805989..8e55bbc0e2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.18.0 + 26.19.0 pom import diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index ba4d6785d4..aecdd1fc40 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.18.0 + 26.19.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7b8c2fe8ee..122f020c0c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.18.0 + 26.19.0 pom import From 75e9a740c36ab56f990b3b517dd5f60713ae3f78 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 21:32:23 +0200 Subject: [PATCH 1336/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.30.1 (#2801) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.30.0` -> `2.30.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.30.0/2.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.30.0/2.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.30.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2301-2023-07-18) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.30.0...v2.30.1) ##### Dependencies - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.23.0 ([#​2791](https://togithub.com/googleapis/java-bigquery/issues/2791)) ([940301b](https://togithub.com/googleapis/java-bigquery/commit/940301b327bf941cfab56d68759b6f1494fda22f)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.27.0 ([#​2792](https://togithub.com/googleapis/java-bigquery/issues/2792)) ([c791066](https://togithub.com/googleapis/java-bigquery/commit/c79106678a0ac62b34605f19ca2baea296ea531c))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e55bbc0e2..cb57585f86 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.30.0 + 2.30.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d4b485f0bf..d43ec90424 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.30.0 + 2.30.1 From b6600635e01f930fa19769cb2594ef4f43226124 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 21:36:18 +0200 Subject: [PATCH 1337/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.24.0 (#2811) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.23.0` -> `2.24.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.23.0/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.23.0/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 357cf0f45e..9cc7df4f0c 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.23.0 + 2.24.0 test From 1fde4a34bdb437488c0efbc4ac7d6ac972eff6fd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 21:36:23 +0200 Subject: [PATCH 1338/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.24.0 (#2810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.23.0` -> `2.24.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigqueryconnection/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigqueryconnection/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigqueryconnection/2.23.0/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigqueryconnection/2.23.0/2.24.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9cc7df4f0c..c19a5a65a0 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.23.0 + 2.24.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d43ec90424..abf4a5e167 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.23.0 + 2.24.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 35cde3b51f..f75696fd93 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.23.0 + 2.24.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 122f020c0c..4c84ed02d3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.23.0 + 2.24.0 test From df3cd761b5111bb0f174f691765697aa1bcbebde Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 21:38:17 +0200 Subject: [PATCH 1339/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 (#2806) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/sdk-platform-java) | `3.13.0` -> `3.13.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-shared-dependencies/3.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-shared-dependencies/3.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-shared-dependencies/3.13.0/3.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-shared-dependencies/3.13.0/3.13.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c19a5a65a0..8f0977b5b3 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230520-2.0.0 - 3.13.0 + 3.13.1 12.0.0
      From adadabeb76bae710de38d83e5e1f0a689dde41ba Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 20:34:18 +0000 Subject: [PATCH 1340/2268] chore: update requirements.txt to address dependabot security alerts (#1829) (#2809) * chore: update dependencies in requirements.txt to address dependabot security alerts * update dependencies within gcp/templates --------- Co-authored-by: Anthonios Partheniou Source-Link: https://togithub.com/googleapis/synthtool/commit/af76aa51249c5f6d8efb66e8ac390ec651f9f2f6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:46d2d262cd285c638656c8bde468011b723dc0c7ffd6a5ecc2650fe639c82e8f --- .github/.OwlBot.lock.yaml | 4 +- .kokoro/requirements.txt | 573 ++++++++++++++++++++++---------------- 2 files changed, 332 insertions(+), 245 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 258389d1aa..d5500ef442 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:31c8276a1bfb43766597d32645721c029cb94571f1b8d996cb2c290744fe52f9 -# created: 2023-06-27T18:51:58.922150125Z + digest: sha256:46d2d262cd285c638656c8bde468011b723dc0c7ffd6a5ecc2650fe639c82e8f +# created: 2023-07-24T14:21:17.707234503Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index c80f0a87cc..32989051e7 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,20 +1,20 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --allow-unsafe --generate-hashes requirements.in +# pip-compile requirements.in --generate-hashes --upgrade # -attrs==22.1.0 \ - --hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \ - --hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c +attrs==23.1.0 \ + --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ + --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 # via gcp-releasetool -cachetools==4.2.4 \ - --hash=sha256:89ea6f1b638d5a73a4f9226be57ac5e4f399d22770b92355f92dcb0f7f001693 \ - --hash=sha256:92971d3cb7d2a97efff7c7bb1657f21a8f5fb309a37530537c71b1774189f2d1 +cachetools==5.3.1 \ + --hash=sha256:95ef631eeaea14ba2e36f06437f36463aac3a096799e876ee55e5cdccb102590 \ + --hash=sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b # via google-auth -certifi==2022.12.7 \ - --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ - --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 +certifi==2023.5.7 \ + --hash=sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7 \ + --hash=sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716 # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ @@ -82,9 +82,82 @@ cffi==1.15.1 \ --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 # via cryptography -charset-normalizer==2.0.12 \ - --hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \ - --hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df +charset-normalizer==3.2.0 \ + --hash=sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96 \ + --hash=sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c \ + --hash=sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710 \ + --hash=sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706 \ + --hash=sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020 \ + --hash=sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252 \ + --hash=sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad \ + --hash=sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329 \ + --hash=sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a \ + --hash=sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f \ + --hash=sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6 \ + --hash=sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4 \ + --hash=sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a \ + --hash=sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46 \ + --hash=sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2 \ + --hash=sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23 \ + --hash=sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace \ + --hash=sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd \ + --hash=sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982 \ + --hash=sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10 \ + --hash=sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2 \ + --hash=sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea \ + --hash=sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09 \ + --hash=sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5 \ + --hash=sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149 \ + --hash=sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489 \ + --hash=sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9 \ + --hash=sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80 \ + --hash=sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592 \ + --hash=sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3 \ + --hash=sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6 \ + --hash=sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed \ + --hash=sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c \ + --hash=sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200 \ + --hash=sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a \ + --hash=sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e \ + --hash=sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d \ + --hash=sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6 \ + --hash=sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623 \ + --hash=sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669 \ + --hash=sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3 \ + --hash=sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa \ + --hash=sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9 \ + --hash=sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2 \ + --hash=sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f \ + --hash=sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1 \ + --hash=sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4 \ + --hash=sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a \ + --hash=sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8 \ + --hash=sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3 \ + --hash=sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029 \ + --hash=sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f \ + --hash=sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959 \ + --hash=sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22 \ + --hash=sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7 \ + --hash=sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952 \ + --hash=sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346 \ + --hash=sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e \ + --hash=sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d \ + --hash=sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299 \ + --hash=sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd \ + --hash=sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a \ + --hash=sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3 \ + --hash=sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037 \ + --hash=sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94 \ + --hash=sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c \ + --hash=sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858 \ + --hash=sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a \ + --hash=sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449 \ + --hash=sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c \ + --hash=sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918 \ + --hash=sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1 \ + --hash=sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c \ + --hash=sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac \ + --hash=sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa # via requests click==8.0.4 \ --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ @@ -97,121 +170,152 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==39.0.1 \ - --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ - --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ - --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ - --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ - --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ - --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ - --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ - --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ - --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ - --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ - --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ - --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ - --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ - --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ - --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ - --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ - --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ - --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ - --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ - --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ - --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 +cryptography==41.0.2 \ + --hash=sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711 \ + --hash=sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7 \ + --hash=sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd \ + --hash=sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e \ + --hash=sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58 \ + --hash=sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0 \ + --hash=sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d \ + --hash=sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83 \ + --hash=sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831 \ + --hash=sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766 \ + --hash=sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b \ + --hash=sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c \ + --hash=sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182 \ + --hash=sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f \ + --hash=sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa \ + --hash=sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4 \ + --hash=sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a \ + --hash=sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2 \ + --hash=sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76 \ + --hash=sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5 \ + --hash=sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee \ + --hash=sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f \ + --hash=sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14 # via # gcp-releasetool # secretstorage -gcp-docuploader==0.6.4 \ - --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ - --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf +gcp-docuploader==0.6.5 \ + --hash=sha256:30221d4ac3e5a2b9c69aa52fdbef68cc3f27d0e6d0d90e220fc024584b8d2318 \ + --hash=sha256:b7458ef93f605b9d46a4bf3a8dc1755dad1f31d030c8679edf304e343b347eea # via -r requirements.in -gcp-releasetool==1.10.5 \ - --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ - --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 +gcp-releasetool==1.16.0 \ + --hash=sha256:27bf19d2e87aaa884096ff941aa3c592c482be3d6a2bfe6f06afafa6af2353e3 \ + --hash=sha256:a316b197a543fd036209d0caba7a8eb4d236d8e65381c80cbc6d7efaa7606d63 # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 +google-api-core==2.11.1 \ + --hash=sha256:25d29e05a0058ed5f19c61c0a78b1b53adea4d9364b464d014fbda941f6d1c9a \ + --hash=sha256:d92a5a92dc36dd4f4b9ee4e55528a90e432b059f93aee6ad857f9de8cc7ae94a # via # google-cloud-core # google-cloud-storage -google-auth==2.14.1 \ - --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ - --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 +google-auth==2.22.0 \ + --hash=sha256:164cba9af4e6e4e40c3a4f90a1a6c12ee56f14c0b4868d1ca91b32826ab334ce \ + --hash=sha256:d61d1b40897407b574da67da1a833bdc10d5a11642566e506565d1b1a46ba873 # via # gcp-releasetool # google-api-core # google-cloud-core # google-cloud-storage -google-cloud-core==2.3.1 \ - --hash=sha256:113ba4f492467d5bd442c8d724c1a25ad7384045c3178369038840ecdd19346c \ - --hash=sha256:34334359cb04187bdc80ddcf613e462dfd7a3aabbc3fe4d118517ab4b9303d53 +google-cloud-core==2.3.3 \ + --hash=sha256:37b80273c8d7eee1ae816b3a20ae43585ea50506cb0e60f3cf5be5f87f1373cb \ + --hash=sha256:fbd11cad3e98a7e5b0343dc07cb1039a5ffd7a5bb96e1f1e27cee4bda4a90863 # via google-cloud-storage -google-cloud-storage==2.0.0 \ - --hash=sha256:a57a15aead0f9dfbd4381f1bfdbe8bf89818a4bd75bab846cafcefb2db846c47 \ - --hash=sha256:ec4be60bb223a3a960f0d01697d849b86d91cad815a84915a32ed3635e93a5e7 +google-cloud-storage==2.10.0 \ + --hash=sha256:934b31ead5f3994e5360f9ff5750982c5b6b11604dc072bc452c25965e076dc7 \ + --hash=sha256:9433cf28801671de1c80434238fb1e7e4a1ba3087470e90f70c928ea77c2b9d7 # via gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 +google-crc32c==1.5.0 \ + --hash=sha256:024894d9d3cfbc5943f8f230e23950cd4906b2fe004c72e29b209420a1e6b05a \ + --hash=sha256:02c65b9817512edc6a4ae7c7e987fea799d2e0ee40c53ec573a692bee24de876 \ + --hash=sha256:02ebb8bf46c13e36998aeaad1de9b48f4caf545e91d14041270d9dca767b780c \ + --hash=sha256:07eb3c611ce363c51a933bf6bd7f8e3878a51d124acfc89452a75120bc436289 \ + --hash=sha256:1034d91442ead5a95b5aaef90dbfaca8633b0247d1e41621d1e9f9db88c36298 \ + --hash=sha256:116a7c3c616dd14a3de8c64a965828b197e5f2d121fedd2f8c5585c547e87b02 \ + --hash=sha256:19e0a019d2c4dcc5e598cd4a4bc7b008546b0358bd322537c74ad47a5386884f \ + --hash=sha256:1c7abdac90433b09bad6c43a43af253e688c9cfc1c86d332aed13f9a7c7f65e2 \ + --hash=sha256:1e986b206dae4476f41bcec1faa057851f3889503a70e1bdb2378d406223994a \ + --hash=sha256:272d3892a1e1a2dbc39cc5cde96834c236d5327e2122d3aaa19f6614531bb6eb \ + --hash=sha256:278d2ed7c16cfc075c91378c4f47924c0625f5fc84b2d50d921b18b7975bd210 \ + --hash=sha256:2ad40e31093a4af319dadf503b2467ccdc8f67c72e4bcba97f8c10cb078207b5 \ + --hash=sha256:2e920d506ec85eb4ba50cd4228c2bec05642894d4c73c59b3a2fe20346bd00ee \ + --hash=sha256:3359fc442a743e870f4588fcf5dcbc1bf929df1fad8fb9905cd94e5edb02e84c \ + --hash=sha256:37933ec6e693e51a5b07505bd05de57eee12f3e8c32b07da7e73669398e6630a \ + --hash=sha256:398af5e3ba9cf768787eef45c803ff9614cc3e22a5b2f7d7ae116df8b11e3314 \ + --hash=sha256:3b747a674c20a67343cb61d43fdd9207ce5da6a99f629c6e2541aa0e89215bcd \ + --hash=sha256:461665ff58895f508e2866824a47bdee72497b091c730071f2b7575d5762ab65 \ + --hash=sha256:4c6fdd4fccbec90cc8a01fc00773fcd5fa28db683c116ee3cb35cd5da9ef6c37 \ + --hash=sha256:5829b792bf5822fd0a6f6eb34c5f81dd074f01d570ed7f36aa101d6fc7a0a6e4 \ + --hash=sha256:596d1f98fc70232fcb6590c439f43b350cb762fb5d61ce7b0e9db4539654cc13 \ + --hash=sha256:5ae44e10a8e3407dbe138984f21e536583f2bba1be9491239f942c2464ac0894 \ + --hash=sha256:635f5d4dd18758a1fbd1049a8e8d2fee4ffed124462d837d1a02a0e009c3ab31 \ + --hash=sha256:64e52e2b3970bd891309c113b54cf0e4384762c934d5ae56e283f9a0afcd953e \ + --hash=sha256:66741ef4ee08ea0b2cc3c86916ab66b6aef03768525627fd6a1b34968b4e3709 \ + --hash=sha256:67b741654b851abafb7bc625b6d1cdd520a379074e64b6a128e3b688c3c04740 \ + --hash=sha256:6ac08d24c1f16bd2bf5eca8eaf8304812f44af5cfe5062006ec676e7e1d50afc \ + --hash=sha256:6f998db4e71b645350b9ac28a2167e6632c239963ca9da411523bb439c5c514d \ + --hash=sha256:72218785ce41b9cfd2fc1d6a017dc1ff7acfc4c17d01053265c41a2c0cc39b8c \ + --hash=sha256:74dea7751d98034887dbd821b7aae3e1d36eda111d6ca36c206c44478035709c \ + --hash=sha256:759ce4851a4bb15ecabae28f4d2e18983c244eddd767f560165563bf9aefbc8d \ + --hash=sha256:77e2fd3057c9d78e225fa0a2160f96b64a824de17840351b26825b0848022906 \ + --hash=sha256:7c074fece789b5034b9b1404a1f8208fc2d4c6ce9decdd16e8220c5a793e6f61 \ + --hash=sha256:7c42c70cd1d362284289c6273adda4c6af8039a8ae12dc451dcd61cdabb8ab57 \ + --hash=sha256:7f57f14606cd1dd0f0de396e1e53824c371e9544a822648cd76c034d209b559c \ + --hash=sha256:83c681c526a3439b5cf94f7420471705bbf96262f49a6fe546a6db5f687a3d4a \ + --hash=sha256:8485b340a6a9e76c62a7dce3c98e5f102c9219f4cfbf896a00cf48caf078d438 \ + --hash=sha256:84e6e8cd997930fc66d5bb4fde61e2b62ba19d62b7abd7a69920406f9ecca946 \ + --hash=sha256:89284716bc6a5a415d4eaa11b1726d2d60a0cd12aadf5439828353662ede9dd7 \ + --hash=sha256:8b87e1a59c38f275c0e3676fc2ab6d59eccecfd460be267ac360cc31f7bcde96 \ + --hash=sha256:8f24ed114432de109aa9fd317278518a5af2d31ac2ea6b952b2f7782b43da091 \ + --hash=sha256:98cb4d057f285bd80d8778ebc4fde6b4d509ac3f331758fb1528b733215443ae \ + --hash=sha256:998679bf62b7fb599d2878aa3ed06b9ce688b8974893e7223c60db155f26bd8d \ + --hash=sha256:9ba053c5f50430a3fcfd36f75aff9caeba0440b2d076afdb79a318d6ca245f88 \ + --hash=sha256:9c99616c853bb585301df6de07ca2cadad344fd1ada6d62bb30aec05219c45d2 \ + --hash=sha256:a1fd716e7a01f8e717490fbe2e431d2905ab8aa598b9b12f8d10abebb36b04dd \ + --hash=sha256:a2355cba1f4ad8b6988a4ca3feed5bff33f6af2d7f134852cf279c2aebfde541 \ + --hash=sha256:b1f8133c9a275df5613a451e73f36c2aea4fe13c5c8997e22cf355ebd7bd0728 \ + --hash=sha256:b8667b48e7a7ef66afba2c81e1094ef526388d35b873966d8a9a447974ed9178 \ + --hash=sha256:ba1eb1843304b1e5537e1fca632fa894d6f6deca8d6389636ee5b4797affb968 \ + --hash=sha256:be82c3c8cfb15b30f36768797a640e800513793d6ae1724aaaafe5bf86f8f346 \ + --hash=sha256:c02ec1c5856179f171e032a31d6f8bf84e5a75c45c33b2e20a3de353b266ebd8 \ + --hash=sha256:c672d99a345849301784604bfeaeba4db0c7aae50b95be04dd651fd2a7310b93 \ + --hash=sha256:c6c777a480337ac14f38564ac88ae82d4cd238bf293f0a22295b66eb89ffced7 \ + --hash=sha256:cae0274952c079886567f3f4f685bcaf5708f0a23a5f5216fdab71f81a6c0273 \ + --hash=sha256:cd67cf24a553339d5062eff51013780a00d6f97a39ca062781d06b3a73b15462 \ + --hash=sha256:d3515f198eaa2f0ed49f8819d5732d70698c3fa37384146079b3799b97667a94 \ + --hash=sha256:d5280312b9af0976231f9e317c20e4a61cd2f9629b7bfea6a693d1878a264ebd \ + --hash=sha256:de06adc872bcd8c2a4e0dc51250e9e65ef2ca91be023b9d13ebd67c2ba552e1e \ + --hash=sha256:e1674e4307fa3024fc897ca774e9c7562c957af85df55efe2988ed9056dc4e57 \ + --hash=sha256:e2096eddb4e7c7bdae4bd69ad364e55e07b8316653234a56552d9c988bd2d61b \ + --hash=sha256:e560628513ed34759456a416bf86b54b2476c59144a9138165c9a1575801d0d9 \ + --hash=sha256:edfedb64740750e1a3b16152620220f51d58ff1b4abceb339ca92e934775c27a \ + --hash=sha256:f13cae8cc389a440def0c8c52057f37359014ccbc9dc1f0827936bcd367c6100 \ + --hash=sha256:f314013e7dcd5cf45ab1945d92e713eec788166262ae8deb2cfacd53def27325 \ + --hash=sha256:f583edb943cf2e09c60441b910d6a20b4d9d626c75a36c8fcac01a6c96c01183 \ + --hash=sha256:fd8536e902db7e365f49e7d9029283403974ccf29b13fc7028b97e2295b33556 \ + --hash=sha256:fe70e325aa68fa4b5edf7d1a4b6f691eb04bbccac0ace68e34820d283b5f80d4 # via google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 +google-resumable-media==2.5.0 \ + --hash=sha256:218931e8e2b2a73a58eb354a288e03a0fd5fb1c4583261ac6e4c078666468c93 \ + --hash=sha256:da1bd943e2e114a56d85d6848497ebf9be6a14d3db23e9fc57581e7c3e8170ec # via google-cloud-storage -googleapis-common-protos==1.56.3 \ - --hash=sha256:6f1369b58ed6cf3a4b7054a44ebe8d03b29c309257583a2bbdc064cd1e4a1442 \ - --hash=sha256:87955d7b3a73e6e803f2572a33179de23989ebba725e05ea42f24838b792e461 +googleapis-common-protos==1.59.1 \ + --hash=sha256:0cbedb6fb68f1c07e18eb4c48256320777707e7d0c55063ae56c15db3224a61e \ + --hash=sha256:b35d530fe825fb4227857bc47ad84c33c809ac96f312e13182bdeaa2abe1178a # via google-api-core idna==3.4 \ --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 # via requests -importlib-metadata==4.8.3 \ - --hash=sha256:65a9576a5b2d58ca44d133c42a241905cc45e34d2c06fd5ba2bafa221e5d7b5e \ - --hash=sha256:766abffff765960fcc18003801f7044eb6755ffae4521c8e8ce8e83b9c9b0668 +importlib-metadata==6.8.0 \ + --hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \ + --hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743 + # via keyring +jaraco-classes==3.3.0 \ + --hash=sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb \ + --hash=sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621 # via keyring jeepney==0.8.0 \ --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ @@ -219,139 +323,119 @@ jeepney==0.8.0 \ # via # keyring # secretstorage -jinja2==3.0.3 \ - --hash=sha256:077ce6014f7b40d03b47d1f1ca4b0fc8328a692bd284016f806ed0eaca390ad8 \ - --hash=sha256:611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7 +jinja2==3.1.2 \ + --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ + --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 # via gcp-releasetool -keyring==23.4.1 \ - --hash=sha256:17e49fb0d6883c2b4445359434dba95aad84aabb29bbff044ad0ed7100232eca \ - --hash=sha256:89cbd74d4683ed164c8082fb38619341097741323b3786905c6dac04d6915a55 +keyring==24.2.0 \ + --hash=sha256:4901caaf597bfd3bbd78c9a0c7c4c29fcd8310dab2cffefe749e916b6527acd6 \ + --hash=sha256:ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509 # via gcp-releasetool -markupsafe==2.0.1 \ - --hash=sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298 \ - --hash=sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64 \ - --hash=sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b \ - --hash=sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194 \ - --hash=sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567 \ - --hash=sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff \ - --hash=sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724 \ - --hash=sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74 \ - --hash=sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646 \ - --hash=sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35 \ - --hash=sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6 \ - --hash=sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a \ - --hash=sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6 \ - --hash=sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad \ - --hash=sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26 \ - --hash=sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38 \ - --hash=sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac \ - --hash=sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7 \ - --hash=sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6 \ - --hash=sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047 \ - --hash=sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75 \ - --hash=sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f \ - --hash=sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b \ - --hash=sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135 \ - --hash=sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8 \ - --hash=sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a \ - --hash=sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a \ - --hash=sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1 \ - --hash=sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9 \ - --hash=sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864 \ - --hash=sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914 \ - --hash=sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee \ - --hash=sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f \ - --hash=sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18 \ - --hash=sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8 \ - --hash=sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2 \ - --hash=sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d \ - --hash=sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b \ - --hash=sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b \ - --hash=sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86 \ - --hash=sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6 \ - --hash=sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f \ - --hash=sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb \ - --hash=sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833 \ - --hash=sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28 \ - --hash=sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e \ - --hash=sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415 \ - --hash=sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902 \ - --hash=sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f \ - --hash=sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d \ - --hash=sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9 \ - --hash=sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d \ - --hash=sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145 \ - --hash=sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066 \ - --hash=sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c \ - --hash=sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1 \ - --hash=sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a \ - --hash=sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207 \ - --hash=sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f \ - --hash=sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53 \ - --hash=sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd \ - --hash=sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134 \ - --hash=sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85 \ - --hash=sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9 \ - --hash=sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5 \ - --hash=sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94 \ - --hash=sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509 \ - --hash=sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51 \ - --hash=sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872 +markupsafe==2.1.3 \ + --hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \ + --hash=sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e \ + --hash=sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431 \ + --hash=sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686 \ + --hash=sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559 \ + --hash=sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc \ + --hash=sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c \ + --hash=sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0 \ + --hash=sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4 \ + --hash=sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9 \ + --hash=sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575 \ + --hash=sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba \ + --hash=sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d \ + --hash=sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3 \ + --hash=sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00 \ + --hash=sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155 \ + --hash=sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac \ + --hash=sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52 \ + --hash=sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f \ + --hash=sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8 \ + --hash=sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b \ + --hash=sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24 \ + --hash=sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea \ + --hash=sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198 \ + --hash=sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0 \ + --hash=sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee \ + --hash=sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be \ + --hash=sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2 \ + --hash=sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707 \ + --hash=sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6 \ + --hash=sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58 \ + --hash=sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779 \ + --hash=sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636 \ + --hash=sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c \ + --hash=sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad \ + --hash=sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee \ + --hash=sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc \ + --hash=sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2 \ + --hash=sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48 \ + --hash=sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7 \ + --hash=sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e \ + --hash=sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b \ + --hash=sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa \ + --hash=sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5 \ + --hash=sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e \ + --hash=sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb \ + --hash=sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9 \ + --hash=sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57 \ + --hash=sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc \ + --hash=sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2 # via jinja2 -packaging==21.3 \ - --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ - --hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522 +more-itertools==9.1.0 \ + --hash=sha256:cabaa341ad0389ea83c17a94566a53ae4c9d07349861ecb14dc6d0345cf9ac5d \ + --hash=sha256:d2bc7f02446e86a68911e58ded76d6561eea00cddfb2a91e7019bbb586c799f3 + # via jaraco-classes +packaging==23.1 \ + --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ + --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f # via gcp-releasetool -protobuf==3.20.2 \ - --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ - --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ - --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ - --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ - --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ - --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ - --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ - --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ - --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ - --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ - --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ - --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ - --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ - --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ - --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ - --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ - --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ - --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ - --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ - --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ - --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ - --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 +protobuf==3.20.3 \ + --hash=sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7 \ + --hash=sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c \ + --hash=sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2 \ + --hash=sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b \ + --hash=sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050 \ + --hash=sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9 \ + --hash=sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7 \ + --hash=sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454 \ + --hash=sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480 \ + --hash=sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469 \ + --hash=sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c \ + --hash=sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e \ + --hash=sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db \ + --hash=sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905 \ + --hash=sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b \ + --hash=sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86 \ + --hash=sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4 \ + --hash=sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402 \ + --hash=sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7 \ + --hash=sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4 \ + --hash=sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99 \ + --hash=sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee # via # gcp-docuploader # gcp-releasetool # google-api-core - # google-cloud-storage -pyasn1==0.4.8 \ - --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ - --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba +pyasn1==0.5.0 \ + --hash=sha256:87a2121042a1ac9358cabcaf1d07680ff97ee6404333bacca15f76aa8ad01a57 \ + --hash=sha256:97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde # via # pyasn1-modules # rsa -pyasn1-modules==0.2.8 \ - --hash=sha256:905f84c712230b2c592c19470d3ca8d552de726050d1d1716282a1f6146be65e \ - --hash=sha256:a50b808ffeb97cb3601dd25981f6b016cbb3d31fbf57a8b8a87428e6158d0c74 +pyasn1-modules==0.3.0 \ + --hash=sha256:5bd01446b736eb9d31512a30d46c1ac3395d676c6f3cafa4c03eb54b9925631c \ + --hash=sha256:d3ccd6ed470d9ffbc716be08bd90efbd44d0734bc9303818f7336070984a162d # via google-auth pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 # via cffi -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba +pyjwt==2.7.0 \ + --hash=sha256:ba2b425b15ad5ef12f200dc67dd56af4e26de2331f965c5439994dad075876e1 \ + --hash=sha256:bd6ca4a3c4285c1a2d4349e5a035fdf8fb94e04ccd0fcbe6ba289dae9cc3e074 # via gcp-releasetool -pyparsing==3.0.9 \ - --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ - --hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc - # via packaging pyperclip==1.8.2 \ --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 # via gcp-releasetool @@ -359,9 +443,9 @@ python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 # via gcp-releasetool -requests==2.27.1 \ - --hash=sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61 \ - --hash=sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d +requests==2.31.0 \ + --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ + --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 # via # gcp-releasetool # google-api-core @@ -374,10 +458,6 @@ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring -setuptools==67.3.2 \ - --hash=sha256:95f00380ef2ffa41d9bba85d95b27689d923c93dfbafed4aecd7cf988a25e012 \ - --hash=sha256:bb6d8e508de562768f2027902929f8523932fcd1fb784e6d573d2cafac995a48 - # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 @@ -385,19 +465,26 @@ six==1.16.0 \ # gcp-docuploader # google-auth # python-dateutil -typing-extensions==4.4.0 \ - --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ - --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e +typing-extensions==4.7.1 \ + --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ + --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 - # via requests -wheel==0.38.4 \ - --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ - --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 +urllib3==1.26.16 \ + --hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \ + --hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14 + # via + # google-auth + # requests +wheel==0.40.0 \ + --hash=sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873 \ + --hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247 # via -r requirements.in -zipp==3.6.0 \ - --hash=sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832 \ - --hash=sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc +zipp==3.16.1 \ + --hash=sha256:0b37c326d826d5ca35f2b9685cd750292740774ef16190008b00a0227c256fe0 \ + --hash=sha256:857b158da2cbf427b376da1c24fd11faecbac5a4ac7523c3607f8a01f94c2ec0 # via importlib-metadata + +# WARNING: The following packages were not pinned, but pip requires them to be +# pinned when the requirements file includes hashes and the requirement is not +# satisfied by a package already installed. Consider using the --allow-unsafe flag. +# setuptools From f92bee558f6de070fb9f525bb47a824dc2c53e07 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 22:46:18 +0200 Subject: [PATCH 1341/2268] deps: update arrow.version to v12.0.1 (#2750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.arrow:arrow-memory-netty](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `12.0.0` -> `12.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.apache.arrow:arrow-memory-netty/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.apache.arrow:arrow-memory-netty/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.apache.arrow:arrow-memory-netty/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.apache.arrow:arrow-memory-netty/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-memory-core](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `12.0.0` -> `12.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.apache.arrow:arrow-memory-core/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.apache.arrow:arrow-memory-core/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.apache.arrow:arrow-memory-core/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.apache.arrow:arrow-memory-core/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [org.apache.arrow:arrow-vector](https://arrow.apache.org/) ([source](https://togithub.com/apache/arrow)) | `12.0.0` -> `12.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.apache.arrow:arrow-vector/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.apache.arrow:arrow-vector/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.apache.arrow:arrow-vector/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.apache.arrow:arrow-vector/12.0.0/12.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8f0977b5b3..64f02e7e52 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ google-cloud-bigquery-parent v2-rev20230520-2.0.0 3.13.1 - 12.0.0 + 12.0.1
      From d2de9e3c674a9b962c10bd004576c9ce839bb455 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 23:18:56 +0200 Subject: [PATCH 1342/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.25.0 (#2813) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64f02e7e52..b569b5dcc8 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.24.0 + 2.25.0 test From 921716d54ea34f1914d16f7774124175be488087 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Jul 2023 23:19:13 +0200 Subject: [PATCH 1343/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.28.0 (#2812) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b569b5dcc8..faed9d33bb 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.27.0 + 1.28.0 pom import From 4d23c4093a8737c4f9337880d7929ab6324083d0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jul 2023 16:02:20 +0200 Subject: [PATCH 1344/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.41.0 (#2814) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index faed9d33bb..4d5b1cca8f 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.40.1 + 2.41.0 pom import From c6c536c618908425f288fa0e6f516df2cc6a4b97 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jul 2023 16:02:56 +0200 Subject: [PATCH 1345/2268] deps: update github/codeql-action action to v2.21.0 (#2803) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.21.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1d53ee053b..3e529afd10 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@489225d82a57396c6f426a40e66d461b16b3461d # v2.20.4 + uses: github/codeql-action/upload-sarif@1813ca74c3faaa3a2da2070b9b8a0b3e7373a0d8 # v2.21.0 with: sarif_file: results.sarif From c0b01e994c1b7f2c65e6093646849c9fc59bd720 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:12:13 +0000 Subject: [PATCH 1346/2268] chore(main): release 2.30.2-SNAPSHOT (#2800) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 52cba8543e..3202012d7f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.30.1 + 2.30.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ec846bb21d..6ed268cfe5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.30.1 + 2.30.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.30.1 + 2.30.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4d5b1cca8f..699eef3d52 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.30.1 + 2.30.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.30.1 + 2.30.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f75696fd93..9dd5e80712 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.30.1 + 2.30.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 117674a6ed..45991e09dd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.30.1:2.30.1 \ No newline at end of file +google-cloud-bigquery:2.30.1:2.30.2-SNAPSHOT \ No newline at end of file From 3092c244ccb72ecee21bb4bb3b466255a1b4f21a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:54:15 +0000 Subject: [PATCH 1347/2268] chore(main): release 2.31.0 (#2815) :robot: I have created a release *beep* *boop* --- ## [2.31.0](https://togithub.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) (2023-07-25) ### Features * Adds Exception handling to handle ALREADY EXISTS error ([#2788](https://togithub.com/googleapis/java-bigquery/issues/2788)) ([67a07ea](https://togithub.com/googleapis/java-bigquery/commit/67a07ea45c4635a2e9d43220d4bc34780eb512ef)) ### Dependencies * Update arrow.version to v12.0.1 ([#2750](https://togithub.com/googleapis/java-bigquery/issues/2750)) ([f92bee5](https://togithub.com/googleapis/java-bigquery/commit/f92bee558f6de070fb9f525bb47a824dc2c53e07)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.24.0 ([#2811](https://togithub.com/googleapis/java-bigquery/issues/2811)) ([b660063](https://togithub.com/googleapis/java-bigquery/commit/b6600635e01f930fa19769cb2594ef4f43226124)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.28.0 ([#2812](https://togithub.com/googleapis/java-bigquery/issues/2812)) ([921716d](https://togithub.com/googleapis/java-bigquery/commit/921716d54ea34f1914d16f7774124175be488087)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 ([#2806](https://togithub.com/googleapis/java-bigquery/issues/2806)) ([df3cd76](https://togithub.com/googleapis/java-bigquery/commit/df3cd761b5111bb0f174f691765697aa1bcbebde)) * Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#2808](https://togithub.com/googleapis/java-bigquery/issues/2808)) ([694f711](https://togithub.com/googleapis/java-bigquery/commit/694f7111d7497126d429c5dda17f44f661279582)) * Update github/codeql-action action to v2.21.0 ([#2803](https://togithub.com/googleapis/java-bigquery/issues/2803)) ([c6c536c](https://togithub.com/googleapis/java-bigquery/commit/c6c536c618908425f288fa0e6f516df2cc6a4b97)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b03b37d71..4cd11b1732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.31.0](https://github.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) (2023-07-25) + + +### Features + +* Adds Exception handling to handle ALREADY EXISTS error ([#2788](https://github.com/googleapis/java-bigquery/issues/2788)) ([67a07ea](https://github.com/googleapis/java-bigquery/commit/67a07ea45c4635a2e9d43220d4bc34780eb512ef)) + + +### Dependencies + +* Update arrow.version to v12.0.1 ([#2750](https://github.com/googleapis/java-bigquery/issues/2750)) ([f92bee5](https://github.com/googleapis/java-bigquery/commit/f92bee558f6de070fb9f525bb47a824dc2c53e07)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.24.0 ([#2811](https://github.com/googleapis/java-bigquery/issues/2811)) ([b660063](https://github.com/googleapis/java-bigquery/commit/b6600635e01f930fa19769cb2594ef4f43226124)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.28.0 ([#2812](https://github.com/googleapis/java-bigquery/issues/2812)) ([921716d](https://github.com/googleapis/java-bigquery/commit/921716d54ea34f1914d16f7774124175be488087)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 ([#2806](https://github.com/googleapis/java-bigquery/issues/2806)) ([df3cd76](https://github.com/googleapis/java-bigquery/commit/df3cd761b5111bb0f174f691765697aa1bcbebde)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#2808](https://github.com/googleapis/java-bigquery/issues/2808)) ([694f711](https://github.com/googleapis/java-bigquery/commit/694f7111d7497126d429c5dda17f44f661279582)) +* Update github/codeql-action action to v2.21.0 ([#2803](https://github.com/googleapis/java-bigquery/issues/2803)) ([c6c536c](https://github.com/googleapis/java-bigquery/commit/c6c536c618908425f288fa0e6f516df2cc6a4b97)) + ## [2.30.1](https://github.com/googleapis/java-bigquery/compare/v2.30.0...v2.30.1) (2023-07-18) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3202012d7f..49f85f3fb3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.30.2-SNAPSHOT + 2.31.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6ed268cfe5..4805f519d0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.30.2-SNAPSHOT + 2.31.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.30.2-SNAPSHOT + 2.31.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 699eef3d52..0dbceabc2f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.30.2-SNAPSHOT + 2.31.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.30.2-SNAPSHOT + 2.31.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9dd5e80712..00705cb2d1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.30.2-SNAPSHOT + 2.31.0 diff --git a/versions.txt b/versions.txt index 45991e09dd..ed5fb17ab4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.30.1:2.30.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.31.0:2.31.0 \ No newline at end of file From 846e9779bf00a4493366617f61a44b5356072ebf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jul 2023 20:52:14 +0200 Subject: [PATCH 1348/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.31.0 (#2819) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.30.1` -> `2.31.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.30.1/2.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.30.1/2.31.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.31.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2310-2023-07-25) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) ##### Features - Adds Exception handling to handle ALREADY EXISTS error ([#​2788](https://togithub.com/googleapis/java-bigquery/issues/2788)) ([67a07ea](https://togithub.com/googleapis/java-bigquery/commit/67a07ea45c4635a2e9d43220d4bc34780eb512ef)) ##### Dependencies - Update arrow.version to v12.0.1 ([#​2750](https://togithub.com/googleapis/java-bigquery/issues/2750)) ([f92bee5](https://togithub.com/googleapis/java-bigquery/commit/f92bee558f6de070fb9f525bb47a824dc2c53e07)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.24.0 ([#​2811](https://togithub.com/googleapis/java-bigquery/issues/2811)) ([b660063](https://togithub.com/googleapis/java-bigquery/commit/b6600635e01f930fa19769cb2594ef4f43226124)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.28.0 ([#​2812](https://togithub.com/googleapis/java-bigquery/issues/2812)) ([921716d](https://togithub.com/googleapis/java-bigquery/commit/921716d54ea34f1914d16f7774124175be488087)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 ([#​2806](https://togithub.com/googleapis/java-bigquery/issues/2806)) ([df3cd76](https://togithub.com/googleapis/java-bigquery/commit/df3cd761b5111bb0f174f691765697aa1bcbebde)) - Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#​2808](https://togithub.com/googleapis/java-bigquery/issues/2808)) ([694f711](https://togithub.com/googleapis/java-bigquery/commit/694f7111d7497126d429c5dda17f44f661279582)) - Update github/codeql-action action to v2.21.0 ([#​2803](https://togithub.com/googleapis/java-bigquery/issues/2803)) ([c6c536c](https://togithub.com/googleapis/java-bigquery/commit/c6c536c618908425f288fa0e6f516df2cc6a4b97))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cb57585f86..7e5fdbab76 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.30.1 + 2.31.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.30.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.31.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.30.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.30.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index abf4a5e167..30790b3d4b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.30.1 + 2.31.0 From eb250a87d99aa370fcee9bf1ee15f579dd012ddf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jul 2023 20:52:28 +0200 Subject: [PATCH 1349/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.25.1 (#2817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.25.0` -> `2.25.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigtable/2.25.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigtable/2.25.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigtable/2.25.0/2.25.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigtable/2.25.0/2.25.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-bigtable (com.google.cloud:google-cloud-bigtable) ### [`v2.25.1`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#2251-2023-07-25) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.25.0...v2.25.1) ##### Bug Fixes - Update the readRow attempt timeouts to be inline with unary rpcs instead of scans ([#​1834](https://togithub.com/googleapis/java-bigtable/issues/1834)) ([168c33e](https://togithub.com/googleapis/java-bigtable/commit/168c33e3135755cc5a1105f18bf93ade5e1219dc)) ##### Dependencies - Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#​1847](https://togithub.com/googleapis/java-bigtable/issues/1847)) ([825faaa](https://togithub.com/googleapis/java-bigtable/commit/825faaad93a5062e6f34ff699cc02701b69e56ab)) - Update shared dependencies ([#​1845](https://togithub.com/googleapis/java-bigtable/issues/1845)) ([88e1892](https://togithub.com/googleapis/java-bigtable/commit/88e18922b4e1da398c51441aff014bca5f3bb746)) - Update the Java code generator (gapic-generator-java) to 2.23.1 ([#​1846](https://togithub.com/googleapis/java-bigtable/issues/1846)) ([78fd837](https://togithub.com/googleapis/java-bigtable/commit/78fd837987780c62137354fbbe41e71050948405))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 30790b3d4b..1f70566b0e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.25.0 + 2.25.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 00705cb2d1..0c1b73ba3c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.25.0 + 2.25.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4c84ed02d3..9cdca8bd5c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.25.0 + 2.25.1 test From 997897166ba121256b7fa6f4c63f83daebdc6a54 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 26 Jul 2023 22:07:20 +0200 Subject: [PATCH 1350/2268] deps: update github/codeql-action action to v2.21.1 (#2824) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3e529afd10..fa10a24734 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1813ca74c3faaa3a2da2070b9b8a0b3e7373a0d8 # v2.21.0 + uses: github/codeql-action/upload-sarif@6ca1aa8c195c3ca3e77c174fe0356db1bce3b319 # v2.21.1 with: sarif_file: results.sarif From a793cc8d99ce2bda79cea03fbc7a51a54317edc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 20:26:13 +0000 Subject: [PATCH 1351/2268] build(deps): bump certifi from 2023.5.7 to 2023.7.22 in /.kokoro (#2816) Bumps [certifi](https://togithub.com/certifi/python-certifi) from 2023.5.7 to 2023.7.22.
      Commits

      [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=certifi&package-manager=pip&previous-version=2023.5.7&new-version=2023.7.22)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
      Dependabot commands and options
      You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://togithub.com/googleapis/java-bigquery/network/alerts).
      From 2586597cab1bfe2478cf0a3e6f88299209190a58 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 31 Jul 2023 17:26:19 +0200 Subject: [PATCH 1352/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.20.0 (#2828) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://cloud.google.com/java/docs/bom) ([source](https://togithub.com/googleapis/java-cloud-bom)) | `26.19.0` -> `26.20.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:libraries-bom/26.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:libraries-bom/26.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:libraries-bom/26.19.0/26.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:libraries-bom/26.19.0/26.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-cloud-bom (com.google.cloud:libraries-bom) ### [`v26.20.0`](https://togithub.com/googleapis/java-cloud-bom/blob/HEAD/CHANGELOG.md#26200-2023-07-27) [Compare Source](https://togithub.com/googleapis/java-cloud-bom/compare/v26.19.0...v26.20.0) ##### Features - add table of modules for a libraries-bom version to README ([#​6083](https://togithub.com/googleapis/java-cloud-bom/issues/6083)) ([c1df19d](https://togithub.com/googleapis/java-cloud-bom/commit/c1df19de42c259b85004f386ca9e25ab9586936d)) ##### Dependencies - update dependency com.google.cloud:first-party-dependencies to v3.13.1 ([#​6102](https://togithub.com/googleapis/java-cloud-bom/issues/6102)) ([9166395](https://togithub.com/googleapis/java-cloud-bom/commit/91663952fd4d6996701428c4297ea974de202a8a)) - update dependency com.google.cloud:gapic-libraries-bom to v1.16.0 ([#​6108](https://togithub.com/googleapis/java-cloud-bom/issues/6108)) ([d503ac0](https://togithub.com/googleapis/java-cloud-bom/commit/d503ac0db80d8bd551a37c0763e42069e14729e2)) - update dependency com.google.cloud:google-cloud-bigquery to v2.31.0 ([#​6121](https://togithub.com/googleapis/java-cloud-bom/issues/6121)) ([3fec4ac](https://togithub.com/googleapis/java-cloud-bom/commit/3fec4ac0c93d722c35d211fe39e080b0679ac895)) - update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.41.0 ([#​6111](https://togithub.com/googleapis/java-cloud-bom/issues/6111)) ([e766185](https://togithub.com/googleapis/java-cloud-bom/commit/e766185490eb8a1230382944e21256d421cc4d52)) - update dependency com.google.cloud:google-cloud-bigtable-bom to v2.25.1 ([#​6116](https://togithub.com/googleapis/java-cloud-bom/issues/6116)) ([295c40d](https://togithub.com/googleapis/java-cloud-bom/commit/295c40ddd31fdb5a8fd9895cc95fa15e53b434eb)) - update dependency com.google.cloud:google-cloud-datastore-bom to v2.16.2 ([#​6112](https://togithub.com/googleapis/java-cloud-bom/issues/6112)) ([7e64cc3](https://togithub.com/googleapis/java-cloud-bom/commit/7e64cc33da2911117118b37214522a649189910e)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.13.6 ([#​6103](https://togithub.com/googleapis/java-cloud-bom/issues/6103)) ([1dd904f](https://togithub.com/googleapis/java-cloud-bom/commit/1dd904fdef347570046e8ecb372d26d9f0995ce9)) - update dependency com.google.cloud:google-cloud-firestore-bom to v3.13.7 ([#​6132](https://togithub.com/googleapis/java-cloud-bom/issues/6132)) ([03466f0](https://togithub.com/googleapis/java-cloud-bom/commit/03466f06143a4de25a824b5053cc34148eb09edc)) - update dependency com.google.cloud:google-cloud-logging-bom to v3.15.7 ([#​6110](https://togithub.com/googleapis/java-cloud-bom/issues/6110)) ([7bdd227](https://togithub.com/googleapis/java-cloud-bom/commit/7bdd22765ebfd22fb0170cfb38c2bb2a2ddc321c)) - update dependency com.google.cloud:google-cloud-logging-logback to v0.130.19-alpha ([#​6118](https://togithub.com/googleapis/java-cloud-bom/issues/6118)) ([86deddd](https://togithub.com/googleapis/java-cloud-bom/commit/86deddd65170f4b4c544baa1ccb31fcfe746093e)) - update dependency com.google.cloud:google-cloud-nio to v0.127.0 ([#​6130](https://togithub.com/googleapis/java-cloud-bom/issues/6130)) ([b9ea753](https://togithub.com/googleapis/java-cloud-bom/commit/b9ea753ab1552a43302bfb53dc1bd4b51f9261f4)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.19 ([#​6119](https://togithub.com/googleapis/java-cloud-bom/issues/6119)) ([421d98c](https://togithub.com/googleapis/java-cloud-bom/commit/421d98ce9c2dd0c76bc42ed3be8c60f8aca61885)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.123.20 ([#​6129](https://togithub.com/googleapis/java-cloud-bom/issues/6129)) ([18c5c70](https://togithub.com/googleapis/java-cloud-bom/commit/18c5c7065e2694ecdb73967972294ffba66afc16)) - update dependency com.google.cloud:google-cloud-pubsub-bom to v1.124.0 ([#​6133](https://togithub.com/googleapis/java-cloud-bom/issues/6133)) ([177ffee](https://togithub.com/googleapis/java-cloud-bom/commit/177ffeebf9b9e2ea4ff020568864618a5b76b558)) - update dependency com.google.cloud:google-cloud-pubsublite-bom to v1.12.12 ([#​6123](https://togithub.com/googleapis/java-cloud-bom/issues/6123)) ([002259c](https://togithub.com/googleapis/java-cloud-bom/commit/002259c4798c0ded47397f33ea0fa5143e8aaded)) - update dependency com.google.cloud:google-cloud-spanner-bom to v6.44.0 ([#​6131](https://togithub.com/googleapis/java-cloud-bom/issues/6131)) ([e43f168](https://togithub.com/googleapis/java-cloud-bom/commit/e43f16842e3bb1e64e2f070bf7132f26abf33b13)) - update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.11.5 ([#​6135](https://togithub.com/googleapis/java-cloud-bom/issues/6135)) ([e601ce8](https://togithub.com/googleapis/java-cloud-bom/commit/e601ce82d1829f56166dd3e5d4288c22503d67dd)) - update dependency com.google.cloud:google-cloud-storage-bom to v2.25.0 ([#​6054](https://togithub.com/googleapis/java-cloud-bom/issues/6054)) ([cf25374](https://togithub.com/googleapis/java-cloud-bom/commit/cf25374148ca9fb48dc6851debfc5186a6cd8472))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/native-image-sample/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index aecdd1fc40..cb48b02c34 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -39,7 +39,7 @@ com.google.cloud libraries-bom - 26.19.0 + 26.20.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9cdca8bd5c..8e218a2ba0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.19.0 + 26.20.0 pom import From 1ae6cb9b20152e00db9a559ff143faca581bf8b1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Aug 2023 17:29:01 +0200 Subject: [PATCH 1353/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 (#2840) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 * 🦉 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 --- README.md | 4 ++-- samples/native-image-sample/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7e5fdbab76..1d99e65b86 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.19.0 + 26.20.0 pom import @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.19.0') +implementation platform('com.google.cloud:libraries-bom:26.21.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index cb48b02c34..034a34cad0 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.23 + 0.9.24 true com.example.bigquery.NativeImageBigquerySample From ae752bc36c516e1a4172bc0c9cfa7ed6bbcbe0e7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Aug 2023 17:29:23 +0200 Subject: [PATCH 1354/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 (#2839) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 034a34cad0..186ea50ab2 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.23 + 0.9.24 test From cff06886b372acecc475d276481ae07ac484a6a8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Aug 2023 17:29:45 +0200 Subject: [PATCH 1355/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.26.0 (#2837) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-storage to v2.26.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0dbceabc2f..655340f737 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.25.0 + 2.26.0 test From 4b3a3c22985c76f7e861341dc76e96abc970eaec Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Aug 2023 17:30:12 +0200 Subject: [PATCH 1356/2268] deps: update jmh.version to v1.37 (#2836) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update jmh.version to v1.37 * 🦉 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 --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 49f85f3fb3..dc6cc9a6df 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.36 + 1.37 benchmark From 79fe14c08836b40bf84775a526cba32f63dd8227 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Aug 2023 17:30:36 +0200 Subject: [PATCH 1357/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 (#2834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 655340f737..a8843c1569 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230520-2.0.0 - 3.13.1 + 3.14.0 12.0.1
      From 246a9dc748c6ad43f3b0ea9671f60e13dc035434 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:57:45 -0400 Subject: [PATCH 1358/2268] chore(main): release 2.31.1-SNAPSHOT (#2818) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dc6cc9a6df..26c3dee284 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.0 + 2.31.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4805f519d0..a0c8932b5b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.0 + 2.31.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.0 + 2.31.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a8843c1569..ab01ea931f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.0 + 2.31.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.0 + 2.31.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0c1b73ba3c..3f56d250bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.0 + 2.31.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index ed5fb17ab4..82a5ef4547 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.0:2.31.0 \ No newline at end of file +google-cloud-bigquery:2.31.0:2.31.1-SNAPSHOT \ No newline at end of file From 9483eea5936281ceab95806ecbaf4a8ffe795467 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Aug 2023 00:51:35 +0200 Subject: [PATCH 1359/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.41.1 (#2843) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ab01ea931f..ef185d2428 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.41.0 + 2.41.1 pom import From 922368430ae5aa6ebc788132c289c4680a7d1f6b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Aug 2023 00:51:55 +0200 Subject: [PATCH 1360/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.25.0 (#2844) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ef185d2428..f996c62de2 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.24.0 + 2.25.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1f70566b0e..5c186115b7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.24.0 + 2.25.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3f56d250bc..7242145322 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.24.0 + 2.25.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8e218a2ba0..080f1e84cf 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.24.0 + 2.25.0 test From 87a0a10d806fdcbf4bdb1ee1478b9ee6aeb7b287 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Aug 2023 02:24:00 +0200 Subject: [PATCH 1361/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.29.0 (#2846) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f996c62de2..ed9c56e0b7 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.28.0 + 1.29.0 pom import From d940f8d7f119d75aaa80eb60babd5406fca76c69 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Aug 2023 02:24:16 +0200 Subject: [PATCH 1362/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.25.0 (#2845) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed9c56e0b7..c6ef90913d 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.24.0 + 2.25.0 test From f8e3da707cb15c57d39ad3c9ea9bdf64742715a5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 22:32:39 -0400 Subject: [PATCH 1363/2268] chore(main): release 2.31.1 (#2841) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cd11b1732..eb61c92caf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.31.1](https://github.com/googleapis/java-bigquery/compare/v2.31.0...v2.31.1) (2023-08-09) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.25.0 ([#2845](https://github.com/googleapis/java-bigquery/issues/2845)) ([d940f8d](https://github.com/googleapis/java-bigquery/commit/d940f8d7f119d75aaa80eb60babd5406fca76c69)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.29.0 ([#2846](https://github.com/googleapis/java-bigquery/issues/2846)) ([87a0a10](https://github.com/googleapis/java-bigquery/commit/87a0a10d806fdcbf4bdb1ee1478b9ee6aeb7b287)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 ([#2834](https://github.com/googleapis/java-bigquery/issues/2834)) ([79fe14c](https://github.com/googleapis/java-bigquery/commit/79fe14c08836b40bf84775a526cba32f63dd8227)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 ([#2839](https://github.com/googleapis/java-bigquery/issues/2839)) ([ae752bc](https://github.com/googleapis/java-bigquery/commit/ae752bc36c516e1a4172bc0c9cfa7ed6bbcbe0e7)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 ([#2840](https://github.com/googleapis/java-bigquery/issues/2840)) ([1ae6cb9](https://github.com/googleapis/java-bigquery/commit/1ae6cb9b20152e00db9a559ff143faca581bf8b1)) +* Update github/codeql-action action to v2.21.1 ([#2824](https://github.com/googleapis/java-bigquery/issues/2824)) ([9978971](https://github.com/googleapis/java-bigquery/commit/997897166ba121256b7fa6f4c63f83daebdc6a54)) +* Update jmh.version to v1.37 ([#2836](https://github.com/googleapis/java-bigquery/issues/2836)) ([4b3a3c2](https://github.com/googleapis/java-bigquery/commit/4b3a3c22985c76f7e861341dc76e96abc970eaec)) + ## [2.31.0](https://github.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) (2023-07-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 26c3dee284..733ba5ff9c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.1-SNAPSHOT + 2.31.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a0c8932b5b..c691388538 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.1-SNAPSHOT + 2.31.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.1-SNAPSHOT + 2.31.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c6ef90913d..cd2a749edf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.1-SNAPSHOT + 2.31.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.1-SNAPSHOT + 2.31.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7242145322..b8737a835c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.1-SNAPSHOT + 2.31.1 diff --git a/versions.txt b/versions.txt index 82a5ef4547..88118a350d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.0:2.31.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.31.1:2.31.1 \ No newline at end of file From 309ea607a9ff50e59dc4e1069c689c1da9605ed5 Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Thu, 17 Aug 2023 15:37:08 -0400 Subject: [PATCH 1364/2268] fix: SearchStats IndexUnusedReasons null bug (#2825) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: SearchStats IndexUnusedReasons null bug * 🦉 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 --- README.md | 8 ++++---- .../main/java/com/google/cloud/bigquery/SearchStats.java | 6 +++--- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 6 +++++- pom.xml | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1d99e65b86..aceecda141 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.21.0') +implementation platform('com.google.cloud:libraries-bom:26.22.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.31.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.31.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java index 73b812383b..237b83ca72 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/SearchStats.java @@ -68,7 +68,7 @@ SearchStatistics toPb() { searchStatistics.setIndexUsageMode(getIndexUsageMode()); } if (getIndexUnusedReasons() != null) { - searchStatistics.setIndexUnusedReason( + searchStatistics.setIndexUnusedReasons( getIndexUnusedReasons().stream() .map(IndexUnusedReason::toPb) .collect(Collectors.toList())); @@ -81,9 +81,9 @@ static SearchStats fromPb(SearchStatistics searchStatistics) { if (searchStatistics.getIndexUsageMode() != null) { builder.setIndexUsageMode(searchStatistics.getIndexUsageMode()); } - if (searchStatistics.getIndexUnusedReason() != null) { + if (searchStatistics.getIndexUnusedReasons() != null) { builder.setIndexUnusedReasons( - searchStatistics.getIndexUnusedReason().stream() + searchStatistics.getIndexUnusedReasons().stream() .map(IndexUnusedReason::fromPb) .collect(Collectors.toList())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8c5742e57d..bb9c233a45 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5090,7 +5090,7 @@ public void testQueryJobWithLabels() throws InterruptedException, TimeoutExcepti } @Test - public void testQueryJobWithSearchReturnsSearchStatistics() throws InterruptedException { + public void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException { String tableName = "test_query_job_table"; String query = "SELECT * FROM " @@ -5109,6 +5109,10 @@ public void testQueryJobWithSearchReturnsSearchStatistics() throws InterruptedEx JobStatistics.QueryStatistics stats = remoteJob.getStatistics(); assertNotNull(stats.getSearchStats()); assertEquals(stats.getSearchStats().getIndexUsageMode(), "UNUSED"); + assertNotNull(stats.getSearchStats().getIndexUnusedReasons()); + assertNotNull( + stats.getSearchStats().getIndexUnusedReasons().get(0).getCode(), + "INDEX_CONFIG_NOT_AVAILABLE"); } finally { bigquery.delete(destinationTable); } diff --git a/pom.xml b/pom.xml index cd2a749edf..90bf5b3236 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230520-2.0.0 + v2-rev20230805-2.0.0 3.14.0 12.0.1 From 814f3934ff157a2059f5f47ecf2b1b360ec53bfe Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Fri, 18 Aug 2023 13:20:16 -0400 Subject: [PATCH 1365/2268] ci: javadoc as required check (#2854) --- .github/sync-repo-settings.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index a37ac497e1..9583d638c8 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -16,6 +16,7 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor + - javadoc - pattern: 1.127.12-sp isAdminEnforced: true requiredApprovingReviewCount: 1 From 2cbded6600af1de8ec15b04a2496733ad2b50c47 Mon Sep 17 00:00:00 2001 From: Farhan Ahmed Date: Tue, 5 Sep 2023 11:12:14 -0400 Subject: [PATCH 1366/2268] fix: hide TableReference data struct (#2855) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: hide TableReference data struct * chore: add clirr ignored differences * chore: organize imports * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Neenu1995 Co-authored-by: Owl Bot --- .gitignore | 4 +++- google-cloud-bigquery/clirr-ignored-differences.xml | 10 ++++++++++ .../google/cloud/bigquery/IndexUnusedReason.java | 13 ++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 1c7a7e78f8..c94c87d10b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ __pycache__ .new-list.txt .org-list.txt SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java -.flattened-pom.xml \ No newline at end of file +.flattened-pom.xml +# Local Test files +*ITLocalTest.java \ No newline at end of file diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 500ce3f58d..41067bd213 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -94,4 +94,14 @@ com/google/cloud/bigquery/TableInfo* *TableConstraints(*) + + 7013 + com/google/cloud/bigquery/IndexUnusedReason* + *BaseTableId(*) + + + 7002 + com/google/cloud/bigquery/IndexUnusedReason* + *BaseTable(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java index 06a88b068e..bb4f0c3c32 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/IndexUnusedReason.java @@ -16,7 +16,6 @@ package com.google.cloud.bigquery; -import com.google.api.services.bigquery.model.TableReference; import com.google.auto.value.AutoValue; import java.io.Serializable; import javax.annotation.Nullable; @@ -52,9 +51,9 @@ public abstract static class Builder { /** * Specifies the base table involved in the reason that no search index was used. * - * @param tableReference tableReference or {@code null} for none + * @param baseTable baseTable or {@code null} for none */ - public abstract Builder setBaseTable(TableReference tableReference); + public abstract Builder setBaseTableId(TableId baseTable); /** Creates a @code IndexUnusedReason} object. */ public abstract IndexUnusedReason build(); @@ -96,7 +95,7 @@ public static Builder newBuilder() { * @return value or {@code null} for none */ @Nullable - public abstract TableReference getBaseTable(); + public abstract TableId getBaseTableId(); com.google.api.services.bigquery.model.IndexUnusedReason toPb() { com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason = @@ -110,8 +109,8 @@ com.google.api.services.bigquery.model.IndexUnusedReason toPb() { if (getMessage() != null) { indexUnusedReason.setMessage(indexUnusedReason.getMessage()); } - if (getBaseTable() != null) { - indexUnusedReason.setBaseTable(indexUnusedReason.getBaseTable()); + if (getBaseTableId() != null) { + indexUnusedReason.setBaseTable(getBaseTableId().toPb()); } return indexUnusedReason; } @@ -129,7 +128,7 @@ static IndexUnusedReason fromPb( builder.setMessage(indexUnusedReason.getMessage()); } if (indexUnusedReason.getBaseTable() != null) { - builder.setBaseTable(indexUnusedReason.getBaseTable()); + builder.setBaseTableId(TableId.fromPb(indexUnusedReason.getBaseTable())); } return builder.build(); } From ad9c63cafad1788c64129c4f34f85537a52252ee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:30:14 +0000 Subject: [PATCH 1367/2268] chore(main): release 2.31.2-SNAPSHOT (#2847) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 733ba5ff9c..1c145087e6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.1 + 2.31.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c691388538..6ecec984f7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.1 + 2.31.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.1 + 2.31.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 90bf5b3236..4c00606777 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.1 + 2.31.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.1 + 2.31.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b8737a835c..74ddf77a94 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.1 + 2.31.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 88118a350d..dea3f27735 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.1:2.31.1 \ No newline at end of file +google-cloud-bigquery:2.31.1:2.31.2-SNAPSHOT \ No newline at end of file From 989d9978f6a8e2a067bbe0e17c3ba935165cbf12 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:51:10 -0400 Subject: [PATCH 1368/2268] chore(main): release 2.31.2 (#2864) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb61c92caf..3c833f4b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.31.2](https://github.com/googleapis/java-bigquery/compare/v2.31.1...v2.31.2) (2023-09-05) + + +### Bug Fixes + +* Hide TableReference data struct ([#2855](https://github.com/googleapis/java-bigquery/issues/2855)) ([2cbded6](https://github.com/googleapis/java-bigquery/commit/2cbded6600af1de8ec15b04a2496733ad2b50c47)) +* SearchStats IndexUnusedReasons null bug ([#2825](https://github.com/googleapis/java-bigquery/issues/2825)) ([309ea60](https://github.com/googleapis/java-bigquery/commit/309ea607a9ff50e59dc4e1069c689c1da9605ed5)) + ## [2.31.1](https://github.com/googleapis/java-bigquery/compare/v2.31.0...v2.31.1) (2023-08-09) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1c145087e6..dde17cb100 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.2-SNAPSHOT + 2.31.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6ecec984f7..5ec3e04a6a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.2-SNAPSHOT + 2.31.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.2-SNAPSHOT + 2.31.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4c00606777..7628435f20 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.2-SNAPSHOT + 2.31.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.2-SNAPSHOT + 2.31.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 74ddf77a94..c811b89f9c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.2-SNAPSHOT + 2.31.2 diff --git a/versions.txt b/versions.txt index dea3f27735..c9aaacf02c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.1:2.31.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.31.2:2.31.2 \ No newline at end of file From 2294c2ffca62a22a66786a9a4c6c9ef1be898e5d Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:14:13 +0200 Subject: [PATCH 1369/2268] feat: add support for converting interval fields to threeten PeriodDuration (#2838) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for converting BigQuery interval type to threeten PeriodDuration, information about the canonical interval form can be found [here](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#canonical_format_3). Parsing logic was referenced from [here](https://cloud.google.com/bigquery/docs/reference/standard-sql/interval_functions#extract). Fixes #1849 ☕️ --- README.md | 6 +- .../com/google/cloud/bigquery/FieldValue.java | 87 +++++++++++++++++++ .../google/cloud/bigquery/FieldValueTest.java | 38 ++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 3 + 4 files changed, 131 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aceecda141..1665fb7d16 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.31.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.31.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index 58c012a60e..ea68075f7f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -27,10 +27,16 @@ import java.io.Serializable; import java.math.BigDecimal; import java.math.RoundingMode; +import java.time.Duration; import java.time.Instant; +import java.time.Period; +import java.time.format.DateTimeParseException; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.threeten.extra.PeriodDuration; /** * Google BigQuery Table Field Value class. Objects of this class represent values of a BigQuery @@ -237,6 +243,28 @@ public List getRepeatedValue() { return (List) value; } + /** + * Returns this field's value as a {@link org.threeten.extra.PeriodDuration}. This method should + * be used if the corresponding field has {@link StandardSQLTypeName#INTERVAL} type, or if it is a + * legal canonical format "[sign]Y-M [sign]D [sign]H:M:S[.F]", e.g. "123-7 -19 0:24:12.000006" or + * ISO 8601. + * + * @throws ClassCastException if the field is not a primitive type + * @throws NullPointerException if {@link #isNull()} returns {@code true} + * @throws IllegalArgumentException if the field cannot be converted to a legal interval + */ + @SuppressWarnings("unchecked") + public PeriodDuration getPeriodDuration() { + checkNotNull(value); + try { + // Try parsing from ISO 8601 + return PeriodDuration.parse(getStringValue()); + } catch (DateTimeParseException dateTimeParseException) { + // Try parsing from canonical interval format + return parseCanonicalInterval(getStringValue()); + } + } + /** * Returns this field's value as a {@link FieldValueList} instance. This method should only be * used if the corresponding field has {@link LegacySQLTypeName#RECORD} type (i.e. {@link @@ -325,4 +353,63 @@ static FieldValue fromPb(Object cellPb, Field recordSchema) { } throw new IllegalArgumentException("Unexpected table cell format"); } + + /** + * Parse interval in canonical format and create instance of {@code PeriodDuration}. + * + *

      The parameter {@code interval} should be an interval in the canonical format: "[sign]Y-M + * [sign]D [sign]H:M:S[.F]". More details + * here + * + * @throws IllegalArgumentException if the {@code interval} is not a valid interval + */ + static PeriodDuration parseCanonicalInterval(String interval) throws IllegalArgumentException { + // Pattern is [sign]Y-M [sign]D [sign]H:M:S[.F] + Pattern pattern = + Pattern.compile( + "(?[+-])?(?\\d+)-(?\\d+) (?[-|+])?(?\\d+) (?[-|+])?(?\\d+):(?\\d+):(?\\d+)(\\.(?\\d+))?"); + Matcher matcher = pattern.matcher(interval); + if (!matcher.find()) { + throw new IllegalArgumentException(); + } + String sign1 = matcher.group("sign1"); + String year = matcher.group("year"); + String month = matcher.group("month"); + String sign2 = matcher.group("sign2"); + String day = matcher.group("day"); + String sign3 = matcher.group("sign3"); + String hours = matcher.group("hours"); + String minutes = matcher.group("minutes"); + String seconds = matcher.group("seconds"); + String fraction = matcher.group("fraction"); + + int yearInt = Integer.parseInt(year); + int monthInt = Integer.parseInt(month); + if (Objects.equals(sign1, "-")) { + yearInt *= -1; + monthInt *= -1; + } + + int dayInt = Integer.parseInt(day); + if (Objects.equals(sign2, "-")) { + dayInt *= -1; + } + if (sign3 == null) { + sign3 = ""; + } + + String durationString = + sign3 + + "PT" + + hours + + "H" + + minutes + + "M" + + seconds + + (fraction == null ? "" : "." + fraction) + + "S"; + + return PeriodDuration.of(Period.of(yearInt, monthInt, dayInt), Duration.parse(durationString)); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index e4ec47b472..90cb690618 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -27,8 +27,13 @@ import com.google.common.collect.ImmutableMap; import com.google.common.io.BaseEncoding; import java.math.BigDecimal; +import java.time.Duration; +import java.time.Period; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Map.Entry; import org.junit.Test; +import org.threeten.extra.PeriodDuration; public class FieldValueTest { @@ -43,6 +48,10 @@ public class FieldValueTest { ImmutableMap.of("v", "123456789.123456789"); private static final Map STRING_FIELD = ImmutableMap.of("v", "string"); private static final Map TIMESTAMP_FIELD = ImmutableMap.of("v", "42"); + private static final Map INTERVAL_FIELD_1 = + ImmutableMap.of("v", "P3Y2M1DT12H34M56.789S"); + private static final Map INTERVAL_FIELD_2 = + ImmutableMap.of("v", "3-2 1 12:34:56.789"); private static final Map BYTES_FIELD = ImmutableMap.of("v", BYTES_BASE64); private static final Map NULL_FIELD = ImmutableMap.of("v", Data.nullOf(String.class)); @@ -74,6 +83,17 @@ public void testFromPb() { value = FieldValue.fromPb(TIMESTAMP_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertEquals(42000000, value.getTimestampValue()); + value = FieldValue.fromPb(INTERVAL_FIELD_1); + assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); + PeriodDuration periodDuration = + PeriodDuration.of(Period.of(3, 2, 1), Duration.parse("PT12H34M56.789S")); + assertEquals(periodDuration, value.getPeriodDuration()); + assertEquals("P3Y2M1DT12H34M56.789S", value.getStringValue()); + value = FieldValue.fromPb(INTERVAL_FIELD_2); + assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); + periodDuration = PeriodDuration.of(Period.of(3, 2, 1), Duration.parse("PT12H34M56.789S")); + assertEquals(periodDuration, value.getPeriodDuration()); + assertEquals("3-2 1 12:34:56.789", value.getStringValue()); value = FieldValue.fromPb(BYTES_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertArrayEquals(BYTES, value.getBytesValue()); @@ -146,4 +166,22 @@ public void testEquals() { assertEquals(recordValue, FieldValue.fromPb(RECORD_FIELD)); assertEquals(recordValue.hashCode(), FieldValue.fromPb(RECORD_FIELD).hashCode()); } + + @Test + public void testParseCanonicalInterval() { + Map intervalToPeriodDuration = new LinkedHashMap<>(); + intervalToPeriodDuration.put( + "125-7 -19 -0:24:12.001", PeriodDuration.parse("P125Y7M-19DT0H-24M-12.001S")); + intervalToPeriodDuration.put("-15-6 23 23:14:05", PeriodDuration.parse("P-15Y-6M23DT23H14M5S")); + intervalToPeriodDuration.put( + "06-01 06 01:01:00.123456", PeriodDuration.parse("P6Y1M6DT1H1M0.123456S")); + intervalToPeriodDuration.put("-0-0 -0 -0:0:0", PeriodDuration.parse("P0Y0M0DT0H0M0S")); + intervalToPeriodDuration.put( + "-99999-99999 9999 999:999:999.999999999", + PeriodDuration.parse("P-99999Y-99999M9999DT999H999M999.999999999S")); + for (Entry entry : intervalToPeriodDuration.entrySet()) { + assertEquals(FieldValue.parseCanonicalInterval(entry.getKey()), entry.getValue()); + System.out.println(FieldValue.parseCanonicalInterval(entry.getKey())); + } + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index bb9c233a45..cf180f9a36 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1228,8 +1228,11 @@ public void testIntervalType() throws InterruptedException { .build(); TableResult result = bigquery.query(queryJobConfiguration); assertNotNull(result.getJobId()); + PeriodDuration periodDuration = + PeriodDuration.of(Period.of(125, 7, -19), java.time.Duration.parse("PT24M12.000006S")); for (FieldValueList values : result.iterateAll()) { assertEquals("125-7 -19 0:24:12.000006", values.get(0).getValue()); + assertEquals(periodDuration, values.get(0).getPeriodDuration()); } } finally { assertTrue(bigquery.delete(tableId)); From f24439b7adf1f08cee4b65918b4395861fe88517 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Sep 2023 00:57:51 +0200 Subject: [PATCH 1370/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 (#2870) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7628435f20..508962ae51 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230805-2.0.0 - 3.14.0 + 3.15.0 12.0.1 From edd714129b65d73f894591c4d40e1a8e79c36b04 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Sep 2023 00:58:12 +0200 Subject: [PATCH 1371/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.26 (#2869) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 186ea50ab2..e3307285d8 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.24 + 0.9.26 true com.example.bigquery.NativeImageBigquerySample From d01031cbc6d50f9aff8c6d49a8d2c54496779451 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Sep 2023 00:58:28 +0200 Subject: [PATCH 1372/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.26 (#2868) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e3307285d8..7f18e0025f 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.24 + 0.9.26 test From cbbf0fb8a99c0633335d81cd36a7b53dfe9df20b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Sep 2023 00:58:49 +0200 Subject: [PATCH 1373/2268] deps: update actions/upload-artifact action to v3.1.3 (#2867) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index fa10a24734..4eab67ad52 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: SARIF file path: results.sarif From 7772c2adf04f3662055921e53b5599db52f7576c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:59:11 -0400 Subject: [PATCH 1374/2268] chore: for Java repos RenovateBot to ignore GitHub Actions workflow file (#1855) (#2866) chore: for Java repos RenovateBot to ignore GitHub Actions workflow file The actions used in the GitHub Actions workflow files do not appear in libraries' dependencies and mostly maintained by Java postprocessor templates. IgnorePath option document: https://docs.renovatebot.com/configuration-options/ Source-Link: https://github.com/googleapis/synthtool/commit/1543029c843989702adbe789acdead153ad696d1 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/requirements.txt | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index d5500ef442..52eaa54d82 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:46d2d262cd285c638656c8bde468011b723dc0c7ffd6a5ecc2650fe639c82e8f -# created: 2023-07-24T14:21:17.707234503Z + digest: sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f +# created: 2023-09-05T18:54:42.225408832Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 32989051e7..a73256ab80 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -12,9 +12,9 @@ cachetools==5.3.1 \ --hash=sha256:95ef631eeaea14ba2e36f06437f36463aac3a096799e876ee55e5cdccb102590 \ --hash=sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b # via google-auth -certifi==2023.5.7 \ - --hash=sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7 \ - --hash=sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716 +certifi==2023.7.22 \ + --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ + --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ @@ -485,6 +485,5 @@ zipp==3.16.1 \ # via importlib-metadata # WARNING: The following packages were not pinned, but pip requires them to be -# pinned when the requirements file includes hashes and the requirement is not -# satisfied by a package already installed. Consider using the --allow-unsafe flag. +# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag. # setuptools From bbb86fd8488ad253f2e9cf3fb08360330bd860a3 Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Wed, 13 Sep 2023 19:04:15 +0200 Subject: [PATCH 1375/2268] feat: add support for ExternalDatasetReference (#2871) API: https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#externaldatasetreference --- .../clirr-ignored-differences.xml | 5 ++ .../com/google/cloud/bigquery/Dataset.java | 6 ++ .../google/cloud/bigquery/DatasetInfo.java | 33 ++++++++ .../bigquery/ExternalDatasetReference.java | 79 +++++++++++++++++++ .../cloud/bigquery/DatasetInfoTest.java | 39 +++++++++ .../google/cloud/bigquery/DatasetTest.java | 31 ++++++++ .../ExternalDatasetReferenceTest.java | 70 ++++++++++++++++ pom.xml | 2 +- 8 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalDatasetReference.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 41067bd213..eaeeded132 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -104,4 +104,9 @@ com/google/cloud/bigquery/IndexUnusedReason* *BaseTable(*) + + 7013 + com/google/cloud/bigquery/DatasetInfo* + *setExternalDatasetReference(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index 5f9fea892f..3ed4b89287 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -152,6 +152,12 @@ public Builder setDefaultCollation(String defaultCollation) { return this; } + @Override + public Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference) { + infoBuilder.setExternalDatasetReference(externalDatasetReference); + return this; + } + @Override public Dataset build() { return new Dataset(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index bd209952e8..44583e0c85 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -73,6 +73,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final EncryptionConfiguration defaultEncryptionConfiguration; private final Long defaultPartitionExpirationMs; private final String defaultCollation; + private final ExternalDatasetReference externalDatasetReference; /** A builder for {@code DatasetInfo} objects. */ public abstract static class Builder { @@ -127,6 +128,13 @@ public abstract static class Builder { public abstract Builder setLabels(Map labels); + /** + * Optional. Information about the external metadata storage where the dataset is defined. + * Filled out when the dataset type is EXTERNAL + */ + public abstract Builder setExternalDatasetReference( + ExternalDatasetReference externalDatasetReference); + /** * The default encryption key for all tables in the dataset. Once this property is set, all * newly-created partitioned tables in the dataset will have encryption key set to this value, @@ -183,6 +191,7 @@ static final class BuilderImpl extends Builder { private EncryptionConfiguration defaultEncryptionConfiguration; private Long defaultPartitionExpirationMs; private String defaultCollation; + private ExternalDatasetReference externalDatasetReference; BuilderImpl() {} @@ -202,6 +211,7 @@ static final class BuilderImpl extends Builder { this.defaultEncryptionConfiguration = datasetInfo.defaultEncryptionConfiguration; this.defaultPartitionExpirationMs = datasetInfo.defaultPartitionExpirationMs; this.defaultCollation = datasetInfo.defaultCollation; + this.externalDatasetReference = datasetInfo.externalDatasetReference; } BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) { @@ -236,6 +246,10 @@ public Acl apply(Dataset.Access accessPb) { } this.defaultPartitionExpirationMs = datasetPb.getDefaultPartitionExpirationMs(); this.defaultCollation = datasetPb.getDefaultCollation(); + if (datasetPb.getExternalDatasetReference() != null) { + this.externalDatasetReference = + ExternalDatasetReference.fromPb(datasetPb.getExternalDatasetReference()); + } } @Override @@ -336,6 +350,12 @@ public Builder setDefaultCollation(String defaultCollation) { return this; } + @Override + public Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference) { + this.externalDatasetReference = externalDatasetReference; + return this; + } + @Override public DatasetInfo build() { return new DatasetInfo(this); @@ -358,6 +378,7 @@ public DatasetInfo build() { defaultEncryptionConfiguration = builder.defaultEncryptionConfiguration; defaultPartitionExpirationMs = builder.defaultPartitionExpirationMs; defaultCollation = builder.defaultCollation; + externalDatasetReference = builder.externalDatasetReference; } /** Returns the dataset identity. */ @@ -487,6 +508,14 @@ public String getDefaultCollation() { return defaultCollation; } + /** + * Returns information about the external metadata storage where the dataset is defined. Filled + * out when the dataset type is EXTERNAL. + */ + public ExternalDatasetReference getExternalDatasetReference() { + return externalDatasetReference; + } + /** Returns a builder for the dataset object. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -510,6 +539,7 @@ public String toString() { .add("defaultEncryptionConfiguration", defaultEncryptionConfiguration) .add("defaultPartitionExpirationMs", defaultPartitionExpirationMs) .add("defaultCollation", defaultCollation) + .add("externalDatasetReference", externalDatasetReference) .toString(); } @@ -588,6 +618,9 @@ public Dataset.Access apply(Acl acl) { if (defaultCollation != null) { datasetPb.setDefaultCollation(defaultCollation); } + if (externalDatasetReference != null) { + datasetPb.setExternalDatasetReference(externalDatasetReference.toPb()); + } return datasetPb; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalDatasetReference.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalDatasetReference.java new file mode 100644 index 0000000000..ecfe54c50c --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalDatasetReference.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import com.google.common.annotations.VisibleForTesting; +import java.io.Serializable; +import javax.annotation.Nullable; + +/** Configures the access a dataset defined in an external metadata storage. */ +@AutoValue +public abstract class ExternalDatasetReference implements Serializable { + + public static ExternalDatasetReference.Builder newBuilder() { + return new AutoValue_ExternalDatasetReference.Builder(); + } + + static ExternalDatasetReference fromPb( + com.google.api.services.bigquery.model.ExternalDatasetReference externalDatasetReference) { + ExternalDatasetReference.Builder builder = newBuilder(); + + if (externalDatasetReference.getConnection() != null) { + builder.setConnection(externalDatasetReference.getConnection()); + } + if (externalDatasetReference.getExternalSource() != null) { + builder.setExternalSource(externalDatasetReference.getExternalSource()); + } + + return builder.build(); + } + + public com.google.api.services.bigquery.model.ExternalDatasetReference toPb() { + com.google.api.services.bigquery.model.ExternalDatasetReference externalDatasetReference = + new com.google.api.services.bigquery.model.ExternalDatasetReference(); + + externalDatasetReference.setConnection(getConnection()); + externalDatasetReference.setExternalSource(getExternalSource()); + return externalDatasetReference; + } + + @Nullable + public abstract String getConnection(); + + @Nullable + public abstract String getExternalSource(); + + /** Returns a builder for an ExternalDatasetReference. */ + @VisibleForTesting + public abstract ExternalDatasetReference.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + /** + * The connection id that is used to access the external_source. Format: + * projects/{project_id}/locations/{location_id}/connections/{connection_id} * + */ + public abstract ExternalDatasetReference.Builder setConnection(String connection); + + /** External source that backs this dataset * */ + public abstract ExternalDatasetReference.Builder setExternalSource(String externalSource); + + /** Creates a {@code ExternalDatasetReference} object. */ + public abstract ExternalDatasetReference build(); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index 453701e3a8..c91cbc2f30 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -58,6 +58,12 @@ public class DatasetInfoTest { private static final DatasetId DATASET_ID_COMPLETE = DatasetId.of("project", "dataset"); private static final EncryptionConfiguration DATASET_ENCRYPTION_CONFIGURATION = EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); + + private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = + ExternalDatasetReference.newBuilder() + .setExternalSource("source") + .setConnection("connection") + .build(); private static final DatasetInfo DATASET_INFO = DatasetInfo.newBuilder(DATASET_ID) .setAcl(ACCESS_RULES) @@ -82,6 +88,8 @@ public class DatasetInfoTest { .build(); private static final DatasetInfo DATASET_INFO_COMPLETE_WITH_IAM_MEMBER = DATASET_INFO.toBuilder().setAcl(ACCESS_RULES_IAM_MEMBER).build(); + private static final DatasetInfo DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE = + DATASET_INFO.toBuilder().setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE).build(); @Test public void testToBuilder() { @@ -108,6 +116,28 @@ public void testToBuilderIncomplete() { assertEquals(datasetInfo, datasetInfo.toBuilder().build()); } + @Test + public void testToBuilderWithExternalDatasetReference() { + compareDatasets( + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE, + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.toBuilder().build()); + + ExternalDatasetReference externalDatasetReference = + ExternalDatasetReference.newBuilder() + .setExternalSource("source2") + .setConnection("connection2") + .build(); + DatasetInfo datasetInfo = + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE + .toBuilder() + .setExternalDatasetReference(externalDatasetReference) + .build(); + assertEquals(externalDatasetReference, datasetInfo.getExternalDatasetReference()); + datasetInfo = + datasetInfo.toBuilder().setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE).build(); + compareDatasets(DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE, datasetInfo); + } + @Test public void testBuilder() { assertNull(DATASET_INFO.getDatasetId().getProject()); @@ -137,6 +167,9 @@ public void testBuilder() { assertEquals(LOCATION, DATASET_INFO_COMPLETE.getLocation()); assertEquals(SELF_LINK, DATASET_INFO_COMPLETE.getSelfLink()); assertEquals(LABELS, DATASET_INFO_COMPLETE.getLabels()); + assertEquals( + EXTERNAL_DATASET_REFERENCE, + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.getExternalDatasetReference()); } @Test @@ -156,6 +189,7 @@ public void testOf() { assertNull(datasetInfo.getDefaultEncryptionConfiguration()); assertNull(datasetInfo.getDefaultPartitionExpirationMs()); assertTrue(datasetInfo.getLabels().isEmpty()); + assertNull(datasetInfo.getExternalDatasetReference()); datasetInfo = DatasetInfo.of(DATASET_ID); assertEquals(DATASET_ID, datasetInfo.getDatasetId()); @@ -172,11 +206,15 @@ public void testOf() { assertNull(datasetInfo.getDefaultEncryptionConfiguration()); assertNull(datasetInfo.getDefaultPartitionExpirationMs()); assertTrue(datasetInfo.getLabels().isEmpty()); + assertNull(datasetInfo.getExternalDatasetReference()); } @Test public void testToPbAndFromPb() { compareDatasets(DATASET_INFO_COMPLETE, DatasetInfo.fromPb(DATASET_INFO_COMPLETE.toPb())); + compareDatasets( + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE, + DatasetInfo.fromPb(DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.toPb())); DatasetInfo datasetInfo = DatasetInfo.newBuilder("project", "dataset").build(); compareDatasets(datasetInfo, DatasetInfo.fromPb(datasetInfo.toPb())); } @@ -204,5 +242,6 @@ private void compareDatasets(DatasetInfo expected, DatasetInfo value) { expected.getDefaultEncryptionConfiguration(), value.getDefaultEncryptionConfiguration()); assertEquals( expected.getDefaultPartitionExpirationMs(), value.getDefaultPartitionExpirationMs()); + assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index d1c97a6940..b244cf2606 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -83,6 +83,11 @@ public class DatasetTest { TableInfo.newBuilder( TableId.of(NEW_PROJECT_ID, "dataset", "table3"), EXTERNAL_TABLE_DEFINITION) .build(); + private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = + ExternalDatasetReference.newBuilder() + .setExternalSource("source") + .setConnection("connection") + .build(); @Rule public MockitoRule rule; @@ -319,6 +324,31 @@ public void testToAndFromPb() { compareDataset(expectedDataset, Dataset.fromPb(bigquery, expectedDataset.toPb())); } + @Test + public void testExternalDatasetReference() { + Dataset datasetWithExternalDatasetReference = + new Dataset.Builder(bigquery, DATASET_ID) + .setAcl(ACCESS_RULES) + .setCreationTime(CREATION_TIME) + .setDefaultTableLifetime(DEFAULT_TABLE_EXPIRATION) + .setDescription(DESCRIPTION) + .setEtag(ETAG) + .setFriendlyName(FRIENDLY_NAME) + .setGeneratedId(GENERATED_ID) + .setLastModified(LAST_MODIFIED) + .setLocation(LOCATION) + .setSelfLink(SELF_LINK) + .setLabels(LABELS) + .setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE) + .build(); + assertEquals( + EXTERNAL_DATASET_REFERENCE, + datasetWithExternalDatasetReference.getExternalDatasetReference()); + compareDataset( + datasetWithExternalDatasetReference, + datasetWithExternalDatasetReference.toBuilder().build()); + } + private void compareDataset(Dataset expected, Dataset value) { assertEquals(expected, value); compareDatasetInfo(expected, value); @@ -338,5 +368,6 @@ private void compareDatasetInfo(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.getCreationTime(), value.getCreationTime()); assertEquals(expected.getDefaultTableLifetime(), value.getDefaultTableLifetime()); assertEquals(expected.getLastModified(), value.getLastModified()); + assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java new file mode 100644 index 0000000000..6d241948b8 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class ExternalDatasetReferenceTest { + private static final String EXTERNAL_SOURCE = "test_source"; + private static final String CONNECTION = "test_connection"; + private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = + ExternalDatasetReference.newBuilder() + .setExternalSource(EXTERNAL_SOURCE) + .setConnection(CONNECTION) + .build(); + + @Test + public void testToBuilder() { + compareExternalDatasetReference( + EXTERNAL_DATASET_REFERENCE, EXTERNAL_DATASET_REFERENCE.toBuilder().build()); + ExternalDatasetReference externalDatasetReference = + EXTERNAL_DATASET_REFERENCE.toBuilder().setExternalSource("test_source2").build(); + assertEquals("test_source2", externalDatasetReference.getExternalSource()); + } + + @Test + public void testBuilder() { + assertEquals(EXTERNAL_SOURCE, EXTERNAL_DATASET_REFERENCE.getExternalSource()); + assertEquals(CONNECTION, EXTERNAL_DATASET_REFERENCE.getConnection()); + ExternalDatasetReference externalDatasetReference = + ExternalDatasetReference.newBuilder() + .setExternalSource(EXTERNAL_SOURCE) + .setConnection(CONNECTION) + .build(); + assertEquals(EXTERNAL_DATASET_REFERENCE, externalDatasetReference); + } + + @Test + public void testToAndFromPb() { + ExternalDatasetReference externalDatasetReference = + EXTERNAL_DATASET_REFERENCE.toBuilder().build(); + assertTrue( + ExternalDatasetReference.fromPb(externalDatasetReference.toPb()) + instanceof ExternalDatasetReference); + compareExternalDatasetReference( + externalDatasetReference, ExternalDatasetReference.fromPb(externalDatasetReference.toPb())); + } + + private void compareExternalDatasetReference( + ExternalDatasetReference expected, ExternalDatasetReference value) { + assertEquals(expected.getExternalSource(), value.getExternalSource()); + assertEquals(expected.getConnection(), value.getConnection()); + } +} diff --git a/pom.xml b/pom.xml index 508962ae51..be820053de 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230805-2.0.0 + v2-rev20230812-2.0.0 3.15.0 12.0.1 From 6cafedf634bc88f41b2b5d3ec1425341b02ac8b6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 00:49:57 +0200 Subject: [PATCH 1376/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.30.0 (#2874) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be820053de..64fc269071 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.29.0 + 1.30.0 pom import From 1985acc9343b8014f110252a02cd578ce73d6a7f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 01:37:58 +0200 Subject: [PATCH 1377/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.42.0 (#2877) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64fc269071..34eceda6ce 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.41.1 + 2.42.0 pom import From 6196625d614ce80641008ffab3b5bf9720651bb9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 01:38:20 +0200 Subject: [PATCH 1378/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.26.0 (#2873) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 34eceda6ce..9b62684183 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.25.0 + 2.26.0 test From 5702109aff3f5c3357c8bca83b18e6e16ca8d878 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 01:38:38 +0200 Subject: [PATCH 1379/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.26.0 (#2872) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9b62684183..13abbec2aa 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.25.0 + 2.26.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5c186115b7..e307f5c09b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.25.0 + 2.26.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c811b89f9c..efe17ad41a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.25.0 + 2.26.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 080f1e84cf..e9e85bf7ee 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.25.0 + 2.26.0 test From f8c163ea697f574a57e024c2872634fa2a03940c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:31:49 -0400 Subject: [PATCH 1380/2268] chore(main): release 2.31.3-SNAPSHOT (#2865) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dde17cb100..479eecb8a5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.2 + 2.31.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5ec3e04a6a..d1441f1a79 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.2 + 2.31.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.2 + 2.31.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 13abbec2aa..c7af98af7f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.2 + 2.31.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.2 + 2.31.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index efe17ad41a..6d3190ee29 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.2 + 2.31.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index c9aaacf02c..49aa7879b5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.2:2.31.2 \ No newline at end of file +google-cloud-bigquery:2.31.2:2.31.3-SNAPSHOT \ No newline at end of file From 902e9b97cd548910354297ff6e605df094a03175 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 03:32:21 +0200 Subject: [PATCH 1381/2268] deps: update actions/checkout action to v4 (#2862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action to v4 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4eab67ad52..4959517d49 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: persist-credentials: false From 6b6d809657376cf3591e732e6440770156ae0382 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 04:30:29 +0200 Subject: [PATCH 1382/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.26.1 (#2851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-storage to v2.26.1 * 🦉 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 Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7af98af7f..9aafd3a38d 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.26.0 + 2.26.1 test From ff8371e72aacff8ce3b550c55aa7bda3523bc2d8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 04:30:51 +0200 Subject: [PATCH 1383/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.31.1 (#2848) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.31.1 * 🦉 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 Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1665fb7d16..73be1efe40 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.31.0 + 2.31.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e307f5c09b..3189c3d6aa 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.31.0 + 2.31.1 From 6b380a668045580b1aa1878c56ca73dcf576e68c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 04:31:03 +0200 Subject: [PATCH 1384/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.26.0 (#2850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.26.0 * 🦉 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 Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3189c3d6aa..7018c5c33f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.25.1 + 2.26.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6d3190ee29..5de6ade6f5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.25.1 + 2.26.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e9e85bf7ee..2e8a7890d2 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.25.1 + 2.26.0 test From 0f7306cff99d7f38c504d006e1518b9389507673 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 14:12:17 +0200 Subject: [PATCH 1385/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.27.0 (#2880) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9aafd3a38d..2f90204848 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.26.1 + 2.27.0 test From 93bdcedcd90927c6144adc3de5e6460d608ebfe2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Sep 2023 14:12:30 +0200 Subject: [PATCH 1386/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.31.2 (#2881) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.31.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 73be1efe40..d5521d9866 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.31.1 + 2.31.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7018c5c33f..0b6b5994bb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.31.1 + 2.31.2 From 42a999640dfe84005007d571daa58e526187c5e2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 09:28:30 -0400 Subject: [PATCH 1387/2268] chore(main): release 2.32.0 (#2878) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c833f4b7c..05a148540f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.32.0](https://github.com/googleapis/java-bigquery/compare/v2.31.2...v2.32.0) (2023-09-14) + + +### Features + +* Add support for converting interval fields to threeten PeriodDuration ([#2838](https://github.com/googleapis/java-bigquery/issues/2838)) ([2294c2f](https://github.com/googleapis/java-bigquery/commit/2294c2ffca62a22a66786a9a4c6c9ef1be898e5d)) +* Add support for ExternalDatasetReference ([#2871](https://github.com/googleapis/java-bigquery/issues/2871)) ([bbb86fd](https://github.com/googleapis/java-bigquery/commit/bbb86fd8488ad253f2e9cf3fb08360330bd860a3)) + + +### Dependencies + +* Update actions/checkout action to v4 ([#2862](https://github.com/googleapis/java-bigquery/issues/2862)) ([902e9b9](https://github.com/googleapis/java-bigquery/commit/902e9b97cd548910354297ff6e605df094a03175)) +* Update actions/upload-artifact action to v3.1.3 ([#2867](https://github.com/googleapis/java-bigquery/issues/2867)) ([cbbf0fb](https://github.com/googleapis/java-bigquery/commit/cbbf0fb8a99c0633335d81cd36a7b53dfe9df20b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.26.0 ([#2873](https://github.com/googleapis/java-bigquery/issues/2873)) ([6196625](https://github.com/googleapis/java-bigquery/commit/6196625d614ce80641008ffab3b5bf9720651bb9)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.30.0 ([#2874](https://github.com/googleapis/java-bigquery/issues/2874)) ([6cafedf](https://github.com/googleapis/java-bigquery/commit/6cafedf634bc88f41b2b5d3ec1425341b02ac8b6)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 ([#2870](https://github.com/googleapis/java-bigquery/issues/2870)) ([f24439b](https://github.com/googleapis/java-bigquery/commit/f24439b7adf1f08cee4b65918b4395861fe88517)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.26 ([#2868](https://github.com/googleapis/java-bigquery/issues/2868)) ([d01031c](https://github.com/googleapis/java-bigquery/commit/d01031cbc6d50f9aff8c6d49a8d2c54496779451)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.26 ([#2869](https://github.com/googleapis/java-bigquery/issues/2869)) ([edd7141](https://github.com/googleapis/java-bigquery/commit/edd714129b65d73f894591c4d40e1a8e79c36b04)) + ## [2.31.2](https://github.com/googleapis/java-bigquery/compare/v2.31.1...v2.31.2) (2023-09-05) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 479eecb8a5..7f06c92456 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.31.3-SNAPSHOT + 2.32.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d1441f1a79..f7fdee1068 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.31.3-SNAPSHOT + 2.32.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.31.3-SNAPSHOT + 2.32.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2f90204848..ed6e9d9646 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.31.3-SNAPSHOT + 2.32.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.31.3-SNAPSHOT + 2.32.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5de6ade6f5..f602d39b95 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.31.3-SNAPSHOT + 2.32.0 diff --git a/versions.txt b/versions.txt index 49aa7879b5..0b7ba086a6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.31.2:2.31.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.32.0:2.32.0 \ No newline at end of file From 599e3b3d7e948a0688c6e08d4910f9db5c532f99 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Sep 2023 15:46:17 +0200 Subject: [PATCH 1388/2268] deps: update github/codeql-action action to v2.21.4 (#2829) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.21.4 * 🦉 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 Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4959517d49..f3044fe4ca 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@6ca1aa8c195c3ca3e77c174fe0356db1bce3b319 # v2.21.1 + uses: github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4 with: sarif_file: results.sarif From 4a50f38129056da19ed5b0be1ab81ad786a1c276 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Sep 2023 15:47:44 +0200 Subject: [PATCH 1389/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.27.2 (#2882) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0b6b5994bb..d373ea764f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.26.0 + 2.27.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f602d39b95..0952a1d2bf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.26.0 + 2.27.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2e8a7890d2..a37ed03fbe 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.26.0 + 2.27.2 test From 6695f8e79bfd7503cdb991b931a252d57fd42e8a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Sep 2023 15:48:02 +0200 Subject: [PATCH 1390/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.32.0 (#2884) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.32.0 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d5521d9866..3d19e57591 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.31.2 + 2.32.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.31.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.32.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.31.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.32.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.31.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.32.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d373ea764f..55b2bfc13c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.31.2 + 2.32.0 From 2237ca2a1dbe9e1dc1d5e6c0dc2bd2fd39e01ef0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Sep 2023 15:48:39 +0200 Subject: [PATCH 1391/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.27 (#2885) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.27 * 🦉 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 --- README.md | 2 +- samples/native-image-sample/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d19e57591..60649dc7b9 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.22.0') +implementation platform('com.google.cloud:libraries-bom:26.23.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 7f18e0025f..e5a19a5ee8 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.26 + 0.9.27 test From 123ad59b60bbda26c816b5442c3f006cae806932 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Sep 2023 15:48:58 +0200 Subject: [PATCH 1392/2268] build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.6.0 (#2887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.6.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed6e9d9646..6c00cf8f66 100644 --- a/pom.xml +++ b/pom.xml @@ -224,7 +224,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 html From 86442522401a2b264ca547a6a619588592f954f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:01:47 -0400 Subject: [PATCH 1393/2268] build(deps): bump cryptography from 41.0.2 to 41.0.3 in /.kokoro (#2835) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): bump cryptography from 41.0.2 to 41.0.3 in /.kokoro Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.3) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> From 7e040e97eeec762ab97190dea33b94769d681bf0 Mon Sep 17 00:00:00 2001 From: Sumit Banerjee <123063931+forksumit@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:38:37 +0530 Subject: [PATCH 1394/2268] fix: update samples snippet to write to BYTES instead of ARRAY (#2876) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: update snippet to write to BYTES instead of ARRAY * 🦉 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 --- .../java/com/example/bigquery/InsertingDataTypes.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java b/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java index 3d721e727d..0f2946488e 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java +++ b/samples/snippets/src/main/java/com/example/bigquery/InsertingDataTypes.java @@ -30,6 +30,7 @@ import com.google.cloud.bigquery.TableDefinition; import com.google.cloud.bigquery.TableId; import com.google.cloud.bigquery.TableInfo; +import java.util.Base64; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -53,10 +54,7 @@ public static void insertingDataTypes(String datasetName, String tableName) { // Inserting data types Field name = Field.of("name", StandardSQLTypeName.STRING); Field age = Field.of("age", StandardSQLTypeName.INT64); - Field school = - Field.newBuilder("school", StandardSQLTypeName.BYTES) - .setMode(Field.Mode.REPEATED) - .build(); + Field school = Field.of("school", StandardSQLTypeName.BYTES); Field location = Field.of("location", StandardSQLTypeName.GEOGRAPHY); Field measurements = Field.newBuilder("measurements", StandardSQLTypeName.FLOAT64) @@ -86,7 +84,7 @@ public static void insertingDataTypes(String datasetName, String tableName) { Map rowContent = new HashMap<>(); rowContent.put("name", "Tom"); rowContent.put("age", 30); - rowContent.put("school", "Test University".getBytes()); + rowContent.put("school", Base64.getEncoder().encodeToString("Test University".getBytes())); rowContent.put("location", "POINT(1 2)"); rowContent.put("measurements", new Float[] {50.05f, 100.5f}); rowContent.put("datesTime", datesTimeContent); From 3895bd94b283b6ff731cfa94426ea0691e0d54c4 Mon Sep 17 00:00:00 2001 From: emkornfield Date: Mon, 25 Sep 2023 04:33:52 -0700 Subject: [PATCH 1395/2268] feat: Add support for FileSetSpec (#2888) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add support for FileSetSpec * 🦉 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 --- .../bigquery/ExternalTableDefinition.java | 30 +++++++++++++++++++ .../cloud/bigquery/LoadJobConfiguration.java | 26 ++++++++++++++++ .../bigquery/ExternalTableDefinitionTest.java | 2 ++ .../bigquery/LoadJobConfigurationTest.java | 2 ++ 4 files changed, 60 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 18c78e7503..d307b82321 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -79,8 +79,20 @@ public Builder setSourceUris(List sourceUris) { return setSourceUrisImmut(ImmutableList.copyOf(sourceUris)); } + abstract Builder setFileSetSpecTypeInner(String spec); + abstract Builder setSourceUrisImmut(ImmutableList sourceUris); + /** + * Defines how to interpret files denoted by URIs. By default the files are assumed to be data + * files (this can be specified explicitly via FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH). A second + * option is "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST" which interprets each file as a + * manifest file, where each line is a reference to a file. + */ + public Builder setFileSetSpecType(String fileSetSpecType) { + return setFileSetSpecTypeInner(fileSetSpecType); + } + /** * Sets the source format, and possibly some parsing options, of the external data. Supported * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. @@ -232,6 +244,14 @@ public List getSourceUris() { return getSourceUrisImmut(); } + @Nullable + public String getFileSetSpecType() { + return getFileSetSpecTypeInner(); + } + + @Nullable + abstract String getFileSetSpecTypeInner(); + @Nullable public abstract ImmutableList getSourceUrisImmut(); @@ -338,6 +358,10 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getHivePartitioningOptions() != null) { externalConfigurationPb.setHivePartitioningOptions(getHivePartitioningOptions().toPb()); } + if (getFileSetSpecType() != null) { + externalConfigurationPb.setFileSetSpecType(getFileSetSpecType()); + } + return externalConfigurationPb; } @@ -507,6 +531,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (externalDataConfiguration.getReferenceFileSchemaUri() != null) { builder.setReferenceFileSchemaUri(externalDataConfiguration.getReferenceFileSchemaUri()); } + if (externalDataConfiguration.getFileSetSpecType() != null) { + builder.setFileSetSpecType(externalDataConfiguration.getFileSetSpecType()); + } } return builder.build(); } @@ -566,6 +593,9 @@ static ExternalTableDefinition fromExternalDataConfiguration( builder.setHivePartitioningOptions( HivePartitioningOptions.fromPb(externalDataConfiguration.getHivePartitioningOptions())); } + if (externalDataConfiguration.getFileSetSpecType() != null) { + builder.setFileSetSpecType(externalDataConfiguration.getFileSetSpecType()); + } return builder.build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 321d542a67..fefff3409f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -38,6 +38,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private static final long serialVersionUID = -2673554846792429829L; private final List sourceUris; + private final String fileSetSpecType; private final TableId destinationTable; private final List decimalTargetTypes; private final EncryptionConfiguration destinationEncryptionConfiguration; @@ -67,6 +68,7 @@ public static final class Builder extends JobConfiguration.Builder sourceUris; + private String fileSetSpecType; private TableId destinationTable; private List decimalTargetTypes; private EncryptionConfiguration destinationEncryptionConfiguration; @@ -107,6 +109,7 @@ private Builder(LoadJobConfiguration loadConfiguration) { this.schema = loadConfiguration.schema; this.ignoreUnknownValues = loadConfiguration.ignoreUnknownValues; this.sourceUris = loadConfiguration.sourceUris; + this.fileSetSpecType = loadConfiguration.fileSetSpecType; this.schemaUpdateOptions = loadConfiguration.schemaUpdateOptions; this.autodetect = loadConfiguration.autodetect; this.destinationEncryptionConfiguration = @@ -175,6 +178,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getSourceUris() != null) { this.sourceUris = ImmutableList.copyOf(configurationPb.getLoad().getSourceUris()); } + if (loadConfigurationPb.getFileSetSpecType() != null) { + this.fileSetSpecType = loadConfigurationPb.getFileSetSpecType(); + } if (loadConfigurationPb.getSchemaUpdateOptions() != null) { ImmutableList.Builder schemaUpdateOptionsBuilder = new ImmutableList.Builder<>(); @@ -306,6 +312,17 @@ public Builder setSourceUris(List sourceUris) { return this; } + /** + * Defines how to interpret files denoted by URIs. By default the files are assumed to be data + * files (this can be specified explicitly via FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH). A second + * option is "FILE_SET_SPEC_TYPE_NEW_LINE_DELIMITED_MANIFEST" which interprets each file as a + * manifest file, where each line is a reference to a file. + */ + public Builder setFileSetSpecType(String fileSetSpecType) { + this.fileSetSpecType = fileSetSpecType; + return this; + } + /** * Defines the list of possible SQL data types to which the source decimal values are converted. * This list and the precision and the scale parameters of the decimal field determine the @@ -403,6 +420,7 @@ public LoadJobConfiguration build() { private LoadJobConfiguration(Builder builder) { super(builder); this.sourceUris = builder.sourceUris; + this.fileSetSpecType = builder.fileSetSpecType; this.destinationTable = builder.destinationTable; this.decimalTargetTypes = builder.decimalTargetTypes; this.createDisposition = builder.createDisposition; @@ -497,6 +515,10 @@ public List getSourceUris() { return sourceUris; } + public String getFileSetSpecType() { + return fileSetSpecType; + } + public List getDecimalTargetTypes() { return decimalTargetTypes; } @@ -575,6 +597,7 @@ ToStringHelper toStringHelper() { .add("schema", schema) .add("ignoreUnknownValue", ignoreUnknownValues) .add("sourceUris", sourceUris) + .add("fileSetSpecType", fileSetSpecType) .add("schemaUpdateOptions", schemaUpdateOptions) .add("autodetect", autodetect) .add("timePartitioning", timePartitioning) @@ -655,6 +678,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (sourceUris != null) { loadConfigurationPb.setSourceUris(ImmutableList.copyOf(sourceUris)); } + if (fileSetSpecType != null) { + loadConfigurationPb.setFileSetSpecType(fileSetSpecType); + } if (decimalTargetTypes != null) { loadConfigurationPb.setDecimalTargetTypes(ImmutableList.copyOf(decimalTargetTypes)); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 4a74091620..3e67ad9599 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -60,6 +60,7 @@ public class ExternalTableDefinitionTest { .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) + .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") .setDecimalTargetTypes(DECIMAL_TARGET_TYPES) .setCompression(COMPRESSION) .setConnectionId(CONNECTION_ID) @@ -154,6 +155,7 @@ public void testToAndFromPbParquet() { private void compareExternalTableDefinition( ExternalTableDefinition expected, ExternalTableDefinition value) { assertEquals(expected, value); + assertEquals(expected.getFileSetSpecType(), value.getFileSetSpecType()); assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); assertEquals(expected.getCompression(), value.getCompression()); assertEquals(expected.getConnectionId(), value.getConnectionId()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 341965fb80..563a3f34a1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -91,6 +91,7 @@ public class LoadJobConfigurationTest { .setCreateDisposition(CREATE_DISPOSITION) .setWriteDisposition(WRITE_DISPOSITION) .setFormatOptions(CSV_OPTIONS) + .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") .setIgnoreUnknownValues(IGNORE_UNKNOWN_VALUES) .setMaxBadRecords(MAX_BAD_RECORDS) .setSchema(TABLE_SCHEMA) @@ -240,6 +241,7 @@ private void compareLoadJobConfiguration( LoadJobConfiguration expected, LoadJobConfiguration value) { assertEquals(expected, value); assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.getFileSetSpecType(), value.getFileSetSpecType()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.getDestinationTable(), value.getDestinationTable()); assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); From 8c68dbe507406b134e1ff300d819f46836595c13 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 26 Sep 2023 21:50:27 +0200 Subject: [PATCH 1396/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.27.1 (#2896) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c00cf8f66..092adfe77f 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.27.0 + 2.27.1 test From 487c310b251000006a782cf331b73f33b7f5d2a1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 26 Sep 2023 21:50:41 +0200 Subject: [PATCH 1397/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.1 (#2894) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7f06c92456..16888be6ef 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.0 + 3.5.1 package From 539b4e62f80598fb510fad37429ae0441db04c6f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 26 Sep 2023 21:53:39 +0200 Subject: [PATCH 1398/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.27 (#2886) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.27 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e5a19a5ee8..1f18d2c067 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.26 + 0.9.27 true com.example.bigquery.NativeImageBigquerySample From b568026fe1b8fb7365306b718b5f8540fb13b8dc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 26 Sep 2023 21:53:46 +0200 Subject: [PATCH 1399/2268] deps: update github/codeql-action action to v2.21.8 (#2889) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.21.8 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f3044fe4ca..19fbe5ba1a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@a09933a12a80f87b87005513f0abb1494c27a716 # v2.21.4 + uses: github/codeql-action/upload-sarif@6a28655e3dcb49cb0840ea372fd6d17733edd8a4 # v2.21.8 with: sarif_file: results.sarif From e1d987199ad8994aa3e9115daf26e0fb27aef911 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 27 Sep 2023 03:11:10 +0200 Subject: [PATCH 1400/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.16.1 (#2892) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 092adfe77f..0afbe66523 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230812-2.0.0 - 3.15.0 + 3.16.1 12.0.1 From 43a1345f3288ffbf7435a93a91537a06a6381595 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:51:35 -0400 Subject: [PATCH 1401/2268] chore(main): release 2.32.1-SNAPSHOT (#2883) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 16888be6ef..adb3df32ab 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.32.0 + 2.32.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f7fdee1068..e8857bfc4a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.32.0 + 2.32.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.32.0 + 2.32.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0afbe66523..40abac928d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.32.0 + 2.32.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.32.0 + 2.32.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0952a1d2bf..0a0005d9c3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.32.0 + 2.32.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0b7ba086a6..9301fb640b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.32.0:2.32.0 \ No newline at end of file +google-cloud-bigquery:2.32.0:2.32.1-SNAPSHOT \ No newline at end of file From e3655af235f002128979ed592c5aade33a4c7596 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 27 Sep 2023 22:37:07 +0200 Subject: [PATCH 1402/2268] deps: update actions/checkout action (#2893) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 19fbe5ba1a..418aff4829 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 with: persist-credentials: false From ab4e1d026c34b7d28caaf5b0b1465ac2de62c530 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 27 Sep 2023 22:37:19 +0200 Subject: [PATCH 1403/2268] deps: update github/codeql-action action to v2.21.8 - abandoned (#2897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.21.8 * 🦉 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 From 33a729f367ba6d9f04595e1b781c7eb321289380 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 27 Sep 2023 22:56:22 +0200 Subject: [PATCH 1404/2268] deps: update github/codeql-action action to v2.21.9 (#2901) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 418aff4829..32d3cc29b8 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@6a28655e3dcb49cb0840ea372fd6d17733edd8a4 # v2.21.8 + uses: github/codeql-action/upload-sarif@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9 with: sarif_file: results.sarif From 682460580d0e50c4c7993ceef7daac93b49880f7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 17:37:27 -0400 Subject: [PATCH 1405/2268] chore(main): release 2.33.0 (#2900) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05a148540f..94c2f34ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.33.0](https://github.com/googleapis/java-bigquery/compare/v2.32.0...v2.33.0) (2023-09-27) + + +### Features + +* Add support for FileSetSpec ([#2888](https://github.com/googleapis/java-bigquery/issues/2888)) ([3895bd9](https://github.com/googleapis/java-bigquery/commit/3895bd94b283b6ff731cfa94426ea0691e0d54c4)) + + +### Bug Fixes + +* Update samples snippet to write to BYTES instead of ARRAY<BYTES> ([#2876](https://github.com/googleapis/java-bigquery/issues/2876)) ([7e040e9](https://github.com/googleapis/java-bigquery/commit/7e040e97eeec762ab97190dea33b94769d681bf0)) + + +### Dependencies + +* Update actions/checkout action ([#2893](https://github.com/googleapis/java-bigquery/issues/2893)) ([e3655af](https://github.com/googleapis/java-bigquery/commit/e3655af235f002128979ed592c5aade33a4c7596)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.16.1 ([#2892](https://github.com/googleapis/java-bigquery/issues/2892)) ([e1d9871](https://github.com/googleapis/java-bigquery/commit/e1d987199ad8994aa3e9115daf26e0fb27aef911)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.27 ([#2885](https://github.com/googleapis/java-bigquery/issues/2885)) ([2237ca2](https://github.com/googleapis/java-bigquery/commit/2237ca2a1dbe9e1dc1d5e6c0dc2bd2fd39e01ef0)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.27 ([#2886](https://github.com/googleapis/java-bigquery/issues/2886)) ([539b4e6](https://github.com/googleapis/java-bigquery/commit/539b4e62f80598fb510fad37429ae0441db04c6f)) +* Update github/codeql-action action to v2.21.4 ([#2829](https://github.com/googleapis/java-bigquery/issues/2829)) ([599e3b3](https://github.com/googleapis/java-bigquery/commit/599e3b3d7e948a0688c6e08d4910f9db5c532f99)) +* Update github/codeql-action action to v2.21.8 - abandoned ([#2897](https://github.com/googleapis/java-bigquery/issues/2897)) ([ab4e1d0](https://github.com/googleapis/java-bigquery/commit/ab4e1d026c34b7d28caaf5b0b1465ac2de62c530)) +* Update github/codeql-action action to v2.21.8 ([#2889](https://github.com/googleapis/java-bigquery/issues/2889)) ([b568026](https://github.com/googleapis/java-bigquery/commit/b568026fe1b8fb7365306b718b5f8540fb13b8dc)) +* Update github/codeql-action action to v2.21.9 ([#2901](https://github.com/googleapis/java-bigquery/issues/2901)) ([33a729f](https://github.com/googleapis/java-bigquery/commit/33a729f367ba6d9f04595e1b781c7eb321289380)) + ## [2.32.0](https://github.com/googleapis/java-bigquery/compare/v2.31.2...v2.32.0) (2023-09-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index adb3df32ab..5c3a2a7652 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.32.1-SNAPSHOT + 2.33.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e8857bfc4a..8e836b6f39 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.32.1-SNAPSHOT + 2.33.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.32.1-SNAPSHOT + 2.33.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 40abac928d..13123299df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.32.1-SNAPSHOT + 2.33.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.32.1-SNAPSHOT + 2.33.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0a0005d9c3..7f01cd52ec 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.32.1-SNAPSHOT + 2.33.0 diff --git a/versions.txt b/versions.txt index 9301fb640b..139a314858 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.32.0:2.32.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.33.0:2.33.0 \ No newline at end of file From 8f85a4d540623e8b4c83005e62e842ba36f8fb1b Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:18:14 +0200 Subject: [PATCH 1406/2268] fix: dry run NPE when there is no query parameters (#2899) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes #2895 ☕️ --- .../google/cloud/bigquery/ConnectionImpl.java | 5 +++- .../cloud/bigquery/ConnectionImplTest.java | 28 +++++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 28 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 17a459312b..2d0367790e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -55,6 +55,7 @@ import java.io.IOException; import java.util.AbstractList; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -173,7 +174,9 @@ public BigQueryDryRunResult dryRun(String sql) throws BigQuerySQLException { List queryParametersPb = dryRunJob.getStatistics().getQuery().getUndeclaredQueryParameters(); List queryParameters = - Lists.transform(queryParametersPb, QUERY_PARAMETER_FROM_PB_FUNCTION); + queryParametersPb == null + ? Collections.emptyList() + : Lists.transform(queryParametersPb, QUERY_PARAMETER_FROM_PB_FUNCTION); QueryStatistics queryStatistics = JobStatistics.fromPb(dryRunJob); SessionInfo sessionInfo = queryStatistics.getSessionInfo() == null ? null : queryStatistics.getSessionInfo(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index d6348f053e..dff73d6bdf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -237,6 +237,34 @@ public void testQueryDryRun() throws BigQuerySQLException { .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); } + @Test + public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException { + com.google.api.services.bigquery.model.JobStatistics2 queryMock = + new com.google.api.services.bigquery.model.JobStatistics2() + .setSchema(FAST_QUERY_TABLESCHEMA); + com.google.api.services.bigquery.model.JobStatistics jobStatsMock = + new com.google.api.services.bigquery.model.JobStatistics() + .setCreationTime(1234L) + .setStartTime(5678L) + .setQuery(queryMock); + com.google.api.services.bigquery.model.JobConfigurationQuery jobConfigurationQuery = + new com.google.api.services.bigquery.model.JobConfigurationQuery(); + com.google.api.services.bigquery.model.JobConfiguration jobConfig = + new com.google.api.services.bigquery.model.JobConfiguration() + .setQuery(jobConfigurationQuery); + com.google.api.services.bigquery.model.Job mockDryRunJob = + new com.google.api.services.bigquery.model.Job() + .setStatistics(jobStatsMock) + .setConfiguration(jobConfig); + when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + .thenReturn(mockDryRunJob); + BigQueryDryRunResult dryRunResult = connection.dryRun(DRY_RUN_SQL); + assertEquals(0, dryRunResult.getQueryParameters().size()); + assertEquals(QUERY_SCHEMA, dryRunResult.getSchema()); + verify(bigqueryRpcMock, times(1)) + .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + } + @Test public void testParseDataTask() throws InterruptedException { BlockingQueue, Boolean>> pageCache = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index cf180f9a36..549066c5fc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2989,6 +2989,34 @@ public void testConnectionImplDryRun() throws SQLException { assertEquals(StatementType.SELECT, queryStatistics.getStatementType()); } + @Test + public void testConnectionImplDryRunNoQueryParameters() throws SQLException { + String query = + String.format( + "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, " + + "TimestampField, FloatField, NumericField, TimeField, DateField, DateTimeField, " + + "GeographyField, RecordField.BytesField, RecordField.BooleanField, " + + "IntegerArrayField from %s order by TimestampField", + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable()); + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setCreateSession(true) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryDryRunResult bigQueryDryRunResultSet = connection.dryRun(query); + assertNotNull(bigQueryDryRunResultSet.getSchema()); + assertEquals( + BQ_RESULTSET_EXPECTED_SCHEMA, bigQueryDryRunResultSet.getSchema()); // match the schema + List queryParameters = bigQueryDryRunResultSet.getQueryParameters(); + assertEquals(0, queryParameters.size()); + QueryStatistics queryStatistics = bigQueryDryRunResultSet.getStatistics().getQueryStatistics(); + assertNotNull(queryStatistics); + SessionInfo sessionInfo = bigQueryDryRunResultSet.getStatistics().getSessionInfo(); + assertNotNull(sessionInfo.getSessionId()); + assertEquals(StatementType.SELECT, queryStatistics.getStatementType()); + } + @Test // This test case test the order of the records, making sure that the result is not jumbled up due // to the multithreaded BigQueryResult implementation From b0a3311a85132f077f183251c3ad4f1205fb2fb3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 14:28:18 -0400 Subject: [PATCH 1407/2268] chore(main): release 2.33.1-SNAPSHOT (#2902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.33.1-SNAPSHOT * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- README.md | 6 +++--- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 60649dc7b9..e7eb451e71 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.32.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.33.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.32.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.32.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5c3a2a7652..9ba91158f5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.0 + 2.33.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8e836b6f39..64ca9d2230 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.0 + 2.33.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.0 + 2.33.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 13123299df..047ad0cdb5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.0 + 2.33.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.0 + 2.33.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7f01cd52ec..e0363b69e5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.0 + 2.33.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 139a314858..d9423a3ac3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.0:2.33.0 \ No newline at end of file +google-cloud-bigquery:2.33.0:2.33.1-SNAPSHOT \ No newline at end of file From 0ab89134897bed696d50e22aebc2f651684ff999 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 28 Sep 2023 21:06:34 +0200 Subject: [PATCH 1408/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.43.0 (#2906) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 047ad0cdb5..3d53134995 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.42.0 + 2.43.0 pom import From b81202b3bc4d53b2ef57edb0f9b9f3b9318c8871 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 28 Sep 2023 21:06:59 +0200 Subject: [PATCH 1409/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.33.0 (#2903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.33.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7eb451e71..80b1ce1a99 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.32.0 + 2.33.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 55b2bfc13c..65f4ca9618 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.32.0 + 2.33.0 From 91b83db5343d757cc02e1958b6028c14cfd72e52 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:45:44 -0400 Subject: [PATCH 1410/2268] chore(main): release 2.33.1 (#2907) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94c2f34ac9..732bdec1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.33.1](https://github.com/googleapis/java-bigquery/compare/v2.33.0...v2.33.1) (2023-09-28) + + +### Bug Fixes + +* Dry run NPE when there is no query parameters ([#2899](https://github.com/googleapis/java-bigquery/issues/2899)) ([8f85a4d](https://github.com/googleapis/java-bigquery/commit/8f85a4d540623e8b4c83005e62e842ba36f8fb1b)) + ## [2.33.0](https://github.com/googleapis/java-bigquery/compare/v2.32.0...v2.33.0) (2023-09-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9ba91158f5..cef22f9b9f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.1-SNAPSHOT + 2.33.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 64ca9d2230..f2d3a307a3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.1-SNAPSHOT + 2.33.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.1-SNAPSHOT + 2.33.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d53134995..fedd467c05 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.1-SNAPSHOT + 2.33.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.1-SNAPSHOT + 2.33.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e0363b69e5..dae7336105 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.1-SNAPSHOT + 2.33.1 diff --git a/versions.txt b/versions.txt index d9423a3ac3..ec7dfb0ad5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.0:2.33.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.33.1:2.33.1 \ No newline at end of file From 436ee8ebe9104f6ca721f1a14bd409158c7bdb5a Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:42:13 +0200 Subject: [PATCH 1411/2268] fix: getDouble in read API path (#2919) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [X] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigquery/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [X] Appropriate docs were updated (if necessary) Fixes #2905 ☕️ --- README.md | 6 +++--- .../java/com/google/cloud/bigquery/BigQueryResultImpl.java | 2 +- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 80b1ce1a99..80d18fd309 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.33.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.33.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java index 2a2aba7cd2..e944efceba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -337,7 +337,7 @@ public double getDouble(String fieldName) throws SQLException { throw new SQLException(String.format("Field %s not found", fieldName)); } Object curVal = curRow.get(fieldName); - return curVal == null ? 0.0d : ((BigDecimal) curVal).doubleValue(); + return curVal == null ? 0.0d : new BigDecimal(curVal.toString()).doubleValue(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 549066c5fc..1ff8597455 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3230,7 +3230,7 @@ public void testReadAPIIterationAndOrderAsync() throws SQLException, ExecutionException, InterruptedException { // use read API to read 300K records and check the order String query = - "SELECT date, county, state_name, confirmed_cases, deaths FROM " + "SELECT date, county, state_name, confirmed_cases, deaths / 10 FROM " + TABLE_ID_LARGE.getTable() + " where date is not null and county is not null and state_name is not null order by confirmed_cases asc limit 300000"; @@ -3255,7 +3255,8 @@ public void testReadAPIIterationAndOrderAsync() assertNotNull(rs.getString(1)); assertNotNull(rs.getString(2)); assertTrue(rs.getInt(3) >= 0); - assertTrue(rs.getInt(4) >= 0); + assertTrue(rs.getDouble(3) >= 0); + assertTrue(rs.getDouble(4) >= 0); // check if the records are sorted assertTrue(rs.getInt(3) >= lasConfirmedCases); From bc6ae298164e03be7ce6a7c6be2ef8e955c33a36 Mon Sep 17 00:00:00 2001 From: Alice <65933803+alicejli@users.noreply.github.com> Date: Tue, 10 Oct 2023 09:47:34 -0400 Subject: [PATCH 1412/2268] build: do not declare javadoc plugin version (#2929) --- README.md | 2 +- pom.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 80d18fd309..361806ec55 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.23.0') +implementation platform('com.google.cloud:libraries-bom:26.24.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index fedd467c05..860f1f3292 100644 --- a/pom.xml +++ b/pom.xml @@ -224,7 +224,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.0 html From 66ab2294d57580deca45008da012e75412db6418 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 10 Oct 2023 17:03:09 +0200 Subject: [PATCH 1413/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.33.1 (#2909) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.33.1 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 361806ec55..2a30c8073a 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.33.0 + 2.33.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 65f4ca9618..10c1f5de19 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.33.0 + 2.33.1 From 719be8a6a010fa8eaf535bb34f2ee2505f461bab Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 10 Oct 2023 17:03:33 +0200 Subject: [PATCH 1414/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.29.0 (#2910) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.29.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 860f1f3292..df707a4a76 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.26.0 + 2.29.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 10c1f5de19..eab1c8fcd0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.26.0 + 2.29.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dae7336105..8f1de32c5a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.26.0 + 2.29.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a37ed03fbe..20910eb895 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.26.0 + 2.29.0 test From 052f5c2f722243be39c0d93b1f81b81a0db48ef1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 10 Oct 2023 17:03:57 +0200 Subject: [PATCH 1415/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.29.0 (#2911) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.29.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df707a4a76..1503c0d7bd 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.26.0 + 2.29.0 test From e05349476a8d987b2cd24ee6a80b2d9b7b9463ee Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:21:12 +0200 Subject: [PATCH 1416/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.33.0 (#2912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.33.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1503c0d7bd..fe077b0438 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.30.0 + 1.33.0 pom import From e497cb07c16350bf3b24921368cb3fb78fc3512b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:21:39 +0200 Subject: [PATCH 1417/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.27.3 (#2914) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.27.3 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index eab1c8fcd0..a3b699fef8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.27.2 + 2.27.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8f1de32c5a..2fc00f056f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.27.2 + 2.27.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 20910eb895..0436705e7f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.27.2 + 2.27.3 test From f0fb64f43817c5aa53adb6c5152afe3fd44b7df1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:22:00 +0200 Subject: [PATCH 1418/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230925-2.0.0 (#2921) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20230925-2.0.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe077b0438..755ec2034f 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230812-2.0.0 + v2-rev20230925-2.0.0 3.16.1 12.0.1 From f67a67078791a685bdfb0be86d461737a7fa9314 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:22:22 +0200 Subject: [PATCH 1419/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.8 (#2924) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.8 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 755ec2034f..47e3673280 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.7 + 1.5.8 From 33ce4aee8b10f630212d96901af00f063c43f440 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:22:53 +0200 Subject: [PATCH 1420/2268] deps: update github/codeql-action action to v2.22.0 (#2926) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.22.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 32d3cc29b8..72c0fc8717 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2.21.9 + uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0 with: sarif_file: results.sarif From 93bfd8eb7fe35121e97b06cf8b103a3960fe9535 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 16:23:21 +0200 Subject: [PATCH 1421/2268] deps: update ossf/scorecard-action action to v2.3.0 (#2927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update ossf/scorecard-action action to v2.3.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 72c0fc8717..14f628fc94 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 + uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0 with: results_file: results.sarif results_format: sarif From 7c05b51364e38a4fb6b193ef6de930110c1266db Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:28:29 -0400 Subject: [PATCH 1422/2268] chore(main): release 2.33.2-SNAPSHOT (#2908) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cef22f9b9f..5b508fd35e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.1 + 2.33.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f2d3a307a3..c7d9db971c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.1 + 2.33.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.1 + 2.33.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 47e3673280..0715de4df9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.1 + 2.33.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.1 + 2.33.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2fc00f056f..daf40c9595 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.1 + 2.33.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ec7dfb0ad5..b9e92abbc6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.1:2.33.1 \ No newline at end of file +google-cloud-bigquery:2.33.1:2.33.2-SNAPSHOT \ No newline at end of file From 25a94f1da840c0cb32bed882e18f7b10f9890d04 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 17:28:57 +0200 Subject: [PATCH 1423/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 (#2931) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0715de4df9..a771fb99b4 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20230925-2.0.0 - 3.16.1 + 3.17.0 12.0.1 From f6b4b60a08ad3de409267581ba2e1145d5d1073d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 17:29:30 +0200 Subject: [PATCH 1424/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.27.4 (#2933) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a3b699fef8..0648fec10d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.27.3 + 2.27.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index daf40c9595..4236aca133 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.27.3 + 2.27.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0436705e7f..352e86adab 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.27.3 + 2.27.4 test From 7ae7b99ab21fcd6e74cbaa95e750da961c09ae80 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 17:29:54 +0200 Subject: [PATCH 1425/2268] deps: update github/codeql-action action to v2.22.1 (#2934) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 14f628fc94..71db8036bb 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0 + uses: github/codeql-action/upload-sarif@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1 with: sarif_file: results.sarif From 1831e5f8bcdb70e5d562925277c90774e830b037 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Oct 2023 18:53:16 +0200 Subject: [PATCH 1426/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.44.0 (#2936) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a771fb99b4..1e6b4f8d57 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.43.0 + 2.44.0 pom import From b82692a82f4bbed88b7954cd50aeb6cef1416b52 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:56:20 -0400 Subject: [PATCH 1427/2268] chore(main): release 2.33.2 (#2937) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 732bdec1ad..07d11f8888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.33.2](https://github.com/googleapis/java-bigquery/compare/v2.33.1...v2.33.2) (2023-10-11) + + +### Bug Fixes + +* GetDouble in read API path ([#2919](https://github.com/googleapis/java-bigquery/issues/2919)) ([436ee8e](https://github.com/googleapis/java-bigquery/commit/436ee8ebe9104f6ca721f1a14bd409158c7bdb5a)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.29.0 ([#2911](https://github.com/googleapis/java-bigquery/issues/2911)) ([052f5c2](https://github.com/googleapis/java-bigquery/commit/052f5c2f722243be39c0d93b1f81b81a0db48ef1)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230925-2.0.0 ([#2921](https://github.com/googleapis/java-bigquery/issues/2921)) ([f0fb64f](https://github.com/googleapis/java-bigquery/commit/f0fb64f43817c5aa53adb6c5152afe3fd44b7df1)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.33.0 ([#2912](https://github.com/googleapis/java-bigquery/issues/2912)) ([e053494](https://github.com/googleapis/java-bigquery/commit/e05349476a8d987b2cd24ee6a80b2d9b7b9463ee)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 ([#2931](https://github.com/googleapis/java-bigquery/issues/2931)) ([25a94f1](https://github.com/googleapis/java-bigquery/commit/25a94f1da840c0cb32bed882e18f7b10f9890d04)) +* Update github/codeql-action action to v2.22.0 ([#2926](https://github.com/googleapis/java-bigquery/issues/2926)) ([33ce4ae](https://github.com/googleapis/java-bigquery/commit/33ce4aee8b10f630212d96901af00f063c43f440)) +* Update github/codeql-action action to v2.22.1 ([#2934](https://github.com/googleapis/java-bigquery/issues/2934)) ([7ae7b99](https://github.com/googleapis/java-bigquery/commit/7ae7b99ab21fcd6e74cbaa95e750da961c09ae80)) +* Update ossf/scorecard-action action to v2.3.0 ([#2927](https://github.com/googleapis/java-bigquery/issues/2927)) ([93bfd8e](https://github.com/googleapis/java-bigquery/commit/93bfd8eb7fe35121e97b06cf8b103a3960fe9535)) + ## [2.33.1](https://github.com/googleapis/java-bigquery/compare/v2.33.0...v2.33.1) (2023-09-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5b508fd35e..cd086b1116 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.2-SNAPSHOT + 2.33.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c7d9db971c..53bd43904f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.2-SNAPSHOT + 2.33.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.2-SNAPSHOT + 2.33.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1e6b4f8d57..9def71c132 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.2-SNAPSHOT + 2.33.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.2-SNAPSHOT + 2.33.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4236aca133..53288c26ee 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.2-SNAPSHOT + 2.33.2 diff --git a/versions.txt b/versions.txt index b9e92abbc6..004398030c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.1:2.33.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.33.2:2.33.2 \ No newline at end of file From 1d660fa19f0d82c2b6ec2ea9590881e513274c25 Mon Sep 17 00:00:00 2001 From: Teja Vemparala <40125841+vteja11@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:19:13 -0700 Subject: [PATCH 1428/2268] feat: Add BigLakeConfiguration Property in StandardTableDefinition.java (#2916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added BigLakeConfiguration in standard table defenition * feat: Add BigLakeConfiguration Property in StandardTableDefinition.java * feat: Update copyright dates to 2023 * feat: Removed bigstore and gs:/ from docs * feat: Renamed Biglake to BigLake * feat: Adding difference entry to resolve clirr error * feat: Refactored formatting to comply with project rules * 🦉 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 --- .../clirr-ignored-differences.xml | 5 + .../cloud/bigquery/BigLakeConfiguration.java | 120 ++++++++++++++++++ .../bigquery/StandardTableDefinition.java | 21 +++ .../bigquery/BigLakeConfigurationTest.java | 80 ++++++++++++ .../bigquery/StandardTableDefinitionTest.java | 8 ++ 5 files changed, 234 insertions(+) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigLakeConfiguration.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index eaeeded132..b2d5aef0fe 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -109,4 +109,9 @@ com/google/cloud/bigquery/DatasetInfo* *setExternalDatasetReference(*) + + 7013 + com/google/cloud/bigquery/StandardTableDefinition* + *BigLakeConfiguration(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigLakeConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigLakeConfiguration.java new file mode 100644 index 0000000000..76b3f55d94 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigLakeConfiguration.java @@ -0,0 +1,120 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; + +@AutoValue +public abstract class BigLakeConfiguration implements Serializable { + + private static final long serialVersionUID = -5951589238459622025L; + + /** + * Credential reference for accessing external storage system. Normalized as + * project_id.location_id.connection_id. + * + * @return value or {@code null} for none + */ + public abstract String getConnectionId(); + + /** + * Open source file format that the table data is stored in. Currently only PARQUET is supported. + * + * @return value or {@code null} for none + */ + public abstract String getFileFormat(); + + /** + * Fully qualified location prefix of the external folder where data is stored. Starts with + * "gs://" ends with "/". Does not contain "*". + * + * @return value or {@code null} for none + */ + public abstract String getStorageUri(); + + /** + * Open source file format that the table data is stored in. Currently only PARQUET is supported. + * + * @return value or {@code null} for none + */ + public abstract String getTableFormat(); + + public static Builder newBuilder() { + return new AutoValue_BigLakeConfiguration.Builder(); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + /** + * [Required] Required and immutable. Credential reference for accessing external storage + * system. Normalized as project_id.location_id.connection_id. + * + * @param connectionId connectionId or {@code null} for none + */ + public abstract Builder setConnectionId(String connectionId); + + /** + * [Required] Required and immutable. Open source file format that the table data is stored in. + * Currently only PARQUET is supported. + * + * @param fileFormat fileFormat or {@code null} for none + */ + public abstract Builder setFileFormat(String fileFormat); + + /** + * [Required] Required and immutable. Fully qualified location prefix of the external folder + * where data is stored. Starts with "gs://" and ends with "/". Does not contain "*". + * + * @param storageUri storageUri or {@code null} for none + */ + public abstract Builder setStorageUri(String storageUri); + + /** + * [Required] Required and immutable. Open source file format that the table data is stored in. + * Currently only PARQUET is supported. + * + * @param tableFormat tableFormat or {@code null} for none + */ + public abstract Builder setTableFormat(String tableFormat); + + public abstract BigLakeConfiguration build(); + } + + com.google.api.services.bigquery.model.BigLakeConfiguration toPb() { + com.google.api.services.bigquery.model.BigLakeConfiguration biglakeConfiguration = + new com.google.api.services.bigquery.model.BigLakeConfiguration(); + biglakeConfiguration.setConnectionId(getConnectionId()); + biglakeConfiguration.setFileFormat(getFileFormat()); + biglakeConfiguration.setStorageUri(getStorageUri()); + biglakeConfiguration.setTableFormat(getTableFormat()); + + return biglakeConfiguration; + } + + static BigLakeConfiguration fromPb( + com.google.api.services.bigquery.model.BigLakeConfiguration biglakeConfigurationPb) { + return newBuilder() + .setConnectionId(biglakeConfigurationPb.getConnectionId()) + .setFileFormat(biglakeConfigurationPb.getFileFormat()) + .setStorageUri(biglakeConfigurationPb.getStorageUri()) + .setTableFormat(biglakeConfigurationPb.getTableFormat()) + .build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java index f4459d734a..0319a6a4dd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardTableDefinition.java @@ -177,6 +177,12 @@ public abstract static class Builder public abstract Builder setTableConstraints(TableConstraints tableConstraints); + /** + * Set the configuration of a BigLake managed table. If not set, the table is not a BigLake + * managed table. + */ + public abstract Builder setBigLakeConfiguration(BigLakeConfiguration biglakeConfiguration); + /** Creates a {@code StandardTableDefinition} object. */ public abstract StandardTableDefinition build(); } @@ -300,6 +306,13 @@ public abstract static class Builder @Nullable public abstract TableConstraints getTableConstraints(); + /** + * [Optional] Specifies the configuration of a BigLake managed table. The value may be {@code + * null}. + */ + @Nullable + public abstract BigLakeConfiguration getBigLakeConfiguration(); + /** Returns a builder for a BigQuery standard table definition. */ public static Builder newBuilder() { return new AutoValue_StandardTableDefinition.Builder().setType(Type.TABLE); @@ -348,6 +361,9 @@ Table toPb() { if (getTableConstraints() != null) { tablePb.setTableConstraints(getTableConstraints().toPb()); } + if (getBigLakeConfiguration() != null) { + tablePb.setBiglakeConfiguration(getBigLakeConfiguration().toPb()); + } return tablePb; } @@ -409,6 +425,11 @@ static StandardTableDefinition fromPb(Table tablePb) { if (tablePb.getTableConstraints() != null) { builder.setTableConstraints(TableConstraints.fromPb(tablePb.getTableConstraints())); } + if (tablePb.getBiglakeConfiguration() != null) { + builder.setBigLakeConfiguration( + BigLakeConfiguration.fromPb(tablePb.getBiglakeConfiguration())); + } + return builder.setNumBytes(tablePb.getNumBytes()).setLocation(tablePb.getLocation()).build(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java new file mode 100644 index 0000000000..afb2b5b10a --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class BigLakeConfigurationTest { + + private static final String STORAGE_URI = "gs://storage-uri"; + private static final String FILE_FORMAT = "PARQUET"; + private static final String TABLE_FORMAT = "ICEBERG"; + private static final String CONNECTION_ID = "us.test-connection"; + + private static final BigLakeConfiguration BIG_LAKE_CONFIGURATION = + BigLakeConfiguration.newBuilder() + .setStorageUri(STORAGE_URI) + .setFileFormat(FILE_FORMAT) + .setTableFormat(TABLE_FORMAT) + .setConnectionId(CONNECTION_ID) + .build(); + private static final com.google.api.services.bigquery.model.BigLakeConfiguration + BIG_LAKE_CONFIGURATION_PB = + new com.google.api.services.bigquery.model.BigLakeConfiguration() + .setStorageUri(STORAGE_URI) + .setFileFormat(FILE_FORMAT) + .setTableFormat(TABLE_FORMAT) + .setConnectionId(CONNECTION_ID); + + @Test + public void testToBuilder() { + assertEquals(STORAGE_URI, BIG_LAKE_CONFIGURATION.getStorageUri()); + assertEquals(FILE_FORMAT, BIG_LAKE_CONFIGURATION.getFileFormat()); + assertEquals(TABLE_FORMAT, BIG_LAKE_CONFIGURATION.getTableFormat()); + assertEquals(CONNECTION_ID, BIG_LAKE_CONFIGURATION.getConnectionId()); + } + + @Test + public void testToPb() { + assertBigLakeConfiguration(BIG_LAKE_CONFIGURATION_PB, BIG_LAKE_CONFIGURATION.toPb()); + } + + @Test + public void testFromPb() { + assertBigLakeConfiguration( + BIG_LAKE_CONFIGURATION, BigLakeConfiguration.fromPb(BIG_LAKE_CONFIGURATION_PB)); + } + + private static void assertBigLakeConfiguration( + BigLakeConfiguration expected, BigLakeConfiguration actual) { + assertEquals(expected.getConnectionId(), actual.getConnectionId()); + assertEquals(expected.getTableFormat(), actual.getTableFormat()); + assertEquals(expected.getStorageUri(), actual.getStorageUri()); + assertEquals(expected.getFileFormat(), actual.getFileFormat()); + } + + private static void assertBigLakeConfiguration( + com.google.api.services.bigquery.model.BigLakeConfiguration expected, + com.google.api.services.bigquery.model.BigLakeConfiguration actual) { + assertEquals(expected.getConnectionId(), actual.getConnectionId()); + assertEquals(expected.getTableFormat(), actual.getTableFormat()); + assertEquals(expected.getStorageUri(), actual.getStorageUri()); + assertEquals(expected.getFileFormat(), actual.getFileFormat()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java index df0e5d79b0..8fbe3cefe7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java @@ -65,6 +65,13 @@ public class StandardTableDefinitionTest { TimePartitioning.of(TimePartitioning.Type.DAY, 42); private static final Clustering CLUSTERING = Clustering.newBuilder().setFields(ImmutableList.of("Foo", "Bar")).build(); + private static final BigLakeConfiguration BIG_LAKE_CONFIGURATION = + BigLakeConfiguration.newBuilder() + .setConnectionId("us.connection-test") + .setTableFormat("ICEBERG") + .setFileFormat("PARQUET") + .setStorageUri("gs://java-bigquery-test/standard-table-def") + .build(); private static final StandardTableDefinition TABLE_DEFINITION = StandardTableDefinition.newBuilder() .setLocation(LOCATION) @@ -82,6 +89,7 @@ public class StandardTableDefinitionTest { .setSchema(TABLE_SCHEMA) .setTimePartitioning(TIME_PARTITIONING) .setClustering(CLUSTERING) + .setBigLakeConfiguration(BIG_LAKE_CONFIGURATION) .build(); @Test From 5b914af089ad18577ee5be04bb86c7673f37478b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:28:14 +0200 Subject: [PATCH 1429/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.6.0 (#2951) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.8` -> `1.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-shared-config/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-shared-config/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-shared-config/1.5.8/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-shared-config/1.5.8/1.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes

      googleapis/java-shared-config (com.google.cloud:google-cloud-shared-config) ### [`v1.6.0`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#160-2023-10-17) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.8...v1.6.0) ##### Features - Add graal-sdk dependency management to java-shared-config ([#​683](https://togithub.com/googleapis/java-shared-config/issues/683)) ([5cd1d84](https://togithub.com/googleapis/java-shared-config/commit/5cd1d84bf2d68dbe8f9fa7e02d9065082bd56726))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 8 ++++---- pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2a30c8073a..879d879e2e 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.24.0') +implementation platform('com.google.cloud:libraries-bom:26.25.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.33.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.33.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/pom.xml b/pom.xml index 9def71c132..a5a2d87e1b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.8 + 1.6.0 From 08de88a5ed63f276f7c3c033ed6d1bcb7cfa4525 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:30:15 +0200 Subject: [PATCH 1430/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.30.0 (#2941) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigqueryconnection](https://togithub.com/googleapis/google-cloud-java) | `2.29.0` -> `2.30.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigqueryconnection/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigqueryconnection/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigqueryconnection/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigqueryconnection/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a5a2d87e1b..aaba96f2a3 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.29.0 + 2.30.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0648fec10d..8bac6d793e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.29.0 + 2.30.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 53288c26ee..671ce2de07 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.29.0 + 2.30.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 352e86adab..3578d289eb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.29.0 + 2.30.0 test From 4d86bb007ae3939f41c30c8698882798a0858856 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:30:23 +0200 Subject: [PATCH 1431/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.28.0 (#2938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-storage](https://togithub.com/googleapis/java-storage) | `2.27.1` -> `2.28.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-storage/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-storage/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-storage/2.27.1/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-storage/2.27.1/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
      googleapis/java-storage (com.google.cloud:google-cloud-storage) ### [`v2.28.0`](https://togithub.com/googleapis/java-storage/blob/HEAD/CHANGELOG.md#2280-2023-10-10) ##### Features - Add [@​BetaApi](https://togithub.com/BetaApi) BlobWriteSession#parallelCompositeUpload ([#​2239](https://togithub.com/googleapis/java-storage/issues/2239)) ([f8f4e22](https://togithub.com/googleapis/java-storage/commit/f8f4e221ae81cf69387827014c9f98a466bb7f19)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 ([#​2250](https://togithub.com/googleapis/java-storage/issues/2250)) ([df687f2](https://togithub.com/googleapis/java-storage/commit/df687f2604be214f05d2bebc94e4d81421003577)) - Update gcr.io/cloud-devrel-public-resources/storage-testbench docker tag to v0.39.0 ([#​2249](https://togithub.com/googleapis/java-storage/issues/2249)) ([fe85df9](https://togithub.com/googleapis/java-storage/commit/fe85df9bf46d76f067819ce3ed94d874818a739e)) ##### Documentation - Reorder columns in table of BlobWriteSessionConfigs.java ([#​2242](https://togithub.com/googleapis/java-storage/issues/2242)) ([98e694f](https://togithub.com/googleapis/java-storage/commit/98e694f3182b194f5e6fbde4fb0a924f17a06c40))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aaba96f2a3..9a377dadc8 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.27.1 + 2.28.0 test From 3d0da5b5a20f49721477afbed10ea3fff43652bb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:30:36 +0200 Subject: [PATCH 1432/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20231008-2.0.0 (#2946) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.apis:google-api-services-bigquery](http://nexus.sonatype.org/oss-repository-hosting.html) ([source](http://svn.sonatype.org/spice/tags/oss-parent-7)) | `v2-rev20230925-2.0.0` -> `v2-rev20231008-2.0.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.apis:google-api-services-bigquery/v2-rev20231008-2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.apis:google-api-services-bigquery/v2-rev20231008-2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.apis:google-api-services-bigquery/v2-rev20230925-2.0.0/v2-rev20231008-2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.apis:google-api-services-bigquery/v2-rev20230925-2.0.0/v2-rev20231008-2.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a377dadc8..9b6c0691df 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20230925-2.0.0 + v2-rev20231008-2.0.0 3.17.0 12.0.1
      From 18162c37c97eff6387e0f58d211f2c1725a9c8d3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:30:43 +0200 Subject: [PATCH 1433/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.34.0 (#2943) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-datacatalog-bom](https://togithub.com/googleapis/google-cloud-java) | `1.33.0` -> `1.34.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-datacatalog-bom/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-datacatalog-bom/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-datacatalog-bom/1.33.0/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-datacatalog-bom/1.33.0/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b6c0691df..2cdca0fba7 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.33.0 + 1.34.0 pom import From 2e28db5243a08db2ea708abe3c8f586cff94c1db Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:32:13 +0200 Subject: [PATCH 1434/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.28.0 (#2945) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigtable](https://togithub.com/googleapis/java-bigtable) | `2.27.4` -> `2.28.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigtable/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigtable/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigtable/2.27.4/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigtable/2.27.4/2.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes
      googleapis/java-bigtable (com.google.cloud:google-cloud-bigtable) ### [`v2.28.0`](https://togithub.com/googleapis/java-bigtable/blob/HEAD/CHANGELOG.md#2280-2023-10-12) [Compare Source](https://togithub.com/googleapis/java-bigtable/compare/v2.27.4...v2.28.0) ##### Features - Add support for Cloud Bigtable Request Priorities in App Profiles ([#​1954](https://togithub.com/googleapis/java-bigtable/issues/1954)) ([8822571](https://togithub.com/googleapis/java-bigtable/commit/88225717b870032b8892123262d2529ba1dbd481)) - Add test profile to push metrics to test environment ([#​1921](https://togithub.com/googleapis/java-bigtable/issues/1921)) ([2104315](https://togithub.com/googleapis/java-bigtable/commit/210431523ce54029db846a0d6777d5e417e039dd)) ##### Dependencies - Update shared dependencies ([#​1955](https://togithub.com/googleapis/java-bigtable/issues/1955)) ([f29717e](https://togithub.com/googleapis/java-bigtable/commit/f29717e3f1af03a78ce9468cdafa8c09dfb1b216))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8bac6d793e..4e6882e6cb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.27.4 + 2.28.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 671ce2de07..a923c5c5a5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.27.4 + 2.28.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3578d289eb..f9bc150da1 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.27.4 + 2.28.0 test From e760fcae98b23ff4e7fc3ae25f2437be220e9df9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:32:18 +0200 Subject: [PATCH 1435/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.30.0 (#2942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1](https://togithub.com/googleapis/google-cloud-java) | `2.29.0` -> `2.30.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1/2.29.0/2.30.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2cdca0fba7..db121fddac 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.29.0 + 2.30.0 test From fa879be92bafcade88e1dd1596affec4550565dd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Oct 2023 21:34:15 +0200 Subject: [PATCH 1436/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.33.2 (#2940) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.33.1` -> `2.33.2` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.33.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.33.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.33.1/2.33.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.33.1/2.33.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
      googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.33.2`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2332-2023-10-11) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.33.1...v2.33.2) ##### Bug Fixes - GetDouble in read API path ([#​2919](https://togithub.com/googleapis/java-bigquery/issues/2919)) ([436ee8e](https://togithub.com/googleapis/java-bigquery/commit/436ee8ebe9104f6ca721f1a14bd409158c7bdb5a)) ##### Dependencies - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.29.0 ([#​2911](https://togithub.com/googleapis/java-bigquery/issues/2911)) ([052f5c2](https://togithub.com/googleapis/java-bigquery/commit/052f5c2f722243be39c0d93b1f81b81a0db48ef1)) - Update dependency com.google.apis:google-api-services-bigquery to v2-rev20230925-2.0.0 ([#​2921](https://togithub.com/googleapis/java-bigquery/issues/2921)) ([f0fb64f](https://togithub.com/googleapis/java-bigquery/commit/f0fb64f43817c5aa53adb6c5152afe3fd44b7df1)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.33.0 ([#​2912](https://togithub.com/googleapis/java-bigquery/issues/2912)) ([e053494](https://togithub.com/googleapis/java-bigquery/commit/e05349476a8d987b2cd24ee6a80b2d9b7b9463ee)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 ([#​2931](https://togithub.com/googleapis/java-bigquery/issues/2931)) ([25a94f1](https://togithub.com/googleapis/java-bigquery/commit/25a94f1da840c0cb32bed882e18f7b10f9890d04)) - Update github/codeql-action action to v2.22.0 ([#​2926](https://togithub.com/googleapis/java-bigquery/issues/2926)) ([33ce4ae](https://togithub.com/googleapis/java-bigquery/commit/33ce4aee8b10f630212d96901af00f063c43f440)) - Update github/codeql-action action to v2.22.1 ([#​2934](https://togithub.com/googleapis/java-bigquery/issues/2934)) ([7ae7b99](https://togithub.com/googleapis/java-bigquery/commit/7ae7b99ab21fcd6e74cbaa95e750da961c09ae80)) - Update ossf/scorecard-action action to v2.3.0 ([#​2927](https://togithub.com/googleapis/java-bigquery/issues/2927)) ([93bfd8e](https://togithub.com/googleapis/java-bigquery/commit/93bfd8eb7fe35121e97b06cf8b103a3960fe9535))
      --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 879d879e2e..6eb5a01fa5 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.33.1 + 2.33.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4e6882e6cb..c515cb9a22 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.33.1 + 2.33.2 From c556c1837baf0d53245452d6a152910df7883262 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 18 Oct 2023 15:57:09 +0200 Subject: [PATCH 1437/2268] deps: update actions/checkout action to v4.1.1 (#2950) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action to v4.1.1 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 71db8036bb..6113c14606 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: persist-credentials: false From f584e59571f0c7918d2d83a19b00d49bd5b558c4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 18 Oct 2023 15:57:47 +0200 Subject: [PATCH 1438/2268] deps: update github/codeql-action action to v2.22.2 (#2944) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.22.2 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6113c14606..45b686d2d5 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1 + uses: github/codeql-action/upload-sarif@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.22.2 with: sarif_file: results.sarif From 1b2bc18bf49d06e1ccd29745be649108dd28cfa5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 18 Oct 2023 17:07:49 +0200 Subject: [PATCH 1439/2268] deps: update github/codeql-action action to v2.22.3 (#2954) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 45b686d2d5..26169295a5 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d90b8d79de6dc1f58e83a1499aa58d6c93dc28de # v2.22.2 + uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: sarif_file: results.sarif From f452cf4e100b6cc211681a840ddbd0be5108d01e Mon Sep 17 00:00:00 2001 From: brendan Date: Fri, 20 Oct 2023 09:16:16 -0400 Subject: [PATCH 1440/2268] feat: Add support for Dataset property storageBillingModel (#2913) Adds support for setting and getting the BigQuery v2 API Dataset property `storageBillingModel`, to allow end users to set the billing model depending on their use case. When no billing model is provided, the existing behavior (use the default billing model) continues. --- .../clirr-ignored-differences.xml | 5 ++++ .../com/google/cloud/bigquery/Dataset.java | 6 +++++ .../google/cloud/bigquery/DatasetInfo.java | 25 +++++++++++++++++++ .../cloud/bigquery/DatasetInfoTest.java | 6 +++++ .../google/cloud/bigquery/DatasetTest.java | 5 ++++ .../cloud/bigquery/it/ITBigQueryTest.java | 23 +++++++++++++++++ 6 files changed, 70 insertions(+) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index b2d5aef0fe..c22579a795 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -109,6 +109,11 @@ com/google/cloud/bigquery/DatasetInfo* *setExternalDatasetReference(*) + + 7013 + com/google/cloud/bigquery/DatasetInfo* + *setStorageBillingModel(*) + 7013 com/google/cloud/bigquery/StandardTableDefinition* diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index 3ed4b89287..daadb9a857 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -158,6 +158,12 @@ public Builder setExternalDatasetReference(ExternalDatasetReference externalData return this; } + @Override + public Builder setStorageBillingModel(String storageBillingModel) { + infoBuilder.setStorageBillingModel(storageBillingModel); + return this; + } + @Override public Dataset build() { return new Dataset(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index 44583e0c85..0dddc0e86f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -74,6 +74,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final Long defaultPartitionExpirationMs; private final String defaultCollation; private final ExternalDatasetReference externalDatasetReference; + private final String storageBillingModel; /** A builder for {@code DatasetInfo} objects. */ public abstract static class Builder { @@ -135,6 +136,12 @@ public abstract static class Builder { public abstract Builder setExternalDatasetReference( ExternalDatasetReference externalDatasetReference); + /** + * Optional. Storage billing model to be used for all tables in the dataset. Can be set to + * PHYSICAL. Default is LOGICAL. + */ + public abstract Builder setStorageBillingModel(String storageBillingModel); + /** * The default encryption key for all tables in the dataset. Once this property is set, all * newly-created partitioned tables in the dataset will have encryption key set to this value, @@ -192,6 +199,7 @@ static final class BuilderImpl extends Builder { private Long defaultPartitionExpirationMs; private String defaultCollation; private ExternalDatasetReference externalDatasetReference; + private String storageBillingModel; BuilderImpl() {} @@ -212,6 +220,7 @@ static final class BuilderImpl extends Builder { this.defaultPartitionExpirationMs = datasetInfo.defaultPartitionExpirationMs; this.defaultCollation = datasetInfo.defaultCollation; this.externalDatasetReference = datasetInfo.externalDatasetReference; + this.storageBillingModel = datasetInfo.storageBillingModel; } BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) { @@ -250,6 +259,7 @@ public Acl apply(Dataset.Access accessPb) { this.externalDatasetReference = ExternalDatasetReference.fromPb(datasetPb.getExternalDatasetReference()); } + this.storageBillingModel = datasetPb.getStorageBillingModel(); } @Override @@ -356,6 +366,12 @@ public Builder setExternalDatasetReference(ExternalDatasetReference externalData return this; } + @Override + public Builder setStorageBillingModel(String storageBillingModel) { + this.storageBillingModel = storageBillingModel; + return this; + } + @Override public DatasetInfo build() { return new DatasetInfo(this); @@ -379,6 +395,7 @@ public DatasetInfo build() { defaultPartitionExpirationMs = builder.defaultPartitionExpirationMs; defaultCollation = builder.defaultCollation; externalDatasetReference = builder.externalDatasetReference; + storageBillingModel = builder.storageBillingModel; } /** Returns the dataset identity. */ @@ -508,6 +525,10 @@ public String getDefaultCollation() { return defaultCollation; } + public String getStorageBillingModel() { + return storageBillingModel; + } + /** * Returns information about the external metadata storage where the dataset is defined. Filled * out when the dataset type is EXTERNAL. @@ -540,6 +561,7 @@ public String toString() { .add("defaultPartitionExpirationMs", defaultPartitionExpirationMs) .add("defaultCollation", defaultCollation) .add("externalDatasetReference", externalDatasetReference) + .add("storageBillingModel", storageBillingModel) .toString(); } @@ -621,6 +643,9 @@ public Dataset.Access apply(Acl acl) { if (externalDatasetReference != null) { datasetPb.setExternalDatasetReference(externalDatasetReference.toPb()); } + if (storageBillingModel != null) { + datasetPb.setStorageBillingModel(storageBillingModel); + } return datasetPb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index c91cbc2f30..df62b7dac8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -58,6 +58,7 @@ public class DatasetInfoTest { private static final DatasetId DATASET_ID_COMPLETE = DatasetId.of("project", "dataset"); private static final EncryptionConfiguration DATASET_ENCRYPTION_CONFIGURATION = EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); + private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = ExternalDatasetReference.newBuilder() @@ -79,6 +80,7 @@ public class DatasetInfoTest { .setLabels(LABELS) .setDefaultEncryptionConfiguration(DATASET_ENCRYPTION_CONFIGURATION) .setDefaultPartitionExpirationMs(DEFAULT_PARTITION__EXPIRATION) + .setStorageBillingModel(STORAGE_BILLING_MODEL) .build(); private static final DatasetInfo DATASET_INFO_COMPLETE = DATASET_INFO @@ -170,6 +172,7 @@ public void testBuilder() { assertEquals( EXTERNAL_DATASET_REFERENCE, DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.getExternalDatasetReference()); + assertEquals(STORAGE_BILLING_MODEL, DATASET_INFO_COMPLETE.getStorageBillingModel()); } @Test @@ -190,6 +193,7 @@ public void testOf() { assertNull(datasetInfo.getDefaultPartitionExpirationMs()); assertTrue(datasetInfo.getLabels().isEmpty()); assertNull(datasetInfo.getExternalDatasetReference()); + assertNull(datasetInfo.getStorageBillingModel()); datasetInfo = DatasetInfo.of(DATASET_ID); assertEquals(DATASET_ID, datasetInfo.getDatasetId()); @@ -207,6 +211,7 @@ public void testOf() { assertNull(datasetInfo.getDefaultPartitionExpirationMs()); assertTrue(datasetInfo.getLabels().isEmpty()); assertNull(datasetInfo.getExternalDatasetReference()); + assertNull(datasetInfo.getStorageBillingModel()); } @Test @@ -243,5 +248,6 @@ private void compareDatasets(DatasetInfo expected, DatasetInfo value) { assertEquals( expected.getDefaultPartitionExpirationMs(), value.getDefaultPartitionExpirationMs()); assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); + assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index b244cf2606..bc42976b23 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -66,6 +66,7 @@ public class DatasetTest { private static final String SELF_LINK = "http://bigquery/p/d"; private static final DatasetInfo DATASET_INFO = DatasetInfo.newBuilder(DATASET_ID).build(); private static final Field FIELD = Field.of("FieldName", LegacySQLTypeName.INTEGER); + private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final StandardTableDefinition TABLE_DEFINITION = StandardTableDefinition.of(Schema.of(FIELD)); private static final ViewDefinition VIEW_DEFINITION = ViewDefinition.of("QUERY"); @@ -120,6 +121,7 @@ public void testBuilder() { .setLocation(LOCATION) .setSelfLink(SELF_LINK) .setLabels(LABELS) + .setStorageBillingModel(STORAGE_BILLING_MODEL) .build(); assertEquals(DATASET_ID, builtDataset.getDatasetId()); assertEquals(ACCESS_RULES, builtDataset.getAcl()); @@ -133,6 +135,7 @@ public void testBuilder() { assertEquals(LOCATION, builtDataset.getLocation()); assertEquals(SELF_LINK, builtDataset.getSelfLink()); assertEquals(LABELS, builtDataset.getLabels()); + assertEquals(STORAGE_BILLING_MODEL, builtDataset.getStorageBillingModel()); } @Test @@ -340,6 +343,7 @@ public void testExternalDatasetReference() { .setSelfLink(SELF_LINK) .setLabels(LABELS) .setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE) + .setStorageBillingModel(STORAGE_BILLING_MODEL) .build(); assertEquals( EXTERNAL_DATASET_REFERENCE, @@ -369,5 +373,6 @@ private void compareDatasetInfo(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.getDefaultTableLifetime(), value.getDefaultTableLifetime()); assertEquals(expected.getLastModified(), value.getLastModified()); assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); + assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 1ff8597455..909500be83 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -202,6 +202,7 @@ public class ITBigQueryTest { private static final String ROUTINE_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); private static final String RANDOM_ID = UUID.randomUUID().toString().substring(0, 8); + private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final String CLOUD_SAMPLES_DATA = Optional.fromNullable(System.getenv("CLOUD_SAMPLES_DATA_BUCKET")).or("cloud-samples-data"); private static final Map LABELS = @@ -965,6 +966,7 @@ public void testGetDatasetWithSelectedFields() { assertNull(dataset.getLastModified()); assertNull(dataset.getLocation()); assertNull(dataset.getSelfLink()); + assertNull(dataset.getStorageBillingModel()); } @Test @@ -980,6 +982,7 @@ public void testUpdateDataset() { assertThat(dataset.getDatasetId().getDataset()).isEqualTo(OTHER_DATASET); assertThat(dataset.getDescription()).isEqualTo("Some Description"); assertThat(dataset.getLabels()).containsExactly("a", "b"); + assertThat(dataset.getStorageBillingModel()).isNull(); Map updateLabels = new HashMap<>(); updateLabels.put("x", "y"); @@ -990,9 +993,11 @@ public void testUpdateDataset() { .toBuilder() .setDescription("Updated Description") .setLabels(updateLabels) + .setStorageBillingModel("LOGICAL") .build()); assertThat(updatedDataset.getDescription()).isEqualTo("Updated Description"); assertThat(updatedDataset.getLabels()).containsExactly("x", "y"); + assertThat(updatedDataset.getStorageBillingModel()).isEqualTo("LOGICAL"); updatedDataset = bigquery.update(updatedDataset.toBuilder().setLabels(null).build()); assertThat(updatedDataset.getLabels()).isEmpty(); @@ -1022,6 +1027,7 @@ public void testUpdateDatasetWithSelectedFields() { assertNull(updatedDataset.getLastModified()); assertNull(updatedDataset.getLocation()); assertNull(updatedDataset.getSelfLink()); + assertNull(updatedDataset.getStorageBillingModel()); assertTrue(dataset.delete()); } @@ -1283,6 +1289,23 @@ public void testCreateTableWithConstraints() { bigquery.delete(tableId); } + @Test + public void testCreateDatasetWithSpecifiedStorageBillingModel() { + String billingModelDataset = RemoteBigQueryHelper.generateDatasetName(); + DatasetInfo info = + DatasetInfo.newBuilder(billingModelDataset) + .setDescription(DESCRIPTION) + .setStorageBillingModel(STORAGE_BILLING_MODEL) + .setLabels(LABELS) + .build(); + bigquery.create(info); + + Dataset dataset = bigquery.getDataset(DatasetId.of(billingModelDataset)); + assertEquals(STORAGE_BILLING_MODEL, dataset.getStorageBillingModel()); + + RemoteBigQueryHelper.forceDelete(bigquery, billingModelDataset); + } + @Test public void testCreateDatasetWithDefaultCollation() { String collationDataset = RemoteBigQueryHelper.generateDatasetName(); From 113b8f27419365c7277c6a300c5f07cea954cca1 Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:22:14 +0300 Subject: [PATCH 1441/2268] feat: add support for preview features (#2923) Enables preview query features, which currently only includes stateless queries (queries without jobId). These features won't always be enabled on the service side and there are additional checks and conditions. Fixes https://togithub.com/googleapis/java-bigquery/issues/2949 --- .../com/google/cloud/bigquery/BigQuery.java | 10 ++++++ .../google/cloud/bigquery/BigQueryImpl.java | 10 ++++++ .../cloud/bigquery/BigQueryOptions.java | 11 ++++++ .../cloud/bigquery/QueryJobConfiguration.java | 36 ++++++++++++++++++- .../cloud/bigquery/QueryRequestInfo.java | 10 +++++- .../bigquery/QueryJobConfigurationTest.java | 11 ++++++ .../cloud/bigquery/QueryRequestInfoTest.java | 5 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 26 ++++++++++++++ 8 files changed, 117 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index ac6262e69d..80fd6618dc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -1596,6 +1596,16 @@ TableResult listTableData( * } *
    * + * This method supports query-related preview features via environmental variables (enabled by + * setting the {@code QUERY_PREVIEW_ENABLED} environment variable to "TRUE"). Specifically, this + * method supports: + * + *
      + *
    • Stateless queries: query execution without corresponding job metadata + *
    + * + * The behaviour of these preview features is controlled by the bigquery service as well + * * @throws BigQueryException upon failure * @throws InterruptedException if the current thread gets interrupted while waiting for the query * to complete diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index ef7e8cb8b8..0d5842724b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -41,6 +41,7 @@ import com.google.cloud.RetryHelper.RetryHelperException; import com.google.cloud.Tuple; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; @@ -1324,6 +1325,14 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); + if (getOptions().isQueryPreviewEnabled()) { + configuration = + configuration + .toBuilder() + .setJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL) + .build(); + } + // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); @@ -1416,6 +1425,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() { public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... options) throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); + // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 2e22ba9224..e53439f023 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -24,6 +24,7 @@ import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.cloud.http.HttpTransportOptions; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableSet; import java.util.Set; @@ -37,6 +38,7 @@ public class BigQueryOptions extends ServiceOptions { private final String location; // set the option ThrowNotFound when you want to throw the exception when the value not found private boolean setThrowNotFound; + private String queryPreviewEnabled = System.getenv("QUERY_PREVIEW_ENABLED"); public static class DefaultBigQueryFactory implements BigQueryFactory { @@ -130,10 +132,19 @@ public String getLocation() { return location; } + public boolean isQueryPreviewEnabled() { + return queryPreviewEnabled != null && queryPreviewEnabled.equalsIgnoreCase("TRUE"); + } + public void setThrowNotFound(boolean setThrowNotFound) { this.setThrowNotFound = setThrowNotFound; } + @VisibleForTesting + public void setQueryPreviewEnabled(String queryPreviewEnabled) { + this.queryPreviewEnabled = queryPreviewEnabled; + } + public boolean getThrowNotFound() { return setThrowNotFound; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index cc726bdd15..0ad85137b2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -73,6 +73,7 @@ public final class QueryJobConfiguration extends JobConfiguration { private final List connectionProperties; // maxResults is only used for fast query path private final Long maxResults; + private final JobCreationMode jobCreationMode; /** * Priority levels for a query. If not specified the priority is assumed to be {@link @@ -94,6 +95,21 @@ public enum Priority { BATCH } + /** Job Creation Mode provides different options on job creation. */ + enum JobCreationMode { + /** Unspecified JobCreationMode, defaults to JOB_CREATION_REQUIRED. */ + JOB_CREATION_MODE_UNSPECIFIED, + /** Default. Job creation is always required. */ + JOB_CREATION_REQUIRED, + /** + * Job creation is optional. Returning immediate results is prioritized. BigQuery will + * automatically determine if a Job needs to be created. The conditions under which BigQuery can + * decide to not create a Job are subject to change. If Job creation is required, + * JOB_CREATION_REQUIRED mode should be used, which is the default. + */ + JOB_CREATION_OPTIONAL, + } + public static final class Builder extends JobConfiguration.Builder { @@ -125,6 +141,7 @@ public static final class Builder private RangePartitioning rangePartitioning; private List connectionProperties; private Long maxResults; + private JobCreationMode jobCreationMode; private Builder() { super(Type.QUERY); @@ -160,6 +177,7 @@ private Builder(QueryJobConfiguration jobConfiguration) { this.rangePartitioning = jobConfiguration.rangePartitioning; this.connectionProperties = jobConfiguration.connectionProperties; this.maxResults = jobConfiguration.maxResults; + this.jobCreationMode = jobConfiguration.jobCreationMode; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -655,6 +673,15 @@ public Builder setMaxResults(Long maxResults) { return this; } + /** + * Provides different options on job creation. If not specified the job creation mode is assumed + * to be {@link JobCreationMode#JOB_CREATION_REQUIRED}. + */ + Builder setJobCreationMode(JobCreationMode jobCreationMode) { + this.jobCreationMode = jobCreationMode; + return this; + } + public QueryJobConfiguration build() { return new QueryJobConfiguration(this); } @@ -699,6 +726,7 @@ private QueryJobConfiguration(Builder builder) { this.rangePartitioning = builder.rangePartitioning; this.connectionProperties = builder.connectionProperties; this.maxResults = builder.maxResults; + this.jobCreationMode = builder.jobCreationMode; } /** @@ -910,6 +938,11 @@ public Long getMaxResults() { return maxResults; } + /** Returns the job creation mode. */ + JobCreationMode getJobCreationMode() { + return jobCreationMode; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -944,7 +977,8 @@ ToStringHelper toStringHelper() { .add("jobTimeoutMs", jobTimeoutMs) .add("labels", labels) .add("rangePartitioning", rangePartitioning) - .add("connectionProperties", connectionProperties); + .add("connectionProperties", connectionProperties) + .add("jobCreationMode", jobCreationMode); } @Override diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 00a8983636..00a11f723b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -18,6 +18,7 @@ import com.google.api.services.bigquery.model.QueryParameter; import com.google.api.services.bigquery.model.QueryRequest; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; import com.google.common.collect.Lists; @@ -40,6 +41,7 @@ final class QueryRequestInfo { private final Boolean createSession; private final Boolean useQueryCache; private final Boolean useLegacySql; + private final JobCreationMode jobCreationMode; QueryRequestInfo(QueryJobConfiguration config) { this.config = config; @@ -55,6 +57,7 @@ final class QueryRequestInfo { this.createSession = config.createSession(); this.useLegacySql = config.useLegacySql(); this.useQueryCache = config.useQueryCache(); + this.jobCreationMode = config.getJobCreationMode(); } boolean isFastQuerySupported(JobId jobId) { @@ -116,6 +119,9 @@ QueryRequest toPb() { if (useQueryCache != null) { request.setUseQueryCache(useQueryCache); } + if (jobCreationMode != null) { + request.setJobCreationMode(jobCreationMode.toString()); + } return request; } @@ -134,6 +140,7 @@ public String toString() { .add("createSession", createSession) .add("useQueryCache", useQueryCache) .add("useLegacySql", useLegacySql) + .add("jobCreationMode", jobCreationMode) .toString(); } @@ -151,7 +158,8 @@ public int hashCode() { requestId, createSession, useQueryCache, - useLegacySql); + useLegacySql, + jobCreationMode); } @Override diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index 9a20219d66..f71e152e62 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -23,6 +23,7 @@ import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; import com.google.cloud.bigquery.JobInfo.WriteDisposition; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.QueryJobConfiguration.Priority; import com.google.cloud.bigquery.TimePartitioning.Type; import com.google.common.collect.ImmutableList; @@ -110,6 +111,7 @@ public class QueryJobConfigurationTest { private static final Map NAME_PARAMETER = ImmutableMap.of("string", STRING_PARAMETER, "timestamp", TIMESTAMP_PARAMETER); private static final String PARAMETER_MODE = "POSITIONAL"; + private static final JobCreationMode JOB_CREATION_MODE = JobCreationMode.JOB_CREATION_OPTIONAL; private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -150,6 +152,8 @@ public class QueryJobConfigurationTest { .setPositionalParameters(ImmutableList.of()) .setNamedParameters(NAME_PARAMETER) .build(); + private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SET_JOB_CREATION_MODE = + QUERY_JOB_CONFIGURATION.toBuilder().setJobCreationMode(JOB_CREATION_MODE).build(); @Test public void testToBuilder() { @@ -230,6 +234,13 @@ public void testNamedParameter() { QUERY_JOB_CONFIGURATION_SET_NAME_PARAMETER.toBuilder().build()); } + @Test + public void testJobCreationMode() { + compareQueryJobConfiguration( + QUERY_JOB_CONFIGURATION_SET_JOB_CREATION_MODE, + QUERY_JOB_CONFIGURATION_SET_JOB_CREATION_MODE.toBuilder().build()); + } + private void compareQueryJobConfiguration( QueryJobConfiguration expected, QueryJobConfiguration value) { assertEquals(expected, value); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 456475597e..0d9464c768 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -23,6 +23,7 @@ import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; import com.google.cloud.bigquery.JobInfo.WriteDisposition; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.QueryJobConfiguration.Priority; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -105,6 +106,8 @@ public class QueryRequestInfoTest { ImmutableList.of(STRING_PARAMETER, TIMESTAMP_PARAMETER); private static final Map NAME_PARAMETER = ImmutableMap.of("string", STRING_PARAMETER, "timestamp", TIMESTAMP_PARAMETER); + private static final JobCreationMode jobCreationModeRequired = + JobCreationMode.JOB_CREATION_REQUIRED; private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -131,6 +134,7 @@ public class QueryRequestInfoTest { .setConnectionProperties(CONNECTION_PROPERTIES) .setPositionalParameters(POSITIONAL_PARAMETER) .setMaxResults(100L) + .setJobCreationMode(jobCreationModeRequired) .build(); QueryRequestInfo REQUEST_INFO = new QueryRequestInfo(QUERY_JOB_CONFIGURATION); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SUPPORTED = @@ -194,5 +198,6 @@ private void compareQueryRequestInfo(QueryRequestInfo expected, QueryRequestInfo assertEquals(expectedQueryReq.getCreateSession(), actualQueryReq.getCreateSession()); assertEquals(expectedQueryReq.getUseQueryCache(), actualQueryReq.getUseQueryCache()); assertEquals(expectedQueryReq.getUseLegacySql(), actualQueryReq.getUseLegacySql()); + assertEquals(expectedQueryReq.get("jobCreationMode"), actualQueryReq.get("jobCreationMode")); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 909500be83..8cada3e084 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6188,4 +6188,30 @@ public void testAlreadyExistJobExceptionHandling() throws InterruptedException { } } } + + @Test + public void testStatelessQueries() throws InterruptedException { + // simulate setting the QUERY_PREVIEW_ENABLED environment variable + bigquery.getOptions().setQueryPreviewEnabled("TRUE"); + assertNull(executeSimpleQuery().getJobId()); + + // the flag should be case-insensitive + bigquery.getOptions().setQueryPreviewEnabled("tRuE"); + assertNull(executeSimpleQuery().getJobId()); + + // any other values won't enable optional job creation mode + bigquery.getOptions().setQueryPreviewEnabled("test_value"); + assertNotNull(executeSimpleQuery().getJobId()); + + // reset the flag + bigquery.getOptions().setQueryPreviewEnabled(null); + assertNotNull(executeSimpleQuery().getJobId()); + } + + private TableResult executeSimpleQuery() throws InterruptedException { + String query = "SELECT 1 as one"; + QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); + TableResult result = bigquery.query(config); + return result; + } } From 137fb23fa2e04df4e1bf17591fe17f84dfa3041c Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Wed, 25 Oct 2023 04:44:14 -0400 Subject: [PATCH 1442/2268] chore: run stateless query IT with allow listed project (#2965) Fixes #2964 --- .kokoro/nightly/integration.cfg | 4 ++-- owlbot.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index a2907a257b..e51c7b4c6c 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -13,12 +13,12 @@ env_vars: { # TODO: remove this after we've migrated all tests and scripts env_vars: { key: "GCLOUD_PROJECT" - value: "java-docs-samples-testing" + value: "gcloud-devel" } env_vars: { key: "GOOGLE_CLOUD_PROJECT" - value: "java-docs-samples-testing" + value: "gcloud-devel" } env_vars: { diff --git a/owlbot.py b/owlbot.py index bf1878a29c..7a89db8ff2 100644 --- a/owlbot.py +++ b/owlbot.py @@ -18,6 +18,7 @@ java.common_templates(excludes=[ '.kokoro/nightly/samples.cfg', + '.kokoro/nightly/integration.cfg', '.kokoro/presubmit/samples.cfg', 'codecov.yaml', 'renovate.json', From 1ee18ebeb90adeb371ef04cbfc7b18be2c24d1e8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:35:03 +0200 Subject: [PATCH 1443/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 (#2955) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db121fddac..a69748fa5b 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20231008-2.0.0 - 3.17.0 + 3.18.0 12.0.1 From 7ed55b5c075dbac827c6201d0398ff87d8240b38 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:35:25 +0200 Subject: [PATCH 1444/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.31.0 (#2967) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a69748fa5b..f54f8f0ace 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.30.0 + 2.31.0 test From 443c39d094d003cf8c379bad079a6b5015ff2625 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:35:43 +0200 Subject: [PATCH 1445/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.31.0 (#2966) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f54f8f0ace..b7bf4189db 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.30.0 + 2.31.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c515cb9a22..d3f893874d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.30.0 + 2.31.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a923c5c5a5..0d44543bfa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.30.0 + 2.31.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f9bc150da1..7b1dcc297f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.30.0 + 2.31.0 test From 7f5ebf79bc3b129e9225e1ff31ec177661dcbc7d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:36:00 -0400 Subject: [PATCH 1446/2268] chore: bump urllib3 from 1.26.17 to 1.26.18 in /synthtool/gcp/templates/java_library/.kokoro (#1885) (#2963) Source-Link: https://github.com/googleapis/synthtool/commit/e4a9d44f7d1ddda567c14bce7df4d93fdb010de0 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:4875b2142cb4325542ba4f3175a81921c4b2b8256db012b220e3ca9637b34154 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/nightly/integration.cfg | 1 + .kokoro/nightly/java11-integration.cfg | 1 + .kokoro/presubmit/integration.cfg | 1 + .kokoro/requirements.txt | 10 ++++++---- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 52eaa54d82..8058621d83 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f -# created: 2023-09-05T18:54:42.225408832Z + digest: sha256:4875b2142cb4325542ba4f3175a81921c4b2b8256db012b220e3ca9637b34154 +# created: 2023-10-24T01:51:42.863726766Z diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index e51c7b4c6c..24b9cf6345 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -35,3 +35,4 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-it-service-account" } + diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg index 58049cc38f..6a6ef94eff 100644 --- a/.kokoro/nightly/java11-integration.cfg +++ b/.kokoro/nightly/java11-integration.cfg @@ -35,3 +35,4 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-it-service-account" } + diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg index dded67a9d5..5864c603e5 100644 --- a/.kokoro/presubmit/integration.cfg +++ b/.kokoro/presubmit/integration.cfg @@ -31,3 +31,4 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-it-service-account" } + diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index a73256ab80..c5c11bbe79 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -418,6 +418,7 @@ protobuf==3.20.3 \ # gcp-docuploader # gcp-releasetool # google-api-core + # googleapis-common-protos pyasn1==0.5.0 \ --hash=sha256:87a2121042a1ac9358cabcaf1d07680ff97ee6404333bacca15f76aa8ad01a57 \ --hash=sha256:97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde @@ -469,9 +470,9 @@ typing-extensions==4.7.1 \ --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 # via -r requirements.in -urllib3==1.26.16 \ - --hash=sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f \ - --hash=sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14 +urllib3==1.26.18 \ + --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \ + --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0 # via # google-auth # requests @@ -485,5 +486,6 @@ zipp==3.16.1 \ # via importlib-metadata # WARNING: The following packages were not pinned, but pip requires them to be -# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag. +# pinned when the requirements file includes hashes and the requirement is not +# satisfied by a package already installed. Consider using the --allow-unsafe flag. # setuptools From 04f57405d6630a356aa69d6b956be350f17940c3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:36:39 +0200 Subject: [PATCH 1447/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.29.0 (#2961) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7bf4189db..9acc23d420 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.28.0 + 2.29.0 test From 855e69889f68592608c8a56070ffdafdf8365f57 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:37:02 +0200 Subject: [PATCH 1448/2268] deps: update ossf/scorecard-action action to v2.3.1 (#2960) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 26169295a5..52d639fd6a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0 + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 with: results_file: results.sarif results_format: sarif From de9bcee50ba682ffa93aae063191a8880741507d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:37:18 +0200 Subject: [PATCH 1449/2268] deps: update github/codeql-action action to v2.22.4 (#2958) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 52d639fd6a..1518a20e22 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 + uses: github/codeql-action/upload-sarif@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4 with: sarif_file: results.sarif From 6465e413c93e01069f86c80fc424715d46f9067b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:37:32 +0200 Subject: [PATCH 1450/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 (#2957) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 1f18d2c067..b311169b1a 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.27 + 0.9.28 true com.example.bigquery.NativeImageBigquerySample From b03effd3b5f5fd6365de9a6267a1a8ace46d7718 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:38:14 +0200 Subject: [PATCH 1451/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 (#2956) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b311169b1a..b10ec974eb 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.27 + 0.9.28 test From 0c8fb658e1232ecf2db86c8595ddcd1e20e0301e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Oct 2023 22:38:35 +0200 Subject: [PATCH 1452/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.1 (#2962) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b10ec974eb..e5c84a3045 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.1 **/*IT From 219db2c0023610d2adcba4889a9b785df2113893 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Oct 2023 20:06:12 +0200 Subject: [PATCH 1453/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.35.0 (#2968) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9acc23d420..7387c22558 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.34.0 + 1.35.0 pom import From fcbf45486436af83f9ee608dae23d3077ef1e766 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Oct 2023 20:22:23 +0200 Subject: [PATCH 1454/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.44.1 (#2969) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7387c22558..d89cf992b4 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.44.0 + 2.44.1 pom import From e73e9255c1ac3701144c7055149ce8f2828e244d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Oct 2023 20:22:40 +0200 Subject: [PATCH 1455/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.29.0 (#2970) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d3f893874d..5f7509ff63 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.28.0 + 2.29.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0d44543bfa..b585b29bce 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.28.0 + 2.29.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7b1dcc297f..5a828edced 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.28.0 + 2.29.0 test From 474ac0a3aa304914c566c9cbbbbb3b8197b0c596 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:22:51 -0400 Subject: [PATCH 1456/2268] chore(main): release 2.33.3-SNAPSHOT (#2939) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cd086b1116..a7b4262975 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.2 + 2.33.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 53bd43904f..25dd80d907 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.2 + 2.33.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.2 + 2.33.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d89cf992b4..87cdbe76c3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.2 + 2.33.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.2 + 2.33.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b585b29bce..75fa4f389c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.2 + 2.33.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 004398030c..159e39b492 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.2:2.33.2 \ No newline at end of file +google-cloud-bigquery:2.33.2:2.33.3-SNAPSHOT \ No newline at end of file From 7a935eb8dd148354ddfad768a39d70fe29ea1d4b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:14:13 +0000 Subject: [PATCH 1457/2268] chore(main): release 2.34.0 (#2971) :robot: I have created a release *beep* *boop* --- ## [2.34.0](https://togithub.com/googleapis/java-bigquery/compare/v2.33.2...v2.34.0) (2023-10-26) ### Features * Add BigLakeConfiguration Property in StandardTableDefinition.java ([#2916](https://togithub.com/googleapis/java-bigquery/issues/2916)) ([1d660fa](https://togithub.com/googleapis/java-bigquery/commit/1d660fa19f0d82c2b6ec2ea9590881e513274c25)) * Add support for Dataset property storageBillingModel ([#2913](https://togithub.com/googleapis/java-bigquery/issues/2913)) ([f452cf4](https://togithub.com/googleapis/java-bigquery/commit/f452cf4e100b6cc211681a840ddbd0be5108d01e)) * Add support for preview features ([#2923](https://togithub.com/googleapis/java-bigquery/issues/2923)) ([113b8f2](https://togithub.com/googleapis/java-bigquery/commit/113b8f27419365c7277c6a300c5f07cea954cca1)) ### Dependencies * Update actions/checkout action to v4.1.1 ([#2950](https://togithub.com/googleapis/java-bigquery/issues/2950)) ([c556c18](https://togithub.com/googleapis/java-bigquery/commit/c556c1837baf0d53245452d6a152910df7883262)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.30.0 ([#2942](https://togithub.com/googleapis/java-bigquery/issues/2942)) ([e760fca](https://togithub.com/googleapis/java-bigquery/commit/e760fcae98b23ff4e7fc3ae25f2437be220e9df9)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.31.0 ([#2967](https://togithub.com/googleapis/java-bigquery/issues/2967)) ([7ed55b5](https://togithub.com/googleapis/java-bigquery/commit/7ed55b5c075dbac827c6201d0398ff87d8240b38)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20231008-2.0.0 ([#2946](https://togithub.com/googleapis/java-bigquery/issues/2946)) ([3d0da5b](https://togithub.com/googleapis/java-bigquery/commit/3d0da5b5a20f49721477afbed10ea3fff43652bb)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.34.0 ([#2943](https://togithub.com/googleapis/java-bigquery/issues/2943)) ([18162c3](https://togithub.com/googleapis/java-bigquery/commit/18162c37c97eff6387e0f58d211f2c1725a9c8d3)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.35.0 ([#2968](https://togithub.com/googleapis/java-bigquery/issues/2968)) ([219db2c](https://togithub.com/googleapis/java-bigquery/commit/219db2c0023610d2adcba4889a9b785df2113893)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#2955](https://togithub.com/googleapis/java-bigquery/issues/2955)) ([1ee18eb](https://togithub.com/googleapis/java-bigquery/commit/1ee18ebeb90adeb371ef04cbfc7b18be2c24d1e8)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#2956](https://togithub.com/googleapis/java-bigquery/issues/2956)) ([b03effd](https://togithub.com/googleapis/java-bigquery/commit/b03effd3b5f5fd6365de9a6267a1a8ace46d7718)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 ([#2957](https://togithub.com/googleapis/java-bigquery/issues/2957)) ([6465e41](https://togithub.com/googleapis/java-bigquery/commit/6465e413c93e01069f86c80fc424715d46f9067b)) * Update github/codeql-action action to v2.22.2 ([#2944](https://togithub.com/googleapis/java-bigquery/issues/2944)) ([f584e59](https://togithub.com/googleapis/java-bigquery/commit/f584e59571f0c7918d2d83a19b00d49bd5b558c4)) * Update github/codeql-action action to v2.22.3 ([#2954](https://togithub.com/googleapis/java-bigquery/issues/2954)) ([1b2bc18](https://togithub.com/googleapis/java-bigquery/commit/1b2bc18bf49d06e1ccd29745be649108dd28cfa5)) * Update github/codeql-action action to v2.22.4 ([#2958](https://togithub.com/googleapis/java-bigquery/issues/2958)) ([de9bcee](https://togithub.com/googleapis/java-bigquery/commit/de9bcee50ba682ffa93aae063191a8880741507d)) * Update ossf/scorecard-action action to v2.3.1 ([#2960](https://togithub.com/googleapis/java-bigquery/issues/2960)) ([855e698](https://togithub.com/googleapis/java-bigquery/commit/855e69889f68592608c8a56070ffdafdf8365f57)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07d11f8888..a8d56e8910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [2.34.0](https://github.com/googleapis/java-bigquery/compare/v2.33.2...v2.34.0) (2023-10-26) + + +### Features + +* Add BigLakeConfiguration Property in StandardTableDefinition.java ([#2916](https://github.com/googleapis/java-bigquery/issues/2916)) ([1d660fa](https://github.com/googleapis/java-bigquery/commit/1d660fa19f0d82c2b6ec2ea9590881e513274c25)) +* Add support for Dataset property storageBillingModel ([#2913](https://github.com/googleapis/java-bigquery/issues/2913)) ([f452cf4](https://github.com/googleapis/java-bigquery/commit/f452cf4e100b6cc211681a840ddbd0be5108d01e)) +* Add support for preview features ([#2923](https://github.com/googleapis/java-bigquery/issues/2923)) ([113b8f2](https://github.com/googleapis/java-bigquery/commit/113b8f27419365c7277c6a300c5f07cea954cca1)) + + +### Dependencies + +* Update actions/checkout action to v4.1.1 ([#2950](https://github.com/googleapis/java-bigquery/issues/2950)) ([c556c18](https://github.com/googleapis/java-bigquery/commit/c556c1837baf0d53245452d6a152910df7883262)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.30.0 ([#2942](https://github.com/googleapis/java-bigquery/issues/2942)) ([e760fca](https://github.com/googleapis/java-bigquery/commit/e760fcae98b23ff4e7fc3ae25f2437be220e9df9)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.31.0 ([#2967](https://github.com/googleapis/java-bigquery/issues/2967)) ([7ed55b5](https://github.com/googleapis/java-bigquery/commit/7ed55b5c075dbac827c6201d0398ff87d8240b38)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20231008-2.0.0 ([#2946](https://github.com/googleapis/java-bigquery/issues/2946)) ([3d0da5b](https://github.com/googleapis/java-bigquery/commit/3d0da5b5a20f49721477afbed10ea3fff43652bb)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.34.0 ([#2943](https://github.com/googleapis/java-bigquery/issues/2943)) ([18162c3](https://github.com/googleapis/java-bigquery/commit/18162c37c97eff6387e0f58d211f2c1725a9c8d3)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.35.0 ([#2968](https://github.com/googleapis/java-bigquery/issues/2968)) ([219db2c](https://github.com/googleapis/java-bigquery/commit/219db2c0023610d2adcba4889a9b785df2113893)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#2955](https://github.com/googleapis/java-bigquery/issues/2955)) ([1ee18eb](https://github.com/googleapis/java-bigquery/commit/1ee18ebeb90adeb371ef04cbfc7b18be2c24d1e8)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#2956](https://github.com/googleapis/java-bigquery/issues/2956)) ([b03effd](https://github.com/googleapis/java-bigquery/commit/b03effd3b5f5fd6365de9a6267a1a8ace46d7718)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 ([#2957](https://github.com/googleapis/java-bigquery/issues/2957)) ([6465e41](https://github.com/googleapis/java-bigquery/commit/6465e413c93e01069f86c80fc424715d46f9067b)) +* Update github/codeql-action action to v2.22.2 ([#2944](https://github.com/googleapis/java-bigquery/issues/2944)) ([f584e59](https://github.com/googleapis/java-bigquery/commit/f584e59571f0c7918d2d83a19b00d49bd5b558c4)) +* Update github/codeql-action action to v2.22.3 ([#2954](https://github.com/googleapis/java-bigquery/issues/2954)) ([1b2bc18](https://github.com/googleapis/java-bigquery/commit/1b2bc18bf49d06e1ccd29745be649108dd28cfa5)) +* Update github/codeql-action action to v2.22.4 ([#2958](https://github.com/googleapis/java-bigquery/issues/2958)) ([de9bcee](https://github.com/googleapis/java-bigquery/commit/de9bcee50ba682ffa93aae063191a8880741507d)) +* Update ossf/scorecard-action action to v2.3.1 ([#2960](https://github.com/googleapis/java-bigquery/issues/2960)) ([855e698](https://github.com/googleapis/java-bigquery/commit/855e69889f68592608c8a56070ffdafdf8365f57)) + ## [2.33.2](https://github.com/googleapis/java-bigquery/compare/v2.33.1...v2.33.2) (2023-10-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a7b4262975..15cd025ff6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.33.3-SNAPSHOT + 2.34.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 25dd80d907..d98743b7e7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.33.3-SNAPSHOT + 2.34.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.33.3-SNAPSHOT + 2.34.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 87cdbe76c3..da800e6f2a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.33.3-SNAPSHOT + 2.34.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.33.3-SNAPSHOT + 2.34.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 75fa4f389c..caa1d2d20e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.33.3-SNAPSHOT + 2.34.0 diff --git a/versions.txt b/versions.txt index 159e39b492..d14c19ff96 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.33.2:2.33.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.34.0:2.34.0 \ No newline at end of file From af8ca6c04634af02fdc8b94e85e76a6f3331a3fd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 27 Oct 2023 20:22:26 +0200 Subject: [PATCH 1458/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.34.0 (#2973) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.33.2` -> `2.34.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.33.2/2.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.33.2/2.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.34.0`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2340-2023-10-26) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.33.2...v2.34.0) ##### Features - Add BigLakeConfiguration Property in StandardTableDefinition.java ([#​2916](https://togithub.com/googleapis/java-bigquery/issues/2916)) ([1d660fa](https://togithub.com/googleapis/java-bigquery/commit/1d660fa19f0d82c2b6ec2ea9590881e513274c25)) - Add support for Dataset property storageBillingModel ([#​2913](https://togithub.com/googleapis/java-bigquery/issues/2913)) ([f452cf4](https://togithub.com/googleapis/java-bigquery/commit/f452cf4e100b6cc211681a840ddbd0be5108d01e)) - Add support for preview features ([#​2923](https://togithub.com/googleapis/java-bigquery/issues/2923)) ([113b8f2](https://togithub.com/googleapis/java-bigquery/commit/113b8f27419365c7277c6a300c5f07cea954cca1)) ##### Dependencies - Update actions/checkout action to v4.1.1 ([#​2950](https://togithub.com/googleapis/java-bigquery/issues/2950)) ([c556c18](https://togithub.com/googleapis/java-bigquery/commit/c556c1837baf0d53245452d6a152910df7883262)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.30.0 ([#​2942](https://togithub.com/googleapis/java-bigquery/issues/2942)) ([e760fca](https://togithub.com/googleapis/java-bigquery/commit/e760fcae98b23ff4e7fc3ae25f2437be220e9df9)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.31.0 ([#​2967](https://togithub.com/googleapis/java-bigquery/issues/2967)) ([7ed55b5](https://togithub.com/googleapis/java-bigquery/commit/7ed55b5c075dbac827c6201d0398ff87d8240b38)) - Update dependency com.google.apis:google-api-services-bigquery to v2-rev20231008-2.0.0 ([#​2946](https://togithub.com/googleapis/java-bigquery/issues/2946)) ([3d0da5b](https://togithub.com/googleapis/java-bigquery/commit/3d0da5b5a20f49721477afbed10ea3fff43652bb)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.34.0 ([#​2943](https://togithub.com/googleapis/java-bigquery/issues/2943)) ([18162c3](https://togithub.com/googleapis/java-bigquery/commit/18162c37c97eff6387e0f58d211f2c1725a9c8d3)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.35.0 ([#​2968](https://togithub.com/googleapis/java-bigquery/issues/2968)) ([219db2c](https://togithub.com/googleapis/java-bigquery/commit/219db2c0023610d2adcba4889a9b785df2113893)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#​2955](https://togithub.com/googleapis/java-bigquery/issues/2955)) ([1ee18eb](https://togithub.com/googleapis/java-bigquery/commit/1ee18ebeb90adeb371ef04cbfc7b18be2c24d1e8)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#​2956](https://togithub.com/googleapis/java-bigquery/issues/2956)) ([b03effd](https://togithub.com/googleapis/java-bigquery/commit/b03effd3b5f5fd6365de9a6267a1a8ace46d7718)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 ([#​2957](https://togithub.com/googleapis/java-bigquery/issues/2957)) ([6465e41](https://togithub.com/googleapis/java-bigquery/commit/6465e413c93e01069f86c80fc424715d46f9067b)) - Update github/codeql-action action to v2.22.2 ([#​2944](https://togithub.com/googleapis/java-bigquery/issues/2944)) ([f584e59](https://togithub.com/googleapis/java-bigquery/commit/f584e59571f0c7918d2d83a19b00d49bd5b558c4)) - Update github/codeql-action action to v2.22.3 ([#​2954](https://togithub.com/googleapis/java-bigquery/issues/2954)) ([1b2bc18](https://togithub.com/googleapis/java-bigquery/commit/1b2bc18bf49d06e1ccd29745be649108dd28cfa5)) - Update github/codeql-action action to v2.22.4 ([#​2958](https://togithub.com/googleapis/java-bigquery/issues/2958)) ([de9bcee](https://togithub.com/googleapis/java-bigquery/commit/de9bcee50ba682ffa93aae063191a8880741507d)) - Update ossf/scorecard-action action to v2.3.1 ([#​2960](https://togithub.com/googleapis/java-bigquery/issues/2960)) ([855e698](https://togithub.com/googleapis/java-bigquery/commit/855e69889f68592608c8a56070ffdafdf8365f57))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 10 +++++----- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6eb5a01fa5..162e644b82 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.33.2 + 2.34.0 ``` @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.25.0') +implementation platform('com.google.cloud:libraries-bom:26.26.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.33.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.34.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.33.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.33.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5f7509ff63..d3c409fccf 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.33.2 + 2.34.0 From 0b8884634f8bd21615a9263bb1344cb162adfa47 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 27 Oct 2023 20:40:19 +0200 Subject: [PATCH 1459/2268] deps: update github/codeql-action action to v2.22.5 (#2975) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.22.5 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1518a20e22..730e292765 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@49abf0ba24d0b7953cb586944e918a0b92074c80 # v2.22.4 + uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 with: sarif_file: results.sarif From 4b1bef421a70027ef6da948ff3b476a9ad5376c7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:43:25 -0500 Subject: [PATCH 1460/2268] chore: update graalvm version to 22.3.3 in kokoro cfg files. (#1889) (#2978) Source-Link: https://github.com/googleapis/synthtool/commit/1547f9a33de075d31d434bb3c9d7f53f068e0ff3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:bc2bf47c7370f1b1a8a46b0c104ce7e43644ac58902c9de265fe1f253fcc2506 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 8058621d83..f930d4846f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:4875b2142cb4325542ba4f3175a81921c4b2b8256db012b220e3ca9637b34154 -# created: 2023-10-24T01:51:42.863726766Z + digest: sha256:bc2bf47c7370f1b1a8a46b0c104ce7e43644ac58902c9de265fe1f253fcc2506 +# created: 2023-10-31T13:44:21.909247346Z diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index f525335458..fb5bb678ff 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.3" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 44b1004875..59efee340c 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2" + value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.3" } env_vars: { From a64b91c03b0291452d53cc407d9c841b3567fe23 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Nov 2023 17:44:00 +0100 Subject: [PATCH 1461/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.10.1 (#2984) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e5c84a3045..aa41f26ea8 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.10.0 + 5.10.1 test From 82d495e47807c63438f43c6774ead0d6c883efaa Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Nov 2023 17:44:21 +0100 Subject: [PATCH 1462/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.29.1 (#2983) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da800e6f2a..fad751c0d9 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.29.0 + 2.29.1 test From c137f1f17f192f4f0a3c4d33e1d27677dbf4556b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Nov 2023 17:45:13 +0100 Subject: [PATCH 1463/2268] deps: update dependency org.checkerframework:checker-compat-qual to v2.5.6 (#2982) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fad751c0d9..c427d557ce 100644 --- a/pom.xml +++ b/pom.xml @@ -105,7 +105,7 @@ org.checkerframework checker-compat-qual - 2.5.5 + 2.5.6 From fa267b672965195b712a44177765e1314f286f37 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:42:51 -0500 Subject: [PATCH 1464/2268] chore(main): release 2.34.1-SNAPSHOT (#2972) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 15cd025ff6..ad670a0f8f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.0 + 2.34.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d98743b7e7..0d5b409b45 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.0 + 2.34.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.0 + 2.34.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c427d557ce..c67ae160ed 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.0 + 2.34.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.0 + 2.34.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index caa1d2d20e..b4417ec034 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.0 + 2.34.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index d14c19ff96..af6c60ecd0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.0:2.34.0 \ No newline at end of file +google-cloud-bigquery:2.34.0:2.34.1-SNAPSHOT \ No newline at end of file From 0d400da7f73ee44ab5053ef51b1d45a9d29f0ebb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Nov 2023 21:28:46 +0100 Subject: [PATCH 1465/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.19.0 (#2986) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c67ae160ed..ec9ec72a17 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20231008-2.0.0 - 3.18.0 + 3.19.0 12.0.1 From 73238cee5af98ec64cdc323273762300e25766bc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:56:46 -0500 Subject: [PATCH 1466/2268] chore(main): release 2.34.1 (#2985) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 10 ++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8d56e8910..f4d3f5880e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.34.1](https://github.com/googleapis/java-bigquery/compare/v2.34.0...v2.34.1) (2023-11-06) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.19.0 ([#2986](https://github.com/googleapis/java-bigquery/issues/2986)) ([0d400da](https://github.com/googleapis/java-bigquery/commit/0d400da7f73ee44ab5053ef51b1d45a9d29f0ebb)) +* Update dependency org.checkerframework:checker-compat-qual to v2.5.6 ([#2982](https://github.com/googleapis/java-bigquery/issues/2982)) ([c137f1f](https://github.com/googleapis/java-bigquery/commit/c137f1f17f192f4f0a3c4d33e1d27677dbf4556b)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.1 ([#2984](https://github.com/googleapis/java-bigquery/issues/2984)) ([a64b91c](https://github.com/googleapis/java-bigquery/commit/a64b91c03b0291452d53cc407d9c841b3567fe23)) +* Update github/codeql-action action to v2.22.5 ([#2975](https://github.com/googleapis/java-bigquery/issues/2975)) ([0b88846](https://github.com/googleapis/java-bigquery/commit/0b8884634f8bd21615a9263bb1344cb162adfa47)) + ## [2.34.0](https://github.com/googleapis/java-bigquery/compare/v2.33.2...v2.34.0) (2023-10-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ad670a0f8f..c9daf9cddf 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.1-SNAPSHOT + 2.34.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0d5b409b45..6e1c128815 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.1-SNAPSHOT + 2.34.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.1-SNAPSHOT + 2.34.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ec9ec72a17..439f7cb7f6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.1-SNAPSHOT + 2.34.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.1-SNAPSHOT + 2.34.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b4417ec034..01505abaf3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.1-SNAPSHOT + 2.34.1 diff --git a/versions.txt b/versions.txt index af6c60ecd0..ea4b61155c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.0:2.34.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.34.1:2.34.1 \ No newline at end of file From dbdff0be16f55c3ef2d6eb7062c5fb988798a329 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 00:00:21 +0100 Subject: [PATCH 1467/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.32.0 (#2987) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 439f7cb7f6..0477a90f70 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.31.0 + 2.32.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d3c409fccf..87047713cd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.31.0 + 2.32.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 01505abaf3..018837f948 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.31.0 + 2.32.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5a828edced..2cf63f32d6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.31.0 + 2.32.0 test From 47a61a7c2cb5fed88937670bca7b15e38529dfaf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 00:00:45 +0100 Subject: [PATCH 1468/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.32.0 (#2989) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0477a90f70..cc14138b90 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.31.0 + 2.32.0 test From 81c07275809eadc4e7146bd080475e4775102339 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 00:01:08 +0100 Subject: [PATCH 1469/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.36.0 (#2990) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cc14138b90..13bc3cf7c1 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.35.0 + 1.36.0 pom import From f39d339b3407d2f0d9f200fa91f81136862c45f9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 14:23:13 +0100 Subject: [PATCH 1470/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.45.0 (#2993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.45.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 162e644b82..31b68b4b87 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.34.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.34.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/pom.xml b/pom.xml index 13bc3cf7c1..f8c54e20b7 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.44.1 + 2.45.0 pom import From af4d5795bbdaf977b52b18894c8ca27a5eeb54c2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 14:23:32 +0100 Subject: [PATCH 1471/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.34.1 (#2992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.34.1 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31b68b4b87..686622a082 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.34.0 + 2.34.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 87047713cd..a8e7c622c0 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.34.0 + 2.34.1 From 2e00eef9f94b7a31ea3c483ad69b588718b4e0a8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:56:16 -0500 Subject: [PATCH 1472/2268] chore(main): release 2.34.2-SNAPSHOT (#2988) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c9daf9cddf..e35e9a2819 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.1 + 2.34.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6e1c128815..49b4535500 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.1 + 2.34.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.1 + 2.34.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f8c54e20b7..a975aecf13 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.1 + 2.34.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.1 + 2.34.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 018837f948..0849cfbffa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.1 + 2.34.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index ea4b61155c..b8b35c4b16 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.1:2.34.1 \ No newline at end of file +google-cloud-bigquery:2.34.1:2.34.2-SNAPSHOT \ No newline at end of file From 5d6a1c0bfc41bcaa93453820b39b2cbbb743d0a7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 Nov 2023 17:02:25 +0100 Subject: [PATCH 1473/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.2 (#2991) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.2 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index aa41f26ea8..f4c1c3ddc1 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.1 + 3.2.2 **/*IT From 6d14b276551cf758b58da5d2de4226b92331c40e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:14:21 -0500 Subject: [PATCH 1474/2268] chore(main): release 2.34.2 (#2994) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4d3f5880e..6c4b28a2b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.34.2](https://github.com/googleapis/java-bigquery/compare/v2.34.1...v2.34.2) (2023-11-07) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.32.0 ([#2989](https://github.com/googleapis/java-bigquery/issues/2989)) ([47a61a7](https://github.com/googleapis/java-bigquery/commit/47a61a7c2cb5fed88937670bca7b15e38529dfaf)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.36.0 ([#2990](https://github.com/googleapis/java-bigquery/issues/2990)) ([81c0727](https://github.com/googleapis/java-bigquery/commit/81c07275809eadc4e7146bd080475e4775102339)) + ## [2.34.1](https://github.com/googleapis/java-bigquery/compare/v2.34.0...v2.34.1) (2023-11-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e35e9a2819..eb6fcb814d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.2-SNAPSHOT + 2.34.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 49b4535500..e0e6a8fb06 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.2-SNAPSHOT + 2.34.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.2-SNAPSHOT + 2.34.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index a975aecf13..616aa52765 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.2-SNAPSHOT + 2.34.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.2-SNAPSHOT + 2.34.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0849cfbffa..2e28a2ec02 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.2-SNAPSHOT + 2.34.2 diff --git a/versions.txt b/versions.txt index b8b35c4b16..4907d332d0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.1:2.34.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.34.2:2.34.2 \ No newline at end of file From 19b7c3ad842a566d4e3e93e48625e0281504de80 Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:50:09 -0500 Subject: [PATCH 1475/2268] feat: Add InputBytes to extract job statistics (#2998) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add InputBytes to extract job statistics * feat: Add InputBytes to extract job statistics * 🦉 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 --- README.md | 6 ++--- .../google/cloud/bigquery/JobStatistics.java | 23 ++++++++++++++++--- .../cloud/bigquery/JobStatisticsTest.java | 3 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 9 ++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 686622a082..f542d5293a 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.34.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.34.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 59c48615fd..1cbf22fa79 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -101,16 +101,21 @@ public static class ExtractStatistics extends JobStatistics { private final List destinationUriFileCounts; + private final Long inputBytes; + static final class Builder extends JobStatistics.Builder { private List destinationUriFileCounts; + private Long inputBytes; + private Builder() {} private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsPb) { super(statisticsPb); if (statisticsPb.getExtract() != null) { this.destinationUriFileCounts = statisticsPb.getExtract().getDestinationUriFileCounts(); + this.inputBytes = statisticsPb.getExtract().getInputBytes(); } } @@ -119,6 +124,11 @@ Builder setDestinationUriFileCounts(List destinationUriFileCounts) { return self(); } + Builder setInputBytes(Long inputBytes) { + this.inputBytes = inputBytes; + return self(); + } + @Override ExtractStatistics build() { return new ExtractStatistics(this); @@ -128,6 +138,7 @@ ExtractStatistics build() { private ExtractStatistics(Builder builder) { super(builder); this.destinationUriFileCounts = builder.destinationUriFileCounts; + this.inputBytes = builder.inputBytes; } /** @@ -139,6 +150,11 @@ public List getDestinationUriFileCounts() { return destinationUriFileCounts; } + /** Returns number of user bytes extracted into the result. */ + public Long getInputBytes() { + return inputBytes; + } + @Override ToStringHelper toStringHelper() { return super.toStringHelper().add("destinationUriFileCounts", destinationUriFileCounts); @@ -159,9 +175,10 @@ public final int hashCode() { @Override com.google.api.services.bigquery.model.JobStatistics toPb() { - com.google.api.services.bigquery.model.JobStatistics statisticsPb = super.toPb(); - return statisticsPb.setExtract( - new JobStatistics4().setDestinationUriFileCounts(destinationUriFileCounts)); + JobStatistics4 extractStatisticsPb = new JobStatistics4(); + extractStatisticsPb.setDestinationUriFileCounts(destinationUriFileCounts); + extractStatisticsPb.setInputBytes(inputBytes); + return super.toPb().setExtract(extractStatisticsPb); } static Builder newBuilder() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index af75a2391e..f32832b594 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -97,6 +97,7 @@ public class JobStatisticsTest { .setEndTime(END_TIME) .setStartTime(START_TIME) .setDestinationUriFileCounts(FILE_COUNT) + .setInputBytes(INPUT_BYTES) .build(); private static final LoadStatistics LOAD_STATISTICS = LoadStatistics.newBuilder() @@ -249,6 +250,7 @@ public void testBuilder() { assertEquals(START_TIME, EXTRACT_STATISTICS.getStartTime()); assertEquals(END_TIME, EXTRACT_STATISTICS.getEndTime()); assertEquals(FILE_COUNT, EXTRACT_STATISTICS.getDestinationUriFileCounts()); + assertEquals(INPUT_BYTES, EXTRACT_STATISTICS.getInputBytes()); assertEquals(CREATION_TIME, LOAD_STATISTICS.getCreationTime()); assertEquals(START_TIME, LOAD_STATISTICS.getStartTime()); @@ -385,6 +387,7 @@ private void compareExtractStatistics(ExtractStatistics expected, ExtractStatist assertEquals(expected, value); compareStatistics(expected, value); assertEquals(expected.getDestinationUriFileCounts(), value.getDestinationUriFileCounts()); + assertEquals(expected.getInputBytes(), value.getInputBytes()); } private void compareLoadStatistics(LoadStatistics expected, LoadStatistics value) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8cada3e084..b37f389ae0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -87,6 +87,7 @@ import com.google.cloud.bigquery.JobId; import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; +import com.google.cloud.bigquery.JobStatistics.ExtractStatistics; import com.google.cloud.bigquery.JobStatistics.LoadStatistics; import com.google.cloud.bigquery.JobStatistics.QueryStatistics; import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; @@ -5304,6 +5305,8 @@ public void testExtractJob() throws InterruptedException, TimeoutException { assertNull(remoteLoadJob.getStatus().getError()); LoadJobConfiguration loadJobConfiguration = remoteLoadJob.getConfiguration(); assertEquals(labels, loadJobConfiguration.getLabels()); + LoadStatistics loadStatistics = remoteLoadJob.getStatistics(); + assertNotNull(loadStatistics); ExtractJobConfiguration extractConfiguration = ExtractJobConfiguration.newBuilder(destinationTable, "gs://" + BUCKET + "/" + EXTRACT_FILE) @@ -5313,6 +5316,12 @@ public void testExtractJob() throws InterruptedException, TimeoutException { remoteExtractJob = remoteExtractJob.waitFor(); assertNull(remoteExtractJob.getStatus().getError()); + ExtractStatistics extractStatistics = remoteExtractJob.getStatistics(); + assertNotNull(extractStatistics); + assertEquals(1L, extractStatistics.getDestinationUriFileCounts().size()); + assertEquals( + loadStatistics.getOutputBytes().longValue(), extractStatistics.getInputBytes().longValue()); + String extractedCsv = new String(storage.readAllBytes(BUCKET, EXTRACT_FILE), StandardCharsets.UTF_8); assertEquals( From ff4a086f0aa3c0401b62489ea8a0b9e2fd6cb3fe Mon Sep 17 00:00:00 2001 From: Minbo Bae <49642083+baeminbo@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:52:21 -0800 Subject: [PATCH 1476/2268] fix: update TableInsertRows.java (#2999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: update TableInsertRows.java Make the example set row id in `addRow`. If row id is missed, it disable the retry b/280865468, which I believe an unexpected behavior to users. * 🦉 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 --- README.md | 2 +- .../java/com/example/bigquery/TableInsertRows.java | 12 ++++++------ .../bigquery/TableInsertRowsWithoutRowIds.java | 2 ++ .../java/com/example/bigquery/TableInsertRowsIT.java | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f542d5293a..3c959da7c1 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.26.0') +implementation platform('com.google.cloud:libraries-bom:26.27.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java b/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java index b5363d47bb..05bcee6d9a 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java +++ b/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java @@ -39,12 +39,13 @@ public static void main(String[] args) { Map rowContent = new HashMap<>(); rowContent.put("booleanField", true); rowContent.put("numericField", "3.14"); - - tableInsertRows(datasetName, tableName, rowContent); + // TODO(developer): Replace the row id with a unique value for each row. + String rowId = "ROW_ID"; + tableInsertRows(datasetName, tableName, rowId, rowContent); } public static void tableInsertRows( - String datasetName, String tableName, Map rowContent) { + String datasetName, String tableName, String rowId, Map rowContent) { try { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. @@ -58,9 +59,8 @@ public static void tableInsertRows( bigquery.insertAll( InsertAllRequest.newBuilder(tableId) // More rows can be added in the same RPC by invoking .addRow() on the builder. - // You can also supply optional unique row keys to support de-duplication - // scenarios. - .addRow(rowContent) + // You can omit the unique row ids to disable de-duplication. + .addRow(rowId, rowContent) .build()); if (response.hasErrors()) { diff --git a/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java b/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java index 1befb593da..1f4def54c0 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java +++ b/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java @@ -54,6 +54,8 @@ public static void tableInsertRowsWithoutRowIds(String datasetName, String table InsertAllResponse response = bigquery.insertAll( InsertAllRequest.newBuilder(TableId.of(datasetName, tableName)) + // No row ids disable de-duplication, and also disable the retries in the Java + // library. .setRows( ImmutableList.of( InsertAllRequest.RowToInsert.of(rowContent1), diff --git a/samples/snippets/src/test/java/com/example/bigquery/TableInsertRowsIT.java b/samples/snippets/src/test/java/com/example/bigquery/TableInsertRowsIT.java index 84a344cd26..d479530120 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/TableInsertRowsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/TableInsertRowsIT.java @@ -88,8 +88,9 @@ public void testTableInsertRows() { Map rowContent = new HashMap<>(); rowContent.put("booleanField", true); rowContent.put("numericField", "3.14"); + String rowId = "ROW_ID"; // Testing - TableInsertRows.tableInsertRows(BIGQUERY_DATASET_NAME, tableName, rowContent); + TableInsertRows.tableInsertRows(BIGQUERY_DATASET_NAME, tableName, rowId, rowContent); assertThat(bout.toString()).contains("Rows successfully inserted into table"); } } From 1fccc1cdf13e7971b34ec4c6fd14c0f29e6aaf7c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:03:32 +0100 Subject: [PATCH 1477/2268] build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.5.0 (#3013) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.5.0 * 🦉 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 --- google-cloud-bigquery/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e0e6a8fb06..2e163c1a23 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -187,7 +187,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.4.0 + 3.5.0 add-source diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a8e7c622c0..d77da94a00 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -92,7 +92,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.4.0 + 3.5.0 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2e28a2ec02..3770393843 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.4.0 + 3.5.0 add-snippets-source From ffc32cf8015030546d2dd7752084e95648d35add Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:03:59 +0100 Subject: [PATCH 1478/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.5.0 (#3008) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.5.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 616aa52765..6121d76d79 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.5 + 3.5.0 From 904ed98af0f08b37f2f54f4b7e83ebf21289d559 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:04:21 +0100 Subject: [PATCH 1479/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.46.0 (#3003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.46.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6121d76d79..39620b9c44 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.45.0 + 2.46.0 pom import From d1bdeab242ea2e6374d1b6d0bbd9eadf638cbcb2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:04:40 +0100 Subject: [PATCH 1480/2268] deps: update actions/github-script action to v7 (#3001) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/github-script action to v7 * 🦉 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 --- .github/workflows/auto-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 92c69857f6..b27e937b45 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true From c40628a05e07c5e70d3aedf7addef60ace80c592 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:05:21 +0100 Subject: [PATCH 1481/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.29.1 (#2997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.29.1 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d77da94a00..e09a2287ee 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.29.0 + 2.29.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3770393843..f27a8d7ff6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.29.0 + 2.29.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2cf63f32d6..e65db0f720 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.29.0 + 2.29.1 test From 79959e5bbd84055575a2fde4e8ec8ed973a373e9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Nov 2023 22:05:41 +0100 Subject: [PATCH 1482/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.34.2 (#2996) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.34.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3c959da7c1..576fec2eba 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.34.1 + 2.34.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e09a2287ee..145e02e3f7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.34.1 + 2.34.2 From ecb567b75849cd0665ac4ab315a5af3bdf934f48 Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:49:30 -0500 Subject: [PATCH 1483/2268] feat: Add Routine DataGovernanceType (#3006) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add Routine DataGovernanceType This also: - fix an issue where RoutineInfo unit test was being skipped - fix an issue where ImportLibaries were not being exported in the toPb method * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Add DataGovernanceType to clirr ignored difference --------- Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 5 +++ .../com/google/cloud/bigquery/Routine.java | 6 ++++ .../google/cloud/bigquery/RoutineInfo.java | 35 +++++++++++++++++-- .../cloud/bigquery/RoutineInfoTest.java | 7 ++++ .../google/cloud/bigquery/RoutineTest.java | 5 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 27 ++++++++++++++ 6 files changed, 83 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index c22579a795..7513b53240 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -19,6 +19,11 @@ com/google/cloud/bigquery/ExternalTableDefinition* *ReferenceFileSchemaUri(*) + + 7013 + com/google/cloud/bigquery/RoutineInfo* + *DataGovernanceType(*) + 7013 com/google/cloud/bigquery/RoutineInfo* diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java index d2d6ec6837..5d99ccfbdc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Routine.java @@ -135,6 +135,12 @@ public Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOpti return this; } + @Override + public Builder setDataGovernanceType(String dataGovernanceType) { + infoBuilder.setDataGovernanceType(dataGovernanceType); + return this; + } + @Override public Routine build() { return new Routine(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java index 3001d2fb97..7cea99f93f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java @@ -72,6 +72,8 @@ public Routine apply(RoutineInfo routineInfo) { private final String body; private final RemoteFunctionOptions remoteFunctionOptions; + private final String dataGovernanceType; + public abstract static class Builder { abstract Builder setRoutineId(RoutineId id); @@ -157,6 +159,13 @@ public abstract static class Builder { */ public abstract Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOptions); + /** + * Sets the data governance type for the Builder (e.g. DATA_MASKING). + * + *

    See https://cloud.google.com/bigquery/docs/reference/rest/v2/routines + */ + public abstract Builder setDataGovernanceType(String dataGovernanceType); + /** Creates a {@code RoutineInfo} object. */ public abstract RoutineInfo build(); } @@ -177,6 +186,8 @@ static class BuilderImpl extends Builder { private String body; private RemoteFunctionOptions remoteFunctionOptions; + private String dataGovernanceType; + BuilderImpl() {} BuilderImpl(RoutineInfo routineInfo) { @@ -194,6 +205,7 @@ static class BuilderImpl extends Builder { this.importedLibrariesList = routineInfo.importedLibrariesList; this.body = routineInfo.body; this.remoteFunctionOptions = routineInfo.remoteFunctionOptions; + this.dataGovernanceType = routineInfo.dataGovernanceType; } BuilderImpl(Routine routinePb) { @@ -225,6 +237,7 @@ static class BuilderImpl extends Builder { this.remoteFunctionOptions = RemoteFunctionOptions.fromPb(routinePb.getRemoteFunctionOptions()); } + this.dataGovernanceType = routinePb.getDataGovernanceType(); } @Override @@ -311,6 +324,12 @@ public Builder setRemoteFunctionOptions(RemoteFunctionOptions remoteFunctionOpti return this; } + @Override + public Builder setDataGovernanceType(String dataGovernanceType) { + this.dataGovernanceType = dataGovernanceType; + return this; + } + @Override public RoutineInfo build() { return new RoutineInfo(this); @@ -332,6 +351,7 @@ public RoutineInfo build() { this.importedLibrariesList = builder.importedLibrariesList; this.body = builder.body; this.remoteFunctionOptions = builder.remoteFunctionOptions; + this.dataGovernanceType = builder.dataGovernanceType; } /** Returns the RoutineId identified for the routine resource. * */ @@ -411,6 +431,11 @@ public RemoteFunctionOptions getRemoteFunctionOptions() { return remoteFunctionOptions; }; + /** Returns the data governance type of the routine, e.g. DATA_MASKING. */ + public String getDataGovernanceType() { + return dataGovernanceType; + } + /** Returns a builder pre-populated using the current values of this routine. */ public Builder toBuilder() { return new BuilderImpl(this); @@ -433,6 +458,7 @@ public String toString() { .add("importedLibrariesList", importedLibrariesList) .add("body", body) .add("remoteFunctionOptions", remoteFunctionOptions) + .add("dataGovernanceType", dataGovernanceType) .toString(); } @@ -452,7 +478,8 @@ public int hashCode() { returnTableType, importedLibrariesList, body, - remoteFunctionOptions); + remoteFunctionOptions, + dataGovernanceType); } @Override @@ -490,7 +517,8 @@ Routine toPb() { .setDescription(getDescription()) .setDeterminismLevel(getDeterminismLevel()) .setLastModifiedTime(getLastModifiedTime()) - .setLanguage(getLanguage()); + .setLanguage(getLanguage()) + .setDataGovernanceType(getDataGovernanceType()); if (getRoutineId() != null) { routinePb.setRoutineReference(getRoutineId().toPb()); } @@ -506,6 +534,9 @@ Routine toPb() { if (getRemoteFunctionOptions() != null) { routinePb.setRemoteFunctionOptions(getRemoteFunctionOptions().toPb()); } + if (getImportedLibraries() != null) { + routinePb.setImportedLibraries(getImportedLibraries()); + } return routinePb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java index 1f1181433b..ae061b62f8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java @@ -33,6 +33,8 @@ public class RoutineInfoTest { private static final Long LAST_MODIFIED_TIME = 20L; private static final String LANGUAGE = "SQL"; + private static final String DATA_GOVERNANCE_TYPE = "DATA_MASKING"; + private static final RoutineArgument ARG_1 = RoutineArgument.newBuilder() .setDataType(StandardSQLDataType.newBuilder("STRING").build()) @@ -63,6 +65,7 @@ public class RoutineInfoTest { .setReturnType(RETURN_TYPE) .setImportedLibraries(IMPORTED_LIBRARIES) .setBody(BODY) + .setDataGovernanceType(DATA_GOVERNANCE_TYPE) .build(); @Test @@ -90,6 +93,7 @@ public void testBuilder() { assertEquals(RETURN_TYPE, ROUTINE_INFO.getReturnType()); assertEquals(IMPORTED_LIBRARIES, ROUTINE_INFO.getImportedLibraries()); assertEquals(BODY, ROUTINE_INFO.getBody()); + assertEquals(DATA_GOVERNANCE_TYPE, ROUTINE_INFO.getDataGovernanceType()); } @Test @@ -107,8 +111,10 @@ public void testOf() { assertNull(routineInfo.getReturnType()); assertNull(routineInfo.getImportedLibraries()); assertNull(routineInfo.getBody()); + assertNull(routineInfo.getDataGovernanceType()); } + @Test public void testToAndFromPb() { compareRoutineInfo(ROUTINE_INFO, RoutineInfo.fromPb(ROUTINE_INFO.toPb())); } @@ -132,6 +138,7 @@ public void compareRoutineInfo(RoutineInfo expected, RoutineInfo value) { assertEquals(expected.getReturnType(), value.getReturnType()); assertEquals(expected.getImportedLibraries(), value.getImportedLibraries()); assertEquals(expected.getBody(), value.getBody()); + assertEquals(expected.getDataGovernanceType(), value.getDataGovernanceType()); assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.toString(), value.toString()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java index c9080e851a..eaf1420120 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java @@ -91,6 +91,8 @@ public class RoutineTest { .setMaxBatchingRows(10L) .build(); + private static final String DATA_GOVERNANCE_TYPE = "DATA_MASKING"; + private static final RoutineInfo ROUTINE_INFO = RoutineInfo.newBuilder(ROUTINE_ID) .setEtag(ETAG) @@ -104,6 +106,7 @@ public class RoutineTest { .setImportedLibraries(IMPORTED_LIBRARIES) .setBody(BODY) .setRemoteFunctionOptions(REMOTE_FUNCTION_OPTIONS) + .setDataGovernanceType(DATA_GOVERNANCE_TYPE) .build(); private static final RoutineInfo ROUTINE_INFO_TVF = @@ -146,6 +149,7 @@ public void testBuilder() { .setImportedLibraries(IMPORTED_LIBRARIES) .setBody(BODY) .setRemoteFunctionOptions(REMOTE_FUNCTION_OPTIONS) + .setDataGovernanceType(DATA_GOVERNANCE_TYPE) .build(); assertEquals(ETAG, builtRoutine.getEtag()); assertEquals(DETERMINISM_LEVEL, builtRoutine.getDeterminismLevel()); @@ -247,5 +251,6 @@ public void compareRoutineInfo(RoutineInfo expected, RoutineInfo value) { assertEquals(expected.getBody(), value.getBody()); assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.getRemoteFunctionOptions(), value.getRemoteFunctionOptions()); + assertEquals(expected.getDataGovernanceType(), value.getDataGovernanceType()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b37f389ae0..7bdb7a7fb0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2684,6 +2684,33 @@ public void testRoutineAPICreationTVF() { assertEquals(routine.getReturnTableType(), returnTableType); } + @Test + public void testRoutineDataGovernanceType() { + String routineName = RemoteBigQueryHelper.generateRoutineName(); + RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); + RoutineInfo routineInfo = + RoutineInfo.newBuilder(routineId) + .setLanguage("SQL") + .setRoutineType("SCALAR_FUNCTION") + .setBody("x") + .setArguments( + ImmutableList.of( + RoutineArgument.newBuilder() + .setName("x") + .setDataType(StandardSQLDataType.newBuilder("INT64").build()) + .build())) + .setReturnType(StandardSQLDataType.newBuilder("INT64").build()) + .setDataGovernanceType("DATA_MASKING") + .build(); + + Routine routine = bigquery.create(routineInfo); + assertNotNull(routine); + assertEquals(routine.getLanguage(), "SQL"); + assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); + assertEquals(routine.getReturnType(), StandardSQLDataType.newBuilder("INT64").build()); + assertEquals(routine.getDataGovernanceType(), "DATA_MASKING"); + } + @Test public void testAuthorizeRoutine() { String routineName = RemoteBigQueryHelper.generateRoutineName(); From ef480029c9e1958c1b6a6f2241b110fb3cfe036d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Nov 2023 17:18:26 +0100 Subject: [PATCH 1484/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20231111-2.0.0 (#3020) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39620b9c44..24862f0b5c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20231008-2.0.0 + v2-rev20231111-2.0.0 3.19.0 12.0.1 From cc6718dd105c22e3cbb912fb6ecfd953443b92a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:28:14 +0000 Subject: [PATCH 1485/2268] build(deps): bump cryptography from 41.0.2 to 41.0.6 in /.kokoro (#3017) Bumps [cryptography](https://togithub.com/pyca/cryptography) from 41.0.2 to 41.0.6.

    Changelog

    Sourced from cryptography's changelog.

    41.0.6 - 2023-11-27

    
    * Fixed a null-pointer-dereference and segfault that could occur when loading
      certificates from a PKCS#7 bundle.  Credit to **pkuzco** for reporting the
      issue. **CVE-2023-49083**
    

    .. _v41-0-5:

    41.0.5 - 2023-10-24

    • Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.4.
    • Added a function to support an upcoming pyOpenSSL release.

    .. _v41-0-4:

    41.0.4 - 2023-09-19

    
    * Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.3.
    

    .. _v41-0-3:

    41.0.3 - 2023-08-01

    • Fixed performance regression loading DH public keys.
    • Fixed a memory leak when using :class:~cryptography.hazmat.primitives.ciphers.aead.ChaCha20Poly1305.
    • Updated Windows, macOS, and Linux wheels to be compiled with OpenSSL 3.1.2.

    .. _v41-0-2:

    Commits

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cryptography&package-manager=pip&previous-version=41.0.2&new-version=41.0.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://togithub.com/googleapis/java-bigquery/network/alerts).
    From 71c3102123effabec812e0f89c0a29b74310a48e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:02:52 -0500 Subject: [PATCH 1486/2268] chore: track customization in templates (#1876) (#2952) Source-Link: https://github.com/googleapis/synthtool/commit/a79241941a00783e0da86853c455e899567c3ccb Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:d0a8eb7ffc63ddce4c63191373d6e99d5385516423c396de207dedf2b6db7427 Co-authored-by: Owl Bot Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> --- .github/.OwlBot.lock.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f930d4846f..a9ab6bf94b 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -14,4 +14,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest digest: sha256:bc2bf47c7370f1b1a8a46b0c104ce7e43644ac58902c9de265fe1f253fcc2506 -# created: 2023-10-31T13:44:21.909247346Z From 759fd64f73a437e4b9847a807b5b716069b4d20e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 1 Dec 2023 21:49:16 +0100 Subject: [PATCH 1487/2268] deps: update arrow.version to v14 (#3023) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24862f0b5c..ffd2422fe4 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ google-cloud-bigquery-parent v2-rev20231111-2.0.0 3.19.0 - 12.0.1 + 14.0.1
    From c09d05022a78a617aefb6b4b079f44db1a2a8ed6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 1 Dec 2023 21:49:33 +0100 Subject: [PATCH 1488/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.6.1 (#3021) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ffd2422fe4..7c0b3a0624 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.6.0 + 1.6.1 From 14ed571365f600b188b7d6716e2549c5b81868ad Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 1 Dec 2023 21:49:59 +0100 Subject: [PATCH 1489/2268] deps: update actions/setup-java action to v4 (#3018) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/setup-java action to v4 * 🦉 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 From ab278b05fd7da9d592ae6d609c971efa17c763e5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:18:52 -0500 Subject: [PATCH 1490/2268] chore(main): release 2.34.3-SNAPSHOT (#2995) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index eb6fcb814d..0686b6c1a5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.2 + 2.34.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2e163c1a23..9f3abe0c5c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.2 + 2.34.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.2 + 2.34.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7c0b3a0624..7a85eaa3c3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.2 + 2.34.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.2 + 2.34.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f27a8d7ff6..a190567b0b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.2 + 2.34.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4907d332d0..03f365097d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.2:2.34.2 \ No newline at end of file +google-cloud-bigquery:2.34.2:2.34.3-SNAPSHOT \ No newline at end of file From 0293edb74e02f44803faacbce400df20da53f66c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 1 Dec 2023 22:44:04 +0100 Subject: [PATCH 1491/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.20.0 (#3019) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a85eaa3c3..df57782433 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20231111-2.0.0 - 3.19.0 + 3.20.0 14.0.1 From 12e758904efb48a4136d5ba0b6351bf75e43d0de Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 1 Dec 2023 23:07:45 +0100 Subject: [PATCH 1492/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v2.47.0 (#3026) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df57782433..abb06c0d13 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.46.0 + 2.47.0 pom import From b3663f6a08a4e0393fa8c0e651d06e7f9b3c78cd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:23:15 -0500 Subject: [PATCH 1493/2268] chore(main): release 2.35.0 (#3028) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Mridula Peddada --- CHANGELOG.md | 22 ++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c4b28a2b0..940d1c5a5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.35.0](https://github.com/googleapis/java-bigquery/compare/v2.34.2...v2.35.0) (2023-12-01) + + +### Features + +* Add InputBytes to extract job statistics ([#2998](https://github.com/googleapis/java-bigquery/issues/2998)) ([19b7c3a](https://github.com/googleapis/java-bigquery/commit/19b7c3ad842a566d4e3e93e48625e0281504de80)) +* Add Routine DataGovernanceType ([#3006](https://github.com/googleapis/java-bigquery/issues/3006)) ([ecb567b](https://github.com/googleapis/java-bigquery/commit/ecb567b75849cd0665ac4ab315a5af3bdf934f48)) + + +### Bug Fixes + +* Update TableInsertRows.java ([#2999](https://github.com/googleapis/java-bigquery/issues/2999)) ([ff4a086](https://github.com/googleapis/java-bigquery/commit/ff4a086f0aa3c0401b62489ea8a0b9e2fd6cb3fe)) + + +### Dependencies + +* Update actions/github-script action to v7 ([#3001](https://github.com/googleapis/java-bigquery/issues/3001)) ([d1bdeab](https://github.com/googleapis/java-bigquery/commit/d1bdeab242ea2e6374d1b6d0bbd9eadf638cbcb2)) +* Update actions/setup-java action to v4 ([#3018](https://github.com/googleapis/java-bigquery/issues/3018)) ([14ed571](https://github.com/googleapis/java-bigquery/commit/14ed571365f600b188b7d6716e2549c5b81868ad)) +* Update arrow.version to v14 ([#3023](https://github.com/googleapis/java-bigquery/issues/3023)) ([759fd64](https://github.com/googleapis/java-bigquery/commit/759fd64f73a437e4b9847a807b5b716069b4d20e)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20231111-2.0.0 ([#3020](https://github.com/googleapis/java-bigquery/issues/3020)) ([ef48002](https://github.com/googleapis/java-bigquery/commit/ef480029c9e1958c1b6a6f2241b110fb3cfe036d)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.20.0 ([#3019](https://github.com/googleapis/java-bigquery/issues/3019)) ([0293edb](https://github.com/googleapis/java-bigquery/commit/0293edb74e02f44803faacbce400df20da53f66c)) + ## [2.34.2](https://github.com/googleapis/java-bigquery/compare/v2.34.1...v2.34.2) (2023-11-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 0686b6c1a5..5be7ca2119 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.34.3-SNAPSHOT + 2.35.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9f3abe0c5c..1806a4e4ed 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.34.3-SNAPSHOT + 2.35.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.34.3-SNAPSHOT + 2.35.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index abb06c0d13..04dacf945c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.34.3-SNAPSHOT + 2.35.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.34.3-SNAPSHOT + 2.35.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a190567b0b..7744e9ca27 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.34.3-SNAPSHOT + 2.35.0 diff --git a/versions.txt b/versions.txt index 03f365097d..fc9d4d40a2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.34.2:2.34.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.35.0:2.35.0 \ No newline at end of file From 20e8b260824189612aa0e7e581be9d0d191351e2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:54:40 +0000 Subject: [PATCH 1494/2268] chore(main): release 2.35.1-SNAPSHOT (#3029) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5be7ca2119..76f9ef91c2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.35.0 + 2.35.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1806a4e4ed..9d1466f158 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.35.0 + 2.35.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.35.0 + 2.35.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 04dacf945c..cdc7dc9743 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.35.0 + 2.35.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.35.0 + 2.35.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7744e9ca27..0f99b68c78 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.35.0 + 2.35.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index fc9d4d40a2..3fa7a0036f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.35.0:2.35.0 \ No newline at end of file +google-cloud-bigquery:2.35.0:2.35.1-SNAPSHOT \ No newline at end of file From f64326a9c46e1f697e15c36c7bf9c9834bc602dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:47:25 -0500 Subject: [PATCH 1495/2268] ci: Update ci.yaml to introduce Java 21 unit testing (#1907) (#3025) Source-Link: https://github.com/googleapis/synthtool/commit/c06d605503f34e91c9d7dfee8f5287d58b5988ae Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:6f431774e11cc46619cf093fd1481193c4024031073697fa18f0099b943aab88 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 3 ++- .github/workflows/ci.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index a9ab6bf94b..d304652e1c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:bc2bf47c7370f1b1a8a46b0c104ce7e43644ac58902c9de265fe1f253fcc2506 + digest: sha256:6f431774e11cc46619cf093fd1481193c4024031073697fa18f0099b943aab88 +# created: 2023-12-01T19:50:20.444857406Z diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e27b2c5756..ae66b1973b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [11, 17] + java: [11, 17, 21] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 From 38191b10a3c2f3ed89351e095c9fc1983bb301ea Mon Sep 17 00:00:00 2001 From: Lumenol <15960196+Lumenol@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:46:41 +0100 Subject: [PATCH 1496/2268] Fix: bigquery.create NullPointerException when job already exists (#3035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 3034: Reproduce and propose fix * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Louis-Maxime Crédeville Co-authored-by: Owl Bot --- README.md | 8 +- .../google/cloud/bigquery/BigQueryImpl.java | 2 +- .../cloud/bigquery/BigQueryImplTest.java | 109 +++++++++--------- 3 files changed, 58 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 576fec2eba..7fdc5ba268 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.27.0') +implementation platform('com.google.cloud:libraries-bom:26.29.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.34.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.35.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.34.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.35.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.34.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.35.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 0d5842724b..7d329e88ff 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -437,7 +437,7 @@ public com.google.api.services.bigquery.model.Job call() { if (matcher.find()) { // If the Job ALREADY EXISTS, retrieve it. - Job job = this.getJob(jobInfo.getJobId()); + Job job = this.getJob(jobInfo.getJobId(), JobOption.fields(JobField.STATISTICS)); long jobCreationTime = job.getStatistics().getCreationTime(); long jobMinStaleTime = System.currentTimeMillis(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 3bbdb98fd3..04bfa6d9f1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -16,47 +16,27 @@ package com.google.cloud.bigquery; +import static com.google.cloud.bigquery.BigQuery.JobField.STATISTICS; +import static com.google.cloud.bigquery.BigQuery.JobField.USER_EMAIL; +import static com.google.cloud.bigquery.BigQueryImpl.optionMap; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; import com.google.api.gax.paging.Page; -import com.google.api.services.bigquery.model.ErrorProto; -import com.google.api.services.bigquery.model.GetQueryResultsResponse; -import com.google.api.services.bigquery.model.JobConfigurationQuery; -import com.google.api.services.bigquery.model.QueryRequest; -import com.google.api.services.bigquery.model.TableCell; -import com.google.api.services.bigquery.model.TableDataInsertAllRequest; -import com.google.api.services.bigquery.model.TableDataInsertAllResponse; -import com.google.api.services.bigquery.model.TableDataList; -import com.google.api.services.bigquery.model.TableRow; +import com.google.api.services.bigquery.model.*; +import com.google.api.services.bigquery.model.JobStatistics; import com.google.cloud.Policy; import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQuery.JobOption; import com.google.cloud.bigquery.BigQuery.QueryResultsOption; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.common.base.Function; import com.google.common.base.Supplier; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; +import com.google.common.collect.*; import java.io.IOException; import java.math.BigInteger; import java.util.Collections; @@ -422,12 +402,11 @@ public class BigQueryImplTest { BigQueryRpc.Option.START_INDEX, 0L); // Job options - private static final BigQuery.JobOption JOB_OPTION_FIELDS = - BigQuery.JobOption.fields(BigQuery.JobField.USER_EMAIL); + private static final JobOption JOB_OPTION_FIELDS = JobOption.fields(USER_EMAIL); // Job list options private static final BigQuery.JobListOption JOB_LIST_OPTION_FIELD = - BigQuery.JobListOption.fields(BigQuery.JobField.STATISTICS); + BigQuery.JobListOption.fields(STATISTICS); private static final BigQuery.JobListOption JOB_LIST_ALL_USERS = BigQuery.JobListOption.allUsers(); private static final BigQuery.JobListOption JOB_LIST_STATE_FILTER = @@ -1615,7 +1594,7 @@ public void testCreateJobWithSelectedFields() { any(com.google.api.services.bigquery.model.Job.class), capturedOptions.capture())) .thenReturn(newJobPb()); - BigQuery.JobOption jobOptions = BigQuery.JobOption.fields(BigQuery.JobField.USER_EMAIL); + JobOption jobOptions = JobOption.fields(USER_EMAIL); bigquery = options.getService(); bigquery.create(JobInfo.of(QueryJobConfiguration.of("SOME QUERY")), jobOptions); @@ -1674,6 +1653,35 @@ public JobId get() { .getJob(any(String.class), eq(id), eq((String) null), eq(EMPTY_RPC_OPTIONS)); } + @Test + public void testCreateJobTryGetNotRandom() { + Map withStatisticOption = optionMap(JobOption.fields(STATISTICS)); + final String id = "testCreateJobTryGet-id"; + String query = "SELECT * in FOO"; + + when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + .thenThrow( + new BigQueryException( + 409, + "already exists, for some reason", + new RuntimeException("Already Exists: Job"))); + when(bigqueryRpcMock.getJob( + any(String.class), eq(id), eq((String) null), eq(withStatisticOption))) + .thenReturn( + newJobPb() + .setId(id) + .setStatistics(new JobStatistics().setCreationTime(System.currentTimeMillis()))); + + bigquery = options.getService(); + Job job = + ((BigQueryImpl) bigquery).create(JobInfo.of(JobId.of(id), QueryJobConfiguration.of(query))); + assertThat(job).isNotNull(); + assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); + verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock) + .getJob(any(String.class), eq(id), eq((String) null), eq(withStatisticOption)); + } + @Test public void testCreateJobWithProjectId() { JobInfo jobInfo = @@ -1925,7 +1933,7 @@ public void testQueryRequestCompleted() throws InterruptedException { JOB_INFO.toPb(), Collections.emptyMap())) .thenReturn(jobResponsePb); when(bigqueryRpcMock.getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb); when(bigqueryRpcMock.listTableData( PROJECT, DATASET, TABLE, Collections.emptyMap())) @@ -1946,8 +1954,7 @@ public void testQueryRequestCompleted() throws InterruptedException { verify(bigqueryRpcMock) .create(JOB_INFO.toPb(), Collections.emptyMap()); verify(bigqueryRpcMock) - .getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) .listTableData(PROJECT, DATASET, TABLE, Collections.emptyMap()); @@ -2003,10 +2010,7 @@ public void testFastQueryMultiplePages() throws InterruptedException { responseJob.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb()); when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)).thenReturn(responseJob); when(bigqueryRpcMock.listTableData( - PROJECT, - DATASET, - TABLE, - BigQueryImpl.optionMap(BigQuery.TableDataListOption.pageToken(CURSOR)))) + PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR)))) .thenReturn( new TableDataList() .setPageToken(CURSOR) @@ -2044,10 +2048,7 @@ public void testFastQueryMultiplePages() throws InterruptedException { verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); verify(bigqueryRpcMock) .listTableData( - PROJECT, - DATASET, - TABLE, - BigQueryImpl.optionMap(BigQuery.TableDataListOption.pageToken(CURSOR))); + PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR))); verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); } @@ -2084,7 +2085,7 @@ public void testFastQuerySlowDdl() throws InterruptedException { responseJob.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb()); when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)).thenReturn(responseJob); when(bigqueryRpcMock.getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(queryResultsResponsePb); when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(new TableDataList().setRows(ImmutableList.of(TABLE_ROW)).setTotalRows(1L)); @@ -2108,8 +2109,7 @@ public void testFastQuerySlowDdl() throws InterruptedException { verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); verify(bigqueryRpcMock) - .getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @@ -2143,7 +2143,7 @@ public void testQueryRequestCompletedOptions() throws InterruptedException { optionMap.put(pageSizeOption.getRpcOption(), pageSizeOption.getValue()); when(bigqueryRpcMock.getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb); when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, optionMap)) .thenReturn( @@ -2164,8 +2164,7 @@ public void testQueryRequestCompletedOptions() throws InterruptedException { verify(bigqueryRpcMock) .create(JOB_INFO.toPb(), Collections.emptyMap()); verify(bigqueryRpcMock) - .getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, optionMap); } @@ -2199,10 +2198,10 @@ public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedExcepti JOB_INFO.toPb(), Collections.emptyMap())) .thenReturn(jobResponsePb1); when(bigqueryRpcMock.getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb1); when(bigqueryRpcMock.getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb2); when(bigqueryRpcMock.listTableData( PROJECT, DATASET, TABLE, Collections.emptyMap())) @@ -2223,11 +2222,9 @@ public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedExcepti verify(bigqueryRpcMock) .create(JOB_INFO.toPb(), Collections.emptyMap()); verify(bigqueryRpcMock) - .getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) - .getQueryResults( - PROJECT, JOB, null, BigQueryImpl.optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) .listTableData(PROJECT, DATASET, TABLE, Collections.emptyMap()); } From ff93fb8c7832ed01b59ca66f34510e343957bc83 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 15 Dec 2023 20:16:39 +0100 Subject: [PATCH 1497/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.30.0 (#3038) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 145e02e3f7..a89c8c4ab8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.29.1 + 2.30.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0f99b68c78..2c05468f6d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.29.1 + 2.30.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e65db0f720..f2307eb44b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.29.1 + 2.30.0 test From d2f1b030af8dbd0d807ecbd7c72b2fdfd9740d11 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Dec 2023 16:50:05 +0100 Subject: [PATCH 1498/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.3 (#3048) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.3 * 🦉 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 --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index f4c1c3ddc1..9310ae98ec 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.2.3 **/*IT From 68a9e915d65ce8781cfa5e361ddb77666fb41d0b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:08:00 -0500 Subject: [PATCH 1499/2268] build(deps): bump cryptography from 41.0.2 to 41.0.3 in /synthtool/gcp/templates/java_library/.kokoro (#1846) (#3036) build(deps): bump cryptography Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.3) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Source-Link: https://github.com/googleapis/synthtool/commit/bfb4e631084fff256869cd33bcb6aaa55f1c736d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:11d59eabd49dc088f8339fb96e9da79ba4b3a73b3d49a8a4e0263e91edd053ba Signed-off-by: dependabot[bot] Co-authored-by: Owl Bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Burke Davison <40617934+burkedavison@users.noreply.github.com> Co-authored-by: Jeffrey Rennie Co-authored-by: Alice <65933803+alicejli@users.noreply.github.com> Co-authored-by: PhongChuong <147636638+PhongChuong@users.noreply.github.com> --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/requirements.txt | 48 +++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index d304652e1c..bff46cd669 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:6f431774e11cc46619cf093fd1481193c4024031073697fa18f0099b943aab88 -# created: 2023-12-01T19:50:20.444857406Z + digest: sha256:11d59eabd49dc088f8339fb96e9da79ba4b3a73b3d49a8a4e0263e91edd053ba +# created: 2023-12-05T18:46:43.811070085Z \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index c5c11bbe79..6a36ccab46 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -170,30 +170,30 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==41.0.2 \ - --hash=sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711 \ - --hash=sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7 \ - --hash=sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd \ - --hash=sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e \ - --hash=sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58 \ - --hash=sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0 \ - --hash=sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d \ - --hash=sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83 \ - --hash=sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831 \ - --hash=sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766 \ - --hash=sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b \ - --hash=sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c \ - --hash=sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182 \ - --hash=sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f \ - --hash=sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa \ - --hash=sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4 \ - --hash=sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a \ - --hash=sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2 \ - --hash=sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76 \ - --hash=sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5 \ - --hash=sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee \ - --hash=sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f \ - --hash=sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14 +cryptography==41.0.3 \ + --hash=sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306 \ + --hash=sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84 \ + --hash=sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47 \ + --hash=sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d \ + --hash=sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116 \ + --hash=sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207 \ + --hash=sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81 \ + --hash=sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087 \ + --hash=sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd \ + --hash=sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507 \ + --hash=sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858 \ + --hash=sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae \ + --hash=sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34 \ + --hash=sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906 \ + --hash=sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd \ + --hash=sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922 \ + --hash=sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7 \ + --hash=sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4 \ + --hash=sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574 \ + --hash=sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1 \ + --hash=sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c \ + --hash=sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e \ + --hash=sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de # via # gcp-releasetool # secretstorage From a7106325b0f688fc36b1b93ecb7001e45b54a454 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Dec 2023 17:46:12 +0100 Subject: [PATCH 1500/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.34.0 (#3033) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cdc7dc9743..f3a9f5156a 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.32.0 + 2.34.0 test From 270f8665a4973be6091697bc8101bee76e26ff1d Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 19 Dec 2023 07:44:37 -0500 Subject: [PATCH 1501/2268] feat: Use location in BigQueryOption as the default for query (#3047) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Use location in BigQueryOption as the default for query * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Use location in BigQueryOption as the default for query * feat: Use location in BigQueryOption as the default for query * feat: Use location in BigQueryOption as the default for query --------- Co-authored-by: Owl Bot --- .../google/cloud/bigquery/BigQueryImpl.java | 9 ++- .../cloud/bigquery/BigQueryImplTest.java | 41 +++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 73 ++++++++++++++++--- 3 files changed, 111 insertions(+), 12 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 7d329e88ff..dcbcd19b04 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1339,6 +1339,9 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio if (requestInfo.isFastQuerySupported(null)) { String projectId = getOptions().getProjectId(); QueryRequest content = requestInfo.toPb(); + if (getOptions().getLocation() != null) { + content.setLocation(getOptions().getLocation()); + } return queryRpc(projectId, content, options); } // Otherwise, fall back to the existing create query job logic @@ -1437,12 +1440,14 @@ public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOp String projectId = jobId.getProject() != null ? jobId.getProject() : getOptions().getProjectId(); QueryRequest content = requestInfo.toPb(); - // Be careful when setting the location in JobId, if a location is specified in the JobId, - // the job created by the query method will be in that location, even if the table to be + // Be careful when setting the location, if a location is specified in the BigQueryOption or + // JobId the job created by the query method will be in that location, even if the table to be // queried is in a different location. This may cause the query to fail with // "BigQueryException: Not found" if (jobId.getLocation() != null) { content.setLocation(jobId.getLocation()); + } else if (getOptions().getLocation() != null) { + content.setLocation(getOptions().getLocation()); } return queryRpc(projectId, content, options); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 04bfa6d9f1..62160bef20 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -1994,6 +1994,47 @@ public void testFastQueryRequestCompleted() throws InterruptedException { QUERY_JOB_CONFIGURATION_FOR_QUERY.getDefaultDataset().getDataset(), requestPb.getDefaultDataset().getDatasetId()); assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); + assertNull(requestPb.getLocation()); + + verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); + } + + @Test + public void testFastQueryRequestCompletedWithLocation() throws InterruptedException { + com.google.api.services.bigquery.model.QueryResponse queryResponsePb = + new com.google.api.services.bigquery.model.QueryResponse() + .setCacheHit(false) + .setJobComplete(true) + .setKind("bigquery#queryResponse") + .setPageToken(null) + .setRows(ImmutableList.of(TABLE_ROW)) + .setSchema(TABLE_SCHEMA.toPb()) + .setTotalBytesProcessed(42L) + .setTotalRows(BigInteger.valueOf(1L)); + + when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + .thenReturn(queryResponsePb); + + BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); + bigquery = options.getService(); + TableResult result = bigquery.query(QUERY_JOB_CONFIGURATION_FOR_QUERY); + assertNull(result.getNextPage()); + assertNull(result.getNextPageToken()); + assertFalse(result.hasNextPage()); + assertThat(result.getSchema()).isEqualTo(TABLE_SCHEMA); + assertThat(result.getTotalRows()).isEqualTo(1); + for (FieldValueList row : result.getValues()) { + assertThat(row.get(0).getBooleanValue()).isFalse(); + assertThat(row.get(1).getLongValue()).isEqualTo(1); + } + + QueryRequest requestPb = requestPbCapture.getValue(); + assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.getQuery(), requestPb.getQuery()); + assertEquals( + QUERY_JOB_CONFIGURATION_FOR_QUERY.getDefaultDataset().getDataset(), + requestPb.getDefaultDataset().getDatasetId()); + assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); + assertEquals(LOCATION, requestPb.getLocation()); verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 7bdb7a7fb0..9a0e3e1079 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6227,27 +6227,80 @@ public void testAlreadyExistJobExceptionHandling() throws InterruptedException { @Test public void testStatelessQueries() throws InterruptedException { + // Create local BigQuery to not contaminate global test parameters. + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQuery bigQuery = bigqueryHelper.getOptions().getService(); + // simulate setting the QUERY_PREVIEW_ENABLED environment variable - bigquery.getOptions().setQueryPreviewEnabled("TRUE"); - assertNull(executeSimpleQuery().getJobId()); + bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + assertNull(executeSimpleQuery(bigQuery).getJobId()); // the flag should be case-insensitive - bigquery.getOptions().setQueryPreviewEnabled("tRuE"); - assertNull(executeSimpleQuery().getJobId()); + bigQuery.getOptions().setQueryPreviewEnabled("tRuE"); + assertNull(executeSimpleQuery(bigQuery).getJobId()); // any other values won't enable optional job creation mode - bigquery.getOptions().setQueryPreviewEnabled("test_value"); - assertNotNull(executeSimpleQuery().getJobId()); + bigQuery.getOptions().setQueryPreviewEnabled("test_value"); + assertNotNull(executeSimpleQuery(bigQuery).getJobId()); // reset the flag - bigquery.getOptions().setQueryPreviewEnabled(null); - assertNotNull(executeSimpleQuery().getJobId()); + bigQuery.getOptions().setQueryPreviewEnabled(null); + assertNotNull(executeSimpleQuery(bigQuery).getJobId()); } - private TableResult executeSimpleQuery() throws InterruptedException { + private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedException { String query = "SELECT 1 as one"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); - TableResult result = bigquery.query(config); + TableResult result = bigQuery.query(config); return result; } + + @Test + public void testStatelessQueriesWithLocation() throws Exception { + // This test validates BigQueryOption location is used for stateless query by verifying that the + // stateless query fails when the BigQueryOption location does not match the dataset location. + String location = "EU"; + String wrongLocation = "US"; + + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQuery bigQuery = + bigqueryHelper.getOptions().toBuilder().setLocation(location).build().getService(); + + Dataset dataset = + bigQuery.create( + DatasetInfo.newBuilder("locationset_" + UUID.randomUUID().toString().replace("-", "_")) + .setLocation(location) + .build()); + try { + TableId tableId = TableId.of(dataset.getDatasetId().getDataset(), "sometable"); + Schema schema = Schema.of(Field.of("name", LegacySQLTypeName.STRING)); + TableDefinition tableDef = StandardTableDefinition.of(schema); + Table table = bigQuery.create(TableInfo.newBuilder(tableId, tableDef).build()); + + String query = + String.format( + "SELECT * FROM `%s.%s.%s`", + table.getTableId().getProject(), + table.getTableId().getDataset(), + table.getTableId().getTable()); + + // Test stateless query when BigQueryOption location matches dataset location. + bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + TableResult tb = bigQuery.query(QueryJobConfiguration.of(query)); + assertNull(tb.getJobId()); + + // Test stateless query when BigQueryOption location does not match dataset location. + try { + BigQuery bigQueryWrongLocation = + bigqueryHelper.getOptions().toBuilder().setLocation(wrongLocation).build().getService(); + bigQueryWrongLocation.getOptions().setQueryPreviewEnabled("TRUE"); + bigQueryWrongLocation.query(QueryJobConfiguration.of(query)); + fail("querying a table with wrong location shouldn't work"); + } catch (BigQueryException e) { + // Nothing to do + } + } finally { + bigQuery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); + } + } } From 2d43a1f44127f43010e7ce77e269a95d07d55810 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Dec 2023 13:45:46 +0100 Subject: [PATCH 1502/2268] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.7.1 (#3049) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f3a9f5156a..e6f9c650f6 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.6.1 + 1.7.1 From b0dc33ad4e004edcfbee131edb5745159f9e6af3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Dec 2023 17:24:19 +0100 Subject: [PATCH 1503/2268] deps: update arrow.version to v14.0.2 (#3050) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6f9c650f6..645f7ea71d 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ google-cloud-bigquery-parent v2-rev20231111-2.0.0 3.20.0 - 14.0.1 + 14.0.2 From c76e8f5a1ae8f77b784348b6c3eeb5b7252a6f57 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Dec 2023 17:47:56 +0100 Subject: [PATCH 1504/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.12.0 (#3051) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 76f9ef91c2..d1e001a29c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.0 org.apache.maven.plugins From c71eabfd36ed30ec56aefaecd20d7da000090d00 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Dec 2023 17:51:32 +0100 Subject: [PATCH 1505/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.33.0 (#3032) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.33.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 645f7ea71d..069dbfb687 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.32.0 + 2.33.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a89c8c4ab8..5bf418cd86 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.32.0 + 2.33.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2c05468f6d..c6c87a9613 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.32.0 + 2.33.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f2307eb44b..4eb97c9486 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.32.0 + 2.33.0 test From f4abbc2b6a1b2ce03a0f4ad4387d4ce5a7d7fcc8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Dec 2023 19:08:42 +0100 Subject: [PATCH 1506/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.34.0 (#3053) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 069dbfb687..4ee9e0ea82 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.33.0 + 2.34.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5bf418cd86..f5fb70316e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.33.0 + 2.34.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c6c87a9613..10d895eb28 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.33.0 + 2.34.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4eb97c9486..0d89f1fc1d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.33.0 + 2.34.0 test From 52d5e97bdb9fa58c9fbee06cc1b41d58feeae379 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Dec 2023 20:03:54 +0100 Subject: [PATCH 1507/2268] deps: update github/codeql-action action to v2.22.11 (#3002) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 730e292765..bdbab91e16 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 + uses: github/codeql-action/upload-sarif@03e7845b7bfcd5e7fb63d1ae8c61b0e791134fab # v2.22.11 with: sarif_file: results.sarif From 7d761006b4a7f549bf254b03f67989c9b41cd7b1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Dec 2023 16:18:49 +0100 Subject: [PATCH 1508/2268] deps: update actions/upload-artifact action to v4 (#3055) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index bdbab91e16..c7f7f64aaa 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: SARIF file path: results.sarif From fb4d0e5e944b9ad7e8aa56e51c059a20b1c4d6eb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Dec 2023 16:22:46 +0100 Subject: [PATCH 1509/2268] test(deps): update dependency com.google.truth:truth to v1.2.0 (#3054) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 4ee9e0ea82..c8f6decbcd 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.truth truth - 1.1.5 + 1.2.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f5fb70316e..b8478a8377 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.1.5 + 1.2.0 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 9310ae98ec..95de88cf6e 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.1.5 + 1.2.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 10d895eb28..6892d55a94 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.1.5 + 1.2.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0d89f1fc1d..3debd229ed 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.1.5 + 1.2.0 test From 21b525f58121d1a3473ea0454ddc9a21178d8776 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Dec 2023 16:31:23 +0100 Subject: [PATCH 1510/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.35.0 (#3030) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.35.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7fdc5ba268..0a5c250aec 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.34.2 + 2.35.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b8478a8377..99e3a85400 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.34.2 + 2.35.0 From 7a1bbd2d33e71644d83c42b71c67bac099882a4a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Dec 2023 17:01:18 +0100 Subject: [PATCH 1511/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.30.1 (#3031) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8f6decbcd..99903e7f2d 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.29.1 + 2.30.1 test From febfc1fdb026a0d07ab24159437633cfb7f44c5d Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 5 Jan 2024 11:38:03 -0500 Subject: [PATCH 1512/2268] feat: Support RANGE schema (#3043) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add support for creating tables with range type schema * feat: Add support for creating tables with range type schema * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Use location in BigQueryOption as the default for query * 🦉 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 --- .../java/com/google/cloud/bigquery/Field.java | 25 +++++++- .../cloud/bigquery/FieldElementType.java | 63 +++++++++++++++++++ .../cloud/bigquery/LegacySQLTypeName.java | 4 ++ .../cloud/bigquery/StandardSQLTypeName.java | 4 +- .../cloud/bigquery/FieldElementTypeTest.java | 46 ++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 20 ++++++ 6 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 7496530dd6..9fbc2ab910 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -64,6 +64,7 @@ public TableFieldSchema apply(Field field) { private final Long precision; private final String defaultValueExpression; private final String collation; + private final FieldElementType rangeElementType; /** * Mode for a BigQuery Table field. {@link Mode#NULLABLE} fields can be set to {@code null}, @@ -89,6 +90,7 @@ public static final class Builder { private Long precision; private String defaultValueExpression; private String collation; + private FieldElementType rangeElementType; private Builder() {} @@ -104,6 +106,7 @@ private Builder(Field field) { this.precision = field.precision; this.defaultValueExpression = field.defaultValueExpression; this.collation = field.collation; + this.rangeElementType = field.rangeElementType; } /** @@ -292,6 +295,12 @@ public Builder setCollation(String collation) { return this; } + /** Optional. Field range element type can be set only when the type of field is RANGE. */ + public Builder setRangeElementType(FieldElementType rangeElementType) { + this.rangeElementType = rangeElementType; + return this; + } + /** Creates a {@code Field} object. */ public Field build() { return new Field(this); @@ -310,6 +319,7 @@ private Field(Builder builder) { this.precision = builder.precision; this.defaultValueExpression = builder.defaultValueExpression; this.collation = builder.collation; + this.rangeElementType = builder.rangeElementType; } /** Returns the field name. */ @@ -369,6 +379,11 @@ public String getCollation() { return collation; } + /** Return the range element type the field. */ + public FieldElementType getRangeElementType() { + return rangeElementType; + } + /** * Returns the list of sub-fields if {@link #getType()} is a {@link LegacySQLTypeName#RECORD}. * Returns {@code null} otherwise. @@ -395,12 +410,13 @@ public String toString() { .add("precision", precision) .add("defaultValueExpression", defaultValueExpression) .add("collation", collation) + .add("rangeElementType", rangeElementType) .toString(); } @Override public int hashCode() { - return Objects.hash(name, type, mode, description, policyTags); + return Objects.hash(name, type, mode, description, policyTags, rangeElementType); } @Override @@ -484,6 +500,9 @@ TableFieldSchema toPb() { if (collation != null) { fieldSchemaPb.setCollation(collation); } + if (rangeElementType != null) { + fieldSchemaPb.setRangeElementType(rangeElementType.toPb()); + } return fieldSchemaPb; } @@ -519,6 +538,10 @@ static Field fromPb(TableFieldSchema fieldSchemaPb) { if (fieldSchemaPb.getCollation() != null) { fieldBuilder.setCollation(fieldSchemaPb.getCollation()); } + if (fieldSchemaPb.getRangeElementType() != null) { + fieldBuilder.setRangeElementType( + FieldElementType.fromPb(fieldSchemaPb.getRangeElementType())); + } return fieldBuilder.build(); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java new file mode 100644 index 0000000000..43446e1d01 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.TableFieldSchema; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +@AutoValue +public abstract class FieldElementType implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * The subtype of the RANGE, if the field type is RANGE. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract String getType(); + + public abstract FieldElementType.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public abstract FieldElementType.Builder setType(String type); + + public abstract FieldElementType build(); + } + + public static Builder newBuilder() { + return new AutoValue_FieldElementType.Builder(); + } + + TableFieldSchema.RangeElementType toPb() { + TableFieldSchema.RangeElementType rangeElementTypePb = new TableFieldSchema.RangeElementType(); + rangeElementTypePb.setType(getType()); + return rangeElementTypePb; + } + + static FieldElementType fromPb(TableFieldSchema.RangeElementType rangeElementTypePb) { + // Treat a FieldElementType message without a Type subfield as invalid. + if (rangeElementTypePb.getType() != null) { + return newBuilder().setType(rangeElementTypePb.getType()).build(); + } + return null; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java index 944df2fb06..dec2583e90 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java @@ -100,6 +100,10 @@ public LegacySQLTypeName apply(String constant) { public static final LegacySQLTypeName INTERVAL = type.createAndRegister("INTERVAL").setStandardType(StandardSQLTypeName.INTERVAL); + /** Represents a contiguous range of values. */ + public static final LegacySQLTypeName RANGE = + type.createAndRegister("RANGE").setStandardType(StandardSQLTypeName.RANGE); + private static Map standardToLegacyMap = new HashMap<>(); static { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java index 1081fc5d60..1f70183cdc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/StandardSQLTypeName.java @@ -60,5 +60,7 @@ public enum StandardSQLTypeName { /** Represents JSON data. */ JSON, /** Represents duration or amount of time. */ - INTERVAL + INTERVAL, + /** Represents a contiguous range of values. */ + RANGE } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java new file mode 100644 index 0000000000..9b45908929 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class FieldElementTypeTest { + private static final FieldElementType FIELD_ELEMENT_TYPE = + FieldElementType.newBuilder().setType("DATE").build(); + + @Test + public void testToBuilder() { + compareFieldElementType(FIELD_ELEMENT_TYPE, FIELD_ELEMENT_TYPE.toBuilder().build()); + } + + @Test + public void testBuilder() { + assertEquals("DATE", FIELD_ELEMENT_TYPE.getType()); + } + + @Test + public void testFromAndPb() { + assertEquals(FIELD_ELEMENT_TYPE, FieldElementType.fromPb(FIELD_ELEMENT_TYPE.toPb())); + } + + private void compareFieldElementType(FieldElementType expected, FieldElementType value) { + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9a0e3e1079..d8d673360d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -72,6 +72,7 @@ import com.google.cloud.bigquery.ExtractJobConfiguration; import com.google.cloud.bigquery.Field; import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldElementType; import com.google.cloud.bigquery.FieldList; import com.google.cloud.bigquery.FieldValue; import com.google.cloud.bigquery.FieldValue.Attribute; @@ -1246,6 +1247,25 @@ public void testIntervalType() throws InterruptedException { } } + @Test + public void testRangeType() throws InterruptedException { + String tableName = "test_create_table_rangetype"; + TableId tableId = TableId.of(DATASET, tableName); + Schema schema = + Schema.of( + Field.newBuilder("rangeField", StandardSQLTypeName.RANGE) + .setRangeElementType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build()); + StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(schema); + try { + // Create a table with a RANGE column. + Table createdTable = bigquery.create(TableInfo.of(tableId, standardTableDefinition)); + assertNotNull(createdTable); + } finally { + assertTrue(bigquery.delete(tableId)); + } + } + @Test public void testCreateTableWithConstraints() { String tableName = "test_create_table_with_constraints"; From 78995c47ba33019e1007f98d152016ffc3184bd4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 8 Jan 2024 17:33:48 +0100 Subject: [PATCH 1513/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.21.0 (#3060) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 99903e7f2d..5d5bd27ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20231111-2.0.0 - 3.20.0 + 3.21.0 14.0.2 From 27489c7215939078f37beec405d6ccd7e9acfd12 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 10 Jan 2024 18:18:23 +0100 Subject: [PATCH 1514/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.31.0 (#3063) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d5bd27ca9..ec4240d779 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.30.1 + 2.31.0 test From 645ff9cf0632bab1cf65d77ceaa969f7edc7fc96 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:04:10 -0500 Subject: [PATCH 1515/2268] chore(main): release 2.36.0 (#3044) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 22 ++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 940d1c5a5f..88197b2c12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.36.0](https://github.com/googleapis/java-bigquery/compare/v2.35.0...v2.36.0) (2024-01-10) + + +### Features + +* Support RANGE schema ([#3043](https://github.com/googleapis/java-bigquery/issues/3043)) ([febfc1f](https://github.com/googleapis/java-bigquery/commit/febfc1fdb026a0d07ab24159437633cfb7f44c5d)) +* Use location in BigQueryOption as the default for query ([#3047](https://github.com/googleapis/java-bigquery/issues/3047)) ([270f866](https://github.com/googleapis/java-bigquery/commit/270f8665a4973be6091697bc8101bee76e26ff1d)) + + +### Bug Fixes + +* Bigquery.create NullPointerException when job already exists ([#3035](https://github.com/googleapis/java-bigquery/issues/3035)) ([38191b1](https://github.com/googleapis/java-bigquery/commit/38191b10a3c2f3ed89351e095c9fc1983bb301ea)) + + +### Dependencies + +* Update actions/upload-artifact action to v4 ([#3055](https://github.com/googleapis/java-bigquery/issues/3055)) ([7d76100](https://github.com/googleapis/java-bigquery/commit/7d761006b4a7f549bf254b03f67989c9b41cd7b1)) +* Update arrow.version to v14.0.2 ([#3050](https://github.com/googleapis/java-bigquery/issues/3050)) ([b0dc33a](https://github.com/googleapis/java-bigquery/commit/b0dc33ad4e004edcfbee131edb5745159f9e6af3)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.34.0 ([#3033](https://github.com/googleapis/java-bigquery/issues/3033)) ([a710632](https://github.com/googleapis/java-bigquery/commit/a7106325b0f688fc36b1b93ecb7001e45b54a454)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.21.0 ([#3060](https://github.com/googleapis/java-bigquery/issues/3060)) ([78995c4](https://github.com/googleapis/java-bigquery/commit/78995c47ba33019e1007f98d152016ffc3184bd4)) +* Update github/codeql-action action to v2.22.11 ([#3002](https://github.com/googleapis/java-bigquery/issues/3002)) ([52d5e97](https://github.com/googleapis/java-bigquery/commit/52d5e97bdb9fa58c9fbee06cc1b41d58feeae379)) + ## [2.35.0](https://github.com/googleapis/java-bigquery/compare/v2.34.2...v2.35.0) (2023-12-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d1e001a29c..4041a1b706 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.35.1-SNAPSHOT + 2.36.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9d1466f158..d7e1519367 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.35.1-SNAPSHOT + 2.36.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.35.1-SNAPSHOT + 2.36.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ec4240d779..f7c83573fe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.35.1-SNAPSHOT + 2.36.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.35.1-SNAPSHOT + 2.36.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6892d55a94..a38c313c7f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.35.1-SNAPSHOT + 2.36.0 diff --git a/versions.txt b/versions.txt index 3fa7a0036f..e2ab490a51 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.35.0:2.35.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.36.0:2.36.0 \ No newline at end of file From a7ffacf7ff1c4fca4dcf7d47463e752730bb6dfd Mon Sep 17 00:00:00 2001 From: Sergei Lilichenko Date: Fri, 12 Jan 2024 04:45:43 -0800 Subject: [PATCH 1516/2268] chore: change row and column variable names in SimpleQuery example (#3059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changed the names of the row and column variables to make their purpose clear. * Changed the code sample to reflect the real life usage * Updated the query and column names * Attempt to fix formatting. * Modified the IT test to match the query in the sample. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Co-authored-by: Owl Bot --- .../java/com/example/bigquery/SimpleQuery.java | 14 ++++++++++++-- .../java/com/example/bigquery/SimpleQueryIT.java | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java b/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java index 1aeaff1955..429a339cf5 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java +++ b/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java @@ -17,6 +17,7 @@ package com.example.bigquery; // [START bigquery_query] + import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; @@ -27,7 +28,9 @@ public class SimpleQuery { public static void main(String[] args) { // TODO(developer): Replace this query before running the sample. - String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; + String query = + "SELECT corpus, count(*) as corpus_count " + + "FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; simpleQuery(query); } @@ -44,7 +47,14 @@ public static void simpleQuery(String query) { TableResult result = bigquery.query(queryConfig); // Print the results. - result.iterateAll().forEach(rows -> rows.forEach(row -> System.out.println(row.getValue()))); + result + .iterateAll() + .forEach( + row -> { + System.out.print("corpus:" + row.get("corpus").getStringValue()); + System.out.print(", count:" + row.get("corpus_count").getLongValue()); + System.out.println(); + }); System.out.println("Query ran successfully"); } catch (BigQueryException | InterruptedException e) { diff --git a/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryIT.java b/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryIT.java index b750c31464..5441ffccad 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryIT.java @@ -51,7 +51,9 @@ public void tearDown() { @Test public void testSimpleQuery() { - String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; + String query = + "SELECT corpus, count(*) as corpus_count " + + "FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; SimpleQuery.simpleQuery(query); assertThat(bout.toString()).contains("Query ran successfully"); From 7d61111d23282c7e2478ac31ba0d4e423330ec92 Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 12 Jan 2024 07:50:18 -0500 Subject: [PATCH 1517/2268] feat: Add support for Table resource tags (#3046) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor labels into annotations to be used for resource tags * Fix issue where changelog was updated during a refactoring * Fix issue where changelog was updated during a refactoring * Add resource tags to Tables * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: clirr * Update TableInfoTest to include ResourceTags --------- Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 5 +++ .../{Labels.java => Annotations.java} | 12 +++---- .../google/cloud/bigquery/DatasetInfo.java | 8 ++--- .../com/google/cloud/bigquery/ModelInfo.java | 8 ++--- .../java/com/google/cloud/bigquery/Table.java | 6 ++++ .../com/google/cloud/bigquery/TableInfo.java | 31 ++++++++++++++++--- .../{LabelsTest.java => AnnotationsTest.java} | 28 ++++++++--------- .../google/cloud/bigquery/TableInfoTest.java | 2 ++ 8 files changed, 68 insertions(+), 32 deletions(-) rename google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/{Labels.java => Annotations.java} (87%) rename google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/{LabelsTest.java => AnnotationsTest.java} (62%) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 7513b53240..9c69fd6a68 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -29,6 +29,11 @@ com/google/cloud/bigquery/RoutineInfo* *RemoteFunctionOptions(*) + + 7013 + com/google/cloud/bigquery/TableInfo* + *ResourceTags(*) + 7012 com/google/cloud/bigquery/Connection diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Labels.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Annotations.java similarity index 87% rename from google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Labels.java rename to google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Annotations.java index 8f91aa37ae..5d8d1e7e0c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Labels.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Annotations.java @@ -28,9 +28,9 @@ import javax.annotation.Nullable; @AutoValue -abstract class Labels implements Serializable { +abstract class Annotations implements Serializable { private static final long serialVersionUID = 1L; - static final Labels ZERO = of(Collections.emptyMap()); + static final Annotations ZERO = of(Collections.emptyMap()); @Nullable abstract Map userMap(); @@ -59,13 +59,13 @@ Map toPb() { return Collections.unmodifiableMap(pbMap); } - private static Labels of(Map userMap) { + private static Annotations of(Map userMap) { Preconditions.checkArgument( userMap == null || !userMap.containsKey(null), "null keys are not supported"); - return new AutoValue_Labels(userMap); + return new AutoValue_Annotations(userMap); } - static Labels fromUser(Map map) { + static Annotations fromUser(Map map) { if (map == null || map instanceof ImmutableMap) { return of(map); } @@ -73,7 +73,7 @@ static Labels fromUser(Map map) { return of(Collections.unmodifiableMap(new HashMap<>(map))); } - static Labels fromPb(Map pb) { + static Annotations fromPb(Map pb) { if (Data.isNull(pb)) { return of(null); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index 0dddc0e86f..b5fabe97d1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -69,7 +69,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final Long lastModified; private final String location; private final String selfLink; - private final Labels labels; + private final Annotations labels; private final EncryptionConfiguration defaultEncryptionConfiguration; private final Long defaultPartitionExpirationMs; private final String defaultCollation; @@ -194,7 +194,7 @@ static final class BuilderImpl extends Builder { private Long lastModified; private String location; private String selfLink; - private Labels labels = Labels.ZERO; + private Annotations labels = Annotations.ZERO; private EncryptionConfiguration defaultEncryptionConfiguration; private Long defaultPartitionExpirationMs; private String defaultCollation; @@ -247,7 +247,7 @@ public Acl apply(Dataset.Access accessPb) { this.lastModified = datasetPb.getLastModifiedTime(); this.location = datasetPb.getLocation(); this.selfLink = datasetPb.getSelfLink(); - this.labels = Labels.fromPb(datasetPb.getLabels()); + this.labels = Annotations.fromPb(datasetPb.getLabels()); if (datasetPb.getDefaultEncryptionConfiguration() != null) { this.defaultEncryptionConfiguration = new EncryptionConfiguration.Builder(datasetPb.getDefaultEncryptionConfiguration()) @@ -337,7 +337,7 @@ Builder setSelfLink(String selfLink) { */ @Override public Builder setLabels(Map labels) { - this.labels = Labels.fromUser(labels); + this.labels = Annotations.fromUser(labels); return this; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java index 83603cbd23..922ed441c8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java @@ -67,7 +67,7 @@ public Model apply(ModelInfo ModelInfo) { private final Long creationTime; private final Long lastModifiedTime; private final Long expirationTime; - private final Labels labels; + private final Annotations labels; private final String location; private final ImmutableList trainingRunList; private final ImmutableList featureColumnList; @@ -132,7 +132,7 @@ static class BuilderImpl extends Builder { private Long creationTime; private Long lastModifiedTime; private Long expirationTime; - private Labels labels = Labels.ZERO; + private Annotations labels = Annotations.ZERO; private String location; private List trainingRunList = Collections.emptyList(); private List labelColumnList = Collections.emptyList(); @@ -169,7 +169,7 @@ static class BuilderImpl extends Builder { this.creationTime = modelPb.getCreationTime(); this.lastModifiedTime = modelPb.getLastModifiedTime(); this.expirationTime = modelPb.getExpirationTime(); - this.labels = Labels.fromPb(modelPb.getLabels()); + this.labels = Annotations.fromPb(modelPb.getLabels()); this.location = modelPb.getLocation(); if (modelPb.getTrainingRuns() != null) { this.trainingRunList = modelPb.getTrainingRuns(); @@ -238,7 +238,7 @@ public Builder setModelId(ModelId modelId) { @Override public Builder setLabels(Map labels) { - this.labels = Labels.fromUser(labels); + this.labels = Annotations.fromUser(labels); return this; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java index fdf0bad668..56c6558555 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Table.java @@ -192,6 +192,12 @@ public Builder setLabels(Map labels) { return this; } + @Override + public Builder setResourceTags(Map resourceTags) { + infoBuilder.setResourceTags(resourceTags); + return this; + } + @Override public Builder setRequirePartitionFilter(Boolean requirePartitionFilter) { infoBuilder.setRequirePartitionFilter(requirePartitionFilter); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index c00ba84410..6e050d0649 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -77,7 +77,9 @@ public Table apply(TableInfo tableInfo) { private final BigInteger numRows; private final TableDefinition definition; private final EncryptionConfiguration encryptionConfiguration; - private final Labels labels; + private final Annotations labels; + + private final Annotations resourceTags; private final Boolean requirePartitionFilter; private final String defaultCollation; @@ -152,6 +154,9 @@ public abstract static class Builder { @BetaApi public abstract Builder setLabels(Map labels); + /** Sets the resource tags applied to this table. */ + public abstract Builder setResourceTags(Map resourceTags); + /** Creates a {@code TableInfo} object. */ public abstract TableInfo build(); @@ -191,7 +196,9 @@ static class BuilderImpl extends Builder { private BigInteger numRows; private TableDefinition definition; private EncryptionConfiguration encryptionConfiguration; - private Labels labels = Labels.ZERO; + private Annotations labels = Annotations.ZERO; + + private Annotations resourceTags = Annotations.ZERO; private Boolean requirePartitionFilter; private String defaultCollation; private CloneDefinition cloneDefinition; @@ -222,6 +229,7 @@ static class BuilderImpl extends Builder { this.definition = tableInfo.definition; this.encryptionConfiguration = tableInfo.encryptionConfiguration; this.labels = tableInfo.labels; + this.resourceTags = tableInfo.resourceTags; this.requirePartitionFilter = tableInfo.requirePartitionFilter; this.defaultCollation = tableInfo.defaultCollation; this.cloneDefinition = tableInfo.cloneDefinition; @@ -255,7 +263,8 @@ static class BuilderImpl extends Builder { this.encryptionConfiguration = new EncryptionConfiguration.Builder(tablePb.getEncryptionConfiguration()).build(); } - this.labels = Labels.fromPb(tablePb.getLabels()); + this.labels = Annotations.fromPb(tablePb.getLabels()); + this.resourceTags = Annotations.fromPb(tablePb.getResourceTags()); this.requirePartitionFilter = tablePb.getRequirePartitionFilter(); this.defaultCollation = tablePb.getDefaultCollation(); if (tablePb.getCloneDefinition() != null) { @@ -394,7 +403,13 @@ public Builder setEncryptionConfiguration(EncryptionConfiguration configuration) @Override public Builder setLabels(Map labels) { - this.labels = Labels.fromUser(labels); + this.labels = Annotations.fromUser(labels); + return this; + } + + @Override + public Builder setResourceTags(Map resourceTags) { + this.resourceTags = Annotations.fromUser(resourceTags); return this; } @@ -449,6 +464,7 @@ public TableInfo build() { this.definition = builder.definition; this.encryptionConfiguration = builder.encryptionConfiguration; this.labels = builder.labels; + this.resourceTags = builder.resourceTags; this.requirePartitionFilter = builder.requirePartitionFilter; this.defaultCollation = builder.defaultCollation; this.cloneDefinition = builder.cloneDefinition; @@ -610,6 +626,11 @@ public Map getLabels() { return labels.userMap(); } + /** Return a map for resource tags applied to the table. */ + public Map getResourceTags() { + return resourceTags.userMap(); + } + /** * Returns true if a partition filter (that can be used for partition elimination) is required for * queries over this table. @@ -660,6 +681,7 @@ public String toString() { .add("definition", definition) .add("encryptionConfiguration", encryptionConfiguration) .add("labels", labels) + .add("resourceTags", resourceTags) .add("requirePartitionFilter", requirePartitionFilter) .add("defaultCollation", defaultCollation) .add("cloneDefinition", cloneDefinition) @@ -724,6 +746,7 @@ Table toPb() { tablePb.setEncryptionConfiguration(encryptionConfiguration.toPb()); } tablePb.setLabels(labels.toPb()); + tablePb.setResourceTags(resourceTags.toPb()); tablePb.setRequirePartitionFilter(requirePartitionFilter); if (defaultCollation != null) { tablePb.setDefaultCollation(defaultCollation); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LabelsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java similarity index 62% rename from google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LabelsTest.java rename to google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java index 787dd77df7..aa3dd9fde4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LabelsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java @@ -25,50 +25,50 @@ import java.util.Map; import org.junit.Test; -public class LabelsTest { +public class AnnotationsTest { @Test public void testFromUser() { - assertThat(Labels.fromUser(null).userMap()).isNull(); + assertThat(Annotations.fromUser(null).userMap()).isNull(); HashMap user = new HashMap<>(); - assertThat(Labels.fromUser(user).userMap()).isEmpty(); + assertThat(Annotations.fromUser(user).userMap()).isEmpty(); user.put("a", "b"); - Labels labels = Labels.fromUser(user); - assertThat(labels.userMap()).containsExactly("a", "b"); + Annotations annotations = Annotations.fromUser(user); + assertThat(annotations.userMap()).containsExactly("a", "b"); - // Changing map afterwards does not change the labels. + // Changing map afterwards does not change the annotation. user.put("c", "d"); - assertThat(labels.userMap()).containsExactly("a", "b"); + assertThat(annotations.userMap()).containsExactly("a", "b"); } @Test public void testFromToPb() { - assertThat(Labels.fromPb(null).toPb()).isNull(); + assertThat(Annotations.fromPb(null).toPb()).isNull(); HashMap pb = new HashMap<>(); - assertThat(Labels.fromPb(pb).toPb()).isNull(); + assertThat(Annotations.fromPb(pb).toPb()).isNull(); pb.put("a", "b"); - assertThat(Labels.fromPb(pb).toPb()).isEqualTo(pb); + assertThat(Annotations.fromPb(pb).toPb()).isEqualTo(pb); pb.put("c", Data.NULL_STRING); - assertThat(Labels.fromPb(pb).toPb()).isEqualTo(pb); + assertThat(Annotations.fromPb(pb).toPb()).isEqualTo(pb); Map jsonNullMap = Data.nullOf(HashMap.class); - assertThat(Data.isNull(Labels.fromPb(jsonNullMap).toPb())).isTrue(); + assertThat(Data.isNull(Annotations.fromPb(jsonNullMap).toPb())).isTrue(); } @Test public void testNullKey() { try { - Labels.fromUser(Collections.singletonMap((String) null, "foo")); + Annotations.fromUser(Collections.singletonMap((String) null, "foo")); fail("null key shouldn't work"); } catch (IllegalArgumentException e) { } try { - Labels.fromPb(Collections.singletonMap((String) null, "foo")); + Annotations.fromPb(Collections.singletonMap((String) null, "foo")); fail("null key shouldn't work"); } catch (IllegalArgumentException e) { } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java index 6283f71c21..a4ce6fbb47 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java @@ -126,6 +126,7 @@ public class TableInfoTest { .setNumRows(BigInteger.valueOf(NUM_ROWS)) .setSelfLink(SELF_LINK) .setLabels(Collections.singletonMap("a", "b")) + .setResourceTags(Collections.singletonMap("resourceTagA", "resourceTagB")) .setRequirePartitionFilter(REQUIRE_PARTITION_FILTER) .build(); private static final TableInfo VIEW_INFO = @@ -309,6 +310,7 @@ private void compareTableInfo(TableInfo expected, TableInfo value) { assertEquals(expected.getNumRows(), value.getNumRows()); assertEquals(expected.getSelfLink(), value.getSelfLink()); assertEquals(expected.getLabels(), value.getLabels()); + assertEquals(expected.getResourceTags(), value.getResourceTags()); assertEquals(expected.getRequirePartitionFilter(), value.getRequirePartitionFilter()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.hashCode(), value.hashCode()); From 0fbdfba1aecf18567fae95aea133b6504f050bd5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 Jan 2024 17:15:41 +0100 Subject: [PATCH 1518/2268] deps: update github/codeql-action action to v2.23.0 (#3061) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c7f7f64aaa..8694cee273 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@03e7845b7bfcd5e7fb63d1ae8c61b0e791134fab # v2.22.11 + uses: github/codeql-action/upload-sarif@8b7fcbfac2aae0e6c24d9f9ebd5830b1290b18e4 # v2.23.0 with: sarif_file: results.sarif From 48cdaa8a77935062cfe9ed8fb66f52f774bdd673 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 Jan 2024 17:22:09 +0100 Subject: [PATCH 1519/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.35.0 (#3066) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f7c83573fe..55d055a2cc 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.34.0 + 2.35.0 test From 6ff4f043905a6fe67bc3ed5cbbacc0f9eddd3172 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 Jan 2024 17:22:59 +0100 Subject: [PATCH 1520/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.39.0 (#3067) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 55d055a2cc..e519c5d51c 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.36.0 + 1.39.0 pom import From d4a4b064656f397d0fd7e23420c79956d5a9f0b0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 Jan 2024 17:42:22 +0100 Subject: [PATCH 1521/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.35.0 (#3065) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e519c5d51c..490c8ef4ab 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.34.0 + 2.35.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 99e3a85400..d4d2d367e5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.34.0 + 2.35.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a38c313c7f..878543a0ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.34.0 + 2.35.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3debd229ed..c96c555e83 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.34.0 + 2.35.0 test From 76987c46c0fa7fa0b23f1b7fd25eec5433088ab3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 16 Jan 2024 17:43:38 +0100 Subject: [PATCH 1522/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.5 (#3062) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 95de88cf6e..982a48a3bc 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.3 + 3.2.5 **/*IT From c42fb60445cdc30b8d0ece8e2d367e8b01debdcd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:35:21 -0500 Subject: [PATCH 1523/2268] chore(main): release 2.36.1-SNAPSHOT (#3068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.36.1-SNAPSHOT * chore(main): release 2.36.1-SNAPSHOT * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- README.md | 6 +++--- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0a5c250aec..2ada83ad83 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.35.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.36.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.35.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.36.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.35.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.36.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4041a1b706..cb406b27bc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.36.0 + 2.36.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d7e1519367..b88b36b01e 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.36.0 + 2.36.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.36.0 + 2.36.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 490c8ef4ab..6299443562 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.36.0 + 2.36.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.36.0 + 2.36.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 878543a0ab..795e5765e7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.36.0 + 2.36.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index e2ab490a51..207aed9509 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.36.0:2.36.0 \ No newline at end of file +google-cloud-bigquery:2.36.0:2.36.1-SNAPSHOT \ No newline at end of file From eb94d565571339409821c72777339e31148c089f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 17:29:12 +0100 Subject: [PATCH 1524/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.36.0 (#3070) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.36.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ada83ad83..310b8c5ded 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.35.0 + 2.36.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d4d2d367e5..d2eb11c492 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.35.0 + 2.36.0 From f371d6709109acf07224ee0b2615de400fd90838 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 17:33:57 +0100 Subject: [PATCH 1525/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240105-2.0.0 (#3073) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240105-2.0.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6299443562..b9dd8358a6 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20231111-2.0.0 + v2-rev20240105-2.0.0 3.21.0 14.0.2 From c23493ef0f24e1db66880d7b243132eae4d3c3d5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 17:36:57 +0100 Subject: [PATCH 1526/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.31.0 (#3074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.31.0 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d2eb11c492..34eb32784b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.30.0 + 2.31.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 795e5765e7..4ed56f6316 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.30.0 + 2.31.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c96c555e83..9932d7bac7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.30.0 + 2.31.0 test From e3f417cec3bdd81040baac3f054d0270dde9d9f8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 17:37:44 +0100 Subject: [PATCH 1527/2268] deps: update github/codeql-action action to v2.23.1 (#3077) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.23.1 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8694cee273..58e6328e56 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@8b7fcbfac2aae0e6c24d9f9ebd5830b1290b18e4 # v2.23.0 + uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 with: sarif_file: results.sarif diff --git a/README.md b/README.md index 310b8c5ded..9614c18ddf 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.29.0') +implementation platform('com.google.cloud:libraries-bom:26.30.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From 3fbb2bba7ad7bca245a8ca5eb59d999aead29ebd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:10:13 +0100 Subject: [PATCH 1528/2268] deps: update actions/upload-artifact action to v4.1.0 (#3071) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/upload-artifact action to v4.1.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 58e6328e56..f87be2a0b6 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 with: name: SARIF file path: results.sarif From f03c4fc957ae5665fe0f98c0f06cc80eea7cec59 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:12:32 +0100 Subject: [PATCH 1529/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.35.0 (#3079) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.35.0 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 34eb32784b..f160d55987 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.1 + 1.35.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4ed56f6316..0391bb7211 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.1 + 1.35.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9932d7bac7..fa0264d1e7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.34.1 + 1.35.0 From a5b119cdf6f8ce9d180a2d51a3a7a9aad50b1ea4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:13:21 +0100 Subject: [PATCH 1530/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 (#3080) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9dd8358a6..bef057fa49 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20240105-2.0.0 - 3.21.0 + 3.22.0 14.0.2 From af81354c342cdb2a790cb008fc9fe3460e62265b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:25:33 +0100 Subject: [PATCH 1531/2268] deps: update actions/upload-artifact action to v4.2.0 (#3081) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f87be2a0b6..967aa1144e 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: SARIF file path: results.sarif From 2614df203b1f3c9800b8c8c23d32e7f22ec76253 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 16:30:46 +0100 Subject: [PATCH 1532/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.35.0 (#3078) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f160d55987..19b9250376 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.1 + 1.35.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0391bb7211..7058520bcc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.1 + 1.35.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index fa0264d1e7..c29824dc21 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.34.1 + 1.35.0 com.google.oauth-client From 62c54c547df1fac081b02a5eb8e9829df9708345 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:51:09 -0500 Subject: [PATCH 1533/2268] chore: Create renovate_config_check.yaml (#1920) (#3085) * chore: Create renovate_config_check.yaml Source-Link: https://github.com/googleapis/synthtool/commit/6612ab8f3afcd5e292aecd647f0fa68812c9f5b5 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 6 +-- .github/workflows/renovate_config_check.yaml | 25 ++++++++++ .kokoro/requirements.txt | 48 ++++++++++---------- 3 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/renovate_config_check.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bff46cd669..dc05a72762 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:11d59eabd49dc088f8339fb96e9da79ba4b3a73b3d49a8a4e0263e91edd053ba -# created: 2023-12-05T18:46:43.811070085Z \ No newline at end of file + digest: sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc +# created: 2024-01-22T14:14:20.913785597Z diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml new file mode 100644 index 0000000000..87d8eb2be8 --- /dev/null +++ b/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + renovate_bot_config_validation: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 6a36ccab46..445c5c1f09 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -170,30 +170,30 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==41.0.3 \ - --hash=sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306 \ - --hash=sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84 \ - --hash=sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47 \ - --hash=sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d \ - --hash=sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116 \ - --hash=sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207 \ - --hash=sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81 \ - --hash=sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087 \ - --hash=sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd \ - --hash=sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507 \ - --hash=sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858 \ - --hash=sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae \ - --hash=sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34 \ - --hash=sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906 \ - --hash=sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd \ - --hash=sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922 \ - --hash=sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7 \ - --hash=sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4 \ - --hash=sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574 \ - --hash=sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1 \ - --hash=sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c \ - --hash=sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e \ - --hash=sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de +cryptography==41.0.6 \ + --hash=sha256:068bc551698c234742c40049e46840843f3d98ad7ce265fd2bd4ec0d11306596 \ + --hash=sha256:0f27acb55a4e77b9be8d550d762b0513ef3fc658cd3eb15110ebbcbd626db12c \ + --hash=sha256:2132d5865eea673fe6712c2ed5fb4fa49dba10768bb4cc798345748380ee3660 \ + --hash=sha256:3288acccef021e3c3c10d58933f44e8602cf04dba96d9796d70d537bb2f4bbc4 \ + --hash=sha256:35f3f288e83c3f6f10752467c48919a7a94b7d88cc00b0668372a0d2ad4f8ead \ + --hash=sha256:398ae1fc711b5eb78e977daa3cbf47cec20f2c08c5da129b7a296055fbb22aed \ + --hash=sha256:422e3e31d63743855e43e5a6fcc8b4acab860f560f9321b0ee6269cc7ed70cc3 \ + --hash=sha256:48783b7e2bef51224020efb61b42704207dde583d7e371ef8fc2a5fb6c0aabc7 \ + --hash=sha256:4d03186af98b1c01a4eda396b137f29e4e3fb0173e30f885e27acec8823c1b09 \ + --hash=sha256:5daeb18e7886a358064a68dbcaf441c036cbdb7da52ae744e7b9207b04d3908c \ + --hash=sha256:60e746b11b937911dc70d164060d28d273e31853bb359e2b2033c9e93e6f3c43 \ + --hash=sha256:742ae5e9a2310e9dade7932f9576606836ed174da3c7d26bc3d3ab4bd49b9f65 \ + --hash=sha256:7e00fb556bda398b99b0da289ce7053639d33b572847181d6483ad89835115f6 \ + --hash=sha256:85abd057699b98fce40b41737afb234fef05c67e116f6f3650782c10862c43da \ + --hash=sha256:8efb2af8d4ba9dbc9c9dd8f04d19a7abb5b49eab1f3694e7b5a16a5fc2856f5c \ + --hash=sha256:ae236bb8760c1e55b7a39b6d4d32d2279bc6c7c8500b7d5a13b6fb9fc97be35b \ + --hash=sha256:afda76d84b053923c27ede5edc1ed7d53e3c9f475ebaf63c68e69f1403c405a8 \ + --hash=sha256:b27a7fd4229abef715e064269d98a7e2909ebf92eb6912a9603c7e14c181928c \ + --hash=sha256:b648fe2a45e426aaee684ddca2632f62ec4613ef362f4d681a9a6283d10e079d \ + --hash=sha256:c5a550dc7a3b50b116323e3d376241829fd326ac47bc195e04eb33a8170902a9 \ + --hash=sha256:da46e2b5df770070412c46f87bac0849b8d685c5f2679771de277a422c7d0b86 \ + --hash=sha256:f39812f70fc5c71a15aa3c97b2bbe213c3f2a460b79bd21c40d033bb34a9bf36 \ + --hash=sha256:ff369dd19e8fe0528b02e8df9f2aeb2479f89b1270d90f96a63500afe9af5cae # via # gcp-releasetool # secretstorage From 1e152e6d206e0ae2b0e73546302f336d3c7d9302 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 Jan 2024 20:52:06 +0100 Subject: [PATCH 1534/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3 (#3072) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bef057fa49..086c408861 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 2.47.0 + 3.0.0 pom import From 33df25cb22374e44dbd75a31156b7c96ee38f349 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 Jan 2024 21:08:49 +0100 Subject: [PATCH 1535/2268] test(deps): update dependency com.google.truth:truth to v1.3.0 (#3083) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 086c408861..b2981acc1f 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 19b9250376..fbb8f4040e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 982a48a3bc..df62de7dc2 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7058520bcc..c97d24d46f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c29824dc21..c94079f594 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.2.0 + 1.3.0 test From 4d4cbae00028f84c071f51e88d7ee976efdf04d5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 Jan 2024 21:29:08 +0100 Subject: [PATCH 1536/2268] deps: update arrow.version to v15 (#3084) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2981acc1f..f6b97fe531 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ google-cloud-bigquery-parent v2-rev20240105-2.0.0 3.22.0 - 14.0.2 + 15.0.0 From eb773b91d03d944d9feab1ac46146234c173c15f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 Jan 2024 21:47:54 +0100 Subject: [PATCH 1537/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.32.0 (#3089) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f6b97fe531..84eb864074 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.31.0 + 2.32.0 test From b2814a2f8e6601347d0489058e563878af40f301 Mon Sep 17 00:00:00 2001 From: PhongChuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:19:09 -0500 Subject: [PATCH 1538/2268] Feat: Add universe domain (#3090) * Universe domain feat * Feat: Add universe domain feat * Feat: Add universe domain feat * Feat: Add universe domain feat --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 45 +++++- .../cloud/bigquery/it/ITBigQueryTest.java | 134 ++++++++++++++++++ 2 files changed, 177 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 96a10deb33..841a790ee6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -105,7 +105,7 @@ public HttpBigQueryRpc(BigQueryOptions options) { this.options = options; bigquery = new Bigquery.Builder(transport, new GsonFactory(), initializer) - .setRootUrl(options.getHost()) + .setRootUrl(options.getResolvedApiaryHost("bigquery")) .setApplicationName(options.getApplicationName()) .build(); } @@ -114,9 +114,16 @@ private static BigQueryException translate(IOException exception) { return new BigQueryException(exception); } + private void validateRPC() throws BigQueryException, IOException { + if (!this.options.hasValidUniverseDomain()) { + throw new BigQueryException(BigQueryException.UNKNOWN_CODE, "Invalid universe domain"); + } + } + @Override public Dataset getDataset(String projectId, String datasetId, Map options) { try { + validateRPC(); return bigquery .datasets() .get(projectId, datasetId) @@ -135,6 +142,7 @@ public Dataset getDataset(String projectId, String datasetId, Map opt @Override public Tuple> listDatasets(String projectId, Map options) { try { + validateRPC(); DatasetList datasetsList = bigquery .datasets() @@ -159,6 +167,7 @@ public Tuple> listDatasets(String projectId, Map options) { try { + validateRPC(); return bigquery .datasets() .insert(dataset.getDatasetReference().getProjectId(), dataset) @@ -173,6 +182,7 @@ public Dataset create(Dataset dataset, Map options) { @Override public Table create(Table table, Map options) { try { + validateRPC(); // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); @@ -190,6 +200,7 @@ public Table create(Table table, Map options) { @Override public Routine create(Routine routine, Map options) { try { + validateRPC(); RoutineReference reference = routine.getRoutineReference(); return bigquery .routines() @@ -205,6 +216,7 @@ public Routine create(Routine routine, Map options) { @Override public Job create(Job job, Map options) { try { + validateRPC(); String projectId = job.getJobReference() != null ? job.getJobReference().getProjectId() @@ -223,6 +235,7 @@ public Job create(Job job, Map options) { @Override public Job createJobForQuery(Job job) { try { + validateRPC(); String projectId = job.getJobReference() != null ? job.getJobReference().getProjectId() @@ -236,6 +249,7 @@ public Job createJobForQuery(Job job) { @Override public boolean deleteDataset(String projectId, String datasetId, Map options) { try { + validateRPC(); bigquery .datasets() .delete(projectId, datasetId) @@ -255,6 +269,7 @@ public boolean deleteDataset(String projectId, String datasetId, Map @Override public Dataset patch(Dataset dataset, Map options) { try { + validateRPC(); DatasetReference reference = dataset.getDatasetReference(); return bigquery .datasets() @@ -270,6 +285,7 @@ public Dataset patch(Dataset dataset, Map options) { @Override public Table patch(Table table, Map options) { try { + validateRPC(); // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); @@ -289,6 +305,7 @@ public Table patch(Table table, Map options) { public Table getTable( String projectId, String datasetId, String tableId, Map options) { try { + validateRPC(); return bigquery .tables() .get(projectId, datasetId, tableId) @@ -316,6 +333,7 @@ private String getTableMetadataOption(Map options) { public Tuple> listTables( String projectId, String datasetId, Map options) { try { + validateRPC(); TableList tableList = bigquery .tables() @@ -351,6 +369,7 @@ public Table apply(TableList.Tables tablePb) { @Override public boolean deleteTable(String projectId, String datasetId, String tableId) { try { + validateRPC(); bigquery.tables().delete(projectId, datasetId, tableId).execute(); return true; } catch (IOException ex) { @@ -365,6 +384,7 @@ public boolean deleteTable(String projectId, String datasetId, String tableId) { @Override public Model patch(Model model, Map options) { try { + validateRPC(); // unset the type, as it is output only ModelReference reference = model.getModelReference(); return bigquery @@ -382,6 +402,7 @@ public Model patch(Model model, Map options) { public Model getModel( String projectId, String datasetId, String modelId, Map options) { try { + validateRPC(); return bigquery .models() .get(projectId, datasetId, modelId) @@ -401,6 +422,7 @@ public Model getModel( public Tuple> listModels( String projectId, String datasetId, Map options) { try { + validateRPC(); ListModelsResponse modelList = bigquery .models() @@ -420,6 +442,7 @@ public Tuple> listModels( @Override public boolean deleteModel(String projectId, String datasetId, String modelId) { try { + validateRPC(); bigquery.models().delete(projectId, datasetId, modelId).execute(); return true; } catch (IOException ex) { @@ -434,6 +457,7 @@ public boolean deleteModel(String projectId, String datasetId, String modelId) { @Override public Routine update(Routine routine, Map options) { try { + validateRPC(); RoutineReference reference = routine.getRoutineReference(); return bigquery .routines() @@ -451,6 +475,7 @@ public Routine update(Routine routine, Map options) { public Routine getRoutine( String projectId, String datasetId, String routineId, Map options) { try { + validateRPC(); return bigquery .routines() .get(projectId, datasetId, routineId) @@ -470,6 +495,7 @@ public Routine getRoutine( public Tuple> listRoutines( String projectId, String datasetId, Map options) { try { + validateRPC(); ListRoutinesResponse routineList = bigquery .routines() @@ -491,6 +517,7 @@ public Tuple> listRoutines( @Override public boolean deleteRoutine(String projectId, String datasetId, String routineId) { try { + validateRPC(); bigquery.routines().delete(projectId, datasetId, routineId).execute(); return true; } catch (IOException ex) { @@ -506,6 +533,7 @@ public boolean deleteRoutine(String projectId, String datasetId, String routineI public TableDataInsertAllResponse insertAll( String projectId, String datasetId, String tableId, TableDataInsertAllRequest request) { try { + validateRPC(); return bigquery .tabledata() .insertAll(projectId, datasetId, tableId, request) @@ -520,6 +548,7 @@ public TableDataInsertAllResponse insertAll( public TableDataList listTableData( String projectId, String datasetId, String tableId, Map options) { try { + validateRPC(); return bigquery .tabledata() .list(projectId, datasetId, tableId) @@ -544,6 +573,7 @@ public TableDataList listTableDataWithRowLimit( Integer maxResultPerPage, String pageToken) { try { + validateRPC(); return bigquery .tabledata() .list(projectId, datasetId, tableId) @@ -559,6 +589,7 @@ public TableDataList listTableDataWithRowLimit( @Override public Job getJob(String projectId, String jobId, String location, Map options) { try { + validateRPC(); return bigquery .jobs() .get(projectId, jobId) @@ -578,6 +609,7 @@ public Job getJob(String projectId, String jobId, String location, Map> listJobs(String projectId, Map options) { try { + validateRPC(); Bigquery.Jobs.List request = bigquery .jobs() @@ -650,6 +683,7 @@ public Job apply(JobList.Jobs jobPb) { @Override public boolean cancel(String projectId, String jobId, String location) { try { + validateRPC(); bigquery .jobs() .cancel(projectId, jobId) @@ -669,6 +703,7 @@ public boolean cancel(String projectId, String jobId, String location) { @Override public boolean deleteJob(String projectId, String jobName, String location) { try { + validateRPC(); bigquery .jobs() .delete(projectId, jobName) @@ -685,6 +720,7 @@ public boolean deleteJob(String projectId, String jobName, String location) { public GetQueryResultsResponse getQueryResults( String projectId, String jobId, String location, Map options) { try { + validateRPC(); return bigquery .jobs() .getQueryResults(projectId, jobId) @@ -707,6 +743,7 @@ public GetQueryResultsResponse getQueryResults( public GetQueryResultsResponse getQueryResultsWithRowLimit( String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) { try { + validateRPC(); return bigquery .jobs() .getQueryResults(projectId, jobId) @@ -723,6 +760,7 @@ public GetQueryResultsResponse getQueryResultsWithRowLimit( @Override public QueryResponse queryRpc(String projectId, QueryRequest content) { try { + validateRPC(); return bigquery.jobs().query(projectId, content).execute(); } catch (IOException ex) { throw translate(ex); @@ -732,7 +770,7 @@ public QueryResponse queryRpc(String projectId, QueryRequest content) { @Override public String open(Job loadJob) { try { - String builder = options.getHost(); + String builder = options.getResolvedApiaryHost("bigquery"); if (!builder.endsWith("/")) { builder += "/"; } @@ -807,6 +845,7 @@ public Job write( @Override public Policy getIamPolicy(String resourceId, Map options) { try { + validateRPC(); GetIamPolicyRequest policyRequest = new GetIamPolicyRequest(); if (null != Option.REQUESTED_POLICY_VERSION.getLong(options)) { policyRequest = @@ -828,6 +867,7 @@ public Policy getIamPolicy(String resourceId, Map options) { @Override public Policy setIamPolicy(String resourceId, Policy policy, Map options) { try { + validateRPC(); SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy); return bigquery .tables() @@ -843,6 +883,7 @@ public Policy setIamPolicy(String resourceId, Policy policy, Map opti public TestIamPermissionsResponse testIamPermissions( String resourceId, List permissions, Map options) { try { + validateRPC(); TestIamPermissionsRequest permissionsRequest = new TestIamPermissionsRequest().setPermissions(permissions); return bigquery diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index d8d673360d..ba30ea0d43 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -54,6 +54,7 @@ import com.google.cloud.bigquery.BigQueryDryRunResult; import com.google.cloud.bigquery.BigQueryError; import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.BigQueryResult; import com.google.cloud.bigquery.BigQuerySQLException; import com.google.cloud.bigquery.CloneDefinition; @@ -149,6 +150,7 @@ import com.google.common.io.BaseEncoding; import com.google.common.util.concurrent.ListenableFuture; import com.google.gson.JsonObject; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -773,6 +775,65 @@ public class ITBigQueryTest { private static final String PUBLIC_PROJECT = "bigquery-public-data"; private static final String PUBLIC_DATASET = "census_bureau_international"; + private static final String FAKE_JSON_CRED_WITH_GOOGLE_DOMAIN = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"project_id\": \"someprojectid\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"universe_domain\": \"googleapis.com\"\n" + + "}"; + private static final String FAKE_JSON_CRED_WITH_INVALID_DOMAIN = + "{\n" + + " \"private_key_id\": \"somekeyid\",\n" + + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" + + "kAgEAAoIBAQC+K2hSuFpAdrJI\\nnCgcDz2M7t7bjdlsadsasad+fvRSW6TjNQZ3p5LLQY1kSZRqBqylRkzteMOyHg" + + "aR\\n0Pmxh3ILCND5men43j3h4eDbrhQBuxfEMalkG92sL+PNQSETY2tnvXryOvmBRwa/\\nQP/9dJfIkIDJ9Fw9N4" + + "Bhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nknddadwkwewcVxHFhcZJO+XWf6ofLUXpRwiTZakGMn8EE1uVa2" + + "LgczOjwWHGi99MFjxSer5m9\\n1tCa3/KEGKiS/YL71JvjwX3mb+cewlkcmweBKZHM2JPTk0ZednFSpVZMtycjkbLa" + + "\\ndYOS8V85AgMBewECggEBAKksaldajfDZDV6nGqbFjMiizAKJolr/M3OQw16K6o3/\\n0S31xIe3sSlgW0+UbYlF" + + "4U8KifhManD1apVSC3csafaspP4RZUHFhtBywLO9pR5c\\nr6S5aLp+gPWFyIp1pfXbWGvc5VY/v9x7ya1VEa6rXvL" + + "sKupSeWAW4tMj3eo/64ge\\nsdaceaLYw52KeBYiT6+vpsnYrEkAHO1fF/LavbLLOFJmFTMxmsNaG0tuiJHgjshB\\" + + "n82DpMCbXG9YcCgI/DbzuIjsdj2JC1cascSP//3PmefWysucBQe7Jryb6NQtASmnv\\nCdDw/0jmZTEjpe4S1lxfHp" + + "lAhHFtdgYTvyYtaLZiVVkCgYEA8eVpof2rceecw/I6\\n5ng1q3Hl2usdWV/4mZMvR0fOemacLLfocX6IYxT1zA1FF" + + "JlbXSRsJMf/Qq39mOR2\\nSpW+hr4jCoHeRVYLgsbggtrevGmILAlNoqCMpGZ6vDmJpq6ECV9olliDvpPgWOP+\\nm" + + "YPDreFBGxWvQrADNbRt2dmGsrsCgYEAyUHqB2wvJHFqdmeBsaacewzV8x9WgmeX\\ngUIi9REwXlGDW0Mz50dxpxcK" + + "CAYn65+7TCnY5O/jmL0VRxU1J2mSWyWTo1C+17L0\\n3fUqjxL1pkefwecxwecvC+gFFYdJ4CQ/MHHXU81Lwl1iWdF" + + "Cd2UoGddYaOF+KNeM\\nHC7cmqra+JsCgYEAlUNywzq8nUg7282E+uICfCB0LfwejuymR93CtsFgb7cRd6ak\\nECR" + + "8FGfCpH8ruWJINllbQfcHVCX47ndLZwqv3oVFKh6pAS/vVI4dpOepP8++7y1u\\ncoOvtreXCX6XqfrWDtKIvv0vjl" + + "HBhhhp6mCcRpdQjV38H7JsyJ7lih/oNjECgYAt\\nkndj5uNl5SiuVxHFhcZJO+XWf6ofLUregtevZakGMn8EE1uVa" + + "2AY7eafmoU/nZPT\\n00YB0TBATdCbn/nBSuKDESkhSg9s2GEKQZG5hBmL5uCMfo09z3SfxZIhJdlerreP\\nJ7gSi" + + "dI12N+EZxYd4xIJh/HFDgp7RRO87f+WJkofMQKBgGTnClK1VMaCRbJZPriw\\nEfeFCoOX75MxKwXs6xgrw4W//AYG" + + "GUjDt83lD6AZP6tws7gJ2IwY/qP7+lyhjEqN\\nHtfPZRGFkGZsdaksdlaksd323423d+15/UvrlRSFPNj1tWQmNKk" + + "XyRDW4IG1Oa2p\\nrALStNBx5Y9t0/LQnFI4w3aG\\n-----END PRIVATE KEY-----\\n\",\n" + + " \"project_id\": \"someprojectid\",\n" + + " \"client_email\": \"someclientid@developer.gserviceaccount.com\",\n" + + " \"client_id\": \"someclientid.apps.googleusercontent.com\",\n" + + " \"type\": \"service_account\",\n" + + " \"universe_domain\": \"fake.domain\"\n" + + "}"; + private static BigQuery bigquery; private static Storage storage; @@ -6323,4 +6384,77 @@ public void testStatelessQueriesWithLocation() throws Exception { bigQuery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); } } + + @Test + public void testUniverseDomainWithInvalidUniverseDomain() { + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQueryOptions bigQueryOptions = + bigqueryHelper + .getOptions() + .toBuilder() + .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_GOOGLE_DOMAIN)) + .setUniverseDomain("invalid.domain") + .build(); + BigQuery bigQuery = bigQueryOptions.getService(); + + try { + // Use list dataset to send RPC to invalid domain. + bigQuery.listDatasets("bigquery-public-data"); + fail("RPCs to invalid universe domain should fail"); + } catch (BigQueryException e) { + assertNotNull(e.getMessage()); + assertThat((e.getMessage().contains("Invalid universe domain"))).isTrue(); + } + } + + @Test + public void testInvalidUniverseDomainWithMismatchCredentials() { + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQueryOptions bigQueryOptions = + bigqueryHelper + .getOptions() + .toBuilder() + .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_INVALID_DOMAIN)) + .build(); + BigQuery bigQuery = bigQueryOptions.getService(); + + try { + // Use list dataset to send RPC to invalid domain. + bigQuery.listDatasets("bigquery-public-data"); + fail("RPCs to invalid universe domain should fail"); + } catch (BigQueryException e) { + assertNotNull(e.getMessage()); + assertThat((e.getMessage().contains("Invalid universe domain"))).isTrue(); + } + } + + @Test + public void testUniverseDomainWithMatchingDomain() { + // Test a valid domain using the default credentials and Google default universe domain. + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQueryOptions bigQueryOptions = + bigqueryHelper.getOptions().toBuilder().setUniverseDomain("googleapis.com").build(); + BigQuery bigQuery = bigQueryOptions.getService(); + + // Verify that all is well by listing a dataset. + Page datasets = bigQuery.listDatasets("bigquery-public-data"); + Iterator iterator = datasets.iterateAll().iterator(); + Set datasetNames = new HashSet<>(); + while (iterator.hasNext()) { + datasetNames.add(iterator.next().getDatasetId().getDataset()); + } + for (String type : PUBLIC_DATASETS) { + assertTrue(datasetNames.contains(type)); + } + } + + static GoogleCredentials loadCredentials(String credentialFile) { + try { + InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); + return GoogleCredentials.fromStream(keyStream); + } catch (IOException e) { + fail("Couldn't create fake JSON credentials."); + } + return null; + } } From f4411b09c4b681d2f3fb250ef133b291649f2865 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Jan 2024 19:12:59 +0100 Subject: [PATCH 1539/2268] deps: update actions/upload-artifact action to v4.3.0 (#3091) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 967aa1144e..6584155eee 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: SARIF file path: results.sarif From a77b6eb7cb2b51f29303bbb8b3823881d291647b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Jan 2024 19:14:02 +0100 Subject: [PATCH 1540/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.36.0 (#3092) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 84eb864074..5d2a7baa95 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.35.0 + 2.36.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fbb8f4040e..de976d88ab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.35.0 + 2.36.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c97d24d46f..f9d680f4a0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.35.0 + 2.36.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c94079f594..732a9b53dd 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.35.0 + 2.36.0 test From 110bcc506272b372fdd90ee718fad298c8ab7e19 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Jan 2024 19:15:30 +0100 Subject: [PATCH 1541/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.40.0 (#3094) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d2a7baa95..d05faa0846 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.39.0 + 1.40.0 pom import From 24456a361a39550e962ac68a79de3c7a9e912884 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Jan 2024 20:27:27 +0100 Subject: [PATCH 1542/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.36.0 (#3093) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d05faa0846..5630ca332f 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.35.0 + 2.36.0 test From 0933b34f30ade216dcf61767a771509ca07f294b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Jan 2024 23:48:17 +0100 Subject: [PATCH 1543/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 (#3096) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5630ca332f..f9555dadfc 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20240105-2.0.0 - 3.22.0 + 3.23.0 15.0.0 From f4c3d3999e7d2e9b48374dbf28c10fe5f7b6dd18 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 25 Jan 2024 17:53:02 +0100 Subject: [PATCH 1544/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.32.1 (#3097) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f9555dadfc..8f3364ee30 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.32.0 + 2.32.1 test From bf74f073cf03ea3911f2cef650337a4f206de7f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 25 Jan 2024 22:04:18 +0100 Subject: [PATCH 1545/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.0.1 (#3098) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `3.0.0` -> `3.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.0.0/3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.0.0/3.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage (com.google.cloud:google-cloud-bigquerystorage-bom) ### [`v3.0.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#301-2024-01-25) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v3.0.0...v3.0.1) ##### Bug Fixes - **deps:** Update the Java code generator (gapic-generator-java) to 2.32.0 ([#​2363](https://togithub.com/googleapis/java-bigquerystorage/issues/2363)) ([542b946](https://togithub.com/googleapis/java-bigquerystorage/commit/542b94606de6790f54ebeb546dc84f30faeb58b2)) ##### Dependencies - Update arrow.version to v15 ([#​2372](https://togithub.com/googleapis/java-bigquerystorage/issues/2372)) ([4b59eec](https://togithub.com/googleapis/java-bigquerystorage/commit/4b59eec20da86195ab5051e585bfe20d149af863)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.36.0 ([#​2364](https://togithub.com/googleapis/java-bigquerystorage/issues/2364)) ([26f3429](https://togithub.com/googleapis/java-bigquerystorage/commit/26f342990fee9c12cb1ee3d016a6d2f434d7b85d)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#​2370](https://togithub.com/googleapis/java-bigquerystorage/issues/2370)) ([adcc49e](https://togithub.com/googleapis/java-bigquerystorage/commit/adcc49e96a445c4dd2c68be7c82a1d750579d0d3)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 ([#​2378](https://togithub.com/googleapis/java-bigquerystorage/issues/2378)) ([2d8245f](https://togithub.com/googleapis/java-bigquerystorage/commit/2d8245fbf1143308410ea2a86ca98b0289a04c29)) - Update dependency com.google.truth:truth to v1.3.0 ([#​2371](https://togithub.com/googleapis/java-bigquerystorage/issues/2371)) ([8b39e8a](https://togithub.com/googleapis/java-bigquerystorage/commit/8b39e8af6a88312b39e1283a52bcd52c119c5f30))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8f3364ee30..43bc4cdd2f 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.0.0 + 3.0.1 pom import From 8dbf92a662a3f0b0e00cbefe0b67b23a7dd4744d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 22:46:15 +0000 Subject: [PATCH 1546/2268] chore(main): release 2.37.0 (#3076) :robot: I have created a release *beep* *boop* --- ## [2.37.0](https://togithub.com/googleapis/java-bigquery/compare/v2.36.0...v2.37.0) (2024-01-25) ### Features * Add support for Table resource tags ([#3046](https://togithub.com/googleapis/java-bigquery/issues/3046)) ([7d61111](https://togithub.com/googleapis/java-bigquery/commit/7d61111d23282c7e2478ac31ba0d4e423330ec92)) * Add universe domain ([#3090](https://togithub.com/googleapis/java-bigquery/issues/3090)) ([b2814a2](https://togithub.com/googleapis/java-bigquery/commit/b2814a2f8e6601347d0489058e563878af40f301)) ### Dependencies * Update actions/upload-artifact action to v4.1.0 ([#3071](https://togithub.com/googleapis/java-bigquery/issues/3071)) ([3fbb2bb](https://togithub.com/googleapis/java-bigquery/commit/3fbb2bba7ad7bca245a8ca5eb59d999aead29ebd)) * Update actions/upload-artifact action to v4.2.0 ([#3081](https://togithub.com/googleapis/java-bigquery/issues/3081)) ([af81354](https://togithub.com/googleapis/java-bigquery/commit/af81354c342cdb2a790cb008fc9fe3460e62265b)) * Update actions/upload-artifact action to v4.3.0 ([#3091](https://togithub.com/googleapis/java-bigquery/issues/3091)) ([f4411b0](https://togithub.com/googleapis/java-bigquery/commit/f4411b09c4b681d2f3fb250ef133b291649f2865)) * Update arrow.version to v15 ([#3084](https://togithub.com/googleapis/java-bigquery/issues/3084)) ([4d4cbae](https://togithub.com/googleapis/java-bigquery/commit/4d4cbae00028f84c071f51e88d7ee976efdf04d5)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.35.0 ([#3066](https://togithub.com/googleapis/java-bigquery/issues/3066)) ([48cdaa8](https://togithub.com/googleapis/java-bigquery/commit/48cdaa8a77935062cfe9ed8fb66f52f774bdd673)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.36.0 ([#3093](https://togithub.com/googleapis/java-bigquery/issues/3093)) ([24456a3](https://togithub.com/googleapis/java-bigquery/commit/24456a361a39550e962ac68a79de3c7a9e912884)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240105-2.0.0 ([#3073](https://togithub.com/googleapis/java-bigquery/issues/3073)) ([f371d67](https://togithub.com/googleapis/java-bigquery/commit/f371d6709109acf07224ee0b2615de400fd90838)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.39.0 ([#3067](https://togithub.com/googleapis/java-bigquery/issues/3067)) ([6ff4f04](https://togithub.com/googleapis/java-bigquery/commit/6ff4f043905a6fe67bc3ed5cbbacc0f9eddd3172)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.40.0 ([#3094](https://togithub.com/googleapis/java-bigquery/issues/3094)) ([110bcc5](https://togithub.com/googleapis/java-bigquery/commit/110bcc506272b372fdd90ee718fad298c8ab7e19)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#3080](https://togithub.com/googleapis/java-bigquery/issues/3080)) ([a5b119c](https://togithub.com/googleapis/java-bigquery/commit/a5b119cdf6f8ce9d180a2d51a3a7a9aad50b1ea4)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 ([#3096](https://togithub.com/googleapis/java-bigquery/issues/3096)) ([0933b34](https://togithub.com/googleapis/java-bigquery/commit/0933b34f30ade216dcf61767a771509ca07f294b)) * Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.35.0 ([#3078](https://togithub.com/googleapis/java-bigquery/issues/3078)) ([2614df2](https://togithub.com/googleapis/java-bigquery/commit/2614df203b1f3c9800b8c8c23d32e7f22ec76253)) * Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.35.0 ([#3079](https://togithub.com/googleapis/java-bigquery/issues/3079)) ([f03c4fc](https://togithub.com/googleapis/java-bigquery/commit/f03c4fc957ae5665fe0f98c0f06cc80eea7cec59)) * Update github/codeql-action action to v2.23.0 ([#3061](https://togithub.com/googleapis/java-bigquery/issues/3061)) ([0fbdfba](https://togithub.com/googleapis/java-bigquery/commit/0fbdfba1aecf18567fae95aea133b6504f050bd5)) * Update github/codeql-action action to v2.23.1 ([#3077](https://togithub.com/googleapis/java-bigquery/issues/3077)) ([e3f417c](https://togithub.com/googleapis/java-bigquery/commit/e3f417cec3bdd81040baac3f054d0270dde9d9f8)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88197b2c12..ea4a0271a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [2.37.0](https://github.com/googleapis/java-bigquery/compare/v2.36.0...v2.37.0) (2024-01-25) + + +### Features + +* Add support for Table resource tags ([#3046](https://github.com/googleapis/java-bigquery/issues/3046)) ([7d61111](https://github.com/googleapis/java-bigquery/commit/7d61111d23282c7e2478ac31ba0d4e423330ec92)) +* Add universe domain ([#3090](https://github.com/googleapis/java-bigquery/issues/3090)) ([b2814a2](https://github.com/googleapis/java-bigquery/commit/b2814a2f8e6601347d0489058e563878af40f301)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.1.0 ([#3071](https://github.com/googleapis/java-bigquery/issues/3071)) ([3fbb2bb](https://github.com/googleapis/java-bigquery/commit/3fbb2bba7ad7bca245a8ca5eb59d999aead29ebd)) +* Update actions/upload-artifact action to v4.2.0 ([#3081](https://github.com/googleapis/java-bigquery/issues/3081)) ([af81354](https://github.com/googleapis/java-bigquery/commit/af81354c342cdb2a790cb008fc9fe3460e62265b)) +* Update actions/upload-artifact action to v4.3.0 ([#3091](https://github.com/googleapis/java-bigquery/issues/3091)) ([f4411b0](https://github.com/googleapis/java-bigquery/commit/f4411b09c4b681d2f3fb250ef133b291649f2865)) +* Update arrow.version to v15 ([#3084](https://github.com/googleapis/java-bigquery/issues/3084)) ([4d4cbae](https://github.com/googleapis/java-bigquery/commit/4d4cbae00028f84c071f51e88d7ee976efdf04d5)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.35.0 ([#3066](https://github.com/googleapis/java-bigquery/issues/3066)) ([48cdaa8](https://github.com/googleapis/java-bigquery/commit/48cdaa8a77935062cfe9ed8fb66f52f774bdd673)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.36.0 ([#3093](https://github.com/googleapis/java-bigquery/issues/3093)) ([24456a3](https://github.com/googleapis/java-bigquery/commit/24456a361a39550e962ac68a79de3c7a9e912884)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240105-2.0.0 ([#3073](https://github.com/googleapis/java-bigquery/issues/3073)) ([f371d67](https://github.com/googleapis/java-bigquery/commit/f371d6709109acf07224ee0b2615de400fd90838)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.39.0 ([#3067](https://github.com/googleapis/java-bigquery/issues/3067)) ([6ff4f04](https://github.com/googleapis/java-bigquery/commit/6ff4f043905a6fe67bc3ed5cbbacc0f9eddd3172)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.40.0 ([#3094](https://github.com/googleapis/java-bigquery/issues/3094)) ([110bcc5](https://github.com/googleapis/java-bigquery/commit/110bcc506272b372fdd90ee718fad298c8ab7e19)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#3080](https://github.com/googleapis/java-bigquery/issues/3080)) ([a5b119c](https://github.com/googleapis/java-bigquery/commit/a5b119cdf6f8ce9d180a2d51a3a7a9aad50b1ea4)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 ([#3096](https://github.com/googleapis/java-bigquery/issues/3096)) ([0933b34](https://github.com/googleapis/java-bigquery/commit/0933b34f30ade216dcf61767a771509ca07f294b)) +* Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.35.0 ([#3078](https://github.com/googleapis/java-bigquery/issues/3078)) ([2614df2](https://github.com/googleapis/java-bigquery/commit/2614df203b1f3c9800b8c8c23d32e7f22ec76253)) +* Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.35.0 ([#3079](https://github.com/googleapis/java-bigquery/issues/3079)) ([f03c4fc](https://github.com/googleapis/java-bigquery/commit/f03c4fc957ae5665fe0f98c0f06cc80eea7cec59)) +* Update github/codeql-action action to v2.23.0 ([#3061](https://github.com/googleapis/java-bigquery/issues/3061)) ([0fbdfba](https://github.com/googleapis/java-bigquery/commit/0fbdfba1aecf18567fae95aea133b6504f050bd5)) +* Update github/codeql-action action to v2.23.1 ([#3077](https://github.com/googleapis/java-bigquery/issues/3077)) ([e3f417c](https://github.com/googleapis/java-bigquery/commit/e3f417cec3bdd81040baac3f054d0270dde9d9f8)) + ## [2.36.0](https://github.com/googleapis/java-bigquery/compare/v2.35.0...v2.36.0) (2024-01-10) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cb406b27bc..54c64e8e41 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.36.1-SNAPSHOT + 2.37.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b88b36b01e..c59d4be0d5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.36.1-SNAPSHOT + 2.37.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.36.1-SNAPSHOT + 2.37.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 43bc4cdd2f..c22acba483 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.36.1-SNAPSHOT + 2.37.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.36.1-SNAPSHOT + 2.37.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f9d680f4a0..f96a2ed83f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.36.1-SNAPSHOT + 2.37.0 diff --git a/versions.txt b/versions.txt index 207aed9509..fc69e91467 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.36.0:2.36.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.37.0:2.37.0 \ No newline at end of file From 4139430b06a4f9dcbca2b97866ff97163b4f38c1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jan 2024 17:05:28 +0100 Subject: [PATCH 1547/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.32.0 (#3099) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index de976d88ab..08b42114b3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.31.0 + 2.32.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f96a2ed83f..2b60352874 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.31.0 + 2.32.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 732a9b53dd..0c52314066 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.31.0 + 2.32.0 test From e7d1af9336013ebbfa4dd5f797b9117ba9876441 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jan 2024 17:06:21 +0100 Subject: [PATCH 1548/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.37.0 (#3101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.37.0 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9614c18ddf..7a3ab38df1 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.36.0 + 2.37.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.36.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.37.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.36.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.36.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 08b42114b3..917e48741f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.36.0 + 2.37.0 From 2cc545ec1c0267fd9c33f3f1566f29d9a30f514e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jan 2024 17:07:02 +0100 Subject: [PATCH 1549/2268] deps: update github/codeql-action action to v2.23.2 (#3102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.23.2 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6584155eee..460ae63c48 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 + uses: github/codeql-action/upload-sarif@2f93e4319b2f04a2efc38fa7f78bd681bc3f7b2f # v2.23.2 with: sarif_file: results.sarif From 6eff68eb8c55162ca1cd2e915f3f60a87f584b35 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Jan 2024 14:15:46 +0100 Subject: [PATCH 1550/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240124-2.0.0 (#3104) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c22acba483..6cc61a0917 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240105-2.0.0 + v2-rev20240124-2.0.0 3.23.0 15.0.0 From fd637fe13fa8286b84891aa7420c2dbf212669b7 Mon Sep 17 00:00:00 2001 From: Alice <65933803+alicejli@users.noreply.github.com> Date: Mon, 29 Jan 2024 08:16:32 -0500 Subject: [PATCH 1551/2268] chore: remove obsolete release job configs (#3095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: remove obsolete release job configs * 🦉 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 --- .kokoro/build.sh | 29 +- .kokoro/release/bump_snapshot.cfg | 53 --- .kokoro/release/bump_snapshot.sh | 30 -- .kokoro/release/common.cfg | 49 --- .kokoro/release/common.sh | 50 --- .kokoro/release/drop.cfg | 6 - .kokoro/release/drop.sh | 32 -- .kokoro/release/promote.cfg | 6 - .kokoro/release/promote.sh | 34 -- .kokoro/release/publish_javadoc.cfg | 23 -- .kokoro/release/publish_javadoc.sh | 53 --- .kokoro/release/publish_javadoc11.cfg | 30 -- .kokoro/release/publish_javadoc11.sh | 63 ---- .kokoro/release/snapshot.cfg | 6 - .kokoro/release/snapshot.sh | 33 -- .kokoro/release/stage.cfg | 19 - .kokoro/release/stage.sh | 47 --- .kokoro/requirements.txt | 491 -------------------------- owlbot.py | 2 + 19 files changed, 7 insertions(+), 1049 deletions(-) delete mode 100644 .kokoro/release/bump_snapshot.cfg delete mode 100755 .kokoro/release/bump_snapshot.sh delete mode 100644 .kokoro/release/common.cfg delete mode 100755 .kokoro/release/common.sh delete mode 100644 .kokoro/release/drop.cfg delete mode 100755 .kokoro/release/drop.sh delete mode 100644 .kokoro/release/promote.cfg delete mode 100755 .kokoro/release/promote.sh delete mode 100644 .kokoro/release/publish_javadoc.cfg delete mode 100755 .kokoro/release/publish_javadoc.sh delete mode 100644 .kokoro/release/publish_javadoc11.cfg delete mode 100755 .kokoro/release/publish_javadoc11.sh delete mode 100644 .kokoro/release/snapshot.cfg delete mode 100755 .kokoro/release/snapshot.sh delete mode 100644 .kokoro/release/stage.cfg delete mode 100755 .kokoro/release/stage.sh delete mode 100644 .kokoro/requirements.txt diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 1b59f5bc3f..64f559885e 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -62,7 +62,7 @@ javadoc) integration) mvn -B ${INTEGRATION_TEST_ARGS} \ -ntp \ - -Dtest=ITBigQueryTest,ITRemoteUDFTest \ + -Penable-integration-tests \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -70,33 +70,14 @@ integration) verify RETURN_CODE=$? ;; -nightly-it) - mvn -B ${INTEGRATION_TEST_ARGS} \ - -ntp \ - -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest \ - -DtrimStackTrace=false \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -fae \ - verify - RETURN_CODE=$? - ;; graalvm) - # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; graalvm17) - # Run Integration Tests with Native Image. Skip running nightly tests in presubmits. - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; -nightly-graalvm) - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test - RETURN_CODE=$? - ;; -nightly-graalvm17) - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Dtest=ITNightlyBigQueryTest,ITRemoteUDFTest -Pnative -Penable-integration-tests test + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; samples) diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index a9df23a26c..0000000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-bigquery/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh deleted file mode 100755 index cda46bf27a..0000000000 --- a/.kokoro/release/bump_snapshot.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the snapshot release PR immediately after publishing a release - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-bigquery \ - --package-name="bigquery" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --snapshot \ - --release-type=java-auth-yoshi -fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg deleted file mode 100644 index 6d3d52351b..0000000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-bigquery/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh deleted file mode 100755 index 7f78ee414f..0000000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg deleted file mode 100644 index 0040a6262e..0000000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index 742ec1a886..0000000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg deleted file mode 100644 index 5bc0209218..0000000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 3cac3d8a97..0000000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index eedb45d591..0000000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index 5d8cd8beec..0000000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-bigquery -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index 60a846c10a..0000000000 --- a/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index b65cd03b6b..0000000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install --require-hashes -r .kokoro/requirements.txt - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-bigquery -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index effcaa3127..0000000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 1f55b77024..0000000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg deleted file mode 100644 index 8cd8055a99..0000000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigquery/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-bigquery/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-bigquery" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh deleted file mode 100755 index 61e714d6ba..0000000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -# Start the releasetool reporter -requirementsFile=$(realpath $(dirname "${BASH_SOURCE[0]}")/../requirements.txt) -python3 -m pip install --require-hashes -r $requirementsFile -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -source $(dirname "$0")/../common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -Dclirr.skip=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt deleted file mode 100644 index 445c5c1f09..0000000000 --- a/.kokoro/requirements.txt +++ /dev/null @@ -1,491 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile requirements.in --generate-hashes --upgrade -# -attrs==23.1.0 \ - --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ - --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 - # via gcp-releasetool -cachetools==5.3.1 \ - --hash=sha256:95ef631eeaea14ba2e36f06437f36463aac3a096799e876ee55e5cdccb102590 \ - --hash=sha256:dce83f2d9b4e1f732a8cd44af8e8fab2dbe46201467fc98b3ef8f269092bf62b - # via google-auth -certifi==2023.7.22 \ - --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ - --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 - # via requests -cffi==1.15.1 \ - --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ - --hash=sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef \ - --hash=sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104 \ - --hash=sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426 \ - --hash=sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405 \ - --hash=sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375 \ - --hash=sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a \ - --hash=sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e \ - --hash=sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc \ - --hash=sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf \ - --hash=sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185 \ - --hash=sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497 \ - --hash=sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3 \ - --hash=sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35 \ - --hash=sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c \ - --hash=sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83 \ - --hash=sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21 \ - --hash=sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca \ - --hash=sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984 \ - --hash=sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac \ - --hash=sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd \ - --hash=sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee \ - --hash=sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a \ - --hash=sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2 \ - --hash=sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192 \ - --hash=sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7 \ - --hash=sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585 \ - --hash=sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f \ - --hash=sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e \ - --hash=sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27 \ - --hash=sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b \ - --hash=sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e \ - --hash=sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e \ - --hash=sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d \ - --hash=sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c \ - --hash=sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415 \ - --hash=sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82 \ - --hash=sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02 \ - --hash=sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314 \ - --hash=sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325 \ - --hash=sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c \ - --hash=sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3 \ - --hash=sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914 \ - --hash=sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045 \ - --hash=sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d \ - --hash=sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9 \ - --hash=sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5 \ - --hash=sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2 \ - --hash=sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c \ - --hash=sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3 \ - --hash=sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2 \ - --hash=sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8 \ - --hash=sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d \ - --hash=sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d \ - --hash=sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9 \ - --hash=sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162 \ - --hash=sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76 \ - --hash=sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4 \ - --hash=sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e \ - --hash=sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9 \ - --hash=sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6 \ - --hash=sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b \ - --hash=sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01 \ - --hash=sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0 - # via cryptography -charset-normalizer==3.2.0 \ - --hash=sha256:04e57ab9fbf9607b77f7d057974694b4f6b142da9ed4a199859d9d4d5c63fe96 \ - --hash=sha256:09393e1b2a9461950b1c9a45d5fd251dc7c6f228acab64da1c9c0165d9c7765c \ - --hash=sha256:0b87549028f680ca955556e3bd57013ab47474c3124dc069faa0b6545b6c9710 \ - --hash=sha256:1000fba1057b92a65daec275aec30586c3de2401ccdcd41f8a5c1e2c87078706 \ - --hash=sha256:1249cbbf3d3b04902ff081ffbb33ce3377fa6e4c7356f759f3cd076cc138d020 \ - --hash=sha256:1920d4ff15ce893210c1f0c0e9d19bfbecb7983c76b33f046c13a8ffbd570252 \ - --hash=sha256:193cbc708ea3aca45e7221ae58f0fd63f933753a9bfb498a3b474878f12caaad \ - --hash=sha256:1a100c6d595a7f316f1b6f01d20815d916e75ff98c27a01ae817439ea7726329 \ - --hash=sha256:1f30b48dd7fa1474554b0b0f3fdfdd4c13b5c737a3c6284d3cdc424ec0ffff3a \ - --hash=sha256:203f0c8871d5a7987be20c72442488a0b8cfd0f43b7973771640fc593f56321f \ - --hash=sha256:246de67b99b6851627d945db38147d1b209a899311b1305dd84916f2b88526c6 \ - --hash=sha256:2dee8e57f052ef5353cf608e0b4c871aee320dd1b87d351c28764fc0ca55f9f4 \ - --hash=sha256:2efb1bd13885392adfda4614c33d3b68dee4921fd0ac1d3988f8cbb7d589e72a \ - --hash=sha256:2f4ac36d8e2b4cc1aa71df3dd84ff8efbe3bfb97ac41242fbcfc053c67434f46 \ - --hash=sha256:3170c9399da12c9dc66366e9d14da8bf7147e1e9d9ea566067bbce7bb74bd9c2 \ - --hash=sha256:3b1613dd5aee995ec6d4c69f00378bbd07614702a315a2cf6c1d21461fe17c23 \ - --hash=sha256:3bb3d25a8e6c0aedd251753a79ae98a093c7e7b471faa3aa9a93a81431987ace \ - --hash=sha256:3bb7fda7260735efe66d5107fb7e6af6a7c04c7fce9b2514e04b7a74b06bf5dd \ - --hash=sha256:41b25eaa7d15909cf3ac4c96088c1f266a9a93ec44f87f1d13d4a0e86c81b982 \ - --hash=sha256:45de3f87179c1823e6d9e32156fb14c1927fcc9aba21433f088fdfb555b77c10 \ - --hash=sha256:46fb8c61d794b78ec7134a715a3e564aafc8f6b5e338417cb19fe9f57a5a9bf2 \ - --hash=sha256:48021783bdf96e3d6de03a6e39a1171ed5bd7e8bb93fc84cc649d11490f87cea \ - --hash=sha256:4957669ef390f0e6719db3613ab3a7631e68424604a7b448f079bee145da6e09 \ - --hash=sha256:5e86d77b090dbddbe78867a0275cb4df08ea195e660f1f7f13435a4649e954e5 \ - --hash=sha256:6339d047dab2780cc6220f46306628e04d9750f02f983ddb37439ca47ced7149 \ - --hash=sha256:681eb3d7e02e3c3655d1b16059fbfb605ac464c834a0c629048a30fad2b27489 \ - --hash=sha256:6c409c0deba34f147f77efaa67b8e4bb83d2f11c8806405f76397ae5b8c0d1c9 \ - --hash=sha256:7095f6fbfaa55defb6b733cfeb14efaae7a29f0b59d8cf213be4e7ca0b857b80 \ - --hash=sha256:70c610f6cbe4b9fce272c407dd9d07e33e6bf7b4aa1b7ffb6f6ded8e634e3592 \ - --hash=sha256:72814c01533f51d68702802d74f77ea026b5ec52793c791e2da806a3844a46c3 \ - --hash=sha256:7a4826ad2bd6b07ca615c74ab91f32f6c96d08f6fcc3902ceeedaec8cdc3bcd6 \ - --hash=sha256:7c70087bfee18a42b4040bb9ec1ca15a08242cf5867c58726530bdf3945672ed \ - --hash=sha256:855eafa5d5a2034b4621c74925d89c5efef61418570e5ef9b37717d9c796419c \ - --hash=sha256:8700f06d0ce6f128de3ccdbc1acaea1ee264d2caa9ca05daaf492fde7c2a7200 \ - --hash=sha256:89f1b185a01fe560bc8ae5f619e924407efca2191b56ce749ec84982fc59a32a \ - --hash=sha256:8b2c760cfc7042b27ebdb4a43a4453bd829a5742503599144d54a032c5dc7e9e \ - --hash=sha256:8c2f5e83493748286002f9369f3e6607c565a6a90425a3a1fef5ae32a36d749d \ - --hash=sha256:8e098148dd37b4ce3baca71fb394c81dc5d9c7728c95df695d2dca218edf40e6 \ - --hash=sha256:94aea8eff76ee6d1cdacb07dd2123a68283cb5569e0250feab1240058f53b623 \ - --hash=sha256:95eb302ff792e12aba9a8b8f8474ab229a83c103d74a750ec0bd1c1eea32e669 \ - --hash=sha256:9bd9b3b31adcb054116447ea22caa61a285d92e94d710aa5ec97992ff5eb7cf3 \ - --hash=sha256:9e608aafdb55eb9f255034709e20d5a83b6d60c054df0802fa9c9883d0a937aa \ - --hash=sha256:a103b3a7069b62f5d4890ae1b8f0597618f628b286b03d4bc9195230b154bfa9 \ - --hash=sha256:a386ebe437176aab38c041de1260cd3ea459c6ce5263594399880bbc398225b2 \ - --hash=sha256:a38856a971c602f98472050165cea2cdc97709240373041b69030be15047691f \ - --hash=sha256:a401b4598e5d3f4a9a811f3daf42ee2291790c7f9d74b18d75d6e21dda98a1a1 \ - --hash=sha256:a7647ebdfb9682b7bb97e2a5e7cb6ae735b1c25008a70b906aecca294ee96cf4 \ - --hash=sha256:aaf63899c94de41fe3cf934601b0f7ccb6b428c6e4eeb80da72c58eab077b19a \ - --hash=sha256:b0dac0ff919ba34d4df1b6131f59ce95b08b9065233446be7e459f95554c0dc8 \ - --hash=sha256:baacc6aee0b2ef6f3d308e197b5d7a81c0e70b06beae1f1fcacffdbd124fe0e3 \ - --hash=sha256:bf420121d4c8dce6b889f0e8e4ec0ca34b7f40186203f06a946fa0276ba54029 \ - --hash=sha256:c04a46716adde8d927adb9457bbe39cf473e1e2c2f5d0a16ceb837e5d841ad4f \ - --hash=sha256:c0b21078a4b56965e2b12f247467b234734491897e99c1d51cee628da9786959 \ - --hash=sha256:c1c76a1743432b4b60ab3358c937a3fe1341c828ae6194108a94c69028247f22 \ - --hash=sha256:c4983bf937209c57240cff65906b18bb35e64ae872da6a0db937d7b4af845dd7 \ - --hash=sha256:c4fb39a81950ec280984b3a44f5bd12819953dc5fa3a7e6fa7a80db5ee853952 \ - --hash=sha256:c57921cda3a80d0f2b8aec7e25c8aa14479ea92b5b51b6876d975d925a2ea346 \ - --hash=sha256:c8063cf17b19661471ecbdb3df1c84f24ad2e389e326ccaf89e3fb2484d8dd7e \ - --hash=sha256:ccd16eb18a849fd8dcb23e23380e2f0a354e8daa0c984b8a732d9cfaba3a776d \ - --hash=sha256:cd6dbe0238f7743d0efe563ab46294f54f9bc8f4b9bcf57c3c666cc5bc9d1299 \ - --hash=sha256:d62e51710986674142526ab9f78663ca2b0726066ae26b78b22e0f5e571238dd \ - --hash=sha256:db901e2ac34c931d73054d9797383d0f8009991e723dab15109740a63e7f902a \ - --hash=sha256:e03b8895a6990c9ab2cdcd0f2fe44088ca1c65ae592b8f795c3294af00a461c3 \ - --hash=sha256:e1c8a2f4c69e08e89632defbfabec2feb8a8d99edc9f89ce33c4b9e36ab63037 \ - --hash=sha256:e4b749b9cc6ee664a3300bb3a273c1ca8068c46be705b6c31cf5d276f8628a94 \ - --hash=sha256:e6a5bf2cba5ae1bb80b154ed68a3cfa2fa00fde979a7f50d6598d3e17d9ac20c \ - --hash=sha256:e857a2232ba53ae940d3456f7533ce6ca98b81917d47adc3c7fd55dad8fab858 \ - --hash=sha256:ee4006268ed33370957f55bf2e6f4d263eaf4dc3cfc473d1d90baff6ed36ce4a \ - --hash=sha256:eef9df1eefada2c09a5e7a40991b9fc6ac6ef20b1372abd48d2794a316dc0449 \ - --hash=sha256:f058f6963fd82eb143c692cecdc89e075fa0828db2e5b291070485390b2f1c9c \ - --hash=sha256:f25c229a6ba38a35ae6e25ca1264621cc25d4d38dca2942a7fce0b67a4efe918 \ - --hash=sha256:f2a1d0fd4242bd8643ce6f98927cf9c04540af6efa92323e9d3124f57727bfc1 \ - --hash=sha256:f7560358a6811e52e9c4d142d497f1a6e10103d3a6881f18d04dbce3729c0e2c \ - --hash=sha256:f779d3ad205f108d14e99bb3859aa7dd8e9c68874617c72354d7ecaec2a054ac \ - --hash=sha256:f87f746ee241d30d6ed93969de31e5ffd09a2961a051e60ae6bddde9ec3583aa - # via requests -click==8.0.4 \ - --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ - --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb - # via - # -r requirements.in - # gcp-docuploader - # gcp-releasetool -colorlog==6.7.0 \ - --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ - --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 - # via gcp-docuploader -cryptography==41.0.6 \ - --hash=sha256:068bc551698c234742c40049e46840843f3d98ad7ce265fd2bd4ec0d11306596 \ - --hash=sha256:0f27acb55a4e77b9be8d550d762b0513ef3fc658cd3eb15110ebbcbd626db12c \ - --hash=sha256:2132d5865eea673fe6712c2ed5fb4fa49dba10768bb4cc798345748380ee3660 \ - --hash=sha256:3288acccef021e3c3c10d58933f44e8602cf04dba96d9796d70d537bb2f4bbc4 \ - --hash=sha256:35f3f288e83c3f6f10752467c48919a7a94b7d88cc00b0668372a0d2ad4f8ead \ - --hash=sha256:398ae1fc711b5eb78e977daa3cbf47cec20f2c08c5da129b7a296055fbb22aed \ - --hash=sha256:422e3e31d63743855e43e5a6fcc8b4acab860f560f9321b0ee6269cc7ed70cc3 \ - --hash=sha256:48783b7e2bef51224020efb61b42704207dde583d7e371ef8fc2a5fb6c0aabc7 \ - --hash=sha256:4d03186af98b1c01a4eda396b137f29e4e3fb0173e30f885e27acec8823c1b09 \ - --hash=sha256:5daeb18e7886a358064a68dbcaf441c036cbdb7da52ae744e7b9207b04d3908c \ - --hash=sha256:60e746b11b937911dc70d164060d28d273e31853bb359e2b2033c9e93e6f3c43 \ - --hash=sha256:742ae5e9a2310e9dade7932f9576606836ed174da3c7d26bc3d3ab4bd49b9f65 \ - --hash=sha256:7e00fb556bda398b99b0da289ce7053639d33b572847181d6483ad89835115f6 \ - --hash=sha256:85abd057699b98fce40b41737afb234fef05c67e116f6f3650782c10862c43da \ - --hash=sha256:8efb2af8d4ba9dbc9c9dd8f04d19a7abb5b49eab1f3694e7b5a16a5fc2856f5c \ - --hash=sha256:ae236bb8760c1e55b7a39b6d4d32d2279bc6c7c8500b7d5a13b6fb9fc97be35b \ - --hash=sha256:afda76d84b053923c27ede5edc1ed7d53e3c9f475ebaf63c68e69f1403c405a8 \ - --hash=sha256:b27a7fd4229abef715e064269d98a7e2909ebf92eb6912a9603c7e14c181928c \ - --hash=sha256:b648fe2a45e426aaee684ddca2632f62ec4613ef362f4d681a9a6283d10e079d \ - --hash=sha256:c5a550dc7a3b50b116323e3d376241829fd326ac47bc195e04eb33a8170902a9 \ - --hash=sha256:da46e2b5df770070412c46f87bac0849b8d685c5f2679771de277a422c7d0b86 \ - --hash=sha256:f39812f70fc5c71a15aa3c97b2bbe213c3f2a460b79bd21c40d033bb34a9bf36 \ - --hash=sha256:ff369dd19e8fe0528b02e8df9f2aeb2479f89b1270d90f96a63500afe9af5cae - # via - # gcp-releasetool - # secretstorage -gcp-docuploader==0.6.5 \ - --hash=sha256:30221d4ac3e5a2b9c69aa52fdbef68cc3f27d0e6d0d90e220fc024584b8d2318 \ - --hash=sha256:b7458ef93f605b9d46a4bf3a8dc1755dad1f31d030c8679edf304e343b347eea - # via -r requirements.in -gcp-releasetool==1.16.0 \ - --hash=sha256:27bf19d2e87aaa884096ff941aa3c592c482be3d6a2bfe6f06afafa6af2353e3 \ - --hash=sha256:a316b197a543fd036209d0caba7a8eb4d236d8e65381c80cbc6d7efaa7606d63 - # via -r requirements.in -google-api-core==2.11.1 \ - --hash=sha256:25d29e05a0058ed5f19c61c0a78b1b53adea4d9364b464d014fbda941f6d1c9a \ - --hash=sha256:d92a5a92dc36dd4f4b9ee4e55528a90e432b059f93aee6ad857f9de8cc7ae94a - # via - # google-cloud-core - # google-cloud-storage -google-auth==2.22.0 \ - --hash=sha256:164cba9af4e6e4e40c3a4f90a1a6c12ee56f14c0b4868d1ca91b32826ab334ce \ - --hash=sha256:d61d1b40897407b574da67da1a833bdc10d5a11642566e506565d1b1a46ba873 - # via - # gcp-releasetool - # google-api-core - # google-cloud-core - # google-cloud-storage -google-cloud-core==2.3.3 \ - --hash=sha256:37b80273c8d7eee1ae816b3a20ae43585ea50506cb0e60f3cf5be5f87f1373cb \ - --hash=sha256:fbd11cad3e98a7e5b0343dc07cb1039a5ffd7a5bb96e1f1e27cee4bda4a90863 - # via google-cloud-storage -google-cloud-storage==2.10.0 \ - --hash=sha256:934b31ead5f3994e5360f9ff5750982c5b6b11604dc072bc452c25965e076dc7 \ - --hash=sha256:9433cf28801671de1c80434238fb1e7e4a1ba3087470e90f70c928ea77c2b9d7 - # via gcp-docuploader -google-crc32c==1.5.0 \ - --hash=sha256:024894d9d3cfbc5943f8f230e23950cd4906b2fe004c72e29b209420a1e6b05a \ - --hash=sha256:02c65b9817512edc6a4ae7c7e987fea799d2e0ee40c53ec573a692bee24de876 \ - --hash=sha256:02ebb8bf46c13e36998aeaad1de9b48f4caf545e91d14041270d9dca767b780c \ - --hash=sha256:07eb3c611ce363c51a933bf6bd7f8e3878a51d124acfc89452a75120bc436289 \ - --hash=sha256:1034d91442ead5a95b5aaef90dbfaca8633b0247d1e41621d1e9f9db88c36298 \ - --hash=sha256:116a7c3c616dd14a3de8c64a965828b197e5f2d121fedd2f8c5585c547e87b02 \ - --hash=sha256:19e0a019d2c4dcc5e598cd4a4bc7b008546b0358bd322537c74ad47a5386884f \ - --hash=sha256:1c7abdac90433b09bad6c43a43af253e688c9cfc1c86d332aed13f9a7c7f65e2 \ - --hash=sha256:1e986b206dae4476f41bcec1faa057851f3889503a70e1bdb2378d406223994a \ - --hash=sha256:272d3892a1e1a2dbc39cc5cde96834c236d5327e2122d3aaa19f6614531bb6eb \ - --hash=sha256:278d2ed7c16cfc075c91378c4f47924c0625f5fc84b2d50d921b18b7975bd210 \ - --hash=sha256:2ad40e31093a4af319dadf503b2467ccdc8f67c72e4bcba97f8c10cb078207b5 \ - --hash=sha256:2e920d506ec85eb4ba50cd4228c2bec05642894d4c73c59b3a2fe20346bd00ee \ - --hash=sha256:3359fc442a743e870f4588fcf5dcbc1bf929df1fad8fb9905cd94e5edb02e84c \ - --hash=sha256:37933ec6e693e51a5b07505bd05de57eee12f3e8c32b07da7e73669398e6630a \ - --hash=sha256:398af5e3ba9cf768787eef45c803ff9614cc3e22a5b2f7d7ae116df8b11e3314 \ - --hash=sha256:3b747a674c20a67343cb61d43fdd9207ce5da6a99f629c6e2541aa0e89215bcd \ - --hash=sha256:461665ff58895f508e2866824a47bdee72497b091c730071f2b7575d5762ab65 \ - --hash=sha256:4c6fdd4fccbec90cc8a01fc00773fcd5fa28db683c116ee3cb35cd5da9ef6c37 \ - --hash=sha256:5829b792bf5822fd0a6f6eb34c5f81dd074f01d570ed7f36aa101d6fc7a0a6e4 \ - --hash=sha256:596d1f98fc70232fcb6590c439f43b350cb762fb5d61ce7b0e9db4539654cc13 \ - --hash=sha256:5ae44e10a8e3407dbe138984f21e536583f2bba1be9491239f942c2464ac0894 \ - --hash=sha256:635f5d4dd18758a1fbd1049a8e8d2fee4ffed124462d837d1a02a0e009c3ab31 \ - --hash=sha256:64e52e2b3970bd891309c113b54cf0e4384762c934d5ae56e283f9a0afcd953e \ - --hash=sha256:66741ef4ee08ea0b2cc3c86916ab66b6aef03768525627fd6a1b34968b4e3709 \ - --hash=sha256:67b741654b851abafb7bc625b6d1cdd520a379074e64b6a128e3b688c3c04740 \ - --hash=sha256:6ac08d24c1f16bd2bf5eca8eaf8304812f44af5cfe5062006ec676e7e1d50afc \ - --hash=sha256:6f998db4e71b645350b9ac28a2167e6632c239963ca9da411523bb439c5c514d \ - --hash=sha256:72218785ce41b9cfd2fc1d6a017dc1ff7acfc4c17d01053265c41a2c0cc39b8c \ - --hash=sha256:74dea7751d98034887dbd821b7aae3e1d36eda111d6ca36c206c44478035709c \ - --hash=sha256:759ce4851a4bb15ecabae28f4d2e18983c244eddd767f560165563bf9aefbc8d \ - --hash=sha256:77e2fd3057c9d78e225fa0a2160f96b64a824de17840351b26825b0848022906 \ - --hash=sha256:7c074fece789b5034b9b1404a1f8208fc2d4c6ce9decdd16e8220c5a793e6f61 \ - --hash=sha256:7c42c70cd1d362284289c6273adda4c6af8039a8ae12dc451dcd61cdabb8ab57 \ - --hash=sha256:7f57f14606cd1dd0f0de396e1e53824c371e9544a822648cd76c034d209b559c \ - --hash=sha256:83c681c526a3439b5cf94f7420471705bbf96262f49a6fe546a6db5f687a3d4a \ - --hash=sha256:8485b340a6a9e76c62a7dce3c98e5f102c9219f4cfbf896a00cf48caf078d438 \ - --hash=sha256:84e6e8cd997930fc66d5bb4fde61e2b62ba19d62b7abd7a69920406f9ecca946 \ - --hash=sha256:89284716bc6a5a415d4eaa11b1726d2d60a0cd12aadf5439828353662ede9dd7 \ - --hash=sha256:8b87e1a59c38f275c0e3676fc2ab6d59eccecfd460be267ac360cc31f7bcde96 \ - --hash=sha256:8f24ed114432de109aa9fd317278518a5af2d31ac2ea6b952b2f7782b43da091 \ - --hash=sha256:98cb4d057f285bd80d8778ebc4fde6b4d509ac3f331758fb1528b733215443ae \ - --hash=sha256:998679bf62b7fb599d2878aa3ed06b9ce688b8974893e7223c60db155f26bd8d \ - --hash=sha256:9ba053c5f50430a3fcfd36f75aff9caeba0440b2d076afdb79a318d6ca245f88 \ - --hash=sha256:9c99616c853bb585301df6de07ca2cadad344fd1ada6d62bb30aec05219c45d2 \ - --hash=sha256:a1fd716e7a01f8e717490fbe2e431d2905ab8aa598b9b12f8d10abebb36b04dd \ - --hash=sha256:a2355cba1f4ad8b6988a4ca3feed5bff33f6af2d7f134852cf279c2aebfde541 \ - --hash=sha256:b1f8133c9a275df5613a451e73f36c2aea4fe13c5c8997e22cf355ebd7bd0728 \ - --hash=sha256:b8667b48e7a7ef66afba2c81e1094ef526388d35b873966d8a9a447974ed9178 \ - --hash=sha256:ba1eb1843304b1e5537e1fca632fa894d6f6deca8d6389636ee5b4797affb968 \ - --hash=sha256:be82c3c8cfb15b30f36768797a640e800513793d6ae1724aaaafe5bf86f8f346 \ - --hash=sha256:c02ec1c5856179f171e032a31d6f8bf84e5a75c45c33b2e20a3de353b266ebd8 \ - --hash=sha256:c672d99a345849301784604bfeaeba4db0c7aae50b95be04dd651fd2a7310b93 \ - --hash=sha256:c6c777a480337ac14f38564ac88ae82d4cd238bf293f0a22295b66eb89ffced7 \ - --hash=sha256:cae0274952c079886567f3f4f685bcaf5708f0a23a5f5216fdab71f81a6c0273 \ - --hash=sha256:cd67cf24a553339d5062eff51013780a00d6f97a39ca062781d06b3a73b15462 \ - --hash=sha256:d3515f198eaa2f0ed49f8819d5732d70698c3fa37384146079b3799b97667a94 \ - --hash=sha256:d5280312b9af0976231f9e317c20e4a61cd2f9629b7bfea6a693d1878a264ebd \ - --hash=sha256:de06adc872bcd8c2a4e0dc51250e9e65ef2ca91be023b9d13ebd67c2ba552e1e \ - --hash=sha256:e1674e4307fa3024fc897ca774e9c7562c957af85df55efe2988ed9056dc4e57 \ - --hash=sha256:e2096eddb4e7c7bdae4bd69ad364e55e07b8316653234a56552d9c988bd2d61b \ - --hash=sha256:e560628513ed34759456a416bf86b54b2476c59144a9138165c9a1575801d0d9 \ - --hash=sha256:edfedb64740750e1a3b16152620220f51d58ff1b4abceb339ca92e934775c27a \ - --hash=sha256:f13cae8cc389a440def0c8c52057f37359014ccbc9dc1f0827936bcd367c6100 \ - --hash=sha256:f314013e7dcd5cf45ab1945d92e713eec788166262ae8deb2cfacd53def27325 \ - --hash=sha256:f583edb943cf2e09c60441b910d6a20b4d9d626c75a36c8fcac01a6c96c01183 \ - --hash=sha256:fd8536e902db7e365f49e7d9029283403974ccf29b13fc7028b97e2295b33556 \ - --hash=sha256:fe70e325aa68fa4b5edf7d1a4b6f691eb04bbccac0ace68e34820d283b5f80d4 - # via google-resumable-media -google-resumable-media==2.5.0 \ - --hash=sha256:218931e8e2b2a73a58eb354a288e03a0fd5fb1c4583261ac6e4c078666468c93 \ - --hash=sha256:da1bd943e2e114a56d85d6848497ebf9be6a14d3db23e9fc57581e7c3e8170ec - # via google-cloud-storage -googleapis-common-protos==1.59.1 \ - --hash=sha256:0cbedb6fb68f1c07e18eb4c48256320777707e7d0c55063ae56c15db3224a61e \ - --hash=sha256:b35d530fe825fb4227857bc47ad84c33c809ac96f312e13182bdeaa2abe1178a - # via google-api-core -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via requests -importlib-metadata==6.8.0 \ - --hash=sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb \ - --hash=sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743 - # via keyring -jaraco-classes==3.3.0 \ - --hash=sha256:10afa92b6743f25c0cf5f37c6bb6e18e2c5bb84a16527ccfc0040ea377e7aaeb \ - --hash=sha256:c063dd08e89217cee02c8d5e5ec560f2c8ce6cdc2fcdc2e68f7b2e5547ed3621 - # via keyring -jeepney==0.8.0 \ - --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ - --hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755 - # via - # keyring - # secretstorage -jinja2==3.1.2 \ - --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ - --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 - # via gcp-releasetool -keyring==24.2.0 \ - --hash=sha256:4901caaf597bfd3bbd78c9a0c7c4c29fcd8310dab2cffefe749e916b6527acd6 \ - --hash=sha256:ca0746a19ec421219f4d713f848fa297a661a8a8c1504867e55bfb5e09091509 - # via gcp-releasetool -markupsafe==2.1.3 \ - --hash=sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e \ - --hash=sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e \ - --hash=sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431 \ - --hash=sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686 \ - --hash=sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559 \ - --hash=sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc \ - --hash=sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c \ - --hash=sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0 \ - --hash=sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4 \ - --hash=sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9 \ - --hash=sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575 \ - --hash=sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba \ - --hash=sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d \ - --hash=sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3 \ - --hash=sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00 \ - --hash=sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155 \ - --hash=sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac \ - --hash=sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52 \ - --hash=sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f \ - --hash=sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8 \ - --hash=sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b \ - --hash=sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24 \ - --hash=sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea \ - --hash=sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198 \ - --hash=sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0 \ - --hash=sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee \ - --hash=sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be \ - --hash=sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2 \ - --hash=sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707 \ - --hash=sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6 \ - --hash=sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58 \ - --hash=sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779 \ - --hash=sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636 \ - --hash=sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c \ - --hash=sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad \ - --hash=sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee \ - --hash=sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc \ - --hash=sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2 \ - --hash=sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48 \ - --hash=sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7 \ - --hash=sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e \ - --hash=sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b \ - --hash=sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa \ - --hash=sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5 \ - --hash=sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e \ - --hash=sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb \ - --hash=sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9 \ - --hash=sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57 \ - --hash=sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc \ - --hash=sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2 - # via jinja2 -more-itertools==9.1.0 \ - --hash=sha256:cabaa341ad0389ea83c17a94566a53ae4c9d07349861ecb14dc6d0345cf9ac5d \ - --hash=sha256:d2bc7f02446e86a68911e58ded76d6561eea00cddfb2a91e7019bbb586c799f3 - # via jaraco-classes -packaging==23.1 \ - --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ - --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f - # via gcp-releasetool -protobuf==3.20.3 \ - --hash=sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7 \ - --hash=sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c \ - --hash=sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2 \ - --hash=sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b \ - --hash=sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050 \ - --hash=sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9 \ - --hash=sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7 \ - --hash=sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454 \ - --hash=sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480 \ - --hash=sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469 \ - --hash=sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c \ - --hash=sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e \ - --hash=sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db \ - --hash=sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905 \ - --hash=sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b \ - --hash=sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86 \ - --hash=sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4 \ - --hash=sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402 \ - --hash=sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7 \ - --hash=sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4 \ - --hash=sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99 \ - --hash=sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee - # via - # gcp-docuploader - # gcp-releasetool - # google-api-core - # googleapis-common-protos -pyasn1==0.5.0 \ - --hash=sha256:87a2121042a1ac9358cabcaf1d07680ff97ee6404333bacca15f76aa8ad01a57 \ - --hash=sha256:97b7290ca68e62a832558ec3976f15cbf911bf5d7c7039d8b861c2a0ece69fde - # via - # pyasn1-modules - # rsa -pyasn1-modules==0.3.0 \ - --hash=sha256:5bd01446b736eb9d31512a30d46c1ac3395d676c6f3cafa4c03eb54b9925631c \ - --hash=sha256:d3ccd6ed470d9ffbc716be08bd90efbd44d0734bc9303818f7336070984a162d - # via google-auth -pycparser==2.21 \ - --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ - --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 - # via cffi -pyjwt==2.7.0 \ - --hash=sha256:ba2b425b15ad5ef12f200dc67dd56af4e26de2331f965c5439994dad075876e1 \ - --hash=sha256:bd6ca4a3c4285c1a2d4349e5a035fdf8fb94e04ccd0fcbe6ba289dae9cc3e074 - # via gcp-releasetool -pyperclip==1.8.2 \ - --hash=sha256:105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57 - # via gcp-releasetool -python-dateutil==2.8.2 \ - --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ - --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via gcp-releasetool -requests==2.31.0 \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 - # via - # gcp-releasetool - # google-api-core - # google-cloud-storage -rsa==4.9 \ - --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ - --hash=sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21 - # via google-auth -secretstorage==3.3.3 \ - --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ - --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 - # via keyring -six==1.16.0 \ - --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ - --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 - # via - # gcp-docuploader - # google-auth - # python-dateutil -typing-extensions==4.7.1 \ - --hash=sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36 \ - --hash=sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2 - # via -r requirements.in -urllib3==1.26.18 \ - --hash=sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07 \ - --hash=sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0 - # via - # google-auth - # requests -wheel==0.40.0 \ - --hash=sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873 \ - --hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247 - # via -r requirements.in -zipp==3.16.1 \ - --hash=sha256:0b37c326d826d5ca35f2b9685cd750292740774ef16190008b00a0227c256fe0 \ - --hash=sha256:857b158da2cbf427b376da1c24fd11faecbac5a4ac7523c3607f8a01f94c2ec0 - # via importlib-metadata - -# WARNING: The following packages were not pinned, but pip requires them to be -# pinned when the requirements file includes hashes and the requirement is not -# satisfied by a package already installed. Consider using the --allow-unsafe flag. -# setuptools diff --git a/owlbot.py b/owlbot.py index 7a89db8ff2..490004d0bd 100644 --- a/owlbot.py +++ b/owlbot.py @@ -23,4 +23,6 @@ 'codecov.yaml', 'renovate.json', '.kokoro/build.sh' + '.kokoro/requirements.in', + '.kokoro/requirements.txt' ]) \ No newline at end of file From 16d79364f5845ac82084f97eff082ed07c69c57f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:26:48 -0500 Subject: [PATCH 1552/2268] chore: adjust renovate bot configs to update the sdk-platform-java-config artifact (#1921) (#3107) chore: update renovate bot configs to update the sdk-platform-java-config artifact Source-Link: https://github.com/googleapis/synthtool/commit/d7828c02a5b1aeb8dcf3aa6c55f8fdf407a0156f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:0d1bb26a1a99ae0456176bf891b8490e9aab424a5cb4e4d301d9703c4dc43b58 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index dc05a72762..bf48c82da1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:a6aa751984f1e905c3ae5a3aac78fc7b68210626ce91487dc7ff4f0a06f010cc -# created: 2024-01-22T14:14:20.913785597Z + digest: sha256:0d1bb26a1a99ae0456176bf891b8490e9aab424a5cb4e4d301d9703c4dc43b58 +# created: 2024-01-30T19:46:55.029238294Z diff --git a/README.md b/README.md index 7a3ab38df1..4705d64a03 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.30.0') +implementation platform('com.google.cloud:libraries-bom:26.31.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From 3f8e8d1f9477aed3a14bccf021d7ff982463022c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 2 Feb 2024 17:37:15 +0100 Subject: [PATCH 1553/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.10.0 (#3110) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index df62de7dc2..983e1f56a6 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.28 + 0.10.0 test From 5ad778c18130c33e7532d0bd3193053518ca047a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 2 Feb 2024 19:03:19 +0100 Subject: [PATCH 1554/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.24.0 (#3109) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cc61a0917..3e29309562 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20240124-2.0.0 - 3.23.0 + 3.24.0 15.0.0 From 2858e96807190d995d9d682e056d90821da11b7a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 2 Feb 2024 19:44:21 +0100 Subject: [PATCH 1555/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.0 (#3111) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 983e1f56a6..3975d227cd 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.28 + 0.10.0 true com.example.bigquery.NativeImageBigquerySample From 29535e7f82c4ce116e363c693a6d84be07ed5f50 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 20:50:39 +0000 Subject: [PATCH 1556/2268] chore(main): release 2.37.1-SNAPSHOT (#3100) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 54c64e8e41..dbe4021012 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.0 + 2.37.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c59d4be0d5..7ce9e586ab 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.0 + 2.37.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3e29309562..c7a3c83f60 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.0 + 2.37.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2b60352874..2d22c8ec18 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index fc69e91467..7bb7cb270d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.0:2.37.0 \ No newline at end of file +google-cloud-bigquery:2.37.0:2.37.1-SNAPSHOT \ No newline at end of file From 01f04059ab119da759536426938c1069906c8be4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 17:11:13 +0100 Subject: [PATCH 1557/2268] deps: update github/codeql-action action to v2.24.0 (#3114) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 460ae63c48..6aa911edf6 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@2f93e4319b2f04a2efc38fa7f78bd681bc3f7b2f # v2.23.2 + uses: github/codeql-action/upload-sarif@dc021d495cb77b369e4d9d04a501700fd83b8c51 # v2.24.0 with: sarif_file: results.sarif From d7dec83d288e6b65503d38b7da41f91cb44294d4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 17:12:02 +0100 Subject: [PATCH 1558/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.1.0 (#3117) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7a3c83f60..70b4ed3d7b 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.0.1 + 3.1.0 pom import From 4b4fdd8ebc324d2bc48a9f78347247f4f6c2e424 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 17:15:00 +0100 Subject: [PATCH 1559/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.10.2 (#3119) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 3975d227cd..e1e6ad55ed 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.10.1 + 5.10.2 test From 667ed38645fdc1f32b2b101cf2db95bf8ef1561a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 17:36:15 +0100 Subject: [PATCH 1560/2268] test(deps): update dependency com.google.truth:truth to v1.4.0 (#3115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.truth:truth](https://togithub.com/google/truth) | `1.3.0` -> `1.4.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.truth:truth/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.truth:truth/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.truth:truth/1.3.0/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.truth:truth/1.3.0/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    google/truth (com.google.truth:truth) ### [`v1.4.0`](https://togithub.com/google/truth/releases/tag/v1.4.0): 1.4.0 In this release, our assertions on Java 8 types continue to move from the `Truth8` class to the main `Truth` class. This change should not break compatibility for any supported JDK or Android version, even users who test under old versions of Android without [API desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring). Additionally, we will never break binary compatibility, though some users will have to make changes to their source code in order for it to compile against newer versions. This release is likely to lead to more **build failures** than [1.3.0](https://togithub.com/google/truth/releases/tag/v1.3.0) did. However, those failures should be **straightforward to fix**. #### Example build failure Foo.java:152: error: reference to assertThat is ambiguous assertThat(repo.findFileWithName("foo")).isNull(); ^ both method assertThat(@​org.jspecify.nullness.Nullable Path) in Truth8 and method assertThat(@​org.jspecify.nullness.Nullable Path) in Truth match #### Simplest upgrade strategy (if you can update all your code atomically in the same commit as the Truth upgrade) In the same commit: 1. Upgrade Truth to 1.4.0. 2. Replace `import static com.google.common.truth.Truth8.assertThat;` with `import static com.google.common.truth.Truth.assertThat;`. - If you use Kotlin, replace `import com.google.common.truth.Truth8.assertThat` with `import com.google.common.truth.Truth.assertThat`. 3. Replace `import com.google.common.truth.Truth8;` with `import com.google.common.truth.Truth;`. - again, similarly for Kotlin if needed 4. Replace remaining references to `Truth8` with references to `Truth`. - For example, replace `Truth8.assertThat(optional).isPresent()` with `Truth.assertThat(optional).isPresent()`. If you're feeling lucky, you can try this one-liner for the code updates: ```sh git grep -l Truth8 | xargs perl -pi -e 's/import static com.google.common.truth.Truth8.assertThat;/import static com.google.common.truth.Truth.assertThat;/g; s/import com.google.common.truth.Truth8.assertThat/import com.google.common.truth.Truth.assertThat/g; s/import com.google.common.truth.Truth8/import com.google.common.truth.Truth/g; s/\bTruth8[.]/Truth./g;' ``` After that process, it is possible that you'll still see build errors from ambiguous usages of `assertThat` static imports. If so, you can find a workaround in the section about overload ambiguity in the release notes for [1.3.0](https://togithub.com/google/truth/releases/tag/v1.3.0). Alternatively, you can wait to upgrade until after a future Truth release, which will eliminate the ambiguity by changing the signatures of some `Truth.assertThat` overloads. #### Incremental upgrade strategy If you have a very large repo or you have other reasons to prefer to upgrade incrementally, you can use the approach that we used inside Google. Roughly, that approach was: 1. Make the optional changes discussed in the release notes for [1.3.0](https://togithub.com/google/truth/releases/tag/v1.3.0). 2. For any remaining calls to `Truth8.assertThat`, change them to *avoid* static import. - That is, replace `assertThat(optional).isPresent()` with `Truth8.assertThat(optional).isPresent()`. 3. Upgrade Truth to 1.4.0. 4. Optionally replace references to `Truth8` with references to `Truth` (including restoring static imports if desired), as discussed in section about the simple upgrade strategy above. #### Optional additional changes - If you use `assertWithMessage(...).about(intStreams()).that(...)`, `expect.about(optionalLongs()).that(...)`, or similar, you can remove your call to `about`. This change will never be necessary; it is just a simplification. - This is similar to a previous optional change from [1.3.0](https://togithub.com/google/truth/releases/tag/v1.3.0), except that 1.3.0 solved this problem for `streams` and `optionals`, whereas 1.4.0 solves it for the other `Truth8` types. #### For help Please feel welcome to [open an issue](https://togithub.com/google/truth/issues/new) to report problems or request help. #### Changelog - Added the remaining `Truth8.assertThat` overloads to the main `Truth` class. ([`9be8e77`](https://togithub.com/google/truth/commit/9be8e774c), [`1f81827`](https://togithub.com/google/truth/commit/1f81827f1)) - Added more `that` overloads to make it possible to write type-specific assertions when using the remaining Java 8 types. ([`7c65fc6`](https://togithub.com/google/truth/commit/7c65fc611))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 70b4ed3d7b..d852b7960c 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.truth truth - 1.3.0 + 1.4.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 917e48741f..af05d99d39 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.3.0 + 1.4.0 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e1e6ad55ed..a8872d9ce0 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.3.0 + 1.4.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2d22c8ec18..51fef3507b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.3.0 + 1.4.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0c52314066..bdd619a7bf 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.3.0 + 1.4.0 test From 3abdc70890c3f5c396055d7d34fc4fe18aef7371 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 Feb 2024 17:00:08 +0100 Subject: [PATCH 1561/2268] deps: update actions/upload-artifact action to v4.3.1 (#3121) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6aa911edf6..4486769288 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: SARIF file path: results.sarif From 2156f023b4ab95bc7ec669545b5709317555fdac Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:12:25 -0500 Subject: [PATCH 1562/2268] Feat: Add queryId to TableResult (#3106) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feat: Add queryId to TableResult * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Feat: Add queryId to TableResult * Feat: Add IT for TableResult with JobId and QueryId. * Feat: Add IT for TableResult with JobId and QueryId. --------- Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 13 ++++ .../google/cloud/bigquery/BigQueryImpl.java | 8 ++- .../cloud/bigquery/EmptyTableResult.java | 2 +- .../google/cloud/bigquery/TableResult.java | 19 +++++- .../com/google/cloud/bigquery/JobTest.java | 2 +- .../cloud/bigquery/SerializationTest.java | 2 +- .../cloud/bigquery/TableResultTest.java | 4 +- .../com/google/cloud/bigquery/TableTest.java | 9 +-- .../cloud/bigquery/it/ITBigQueryTest.java | 59 ++++++++++++++++--- 9 files changed, 95 insertions(+), 23 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 9c69fd6a68..75441b537c 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -14,6 +14,19 @@ com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method + + 7004 + com/google/cloud/bigquery/TableResult* + *TableResult(*) + It should be fine to update TableResult constructors since it is used to return results to the user and users should not directly construct TableResult objects + + + 7005 + com/google/cloud/bigquery/TableResult* + *TableResult(*) + *TableResult(*) + It should be fine to update TableResult constructors since it is used to return results to the user and users should not directly construct TableResult objects + 7013 com/google/cloud/bigquery/ExternalTableDefinition* diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index dcbcd19b04..30fd24f931 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1156,7 +1156,7 @@ public TableResult listTableData( public TableResult listTableData(TableId tableId, Schema schema, TableDataListOption... options) { Tuple, Long> data = listTableData(tableId, schema, getOptions(), optionMap(options)); - return new TableResult(schema, data.y(), data.x()); + return new TableResult(schema, data.y(), data.x(), null); } private static Tuple, Long> listTableData( @@ -1410,7 +1410,8 @@ public com.google.api.services.bigquery.model.QueryResponse call() { // cache first page of result transformTableData(results.getRows(), schema)), // Return the JobID of the successful job - jobId); + jobId, + results.getQueryId()); } // only 1 page of result return new TableResult( @@ -1421,7 +1422,8 @@ public com.google.api.services.bigquery.model.QueryResponse call() { null, transformTableData(results.getRows(), schema)), // Return the JobID of the successful job - results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null); + results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null, + results.getQueryId()); } @Override diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java index 7cb5e1932f..a5c6c47857 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java @@ -27,6 +27,6 @@ public class EmptyTableResult extends TableResult { /** An empty {@code TableResult} to avoid making API requests to unlistable tables. */ @InternalApi("Exposed for testing") public EmptyTableResult(@Nullable Schema schema) { - super(schema, 0, new PageImpl(null, "", null)); + super(schema, 0, new PageImpl(null, "", null), null); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 325e1fd0bd..1631d3bd5c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -37,6 +37,8 @@ public class TableResult implements Page, Serializable { private final Page pageNoSchema; @Nullable private JobId jobId = null; + @Nullable private final String queryId; + // package-private so job id is not set outside the package. void setJobId(@Nullable JobId jobId) { this.jobId = jobId; @@ -46,24 +48,35 @@ public JobId getJobId() { return jobId; } + public String getQueryId() { + return queryId; + } + /** * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s * when iterating through them. {@code pageNoSchema} must not be null. */ @InternalApi("Exposed for testing") - public TableResult(Schema schema, long totalRows, Page pageNoSchema) { + public TableResult( + Schema schema, long totalRows, Page pageNoSchema, String queryId) { this.schema = schema; this.totalRows = totalRows; this.pageNoSchema = checkNotNull(pageNoSchema); + this.queryId = queryId; } @InternalApi("Exposed for testing") public TableResult( - Schema schema, long totalRows, Page pageNoSchema, JobId jobId) { + Schema schema, + long totalRows, + Page pageNoSchema, + JobId jobId, + String queryId) { this.schema = schema; this.totalRows = totalRows; this.pageNoSchema = checkNotNull(pageNoSchema); this.jobId = jobId; + this.queryId = queryId; } /** Returns the schema of the results. Null if the schema is not supplied. */ @@ -92,7 +105,7 @@ public String getNextPageToken() { @Override public TableResult getNextPage() { if (pageNoSchema.hasNextPage()) { - return new TableResult(schema, totalRows, pageNoSchema.getNextPage()); + return new TableResult(schema, totalRows, pageNoSchema.getNextPage(), queryId); } return null; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index b4b17b7d96..08c4137d69 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -309,7 +309,7 @@ public void testWaitForAndGetQueryResults() throws InterruptedException { Job completedJob = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); Page singlePage = Pages.empty(); - TableResult result = new TableResult(Schema.of(), 1, singlePage); + TableResult result = new TableResult(Schema.of(), 1, singlePage, null); QueryResponse completedQuery = QueryResponse.newBuilder() .setCompleted(true) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java index 0b0cd0207a..d31b282e72 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java @@ -206,7 +206,7 @@ public class SerializationTest extends BaseSerializationTest { private static final FieldValue FIELD_VALUE = FieldValue.of(FieldValue.Attribute.PRIMITIVE, "value"); private static final TableResult TABLE_RESULT = - new TableResult(Schema.of(), 0L, new PageImpl(null, "", ImmutableList.of())); + new TableResult(Schema.of(), 0L, new PageImpl(null, "", ImmutableList.of()), null); private static final BigQuery BIGQUERY = BigQueryOptions.newBuilder().setProjectId("p1").build().getService(); private static final Dataset DATASET = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java index 35a167af12..89b7d68371 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java @@ -53,7 +53,7 @@ private static FieldValueList newFieldValueList(String s) { @Test public void testNullSchema() { - TableResult result = new TableResult(null, 3, INNER_PAGE_0); + TableResult result = new TableResult(null, 3, INNER_PAGE_0, null); assertThat(result.getSchema()).isNull(); assertThat(result.hasNextPage()).isTrue(); assertThat(result.getNextPageToken()).isNotNull(); @@ -75,7 +75,7 @@ public void testNullSchema() { @Test public void testSchema() { - TableResult result = new TableResult(SCHEMA, 3, INNER_PAGE_0); + TableResult result = new TableResult(SCHEMA, 3, INNER_PAGE_0, null); assertThat(result.getSchema()).isEqualTo(SCHEMA); assertThat(result.hasNextPage()).isTrue(); assertThat(result.getNextPageToken()).isNotNull(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java index b93ed770b8..9aa1953314 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java @@ -248,9 +248,10 @@ public void testInsertComplete() { @Test public void testList() { Page page = new PageImpl<>(null, "c", ROWS); - when(bigquery.listTableData(TABLE_ID1)).thenReturn(new TableResult(null, ROWS.size(), page)); + when(bigquery.listTableData(TABLE_ID1)) + .thenReturn(new TableResult(null, ROWS.size(), page, null)); when(bigquery.listTableData(TABLE_ID1, SCHEMA)) - .thenReturn(new TableResult(SCHEMA, ROWS.size(), page)); + .thenReturn(new TableResult(SCHEMA, ROWS.size(), page, null)); Page dataPage = table.list(); assertThat(dataPage.getValues()).containsExactlyElementsIn(ROWS).inOrder(); dataPage = table.list(SCHEMA); @@ -263,9 +264,9 @@ public void testList() { public void testListWithOptions() { Page page = new PageImpl<>(null, "c", ROWS); when(bigquery.listTableData(TABLE_ID1, BigQuery.TableDataListOption.pageSize(10L))) - .thenReturn(new TableResult(null, ROWS.size(), page)); + .thenReturn(new TableResult(null, ROWS.size(), page, null)); when(bigquery.listTableData(TABLE_ID1, SCHEMA, BigQuery.TableDataListOption.pageSize(10L))) - .thenReturn(new TableResult(SCHEMA, ROWS.size(), page)); + .thenReturn(new TableResult(SCHEMA, ROWS.size(), page, null)); Page dataPage = table.list(BigQuery.TableDataListOption.pageSize(10L)); assertThat(dataPage.getValues()).containsExactlyElementsIn(ROWS).inOrder(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ba30ea0d43..8b5a45913f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6312,21 +6312,29 @@ public void testStatelessQueries() throws InterruptedException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQuery bigQuery = bigqueryHelper.getOptions().getService(); - // simulate setting the QUERY_PREVIEW_ENABLED environment variable + // Simulate setting the QUERY_PREVIEW_ENABLED environment variable. bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); - assertNull(executeSimpleQuery(bigQuery).getJobId()); + TableResult tableResult = executeSimpleQuery(bigQuery); + assertNotNull(tableResult.getQueryId()); + assertNull(tableResult.getJobId()); - // the flag should be case-insensitive + // The flag should be case-insensitive. bigQuery.getOptions().setQueryPreviewEnabled("tRuE"); - assertNull(executeSimpleQuery(bigQuery).getJobId()); + tableResult = executeSimpleQuery(bigQuery); + assertNotNull(tableResult.getQueryId()); + assertNull(tableResult.getJobId()); - // any other values won't enable optional job creation mode + // Any other values won't enable optional job creation mode. bigQuery.getOptions().setQueryPreviewEnabled("test_value"); - assertNotNull(executeSimpleQuery(bigQuery).getJobId()); + tableResult = executeSimpleQuery(bigQuery); + assertNotNull(tableResult.getQueryId()); + assertNotNull(tableResult.getJobId()); - // reset the flag + // Reset the flag. bigQuery.getOptions().setQueryPreviewEnabled(null); - assertNotNull(executeSimpleQuery(bigQuery).getJobId()); + tableResult = executeSimpleQuery(bigQuery); + assertNotNull(tableResult.getQueryId()); + assertNotNull(tableResult.getJobId()); } private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedException { @@ -6336,6 +6344,41 @@ private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedExce return result; } + @Test + public void testTableResultJobIdAndQueryId() throws InterruptedException { + // For stateless queries, jobId and queryId are populated based on the following criteria: + // 1. For stateless queries, then queryId is populated. + // 2. For queries that fails the requirements to be stateless, then jobId is populated and + // queryId is not. + // 3. For explicitly created jobs, then jobId is populated and queryId is not populated. + + // Test scenario 1. + // Create local BigQuery for test scenario 1 to not contaminate global test parameters. + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQuery bigQuery = bigqueryHelper.getOptions().getService(); + // Simulate setting the QUERY_PREVIEW_ENABLED environment variable. + bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + String query = "SELECT 1 as one"; + QueryJobConfiguration configStateless = QueryJobConfiguration.newBuilder(query).build(); + TableResult result = bigQuery.query(configStateless); + assertNull(result.getJobId()); + assertNotNull(result.getQueryId()); + + // Test scenario 2 by failing stateless check by setting job timeout. + QueryJobConfiguration configQueryWithJob = + QueryJobConfiguration.newBuilder(query).setJobTimeoutMs(1L).build(); + result = bigQuery.query(configQueryWithJob); + assertNotNull(result.getJobId()); + assertNull(result.getQueryId()); + + // Test scenario 3. + QueryJobConfiguration configWithJob = QueryJobConfiguration.newBuilder(query).build(); + Job job = bigQuery.create(JobInfo.of(JobId.of(), configWithJob)); + result = job.getQueryResults(); + assertNotNull(result.getJobId()); + assertNull(result.getQueryId()); + } + @Test public void testStatelessQueriesWithLocation() throws Exception { // This test validates BigQueryOption location is used for stateless query by verifying that the From 5a82c854b6549c82c905eba4905378b59cc88af4 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:16:09 -0500 Subject: [PATCH 1563/2268] Feat: Update universe domain exception error code/message (#3113) * Feat: Update universe domain exception error code/message * Feat: Update universe domain exception error code/message --- google-cloud-bigquery/pom.xml | 4 ++++ .../cloud/bigquery/spi/v2/HttpBigQueryRpc.java | 7 ++++++- .../google/cloud/bigquery/it/ITBigQueryTest.java | 13 +++++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7ce9e586ab..2bd74f8d34 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -50,6 +50,10 @@ org.checkerframework checker-qual + + com.google.auth + google-auth-library-credentials + com.google.auth google-auth-library-oauth2-http diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 841a790ee6..dca129bfb5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -19,6 +19,7 @@ import static java.net.HttpURLConnection.HTTP_CREATED; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import static java.net.HttpURLConnection.HTTP_OK; +import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; import com.google.api.client.http.ByteArrayContent; import com.google.api.client.http.GenericUrl; @@ -116,7 +117,11 @@ private static BigQueryException translate(IOException exception) { private void validateRPC() throws BigQueryException, IOException { if (!this.options.hasValidUniverseDomain()) { - throw new BigQueryException(BigQueryException.UNKNOWN_CODE, "Invalid universe domain"); + String errorMessage = + String.format( + "The configured universe domain %s does not match the universe domain found in the credentials %s. If you haven't configured the universe domain explicitly, `googleapis.com` is the default.", + this.options.getUniverseDomain(), this.options.getCredentials().getUniverseDomain()); + throw new BigQueryException(HTTP_UNAUTHORIZED, errorMessage); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 8b5a45913f..7652e65a58 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -19,6 +19,7 @@ import static com.google.cloud.bigquery.JobStatus.State.DONE; import static com.google.common.truth.Truth.assertThat; import static java.lang.System.currentTimeMillis; +import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -6445,8 +6446,12 @@ public void testUniverseDomainWithInvalidUniverseDomain() { bigQuery.listDatasets("bigquery-public-data"); fail("RPCs to invalid universe domain should fail"); } catch (BigQueryException e) { + assertEquals(e.getCode(), HTTP_UNAUTHORIZED); assertNotNull(e.getMessage()); - assertThat((e.getMessage().contains("Invalid universe domain"))).isTrue(); + assertThat( + (e.getMessage() + .contains("does not match the universe domain found in the credentials"))) + .isTrue(); } } @@ -6466,8 +6471,12 @@ public void testInvalidUniverseDomainWithMismatchCredentials() { bigQuery.listDatasets("bigquery-public-data"); fail("RPCs to invalid universe domain should fail"); } catch (BigQueryException e) { + assertEquals(e.getCode(), HTTP_UNAUTHORIZED); assertNotNull(e.getMessage()); - assertThat((e.getMessage().contains("Invalid universe domain"))).isTrue(); + assertThat( + (e.getMessage() + .contains("does not match the universe domain found in the credentials"))) + .isTrue(); } } From 36f9ebac25e2ccff9267603ea16d115ba5ce7976 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 07:24:15 -0500 Subject: [PATCH 1564/2268] chore(main): release 2.37.1 (#3116) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 27 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea4a0271a3..1a961cc3fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.37.1](https://github.com/googleapis/java-bigquery/compare/v2.37.0...v2.37.1) (2024-02-06) + + +### Features + +* Add queryId to TableResult ([#3106](https://github.com/googleapis/java-bigquery/issues/3106)) ([2156f02](https://github.com/googleapis/java-bigquery/commit/2156f023b4ab95bc7ec669545b5709317555fdac)) +* Update universe domain exception error code/message ([#3113](https://github.com/googleapis/java-bigquery/issues/3113)) ([5a82c85](https://github.com/googleapis/java-bigquery/commit/5a82c854b6549c82c905eba4905378b59cc88af4)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.3.1 ([#3121](https://github.com/googleapis/java-bigquery/issues/3121)) ([3abdc70](https://github.com/googleapis/java-bigquery/commit/3abdc70890c3f5c396055d7d34fc4fe18aef7371)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240124-2.0.0 ([#3104](https://github.com/googleapis/java-bigquery/issues/3104)) ([6eff68e](https://github.com/googleapis/java-bigquery/commit/6eff68eb8c55162ca1cd2e915f3f60a87f584b35)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.24.0 ([#3109](https://github.com/googleapis/java-bigquery/issues/3109)) ([5ad778c](https://github.com/googleapis/java-bigquery/commit/5ad778c18130c33e7532d0bd3193053518ca047a)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.0 ([#3110](https://github.com/googleapis/java-bigquery/issues/3110)) ([3f8e8d1](https://github.com/googleapis/java-bigquery/commit/3f8e8d1f9477aed3a14bccf021d7ff982463022c)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.0 ([#3111](https://github.com/googleapis/java-bigquery/issues/3111)) ([2858e96](https://github.com/googleapis/java-bigquery/commit/2858e96807190d995d9d682e056d90821da11b7a)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.2 ([#3119](https://github.com/googleapis/java-bigquery/issues/3119)) ([4b4fdd8](https://github.com/googleapis/java-bigquery/commit/4b4fdd8ebc324d2bc48a9f78347247f4f6c2e424)) +* Update github/codeql-action action to v2.23.2 ([#3102](https://github.com/googleapis/java-bigquery/issues/3102)) ([2cc545e](https://github.com/googleapis/java-bigquery/commit/2cc545ec1c0267fd9c33f3f1566f29d9a30f514e)) +* Update github/codeql-action action to v2.24.0 ([#3114](https://github.com/googleapis/java-bigquery/issues/3114)) ([01f0405](https://github.com/googleapis/java-bigquery/commit/01f04059ab119da759536426938c1069906c8be4)) + ## [2.37.0](https://github.com/googleapis/java-bigquery/compare/v2.36.0...v2.37.0) (2024-01-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dbe4021012..1cd278cec4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.1-SNAPSHOT + 2.37.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2bd74f8d34..27294847af 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.1-SNAPSHOT + 2.37.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.1-SNAPSHOT + 2.37.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d852b7960c..22b2ce9276 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.1-SNAPSHOT + 2.37.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.37.1-SNAPSHOT + 2.37.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 51fef3507b..46a3041c27 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.1-SNAPSHOT + 2.37.1 diff --git a/versions.txt b/versions.txt index 7bb7cb270d..0eda018543 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.0:2.37.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.37.1:2.37.1 \ No newline at end of file From 88bdbe5d02ce8cfc79045042c4d1ba77664fbd59 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:31:31 -0500 Subject: [PATCH 1565/2268] chore(main): release 2.37.2-SNAPSHOT (#3122) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1cd278cec4..62b803d038 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.1 + 2.37.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 27294847af..fe6b2d7868 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.1 + 2.37.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.1 + 2.37.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 22b2ce9276..63c7377a96 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.1 + 2.37.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.37.1 + 2.37.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 46a3041c27..18f2ad1c9c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.1 + 2.37.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0eda018543..760c94f7dd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.1:2.37.1 \ No newline at end of file +google-cloud-bigquery:2.37.1:2.37.2-SNAPSHOT \ No newline at end of file From 74b8989739c653fdbd61599d9af4d566fc38be44 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 8 Feb 2024 16:50:39 +0100 Subject: [PATCH 1566/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.33.0 (#3124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-storage to v2.33.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4705d64a03..f26b3e5899 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.37.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.37.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/pom.xml b/pom.xml index 63c7377a96..a8e8c64cf4 100644 --- a/pom.xml +++ b/pom.xml @@ -155,7 +155,7 @@ com.google.cloud google-cloud-storage - 2.32.1 + 2.33.0 test From 2276faa8cab91f3629edeb8b0eb459c7860a5438 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 8 Feb 2024 17:14:15 +0100 Subject: [PATCH 1567/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.37.1 (#3123) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.37.0` -> `2.37.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.37.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.37.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.37.0/2.37.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.37.0/2.37.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.37.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2371-2024-02-06) [Compare Source](https://togithub.com/googleapis/java-bigquery/compare/v2.37.0...v2.37.1) ##### Features - Add queryId to TableResult ([#​3106](https://togithub.com/googleapis/java-bigquery/issues/3106)) ([2156f02](https://togithub.com/googleapis/java-bigquery/commit/2156f023b4ab95bc7ec669545b5709317555fdac)) - Update universe domain exception error code/message ([#​3113](https://togithub.com/googleapis/java-bigquery/issues/3113)) ([5a82c85](https://togithub.com/googleapis/java-bigquery/commit/5a82c854b6549c82c905eba4905378b59cc88af4)) ##### Dependencies - Update actions/upload-artifact action to v4.3.1 ([#​3121](https://togithub.com/googleapis/java-bigquery/issues/3121)) ([3abdc70](https://togithub.com/googleapis/java-bigquery/commit/3abdc70890c3f5c396055d7d34fc4fe18aef7371)) - Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240124-2.0.0 ([#​3104](https://togithub.com/googleapis/java-bigquery/issues/3104)) ([6eff68e](https://togithub.com/googleapis/java-bigquery/commit/6eff68eb8c55162ca1cd2e915f3f60a87f584b35)) - Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.24.0 ([#​3109](https://togithub.com/googleapis/java-bigquery/issues/3109)) ([5ad778c](https://togithub.com/googleapis/java-bigquery/commit/5ad778c18130c33e7532d0bd3193053518ca047a)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.0 ([#​3110](https://togithub.com/googleapis/java-bigquery/issues/3110)) ([3f8e8d1](https://togithub.com/googleapis/java-bigquery/commit/3f8e8d1f9477aed3a14bccf021d7ff982463022c)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.0 ([#​3111](https://togithub.com/googleapis/java-bigquery/issues/3111)) ([2858e96](https://togithub.com/googleapis/java-bigquery/commit/2858e96807190d995d9d682e056d90821da11b7a)) - Update dependency org.junit.vintage:junit-vintage-engine to v5.10.2 ([#​3119](https://togithub.com/googleapis/java-bigquery/issues/3119)) ([4b4fdd8](https://togithub.com/googleapis/java-bigquery/commit/4b4fdd8ebc324d2bc48a9f78347247f4f6c2e424)) - Update github/codeql-action action to v2.23.2 ([#​3102](https://togithub.com/googleapis/java-bigquery/issues/3102)) ([2cc545e](https://togithub.com/googleapis/java-bigquery/commit/2cc545ec1c0267fd9c33f3f1566f29d9a30f514e)) - Update github/codeql-action action to v2.24.0 ([#​3114](https://togithub.com/googleapis/java-bigquery/issues/3114)) ([01f0405](https://togithub.com/googleapis/java-bigquery/commit/01f04059ab119da759536426938c1069906c8be4))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f26b3e5899..5be562a383 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index af05d99d39..feb865daa4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.1 From 5e2841988b223bc8ac775ed2b4d38e2c26b2815b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 9 Feb 2024 13:29:43 +0100 Subject: [PATCH 1568/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240203-2.0.0 (#3126) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8e8c64cf4..90f4785e7b 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240124-2.0.0 + v2-rev20240203-2.0.0 3.24.0 15.0.0
    From e3d32269a73c32de6f13fc9e753e741a9aa49dba Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Feb 2024 13:36:30 +0100 Subject: [PATCH 1569/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.37.0 (#3131) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 90f4785e7b..deb304c636 100644 --- a/pom.xml +++ b/pom.xml @@ -161,7 +161,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.36.0 + 2.37.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index feb865daa4..fdc172e59d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.36.0 + 2.37.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 18f2ad1c9c..e8b82cc041 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.36.0 + 2.37.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bdd619a7bf..6471a600c7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.36.0 + 2.37.0 test From 9ab79ec14d661e79f152568ff667bef3482315e0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Feb 2024 13:46:47 +0100 Subject: [PATCH 1570/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.41.0 (#3135) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index deb304c636..7060a1bfa1 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.40.0 + 1.41.0 pom import From 3a1efc2ede4eb1de5e3cf7703dc6bdef51b263f1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Feb 2024 19:51:18 +0100 Subject: [PATCH 1571/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.37.0 (#3132) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7060a1bfa1..fa70c5d635 100644 --- a/pom.xml +++ b/pom.xml @@ -167,7 +167,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.36.0 + 2.37.0 test From e57d6290494748c343c5bb1be750c7444bad1543 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Feb 2024 14:22:01 +0100 Subject: [PATCH 1572/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.33.0 (#3136) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fdc172e59d..89b2df133c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.32.0 + 2.33.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e8b82cc041..7fdcb6c73e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.32.0 + 2.33.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6471a600c7..722f3660ad 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.32.0 + 2.33.0 test From 4b3a42991836c3bb23972616cb4d20756dc83488 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Feb 2024 18:50:06 +0100 Subject: [PATCH 1573/2268] deps: update github/codeql-action action to v2.24.1 (#3139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.24.1 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4486769288..6987a764b7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@dc021d495cb77b369e4d9d04a501700fd83b8c51 # v2.24.0 + uses: github/codeql-action/upload-sarif@1a077f8f6c71a45340c26ca0b877e00459e5f443 # v2.24.1 with: sarif_file: results.sarif diff --git a/README.md b/README.md index 5be562a383..75a55d7837 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.31.0') +implementation platform('com.google.cloud:libraries-bom:26.32.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From e61a7bc5735822308db3baab327474b6319e4d93 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 14 Feb 2024 16:19:51 +0100 Subject: [PATCH 1574/2268] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.25.0 (#3140) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa70c5d635..69e133554f 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20240203-2.0.0 - 3.24.0 + 3.25.0 15.0.0
    From 386cd28b172f3a92c7af5dead8713301abea7026 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Wed, 14 Feb 2024 13:34:32 -0500 Subject: [PATCH 1575/2268] chore: adding google-cloud-bigquery-bom (#3137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: adding google-cloud-bigquery-bom * 🦉 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 --- google-cloud-bigquery-bom/pom.xml | 83 +++++++++++++++++++++++++++++++ pom.xml | 1 + 2 files changed, 84 insertions(+) create mode 100644 google-cloud-bigquery-bom/pom.xml diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml new file mode 100644 index 0000000000..5e41fa1784 --- /dev/null +++ b/google-cloud-bigquery-bom/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + google-cloud-bigquery-bom + 2.37.0 + pom + + com.google.cloud + google-cloud-shared-config + 1.7.1 + + + + Google Cloud BigQuery BOM + https://github.com/googleapis/java-bigquery + + BOM for Google Cloud BigQuery + + + + Google LLC + + + + + suztomo + Tomo Suzuki + suztomo@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-bigquery.git + scm:git:git@github.com:googleapis/java-bigquery.git + https://github.com/googleapis/java-bigquery + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-bigquery + 2.37.0 + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + org.apache.maven.plugins + maven-site-plugin + + + false + + + + + diff --git a/pom.xml b/pom.xml index 69e133554f..530ffe70e4 100644 --- a/pom.xml +++ b/pom.xml @@ -175,6 +175,7 @@ google-cloud-bigquery + google-cloud-bigquery-bom From 35490371f26fdac94a38ccd38a5b9f3c423b5175 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:54:09 -0500 Subject: [PATCH 1576/2268] chore(main): release 2.37.2 (#3127) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 11 +++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a961cc3fe..d543ab3d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.37.2](https://github.com/googleapis/java-bigquery/compare/v2.37.1...v2.37.2) (2024-02-14) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.37.0 ([#3132](https://github.com/googleapis/java-bigquery/issues/3132)) ([3a1efc2](https://github.com/googleapis/java-bigquery/commit/3a1efc2ede4eb1de5e3cf7703dc6bdef51b263f1)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240203-2.0.0 ([#3126](https://github.com/googleapis/java-bigquery/issues/3126)) ([5e28419](https://github.com/googleapis/java-bigquery/commit/5e2841988b223bc8ac775ed2b4d38e2c26b2815b)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.41.0 ([#3135](https://github.com/googleapis/java-bigquery/issues/3135)) ([9ab79ec](https://github.com/googleapis/java-bigquery/commit/9ab79ec14d661e79f152568ff667bef3482315e0)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.25.0 ([#3140](https://github.com/googleapis/java-bigquery/issues/3140)) ([e61a7bc](https://github.com/googleapis/java-bigquery/commit/e61a7bc5735822308db3baab327474b6319e4d93)) +* Update github/codeql-action action to v2.24.1 ([#3139](https://github.com/googleapis/java-bigquery/issues/3139)) ([4b3a429](https://github.com/googleapis/java-bigquery/commit/4b3a42991836c3bb23972616cb4d20756dc83488)) + ## [2.37.1](https://github.com/googleapis/java-bigquery/compare/v2.37.0...v2.37.1) (2024-02-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 62b803d038..8a8a2fecd0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.2-SNAPSHOT + 2.37.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index fe6b2d7868..f29852bd40 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.2-SNAPSHOT + 2.37.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.2-SNAPSHOT + 2.37.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 530ffe70e4..2c7fbe9e9b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.2-SNAPSHOT + 2.37.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -111,7 +111,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2-SNAPSHOT + 2.37.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7fdcb6c73e..65a20714c9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2-SNAPSHOT + 2.37.2 diff --git a/versions.txt b/versions.txt index 760c94f7dd..6f4cd476e0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.1:2.37.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.37.2:2.37.2 \ No newline at end of file From e1947c15e081ab69edd1e348217ffdb8d1cea816 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:30:10 +0000 Subject: [PATCH 1577/2268] chore: use sdk-platform-java-config to consolidate build configs (#3144) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use sdk-platform-java-config to consolidate build configs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * exclude .kokoro/presubmit from owlbot --------- Co-authored-by: Owl Bot --- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- owlbot.py | 2 ++ pom.xml | 7 +++---- renovate.json | 12 ++++++++++++ 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 9eea05bada..28a65e0fea 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.25.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 5150fb2924..d9c57fee12 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.25.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index fb5bb678ff..890878fef0 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.25.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 59efee340c..8e8cded782 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.25.0" } env_vars: { diff --git a/owlbot.py b/owlbot.py index 490004d0bd..a2540ce52e 100644 --- a/owlbot.py +++ b/owlbot.py @@ -20,6 +20,8 @@ '.kokoro/nightly/samples.cfg', '.kokoro/nightly/integration.cfg', '.kokoro/presubmit/samples.cfg', + '.kokoro/presubmit/graalvm-native.cfg', + '.kokoro/presubmit/graalvm-native-17.cfg', 'codecov.yaml', 'renovate.json', '.kokoro/build.sh' diff --git a/pom.xml b/pom.xml index 2c7fbe9e9b..5ef5db6733 100644 --- a/pom.xml +++ b/pom.xml @@ -13,8 +13,8 @@ com.google.cloud - google-cloud-shared-config - 1.7.1 + sdk-platform-java-config + 3.25.0 @@ -55,7 +55,6 @@ github google-cloud-bigquery-parent v2-rev20240203-2.0.0 - 3.25.0 15.0.0 @@ -64,7 +63,7 @@ com.google.cloud google-cloud-shared-dependencies - ${google.cloud.shared-dependencies.version} + ${google-cloud-shared-dependencies.version} pom import diff --git a/renovate.json b/renovate.json index 274ec500cd..0b609db9a1 100644 --- a/renovate.json +++ b/renovate.json @@ -11,6 +11,18 @@ ":autodetectPinVersions" ], "ignorePaths": [".kokoro/requirements.txt"], + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + "^.kokoro/continuous/graalvm-native.*.cfg$", + "^.kokoro/presubmit/graalvm-native.*.cfg$" + ], + "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], + "depNameTemplate": "com.google.cloud:sdk-platform-java-config", + "datasourceTemplate": "maven" + } + ], "packageRules": [ { "packagePatterns": [ From f3f387b2265d527f3b5bf567c1eaf7ecdad6e096 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 14 Feb 2024 16:17:23 -0500 Subject: [PATCH 1578/2268] feat: add MetadataCacheStatistics to Job QueryStatistics (#3133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feat: Add MetadataCacheStatistics to Job QueryStatistics * Add integration test * Add integration test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update documentation. * 🦉 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 --- README.md | 6 +- .../google/cloud/bigquery/JobStatistics.java | 23 ++++ .../cloud/bigquery/MetadataCacheStats.java | 76 +++++++++++ .../bigquery/TableMetadataCacheUsage.java | 118 ++++++++++++++++++ .../src/test/java/MetadataCacheStatsTest.java | 60 +++++++++ .../cloud/bigquery/JobStatisticsTest.java | 11 ++ .../bigquery/TableMetadataCacheUsageTest.java | 70 +++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 42 +++++++ 8 files changed, 403 insertions(+), 3 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MetadataCacheStats.java create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableMetadataCacheUsage.java create mode 100644 google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java diff --git a/README.md b/README.md index 75a55d7837..f1ebabf706 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.37.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.37.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 1cbf22fa79..5979afbca7 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -358,6 +358,7 @@ public static class QueryStatistics extends JobStatistics { private final List timeline; private final Schema schema; private final SearchStats searchStats; + private final MetadataCacheStats metadataCacheStats; private final List queryParameters; /** @@ -444,6 +445,8 @@ static final class Builder extends JobStatistics.Builder queryParameters; private SearchStats searchStats; + private MetadataCacheStats metadataCacheStats; + private Builder() {} private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsPb) { @@ -493,6 +496,10 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP if (statisticsPb.getQuery().getSearchStatistics() != null) { this.searchStats = SearchStats.fromPb(statisticsPb.getQuery().getSearchStatistics()); } + if (statisticsPb.getQuery().getMetadataCacheStatistics() != null) { + this.metadataCacheStats = + MetadataCacheStats.fromPb(statisticsPb.getQuery().getMetadataCacheStatistics()); + } if (statisticsPb.getQuery().getDmlStats() != null) { this.dmlStats = DmlStats.fromPb(statisticsPb.getQuery().getDmlStats()); } @@ -599,6 +606,11 @@ Builder setSearchStats(SearchStats searchStats) { return self(); } + Builder setMetadataCacheStats(MetadataCacheStats metadataCacheStats) { + this.metadataCacheStats = metadataCacheStats; + return self(); + } + Builder setQueryParameters(List queryParameters) { this.queryParameters = queryParameters; return self(); @@ -631,6 +643,7 @@ private QueryStatistics(Builder builder) { this.timeline = builder.timeline; this.schema = builder.schema; this.searchStats = builder.searchStats; + this.metadataCacheStats = builder.metadataCacheStats; this.queryParameters = builder.queryParameters; } @@ -761,6 +774,11 @@ public SearchStats getSearchStats() { return searchStats; } + /** Statistics for metadata caching in BigLake tables. */ + public MetadataCacheStats getMetadataCacheStats() { + return metadataCacheStats; + } + /** * Standard SQL only: Returns a list of undeclared query parameters detected during a dry run * validation. @@ -781,6 +799,7 @@ ToStringHelper toStringHelper() { .add("timeline", timeline) .add("schema", schema) .add("searchStats", searchStats) + .add("metadataCacheStats", metadataCacheStats) .add("queryParameters", queryParameters); } @@ -804,6 +823,7 @@ public final int hashCode() { queryPlan, schema, searchStats, + metadataCacheStats, queryParameters); } @@ -849,6 +869,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (searchStats != null) { queryStatisticsPb.setSearchStatistics(searchStats.toPb()); } + if (metadataCacheStats != null) { + queryStatisticsPb.setMetadataCacheStatistics(metadataCacheStats.toPb()); + } if (queryParameters != null) { queryStatisticsPb.setUndeclaredQueryParameters(queryParameters); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MetadataCacheStats.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MetadataCacheStats.java new file mode 100644 index 0000000000..482571d5f0 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/MetadataCacheStats.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.api.services.bigquery.model.MetadataCacheStatistics; +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +/** + * Represents statistics for metadata caching in BigLake tables. + * + * @see BigLake Tables + */ +@AutoValue +public abstract class MetadataCacheStats implements Serializable { + + private static final long serialVersionUID = 1L; + + @AutoValue.Builder + public abstract static class Builder { + /** Sets the free form human-readable reason metadata caching was unused for the job. */ + public abstract MetadataCacheStats.Builder setTableMetadataCacheUsage( + List tableMetadataCacheUsage); + + /** Creates a @code MetadataCacheStats} object. */ + public abstract MetadataCacheStats build(); + } + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_MetadataCacheStats.Builder(); + } + + @Nullable + public abstract List getTableMetadataCacheUsage(); + + MetadataCacheStatistics toPb() { + MetadataCacheStatistics metadataCacheStatistics = new MetadataCacheStatistics(); + if (getTableMetadataCacheUsage() != null) { + metadataCacheStatistics.setTableMetadataCacheUsage( + getTableMetadataCacheUsage().stream() + .map(TableMetadataCacheUsage::toPb) + .collect(Collectors.toList())); + } + return metadataCacheStatistics; + } + + static MetadataCacheStats fromPb(MetadataCacheStatistics metadataCacheStatistics) { + Builder builder = newBuilder(); + if (metadataCacheStatistics.getTableMetadataCacheUsage() != null) { + builder.setTableMetadataCacheUsage( + metadataCacheStatistics.getTableMetadataCacheUsage().stream() + .map(TableMetadataCacheUsage::fromPb) + .collect(Collectors.toList())); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableMetadataCacheUsage.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableMetadataCacheUsage.java new file mode 100644 index 0000000000..89ad4f966d --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableMetadataCacheUsage.java @@ -0,0 +1,118 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; +import javax.annotation.Nullable; + +/** Represents Table level detail on the usage of metadata caching. */ +@AutoValue +public abstract class TableMetadataCacheUsage implements Serializable { + + private static final long serialVersionUID = 1L; + + /** Reason for not using metadata caching for the table. */ + public enum UnusedReason { + /** Unused reasons not specified. */ + UNUSED_REASON_UNSPECIFIED, + + /** Metadata cache was outside the table's maxStaleness. */ + EXCEEDED_MAX_STALENESS, + + /** + * Metadata caching feature is not enabled. Update BigLake tables to enable the metadata + * caching. + */ + METADATA_CACHING_NOT_ENABLED, + + /** Other unknown reason. */ + OTHER_REASON + } + + @AutoValue.Builder + public abstract static class Builder { + /** Sets the free form human-readable reason metadata caching was unused for the job. */ + public abstract TableMetadataCacheUsage.Builder setExplanation(String explanation); + + /** Sets the metadata caching eligible table referenced in the query. */ + public abstract TableMetadataCacheUsage.Builder setTableReference(TableId tableReference); + + /** Sets the table type. */ + public abstract TableMetadataCacheUsage.Builder setTableType(String tableType); + + /** Sets reason for not using metadata caching for the table. */ + public abstract TableMetadataCacheUsage.Builder setUnusedReason(UnusedReason unusedReason); + + /** Creates a @code TableMetadataCacheUsage} object. */ + public abstract TableMetadataCacheUsage build(); + } + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_TableMetadataCacheUsage.Builder(); + } + + @Nullable + public abstract String getExplanation(); + + @Nullable + public abstract TableId getTableReference(); + + @Nullable + public abstract String getTableType(); + + @Nullable + public abstract UnusedReason getUnusedReason(); + + com.google.api.services.bigquery.model.TableMetadataCacheUsage toPb() { + com.google.api.services.bigquery.model.TableMetadataCacheUsage tableMetadataCacheUsage = + new com.google.api.services.bigquery.model.TableMetadataCacheUsage(); + if (getExplanation() != null) { + tableMetadataCacheUsage.setExplanation(getExplanation()); + } + if (getTableReference() != null) { + tableMetadataCacheUsage.setTableReference(getTableReference().toPb()); + } + if (getTableType() != null) { + tableMetadataCacheUsage.setTableType(getTableType()); + } + if (getUnusedReason() != null) { + tableMetadataCacheUsage.setUnusedReason(getUnusedReason().toString()); + } + return tableMetadataCacheUsage; + } + + static TableMetadataCacheUsage fromPb( + com.google.api.services.bigquery.model.TableMetadataCacheUsage tableMetadataCacheUsage) { + Builder builder = newBuilder(); + if (tableMetadataCacheUsage.getExplanation() != null) { + builder.setExplanation(tableMetadataCacheUsage.getExplanation()); + } + if (tableMetadataCacheUsage.getTableReference() != null) { + builder.setTableReference(TableId.fromPb(tableMetadataCacheUsage.getTableReference())); + } + if (tableMetadataCacheUsage.getTableType() != null) { + builder.setTableType(tableMetadataCacheUsage.getTableType()); + } + if (tableMetadataCacheUsage.getUnusedReason() != null) { + builder.setUnusedReason(UnusedReason.valueOf(tableMetadataCacheUsage.getUnusedReason())); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java b/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java new file mode 100644 index 0000000000..d1cfa86e9e --- /dev/null +++ b/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java @@ -0,0 +1,60 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import com.google.api.services.bigquery.model.MetadataCacheStatistics; +import com.google.common.collect.ImmutableList; +import com.google.common.truth.Truth; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.Test; + +public class MetadataCacheStatsTest { + private static List + TABLE_METADATA_CACHE_USAGE_PB_LIST = + ImmutableList.of( + new com.google.api.services.bigquery.model.TableMetadataCacheUsage() + .setExplanation("test explanation")); + + private static final MetadataCacheStats METADATA_CACHE_STATS = + MetadataCacheStats.newBuilder() + .setTableMetadataCacheUsage( + TABLE_METADATA_CACHE_USAGE_PB_LIST.stream() + .map(TableMetadataCacheUsage::fromPb) + .collect(Collectors.toList())) + .build(); + + private static final MetadataCacheStatistics METADATA_CACHE_STATISTICS_PB = + new MetadataCacheStatistics().setTableMetadataCacheUsage(TABLE_METADATA_CACHE_USAGE_PB_LIST); + + @Test + public void testToPbAndFromPb() { + assertEquals(METADATA_CACHE_STATISTICS_PB, METADATA_CACHE_STATS.toPb()); + compareMetadataCacheStats( + METADATA_CACHE_STATS, MetadataCacheStats.fromPb(METADATA_CACHE_STATISTICS_PB)); + } + + private void compareMetadataCacheStats(MetadataCacheStats expected, MetadataCacheStats value) { + assertEquals(expected, value); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + Truth.assertThat( + expected.getTableMetadataCacheUsage().containsAll(value.getTableMetadataCacheUsage())); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index f32832b594..5502b84720 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -163,6 +163,14 @@ public class JobStatisticsTest { private static final String UNUSED_INDEX_USAGE_MODE = "UNUSED"; private static final SearchStats SEARCH_STATS = SearchStats.newBuilder().setIndexUsageMode(UNUSED_INDEX_USAGE_MODE).build(); + + private static final MetadataCacheStats METADATA_CACHE_STATS = + MetadataCacheStats.newBuilder() + .setTableMetadataCacheUsage( + ImmutableList.of( + TableMetadataCacheUsage.newBuilder().setExplanation("test explanation").build())) + .build(); + private static final QueryStatistics QUERY_STATISTICS = QueryStatistics.newBuilder() .setCreationTimestamp(CREATION_TIME) @@ -187,6 +195,7 @@ public class JobStatisticsTest { .setTimeline(TIMELINE) .setSchema(SCHEMA) .setSearchStats(SEARCH_STATS) + .setMetadataCacheStats(METADATA_CACHE_STATS) .build(); private static final QueryStatistics QUERY_STATISTICS_INCOMPLETE = QueryStatistics.newBuilder() @@ -196,6 +205,7 @@ public class JobStatisticsTest { .setBillingTier(BILLING_TIER) .setCacheHit(CACHE_HIT) .setSearchStats(SEARCH_STATS) + .setMetadataCacheStats(METADATA_CACHE_STATS) .build(); private static final ScriptStackFrame STATEMENT_STACK_FRAME = ScriptStackFrame.newBuilder() @@ -417,6 +427,7 @@ private void compareQueryStatistics(QueryStatistics expected, QueryStatistics va assertEquals(expected.getSchema(), value.getSchema()); assertEquals( expected.getSearchStats().getIndexUsageMode(), value.getSearchStats().getIndexUsageMode()); + assertEquals(expected.getMetadataCacheStats(), value.getMetadataCacheStats()); assertEquals(expected.getStatementType(), value.getStatementType()); assertEquals(expected.getTimeline(), value.getTimeline()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java new file mode 100644 index 0000000000..8f141fa596 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; + +import com.google.api.services.bigquery.model.TableReference; +import com.google.cloud.bigquery.TableMetadataCacheUsage.UnusedReason; +import org.junit.Test; + +public class TableMetadataCacheUsageTest { + + private static final String EXPLANATION = "test explanation"; + + private static final String TABLE_TYPE = "test tableType"; + + private static final UnusedReason UNUSED_REASON = UnusedReason.UNUSED_REASON_UNSPECIFIED; + private static final TableReference TABLE_REFERENCE = + new TableReference() + .setTableId("test tableId") + .setProjectId("test projectId") + .setDatasetId("test dataset"); + private static final TableMetadataCacheUsage TABLE_METADATA_CACHE_USAGE = + TableMetadataCacheUsage.newBuilder() + .setExplanation(EXPLANATION) + .setTableType(TABLE_TYPE) + .setUnusedReason(UNUSED_REASON) + .setTableReference(TableId.fromPb(TABLE_REFERENCE)) + .build(); + + private static final com.google.api.services.bigquery.model.TableMetadataCacheUsage + TABLE_METADATA_CACHE_USAGE_PB = + new com.google.api.services.bigquery.model.TableMetadataCacheUsage() + .setTableReference(TABLE_REFERENCE) + .setExplanation(EXPLANATION) + .setTableType(TABLE_TYPE) + .setUnusedReason(UNUSED_REASON.toString()); + + @Test + public void testToPbAndFromPb() { + assertEquals(TABLE_METADATA_CACHE_USAGE_PB, TABLE_METADATA_CACHE_USAGE.toPb()); + compareTableMetadataCacheUsage( + TABLE_METADATA_CACHE_USAGE, TableMetadataCacheUsage.fromPb(TABLE_METADATA_CACHE_USAGE_PB)); + } + + private void compareTableMetadataCacheUsage( + TableMetadataCacheUsage expected, TableMetadataCacheUsage value) { + assertEquals(expected, value); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + assertEquals(expected.getExplanation(), value.getExplanation()); + assertEquals(expected.getTableType(), value.getTableType()); + assertEquals(expected.getUnusedReason(), value.getUnusedReason()); + assertEquals(expected.getTableReference(), value.getTableReference()); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 7652e65a58..3fd084a638 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -126,6 +126,7 @@ import com.google.cloud.bigquery.TableDefinition; import com.google.cloud.bigquery.TableId; import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.TableMetadataCacheUsage.UnusedReason; import com.google.cloud.bigquery.TableResult; import com.google.cloud.bigquery.TimePartitioning; import com.google.cloud.bigquery.TimePartitioning.Type; @@ -6500,6 +6501,47 @@ public void testUniverseDomainWithMatchingDomain() { } } + @Test + public void testExternalTableMetadataCachingNotEnable() throws InterruptedException { + String tableName = "test_metadata_cache_not_enable"; + TableId tableId = TableId.of(DATASET, tableName); + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.of( + "gs://" + BUCKET + "/" + JSON_LOAD_FILE, TABLE_SCHEMA, FormatOptions.json()); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof ExternalTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals(TABLE_SCHEMA, remoteTable.getDefinition().getSchema()); + + String query = String.format("SELECT * FROM %s.%s", DATASET, tableName); + QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); + + Job remoteJob = bigquery.create(JobInfo.of(config)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + + Job queryJob = bigquery.getJob(remoteJob.getJobId()); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + assertNotNull(statistics); + assertNotNull(statistics.getMetadataCacheStats()); + assertThat(statistics.getMetadataCacheStats().getTableMetadataCacheUsage().size()).isEqualTo(1); + assertThat( + statistics + .getMetadataCacheStats() + .getTableMetadataCacheUsage() + .get(0) + .getUnusedReason()) + .isEqualTo(UnusedReason.METADATA_CACHING_NOT_ENABLED); + + assertTrue(remoteTable.delete()); + } + static GoogleCredentials loadCredentials(String credentialFile) { try { InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); From b358bbcc047ad75b0847b7110920eccee490e17a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Feb 2024 02:30:48 +0100 Subject: [PATCH 1579/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.37.2 (#3143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.37.2 * 🦉 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 --- README.md | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1ebabf706..f32db6e661 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.37.1 + 2.37.2 ``` diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 5e41fa1784..6ccf7c9122 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.37.0 + 2.37.2
    diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 89b2df133c..981ef01899 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.37.1 + 2.37.2 From ea03dbabedf230db500ce8f6198dac40cc6dd94a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Feb 2024 19:05:18 +0100 Subject: [PATCH 1580/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.34.0 (#3146) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ef5db6733..b1c33425dd 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.33.0 + 2.34.0 test From a0a7b0186ae47fcfcf75fe4f35cce50044c6926c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Feb 2024 19:06:14 +0100 Subject: [PATCH 1581/2268] deps: update github/codeql-action action to v2.24.3 (#3148) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6987a764b7..d5706e48e8 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1a077f8f6c71a45340c26ca0b877e00459e5f443 # v2.24.1 + uses: github/codeql-action/upload-sarif@4a8f20f6b9b5114f354129a1e2f391d75bfd640a # v2.24.3 with: sarif_file: results.sarif From 042fcf0aca46d349103211c3d04ae4b49868933c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Feb 2024 19:11:12 +0100 Subject: [PATCH 1582/2268] deps: update github/codeql-action action to v2.24.3 (#3150) From 16eabce3e5bb561b7aa8b017be77631971b7170a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Feb 2024 17:34:25 +0100 Subject: [PATCH 1583/2268] test(deps): update dependency com.google.truth:truth to v1.4.1 (#3151) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index b1c33425dd..8e55f006f1 100644 --- a/pom.xml +++ b/pom.xml @@ -136,7 +136,7 @@ com.google.truth truth - 1.4.0 + 1.4.1 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 981ef01899..efd9e50c7e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.4.0 + 1.4.1 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index a8872d9ce0..054077ec37 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.4.0 + 1.4.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 65a20714c9..8a23b99ee1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.4.0 + 1.4.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 722f3660ad..d5510a7a25 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.4.0 + 1.4.1 test From c57748dedfeecabd33c32db06cad342dd5966380 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Feb 2024 17:35:31 +0100 Subject: [PATCH 1584/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.2.0 (#3149) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e55f006f1..ccfc85bbad 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.1.0 + 3.2.0 pom import From e5d688872e4c125a68ed6f666bffd0a41efc3f30 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Feb 2024 17:36:03 +0100 Subject: [PATCH 1585/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240211-2.0.0 (#3152) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ccfc85bbad..56e7303e88 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240203-2.0.0 + v2-rev20240211-2.0.0 15.0.0
    From 69db2535ce0fff3048e8cb3a4767d0ee3900b29c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Feb 2024 17:36:40 +0100 Subject: [PATCH 1586/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.2 (#3155) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8a8a2fecd0..af42c7446c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.5.2 package From 68046440b8b921e79b44150972e4b316984bf296 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:06:15 +0000 Subject: [PATCH 1587/2268] chore(main): release 2.37.3-SNAPSHOT (#3147) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index af42c7446c..3eca364f10 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.2 + 2.37.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 6ccf7c9122..8b18134261 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.37.0 + 2.37.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2 + 2.37.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f29852bd40..15be2ae8e3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.2 + 2.37.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.2 + 2.37.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 56e7303e88..88c5e1435c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.2 + 2.37.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2 + 2.37.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8a23b99ee1..f789501c93 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2 + 2.37.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 6f4cd476e0..f429a3ad8b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.2:2.37.2 \ No newline at end of file +google-cloud-bigquery:2.37.2:2.37.3-SNAPSHOT \ No newline at end of file From 678b6ce9e3b770193817d7c053bac6d5468364f5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Feb 2024 15:55:16 +0100 Subject: [PATCH 1588/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.38.0 (#3158) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.38.0 * 🦉 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 --- README.md | 2 +- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f32db6e661..977432d012 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.32.0') +implementation platform('com.google.cloud:libraries-bom:26.33.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 88c5e1435c..4fbdd82f62 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.37.0 + 2.38.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index efd9e50c7e..7352fd1a3d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.37.0 + 2.38.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f789501c93..bbf8c5c4a3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.37.0 + 2.38.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d5510a7a25..cb740eff44 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.37.0 + 2.38.0 test From 253f6c90f3f2b8a75405e132bf41001a2fdcd97b Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:12:26 -0500 Subject: [PATCH 1589/2268] chore: Refactor TableResult using builder pattern (#3130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Refactor TableResult using builder pattern This also removed the redundant EmptyTableResult. These changes are fine as TableResult and EmptyTableResult are internal API only. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Remove typo comment in TableResult * 🦉 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 --- .../clirr-ignored-differences.xml | 25 ++++ .../google/cloud/bigquery/BigQueryImpl.java | 51 ++++---- .../cloud/bigquery/EmptyTableResult.java | 32 ----- .../java/com/google/cloud/bigquery/Job.java | 14 +- .../google/cloud/bigquery/TableResult.java | 120 ++++++++---------- .../com/google/cloud/bigquery/JobTest.java | 7 +- .../cloud/bigquery/SerializationTest.java | 6 +- .../cloud/bigquery/TableResultTest.java | 10 +- .../com/google/cloud/bigquery/TableTest.java | 26 +++- 9 files changed, 159 insertions(+), 132 deletions(-) delete mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 75441b537c..abf827b48e 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -2,6 +2,17 @@ + + 3005 + com/google/cloud/bigquery/TableResult* + TableResult is an internal API and it should be fine to update + + + 7002 + com/google/cloud/bigquery/TableResult* + *TableResult(*) + TableResult is an internal API and it should be fine to update + 7004 com/google/cloud/bigquery/spi/v2/BigQueryRpc @@ -47,6 +58,16 @@ com/google/cloud/bigquery/TableInfo* *ResourceTags(*) + + 7013 + com/google/cloud/bigquery/TableResult* + *getPageNoSchema(*) + + + 7013 + com/google/cloud/bigquery/TableResult* + *toBuilder(*) + 7012 com/google/cloud/bigquery/Connection @@ -142,4 +163,8 @@ com/google/cloud/bigquery/StandardTableDefinition* *BigLakeConfiguration(*) + + 8001 + com/google/cloud/bigquery/EmptyTableResult* + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 30fd24f931..a0e61e23b0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1156,7 +1156,11 @@ public TableResult listTableData( public TableResult listTableData(TableId tableId, Schema schema, TableDataListOption... options) { Tuple, Long> data = listTableData(tableId, schema, getOptions(), optionMap(options)); - return new TableResult(schema, data.y(), data.x(), null); + return TableResult.newBuilder() + .setSchema(schema) + .setTotalRows(data.y()) + .setPageNoSchema(data.x()) + .build(); } private static Tuple, Long> listTableData( @@ -1400,30 +1404,33 @@ public com.google.api.services.bigquery.model.QueryResponse call() { if (results.getPageToken() != null) { JobId jobId = JobId.fromPb(results.getJobReference()); String cursor = results.getPageToken(); - return new TableResult( - schema, - numRows, - new PageImpl<>( - // fetch next pages of results - new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), - cursor, - // cache first page of result - transformTableData(results.getRows(), schema)), - // Return the JobID of the successful job - jobId, - results.getQueryId()); + return TableResult.newBuilder() + .setSchema(schema) + .setTotalRows(numRows) + .setPageNoSchema( + new PageImpl<>( + // fetch next pages of results + new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), + cursor, + transformTableData(results.getRows(), schema))) + .setJobId(jobId) + .setQueryId(results.getQueryId()) + .build(); } // only 1 page of result - return new TableResult( - schema, - numRows, - new PageImpl<>( - new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), - null, - transformTableData(results.getRows(), schema)), + return TableResult.newBuilder() + .setSchema(schema) + .setTotalRows(numRows) + .setPageNoSchema( + new PageImpl<>( + new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), + null, + transformTableData(results.getRows(), schema))) // Return the JobID of the successful job - results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null, - results.getQueryId()); + .setJobId( + results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) + .setQueryId(results.getQueryId()) + .build(); } @Override diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java deleted file mode 100644 index a5c6c47857..0000000000 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/EmptyTableResult.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2018 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.cloud.bigquery; - -import com.google.api.core.InternalApi; -import com.google.cloud.PageImpl; -import javax.annotation.Nullable; - -public class EmptyTableResult extends TableResult { - - private static final long serialVersionUID = -4831062717210349819L; - - /** An empty {@code TableResult} to avoid making API requests to unlistable tables. */ - @InternalApi("Exposed for testing") - public EmptyTableResult(@Nullable Schema schema) { - super(schema, 0, new PageImpl(null, "", null), null); - } -} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index db9b4b1736..d23e4ea52a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -21,6 +21,7 @@ import com.google.api.gax.retrying.BasicResultRetryAlgorithm; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.cloud.PageImpl; import com.google.cloud.RetryHelper; import com.google.cloud.RetryOption; import com.google.cloud.bigquery.BigQuery.JobOption; @@ -311,8 +312,13 @@ public TableResult getQueryResults(QueryResultsOption... options) // Listing table data might fail, such as with CREATE VIEW queries. // Avoid a tabledata.list API request by returning an empty TableResult. if (response.getTotalRows() == 0) { - TableResult emptyTableResult = new EmptyTableResult(response.getSchema()); - emptyTableResult.setJobId(job.getJobId()); + TableResult emptyTableResult = + TableResult.newBuilder() + .setSchema(response.getSchema()) + .setJobId(job.getJobId()) + .setTotalRows(0L) + .setPageNoSchema(new PageImpl(null, "", null)) + .build(); return emptyTableResult; } @@ -323,8 +329,8 @@ public TableResult getQueryResults(QueryResultsOption... options) TableResult tableResult = bigquery.listTableData( table, response.getSchema(), listOptions.toArray(new TableDataListOption[0])); - tableResult.setJobId(job.getJobId()); - return tableResult; + TableResult tableResultWithJobId = tableResult.toBuilder().setJobId(job.getJobId()).build(); + return tableResultWithJobId; } private QueryResponse waitForQueryResults( diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 1631d3bd5c..203a91faba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -16,10 +16,9 @@ package com.google.cloud.bigquery; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; +import com.google.auto.value.AutoValue; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.collect.Iterables; @@ -28,100 +27,87 @@ import java.util.Objects; import javax.annotation.Nullable; -public class TableResult implements Page, Serializable { +@InternalApi +@AutoValue +public abstract class TableResult implements Page, Serializable { - private static final long serialVersionUID = -4831062717210349819L; + private static final long serialVersionUID = 1L; - @Nullable private final Schema schema; - private final long totalRows; - private final Page pageNoSchema; - @Nullable private JobId jobId = null; + @AutoValue.Builder + public abstract static class Builder { + public abstract TableResult.Builder setSchema(Schema schema); - @Nullable private final String queryId; + /** + * Sets the total number of rows in the complete result set, which can be more than the number + * of rows in the first page of results returned by {@link #getValues()}. + */ + public abstract TableResult.Builder setTotalRows(Long totalRows); - // package-private so job id is not set outside the package. - void setJobId(@Nullable JobId jobId) { - this.jobId = jobId; - } + public abstract TableResult.Builder setJobId(JobId jobId); - public JobId getJobId() { - return jobId; - } + public abstract TableResult.Builder setPageNoSchema(Page pageNoSchema); - public String getQueryId() { - return queryId; - } + public abstract TableResult.Builder setQueryId(String queryId); - /** - * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s - * when iterating through them. {@code pageNoSchema} must not be null. - */ - @InternalApi("Exposed for testing") - public TableResult( - Schema schema, long totalRows, Page pageNoSchema, String queryId) { - this.schema = schema; - this.totalRows = totalRows; - this.pageNoSchema = checkNotNull(pageNoSchema); - this.queryId = queryId; + /** Creates a @code TableResult} object. */ + public abstract TableResult build(); } - @InternalApi("Exposed for testing") - public TableResult( - Schema schema, - long totalRows, - Page pageNoSchema, - JobId jobId, - String queryId) { - this.schema = schema; - this.totalRows = totalRows; - this.pageNoSchema = checkNotNull(pageNoSchema); - this.jobId = jobId; - this.queryId = queryId; + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_TableResult.Builder(); } /** Returns the schema of the results. Null if the schema is not supplied. */ - public Schema getSchema() { - return schema; - } + @Nullable + public abstract Schema getSchema(); - /** - * Returns the total number of rows in the complete result set, which can be more than the number - * of rows in the first page of results returned by {@link #getValues()}. - */ - public long getTotalRows() { - return totalRows; - } + public abstract long getTotalRows(); + + public abstract Page getPageNoSchema(); + + @Nullable + public abstract JobId getJobId(); + + @Nullable + public abstract String getQueryId(); @Override public boolean hasNextPage() { - return pageNoSchema.hasNextPage(); + return getPageNoSchema().hasNextPage(); } @Override public String getNextPageToken() { - return pageNoSchema.getNextPageToken(); + return getPageNoSchema().getNextPageToken(); } @Override public TableResult getNextPage() { - if (pageNoSchema.hasNextPage()) { - return new TableResult(schema, totalRows, pageNoSchema.getNextPage(), queryId); + if (getPageNoSchema().hasNextPage()) { + return TableResult.newBuilder() + .setSchema(getSchema()) + .setTotalRows(getTotalRows()) + .setPageNoSchema(getPageNoSchema().getNextPage()) + .setQueryId(getQueryId()) + .build(); } return null; } @Override public Iterable iterateAll() { - return addSchema(pageNoSchema.iterateAll()); + return addSchema(getPageNoSchema().iterateAll()); } @Override public Iterable getValues() { - return addSchema(pageNoSchema.getValues()); + return addSchema(getPageNoSchema().getValues()); } private Iterable addSchema(Iterable iter) { - if (schema == null) { + if (getSchema() == null) { return iter; } return Iterables.transform( @@ -129,7 +115,7 @@ private Iterable addSchema(Iterable iter) { new Function() { @Override public FieldValueList apply(FieldValueList list) { - return list.withSchema(schema.getFields()); + return list.withSchema(getSchema().getFields()); } }); } @@ -138,15 +124,16 @@ public FieldValueList apply(FieldValueList list) { public String toString() { return MoreObjects.toStringHelper(this) .add("rows", getValues()) - .add("schema", schema) - .add("totalRows", totalRows) + .add("schema", getSchema()) + .add("totalRows", getTotalRows()) .add("cursor", getNextPageToken()) + .add("queryId", getQueryId()) .toString(); } @Override public final int hashCode() { - return Objects.hash(pageNoSchema, schema, totalRows); + return Objects.hash(getPageNoSchema(), getSchema(), getTotalRows(), getQueryId()); } @Override @@ -154,13 +141,14 @@ public final boolean equals(Object obj) { if (obj == this) { return true; } - if (obj == null || !obj.getClass().equals(TableResult.class)) { + if (obj == null || !obj.getClass().equals(AutoValue_TableResult.class)) { return false; } TableResult response = (TableResult) obj; return Objects.equals(getNextPageToken(), response.getNextPageToken()) && Iterators.elementsEqual(getValues().iterator(), response.getValues().iterator()) - && Objects.equals(schema, response.schema) - && totalRows == response.totalRows; + && Objects.equals(getSchema(), response.getSchema()) + && getTotalRows() == response.getTotalRows() + && getQueryId() == response.getQueryId(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index 08c4137d69..d10203444d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -309,7 +309,12 @@ public void testWaitForAndGetQueryResults() throws InterruptedException { Job completedJob = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); Page singlePage = Pages.empty(); - TableResult result = new TableResult(Schema.of(), 1, singlePage, null); + TableResult result = + TableResult.newBuilder() + .setSchema(Schema.of()) + .setTotalRows(1L) + .setPageNoSchema(singlePage) + .build(); QueryResponse completedQuery = QueryResponse.newBuilder() .setCompleted(true) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java index d31b282e72..e91a243949 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SerializationTest.java @@ -206,7 +206,11 @@ public class SerializationTest extends BaseSerializationTest { private static final FieldValue FIELD_VALUE = FieldValue.of(FieldValue.Attribute.PRIMITIVE, "value"); private static final TableResult TABLE_RESULT = - new TableResult(Schema.of(), 0L, new PageImpl(null, "", ImmutableList.of()), null); + TableResult.newBuilder() + .setSchema(Schema.of()) + .setTotalRows(0L) + .setPageNoSchema(new PageImpl(null, "", ImmutableList.of())) + .build(); private static final BigQuery BIGQUERY = BigQueryOptions.newBuilder().setProjectId("p1").build().getService(); private static final Dataset DATASET = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java index 89b7d68371..71f9e35da5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java @@ -53,7 +53,8 @@ private static FieldValueList newFieldValueList(String s) { @Test public void testNullSchema() { - TableResult result = new TableResult(null, 3, INNER_PAGE_0, null); + TableResult result = + TableResult.newBuilder().setTotalRows(3L).setPageNoSchema(INNER_PAGE_0).build(); assertThat(result.getSchema()).isNull(); assertThat(result.hasNextPage()).isTrue(); assertThat(result.getNextPageToken()).isNotNull(); @@ -75,7 +76,12 @@ public void testNullSchema() { @Test public void testSchema() { - TableResult result = new TableResult(SCHEMA, 3, INNER_PAGE_0, null); + TableResult result = + TableResult.newBuilder() + .setSchema(SCHEMA) + .setTotalRows(3L) + .setPageNoSchema(INNER_PAGE_0) + .build(); assertThat(result.getSchema()).isEqualTo(SCHEMA); assertThat(result.hasNextPage()).isTrue(); assertThat(result.getNextPageToken()).isNotNull(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java index 9aa1953314..6e99b701c1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java @@ -249,9 +249,18 @@ public void testInsertComplete() { public void testList() { Page page = new PageImpl<>(null, "c", ROWS); when(bigquery.listTableData(TABLE_ID1)) - .thenReturn(new TableResult(null, ROWS.size(), page, null)); + .thenReturn( + TableResult.newBuilder() + .setTotalRows((long) ROWS.size()) + .setPageNoSchema(page) + .build()); when(bigquery.listTableData(TABLE_ID1, SCHEMA)) - .thenReturn(new TableResult(SCHEMA, ROWS.size(), page, null)); + .thenReturn( + TableResult.newBuilder() + .setSchema(SCHEMA) + .setTotalRows((long) ROWS.size()) + .setPageNoSchema(page) + .build()); Page dataPage = table.list(); assertThat(dataPage.getValues()).containsExactlyElementsIn(ROWS).inOrder(); dataPage = table.list(SCHEMA); @@ -264,9 +273,18 @@ public void testList() { public void testListWithOptions() { Page page = new PageImpl<>(null, "c", ROWS); when(bigquery.listTableData(TABLE_ID1, BigQuery.TableDataListOption.pageSize(10L))) - .thenReturn(new TableResult(null, ROWS.size(), page, null)); + .thenReturn( + TableResult.newBuilder() + .setTotalRows((long) ROWS.size()) + .setPageNoSchema(page) + .build()); when(bigquery.listTableData(TABLE_ID1, SCHEMA, BigQuery.TableDataListOption.pageSize(10L))) - .thenReturn(new TableResult(SCHEMA, ROWS.size(), page, null)); + .thenReturn( + TableResult.newBuilder() + .setSchema(SCHEMA) + .setTotalRows((long) ROWS.size()) + .setPageNoSchema(page) + .build()); Page dataPage = table.list(BigQuery.TableDataListOption.pageSize(10L)); assertThat(dataPage.getValues()).containsExactlyElementsIn(ROWS).inOrder(); From 531b1a0b93ee19a7479a006207c30f7399869773 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Feb 2024 16:16:23 +0100 Subject: [PATCH 1590/2268] deps: update github/codeql-action action to v2.24.4 (#3161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.24.4 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d5706e48e8..b16bfac237 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4a8f20f6b9b5114f354129a1e2f391d75bfd640a # v2.24.3 + uses: github/codeql-action/upload-sarif@80eb8d5395c1d8edac424890a2dc323568ba25fb # v2.24.4 with: sarif_file: results.sarif From 1da59ce0cecfd6582070f59077d90f8523783933 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:44:47 -0500 Subject: [PATCH 1591/2268] chore(main): release 2.38.0 (#3156) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d543ab3d05..3eb475e7dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.38.0](https://github.com/googleapis/java-bigquery/compare/v2.37.2...v2.38.0) (2024-02-22) + + +### Features + +* Add MetadataCacheStatistics to Job QueryStatistics ([#3133](https://github.com/googleapis/java-bigquery/issues/3133)) ([f3f387b](https://github.com/googleapis/java-bigquery/commit/f3f387b2265d527f3b5bf567c1eaf7ecdad6e096)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240211-2.0.0 ([#3152](https://github.com/googleapis/java-bigquery/issues/3152)) ([e5d6888](https://github.com/googleapis/java-bigquery/commit/e5d688872e4c125a68ed6f666bffd0a41efc3f30)) +* Update github/codeql-action action to v2.24.3 ([#3148](https://github.com/googleapis/java-bigquery/issues/3148)) ([a0a7b01](https://github.com/googleapis/java-bigquery/commit/a0a7b0186ae47fcfcf75fe4f35cce50044c6926c)) +* Update github/codeql-action action to v2.24.3 ([#3150](https://github.com/googleapis/java-bigquery/issues/3150)) ([042fcf0](https://github.com/googleapis/java-bigquery/commit/042fcf0aca46d349103211c3d04ae4b49868933c)) +* Update github/codeql-action action to v2.24.4 ([#3161](https://github.com/googleapis/java-bigquery/issues/3161)) ([531b1a0](https://github.com/googleapis/java-bigquery/commit/531b1a0b93ee19a7479a006207c30f7399869773)) + ## [2.37.2](https://github.com/googleapis/java-bigquery/compare/v2.37.1...v2.37.2) (2024-02-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3eca364f10..fccb9667f2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.37.3-SNAPSHOT + 2.38.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8b18134261..68a0051ed4 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.37.3-SNAPSHOT + 2.38.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.37.3-SNAPSHOT + 2.38.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 15be2ae8e3..de38f783f1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.37.3-SNAPSHOT + 2.38.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.37.3-SNAPSHOT + 2.38.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4fbdd82f62..923b51cda5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.37.3-SNAPSHOT + 2.38.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.37.3-SNAPSHOT + 2.38.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bbf8c5c4a3..37e581dfe6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.37.3-SNAPSHOT + 2.38.0 diff --git a/versions.txt b/versions.txt index f429a3ad8b..160dbac954 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.37.2:2.37.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.38.0:2.38.0 \ No newline at end of file From 8ac7722977e453d272710153180f458be6427aa4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 14:19:52 +0100 Subject: [PATCH 1592/2268] deps: update github/codeql-action action to v2.24.5 (#3165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.24.5 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b16bfac237..06a691499f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@80eb8d5395c1d8edac424890a2dc323568ba25fb # v2.24.4 + uses: github/codeql-action/upload-sarif@a56a03b370b87b26fde6d680755f818cfda0372b # v2.24.5 with: sarif_file: results.sarif diff --git a/README.md b/README.md index 977432d012..8b6b05d517 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.37.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.38.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.37.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.37.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From b68ab427b157a40c7e7d415b02a01f1988080e08 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 14:22:25 +0100 Subject: [PATCH 1593/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.1 (#3154) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 054077ec37..b9eff795d8 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.10.0 + 0.10.1 true com.example.bigquery.NativeImageBigquerySample From b0fd2b9a6bf83a8631595412bf9046fe25f15003 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 15:52:48 +0100 Subject: [PATCH 1594/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.34.0 (#3157) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7352fd1a3d..4a9d1c752e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.33.0 + 2.34.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 37e581dfe6..1e2de9e89e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.33.0 + 2.34.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cb740eff44..6c397a8587 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.33.0 + 2.34.0 test From b8b741828221001397ee335a000efff5e2dda8b1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 15:53:03 +0100 Subject: [PATCH 1595/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.0 (#3164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b6b05d517..a0eb62053d 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.37.2 + 2.38.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4a9d1c752e..07d39ced4a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.37.2 + 2.38.0 From 436f58cbd33546f78ae082d4261ce106f9f77a66 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 16:19:37 +0100 Subject: [PATCH 1596/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.10.1 (#3153) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b9eff795d8..9dfe7de3b4 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.10.0 + 0.10.1 test From e31b5b7ea4b91ab0096bf318377dfd66d1364b3c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 23 Feb 2024 19:17:55 +0100 Subject: [PATCH 1597/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.42.0 (#3160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.42.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 923b51cda5..82d260c25d 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.41.0 + 1.42.0 pom import From acffb24030720ddf1f5358f50e22af366ba28f83 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:24:15 +0000 Subject: [PATCH 1598/2268] chore(main): release 2.38.1-SNAPSHOT (#3162) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index fccb9667f2..95dc2e0238 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.0 + 2.38.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 68a0051ed4..558334208a 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.0 + 2.38.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index de38f783f1..b191fd1b60 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.0 + 2.38.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 82d260c25d..3b7047817a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.0 + 2.38.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1e2de9e89e..3c9757d00b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 160dbac954..54415640e1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.0:2.38.0 \ No newline at end of file +google-cloud-bigquery:2.38.0:2.38.1-SNAPSHOT \ No newline at end of file From d6c65abb844d1cca616907cd6aeb02f2a6042916 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Feb 2024 20:28:34 +0100 Subject: [PATCH 1599/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.38.0 (#3159) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3b7047817a..8d99ab4ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.37.0 + 2.38.0 test From a9df1ba8895d1656d2ffd9037de27f62c625215b Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:57:35 -0500 Subject: [PATCH 1600/2268] chore: use sdk-platform-java-config instead of java-shared-config (#3173) chore: use sdk-platform-java-config instead of java-shared-config --- google-cloud-bigquery-bom/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 558334208a..2d55ae9ef1 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -7,8 +7,8 @@ pom com.google.cloud - google-cloud-shared-config - 1.7.1 + sdk-platform-java-config + 3.25.0 From 45c5096c756a6599233935553708af4f53de5d58 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Thu, 29 Feb 2024 19:52:54 +0000 Subject: [PATCH 1601/2268] chore: next release from main branch is 2.36.0 (#3174) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index 7abf72a6e2..ab97340a7a 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -19,6 +19,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.19.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.35.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 9583d638c8..418e8ab988 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -92,6 +92,21 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - OwlBot Post Processor + - pattern: 2.35.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - javadoc permissionRules: - team: api-bigquery permission: admin From b93e62e30808d9df95fa4c268dcd37a5462056e1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 4 Mar 2024 14:36:19 +0100 Subject: [PATCH 1602/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.27.0 (#3176) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:sdk-platform-java-config](https://togithub.com/googleapis/java-shared-config) | `3.25.0` -> `3.27.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:sdk-platform-java-config/3.27.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:sdk-platform-java-config/3.27.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:sdk-platform-java-config/3.25.0/3.27.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:sdk-platform-java-config/3.25.0/3.27.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 28a65e0fea..179708616f 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.25.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.27.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index d9c57fee12..b44ea4a6ea 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.25.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.27.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 890878fef0..3762600b8a 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.25.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.27.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 8e8cded782..6283184778 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.25.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.27.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 2d55ae9ef1..2a779cabf6 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.25.0 + 3.27.0 diff --git a/pom.xml b/pom.xml index 8d99ab4ca9..06206ac859 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.25.0 + 3.27.0 From 8e2eccbab081e8e388e8613669cc8651e549d029 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 5 Mar 2024 16:17:10 -0500 Subject: [PATCH 1603/2268] ci: sample build in Cloud Build (#3171) * ci: sample build in Cloud Build b/322966824 --- .cloudbuild/samples_build.yaml | 45 +++++++++++++++++++ .../com/example/bigquery/CopyTableCmekIT.java | 2 + .../example/bigquery/CreateDatasetAwsIT.java | 2 + .../bigquery/CreateExternalTableAwsIT.java | 2 + .../example/bigquery/CreateTableCmekIT.java | 2 + .../bigquery/ExportQueryResultsToS3IT.java | 2 + .../com/example/bigquery/ExtractModelIT.java | 2 + .../bigquery/ExtractTableCompressedIT.java | 2 + .../example/bigquery/ExtractTableToCsvIT.java | 2 + .../bigquery/ExtractTableToJsonIT.java | 2 + .../bigquery/LoadJsonFromGcsCmekIT.java | 2 + .../bigquery/QueryClusteredTableIT.java | 2 + .../bigquery/QueryDestinationTableCmekIT.java | 2 + .../bigquery/QueryExternalBigtablePermIT.java | 2 + .../bigquery/QueryExternalBigtableTempIT.java | 2 + .../bigquery/QueryExternalSheetsPermIT.java | 2 + .../bigquery/QueryExternalSheetsTempIT.java | 2 + .../bigquery/QueryExternalTableAwsIT.java | 2 + .../bigquery/UpdateDatasetAccessIT.java | 2 + .../example/bigquery/UpdateTableCmekIT.java | 2 + 20 files changed, 83 insertions(+) create mode 100644 .cloudbuild/samples_build.yaml diff --git a/.cloudbuild/samples_build.yaml b/.cloudbuild/samples_build.yaml new file mode 100644 index 0000000000..354adf9720 --- /dev/null +++ b/.cloudbuild/samples_build.yaml @@ -0,0 +1,45 @@ +steps: +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: ls + args: [ + '-alt', + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: curl + args: [ + '--header', + 'Metadata-Flavor: Google', + 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email' + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: pwd +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: bash + args: [ + '.kokoro/build.sh' + ] + env: + - 'JOB_TYPE=samples' + - 'BIGQUERY_PROJECT_ID=cloud-java-ci-sample' + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-sample' + - 'GCS_BUCKET=java-samples-bigquery' + - 'BIGQUERY_TEST_TABLE=test_table' + - 'BIGQUERY_MODEL_NAME=natality_model' + - 'BIGQUERY_MODEL_TEST_PROJECT_ID=bigquery-public-data' + - 'OMNI_PROJECT_ID=sunlit-ace-276222' + - 'OMNI_EXTERNAL_TABLE_NAME=devrel_test_table' + - 'BIGQUERY_TABLE2=table2' + - 'BIGQUERY_TABLE1=table1' + - 'BIGTABLE_TESTING_INSTANCE=bigquery-samples-instance' + - 'BIGQUERY_DATASET_NAME=bigquery_test_dataset' + - 'KOKORO_GFILE_DIR=/workspace' + # This key is not available yet + - 'BIGQUERY_KMS_KEY_NAME=projects/cloud-java-ci-sample/locations/us/keyRings/bq-kms-key/cryptoKeys/bq-kms-key' +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: echo + args: [ + 'Sample job succeeded', + ] +timeout: 3600s +options: + defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET diff --git a/samples/snippets/src/test/java/com/example/bigquery/CopyTableCmekIT.java b/samples/snippets/src/test/java/com/example/bigquery/CopyTableCmekIT.java index d5b12a0e21..7a601cf951 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CopyTableCmekIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CopyTableCmekIT.java @@ -31,8 +31,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class CopyTableCmekIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetAwsIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetAwsIT.java index f4b5cf0f6b..6f59f0c49f 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetAwsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateDatasetAwsIT.java @@ -27,8 +27,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class CreateDatasetAwsIT { private static final String ID = UUID.randomUUID().toString().substring(0, 8); diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateExternalTableAwsIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateExternalTableAwsIT.java index 8aac2716e7..80be0bb26f 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CreateExternalTableAwsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateExternalTableAwsIT.java @@ -32,8 +32,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class CreateExternalTableAwsIT { private static final String ID = UUID.randomUUID().toString().substring(0, 8); diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateTableCmekIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateTableCmekIT.java index fd35c390e0..7169a8fce1 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CreateTableCmekIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateTableCmekIT.java @@ -31,8 +31,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class CreateTableCmekIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/ExportQueryResultsToS3IT.java b/samples/snippets/src/test/java/com/example/bigquery/ExportQueryResultsToS3IT.java index 61a5438120..b014bde602 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ExportQueryResultsToS3IT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ExportQueryResultsToS3IT.java @@ -26,8 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class ExportQueryResultsToS3IT { private final Logger log = Logger.getLogger(this.getClass().getName()); private ByteArrayOutputStream bout; diff --git a/samples/snippets/src/test/java/com/example/bigquery/ExtractModelIT.java b/samples/snippets/src/test/java/com/example/bigquery/ExtractModelIT.java index 3e13e78167..ac0d131113 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ExtractModelIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ExtractModelIT.java @@ -26,8 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class ExtractModelIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableCompressedIT.java b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableCompressedIT.java index 8fc5eed6ef..4e551ed818 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableCompressedIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableCompressedIT.java @@ -26,8 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class ExtractTableCompressedIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToCsvIT.java b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToCsvIT.java index c3b6550bf9..838a989b69 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToCsvIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToCsvIT.java @@ -26,8 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class ExtractTableToCsvIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToJsonIT.java b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToJsonIT.java index 68f7903838..393188c7eb 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToJsonIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ExtractTableToJsonIT.java @@ -27,8 +27,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class ExtractTableToJsonIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/LoadJsonFromGcsCmekIT.java b/samples/snippets/src/test/java/com/example/bigquery/LoadJsonFromGcsCmekIT.java index fb7ea8e522..c4507f11d7 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/LoadJsonFromGcsCmekIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/LoadJsonFromGcsCmekIT.java @@ -28,8 +28,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class LoadJsonFromGcsCmekIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryClusteredTableIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryClusteredTableIT.java index 7b861be5fe..abdaed05f3 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryClusteredTableIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryClusteredTableIT.java @@ -24,8 +24,10 @@ import java.util.logging.Logger; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryClusteredTableIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryDestinationTableCmekIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryDestinationTableCmekIT.java index df7d3ec747..e4f21760d8 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryDestinationTableCmekIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryDestinationTableCmekIT.java @@ -31,8 +31,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryDestinationTableCmekIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtablePermIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtablePermIT.java index 5e0fd3caba..7f14a28719 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtablePermIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtablePermIT.java @@ -34,8 +34,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryExternalBigtablePermIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtableTempIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtableTempIT.java index 27208b196e..dce81d6374 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtableTempIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalBigtableTempIT.java @@ -34,8 +34,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryExternalBigtableTempIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsPermIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsPermIT.java index 1eb72c4d94..fc16a4f8ea 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsPermIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsPermIT.java @@ -30,8 +30,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryExternalSheetsPermIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsTempIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsTempIT.java index 6a167d47a6..2098cce6ee 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsTempIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalSheetsTempIT.java @@ -28,8 +28,10 @@ import java.util.logging.Logger; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryExternalSheetsTempIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalTableAwsIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalTableAwsIT.java index 4759a4eb6d..504a72f45a 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryExternalTableAwsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryExternalTableAwsIT.java @@ -26,8 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class QueryExternalTableAwsIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateDatasetAccessIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateDatasetAccessIT.java index d4ec62df2b..2a1ed26f9d 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateDatasetAccessIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateDatasetAccessIT.java @@ -30,8 +30,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class UpdateDatasetAccessIT { private final Logger log = Logger.getLogger(this.getClass().getName()); diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateTableCmekIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateTableCmekIT.java index 3c6417f44f..ddeb7a0220 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateTableCmekIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateTableCmekIT.java @@ -31,8 +31,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class UpdateTableCmekIT { private final Logger log = Logger.getLogger(this.getClass().getName()); From 5c636b4e75360cfa443ed3fd4a3118cf292e9ab5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 7 Mar 2024 03:02:21 +0100 Subject: [PATCH 1604/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.3.1 (#3181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquerystorage-bom](https://togithub.com/googleapis/java-bigquerystorage) | `3.2.0` -> `3.3.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.2.0/3.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquerystorage-bom/3.2.0/3.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquerystorage (com.google.cloud:google-cloud-bigquerystorage-bom) ### [`v3.3.1`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#331-2024-03-06) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v3.3.0...v3.3.1) ##### Dependencies - Update dependency com.google.cloud:sdk-platform-java-config to v3.27.0 ([#​2425](https://togithub.com/googleapis/java-bigquerystorage/issues/2425)) ([488d282](https://togithub.com/googleapis/java-bigquerystorage/commit/488d28287fdaefff02e7ad9f9f7c8da6ac873671)) ### [`v3.3.0`](https://togithub.com/googleapis/java-bigquerystorage/blob/HEAD/CHANGELOG.md#330-2024-03-04) [Compare Source](https://togithub.com/googleapis/java-bigquerystorage/compare/v3.2.0...v3.3.0) ##### Features - Add RetrySettings use to Write API samples. ([#​2419](https://togithub.com/googleapis/java-bigquerystorage/issues/2419)) ([5b000d0](https://togithub.com/googleapis/java-bigquerystorage/commit/5b000d0a4e953649ca4e44bffd3ba25c288e70e4)) - Add the RANGE type to the google.cloud.bigquery.storage.v1.TableFieldSchema ([#​2413](https://togithub.com/googleapis/java-bigquerystorage/issues/2413)) ([6aa92b5](https://togithub.com/googleapis/java-bigquerystorage/commit/6aa92b5d03eed548de9e89b0731707f92c373ce3)) - Next release from main branch is 2.48.0 ([#​2420](https://togithub.com/googleapis/java-bigquerystorage/issues/2420)) ([2dd8efc](https://togithub.com/googleapis/java-bigquerystorage/commit/2dd8efc4a21f186c20e86304092d22fd574e822e)) ##### Bug Fixes - Fix issue where Universe Domain is not correctly set. ([#​2423](https://togithub.com/googleapis/java-bigquerystorage/issues/2423)) ([b7ebd73](https://togithub.com/googleapis/java-bigquerystorage/commit/b7ebd73754fe51a4835f676e429b95b80f8114a5)) ##### Dependencies - Update dependency com.google.cloud:google-cloud-bigquery to v2.38.0 ([#​2417](https://togithub.com/googleapis/java-bigquerystorage/issues/2417)) ([8184a0f](https://togithub.com/googleapis/java-bigquerystorage/commit/8184a0f74e98340fe62621957f3ac78ad70c9edb)) - Update dependency com.google.cloud:google-cloud-bigquery to v2.38.0 ([#​2418](https://togithub.com/googleapis/java-bigquerystorage/issues/2418)) ([4d5eb73](https://togithub.com/googleapis/java-bigquerystorage/commit/4d5eb7343cdf5fd617a2da120642bfd678d58f94)) - Update dependency com.google.truth:truth to v1.4.1 ([#​2412](https://togithub.com/googleapis/java-bigquerystorage/issues/2412)) ([c2dcb73](https://togithub.com/googleapis/java-bigquerystorage/commit/c2dcb73c54ad5dcb68ce18741efaf479298373e1)) - Update dependency com.google.truth:truth to v1.4.2 ([#​2424](https://togithub.com/googleapis/java-bigquerystorage/issues/2424)) ([7a12de0](https://togithub.com/googleapis/java-bigquerystorage/commit/7a12de0ebc6a0a0f4bb438e3dcb36ee0759c0b94)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.1 ([#​2414](https://togithub.com/googleapis/java-bigquerystorage/issues/2414)) ([dfa8d53](https://togithub.com/googleapis/java-bigquerystorage/commit/dfa8d532e5e1a28d644fefed6650ca1a2481a3a3)) - Update dependency org.json:json to v20240303 ([#​2426](https://togithub.com/googleapis/java-bigquerystorage/issues/2426)) ([2accca7](https://togithub.com/googleapis/java-bigquerystorage/commit/2accca72f2bd26c9a1cf1bd918961889b9ee3ace)) ##### Documentation - Mark BigQueryWrite v1beta2 as deprecated ([#​2421](https://togithub.com/googleapis/java-bigquerystorage/issues/2421)) ([07d98ab](https://togithub.com/googleapis/java-bigquerystorage/commit/07d98ab417ae9fd2f90aca4d6a1a3ff62ef0bc1d))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 06206ac859..29fedf1975 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.2.0 + 3.3.1 pom import From 041d83cd509375c13b4ef6c6c306e56d7d4331a7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 22:20:28 -0500 Subject: [PATCH 1605/2268] chore(main): release 2.38.1 (#3167) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eb475e7dc..418a208b9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.38.1](https://github.com/googleapis/java-bigquery/compare/v2.38.0...v2.38.1) (2024-03-07) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.38.0 ([#3159](https://github.com/googleapis/java-bigquery/issues/3159)) ([d6c65ab](https://github.com/googleapis/java-bigquery/commit/d6c65abb844d1cca616907cd6aeb02f2a6042916)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.42.0 ([#3160](https://github.com/googleapis/java-bigquery/issues/3160)) ([e31b5b7](https://github.com/googleapis/java-bigquery/commit/e31b5b7ea4b91ab0096bf318377dfd66d1364b3c)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.27.0 ([#3176](https://github.com/googleapis/java-bigquery/issues/3176)) ([b93e62e](https://github.com/googleapis/java-bigquery/commit/b93e62e30808d9df95fa4c268dcd37a5462056e1)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.1 ([#3153](https://github.com/googleapis/java-bigquery/issues/3153)) ([436f58c](https://github.com/googleapis/java-bigquery/commit/436f58cbd33546f78ae082d4261ce106f9f77a66)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.1 ([#3154](https://github.com/googleapis/java-bigquery/issues/3154)) ([b68ab42](https://github.com/googleapis/java-bigquery/commit/b68ab427b157a40c7e7d415b02a01f1988080e08)) +* Update github/codeql-action action to v2.24.5 ([#3165](https://github.com/googleapis/java-bigquery/issues/3165)) ([8ac7722](https://github.com/googleapis/java-bigquery/commit/8ac7722977e453d272710153180f458be6427aa4)) + ## [2.38.0](https://github.com/googleapis/java-bigquery/compare/v2.37.2...v2.38.0) (2024-02-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 95dc2e0238..9be5bc351f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.1-SNAPSHOT + 2.38.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 2a779cabf6..e2a8299b40 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.1-SNAPSHOT + 2.38.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1-SNAPSHOT + 2.38.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b191fd1b60..551db63ceb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.1-SNAPSHOT + 2.38.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.1-SNAPSHOT + 2.38.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 29fedf1975..0d5813ca4d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.1-SNAPSHOT + 2.38.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1-SNAPSHOT + 2.38.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3c9757d00b..64ebf51be2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1-SNAPSHOT + 2.38.1 diff --git a/versions.txt b/versions.txt index 54415640e1..3e8ba920b1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.0:2.38.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.38.1:2.38.1 \ No newline at end of file From 39b5f27cf019ec86c01d4ea2512402d462710a1e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 7 Mar 2024 15:06:58 +0100 Subject: [PATCH 1606/2268] test(deps): update dependency com.google.truth:truth to v1.4.2 (#3175) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 0d5813ca4d..40d759c090 100644 --- a/pom.xml +++ b/pom.xml @@ -136,7 +136,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 07d39ced4a..3ff0852c2e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 9dfe7de3b4..ba90812eb3 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 64ebf51be2..e2ef0c5b85 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6c397a8587..2d84351388 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.4.1 + 1.4.2 test From db05223ada34947ba26b6e97376c079a8483187b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:16:16 +0000 Subject: [PATCH 1607/2268] chore(main): release 2.38.2-SNAPSHOT (#3183) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- README.md | 6 +++--- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a0eb62053d..b00344b766 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.38.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.38.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9be5bc351f..655f1b7dd3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.1 + 2.38.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e2a8299b40..4e37ae91e5 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.1 + 2.38.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 551db63ceb..33d11820b9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.1 + 2.38.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 40d759c090..80eeb55429 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.1 + 2.38.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -110,7 +110,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e2ef0c5b85..e764160869 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3e8ba920b1..e1d5c8b1cc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.1:2.38.1 \ No newline at end of file +google-cloud-bigquery:2.38.1:2.38.2-SNAPSHOT \ No newline at end of file From a72262a136c659cbdc52352a8064b94d21cd43e4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Mar 2024 14:44:07 +0100 Subject: [PATCH 1608/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.35.0 (#3180) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 80eeb55429..8685cbdb07 100644 --- a/pom.xml +++ b/pom.xml @@ -154,7 +154,7 @@ com.google.cloud google-cloud-storage - 2.34.0 + 2.35.0 test From 18a7c8ee96eb90b5a87589df5017c52be2839bb8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Mar 2024 14:46:06 +0100 Subject: [PATCH 1609/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.35.1 (#3182) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3ff0852c2e..ae553725af 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.34.0 + 2.35.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e764160869..9b4c211de8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.34.0 + 2.35.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2d84351388..b21638a354 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.34.0 + 2.35.1 test From 0ac910f6203821334f0d16083eb6337e908c7c55 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Mar 2024 14:46:34 +0100 Subject: [PATCH 1610/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.1 (#3184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.1 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b00344b766..5f9648f200 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ae553725af..b30ac06d42 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.38.0 + 2.38.1 From 31f00d284868725ac7894ddaa8aa1d4251866fb1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Mar 2024 14:47:10 +0100 Subject: [PATCH 1611/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.39.0 (#3185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.39.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8685cbdb07..632635ced4 100644 --- a/pom.xml +++ b/pom.xml @@ -160,7 +160,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.38.0 + 2.39.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b30ac06d42..0aa8cd3015 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.38.0 + 2.39.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9b4c211de8..57b51bc426 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.38.0 + 2.39.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b21638a354..00a6618044 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.38.0 + 2.39.0 test From 9e705a140ac6fc1d1d64674dc985c35955911667 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 13:52:33 +0100 Subject: [PATCH 1612/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.39.0 (#3186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.39.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 632635ced4..f59fe902f3 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.38.0 + 2.39.0 test From 497ff298d84e536161b112c6b1aa176d4d962a49 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 13:53:09 +0100 Subject: [PATCH 1613/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.43.0 (#3187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.43.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f59fe902f3..c1de6fa60d 100644 --- a/pom.xml +++ b/pom.xml @@ -96,7 +96,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.42.0 + 1.43.0 pom import From a018424ccbf3c2c554d829c97e442f4813b2c764 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 13:53:46 +0100 Subject: [PATCH 1614/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240229-2.0.0 (#3188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240229-2.0.0 * 🦉 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 --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5f9648f200..2ce7af4092 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.33.0') +implementation platform('com.google.cloud:libraries-bom:26.34.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index c1de6fa60d..fa9fcb5b4d 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240211-2.0.0 + v2-rev20240229-2.0.0 15.0.0 From 940e4f6c656a2e0f1d2e4d6e08d42214d14fe125 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 13:56:11 +0100 Subject: [PATCH 1615/2268] deps: update actions/checkout action (#3190) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 06a691499f..d537635989 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: persist-credentials: false From fb6284e94d4744bb4c8f9501751bf79e04a2429b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 14:55:27 +0100 Subject: [PATCH 1616/2268] deps: update arrow.version to v15.0.1 (#3189) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa9fcb5b4d..a9da3bb4f2 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ github google-cloud-bigquery-parent v2-rev20240229-2.0.0 - 15.0.0 + 15.0.1 From 8843cae621e1eede6b072b1347f2a68a36304bca Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Mar 2024 17:29:29 +0100 Subject: [PATCH 1617/2268] deps: update github/codeql-action action to v2.24.6 (#3178) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d537635989..810b6be6ae 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@a56a03b370b87b26fde6d680755f818cfda0372b # v2.24.5 + uses: github/codeql-action/upload-sarif@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 with: sarif_file: results.sarif From 4be8071c42bb646441100d43410663724307ff88 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Wed, 13 Mar 2024 09:20:23 -0400 Subject: [PATCH 1618/2268] chore: stop declaring Apache Arrow deps in dependencyManagement (#3193) --- pom.xml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index a9da3bb4f2..852a1e951a 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,6 @@ github google-cloud-bigquery-parent v2-rev20240229-2.0.0 - 15.0.1 @@ -76,23 +75,7 @@ pom import
    - - org.apache.arrow - arrow-vector - ${arrow.version} - - - org.apache.arrow - arrow-memory-core - ${arrow.version} - - - org.apache.arrow - arrow-memory-netty - ${arrow.version} - runtime - - + com.google.cloud google-cloud-datacatalog-bom From 2e2d730de9e4e49f25c20de2cfe1ae38babef830 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 14 Mar 2024 15:45:07 +0100 Subject: [PATCH 1619/2268] deps: update github/codeql-action action to v2.24.7 (#3194) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 810b6be6ae..ff9985a871 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@928ff8c822d966a999092a6a35e32177899afb7c # v2.24.6 + uses: github/codeql-action/upload-sarif@e56cfd0877b4826be144d11aa31e6c64a55828e9 # v2.24.7 with: sarif_file: results.sarif From 20e8e4f184592ef7e61130150cd88e4efe09e626 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Mar 2024 17:30:25 +0100 Subject: [PATCH 1620/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.36.0 (#3195) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0aa8cd3015..68968cd4f4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.35.1 + 2.36.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 57b51bc426..1039b499bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.35.1 + 2.36.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 00a6618044..41482f64d0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.35.1 + 2.36.0 test From 61f23a35d2b5cbbd66ddf35b93709a5669b5b102 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Mar 2024 17:31:18 +0100 Subject: [PATCH 1621/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 (#3196) --- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 179708616f..fba53ee54b 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.27.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.28.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index b44ea4a6ea..853a0d20ba 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.27.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.28.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 3762600b8a..227409d0cb 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.27.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.28.1"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 6283184778..94e00cbaa0 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.27.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.28.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 4e37ae91e5..ab041e2633 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.27.0 + 3.28.1 diff --git a/pom.xml b/pom.xml index 852a1e951a..2893fd09a4 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.27.0 + 3.28.1 From 525ceb24fa88d10590cfed25784e48e096213463 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Mar 2024 17:34:02 +0100 Subject: [PATCH 1622/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.36.0 (#3197) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2893fd09a4..4cf444f658 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.35.0 + 2.36.0 test From bd81a56a07c836abb05c1de0d42e9cd397920e99 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Mar 2024 16:55:13 +0100 Subject: [PATCH 1623/2268] deps: update github/codeql-action action to v2.24.8 (#3198) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index ff9985a871..c8c5af3706 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e56cfd0877b4826be144d11aa31e6c64a55828e9 # v2.24.7 + uses: github/codeql-action/upload-sarif@c2dc67199a2e650d535d7de586a07597aea4d9c7 # v2.24.8 with: sarif_file: results.sarif From 4563ffa68f931dc89226e23dc102770a7378a2ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 19 Mar 2024 16:55:43 +0100 Subject: [PATCH 1624/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.13.0 (#3199) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 655f1b7dd3..f0d06fee15 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.0 + 3.13.0 org.apache.maven.plugins From 18f21b0a2d76a4eea6ac385da2180b67ba586eaa Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Mar 2024 01:49:37 +0100 Subject: [PATCH 1625/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.4.0 (#3200) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4cf444f658..d9de25028c 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.3.1 + 3.4.0 pom import From b12139cd8712468b09ed4e6ce21a6cd2e1c47a48 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 01:34:22 +0000 Subject: [PATCH 1626/2268] chore(main): release 2.38.2 (#3191) :robot: I have created a release *beep* *boop* --- ## [2.38.2](https://togithub.com/googleapis/java-bigquery/compare/v2.38.1...v2.38.2) (2024-03-21) ### Dependencies * Update actions/checkout action ([#3190](https://togithub.com/googleapis/java-bigquery/issues/3190)) ([940e4f6](https://togithub.com/googleapis/java-bigquery/commit/940e4f6c656a2e0f1d2e4d6e08d42214d14fe125)) * Update arrow.version to v15.0.1 ([#3189](https://togithub.com/googleapis/java-bigquery/issues/3189)) ([fb6284e](https://togithub.com/googleapis/java-bigquery/commit/fb6284e94d4744bb4c8f9501751bf79e04a2429b)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.39.0 ([#3186](https://togithub.com/googleapis/java-bigquery/issues/3186)) ([9e705a1](https://togithub.com/googleapis/java-bigquery/commit/9e705a140ac6fc1d1d64674dc985c35955911667)) * Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240229-2.0.0 ([#3188](https://togithub.com/googleapis/java-bigquery/issues/3188)) ([a018424](https://togithub.com/googleapis/java-bigquery/commit/a018424ccbf3c2c554d829c97e442f4813b2c764)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.43.0 ([#3187](https://togithub.com/googleapis/java-bigquery/issues/3187)) ([497ff29](https://togithub.com/googleapis/java-bigquery/commit/497ff298d84e536161b112c6b1aa176d4d962a49)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#3196](https://togithub.com/googleapis/java-bigquery/issues/3196)) ([61f23a3](https://togithub.com/googleapis/java-bigquery/commit/61f23a35d2b5cbbd66ddf35b93709a5669b5b102)) * Update github/codeql-action action to v2.24.6 ([#3178](https://togithub.com/googleapis/java-bigquery/issues/3178)) ([8843cae](https://togithub.com/googleapis/java-bigquery/commit/8843cae621e1eede6b072b1347f2a68a36304bca)) * Update github/codeql-action action to v2.24.7 ([#3194](https://togithub.com/googleapis/java-bigquery/issues/3194)) ([2e2d730](https://togithub.com/googleapis/java-bigquery/commit/2e2d730de9e4e49f25c20de2cfe1ae38babef830)) * Update github/codeql-action action to v2.24.8 ([#3198](https://togithub.com/googleapis/java-bigquery/issues/3198)) ([bd81a56](https://togithub.com/googleapis/java-bigquery/commit/bd81a56a07c836abb05c1de0d42e9cd397920e99)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 418a208b9d..547ec4ce27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.38.2](https://github.com/googleapis/java-bigquery/compare/v2.38.1...v2.38.2) (2024-03-21) + + +### Dependencies + +* Update actions/checkout action ([#3190](https://github.com/googleapis/java-bigquery/issues/3190)) ([940e4f6](https://github.com/googleapis/java-bigquery/commit/940e4f6c656a2e0f1d2e4d6e08d42214d14fe125)) +* Update arrow.version to v15.0.1 ([#3189](https://github.com/googleapis/java-bigquery/issues/3189)) ([fb6284e](https://github.com/googleapis/java-bigquery/commit/fb6284e94d4744bb4c8f9501751bf79e04a2429b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.39.0 ([#3186](https://github.com/googleapis/java-bigquery/issues/3186)) ([9e705a1](https://github.com/googleapis/java-bigquery/commit/9e705a140ac6fc1d1d64674dc985c35955911667)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240229-2.0.0 ([#3188](https://github.com/googleapis/java-bigquery/issues/3188)) ([a018424](https://github.com/googleapis/java-bigquery/commit/a018424ccbf3c2c554d829c97e442f4813b2c764)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.43.0 ([#3187](https://github.com/googleapis/java-bigquery/issues/3187)) ([497ff29](https://github.com/googleapis/java-bigquery/commit/497ff298d84e536161b112c6b1aa176d4d962a49)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#3196](https://github.com/googleapis/java-bigquery/issues/3196)) ([61f23a3](https://github.com/googleapis/java-bigquery/commit/61f23a35d2b5cbbd66ddf35b93709a5669b5b102)) +* Update github/codeql-action action to v2.24.6 ([#3178](https://github.com/googleapis/java-bigquery/issues/3178)) ([8843cae](https://github.com/googleapis/java-bigquery/commit/8843cae621e1eede6b072b1347f2a68a36304bca)) +* Update github/codeql-action action to v2.24.7 ([#3194](https://github.com/googleapis/java-bigquery/issues/3194)) ([2e2d730](https://github.com/googleapis/java-bigquery/commit/2e2d730de9e4e49f25c20de2cfe1ae38babef830)) +* Update github/codeql-action action to v2.24.8 ([#3198](https://github.com/googleapis/java-bigquery/issues/3198)) ([bd81a56](https://github.com/googleapis/java-bigquery/commit/bd81a56a07c836abb05c1de0d42e9cd397920e99)) + ## [2.38.1](https://github.com/googleapis/java-bigquery/compare/v2.38.0...v2.38.1) (2024-03-07) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f0d06fee15..ef726795cd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.2-SNAPSHOT + 2.38.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index ab041e2633..a37ce9c8da 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.2-SNAPSHOT + 2.38.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2-SNAPSHOT + 2.38.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 33d11820b9..f307ff2475 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.2-SNAPSHOT + 2.38.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.2-SNAPSHOT + 2.38.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d9de25028c..6a9b27e6b7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.2-SNAPSHOT + 2.38.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2-SNAPSHOT + 2.38.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1039b499bc..c8b8fcf245 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2-SNAPSHOT + 2.38.2 diff --git a/versions.txt b/versions.txt index e1d5c8b1cc..4540e1564a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.1:2.38.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.38.2:2.38.2 \ No newline at end of file From 90cfa007938c1a96c70feba308070e500542a592 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 21 Mar 2024 15:02:05 +0100 Subject: [PATCH 1627/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.2 (#3202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.38.2 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2ce7af4092..f824e61991 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.38.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.38.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 68968cd4f4..e5674d6b05 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.38.1 + 2.38.2 From 9438f2c934984ff7e6d066fe7593fcd967c79f4a Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Fri, 22 Mar 2024 19:22:24 -0400 Subject: [PATCH 1628/2268] ci: unmanaged dependency check (#3145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: unmanaged dependency check b/320677879 * now bom is available * Ignoring failing sample tests * update renovate config * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Joe Wang Co-authored-by: Owl Bot --- .../workflows/unmanaged_dependency_check.yaml | 25 +++++++++++++++++++ renovate.json | 9 +++++++ .../bigquery/NativeImageBigquerySampleIT.java | 2 ++ .../bigquery/LoadCsvFromGcsTruncateTest.java | 2 ++ 4 files changed, 38 insertions(+) create mode 100644 .github/workflows/unmanaged_dependency_check.yaml diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml new file mode 100644 index 0000000000..3313f99413 --- /dev/null +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -0,0 +1,25 @@ +on: + pull_request: +name: Unmanaged dependency check +jobs: + unmanaged_dependency_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + - name: Install modules + shell: bash + run: | + # No argument to build.sh installs the modules in local Maven + # repository + .kokoro/build.sh + - name: Unmanaged dependency check + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.27.0 + with: + # java-bigquery does not produce a BOM. Fortunately the root pom.xml + # defines google-cloud-bigquery in dependencyManagement section. So + # we can treat this as the BOM to run with the check. + bom-path: ./google-cloud-bigquery-bom/pom.xml diff --git a/renovate.json b/renovate.json index 0b609db9a1..8034b03793 100644 --- a/renovate.json +++ b/renovate.json @@ -21,6 +21,15 @@ "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/unmanaged_dependency_check.yaml$" + ], + "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], + "depNameTemplate": "com.google.cloud:sdk-platform-java-config", + "datasourceTemplate": "maven" } ], "packageRules": [ diff --git a/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java b/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java index a65bc5aa87..8cdb01ab9e 100644 --- a/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java +++ b/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java @@ -25,9 +25,11 @@ import com.google.cloud.bigquery.StandardSQLTypeName; import java.util.UUID; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; /** Tests for {@link NativeImageBigquerySample} */ +@Ignore public class NativeImageBigquerySampleIT { private static final String DATASET_ID = "nativeimage_it_dataset"; diff --git a/samples/snippets/src/test/java/com/example/bigquery/LoadCsvFromGcsTruncateTest.java b/samples/snippets/src/test/java/com/example/bigquery/LoadCsvFromGcsTruncateTest.java index 09e8d9c50f..6203676496 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/LoadCsvFromGcsTruncateTest.java +++ b/samples/snippets/src/test/java/com/example/bigquery/LoadCsvFromGcsTruncateTest.java @@ -30,8 +30,10 @@ import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class LoadCsvFromGcsTruncateTest { private final Logger log = Logger.getLogger(this.getClass().getName()); From d05ccf39f9a6db78713cb0d2ce3ad4b4e061c4ad Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 15:59:50 +0100 Subject: [PATCH 1629/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.36.1 (#3203) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a9b27e6b7..853e22f5da 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.36.0 + 2.36.1 test From 434b72710373cdd6c07829c44cc97608cc28ef17 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 16:02:32 +0100 Subject: [PATCH 1630/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.40.0 (#3209) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 853e22f5da..d454b9d73a 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.39.0 + 2.40.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e5674d6b05..1e424351a9 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.39.0 + 2.40.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c8b8fcf245..fea7df554e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.39.0 + 2.40.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 41482f64d0..9a0220be43 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.39.0 + 2.40.0 test From bf7e97e1c936a419a34529a316c4f538872dd20b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 16:02:58 +0100 Subject: [PATCH 1631/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.40.0 (#3210) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d454b9d73a..ed829250b2 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.39.0 + 2.40.0 test From 6204331953b3922f5ecb1ac0c1868cb6579dd73b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 16:03:49 +0100 Subject: [PATCH 1632/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 (#3207) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 3313f99413..ebf073c1b3 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.27.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.28.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So From 6993b51f8722466b846a7dd3912acbd81e04126c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 16:04:16 +0100 Subject: [PATCH 1633/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.44.0 (#3211) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed829250b2..100b6ce943 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.43.0 + 1.44.0 pom import From 7a24d3e29f32db58475c1e02ab1c13ee8941c27d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Mar 2024 18:59:53 +0100 Subject: [PATCH 1634/2268] deps: update github/codeql-action action to v2.24.9 (#3204) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c8c5af3706..e29083aaba 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@c2dc67199a2e650d535d7de586a07597aea4d9c7 # v2.24.8 + uses: github/codeql-action/upload-sarif@a82bad71823183e5b120ab52d521460ecb0585fe # v2.24.9 with: sarif_file: results.sarif From 64bdda84fe06726042a41f2a89ac5c067f9bc949 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:48:31 -0400 Subject: [PATCH 1635/2268] feat: Add new fields to copy job statistics (#3205) * feat: Add new fields to copy job statistics Specifically, [copiedRows, copiedLogicalBytes] are added to CopyStatistics. * Fix issue where IT verified copied rows twice instead of copied logical bytes. * Add additional test to verified non-zero copy statistic case. --- .../google/cloud/bigquery/JobStatistics.java | 54 ++++++++++++++++++- .../cloud/bigquery/JobStatisticsTest.java | 18 +++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 39 ++++++++++++++ 3 files changed, 109 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 5979afbca7..c600f6a198 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -21,6 +21,7 @@ import com.google.api.services.bigquery.model.JobStatistics2; import com.google.api.services.bigquery.model.JobStatistics3; import com.google.api.services.bigquery.model.JobStatistics4; +import com.google.api.services.bigquery.model.JobStatistics5; import com.google.api.services.bigquery.model.QueryParameter; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; @@ -51,14 +52,36 @@ public abstract class JobStatistics implements Serializable { /** A Google BigQuery Copy Job statistics. */ public static class CopyStatistics extends JobStatistics { - private static final long serialVersionUID = 8218325588441660938L; + private static final long serialVersionUID = 8218325588441660939L; + + private final Long copiedLogicalBytes; + + private final Long copiedRows; static final class Builder extends JobStatistics.Builder { + private Long copiedLogicalBytes; + + private Long copiedRows; + private Builder() {} private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsPb) { super(statisticsPb); + if (statisticsPb.getCopy() != null) { + this.copiedLogicalBytes = statisticsPb.getCopy().getCopiedLogicalBytes(); + this.copiedRows = statisticsPb.getCopy().getCopiedRows(); + } + } + + Builder setCopiedLogicalBytes(long copiedLogicalBytes) { + this.copiedLogicalBytes = copiedLogicalBytes; + return self(); + } + + Builder setCopiedRows(long copiedRows) { + this.copiedRows = copiedRows; + return self(); } @Override @@ -69,6 +92,25 @@ CopyStatistics build() { private CopyStatistics(Builder builder) { super(builder); + this.copiedLogicalBytes = builder.copiedLogicalBytes; + this.copiedRows = builder.copiedRows; + } + + /** Returns number of logical bytes copied to the destination table. */ + public Long getCopiedLogicalBytes() { + return copiedLogicalBytes; + } + + /** Returns number of rows copied to the destination table. */ + public Long getCopiedRows() { + return copiedRows; + } + + @Override + ToStringHelper toStringHelper() { + return super.toStringHelper() + .add("copiedLogicalBytes", copiedLogicalBytes) + .add("copiedRows", copiedRows); } @Override @@ -81,7 +123,15 @@ public final boolean equals(Object obj) { @Override public final int hashCode() { - return baseHashCode(); + return Objects.hash(baseHashCode(), copiedLogicalBytes, copiedRows); + } + + @Override + com.google.api.services.bigquery.model.JobStatistics toPb() { + JobStatistics5 copyStatisticsPb = new JobStatistics5(); + copyStatisticsPb.setCopiedLogicalBytes(copiedLogicalBytes); + copyStatisticsPb.setCopiedRows(copiedRows); + return super.toPb().setCopy(copyStatisticsPb); } static Builder newBuilder() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 5502b84720..24344514e0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -85,11 +85,15 @@ public class JobStatisticsTest { private static final Long SLOTMS = 12545L; private static final String TRANSACTION_ID = UUID.randomUUID().toString().substring(0, 8); private static final String SESSION_ID = UUID.randomUUID().toString().substring(0, 8); + private static final Long COPIED_ROW = 1L; + private static final Long COPIED_LOGICAL_BYTES = 2L; private static final CopyStatistics COPY_STATISTICS = CopyStatistics.newBuilder() .setCreationTimestamp(CREATION_TIME) .setEndTime(END_TIME) .setStartTime(START_TIME) + .setCopiedRows(COPIED_ROW) + .setCopiedLogicalBytes(COPIED_LOGICAL_BYTES) .build(); private static final ExtractStatistics EXTRACT_STATISTICS = ExtractStatistics.newBuilder() @@ -262,6 +266,12 @@ public void testBuilder() { assertEquals(FILE_COUNT, EXTRACT_STATISTICS.getDestinationUriFileCounts()); assertEquals(INPUT_BYTES, EXTRACT_STATISTICS.getInputBytes()); + assertEquals(CREATION_TIME, COPY_STATISTICS.getCreationTime()); + assertEquals(START_TIME, COPY_STATISTICS.getStartTime()); + assertEquals(END_TIME, COPY_STATISTICS.getEndTime()); + assertEquals(COPIED_LOGICAL_BYTES, COPY_STATISTICS.getCopiedLogicalBytes()); + assertEquals(COPIED_ROW, COPY_STATISTICS.getCopiedRows()); + assertEquals(CREATION_TIME, LOAD_STATISTICS.getCreationTime()); assertEquals(START_TIME, LOAD_STATISTICS.getStartTime()); assertEquals(END_TIME, LOAD_STATISTICS.getEndTime()); @@ -334,6 +344,7 @@ public void testBuilder() { public void testToPbAndFromPb() { compareExtractStatistics( EXTRACT_STATISTICS, ExtractStatistics.fromPb(EXTRACT_STATISTICS.toPb())); + compareCopyStatistics(COPY_STATISTICS, CopyStatistics.fromPb(COPY_STATISTICS.toPb())); compareLoadStatistics(LOAD_STATISTICS, LoadStatistics.fromPb(LOAD_STATISTICS.toPb())); compareQueryStatistics(QUERY_STATISTICS, QueryStatistics.fromPb(QUERY_STATISTICS.toPb())); compareStatistics(COPY_STATISTICS, CopyStatistics.fromPb(COPY_STATISTICS.toPb())); @@ -400,6 +411,13 @@ private void compareExtractStatistics(ExtractStatistics expected, ExtractStatist assertEquals(expected.getInputBytes(), value.getInputBytes()); } + private void compareCopyStatistics(CopyStatistics expected, CopyStatistics value) { + assertEquals(expected, value); + compareStatistics(expected, value); + assertEquals(expected.getCopiedLogicalBytes(), value.getCopiedLogicalBytes()); + assertEquals(expected.getCopiedRows(), value.getCopiedRows()); + } + private void compareLoadStatistics(LoadStatistics expected, LoadStatistics value) { assertEquals(expected, value); compareStatistics(expected, value); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 3fd084a638..0a589e9edc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -90,6 +90,7 @@ import com.google.cloud.bigquery.JobId; import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; +import com.google.cloud.bigquery.JobStatistics.CopyStatistics; import com.google.cloud.bigquery.JobStatistics.ExtractStatistics; import com.google.cloud.bigquery.JobStatistics.LoadStatistics; import com.google.cloud.bigquery.JobStatistics.QueryStatistics; @@ -5042,11 +5043,18 @@ public void testCopyJob() throws InterruptedException, TimeoutException { assertNotNull(createdTable); assertEquals(DATASET, createdTable.getTableId().getDataset()); assertEquals(sourceTableName, createdTable.getTableId().getTable()); + TableId destinationTable = TableId.of(DATASET, destinationTableName); CopyJobConfiguration configuration = CopyJobConfiguration.of(destinationTable, sourceTable); Job remoteJob = bigquery.create(JobInfo.of(configuration)); remoteJob = remoteJob.waitFor(); assertNull(remoteJob.getStatus().getError()); + + CopyStatistics copyStatistics = remoteJob.getStatistics(); + assertNotNull(copyStatistics); + assertEquals(0, copyStatistics.getCopiedRows().longValue()); + assertEquals(0, copyStatistics.getCopiedLogicalBytes().longValue()); + Table remoteTable = bigquery.getTable(DATASET, destinationTableName); assertNotNull(remoteTable); assertEquals(destinationTable.getDataset(), remoteTable.getTableId().getDataset()); @@ -5056,6 +5064,37 @@ public void testCopyJob() throws InterruptedException, TimeoutException { assertTrue(remoteTable.delete()); } + @Test + public void testCopyJobStatistics() throws InterruptedException, TimeoutException { + String sourceTableName = "test_copy_job_statistics_source_table"; + String destinationTableName = "test_copy_job_statistics_destination_table"; + + QueryJobConfiguration createTable = + QueryJobConfiguration.newBuilder( + String.format( + "CREATE TABLE %s AS SELECT num FROM UNNEST(GENERATE_ARRAY(0,5)) as num", + sourceTableName)) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .build(); + bigquery.query(createTable); + + // Copy the created table. + TableId sourceTable = TableId.of(DATASET, sourceTableName); + TableId destinationTable = TableId.of(DATASET, destinationTableName); + CopyJobConfiguration configuration = CopyJobConfiguration.of(destinationTable, sourceTable); + Job remoteJob = bigquery.create(JobInfo.of(configuration)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + + CopyStatistics copyStatistics = remoteJob.getStatistics(); + assertNotNull(copyStatistics); + assertEquals(6, copyStatistics.getCopiedRows().longValue()); + // Assert != 0 since copied logical bytes is may return non-deterministic value due to how the + // data is represented. + assertNotEquals(0, copyStatistics.getCopiedLogicalBytes().longValue()); + } + @Test public void testSnapshotTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; From 14d1d875c6fe599b32e23358f1c5bcd4f0fffac7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:21:44 -0400 Subject: [PATCH 1636/2268] chore(main): release 2.38.3-SNAPSHOT (#3201) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ef726795cd..a931b0dd70 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.2 + 2.38.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index a37ce9c8da..37799ec4ef 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.2 + 2.38.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2 + 2.38.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f307ff2475..c265185489 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.2 + 2.38.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.2 + 2.38.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 100b6ce943..9ed52f8779 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.2 + 2.38.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2 + 2.38.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fea7df554e..df5e529f30 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2 + 2.38.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4540e1564a..3d8630e02e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.2:2.38.2 \ No newline at end of file +google-cloud-bigquery:2.38.2:2.38.3-SNAPSHOT \ No newline at end of file From a6402b16ffa8ab473c415cf87a6b2e0d8068e3dc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 28 Mar 2024 15:02:52 +0100 Subject: [PATCH 1637/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.37.0 (#3214) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1e424351a9..ef2191a675 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.36.0 + 2.37.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index df5e529f30..a62cf6b6bc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.36.0 + 2.37.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9a0220be43..0d5be75283 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.36.0 + 2.37.0 test From d40ddfa4887bab63dba6404208cfd9b3047cb350 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 2 Apr 2024 16:41:15 +0200 Subject: [PATCH 1638/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.41.0 (#3218) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9ed52f8779..d461cb4cb0 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.40.0 + 2.41.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ef2191a675..753d392d2f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.40.0 + 2.41.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a62cf6b6bc..c2e77488ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.40.0 + 2.41.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0d5be75283..83087dd885 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.40.0 + 2.41.0 test From 9d71b8b9a9231ea5d7cfa93c7bcbb533d6a3a900 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 2 Apr 2024 16:41:42 +0200 Subject: [PATCH 1639/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.41.0 (#3219) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d461cb4cb0..575022c2ff 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.40.0 + 2.41.0 test From 21ae09ce2c63f790ca77cc5c4c0df16dcb123b59 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 2 Apr 2024 16:42:09 +0200 Subject: [PATCH 1640/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.45.0 (#3220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.45.0 * 🦉 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 --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f824e61991..a78760c898 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.34.0') +implementation platform('com.google.cloud:libraries-bom:26.35.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 575022c2ff..f45ba8b7b8 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.44.0 + 1.45.0 pom import From 2740076f072b0ccc65aa51d534ea33d188bf85e0 Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 8 Apr 2024 11:46:19 -0700 Subject: [PATCH 1641/2268] testing: reorder test to avoid racing (#3232) Test involves working with a source table and a job that uses the table as an input. Reorders the cleanup until after the job is complete to avoid possible racing with deletion before completion. Fixes: https://togithub.com/googleapis/java-bigquery/issues/3212 --- README.md | 2 +- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a78760c898..cc0001a9ce 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.35.0') +implementation platform('com.google.cloud:libraries-bom:26.37.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 0a589e9edc..7e6da2b277 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5021,13 +5021,12 @@ public void testCreateAndGetJobWithSelectedFields() assertNull(remoteJob.getStatus()); assertNull(remoteJob.getSelfLink()); assertNull(remoteJob.getUserEmail()); - assertTrue(createdTable.delete()); - Job completedJob = remoteJob.waitFor( RetryOption.initialRetryDelay(Duration.ofSeconds(1)), RetryOption.totalTimeout(Duration.ofMinutes(1))); assertNotNull(completedJob); + assertTrue(createdTable.delete()); assertNull(completedJob.getStatus().getError()); assertTrue(bigquery.delete(destinationTable)); } From 43409c9fa879de27087763e2a2b04c4d0582429b Mon Sep 17 00:00:00 2001 From: shollyman Date: Tue, 9 Apr 2024 10:32:16 -0700 Subject: [PATCH 1642/2268] testing: address another possible test flake (#3234) Another case of deleting resource before job may be done using it. Fixes: https://togithub.com/googleapis/java-bigquery/issues/3208 --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 7e6da2b277..9980e69f83 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -4973,12 +4973,11 @@ public void testCreateAndGetJob() throws InterruptedException, TimeoutException assertNotNull(remoteJob.getStatus()); assertEquals(createdJob.getSelfLink(), remoteJob.getSelfLink()); assertEquals(createdJob.getUserEmail(), remoteJob.getUserEmail()); - assertTrue(createdTable.delete()); Job completedJob = remoteJob.waitFor(RetryOption.totalTimeout(Duration.ofMinutes(1))); - assertNotNull(completedJob); assertNull(completedJob.getStatus().getError()); + assertTrue(createdTable.delete()); assertTrue(bigquery.delete(destinationTable)); } From 7d4fc61fcd546ef664b23550b173abf11437a087 Mon Sep 17 00:00:00 2001 From: Alice <65933803+alicejli@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:02:08 -0400 Subject: [PATCH 1643/2268] chore: include recommended_package in repo-metadata.json (#3241) --- .repo-metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.repo-metadata.json b/.repo-metadata.json index d795a9ea62..278b4ea8e9 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -13,5 +13,6 @@ "codeowner_team": "@googleapis/api-bigquery", "api_id": "bigquery.googleapis.com", "library_type": "GAPIC_MANUAL", - "requires_billing": true + "requires_billing": true, + "recommended_package": "com.google.cloud.bigquery" } From 4e65fcfb91775b04d8db3162f549770f1d4d4777 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 17 Apr 2024 16:18:40 +0200 Subject: [PATCH 1644/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.43.0 (#3224) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f45ba8b7b8..32ca292a7c 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.41.0 + 2.43.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 753d392d2f..508e4432a3 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.41.0 + 2.43.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c2e77488ab..6a2093ab5e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.41.0 + 2.43.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 83087dd885..5e636d072a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.41.0 + 2.43.0 test From a8973067348fa09acd91c5b01f048c43fac93894 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 17 Apr 2024 18:01:12 +0200 Subject: [PATCH 1645/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.43.0 (#3225) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32ca292a7c..6c84b203d6 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.41.0 + 2.43.0 test From d45d168bf53a8648e2254c8c4305a5d9a390276d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 17 Apr 2024 18:48:38 +0200 Subject: [PATCH 1646/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.47.0 (#3226) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c84b203d6..d79a4ed09e 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.45.0 + 1.47.0 pom import From 975df05b95b714c5574155d5e09860885c4b58f2 Mon Sep 17 00:00:00 2001 From: Anoop Johnson Date: Wed, 17 Apr 2024 10:03:55 -0700 Subject: [PATCH 1647/2268] feat: Add support for ObjectMetadata (#3217) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add support for ObjectMetadata Fixes #3216 * 🦉 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 --- .../bigquery/ExternalTableDefinition.java | 50 +++++++++++++++++++ .../bigquery/ExternalTableDefinitionTest.java | 3 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 43 ++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index d307b82321..9f8aa40124 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -180,6 +180,12 @@ public Builder setHivePartitioningOptions(HivePartitioningOptions hivePartitioni abstract Builder setHivePartitioningOptionsInner( HivePartitioningOptions hivePartitioningOptions); + public Builder setObjectMetadata(String objectMetadata) { + return setObjectMetadataInner(objectMetadata); + } + + abstract Builder setObjectMetadataInner(String objectMetadata); + /** Creates an {@code ExternalTableDefinition} object. */ @Override public abstract ExternalTableDefinition build(); @@ -255,6 +261,21 @@ public String getFileSetSpecType() { @Nullable public abstract ImmutableList getSourceUrisImmut(); + /** + * Returns the object metadata. + * + * @see + * ObjectMetadata + */ + @Nullable + public String getObjectMetadata() { + return getObjectMetadataInner(); + } + + @Nullable + abstract String getObjectMetadataInner(); + /** * Returns the source format, and possibly some parsing options, of the external data. Supported * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. @@ -362,6 +383,10 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC externalConfigurationPb.setFileSetSpecType(getFileSetSpecType()); } + if (getObjectMetadata() != null) { + externalConfigurationPb.setObjectMetadata(getObjectMetadata()); + } + return externalConfigurationPb; } @@ -426,6 +451,24 @@ public static Builder newBuilder(String sourceUri, FormatOptions format) { return newBuilder().setSourceUris(ImmutableList.of(sourceUri)).setFormatOptions(format); } + /** + * Creates a builder for an ExternalTableDefinition object. + * + * @param sourceUri the fully-qualified URIs that point to your data in Google Cloud. For Google + * Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and + * valid HTTPS URL for a Google Cloud Bigtable table. Size limits related to load jobs apply + * to external data sources, plus an additional limit of 10 GB maximum size across all URIs. + * @return a builder for an ExternalTableDefinition object given source URIs and format + * @see Quota + * @see + * Source Format + */ + public static Builder newBuilder(String sourceUri) { + checkArgument(!isNullOrEmpty(sourceUri), "Provided sourceUri is null or empty"); + return newBuilder().setSourceUris(ImmutableList.of(sourceUri)); + } + /** * Creates an ExternalTableDefinition object. * @@ -534,6 +577,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (externalDataConfiguration.getFileSetSpecType() != null) { builder.setFileSetSpecType(externalDataConfiguration.getFileSetSpecType()); } + if (externalDataConfiguration.getObjectMetadata() != null) { + builder.setObjectMetadata(externalDataConfiguration.getObjectMetadata()); + } } return builder.build(); } @@ -597,6 +643,10 @@ static ExternalTableDefinition fromExternalDataConfiguration( builder.setFileSetSpecType(externalDataConfiguration.getFileSetSpecType()); } + if (externalDataConfiguration.getObjectMetadata() != null) { + builder.setObjectMetadata(externalDataConfiguration.getObjectMetadata()); + } + return builder.build(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 3e67ad9599..ed56598916 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -58,6 +58,7 @@ public class ExternalTableDefinitionTest { .setMode("AUTO") .setSourceUriPrefix(SOURCE_URIS.get(0)) .build(); + private static final String OBJECT_METADATA = "SIMPLE"; private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") @@ -68,6 +69,7 @@ public class ExternalTableDefinitionTest { .setMaxBadRecords(MAX_BAD_RECORDS) .setAutodetect(AUTODETECT) .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) + .setObjectMetadata(OBJECT_METADATA) .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = @@ -167,5 +169,6 @@ private void compareExternalTableDefinition( assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.getAutodetect(), value.getAutodetect()); assertEquals(expected.getHivePartitioningOptions(), value.getHivePartitioningOptions()); + assertEquals(expected.getObjectMetadata(), value.getObjectMetadata()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9980e69f83..9f5c6edd87 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6579,6 +6579,49 @@ public void testExternalTableMetadataCachingNotEnable() throws InterruptedExcept assertTrue(remoteTable.delete()); } + @Test + public void testObjectTable() throws InterruptedException { + String tableName = "test_object_table"; + TableId tableId = TableId.of(DATASET, tableName); + + String sourceUri = "gs://" + BUCKET + "/" + JSON_LOAD_FILE; + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder(sourceUri) + .setConnectionId( + "projects/java-docs-samples-testing/locations/us/connections/DEVREL_TEST_CONNECTION") + .setObjectMetadata("SIMPLE") + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + Table createdTable = bigquery.create(tableInfo); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + + try { + assertTrue(remoteTable.getDefinition() instanceof ExternalTableDefinition); + assertEquals(createdTable.getTableId(), remoteTable.getTableId()); + assertEquals( + "SIMPLE", ((ExternalTableDefinition) remoteTable.getDefinition()).getObjectMetadata()); + assertNotNull(remoteTable.getDefinition().getSchema().getFields().get("uri")); + + String query = String.format("SELECT * FROM %s.%s", DATASET, tableName); + QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); + + Job remoteJob = bigquery.create(JobInfo.of(config)); + remoteJob = remoteJob.waitFor(); + assertNull(remoteJob.getStatus().getError()); + + Job queryJob = bigquery.getJob(remoteJob.getJobId()); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + assertNotNull(statistics); + assertThat(statistics.getTotalBytesProcessed()).isGreaterThan(0); + } finally { + assertTrue(remoteTable.delete()); + } + } + static GoogleCredentials loadCredentials(String credentialFile) { try { InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); From 2c3399dd10fecc01237158a3cdeee966b38746f2 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:02:07 -0400 Subject: [PATCH 1648/2268] feat: Add Range object to allow reading range value (#3236) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add Range object to allow reading range value This PR also adds the ability to use Range query parameter * fix: lint error * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add IT test for listTableData with Range value * Change Range get[Start, End] to return FieldValue * Fix QueryParameterValueTest * Update FieldValue to include type for Range values --------- Co-authored-by: Owl Bot --- .../cloud/bigquery/FieldElementType.java | 11 ++ .../com/google/cloud/bigquery/FieldValue.java | 28 ++++- .../cloud/bigquery/QueryParameterValue.java | 65 ++++++++++ .../java/com/google/cloud/bigquery/Range.java | 114 +++++++++++++++++ .../cloud/bigquery/FieldElementTypeTest.java | 6 + .../google/cloud/bigquery/FieldValueTest.java | 10 ++ .../bigquery/QueryParameterValueTest.java | 65 ++++++++++ .../com/google/cloud/bigquery/RangeTest.java | 100 +++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 117 ++++++++++++++++-- 9 files changed, 508 insertions(+), 8 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java index 43446e1d01..de601151e1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldElementType.java @@ -15,6 +15,7 @@ */ package com.google.cloud.bigquery; +import com.google.api.services.bigquery.model.QueryParameterType; import com.google.api.services.bigquery.model.TableFieldSchema; import com.google.auto.value.AutoValue; import java.io.Serializable; @@ -60,4 +61,14 @@ static FieldElementType fromPb(TableFieldSchema.RangeElementType rangeElementTyp } return null; } + + /** Creates an instance of FieldElementType from QueryParameterType with RangeElementType. */ + static FieldElementType fromPb(QueryParameterType queryParameterTypePb) { + // Treat a FieldElementType message without a Type subfield as invalid. + if ((queryParameterTypePb.getRangeElementType() != null) + && (queryParameterTypePb.getRangeElementType().getType() != null)) { + return newBuilder().setType(queryParameterTypePb.getRangeElementType().getType()).build(); + } + return null; + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index ea68075f7f..a28f2ed61b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -67,7 +67,10 @@ public enum Attribute { REPEATED, /** A {@code FieldValue} for a field of type {@link LegacySQLTypeName#RECORD}. */ - RECORD + RECORD, + + /** A {@code FieldValue} for a field of type {@link LegacySQLTypeName#RANGE}. */ + RANGE } private FieldValue(Attribute attribute, Object value) { @@ -229,6 +232,23 @@ public BigDecimal getNumericValue() { return new BigDecimal(getStringValue()); } + /** + * Returns this field's value as a {@link Range}. This method should only be used * if the + * corresponding field has {@link LegacySQLTypeName#RANGE} type. + * + * @throws ClassCastException if the field is not a primitive type + * @throws IllegalArgumentException if the field's value could not be converted to {@link Range} + * @throws NullPointerException if {@link #isNull()} returns {@code true} + */ + @SuppressWarnings("unchecked") + public Range getRangeValue() { + if (attribute == Attribute.RANGE) { + return (Range) value; + } + // Provide best effort to convert value to Range object. + return Range.of(getStringValue()); + } + /** * Returns this field's value as a list of {@link FieldValue}. This method should only be used if * the corresponding field has {@link Field.Mode#REPEATED} mode (i.e. {@link #getAttribute()} is @@ -332,6 +352,12 @@ static FieldValue fromPb(Object cellPb, Field recordSchema) { return FieldValue.of(Attribute.PRIMITIVE, null); } if (cellPb instanceof String) { + if ((recordSchema != null) + && (recordSchema.getType() == LegacySQLTypeName.RANGE) + && (recordSchema.getRangeElementType() != null)) { + return FieldValue.of( + Attribute.RANGE, Range.of((String) cellPb, recordSchema.getRangeElementType())); + } return FieldValue.of(Attribute.PRIMITIVE, cellPb); } if (cellPb instanceof List) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index 85ebd2957b..a7469a3a68 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -22,6 +22,7 @@ import static org.threeten.bp.temporal.ChronoField.SECOND_OF_MINUTE; import com.google.api.services.bigquery.model.QueryParameterType; +import com.google.api.services.bigquery.model.RangeValue; import com.google.auto.value.AutoValue; import com.google.cloud.Timestamp; import com.google.common.base.Function; @@ -141,6 +142,13 @@ public Builder setStructValues(Map structValues) { abstract Builder setStructValuesInner(Map structValues); + /** Sets range values. The type must set to RANGE. */ + public Builder setRangeValues(Range range) { + return setRangeValuesInner(range); + } + + abstract Builder setRangeValuesInner(Range range); + /** Sets the parameter data type. */ public abstract Builder setType(StandardSQLTypeName type); @@ -184,6 +192,15 @@ public Map getStructValues() { @Nullable abstract Map getStructValuesInner(); + /** Returns the struct values of this parameter. The returned map, if not null, is immutable. */ + @Nullable + public Range getRangeValues() { + return getRangeValuesInner(); + } + + @Nullable + abstract Range getRangeValuesInner(); + /** Returns the data type of this parameter. */ public abstract StandardSQLTypeName getType(); @@ -333,6 +350,14 @@ public static QueryParameterValue interval(PeriodDuration value) { return of(value, StandardSQLTypeName.INTERVAL); } + /** Creates a {@code QueryParameterValue} object with a type of RANGE. */ + public static QueryParameterValue range(Range value) { + return QueryParameterValue.newBuilder() + .setRangeValues(value) + .setType(StandardSQLTypeName.RANGE) + .build(); + } + /** * Creates a {@code QueryParameterValue} object with a type of ARRAY, and an array element type * based on the given class. @@ -442,6 +467,8 @@ private static String valueToStringOrNull(T value, StandardSQLTypeName type) throw new IllegalArgumentException("Cannot convert STRUCT to String value"); case ARRAY: throw new IllegalArgumentException("Cannot convert ARRAY to String value"); + case RANGE: + throw new IllegalArgumentException("Cannot convert RANGE to String value"); case TIMESTAMP: if (value instanceof Long) { Timestamp timestamp = Timestamp.ofTimeMicroseconds((Long) value); @@ -517,6 +544,22 @@ com.google.api.services.bigquery.model.QueryParameterValue toValuePb() { } valuePb.setStructValues(structValues); } + if (getType() == StandardSQLTypeName.RANGE) { + RangeValue rangeValue = new RangeValue(); + if (!getRangeValues().getStart().isNull()) { + com.google.api.services.bigquery.model.QueryParameterValue startValue = + new com.google.api.services.bigquery.model.QueryParameterValue(); + startValue.setValue(getRangeValues().getStart().getStringValue()); + rangeValue.setStart(startValue); + } + if (!getRangeValues().getEnd().isNull()) { + com.google.api.services.bigquery.model.QueryParameterValue endValue = + new com.google.api.services.bigquery.model.QueryParameterValue(); + endValue.setValue(getRangeValues().getEnd().getStringValue()); + rangeValue.setEnd(endValue); + } + valuePb.setRangeValue(rangeValue); + } return valuePb; } @@ -544,6 +587,13 @@ QueryParameterType toTypePb() { } typePb.setStructTypes(structTypes); } + if (getType() == StandardSQLTypeName.RANGE + && getRangeValues() != null + && getRangeValues().getType() != null) { + QueryParameterType rangeTypePb = new QueryParameterType(); + rangeTypePb.setType(getRangeValues().getType().getType()); + typePb.setRangeElementType(rangeTypePb); + } return typePb; } @@ -592,6 +642,21 @@ static QueryParameterValue fromPb( } valueBuilder.setStructValues(structValues); } + } else if (type == StandardSQLTypeName.RANGE) { + Range.Builder range = Range.newBuilder(); + if (valuePb.getRangeValue() != null) { + com.google.api.services.bigquery.model.RangeValue rangeValuePb = valuePb.getRangeValue(); + if (rangeValuePb.getStart() != null && rangeValuePb.getStart().getValue() != null) { + range.setStart(valuePb.getRangeValue().getStart().getValue()); + } + if (rangeValuePb.getEnd() != null && rangeValuePb.getEnd().getValue() != null) { + range.setEnd(valuePb.getRangeValue().getEnd().getValue()); + } + } + if (typePb.getRangeElementType() != null && typePb.getRangeElementType().getType() != null) { + range.setType(FieldElementType.fromPb(typePb)); + } + valueBuilder.setRangeValues(range.build()); } else { valueBuilder.setValue(valuePb == null ? "" : valuePb.getValue()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java new file mode 100644 index 0000000000..198bd28faa --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java @@ -0,0 +1,114 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.auto.value.AutoValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import java.io.Serializable; +import javax.annotation.Nullable; + +@AutoValue +public abstract class Range implements Serializable { + private static final long serialVersionUID = 1L; + + /** Returns the start value of the range. A null value represents an unbounded start. */ + public FieldValue getStart() { + // The supported Range types [DATE, TIME, TIMESTAMP] are all Attribute.PRIMITIVE. + return FieldValue.of(Attribute.PRIMITIVE, getStartInner()); + } + + @Nullable + abstract String getStartInner(); + + /** Returns the end value of the range. A null value represents an unbounded end. */ + public FieldValue getEnd() { + // The supported Range types [DATE, TIME, TIMESTAMP] are all Attribute.PRIMITIVE. + return FieldValue.of(Attribute.PRIMITIVE, getEndInner()); + } + + @Nullable + abstract String getEndInner(); + + /** Returns the type of the range. */ + @Nullable + public abstract FieldElementType getType(); + + public abstract Range.Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + + public Range.Builder setStart(String start) { + return setStartInner(start); + } + + abstract Range.Builder setStartInner(String start); + + public Range.Builder setEnd(String end) { + return setEndInner(end); + } + + abstract Range.Builder setEndInner(String end); + + public abstract Range.Builder setType(FieldElementType type); + + public abstract Range build(); + } + + /** Creates a range builder. Supported StandardSQLTypeName are [DATE, DATETIME, TIMESTAMP] */ + public static Builder newBuilder() { + return new AutoValue_Range.Builder(); + } + + public static Range of(String value) throws IllegalArgumentException { + return of(value, null); + } + + /** + * Creates an instance of {@code Range} from a string representation. + * + *

    The expected string format is: "[start, end)", where start and end are string format of + * [DATE, TIME, TIMESTAMP]. + */ + public static Range of(String value, FieldElementType type) throws IllegalArgumentException { + checkNotNull(value); + Range.Builder builder = newBuilder(); + if (type != null) { + builder.setType(type); + } + String[] startEnd = value.split(", ", 2); // Expect an extra space after ','. + if (startEnd.length != 2) { + throw new IllegalArgumentException( + String.format("Expected Range value string to be [start, end) and got %s", value)); + } + + String start = startEnd[0].substring(1); // Ignore the [ + String end = startEnd[1].substring(0, startEnd[1].length() - 1); // Ignore the ) + if (start.equalsIgnoreCase("UNBOUNDED") || (start.equalsIgnoreCase("NULL"))) { + builder.setStart(null); + } else { + builder.setStart(start); + } + if (end.equalsIgnoreCase("UNBOUNDED") || (end.equalsIgnoreCase("NULL"))) { + builder.setEnd(null); + } else { + builder.setEnd(end); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java index 9b45908929..cf217b25c7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java @@ -17,6 +17,7 @@ import static org.junit.Assert.assertEquals; +import com.google.api.services.bigquery.model.QueryParameterType; import org.junit.Test; public class FieldElementTypeTest { @@ -36,6 +37,11 @@ public void testBuilder() { @Test public void testFromAndPb() { assertEquals(FIELD_ELEMENT_TYPE, FieldElementType.fromPb(FIELD_ELEMENT_TYPE.toPb())); + assertEquals( + FIELD_ELEMENT_TYPE, + FieldElementType.fromPb( + new QueryParameterType() + .setRangeElementType(new QueryParameterType().setType("DATE")))); } private void compareFieldElementType(FieldElementType expected, FieldElementType value) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index 90cb690618..eaebe35671 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -55,6 +55,9 @@ public class FieldValueTest { private static final Map BYTES_FIELD = ImmutableMap.of("v", BYTES_BASE64); private static final Map NULL_FIELD = ImmutableMap.of("v", Data.nullOf(String.class)); + + private static final Map RANGE_FIELD = ImmutableMap.of("v", "[start, end)"); + private static final Map REPEATED_FIELD = ImmutableMap.of("v", ImmutableList.of(INTEGER_FIELD, INTEGER_FIELD)); private static final Map RECORD_FIELD = @@ -99,6 +102,9 @@ public void testFromPb() { assertArrayEquals(BYTES, value.getBytesValue()); value = FieldValue.fromPb(NULL_FIELD); assertNull(value.getValue()); + value = FieldValue.fromPb(RANGE_FIELD); + assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); + assertEquals(Range.of(RANGE_FIELD.get("v")), value.getRangeValue()); value = FieldValue.fromPb(REPEATED_FIELD); assertEquals(FieldValue.Attribute.REPEATED, value.getAttribute()); assertEquals(FieldValue.fromPb(INTEGER_FIELD), value.getRepeatedValue().get(0)); @@ -156,6 +162,10 @@ public void testEquals() { assertEquals(nullValue, FieldValue.fromPb(NULL_FIELD)); assertEquals(nullValue.hashCode(), FieldValue.fromPb(NULL_FIELD).hashCode()); + FieldValue rangeValue = FieldValue.of(FieldValue.Attribute.PRIMITIVE, "[start, end)"); + assertEquals(rangeValue, FieldValue.fromPb(RANGE_FIELD)); + assertEquals(rangeValue.hashCode(), FieldValue.fromPb(RANGE_FIELD).hashCode()); + FieldValue repeatedValue = FieldValue.of(FieldValue.Attribute.REPEATED, ImmutableList.of(integerValue, integerValue)); assertEquals(repeatedValue, FieldValue.fromPb(REPEATED_FIELD)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index 0534865b23..e0ea9d68dd 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -619,4 +619,69 @@ private static void assertArrayDataEquals( assertThat(value.getArrayValues()).isNull(); } } + + @Test + public void testRange() { + testRangeDataEquals(null, null, FieldElementType.newBuilder().setType("DATE").build()); + testRangeDataEquals(null, "1971-02-03", FieldElementType.newBuilder().setType("DATE").build()); + testRangeDataEquals("1970-01-02", null, FieldElementType.newBuilder().setType("DATE").build()); + testRangeDataEquals( + "1970-01-02", "1971-02-03", FieldElementType.newBuilder().setType("DATE").build()); + + testRangeDataEquals(null, null, FieldElementType.newBuilder().setType("DATETIME").build()); + testRangeDataEquals( + null, + "2015-09-20 06:41:35.220000", + FieldElementType.newBuilder().setType("DATETIME").build()); + testRangeDataEquals( + "2014-08-19 05:41:35.220000", + null, + FieldElementType.newBuilder().setType("DATETIME").build()); + testRangeDataEquals( + "2014-08-19 05:41:35.220000", + "2015-09-20 06:41:35.220000", + FieldElementType.newBuilder().setType("DATETIME").build()); + + testRangeDataEquals(null, null, FieldElementType.newBuilder().setType("TIMESTAMP").build()); + testRangeDataEquals( + null, + "2015-09-20 13:41:35.220000+01:00", + FieldElementType.newBuilder().setType("TIMESTAMP").build()); + testRangeDataEquals( + "2014-08-19 12:41:35.220000+00:00", + null, + FieldElementType.newBuilder().setType("TIMESTAMP").build()); + testRangeDataEquals( + "2014-08-19 12:41:35.220000+00:00", + "2015-09-20 13:41:35.220000+01:00", + FieldElementType.newBuilder().setType("TIMESTAMP").build()); + } + + /** Helper method to test range QueryParameterValue and its permutations. */ + private static void testRangeDataEquals(String start, String end, FieldElementType type) { + QueryParameterValue rangeField = + QueryParameterValue.range( + Range.newBuilder().setType(type).setStart(start).setEnd(end).build()); + QueryParameterType parameterType = rangeField.toTypePb(); + com.google.api.services.bigquery.model.QueryParameterValue parameterValue = + rangeField.toValuePb(); + QueryParameterValue queryParameterValue = + QueryParameterValue.fromPb(parameterValue, parameterType); + + assertThat(queryParameterValue.getType()).isEqualTo(StandardSQLTypeName.RANGE); + if (start == null) { + assertThat(queryParameterValue.getRangeValues().getStart().isNull()).isTrue(); + } else { + assertThat(queryParameterValue.getRangeValues().getStart().getStringValue()).isEqualTo(start); + } + if (end == null) { + assertThat(queryParameterValue.getRangeValues().getEnd().isNull()).isTrue(); + } else { + assertThat(queryParameterValue.getRangeValues().getEnd().getStringValue()).isEqualTo(end); + } + assertThat(queryParameterValue.getRangeValues().getType()).isEqualTo(type); + assertThat(queryParameterValue.getArrayValues()).isNull(); + assertThat(queryParameterValue.getStructValues()).isNull(); + assertThat(queryParameterValue.getValue()).isNull(); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java new file mode 100644 index 0000000000..45bb83259d --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class RangeTest { + private static final Range RANGE_DATE = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .setStart("1970-01-02") + .setEnd("1970-03-04") + .build(); + + private static final Range RANGE_DATETIME = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .setStart("2014-08-19 05:41:35.220000") + .setEnd("2015-09-20 06:41:35.220000") + .build(); + + private static final Range RANGE_TIMESTAMP = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .setStart("2014-08-19 12:41:35.220000+00:00") + .setEnd("2015-09-20 13:41:35.220000+01:00") + .build(); + + @Test + public void testOf() { + compareRange(null, null, Range.of("[null, NULL)")); + compareRange(null, null, Range.of("[unbounded, UNBOUNDED)")); + compareRange(null, null, Range.of("[nUlL, uNbOuNdEd)")); + + compareRange(null, "2020-12-31", Range.of("[null, 2020-12-31)")); + compareRange("2020-01-01", null, Range.of("[2020-01-01, null)")); + compareRange("2020-01-01", "2020-12-31", Range.of("[2020-01-01, 2020-12-31)")); + } + + @Test + public void testBuilder() { + assertEquals("1970-01-02", RANGE_DATE.getStart().getStringValue()); + assertEquals("1970-03-04", RANGE_DATE.getEnd().getStringValue()); + assertEquals(FieldElementType.newBuilder().setType("DATE").build(), RANGE_DATE.getType()); + + assertEquals("2014-08-19 05:41:35.220000", RANGE_DATETIME.getStart().getStringValue()); + assertEquals("2015-09-20 06:41:35.220000", RANGE_DATETIME.getEnd().getStringValue()); + assertEquals( + FieldElementType.newBuilder().setType("DATETIME").build(), RANGE_DATETIME.getType()); + + assertEquals("2014-08-19 12:41:35.220000+00:00", RANGE_TIMESTAMP.getStart().getStringValue()); + assertEquals("2015-09-20 13:41:35.220000+01:00", RANGE_TIMESTAMP.getEnd().getStringValue()); + assertEquals( + FieldElementType.newBuilder().setType("TIMESTAMP").build(), RANGE_TIMESTAMP.getType()); + } + + @Test + public void testToBuilder() { + compareRange(RANGE_DATE, RANGE_DATE.toBuilder().build()); + compareRange(RANGE_DATETIME, RANGE_DATETIME.toBuilder().build()); + compareRange(RANGE_TIMESTAMP, RANGE_TIMESTAMP.toBuilder().build()); + } + + private static void compareRange(Range expected, Range value) { + assertEquals(expected.getStart(), value.getStart()); + assertEquals(expected.getEnd(), value.getEnd()); + assertEquals(expected.getType(), value.getType()); + assertEquals(expected.hashCode(), value.hashCode()); + assertEquals(expected.toString(), value.toString()); + } + + private static void compareRange(String expectedStart, String expectedEnd, Range range) { + if (expectedStart == null) { + assertTrue(range.getStart().isNull()); + } else { + assertEquals(expectedStart, range.getStart().getStringValue()); + } + if (expectedEnd == null) { + assertTrue(range.getEnd().isNull()); + } else { + assertEquals(expectedEnd, range.getEnd().getStringValue()); + } + } +} diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9f5c6edd87..b385fe47b5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -109,6 +109,7 @@ import com.google.cloud.bigquery.PrimaryKey; import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.Range; import com.google.cloud.bigquery.RangePartitioning; import com.google.cloud.bigquery.Routine; import com.google.cloud.bigquery.RoutineArgument; @@ -1312,14 +1313,31 @@ public void testIntervalType() throws InterruptedException { } @Test - public void testRangeType() throws InterruptedException { - String tableName = "test_create_table_rangetype"; + public void testRangeCreateTable() throws InterruptedException { + String tableName = "test_range_create_table"; TableId tableId = TableId.of(DATASET, tableName); - Schema schema = - Schema.of( - Field.newBuilder("rangeField", StandardSQLTypeName.RANGE) - .setRangeElementType(FieldElementType.newBuilder().setType("DATETIME").build()) - .build()); + Field rangeFieldWithDate = + Field.newBuilder("rangeFieldDate", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with DATE") + .setRangeElementType(FieldElementType.newBuilder().setType("DATE").build()) + .build(); + + Field rangeFieldWithDatetime = + Field.newBuilder("rangeFieldDatetime", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with DATETIME") + .setRangeElementType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build(); + + Field rangeFieldWithTimestamp = + Field.newBuilder("rangeFieldTimestamp", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with TIMESTAMP") + .setRangeElementType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build(); + + Schema schema = Schema.of(rangeFieldWithDate, rangeFieldWithDatetime, rangeFieldWithTimestamp); StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(schema); try { // Create a table with a RANGE column. @@ -1330,6 +1348,91 @@ public void testRangeType() throws InterruptedException { } } + @Test + public void testRangeType() throws InterruptedException { + // TODO: Combine testRangeType test with testRangeCreateTable test. + String tableName = "test_range_type_table"; + QueryJobConfiguration createTable = + QueryJobConfiguration.newBuilder( + String.format( + "CREATE TABLE %s AS SELECT RANGE(DATE '2020-01-01', DATE '2020-12-31') as date, \n" + + "RANGE(DATETIME '2020-01-01T12:00:00', DATETIME '2020-12-31T12:00:00') as datetime, \n" + + "RANGE(TIMESTAMP '2014-01-01 07:00:00.000000+00:00', TIMESTAMP '2015-01-01 07:00:00.000000+00:00') as timestamp", + tableName)) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .build(); + bigquery.query(createTable); + + String query = + String.format( + "SELECT date, datetime, timestamp\n" + + "FROM %s.%s\n" + + "WHERE date = @dateParam\n" + + "AND datetime = @datetimeParam\n" + + "AND timestamp = @timestampParam", + DATASET, tableName); + + Range dateRange = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .setStart("2020-01-01") + .setEnd("2020-12-31") + .build(); + Range datetimeRange = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .setStart("2020-01-01T12:00:00") + .setEnd("2020-12-31T12:00:00") + .build(); + Range timestampRange = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .setStart("2014-01-01 07:00:00.000000+00:00") + .setEnd("2015-01-01 07:00:00.000000+00:00") + .build(); + + // Test Query Parameter. + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .addNamedParameter("dateParam", QueryParameterValue.range(dateRange)) + .addNamedParameter("datetimeParam", QueryParameterValue.range(datetimeRange)) + .addNamedParameter("timestampParam", QueryParameterValue.range(timestampRange)) + .build(); + TableResult result = bigquery.query(config); + assertEquals(1, Iterables.size(result.getValues())); + for (FieldValueList values : result.iterateAll()) { + assertEquals(dateRange.getStart(), values.get("date").getRangeValue().getStart()); + assertEquals(dateRange.getEnd(), values.get("date").getRangeValue().getEnd()); + assertEquals(datetimeRange.getStart(), values.get("datetime").getRangeValue().getStart()); + assertEquals(datetimeRange.getEnd(), values.get("datetime").getRangeValue().getEnd()); + // timestamps are returned as seconds since epoch + assertEquals( + 1388559600000000L, + values.get("timestamp").getRangeValue().getStart().getTimestampValue()); + assertEquals( + 1420095600000000L, values.get("timestamp").getRangeValue().getEnd().getTimestampValue()); + } + + // Test listTableData. + Schema schema = result.getSchema(); + result = bigquery.listTableData(DATASET, tableName, schema); + assertEquals(1, Iterables.size(result.getValues())); + for (FieldValueList values : result.iterateAll()) { + assertEquals(dateRange.getStart(), values.get("date").getRangeValue().getStart()); + assertEquals(dateRange.getEnd(), values.get("date").getRangeValue().getEnd()); + assertEquals(datetimeRange.getStart(), values.get("datetime").getRangeValue().getStart()); + assertEquals(datetimeRange.getEnd(), values.get("datetime").getRangeValue().getEnd()); + // timestamps are returned as seconds since epoch + assertEquals( + 1388559600000000L, + values.get("timestamp").getRangeValue().getStart().getTimestampValue()); + assertEquals( + 1420095600000000L, values.get("timestamp").getRangeValue().getEnd().getTimestampValue()); + } + } + @Test public void testCreateTableWithConstraints() { String tableName = "test_create_table_with_constraints"; From e91be80ebdd39c2448914ff9aa1742f3079d0bb8 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:04:35 -0400 Subject: [PATCH 1649/2268] feat: Add ExportDataStats to QueryStatistics (#3244) --- .../google/cloud/bigquery/JobStatistics.java | 97 +++++++++++++++++++ .../cloud/bigquery/JobStatisticsTest.java | 12 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 24 +++++ 3 files changed, 133 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index c600f6a198..0200711d6a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -17,12 +17,14 @@ package com.google.cloud.bigquery; import com.google.api.core.ApiFunction; +import com.google.api.services.bigquery.model.ExportDataStatistics; import com.google.api.services.bigquery.model.JobConfiguration; import com.google.api.services.bigquery.model.JobStatistics2; import com.google.api.services.bigquery.model.JobStatistics3; import com.google.api.services.bigquery.model.JobStatistics4; import com.google.api.services.bigquery.model.JobStatistics5; import com.google.api.services.bigquery.model.QueryParameter; +import com.google.auto.value.AutoValue; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; import com.google.common.base.Function; @@ -32,6 +34,7 @@ import java.io.Serializable; import java.util.List; import java.util.Objects; +import javax.annotation.Nullable; import org.checkerframework.checker.nullness.compatqual.NullableDecl; /** A Google BigQuery Job statistics. */ @@ -398,6 +401,7 @@ public static class QueryStatistics extends JobStatistics { private final Long estimatedBytesProcessed; private final Long numDmlAffectedRows; private final DmlStats dmlStats; + private final ExportDataStats exportDataStats; private final List referencedTables; private final StatementType statementType; private final Long totalBytesBilled; @@ -472,6 +476,80 @@ public static StatementType[] values() { } } + /** + * Statistics for the EXPORT DATA statement as part of Query Job. EXTRACT JOB statistics are + * populated in ExtractStatistics. + */ + @AutoValue + public abstract static class ExportDataStats implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * Returns number of destination files generated in case of EXPORT DATA statement only. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract Long getFileCount(); + + /** + * Returns number of destination rows generated in case of EXPORT DATA statement only. + * + * @return value or {@code null} for none + */ + @Nullable + public abstract Long getRowCount(); + + public abstract Builder toBuilder(); + + public static Builder newBuilder() { + return new AutoValue_JobStatistics_QueryStatistics_ExportDataStats.Builder(); + } + + static ExportDataStats fromPb(ExportDataStatistics exportDataStatisticsPb) { + Builder builder = newBuilder(); + if (exportDataStatisticsPb.getFileCount() != null) { + builder.setFileCount(exportDataStatisticsPb.getFileCount()); + } + if (exportDataStatisticsPb.getRowCount() != null) { + builder.setRowCount(exportDataStatisticsPb.getRowCount()); + } + return builder.build(); + } + + ExportDataStatistics toPb() { + ExportDataStatistics exportDataStatisticsPb = new ExportDataStatistics(); + if (getFileCount() != null) { + exportDataStatisticsPb.setFileCount(getFileCount()); + } + if (getRowCount() != null) { + exportDataStatisticsPb.setRowCount(getRowCount()); + } + return exportDataStatisticsPb; + } + + @AutoValue.Builder + public abstract static class Builder { + + /** + * Number of destination files generated in case of EXPORT DATA statement only. + * + * @param fileCount fileCount or {@code null} for none + */ + public abstract Builder setFileCount(Long fileCount); + + /** + * Number of destination rows generated in case of EXPORT DATA statement only. + * + * @param rowCount rowCount or {@code null} for none + */ + public abstract Builder setRowCount(Long rowCount); + + /** Creates a {@code ExportDataStats} object. */ + public abstract ExportDataStats build(); + } + } + static final class Builder extends JobStatistics.Builder { private BiEngineStats biEngineStats; @@ -483,6 +561,7 @@ static final class Builder extends JobStatistics.Builder referencedTables; private StatementType statementType; private Long totalBytesBilled; @@ -553,6 +632,10 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP if (statisticsPb.getQuery().getDmlStats() != null) { this.dmlStats = DmlStats.fromPb(statisticsPb.getQuery().getDmlStats()); } + if (statisticsPb.getQuery().getExportDataStatistics() != null) { + this.exportDataStats = + ExportDataStats.fromPb(statisticsPb.getQuery().getExportDataStatistics()); + } } } @@ -601,6 +684,11 @@ Builder setDmlStats(DmlStats dmlStats) { return self(); } + Builder setExportDataStats(ExportDataStats exportDataStats) { + this.exportDataStats = exportDataStats; + return self(); + } + Builder setReferenceTables(List referencedTables) { this.referencedTables = referencedTables; return self(); @@ -683,6 +771,7 @@ private QueryStatistics(Builder builder) { this.estimatedBytesProcessed = builder.estimatedBytesProcessed; this.numDmlAffectedRows = builder.numDmlAffectedRows; this.dmlStats = builder.dmlStats; + this.exportDataStats = builder.exportDataStats; this.referencedTables = builder.referencedTables; this.statementType = builder.statementType; this.totalBytesBilled = builder.totalBytesBilled; @@ -749,6 +838,11 @@ public DmlStats getDmlStats() { return dmlStats; } + /** Detailed statistics for EXPORT DATA statement. */ + public ExportDataStats getExportDataStats() { + return exportDataStats; + } + /** * Referenced tables for the job. Queries that reference more than 50 tables will not have a * complete list. @@ -900,6 +994,9 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { if (dmlStats != null) { queryStatisticsPb.setDmlStats(dmlStats.toPb()); } + if (exportDataStats != null) { + queryStatisticsPb.setExportDataStatistics(exportDataStats.toPb()); + } if (referencedTables != null) { queryStatisticsPb.setReferencedTables( Lists.transform(referencedTables, TableId.TO_PB_FUNCTION)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 24344514e0..aaf4aa2b16 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -23,6 +23,7 @@ import com.google.cloud.bigquery.JobStatistics.ExtractStatistics; import com.google.cloud.bigquery.JobStatistics.LoadStatistics; import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.ExportDataStats; import com.google.cloud.bigquery.JobStatistics.ReservationUsage; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics; import com.google.cloud.bigquery.JobStatistics.ScriptStatistics.ScriptStackFrame; @@ -64,6 +65,13 @@ public class JobStatisticsTest { .setInsertedRowCount(INSERTED_ROW_COUNT) .setUpdatedRowCount(UPDATED_ROW_COUNT) .build(); + private static final Long EXPORT_DATA_STATS_ROW_COUNT = 3L; + private static final Long EXPORT_DATA_STATS_FILE_COUNT = 2L; + private static final ExportDataStats EXPORT_DATA_STATS = + ExportDataStats.newBuilder() + .setRowCount(EXPORT_DATA_STATS_ROW_COUNT) + .setFileCount(EXPORT_DATA_STATS_FILE_COUNT) + .build(); private static final QueryStatistics.StatementType STATEMENT_TYPE = QueryStatistics.StatementType.SELECT; private static final Long TOTAL_BYTES_BILLED = 24L; @@ -189,6 +197,7 @@ public class JobStatisticsTest { .setEstimatedBytesProcessed(ESTIMATE_BYTES_PROCESSED) .setNumDmlAffectedRows(NUM_DML_AFFECTED_ROWS) .setDmlStats(DML_STATS) + .setExportDataStats(EXPORT_DATA_STATS) .setReferenceTables(REFERENCED_TABLES) .setStatementType(STATEMENT_TYPE) .setTotalBytesBilled(TOTAL_BYTES_BILLED) @@ -293,6 +302,7 @@ public void testBuilder() { assertEquals(ESTIMATE_BYTES_PROCESSED, QUERY_STATISTICS.getEstimatedBytesProcessed()); assertEquals(NUM_DML_AFFECTED_ROWS, QUERY_STATISTICS.getNumDmlAffectedRows()); assertEquals(DML_STATS, QUERY_STATISTICS.getDmlStats()); + assertEquals(EXPORT_DATA_STATS, QUERY_STATISTICS.getExportDataStats()); assertEquals(REFERENCED_TABLES, QUERY_STATISTICS.getReferencedTables()); assertEquals(STATEMENT_TYPE, QUERY_STATISTICS.getStatementType()); assertEquals(TOTAL_BYTES_BILLED, QUERY_STATISTICS.getTotalBytesBilled()); @@ -448,6 +458,8 @@ private void compareQueryStatistics(QueryStatistics expected, QueryStatistics va assertEquals(expected.getMetadataCacheStats(), value.getMetadataCacheStats()); assertEquals(expected.getStatementType(), value.getStatementType()); assertEquals(expected.getTimeline(), value.getTimeline()); + assertEquals(expected.getDmlStats(), value.getDmlStats()); + assertEquals(expected.getExportDataStats(), value.getExportDataStats()); } private void compareStatistics(JobStatistics expected, JobStatistics value) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b385fe47b5..430235fba6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6734,4 +6734,28 @@ static GoogleCredentials loadCredentials(String credentialFile) { } return null; } + + @Test + public void testQueryExportStatistics() throws InterruptedException { + String query = + String.format( + "EXPORT DATA OPTIONS(\n" + + " uri='gs://%s/*.csv',\n" + + " format='CSV',\n" + + " overwrite=true,\n" + + " header=true,\n" + + " field_delimiter=';') AS\n" + + "SELECT num FROM UNNEST([1,2,3]) AS num", + BUCKET); + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); + Job job = bigquery.create(JobInfo.of(JobId.of(), config)); + job = job.waitFor(); + + QueryStatistics queryStatistics = job.getStatistics(); + assertNotNull(queryStatistics); + assertNotNull(queryStatistics.getExportDataStats()); + assertEquals(1L, queryStatistics.getExportDataStats().getFileCount().longValue()); + assertEquals(3L, queryStatistics.getExportDataStats().getRowCount().longValue()); + } } From 1bb51ede58d4dc5c12f8c85f3641f989f2f1eb88 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:07:39 -0400 Subject: [PATCH 1650/2268] chore: adding 'infrastructure-public-image-' tags for owlbot-java (#1947) (#3227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: adding 'infrastructure-public-image-' tags for owlbot-java (#1947) Source-Link: https://github.com/googleapis/synthtool/commit/349943b54f15f9f9655a3d1c35d58acb68165678 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:033161f610016d155d58f96769ad5a821d203824684e8a13fc50be8c25a5f9cf * 🦉 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 --- .github/.OwlBot.lock.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bf48c82da1..d47d3d76b1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:0d1bb26a1a99ae0456176bf891b8490e9aab424a5cb4e4d301d9703c4dc43b58 -# created: 2024-01-30T19:46:55.029238294Z + digest: sha256:033161f610016d155d58f96769ad5a821d203824684e8a13fc50be8c25a5f9cf +# created: 2024-04-04T20:03:23.876897177Z From aeedf2960700f1742e38469fd26ea70000967cfa Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Apr 2024 20:26:37 +0200 Subject: [PATCH 1651/2268] deps: update github/codeql-action action to v2.25.1 (#3229) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e29083aaba..e229d5ff77 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@a82bad71823183e5b120ab52d521460ecb0585fe # v2.24.9 + uses: github/codeql-action/upload-sarif@e949a1676c32f4c215780f7429eb9f00ff18b225 # v2.25.1 with: sarif_file: results.sarif From ee94a6ea22628a758135ef8a0e08ff31f00f20f2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:50:58 -0400 Subject: [PATCH 1652/2268] chore: owlbot-java adding the Docker tag in images section (#1949) (#3230) Source-Link: https://github.com/googleapis/synthtool/commit/4b49307944160a308513a34f73dbd6b00b6617d2 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:25b384ee1674eda3984ec41c15b514a63bbeb5eda4d57c73c7e6f5adef2fd2f1 Co-authored-by: Owl Bot Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> --- .github/.OwlBot.lock.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index d47d3d76b1..5762b69661 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,6 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:033161f610016d155d58f96769ad5a821d203824684e8a13fc50be8c25a5f9cf -# created: 2024-04-04T20:03:23.876897177Z + digest: sha256:25b384ee1674eda3984ec41c15b514a63bbeb5eda4d57c73c7e6f5adef2fd2f1 +# created: 2024-04-05T19:12:34.133475268Z + From ff1ebc66e458519deca37275ba91650133188683 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:13:45 -0400 Subject: [PATCH 1653/2268] feat: Add support for inserting Range values (#3246) * feat: Add support for inserting Range values * fix: IT assert to use size instead of const --- .../java/com/google/cloud/bigquery/Range.java | 13 + .../com/google/cloud/bigquery/RangeTest.java | 18 + .../cloud/bigquery/it/ITBigQueryTest.java | 323 ++++++++++++------ 3 files changed, 246 insertions(+), 108 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java index 198bd28faa..8d244fbeb0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Range.java @@ -19,6 +19,7 @@ import com.google.auto.value.AutoValue; import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.common.collect.ImmutableMap; import java.io.Serializable; import javax.annotation.Nullable; @@ -44,6 +45,18 @@ public FieldValue getEnd() { @Nullable abstract String getEndInner(); + /** Returns the start and end values of this range. */ + public ImmutableMap getValues() { + ImmutableMap.Builder result = ImmutableMap.builder(); + if (!getStart().isNull()) { + result.put("start", getStart().getStringValue()); + } + if (!getEnd().isNull()) { + result.put("end", getEnd().getStringValue()); + } + return result.build(); + } + /** Returns the type of the range. */ @Nullable public abstract FieldElementType getType(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java index 45bb83259d..2d98376b36 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java @@ -18,6 +18,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.google.common.collect.ImmutableMap; import org.junit.Test; public class RangeTest { @@ -77,6 +78,17 @@ public void testToBuilder() { compareRange(RANGE_TIMESTAMP, RANGE_TIMESTAMP.toBuilder().build()); } + @Test + public void testGetValues() { + compareRange(null, null, Range.of("[null, NULL)").getValues()); + compareRange(null, null, Range.of("[unbounded, UNBOUNDED)").getValues()); + compareRange(null, null, Range.of("[nUlL, uNbOuNdEd)").getValues()); + + compareRange(null, "2020-12-31", Range.of("[null, 2020-12-31)").getValues()); + compareRange("2020-01-01", null, Range.of("[2020-01-01, null)").getValues()); + compareRange("2020-01-01", "2020-12-31", Range.of("[2020-01-01, 2020-12-31)").getValues()); + } + private static void compareRange(Range expected, Range value) { assertEquals(expected.getStart(), value.getStart()); assertEquals(expected.getEnd(), value.getEnd()); @@ -97,4 +109,10 @@ private static void compareRange(String expectedStart, String expectedEnd, Range assertEquals(expectedEnd, range.getEnd().getStringValue()); } } + + private static void compareRange( + String expectedStart, String expectedEnd, ImmutableMap values) { + assertEquals(expectedStart, values.get("start")); + assertEquals(expectedEnd, values.get("end")); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 430235fba6..d78549f6ea 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -838,6 +838,157 @@ public class ITBigQueryTest { + " \"universe_domain\": \"fake.domain\"\n" + "}"; + private static final Schema RANGE_SCHEMA = + Schema.of( + Field.newBuilder("name", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("Name of the row") + .build(), + Field.newBuilder("date", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with DATE") + .setRangeElementType(FieldElementType.newBuilder().setType("DATE").build()) + .build(), + Field.newBuilder("datetime", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with DATETIME") + .setRangeElementType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build(), + Field.newBuilder("timestamp", StandardSQLTypeName.RANGE) + .setMode(Field.Mode.NULLABLE) + .setDescription("Range field with TIMESTAMP") + .setRangeElementType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()); + + private static final ImmutableMap RANGE_TEST_VALUES_DATES = + new ImmutableMap.Builder() + .put( + "bounded", + Range.newBuilder() + .setStart("2020-01-01") + .setEnd("2020-12-31") + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .build()) + .put( + "unboundedStart", + Range.newBuilder() + .setStart(null) + .setEnd("2020-12-31") + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .build()) + .put( + "unboundedEnd", + Range.newBuilder() + .setStart("2020-01-01") + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .build()) + .put( + "unbounded", + Range.newBuilder() + .setStart(null) + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .build()) + .build(); + + private static final ImmutableMap RANGE_TEST_VALUES_DATETIME = + new ImmutableMap.Builder() + .put( + "bounded", + Range.newBuilder() + .setStart("2014-08-19T05:41:35.220000") + .setEnd("2015-09-20T06:41:35.220000") + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build()) + .put( + "unboundedStart", + Range.newBuilder() + .setStart(null) + .setEnd("2015-09-20T06:41:35.220000") + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build()) + .put( + "unboundedEnd", + Range.newBuilder() + .setStart("2014-08-19T05:41:35.220000") + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build()) + .put( + "unbounded", + Range.newBuilder() + .setStart(null) + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .build()) + .build(); + + private static final ImmutableMap RANGE_TEST_VALUES_TIMESTAMP = + new ImmutableMap.Builder() + .put( + "bounded", + Range.newBuilder() + .setStart("2014-08-19 12:41:35.220000+00:00") + .setEnd("2015-09-20 13:41:35.220000+01:00") + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unboundedStart", + Range.newBuilder() + .setStart(null) + .setEnd("2015-09-20 13:41:35.220000+01:00") + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unboundedEnd", + Range.newBuilder() + .setStart("2014-08-19 12:41:35.220000+00:00") + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unbounded", + Range.newBuilder() + .setStart(null) + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .build(); + + // timestamps are returned as seconds since epoch + private static final ImmutableMap RANGE_TEST_VALUES_EXPECTED_TIMESTAMP = + new ImmutableMap.Builder() + .put( + "bounded", + Range.newBuilder() + .setStart("1408452095.220000") + .setEnd("1442752895.220000") + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unboundedStart", + Range.newBuilder() + .setStart(null) + .setEnd("1442752895.220000") + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unboundedEnd", + Range.newBuilder() + .setStart("1408452095.220000") + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .put( + "unbounded", + Range.newBuilder() + .setStart(null) + .setEnd(null) + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .build()) + .build(); + private static BigQuery bigquery; private static Storage storage; @@ -1313,123 +1464,79 @@ public void testIntervalType() throws InterruptedException { } @Test - public void testRangeCreateTable() throws InterruptedException { - String tableName = "test_range_create_table"; + public void testRangeType() throws InterruptedException { + String tableName = "test_range_type_table"; TableId tableId = TableId.of(DATASET, tableName); - Field rangeFieldWithDate = - Field.newBuilder("rangeFieldDate", StandardSQLTypeName.RANGE) - .setMode(Field.Mode.NULLABLE) - .setDescription("Range field with DATE") - .setRangeElementType(FieldElementType.newBuilder().setType("DATE").build()) - .build(); - - Field rangeFieldWithDatetime = - Field.newBuilder("rangeFieldDatetime", StandardSQLTypeName.RANGE) - .setMode(Field.Mode.NULLABLE) - .setDescription("Range field with DATETIME") - .setRangeElementType(FieldElementType.newBuilder().setType("DATETIME").build()) - .build(); - - Field rangeFieldWithTimestamp = - Field.newBuilder("rangeFieldTimestamp", StandardSQLTypeName.RANGE) - .setMode(Field.Mode.NULLABLE) - .setDescription("Range field with TIMESTAMP") - .setRangeElementType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) - .build(); - Schema schema = Schema.of(rangeFieldWithDate, rangeFieldWithDatetime, rangeFieldWithTimestamp); - StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(schema); + StandardTableDefinition standardTableDefinition = StandardTableDefinition.of(RANGE_SCHEMA); try { - // Create a table with a RANGE column. + // Create a table with a RANGE columns and verify the result. Table createdTable = bigquery.create(TableInfo.of(tableId, standardTableDefinition)); assertNotNull(createdTable); - } finally { - assertTrue(bigquery.delete(tableId)); - } - } - - @Test - public void testRangeType() throws InterruptedException { - // TODO: Combine testRangeType test with testRangeCreateTable test. - String tableName = "test_range_type_table"; - QueryJobConfiguration createTable = - QueryJobConfiguration.newBuilder( - String.format( - "CREATE TABLE %s AS SELECT RANGE(DATE '2020-01-01', DATE '2020-12-31') as date, \n" - + "RANGE(DATETIME '2020-01-01T12:00:00', DATETIME '2020-12-31T12:00:00') as datetime, \n" - + "RANGE(TIMESTAMP '2014-01-01 07:00:00.000000+00:00', TIMESTAMP '2015-01-01 07:00:00.000000+00:00') as timestamp", - tableName)) - .setDefaultDataset(DatasetId.of(DATASET)) - .setUseLegacySql(false) - .build(); - bigquery.query(createTable); - String query = - String.format( - "SELECT date, datetime, timestamp\n" - + "FROM %s.%s\n" - + "WHERE date = @dateParam\n" - + "AND datetime = @datetimeParam\n" - + "AND timestamp = @timestampParam", - DATASET, tableName); + Table remoteTable = bigquery.getTable(DATASET, tableName); + Schema remoteSchema = remoteTable.getDefinition().getSchema(); + assertEquals(RANGE_SCHEMA, remoteSchema); + + // Insert range values to the table. + InsertAllRequest.Builder request = InsertAllRequest.newBuilder(tableId); + for (String name : RANGE_TEST_VALUES_DATES.keySet()) { + ImmutableMap.Builder builder = ImmutableMap.builder(); + builder.put("name", name); + builder.put("date", RANGE_TEST_VALUES_DATES.get(name).getValues()); + builder.put("datetime", RANGE_TEST_VALUES_DATETIME.get(name).getValues()); + builder.put("timestamp", RANGE_TEST_VALUES_TIMESTAMP.get(name).getValues()); + request.addRow(builder.build()); + } + bigquery.insertAll(request.build()); - Range dateRange = - Range.newBuilder() - .setType(FieldElementType.newBuilder().setType("DATE").build()) - .setStart("2020-01-01") - .setEnd("2020-12-31") - .build(); - Range datetimeRange = - Range.newBuilder() - .setType(FieldElementType.newBuilder().setType("DATETIME").build()) - .setStart("2020-01-01T12:00:00") - .setEnd("2020-12-31T12:00:00") - .build(); - Range timestampRange = - Range.newBuilder() - .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) - .setStart("2014-01-01 07:00:00.000000+00:00") - .setEnd("2015-01-01 07:00:00.000000+00:00") - .build(); + // Test listTableData + TableResult result = bigquery.listTableData(DATASET, tableName, RANGE_SCHEMA); + assertEquals(RANGE_TEST_VALUES_DATES.size(), Iterables.size(result.getValues())); + for (FieldValueList values : result.iterateAll()) { + String name = values.get("name").getStringValue(); + assertEquals(RANGE_TEST_VALUES_DATES.get(name), values.get("date").getRangeValue()); + assertEquals(RANGE_TEST_VALUES_DATETIME.get(name), values.get("datetime").getRangeValue()); + assertEquals( + RANGE_TEST_VALUES_EXPECTED_TIMESTAMP.get(name), + values.get("timestamp").getRangeValue()); + } - // Test Query Parameter. - QueryJobConfiguration config = - QueryJobConfiguration.newBuilder(query) - .setDefaultDataset(DatasetId.of(DATASET)) - .addNamedParameter("dateParam", QueryParameterValue.range(dateRange)) - .addNamedParameter("datetimeParam", QueryParameterValue.range(datetimeRange)) - .addNamedParameter("timestampParam", QueryParameterValue.range(timestampRange)) - .build(); - TableResult result = bigquery.query(config); - assertEquals(1, Iterables.size(result.getValues())); - for (FieldValueList values : result.iterateAll()) { - assertEquals(dateRange.getStart(), values.get("date").getRangeValue().getStart()); - assertEquals(dateRange.getEnd(), values.get("date").getRangeValue().getEnd()); - assertEquals(datetimeRange.getStart(), values.get("datetime").getRangeValue().getStart()); - assertEquals(datetimeRange.getEnd(), values.get("datetime").getRangeValue().getEnd()); - // timestamps are returned as seconds since epoch - assertEquals( - 1388559600000000L, - values.get("timestamp").getRangeValue().getStart().getTimestampValue()); - assertEquals( - 1420095600000000L, values.get("timestamp").getRangeValue().getEnd().getTimestampValue()); - } + // Test Query Parameter by selecting for the bounded Range entry only. + String query = + String.format( + "SELECT name, date, datetime, timestamp\n" + + "FROM %s.%s\n" + + "WHERE date = @dateParam\n" + + "AND datetime = @datetimeParam\n" + + "AND timestamp = @timestampParam", + DATASET, tableName); + + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .addNamedParameter( + "dateParam", QueryParameterValue.range(RANGE_TEST_VALUES_DATES.get("bounded"))) + .addNamedParameter( + "datetimeParam", + QueryParameterValue.range(RANGE_TEST_VALUES_DATETIME.get("bounded"))) + .addNamedParameter( + "timestampParam", + QueryParameterValue.range(RANGE_TEST_VALUES_TIMESTAMP.get("bounded"))) + .build(); + result = bigquery.query(config); - // Test listTableData. - Schema schema = result.getSchema(); - result = bigquery.listTableData(DATASET, tableName, schema); - assertEquals(1, Iterables.size(result.getValues())); - for (FieldValueList values : result.iterateAll()) { - assertEquals(dateRange.getStart(), values.get("date").getRangeValue().getStart()); - assertEquals(dateRange.getEnd(), values.get("date").getRangeValue().getEnd()); - assertEquals(datetimeRange.getStart(), values.get("datetime").getRangeValue().getStart()); - assertEquals(datetimeRange.getEnd(), values.get("datetime").getRangeValue().getEnd()); - // timestamps are returned as seconds since epoch - assertEquals( - 1388559600000000L, - values.get("timestamp").getRangeValue().getStart().getTimestampValue()); - assertEquals( - 1420095600000000L, values.get("timestamp").getRangeValue().getEnd().getTimestampValue()); + assertEquals(1, Iterables.size(result.getValues())); + for (FieldValueList values : result.iterateAll()) { + String name = values.get("name").getStringValue(); + assertEquals(RANGE_TEST_VALUES_DATES.get(name), values.get("date").getRangeValue()); + assertEquals(RANGE_TEST_VALUES_DATETIME.get(name), values.get("datetime").getRangeValue()); + assertEquals( + RANGE_TEST_VALUES_EXPECTED_TIMESTAMP.get(name), + values.get("timestamp").getRangeValue()); + } + } finally { + assertTrue(bigquery.delete(tableId)); } } From 2c0f48f86d3c4d5a1a682775c494a9122373858d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Apr 2024 16:18:39 +0200 Subject: [PATCH 1654/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240323-2.0.0 (#3239) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d79a4ed09e..dc50db3239 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240229-2.0.0 + v2-rev20240323-2.0.0 From b13bbb856f75bb545a1b346a9fddda0234a491a7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Apr 2024 16:21:22 +0200 Subject: [PATCH 1655/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.38.0 (#3240) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 508e4432a3..34ad3706c8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.37.0 + 2.38.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6a2093ab5e..06cb8a3f8a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.37.0 + 2.38.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5e636d072a..35cb184dfd 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.37.0 + 2.38.0 test From 66d5efded17c42514f98f4af2bc6ba826999a62a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Apr 2024 16:39:57 +0200 Subject: [PATCH 1656/2268] deps: update dependency org.threeten:threeten-extra to v1.8.0 (#3242) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc50db3239..78a00c4e7e 100644 --- a/pom.xml +++ b/pom.xml @@ -106,7 +106,7 @@ org.threeten threeten-extra - 1.7.2 + 1.8.0 From 0b0b414c3a2b213844ce653ecea361aabd097d47 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Apr 2024 16:45:42 +0200 Subject: [PATCH 1657/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.37.0 (#3252) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 78a00c4e7e..5824bbe1e7 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.36.1 + 2.37.0 test From 75ea095b0a194d6be4951795bc3a616ace389ff2 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:10:29 -0400 Subject: [PATCH 1658/2268] feat: Add totalSlotMs to JobStatistics (#3250) * feat: Add totalSlotMs to JobStatistics * fix: testQuery IT flakiness * Fix query statistics test --- .../google/cloud/bigquery/JobStatistics.java | 42 ++++++++++--------- .../cloud/bigquery/JobStatisticsTest.java | 10 ++++- .../cloud/bigquery/it/ITBigQueryTest.java | 19 +++++++++ 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 0200711d6a..64d31fab17 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -40,7 +40,7 @@ /** A Google BigQuery Job statistics. */ public abstract class JobStatistics implements Serializable { - private static final long serialVersionUID = 1433024714741660399L; + private static final long serialVersionUID = 1433024714741660400L; private final Long creationTime; private final Long endTime; @@ -51,6 +51,7 @@ public abstract class JobStatistics implements Serializable { private final List reservationUsage; private final TransactionInfo transactionInfo; private final SessionInfo sessionInfo; + private final Long totalSlotMs; /** A Google BigQuery Copy Job statistics. */ public static class CopyStatistics extends JobStatistics { @@ -390,7 +391,7 @@ static LoadStatistics fromPb(com.google.api.services.bigquery.model.JobStatistic /** A Google BigQuery Query Job statistics. */ public static class QueryStatistics extends JobStatistics { - private static final long serialVersionUID = 7539354109226732353L; + private static final long serialVersionUID = 7539354109226732354L; private final BiEngineStats biEngineStats; private final Integer billingTier; @@ -407,7 +408,6 @@ public static class QueryStatistics extends JobStatistics { private final Long totalBytesBilled; private final Long totalBytesProcessed; private final Long totalPartitionsProcessed; - private final Long totalSlotMs; private final List queryPlan; private final List timeline; private final Schema schema; @@ -567,7 +567,6 @@ static final class Builder extends JobStatistics.Builder queryPlan; private List timeline; private Schema schema; @@ -599,7 +598,6 @@ private Builder(com.google.api.services.bigquery.model.JobStatistics statisticsP this.totalBytesBilled = statisticsPb.getQuery().getTotalBytesBilled(); this.totalBytesProcessed = statisticsPb.getQuery().getTotalBytesProcessed(); this.totalPartitionsProcessed = statisticsPb.getQuery().getTotalPartitionsProcessed(); - this.totalSlotMs = statisticsPb.getQuery().getTotalSlotMs(); if (statisticsPb.getQuery().getStatementType() != null) { this.statementType = StatementType.valueOf(statisticsPb.getQuery().getStatementType()); } @@ -719,11 +717,6 @@ Builder setTotalPartitionsProcessed(Long totalPartitionsProcessed) { return self(); } - Builder setTotalSlotMs(Long totalSlotMs) { - this.totalSlotMs = totalSlotMs; - return self(); - } - Builder setQueryPlan(List queryPlan) { this.queryPlan = queryPlan; return self(); @@ -777,7 +770,6 @@ private QueryStatistics(Builder builder) { this.totalBytesBilled = builder.totalBytesBilled; this.totalBytesProcessed = builder.totalBytesProcessed; this.totalPartitionsProcessed = builder.totalPartitionsProcessed; - this.totalSlotMs = builder.totalSlotMs; this.queryPlan = builder.queryPlan; this.timeline = builder.timeline; this.schema = builder.schema; @@ -874,11 +866,6 @@ public Long getTotalPartitionsProcessed() { return totalPartitionsProcessed; } - /** Returns the slot-milliseconds consumed by the query. */ - public Long getTotalSlotMs() { - return totalSlotMs; - } - /** * Returns the query plan as a list of stages or {@code null} if a query plan is not available. * Each stage involves a number of steps that read from data sources, perform a series of @@ -984,7 +971,6 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { queryStatisticsPb.setTotalBytesBilled(totalBytesBilled); queryStatisticsPb.setTotalBytesProcessed(totalBytesProcessed); queryStatisticsPb.setTotalPartitionsProcessed(totalPartitionsProcessed); - queryStatisticsPb.setTotalSlotMs(totalSlotMs); if (ddlTargetTable != null) { queryStatisticsPb.setDdlTargetTable(ddlTargetTable.toPb()); } @@ -1589,6 +1575,7 @@ abstract static class Builder> private List reservationUsage; private TransactionInfo transactionInfo; private SessionInfo sessionInfo; + private Long totalSlotMs; protected Builder() {} @@ -1598,6 +1585,9 @@ protected Builder(com.google.api.services.bigquery.model.JobStatistics statistic this.startTime = statisticsPb.getStartTime(); this.numChildJobs = statisticsPb.getNumChildJobs(); this.parentJobId = statisticsPb.getParentJobId(); + if (statisticsPb.getTotalSlotMs() != null) { + this.totalSlotMs = statisticsPb.getTotalSlotMs(); + } if (statisticsPb.getScriptStatistics() != null) { this.scriptStatistics = ScriptStatistics.fromPb(statisticsPb.getScriptStatistics()); } @@ -1633,6 +1623,11 @@ B setStartTime(Long startTime) { return self(); } + B setTotalSlotMs(Long totalSlotMs) { + this.totalSlotMs = totalSlotMs; + return self(); + } + abstract T build(); } @@ -1646,6 +1641,7 @@ protected JobStatistics(Builder builder) { this.reservationUsage = builder.reservationUsage; this.transactionInfo = builder.transactionInfo; this.sessionInfo = builder.sessionInfo; + this.totalSlotMs = builder.totalSlotMs; } /** Returns the creation time of the job in milliseconds since epoch. */ @@ -1699,6 +1695,11 @@ public SessionInfo getSessionInfo() { return sessionInfo; } + /** Returns the slot-milliseconds for the job. */ + public Long getTotalSlotMs() { + return totalSlotMs; + } + ToStringHelper toStringHelper() { return MoreObjects.toStringHelper(this) .add("creationTime", creationTime) @@ -1709,7 +1710,8 @@ ToStringHelper toStringHelper() { .add("scriptStatistics", scriptStatistics) .add("reservationUsage", reservationUsage) .add("transactionInfo", transactionInfo) - .add("sessionInfo", sessionInfo); + .add("sessionInfo", sessionInfo) + .add("totalSlotMs", totalSlotMs); } @Override @@ -1727,7 +1729,8 @@ final int baseHashCode() { scriptStatistics, reservationUsage, transactionInfo, - sessionInfo); + sessionInfo, + totalSlotMs); } final boolean baseEquals(JobStatistics jobStatistics) { @@ -1742,6 +1745,7 @@ com.google.api.services.bigquery.model.JobStatistics toPb() { statistics.setStartTime(startTime); statistics.setNumChildJobs(numChildJobs); statistics.setParentJobId(parentJobId); + statistics.setTotalSlotMs(totalSlotMs); if (scriptStatistics != null) { statistics.setScriptStatistics(scriptStatistics.toPb()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index aaf4aa2b16..2a1353f5d8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -102,6 +102,7 @@ public class JobStatisticsTest { .setStartTime(START_TIME) .setCopiedRows(COPIED_ROW) .setCopiedLogicalBytes(COPIED_LOGICAL_BYTES) + .setTotalSlotMs(TOTAL_SLOT_MS) .build(); private static final ExtractStatistics EXTRACT_STATISTICS = ExtractStatistics.newBuilder() @@ -110,6 +111,7 @@ public class JobStatisticsTest { .setStartTime(START_TIME) .setDestinationUriFileCounts(FILE_COUNT) .setInputBytes(INPUT_BYTES) + .setTotalSlotMs(TOTAL_SLOT_MS) .build(); private static final LoadStatistics LOAD_STATISTICS = LoadStatistics.newBuilder() @@ -121,6 +123,7 @@ public class JobStatisticsTest { .setOutputBytes(OUTPUT_BYTES) .setOutputRows(OUTPUT_ROWS) .setBadRecords(BAD_RECORDS) + .setTotalSlotMs(TOTAL_SLOT_MS) .build(); private static final LoadStatistics LOAD_STATISTICS_INCOMPLETE = LoadStatistics.newBuilder() @@ -130,6 +133,7 @@ public class JobStatisticsTest { .setInputBytes(INPUT_BYTES) .setInputFiles(INPUT_FILES) .setBadRecords(BAD_RECORDS) + .setTotalSlotMs(TOTAL_SLOT_MS) .build(); private static final List SUBSTEPS1 = ImmutableList.of("substep1", "substep2"); private static final List SUBSTEPS2 = ImmutableList.of("substep3", "substep4"); @@ -272,18 +276,21 @@ public void testBuilder() { assertEquals(CREATION_TIME, EXTRACT_STATISTICS.getCreationTime()); assertEquals(START_TIME, EXTRACT_STATISTICS.getStartTime()); assertEquals(END_TIME, EXTRACT_STATISTICS.getEndTime()); + assertEquals(TOTAL_SLOT_MS, EXTRACT_STATISTICS.getTotalSlotMs()); assertEquals(FILE_COUNT, EXTRACT_STATISTICS.getDestinationUriFileCounts()); assertEquals(INPUT_BYTES, EXTRACT_STATISTICS.getInputBytes()); assertEquals(CREATION_TIME, COPY_STATISTICS.getCreationTime()); assertEquals(START_TIME, COPY_STATISTICS.getStartTime()); assertEquals(END_TIME, COPY_STATISTICS.getEndTime()); + assertEquals(TOTAL_SLOT_MS, COPY_STATISTICS.getTotalSlotMs()); assertEquals(COPIED_LOGICAL_BYTES, COPY_STATISTICS.getCopiedLogicalBytes()); assertEquals(COPIED_ROW, COPY_STATISTICS.getCopiedRows()); assertEquals(CREATION_TIME, LOAD_STATISTICS.getCreationTime()); assertEquals(START_TIME, LOAD_STATISTICS.getStartTime()); assertEquals(END_TIME, LOAD_STATISTICS.getEndTime()); + assertEquals(TOTAL_SLOT_MS, LOAD_STATISTICS.getTotalSlotMs()); assertEquals(INPUT_BYTES, LOAD_STATISTICS.getInputBytes()); assertEquals(INPUT_FILES, LOAD_STATISTICS.getInputFiles()); assertEquals(OUTPUT_BYTES, LOAD_STATISTICS.getOutputBytes()); @@ -293,6 +300,7 @@ public void testBuilder() { assertEquals(CREATION_TIME, QUERY_STATISTICS.getCreationTime()); assertEquals(START_TIME, QUERY_STATISTICS.getStartTime()); assertEquals(END_TIME, QUERY_STATISTICS.getEndTime()); + assertEquals(TOTAL_SLOT_MS, QUERY_STATISTICS.getTotalSlotMs()); assertEquals(BI_ENGINE_STATS, QUERY_STATISTICS.getBiEngineStats()); assertEquals(BILLING_TIER, QUERY_STATISTICS.getBillingTier()); assertEquals(CACHE_HIT, QUERY_STATISTICS.getCacheHit()); @@ -308,7 +316,6 @@ public void testBuilder() { assertEquals(TOTAL_BYTES_BILLED, QUERY_STATISTICS.getTotalBytesBilled()); assertEquals(TOTAL_BYTES_PROCESSED, QUERY_STATISTICS.getTotalBytesProcessed()); assertEquals(TOTAL_PARTITION_PROCESSED, QUERY_STATISTICS.getTotalPartitionsProcessed()); - assertEquals(TOTAL_SLOT_MS, QUERY_STATISTICS.getTotalSlotMs()); assertEquals(QUERY_PLAN, QUERY_STATISTICS.getQueryPlan()); assertEquals(TIMELINE, QUERY_STATISTICS.getTimeline()); @@ -472,6 +479,7 @@ private void compareStatistics(JobStatistics expected, JobStatistics value) { assertEquals(expected.getNumChildJobs(), value.getNumChildJobs()); assertEquals(expected.getParentJobId(), value.getParentJobId()); assertEquals(expected.getScriptStatistics(), value.getScriptStatistics()); + assertEquals(expected.getTotalSlotMs(), value.getTotalSlotMs()); } private void compareScriptStatistics(ScriptStatistics expected, ScriptStatistics value) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index d78549f6ea..56dd7cd3ae 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3160,6 +3160,23 @@ public void testQuery() throws InterruptedException { assertNotNull(statistics.getQueryPlan()); } + @Test + public void testQueryStatistics() throws InterruptedException { + // Use CURRENT_TIMESTAMP to avoid potential caching. + String query = "SELECT CURRENT_TIMESTAMP() AS ts"; + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseQueryCache(false) + .build(); + Job job = bigquery.create(JobInfo.of(JobId.of(), config)); + job = job.waitFor(); + + JobStatistics.QueryStatistics statistics = job.getStatistics(); + assertNotNull(statistics.getQueryPlan()); + assertThat(statistics.getTotalSlotMs()).isGreaterThan(0L); + } + @Test public void testExecuteSelectDefaultConnectionSettings() throws SQLException { // Use the default connection settings @@ -4429,6 +4446,7 @@ public void testLoadSessionSupport() throws InterruptedException { Job loadJob = bigquery.getJob(job.getJobId()); JobStatistics.LoadStatistics statistics = loadJob.getStatistics(); + assertThat(statistics.getTotalSlotMs()).isGreaterThan(0L); String sessionId = statistics.getSessionInfo().getSessionId(); assertNotNull(sessionId); @@ -5678,6 +5696,7 @@ public void testExtractJob() throws InterruptedException, TimeoutException { assertEquals(1L, extractStatistics.getDestinationUriFileCounts().size()); assertEquals( loadStatistics.getOutputBytes().longValue(), extractStatistics.getInputBytes().longValue()); + assertThat(extractStatistics.getTotalSlotMs()).isGreaterThan(0L); String extractedCsv = new String(storage.readAllBytes(BUCKET, EXTRACT_FILE), StandardCharsets.UTF_8); From c50c17bc4eedd0c34f440b697a8b26a5354c9c4f Mon Sep 17 00:00:00 2001 From: Sumeet Gajjar Date: Sat, 20 Apr 2024 09:13:01 -0700 Subject: [PATCH 1659/2268] fix: Fix BigQuery#listDatasets to include dataset location in the response (#3238) --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 1 + .../cloud/bigquery/BigQueryImplTest.java | 8 +++++- .../cloud/bigquery/it/ITBigQueryTest.java | 28 +++++++++++++++++-- .../bigquery/spi/v2/HttpBigQueryRpcTest.java | 4 ++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index dca129bfb5..5dd39eaed9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -95,6 +95,7 @@ public Dataset apply(DatasetList.Datasets datasetPb) { .setFriendlyName(datasetPb.getFriendlyName()) .setId(datasetPb.getId()) .setKind(datasetPb.getKind()) + .setLocation(datasetPb.getLocation()) .setLabels(datasetPb.getLabels()); } }; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 62160bef20..d3d3740061 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -81,16 +81,22 @@ public class BigQueryImplTest { Acl.of(Acl.Group.ofAllAuthenticatedUsers(), Acl.Role.READER), Acl.of(new Acl.View(TableId.of(PROJECT, "dataset", "table")))); private static final DatasetInfo DATASET_INFO = - DatasetInfo.newBuilder(DATASET).setAcl(ACCESS_RULES).setDescription("description").build(); + DatasetInfo.newBuilder(DATASET) + .setAcl(ACCESS_RULES) + .setDescription("description") + .setLocation(LOCATION) + .build(); private static final DatasetInfo DATASET_INFO_WITH_PROJECT = DatasetInfo.newBuilder(PROJECT, DATASET) .setAcl(ACCESS_RULES_WITH_PROJECT) .setDescription("description") + .setLocation(LOCATION) .build(); private static final DatasetInfo OTHER_DATASET_INFO = DatasetInfo.newBuilder(PROJECT, OTHER_DATASET) .setAcl(ACCESS_RULES) .setDescription("other description") + .setLocation(LOCATION) .build(); private static final TableId TABLE_ID = TableId.of(DATASET, TABLE); private static final TableId OTHER_TABLE_ID = TableId.of(PROJECT, DATASET, OTHER_TABLE); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 56dd7cd3ae..6caecd26b3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -775,6 +775,20 @@ public class ITBigQueryTest { private static final Set PUBLIC_DATASETS = ImmutableSet.of("github_repos", "hacker_news", "noaa_gsod", "samples", "usa_names"); + private static final Map PUBLIC_DATASETS_LOCATION = + ImmutableMap.builder() + .put("github_repos", "US") + .put("hacker_news", "US") + .put("noaa_gsod", "US") + .put("samples", "US") + .put("usa_names", "US") + // Dataset url: + // https://console.cloud.google.com/bigquery?project=bigquery-public-data&ws=!1m4!1m3!3m2!1sbigquery-public-data!2sgnomAD_asiane1 + .put("gnomAD_asiane1", "asia-northeast1") + // Dataset url: + // https://console.cloud.google.com/bigquery?project=bigquery-public-data&ws=!1m4!1m3!3m2!1sbigquery-public-data!2sgnomAD_eu + .put("gnomAD_eu", "EU") + .build(); private static final String PUBLIC_PROJECT = "bigquery-public-data"; private static final String PUBLIC_DATASET = "census_bureau_international"; @@ -1113,11 +1127,16 @@ public void testListDatasets() { Page datasets = bigquery.listDatasets("bigquery-public-data"); Iterator iterator = datasets.iterateAll().iterator(); Set datasetNames = new HashSet<>(); + Map datasetLocation = new HashMap<>(); while (iterator.hasNext()) { - datasetNames.add(iterator.next().getDatasetId().getDataset()); + Dataset dataset = iterator.next(); + String name = dataset.getDatasetId().getDataset(); + datasetNames.add(name); + datasetLocation.put(name, dataset.getLocation()); } for (String type : PUBLIC_DATASETS) { assertTrue(datasetNames.contains(type)); + assertEquals(PUBLIC_DATASETS_LOCATION.get(type), datasetLocation.get(type)); } } @@ -6759,11 +6778,16 @@ public void testUniverseDomainWithMatchingDomain() { Page datasets = bigQuery.listDatasets("bigquery-public-data"); Iterator iterator = datasets.iterateAll().iterator(); Set datasetNames = new HashSet<>(); + Map datasetLocation = new HashMap<>(); while (iterator.hasNext()) { - datasetNames.add(iterator.next().getDatasetId().getDataset()); + Dataset dataset = iterator.next(); + String name = dataset.getDatasetId().getDataset(); + datasetNames.add(name); + datasetLocation.put(name, dataset.getLocation()); } for (String type : PUBLIC_DATASETS) { assertTrue(datasetNames.contains(type)); + assertEquals(PUBLIC_DATASETS_LOCATION.get(type), datasetLocation.get(type)); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java index 576e5c4e37..eec39f633f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java @@ -35,7 +35,8 @@ public void testListToDataset() { .setId("project-id:dataset-id") .setFriendlyName("friendly") .setKind("bigquery#dataset") - .setLabels(Collections.singletonMap("foo", "bar")); + .setLabels(Collections.singletonMap("foo", "bar")) + .setLocation("test-region-1"); Dataset dataset = HttpBigQueryRpc.LIST_TO_DATASET.apply(listDataSet); assertThat(dataset.getKind()).isEqualTo("bigquery#dataset"); @@ -43,5 +44,6 @@ public void testListToDataset() { assertThat(dataset.getFriendlyName()).isEqualTo("friendly"); assertThat(dataset.getDatasetReference()).isEqualTo(datasetRef); assertThat(dataset.getLabels()).containsExactly("foo", "bar"); + assertThat(dataset.getLocation()).isEqualTo("test-region-1"); } } From 066b51fb088fc67c83a45a219897752876889136 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 22 Apr 2024 17:55:12 +0200 Subject: [PATCH 1660/2268] deps: update actions/upload-artifact action to v4.3.2 (#3248) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e229d5ff77..6f8d891645 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 with: name: SARIF file path: results.sarif From 6df3a325b7f71ed1eb2054dd0c3a27cfd6cda2f2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 22 Apr 2024 20:10:02 +0200 Subject: [PATCH 1661/2268] deps: update actions/checkout action (#3256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- .github/workflows/unmanaged_dependency_check.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 6f8d891645..87d07a651a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 with: persist-credentials: false diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ebf073c1b3..92fce04005 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -5,7 +5,7 @@ jobs: unmanaged_dependency_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: temurin From 19d92a144cd4d86fee6dd420e574c3a1a928642c Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:28:06 -0400 Subject: [PATCH 1662/2268] fix: Remove @InternalApi from TableResult (#3257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Remove @InternalApi from TableResult Since users depends on TableResult in testing, removing @InternalApi forces maintainers to change/roll out changes to TableResult more carefully in the future. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Remove clirr ignore difference entries for TableResult --------- Co-authored-by: Owl Bot --- .../clirr-ignored-differences.xml | 38 ------------------- .../google/cloud/bigquery/TableResult.java | 2 - 2 files changed, 40 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index abf827b48e..9c69fd6a68 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -2,17 +2,6 @@ - - 3005 - com/google/cloud/bigquery/TableResult* - TableResult is an internal API and it should be fine to update - - - 7002 - com/google/cloud/bigquery/TableResult* - *TableResult(*) - TableResult is an internal API and it should be fine to update - 7004 com/google/cloud/bigquery/spi/v2/BigQueryRpc @@ -25,19 +14,6 @@ com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method - - 7004 - com/google/cloud/bigquery/TableResult* - *TableResult(*) - It should be fine to update TableResult constructors since it is used to return results to the user and users should not directly construct TableResult objects - - - 7005 - com/google/cloud/bigquery/TableResult* - *TableResult(*) - *TableResult(*) - It should be fine to update TableResult constructors since it is used to return results to the user and users should not directly construct TableResult objects - 7013 com/google/cloud/bigquery/ExternalTableDefinition* @@ -58,16 +34,6 @@ com/google/cloud/bigquery/TableInfo* *ResourceTags(*) - - 7013 - com/google/cloud/bigquery/TableResult* - *getPageNoSchema(*) - - - 7013 - com/google/cloud/bigquery/TableResult* - *toBuilder(*) - 7012 com/google/cloud/bigquery/Connection @@ -163,8 +129,4 @@ com/google/cloud/bigquery/StandardTableDefinition* *BigLakeConfiguration(*) - - 8001 - com/google/cloud/bigquery/EmptyTableResult* - \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 203a91faba..1b4b0e1011 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -16,7 +16,6 @@ package com.google.cloud.bigquery; -import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.auto.value.AutoValue; import com.google.common.base.Function; @@ -27,7 +26,6 @@ import java.util.Objects; import javax.annotation.Nullable; -@InternalApi @AutoValue public abstract class TableResult implements Page, Serializable { From 94b5b4312a259653d2b6703788315a7c559d4c92 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:11:33 -0400 Subject: [PATCH 1663/2268] chore(main): release 2.39.0 (#3213) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 44 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 547ec4ce27..4b4d2002da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,40 @@ # Changelog +## [2.39.0](https://github.com/googleapis/java-bigquery/compare/v2.38.2...v2.39.0) (2024-04-22) + + +### Features + +* Add ExportDataStats to QueryStatistics ([#3244](https://github.com/googleapis/java-bigquery/issues/3244)) ([e91be80](https://github.com/googleapis/java-bigquery/commit/e91be80ebdd39c2448914ff9aa1742f3079d0bb8)) +* Add new fields to copy job statistics ([#3205](https://github.com/googleapis/java-bigquery/issues/3205)) ([64bdda8](https://github.com/googleapis/java-bigquery/commit/64bdda84fe06726042a41f2a89ac5c067f9bc949)) +* Add Range object to allow reading range value ([#3236](https://github.com/googleapis/java-bigquery/issues/3236)) ([2c3399d](https://github.com/googleapis/java-bigquery/commit/2c3399dd10fecc01237158a3cdeee966b38746f2)) +* Add support for inserting Range values ([#3246](https://github.com/googleapis/java-bigquery/issues/3246)) ([ff1ebc6](https://github.com/googleapis/java-bigquery/commit/ff1ebc66e458519deca37275ba91650133188683)) +* Add support for ObjectMetadata ([#3217](https://github.com/googleapis/java-bigquery/issues/3217)) ([975df05](https://github.com/googleapis/java-bigquery/commit/975df05b95b714c5574155d5e09860885c4b58f2)) +* Add totalSlotMs to JobStatistics ([#3250](https://github.com/googleapis/java-bigquery/issues/3250)) ([75ea095](https://github.com/googleapis/java-bigquery/commit/75ea095b0a194d6be4951795bc3a616ace389ff2)) + + +### Bug Fixes + +* Fix BigQuery#listDatasets to include dataset location in the response ([#3238](https://github.com/googleapis/java-bigquery/issues/3238)) ([c50c17b](https://github.com/googleapis/java-bigquery/commit/c50c17bc4eedd0c34f440b697a8b26a5354c9c4f)) +* Remove @InternalApi from TableResult ([#3257](https://github.com/googleapis/java-bigquery/issues/3257)) ([19d92a1](https://github.com/googleapis/java-bigquery/commit/19d92a144cd4d86fee6dd420e574c3a1a928642c)) + + +### Dependencies + +* Update actions/checkout action ([#3256](https://github.com/googleapis/java-bigquery/issues/3256)) ([6df3a32](https://github.com/googleapis/java-bigquery/commit/6df3a325b7f71ed1eb2054dd0c3a27cfd6cda2f2)) +* Update actions/upload-artifact action to v4.3.2 ([#3248](https://github.com/googleapis/java-bigquery/issues/3248)) ([066b51f](https://github.com/googleapis/java-bigquery/commit/066b51fb088fc67c83a45a219897752876889136)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.40.0 ([#3210](https://github.com/googleapis/java-bigquery/issues/3210)) ([bf7e97e](https://github.com/googleapis/java-bigquery/commit/bf7e97e1c936a419a34529a316c4f538872dd20b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.41.0 ([#3219](https://github.com/googleapis/java-bigquery/issues/3219)) ([9d71b8b](https://github.com/googleapis/java-bigquery/commit/9d71b8b9a9231ea5d7cfa93c7bcbb533d6a3a900)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.43.0 ([#3225](https://github.com/googleapis/java-bigquery/issues/3225)) ([a897306](https://github.com/googleapis/java-bigquery/commit/a8973067348fa09acd91c5b01f048c43fac93894)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240323-2.0.0 ([#3239](https://github.com/googleapis/java-bigquery/issues/3239)) ([2c0f48f](https://github.com/googleapis/java-bigquery/commit/2c0f48f86d3c4d5a1a682775c494a9122373858d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.44.0 ([#3211](https://github.com/googleapis/java-bigquery/issues/3211)) ([6993b51](https://github.com/googleapis/java-bigquery/commit/6993b51f8722466b846a7dd3912acbd81e04126c)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.45.0 ([#3220](https://github.com/googleapis/java-bigquery/issues/3220)) ([21ae09c](https://github.com/googleapis/java-bigquery/commit/21ae09ce2c63f790ca77cc5c4c0df16dcb123b59)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.47.0 ([#3226](https://github.com/googleapis/java-bigquery/issues/3226)) ([d45d168](https://github.com/googleapis/java-bigquery/commit/d45d168bf53a8648e2254c8c4305a5d9a390276d)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#3207](https://github.com/googleapis/java-bigquery/issues/3207)) ([6204331](https://github.com/googleapis/java-bigquery/commit/6204331953b3922f5ecb1ac0c1868cb6579dd73b)) +* Update dependency org.threeten:threeten-extra to v1.8.0 ([#3242](https://github.com/googleapis/java-bigquery/issues/3242)) ([66d5efd](https://github.com/googleapis/java-bigquery/commit/66d5efded17c42514f98f4af2bc6ba826999a62a)) +* Update github/codeql-action action to v2.24.9 ([#3204](https://github.com/googleapis/java-bigquery/issues/3204)) ([7a24d3e](https://github.com/googleapis/java-bigquery/commit/7a24d3e29f32db58475c1e02ab1c13ee8941c27d)) +* Update github/codeql-action action to v2.25.1 ([#3229](https://github.com/googleapis/java-bigquery/issues/3229)) ([aeedf29](https://github.com/googleapis/java-bigquery/commit/aeedf2960700f1742e38469fd26ea70000967cfa)) + ## [2.38.2](https://github.com/googleapis/java-bigquery/compare/v2.38.1...v2.38.2) (2024-03-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a931b0dd70..2133b6e6df 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.38.3-SNAPSHOT + 2.39.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 37799ec4ef..1513fd25e5 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.38.3-SNAPSHOT + 2.39.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.38.3-SNAPSHOT + 2.39.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c265185489..8232a8059f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.38.3-SNAPSHOT + 2.39.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.38.3-SNAPSHOT + 2.39.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5824bbe1e7..15d74cb7e0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.38.3-SNAPSHOT + 2.39.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.38.3-SNAPSHOT + 2.39.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 06cb8a3f8a..90e7572ba1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.38.3-SNAPSHOT + 2.39.0 diff --git a/versions.txt b/versions.txt index 3d8630e02e..8da4e48389 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.38.2:2.38.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.39.0:2.39.0 \ No newline at end of file From 0c5eed1a18409f120a1243bd5da1db2aa4f9c206 Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Wed, 24 Apr 2024 11:33:59 -0700 Subject: [PATCH 1664/2268] Fix: @Nullable annotations on builder methods (#3222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix @Nullable annotations on builder methods This fixes errors in the latest versions of AutoValue ``` google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java:225: error: [AutoValueBuilderSetterNullable] Setter methods always return the Builder so @Nullable is not appropriate public abstract Builder setUseReadAPI(Boolean useReadAPI); ^ ``` * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Review comments * Review comments * 🦉 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 --- README.md | 6 +++--- .../java/com/google/cloud/bigquery/ConnectionSettings.java | 1 - .../cloud/bigquery/ReadClientConnectionConfiguration.java | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cc0001a9ce..d7279f7ead 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.38.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.39.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.38.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.39.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.38.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.39.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java index a9aabe038d..79bc3aac9f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionSettings.java @@ -221,7 +221,6 @@ Builder withDefaultValues() { * * @param useReadAPI or {@code true} for none */ - @Nullable public abstract Builder setUseReadAPI(Boolean useReadAPI); /** diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java index e0805a11e9..03cc2140e0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ReadClientConnectionConfiguration.java @@ -31,21 +31,18 @@ public abstract static class Builder { * Sets the total row count to page row count ratio used to determine whether to us the * BigQueryStorage Read client to fetch result sets after the first page. */ - @Nullable public abstract Builder setTotalToPageRowCountRatio(Long ratio); /** * Sets the minimum number of table rows in the query results used to determine whether to us * the BigQueryStorage Read client to fetch result sets after the first page. */ - @Nullable public abstract Builder setMinResultSize(Long numRows); /** * Sets the maximum number of table rows allowed in buffer before streaming them to the * BigQueryResult. */ - @Nullable public abstract Builder setBufferSize(Long bufferSize); /** Creates a {@code ReadClientConnectionConfiguration} object. */ @@ -53,12 +50,15 @@ public abstract static class Builder { } /** Returns the totalToPageRowCountRatio in this configuration. */ + @Nullable public abstract Long getTotalToPageRowCountRatio(); /** Returns the minResultSize in this configuration. */ + @Nullable public abstract Long getMinResultSize(); /** Returns the bufferSize in this configuration. */ + @Nullable public abstract Long getBufferSize(); public abstract Builder toBuilder(); From 52152350a2a6218b51ebf3d7dd6beb2699064a3c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Apr 2024 22:13:15 +0200 Subject: [PATCH 1665/2268] deps: update actions/upload-artifact action to v4.3.3 (#3258) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 87d07a651a..a9471c52e2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: SARIF file path: results.sarif From 3302dc46e3e2c6a173798ef7f1642d3d4cb20332 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Apr 2024 22:13:30 +0200 Subject: [PATCH 1666/2268] deps: update github/codeql-action action to v2.25.2 (#3260) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index a9471c52e2..9047ddf712 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e949a1676c32f4c215780f7429eb9f00ff18b225 # v2.25.1 + uses: github/codeql-action/upload-sarif@9ace329d8c0504a5571820cf13ab64d3f59e84fb # v2.25.2 with: sarif_file: results.sarif From 841cd386da8f83f02af20e7cae8740c3bfbeeb3d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Apr 2024 22:13:54 +0200 Subject: [PATCH 1667/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.39.0 (#3262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.39.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7279f7ead..a2aa57226c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.38.2 + 2.39.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 34ad3706c8..3c411e5ae1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.38.2 + 2.39.0 From 9ef933ad93fbb9546135506b35ceb30a510a9f95 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 24 Apr 2024 22:14:06 +0200 Subject: [PATCH 1668/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.3 (#3263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.5.3 * 🦉 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 --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2133b6e6df..e070fd339c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.2 + 3.5.3 package From 63075ddbd928dfa075893b7c8312789122bc0587 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:14:17 -0400 Subject: [PATCH 1669/2268] chore: update requirements.txt to address dependabot security alerts. (#1957) (#3264) Source-Link: https://github.com/googleapis/synthtool/commit/e451548dbb9b120f379bf7f0cc7fce16a5f54193 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:d13de1a4faec2645bda630b7a9aa080ce95182795aeab6f37ed4bd18cf5facbc Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5762b69661..1096f4dc0f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,6 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:25b384ee1674eda3984ec41c15b514a63bbeb5eda4d57c73c7e6f5adef2fd2f1 -# created: 2024-04-05T19:12:34.133475268Z - + digest: sha256:d13de1a4faec2645bda630b7a9aa080ce95182795aeab6f37ed4bd18cf5facbc +# created: 2024-04-24T14:22:15.892514394Z From c297ed2c77e36257451b5c12e4988f3293cdbb88 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 27 Apr 2024 02:19:23 +0200 Subject: [PATCH 1670/2268] deps: update actions/checkout action (#3267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9047ddf712..9f8f14d7c0 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: persist-credentials: false From 1cf237702e16952029741c306aa57cb3558a663f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 14:14:33 +0200 Subject: [PATCH 1671/2268] deps: update github/codeql-action action to v2.25.3 (#3268) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9f8f14d7c0..f9cc590285 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@9ace329d8c0504a5571820cf13ab64d3f59e84fb # v2.25.2 + uses: github/codeql-action/upload-sarif@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 with: sarif_file: results.sarif From 3b6e0d5e3d26b8e2de412aa926a638d72562d4a0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 15:52:46 +0200 Subject: [PATCH 1672/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.48.0 (#3271) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 15d74cb7e0..a37348a4fe 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.47.0 + 1.48.0 pom import From cb83b68a5eec4b428bffb5bf5d42dd94722bc11d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 16:23:55 +0200 Subject: [PATCH 1673/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.2 (#3274) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e070fd339c..7924462681 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true diff --git a/samples/pom.xml b/samples/pom.xml index 43d03461c5..b7e48a56e5 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -55,7 +55,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 35cb184dfd..b37b12c681 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true From ee09ab68ea2be824aaf4e3d08b67e3bfbab2977f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 17:18:15 +0200 Subject: [PATCH 1674/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.44.0 (#3270) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a37348a4fe..f7bec63620 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.43.0 + 2.44.0 test From ad2dab1d4b7b3871cd73dc779c3bb5b36aab6034 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 17:35:24 +0200 Subject: [PATCH 1675/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.44.0 (#3269) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f7bec63620..7241cfbd99 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.43.0 + 2.44.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3c411e5ae1..a1eb97001c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.43.0 + 2.44.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 90e7572ba1..2d68d4fffa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.43.0 + 2.44.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b37b12c681..6cb2561c36 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.43.0 + 2.44.0 test From e7c620119321b673c19b99adb79247cd3c52cd67 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 18:26:05 +0200 Subject: [PATCH 1676/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.29.0 (#3251) * deps: update dependency com.google.cloud:sdk-platform-java-config to v3.29.0 * chore: update bigquerystorage-bom to v3.5.0 --------- Co-authored-by: Lawrence Qiu --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 92fce04005..837835a5c8 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.28.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.29.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index fba53ee54b..a1b734677d 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.28.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.29.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 853a0d20ba..8a6da76b4a 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.28.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.29.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 227409d0cb..ef071a411b 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.28.1"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.29.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 94e00cbaa0..1b1d4c4bfe 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.28.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.29.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 1513fd25e5..7c4d000e6b 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.28.1 + 3.29.0 diff --git a/pom.xml b/pom.xml index 7241cfbd99..80a4f0e2c6 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.28.1 + 3.29.0 @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.4.0 + 3.5.0 pom import From 7852b2bf598efca2a2feaf5729ea82df910cad66 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:06:23 +0000 Subject: [PATCH 1677/2268] chore(main): release 2.39.1-SNAPSHOT (#3261) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7924462681..40095c03d3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.39.0 + 2.39.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7c4d000e6b..66e5921d6c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.39.0 + 2.39.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8232a8059f..494fa2aa28 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.39.0 + 2.39.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 80a4f0e2c6..1e01ec92e8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.39.0 + 2.39.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2d68d4fffa..42f3fffc60 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8da4e48389..843cba5f40 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.39.0:2.39.0 \ No newline at end of file +google-cloud-bigquery:2.39.0:2.39.1-SNAPSHOT \ No newline at end of file From c2e328324af1e50fdab441bd8b01c1a272a171f4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:34:22 +0000 Subject: [PATCH 1678/2268] chore(main): release 2.39.1 (#3275) :robot: I have created a release *beep* *boop* --- ## [2.39.1](https://togithub.com/googleapis/java-bigquery/compare/v2.39.0...v2.39.1) (2024-04-29) ### Bug Fixes * @Nullable annotations on builder methods ([#3222](https://togithub.com/googleapis/java-bigquery/issues/3222)) ([0c5eed1](https://togithub.com/googleapis/java-bigquery/commit/0c5eed1a18409f120a1243bd5da1db2aa4f9c206)) ### Dependencies * Update actions/checkout action ([#3267](https://togithub.com/googleapis/java-bigquery/issues/3267)) ([c297ed2](https://togithub.com/googleapis/java-bigquery/commit/c297ed2c77e36257451b5c12e4988f3293cdbb88)) * Update actions/upload-artifact action to v4.3.3 ([#3258](https://togithub.com/googleapis/java-bigquery/issues/3258)) ([5215235](https://togithub.com/googleapis/java-bigquery/commit/52152350a2a6218b51ebf3d7dd6beb2699064a3c)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.44.0 ([#3270](https://togithub.com/googleapis/java-bigquery/issues/3270)) ([ee09ab6](https://togithub.com/googleapis/java-bigquery/commit/ee09ab68ea2be824aaf4e3d08b67e3bfbab2977f)) * Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.0 ([e7c6201](https://togithub.com/googleapis/java-bigquery/commit/e7c620119321b673c19b99adb79247cd3c52cd67)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.48.0 ([#3271](https://togithub.com/googleapis/java-bigquery/issues/3271)) ([3b6e0d5](https://togithub.com/googleapis/java-bigquery/commit/3b6e0d5e3d26b8e2de412aa926a638d72562d4a0)) * Update github/codeql-action action to v2.25.2 ([#3260](https://togithub.com/googleapis/java-bigquery/issues/3260)) ([3302dc4](https://togithub.com/googleapis/java-bigquery/commit/3302dc46e3e2c6a173798ef7f1642d3d4cb20332)) * Update github/codeql-action action to v2.25.3 ([#3268](https://togithub.com/googleapis/java-bigquery/issues/3268)) ([1cf2377](https://togithub.com/googleapis/java-bigquery/commit/1cf237702e16952029741c306aa57cb3558a663f)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b4d2002da..d675cc8211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.39.1](https://github.com/googleapis/java-bigquery/compare/v2.39.0...v2.39.1) (2024-04-29) + + +### Bug Fixes + +* @Nullable annotations on builder methods ([#3222](https://github.com/googleapis/java-bigquery/issues/3222)) ([0c5eed1](https://github.com/googleapis/java-bigquery/commit/0c5eed1a18409f120a1243bd5da1db2aa4f9c206)) + + +### Dependencies + +* Update actions/checkout action ([#3267](https://github.com/googleapis/java-bigquery/issues/3267)) ([c297ed2](https://github.com/googleapis/java-bigquery/commit/c297ed2c77e36257451b5c12e4988f3293cdbb88)) +* Update actions/upload-artifact action to v4.3.3 ([#3258](https://github.com/googleapis/java-bigquery/issues/3258)) ([5215235](https://github.com/googleapis/java-bigquery/commit/52152350a2a6218b51ebf3d7dd6beb2699064a3c)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.44.0 ([#3270](https://github.com/googleapis/java-bigquery/issues/3270)) ([ee09ab6](https://github.com/googleapis/java-bigquery/commit/ee09ab68ea2be824aaf4e3d08b67e3bfbab2977f)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.0 ([e7c6201](https://github.com/googleapis/java-bigquery/commit/e7c620119321b673c19b99adb79247cd3c52cd67)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.48.0 ([#3271](https://github.com/googleapis/java-bigquery/issues/3271)) ([3b6e0d5](https://github.com/googleapis/java-bigquery/commit/3b6e0d5e3d26b8e2de412aa926a638d72562d4a0)) +* Update github/codeql-action action to v2.25.2 ([#3260](https://github.com/googleapis/java-bigquery/issues/3260)) ([3302dc4](https://github.com/googleapis/java-bigquery/commit/3302dc46e3e2c6a173798ef7f1642d3d4cb20332)) +* Update github/codeql-action action to v2.25.3 ([#3268](https://github.com/googleapis/java-bigquery/issues/3268)) ([1cf2377](https://github.com/googleapis/java-bigquery/commit/1cf237702e16952029741c306aa57cb3558a663f)) + ## [2.39.0](https://github.com/googleapis/java-bigquery/compare/v2.38.2...v2.39.0) (2024-04-22) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 40095c03d3..7da9585e97 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 66e5921d6c..126d75c834 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.39.1-SNAPSHOT + 2.39.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 494fa2aa28..71738d92ea 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.39.1-SNAPSHOT + 2.39.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.39.1-SNAPSHOT + 2.39.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1e01ec92e8..1ff930cd3d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.39.1-SNAPSHOT + 2.39.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 42f3fffc60..4338842843 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1-SNAPSHOT + 2.39.1 diff --git a/versions.txt b/versions.txt index 843cba5f40..198c0fe150 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.39.0:2.39.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.39.1:2.39.1 \ No newline at end of file From 8bac33a32e0239ffa03715ad0c6440527cb2e01e Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:48:21 -0400 Subject: [PATCH 1679/2268] feat: Add getStringOrDefault method to FieldValue (#3255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add getStringOrDefault method to FieldValue * feat: Add getStringOrDefault method to FieldValue * Add null case to FieldValueTest unit test * 🦉 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 --- .../java/com/google/cloud/bigquery/FieldValue.java | 14 ++++++++++++++ .../com/google/cloud/bigquery/FieldValueTest.java | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index a28f2ed61b..c5a8fab07c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -123,6 +123,20 @@ public String getStringValue() { return (String) value; } + /** + * Returns this field's value as a {@link String}, or defaultValue if {@link #isNull()} returns + * {@code true}. See {@link #getStringValue()} for more details. + * + * @throws ClassCastException if the field is not a primitive type + */ + @SuppressWarnings("unchecked") + public String getStringValueOrDefault(String defaultValue) { + if (isNull()) { + return defaultValue; + } + return getStringValue(); + } + /** * Returns this field's value as a byte array. This method should only be used if the * corresponding field has primitive type ({@link LegacySQLTypeName#BYTES}. diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index eaebe35671..6dbe817078 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import com.google.api.client.util.Data; import com.google.api.services.bigquery.model.TableCell; @@ -77,12 +78,14 @@ public void testFromPb() { value = FieldValue.fromPb(GEOGRAPHY_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertEquals("POINT(-122.350220 47.649154)", value.getStringValue()); + assertEquals("POINT(-122.350220 47.649154)", value.getStringValueOrDefault(null)); value = FieldValue.fromPb(NUMERIC_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertEquals(new BigDecimal("123456789.123456789"), value.getNumericValue()); value = FieldValue.fromPb(STRING_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertEquals("string", value.getStringValue()); + assertEquals("string", value.getStringValueOrDefault(null)); value = FieldValue.fromPb(TIMESTAMP_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertEquals(42000000, value.getTimestampValue()); @@ -92,11 +95,13 @@ public void testFromPb() { PeriodDuration.of(Period.of(3, 2, 1), Duration.parse("PT12H34M56.789S")); assertEquals(periodDuration, value.getPeriodDuration()); assertEquals("P3Y2M1DT12H34M56.789S", value.getStringValue()); + assertEquals("P3Y2M1DT12H34M56.789S", value.getStringValueOrDefault(null)); value = FieldValue.fromPb(INTERVAL_FIELD_2); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); periodDuration = PeriodDuration.of(Period.of(3, 2, 1), Duration.parse("PT12H34M56.789S")); assertEquals(periodDuration, value.getPeriodDuration()); assertEquals("3-2 1 12:34:56.789", value.getStringValue()); + assertEquals("3-2 1 12:34:56.789", value.getStringValueOrDefault(null)); value = FieldValue.fromPb(BYTES_FIELD); assertEquals(FieldValue.Attribute.PRIMITIVE, value.getAttribute()); assertArrayEquals(BYTES, value.getBytesValue()); @@ -113,6 +118,10 @@ public void testFromPb() { assertEquals(FieldValue.Attribute.RECORD, value.getAttribute()); assertEquals(FieldValue.fromPb(FLOAT_FIELD), value.getRepeatedValue().get(0)); assertEquals(FieldValue.fromPb(TIMESTAMP_FIELD), value.getRepeatedValue().get(1)); + value = FieldValue.fromPb(NULL_FIELD); + assertTrue(value.isNull()); + assertEquals(null, value.getStringValueOrDefault(null)); + assertEquals("defaultValue", value.getStringValueOrDefault("defaultValue")); } @Test From fa1a6d8ac490b2bb658d5b111ddecaf396ce5ac4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 29 Apr 2024 22:15:38 +0200 Subject: [PATCH 1680/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.0 (#3276) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a1eb97001c..c204f9004e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.38.0 + 2.39.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4338842843..1d94faeecc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.38.0 + 2.39.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6cb2561c36..31cb2dab9e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.38.0 + 2.39.0 test From 8fa6d279bc8dd8fc11fd7f0ebadcbeca7f88ef42 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 Apr 2024 17:30:32 +0200 Subject: [PATCH 1681/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.39.1 (#3278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-bigquery](https://togithub.com/googleapis/java-bigquery) | `2.39.0` -> `2.39.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-bigquery/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-bigquery/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-bigquery/2.39.0/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-bigquery/2.39.0/2.39.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
    googleapis/java-bigquery (com.google.cloud:google-cloud-bigquery) ### [`v2.39.1`](https://togithub.com/googleapis/java-bigquery/blob/HEAD/CHANGELOG.md#2391-2024-04-29) ##### Bug Fixes - [@​Nullable](https://togithub.com/Nullable) annotations on builder methods ([#​3222](https://togithub.com/googleapis/java-bigquery/issues/3222)) ([0c5eed1](https://togithub.com/googleapis/java-bigquery/commit/0c5eed1a18409f120a1243bd5da1db2aa4f9c206)) ##### Dependencies - Update actions/checkout action ([#​3267](https://togithub.com/googleapis/java-bigquery/issues/3267)) ([c297ed2](https://togithub.com/googleapis/java-bigquery/commit/c297ed2c77e36257451b5c12e4988f3293cdbb88)) - Update actions/upload-artifact action to v4.3.3 ([#​3258](https://togithub.com/googleapis/java-bigquery/issues/3258)) ([5215235](https://togithub.com/googleapis/java-bigquery/commit/52152350a2a6218b51ebf3d7dd6beb2699064a3c)) - Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.44.0 ([#​3270](https://togithub.com/googleapis/java-bigquery/issues/3270)) ([ee09ab6](https://togithub.com/googleapis/java-bigquery/commit/ee09ab68ea2be824aaf4e3d08b67e3bfbab2977f)) - Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.0 ([e7c6201](https://togithub.com/googleapis/java-bigquery/commit/e7c620119321b673c19b99adb79247cd3c52cd67)) - Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.48.0 ([#​3271](https://togithub.com/googleapis/java-bigquery/issues/3271)) ([3b6e0d5](https://togithub.com/googleapis/java-bigquery/commit/3b6e0d5e3d26b8e2de412aa926a638d72562d4a0)) - Update github/codeql-action action to v2.25.2 ([#​3260](https://togithub.com/googleapis/java-bigquery/issues/3260)) ([3302dc4](https://togithub.com/googleapis/java-bigquery/commit/3302dc46e3e2c6a173798ef7f1642d3d4cb20332)) - Update github/codeql-action action to v2.25.3 ([#​3268](https://togithub.com/googleapis/java-bigquery/issues/3268)) ([1cf2377](https://togithub.com/googleapis/java-bigquery/commit/1cf237702e16952029741c306aa57cb3558a663f))
    --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquery). --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a2aa57226c..5ae7e7abd7 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.39.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.39.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.39.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.39.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.39.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.39.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c204f9004e..ef22077063 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.39.0 + 2.39.1 From 67f2ea47f78240b6def27241e21fd298a75920b2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 3 May 2024 16:24:06 +0200 Subject: [PATCH 1682/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.30.0 (#3279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:sdk-platform-java-config to v3.30.0 * 🦉 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 --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- README.md | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 837835a5c8..e61a4af1b1 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.29.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.30.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index a1b734677d..6fd91140cb 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.29.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 8a6da76b4a..e709308c5a 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.29.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index ef071a411b..9fa6d222db 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.29.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 1b1d4c4bfe..aad0db9785 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.29.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.0" } env_vars: { diff --git a/README.md b/README.md index 5ae7e7abd7..2e55de6a97 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.37.0') +implementation platform('com.google.cloud:libraries-bom:26.38.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 126d75c834..4ca20f7fa6 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.29.0 + 3.30.0 diff --git a/pom.xml b/pom.xml index 1ff930cd3d..f35754a3b9 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.29.0 + 3.30.0 From 4d498130ae7f3a3077ae415ee9f6250635f639d3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 10:11:24 -0400 Subject: [PATCH 1683/2268] chore(main): release 2.39.2-SNAPSHOT (#3277) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7da9585e97..4f80512ae1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 4ca20f7fa6..f5625d307f 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.39.1 + 2.39.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 71738d92ea..227097f45f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.39.1 + 2.39.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.39.1 + 2.39.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f35754a3b9..71eb3fd0f3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.39.1 + 2.39.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1d94faeecc..57a3c3bc13 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1 + 2.39.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 198c0fe150..772df7dd41 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.39.1:2.39.1 \ No newline at end of file +google-cloud-bigquery:2.39.1:2.39.2-SNAPSHOT \ No newline at end of file From b73230ecae9b85251ac5064c175613273747398e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 10:48:23 -0400 Subject: [PATCH 1684/2268] chore(main): release 2.40.0 (#3282) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d675cc8211..d9ac2302ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.40.0](https://github.com/googleapis/java-bigquery/compare/v2.39.1...v2.40.0) (2024-05-06) + + +### Features + +* Add getStringOrDefault method to FieldValue ([#3255](https://github.com/googleapis/java-bigquery/issues/3255)) ([8bac33a](https://github.com/googleapis/java-bigquery/commit/8bac33a32e0239ffa03715ad0c6440527cb2e01e)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.30.0 ([#3279](https://github.com/googleapis/java-bigquery/issues/3279)) ([67f2ea4](https://github.com/googleapis/java-bigquery/commit/67f2ea47f78240b6def27241e21fd298a75920b2)) + ## [2.39.1](https://github.com/googleapis/java-bigquery/compare/v2.39.0...v2.39.1) (2024-04-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4f80512ae1..a14f420e0c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.39.2-SNAPSHOT + 2.40.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index f5625d307f..3412d1fd7d 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.39.2-SNAPSHOT + 2.40.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.39.2-SNAPSHOT + 2.40.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 227097f45f..1be098dd71 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.39.2-SNAPSHOT + 2.40.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.39.2-SNAPSHOT + 2.40.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 71eb3fd0f3..0dff255c20 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.39.2-SNAPSHOT + 2.40.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.39.2-SNAPSHOT + 2.40.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 57a3c3bc13..d6cc26323e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.39.2-SNAPSHOT + 2.40.0 diff --git a/versions.txt b/versions.txt index 772df7dd41..328e41f493 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.39.1:2.39.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.40.0:2.40.0 \ No newline at end of file From 842f1822049831bdfe176ccd83b882104ddb8425 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 12:53:22 -0400 Subject: [PATCH 1685/2268] chore(main): release 2.40.1-SNAPSHOT (#3283) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a14f420e0c..a75fbddd97 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.0 + 2.40.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3412d1fd7d..043845b76c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.0 + 2.40.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1be098dd71..12d5632834 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.0 + 2.40.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0dff255c20..4af57364f7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.0 + 2.40.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d6cc26323e..817a889d42 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 328e41f493..a711e0e43f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.0:2.40.0 \ No newline at end of file +google-cloud-bigquery:2.40.0:2.40.1-SNAPSHOT \ No newline at end of file From 29059131d3736c15782071d0582234fc29b9c288 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 May 2024 19:47:10 +0200 Subject: [PATCH 1686/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.0 (#3285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.0 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2e55de6a97..4e20674b73 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.39.1 + 2.40.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.39.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.40.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.39.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.39.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ef22077063..47b92f6249 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.39.1 + 2.40.0 From f2c98e0e7b3f4cd81b3c33a45532263700dd8feb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 May 2024 20:27:04 +0200 Subject: [PATCH 1687/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.1 (#3284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.1 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4af57364f7..e15c9cabcb 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.5.0 + 3.5.1 pom import From 4d8f3fb7fd3d8f6e9484c809d6690f8078ef7a30 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 May 2024 20:27:32 +0200 Subject: [PATCH 1688/2268] deps: update actions/checkout action (#3286) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f9cc590285..1611e0fd5c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 with: persist-credentials: false From 0dc69b371b4dc52d12011f933005bfb77e839f9e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 18:06:24 -0400 Subject: [PATCH 1689/2268] chore(main): release 2.40.1 (#3287) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ac2302ea..a939b3e6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.40.1](https://github.com/googleapis/java-bigquery/compare/v2.40.0...v2.40.1) (2024-05-06) + + +### Dependencies + +* Update actions/checkout action ([#3286](https://github.com/googleapis/java-bigquery/issues/3286)) ([4d8f3fb](https://github.com/googleapis/java-bigquery/commit/4d8f3fb7fd3d8f6e9484c809d6690f8078ef7a30)) + ## [2.40.0](https://github.com/googleapis/java-bigquery/compare/v2.39.1...v2.40.0) (2024-05-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a75fbddd97..bcf23b1fe5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.1-SNAPSHOT + 2.40.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 043845b76c..7b43ade968 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.1-SNAPSHOT + 2.40.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1-SNAPSHOT + 2.40.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 12d5632834..0956061868 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.1-SNAPSHOT + 2.40.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.1-SNAPSHOT + 2.40.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e15c9cabcb..ee980ecfd4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.1-SNAPSHOT + 2.40.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1-SNAPSHOT + 2.40.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 817a889d42..74b17827a3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1-SNAPSHOT + 2.40.1 diff --git a/versions.txt b/versions.txt index a711e0e43f..848fb8f026 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.0:2.40.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.40.1:2.40.1 \ No newline at end of file From af8f64c894b917d107de0ac472683b9d16ceb107 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 7 May 2024 17:55:47 +0200 Subject: [PATCH 1690/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.1 (#3289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.1 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4e20674b73..46a291fb20 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.40.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.40.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.1" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 47b92f6249..9fff816551 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.40.0 + 2.40.1 From 6e281d548e3198456929ac429a3390480b74a2af Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 13:35:08 -0400 Subject: [PATCH 1691/2268] chore(main): release 2.40.2-SNAPSHOT (#3288) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bcf23b1fe5..129df70391 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.1 + 2.40.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7b43ade968..12df23ddb7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.1 + 2.40.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0956061868..5fd9b3f229 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.1 + 2.40.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ee980ecfd4..430be7a70d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.1 + 2.40.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 74b17827a3..6097733440 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 848fb8f026..d74a98f5ad 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.1:2.40.1 \ No newline at end of file +google-cloud-bigquery:2.40.1:2.40.2-SNAPSHOT \ No newline at end of file From 127cff9f964c5d2d912d26276474822fd137a64b Mon Sep 17 00:00:00 2001 From: Nick Redfearn <97466325+nick-redfearn@users.noreply.github.com> Date: Wed, 8 May 2024 18:40:22 +0100 Subject: [PATCH 1692/2268] fix: Fixing NPE bug by adding to if clause (#3290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fixing bug by adding to if clause * fix: fixing formatting * 🦉 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 --- .../src/main/java/com/google/cloud/bigquery/BigQueryImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index a0e61e23b0..acfa1b7f12 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -427,7 +427,9 @@ public com.google.api.services.bigquery.model.Job call() { } if (!idRandom) { - if (createException instanceof BigQueryException && createException.getCause() != null) { + if (createException instanceof BigQueryException + && createException.getCause() != null + && createException.getCause().getMessage() != null) { /*GoogleJsonResponseException createExceptionCause = (GoogleJsonResponseException) createException.getCause();*/ From 5bd03bae5f379c4edc0f5d4c13340d0ed263410e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 May 2024 15:38:32 +0200 Subject: [PATCH 1693/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.1 (#3293) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9fff816551..98f25c989e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.39.0 + 2.39.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6097733440..5e7a6d0c81 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.39.0 + 2.39.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 31cb2dab9e..54f08d45b3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.39.0 + 2.39.1 test From 7d1151580c21ef1d3c9ba1920db35875e7c9ca02 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 May 2024 15:38:47 +0200 Subject: [PATCH 1694/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.45.0 (#3294) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 430be7a70d..5f5d69ef39 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.44.0 + 2.45.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 98f25c989e..ef733c9d49 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.44.0 + 2.45.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5e7a6d0c81..5d0c18f7ec 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.44.0 + 2.45.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 54f08d45b3..4e5e2b75fe 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.44.0 + 2.45.0 test From c659523a7ca25bc12282f0e28fff18ec9221f48e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 May 2024 15:38:58 +0200 Subject: [PATCH 1695/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.45.0 (#3295) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5f5d69ef39..e3dccc2d99 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.44.0 + 2.45.0 test From d09608211aed5dc49e2b5e51affe7942403ed267 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 May 2024 15:12:06 +0200 Subject: [PATCH 1696/2268] deps: update ossf/scorecard-action action to v2.3.3 (#3304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update ossf/scorecard-action action to v2.3.3 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1611e0fd5c..95a3062808 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 with: results_file: results.sarif results_format: sarif diff --git a/README.md b/README.md index 46a291fb20..8ec28e640f 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.38.0') +implementation platform('com.google.cloud:libraries-bom:26.39.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` From 194ed0919eb3e47b224df267c68c6f96728d1827 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 May 2024 15:13:45 +0200 Subject: [PATCH 1697/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.2 (#3303) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ef733c9d49..3fa4525a99 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.39.1 + 2.39.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5d0c18f7ec..409ef8a616 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.39.1 + 2.39.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4e5e2b75fe..0b5973853d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.39.1 + 2.39.2 test From 7d148d5bb1d6e1e6b0a421749fcbb73a6fbe61e0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 May 2024 15:20:52 +0200 Subject: [PATCH 1698/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.49.0 (#3296) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3dccc2d99..ea0b2ad14a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.48.0 + 1.49.0 pom import From 306409edc97674807871b5dab6b6eb66f84c9c02 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 12:53:56 -0400 Subject: [PATCH 1699/2268] chore: update dependency versions in java templates (#1964) (#3301) * chore: update dependency versions in java templates * update other templates Source-Link: https://github.com/googleapis/synthtool/commit/0b86c72fe652dd7e52ba05a63f61bc1399ad5d65 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:68ba5f5164a4b55529d358bb262feaa000536a0c62980727dd05a91bbb47ea5e Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +-- .github/workflows/approve-readme.yaml | 2 +- .github/workflows/ci.yaml | 30 ++++++++++---------- .github/workflows/renovate_config_check.yaml | 2 +- .github/workflows/samples.yaml | 4 +-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 1096f4dc0f..5db36a5f7d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:d13de1a4faec2645bda630b7a9aa080ce95182795aeab6f37ed4bd18cf5facbc -# created: 2024-04-24T14:22:15.892514394Z + digest: sha256:68ba5f5164a4b55529d358bb262feaa000536a0c62980727dd05a91bbb47ea5e +# created: 2024-05-09T16:31:37.168667071Z diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index f5fc7d5169..59f00b8eb6 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ae66b1973b..b91fa381f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,8 +27,8 @@ jobs: matrix: java: [11, 17, 21] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{matrix.java}} @@ -41,8 +41,8 @@ jobs: name: "units (8)" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: 8 distribution: temurin @@ -51,7 +51,7 @@ jobs: # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV shell: bash - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: java-version: 17 distribution: temurin @@ -63,8 +63,8 @@ jobs: steps: - name: Support longpaths run: git config --system core.longpaths true - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 8 @@ -78,8 +78,8 @@ jobs: matrix: java: [17] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{matrix.java}} @@ -88,8 +88,8 @@ jobs: javadoc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 @@ -100,8 +100,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 @@ -112,8 +112,8 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 8 diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml index 87d8eb2be8..7c5ec7865e 100644 --- a/.github/workflows/renovate_config_check.yaml +++ b/.github/workflows/renovate_config_check.yaml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '20' diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index 10d252d775..03b2939567 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,8 +20,8 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: temurin java-version: 8 From acf6e737bbda01d8e759e5c910cccb6b57f28f3e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 May 2024 19:36:23 +0200 Subject: [PATCH 1700/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.38.0 (#3302) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea0b2ad14a..98be811fd7 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.37.0 + 2.38.0 test From 13bb5aaa6e4bac7144a369c9fbb5ae8922eb36ee Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 May 2024 23:22:42 +0200 Subject: [PATCH 1701/2268] deps: update github/codeql-action action to v2.25.4 (#3291) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 95a3062808..33b7cb733c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@ceaec5c11a131e0d282ff3b6f095917d234caace # v2.25.3 + uses: github/codeql-action/upload-sarif@4f0ceda83afa9bc55df7b6c611b81435fa53d987 # v2.25.4 with: sarif_file: results.sarif From 641f1a8325f0f43aeffd135654480a721f26e4e7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 26 May 2024 18:03:59 +0200 Subject: [PATCH 1702/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.30.1 (#3310) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index e61a4af1b1..c68f5f5900 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.30.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.30.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 6fd91140cb..030444e512 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index e709308c5a..ee3ad6d86f 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 9fa6d222db..0083532373 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.1"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index aad0db9785..1292cf163b 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 12df23ddb7..e8b3648e66 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.30.0 + 3.30.1 diff --git a/pom.xml b/pom.xml index 98be811fd7..a4d025ebb1 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.30.0 + 3.30.1 From 11f0d2d449b0f1af8c9415312f64ec144f348a7c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 26 May 2024 20:20:55 +0200 Subject: [PATCH 1703/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.5.2 (#3320) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4d025ebb1..5f13d5207b 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.5.1 + 3.5.2 pom import From ba988970574ad393b9aa416e991334a4a331c4d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 08:18:44 -0400 Subject: [PATCH 1704/2268] chore(main): release 2.40.2 (#3292) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a939b3e6b8..0d65694b11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.40.2](https://github.com/googleapis/java-bigquery/compare/v2.40.1...v2.40.2) (2024-05-26) + + +### Bug Fixes + +* Fixing NPE bug by adding to if clause ([#3290](https://github.com/googleapis/java-bigquery/issues/3290)) ([127cff9](https://github.com/googleapis/java-bigquery/commit/127cff9f964c5d2d912d26276474822fd137a64b)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.45.0 ([#3295](https://github.com/googleapis/java-bigquery/issues/3295)) ([c659523](https://github.com/googleapis/java-bigquery/commit/c659523a7ca25bc12282f0e28fff18ec9221f48e)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.49.0 ([#3296](https://github.com/googleapis/java-bigquery/issues/3296)) ([7d148d5](https://github.com/googleapis/java-bigquery/commit/7d148d5bb1d6e1e6b0a421749fcbb73a6fbe61e0)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.30.1 ([#3310](https://github.com/googleapis/java-bigquery/issues/3310)) ([641f1a8](https://github.com/googleapis/java-bigquery/commit/641f1a8325f0f43aeffd135654480a721f26e4e7)) +* Update github/codeql-action action to v2.25.4 ([#3291](https://github.com/googleapis/java-bigquery/issues/3291)) ([13bb5aa](https://github.com/googleapis/java-bigquery/commit/13bb5aaa6e4bac7144a369c9fbb5ae8922eb36ee)) +* Update ossf/scorecard-action action to v2.3.3 ([#3304](https://github.com/googleapis/java-bigquery/issues/3304)) ([d096082](https://github.com/googleapis/java-bigquery/commit/d09608211aed5dc49e2b5e51affe7942403ed267)) + ## [2.40.1](https://github.com/googleapis/java-bigquery/compare/v2.40.0...v2.40.1) (2024-05-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 129df70391..c97073ad39 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.2-SNAPSHOT + 2.40.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e8b3648e66..76854c3fbd 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.2-SNAPSHOT + 2.40.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2-SNAPSHOT + 2.40.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5fd9b3f229..21b589fa28 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.2-SNAPSHOT + 2.40.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.2-SNAPSHOT + 2.40.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5f13d5207b..2b00d67b7c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.2-SNAPSHOT + 2.40.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2-SNAPSHOT + 2.40.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 409ef8a616..e5b80c7a9c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2-SNAPSHOT + 2.40.2 diff --git a/versions.txt b/versions.txt index d74a98f5ad..f81ca08e7f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.1:2.40.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.40.2:2.40.2 \ No newline at end of file From 5d4c378cf95ce3a81cdee99b9a92a6f70bbbf306 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 08:58:39 -0400 Subject: [PATCH 1705/2268] chore(main): release 2.40.3-SNAPSHOT (#3322) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c97073ad39..a2072e35ee 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.2 + 2.40.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 76854c3fbd..11e339aafd 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.2 + 2.40.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 21b589fa28..67567c1341 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.2 + 2.40.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2b00d67b7c..2748a1b9ba 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.2 + 2.40.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e5b80c7a9c..2651ecdbd5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index f81ca08e7f..d7c22bcb18 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.2:2.40.2 \ No newline at end of file +google-cloud-bigquery:2.40.2:2.40.3-SNAPSHOT \ No newline at end of file From d05e5547e97f52ccfdcec1d6fe167e6587dd00c6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 16:21:32 +0200 Subject: [PATCH 1706/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.36.0 (#3305) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3fa4525a99..f6b6094ebe 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.35.0 + 1.36.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2651ecdbd5..b07189ab07 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.35.0 + 1.36.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0b5973853d..62b189b386 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.35.0 + 1.36.0 com.google.oauth-client From 4e7f6b5fe60c3e6b1f964be02cf2a5aca24eb553 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 18:14:38 +0200 Subject: [PATCH 1707/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.2 (#3323) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.2 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8ec28e640f..cd20be7a30 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.40.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.40.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.2" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f6b6094ebe..3a7f838fdd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.40.1 + 2.40.2 From 05804ae109d53aec94122e27ec56ac1e05053b8a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 19:34:25 +0200 Subject: [PATCH 1708/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.4 (#3321) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.4 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a7f838fdd..ee17800164 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.39.2 + 2.39.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b07189ab07..94b909dffa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.39.2 + 2.39.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 62b189b386..0616a9fa46 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.39.2 + 2.39.4 test From cd7c5cad0c7368142327269c56f946187681b11b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 19:34:51 +0200 Subject: [PATCH 1709/2268] build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.0 (#3313) --- google-cloud-bigquery/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 67567c1341..5d797f92c4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -191,7 +191,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.5.0 + 3.6.0 add-source diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ee17800164..feaa702565 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -92,7 +92,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.5.0 + 3.6.0 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 94b909dffa..1718c7f1b3 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.5.0 + 3.6.0 add-snippets-source From 3912a9232788e09c10fc4e91ef6d65514fc106e4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 19:35:23 +0200 Subject: [PATCH 1710/2268] deps: update dependency org.graalvm.buildtools:junit-platform-native to v0.10.2 (#3311) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index ba90812eb3..cac9e78551 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -99,7 +99,7 @@ org.graalvm.buildtools junit-platform-native - 0.10.1 + 0.10.2 test From c7d6362d47cb985abf3c08f5c4e89f651480c4c8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 19:39:01 +0200 Subject: [PATCH 1711/2268] deps: update actions/checkout action to v4.1.6 (#3309) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 33b7cb733c..15f886c727 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: persist-credentials: false From 8999d337b92d7030825c5a36686ddd082cadc816 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 19:39:24 +0200 Subject: [PATCH 1712/2268] deps: update github/codeql-action action to v2.25.6 (#3307) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 15f886c727..13730c1702 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4f0ceda83afa9bc55df7b6c611b81435fa53d987 # v2.25.4 + uses: github/codeql-action/upload-sarif@162eb1e32abe518e88bd229ebc8784a533ceaa51 # v2.25.6 with: sarif_file: results.sarif From 0eeed668b5f88f9c59ef6c1b309e7a81f5c1f0e9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 May 2024 20:15:08 +0200 Subject: [PATCH 1713/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.36.0 (#3306) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index feaa702565..d362b1f81a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.35.0 + 1.36.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1718c7f1b3..c874f813ab 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.35.0 + 1.36.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0616a9fa46..47203c4669 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.35.0 + 1.36.0 From 687a5f35087361c6444e767a5b565309387d3250 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 15:55:24 +0200 Subject: [PATCH 1714/2268] build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.7.0 (#3326) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.sonatype.plugins:nexus-staging-maven-plugin to v1.7.0 * 🦉 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 --- README.md | 2 +- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cd20be7a30..f8cebcd7eb 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.39.0') +implementation platform('com.google.cloud:libraries-bom:26.40.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a2072e35ee..9318773f6a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -83,7 +83,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true diff --git a/samples/pom.xml b/samples/pom.xml index b7e48a56e5..cb1d804240 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -63,7 +63,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 47203c4669..d7176fcf85 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -117,7 +117,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true From 283d6aadc50bd7556f633f51fa6208d89dbff123 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 15:55:44 +0200 Subject: [PATCH 1715/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.46.0 (#3327) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.46.0 * 🦉 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 --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 2748a1b9ba..e7dc2c8d61 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.45.0 + 2.46.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d362b1f81a..e2528bd7ec 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.45.0 + 2.46.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c874f813ab..22c0937f24 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.45.0 + 2.46.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d7176fcf85..c803be6ff0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.45.0 + 2.46.0 test From 9737a5d63d545ed197879bbd9dbfd3f1dbc15d93 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 15:55:56 +0200 Subject: [PATCH 1716/2268] deps: update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.2 (#3312) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index cac9e78551..cb49561656 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -121,7 +121,7 @@ org.graalvm.buildtools native-maven-plugin - 0.10.1 + 0.10.2 true com.example.bigquery.NativeImageBigquerySample From a6661ade5e297102ff54d314fa55caac9201ac67 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 16:33:13 +0200 Subject: [PATCH 1717/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.46.0 (#3328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.46.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7dc2c8d61..e577427f98 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.45.0 + 2.46.0 test From cabb0ab1bc09ba10c43a2cf109f1390268441693 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 16:33:28 +0200 Subject: [PATCH 1718/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.50.0 (#3330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.50.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e577427f98..ac5e945c4f 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.49.0 + 1.50.0 pom import From 4896c3f33beaf51f33baedd52c534576fb453dba Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 May 2024 16:33:40 +0200 Subject: [PATCH 1719/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.39.0 (#3331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(deps): update dependency com.google.cloud:google-cloud-storage to v2.39.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ac5e945c4f..e8934e565c 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.38.0 + 2.39.0 test From e4edcfe201d909e4771fd91b8ca436fde0adbd72 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 3 Jun 2024 15:41:47 +0200 Subject: [PATCH 1720/2268] build(deps): update dependency org.apache.maven.plugins:maven-shade-plugin to v3.6.0 (#3333) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9318773f6a..52a03210ee 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -42,7 +42,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.3 + 3.6.0 package From 768342da168921251c34163b51ffc3cddfefc0ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 3 Jun 2024 15:47:35 +0200 Subject: [PATCH 1721/2268] deps: update github/codeql-action action to v2.25.7 (#3334) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 13730c1702..261d70d4ef 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@162eb1e32abe518e88bd229ebc8784a533ceaa51 # v2.25.6 + uses: github/codeql-action/upload-sarif@366cd9811409649a3e1276ce7f1a1c9023832b56 # v2.25.7 with: sarif_file: results.sarif From 062345501c392c2a186c3cd82dee8d20ceda2a0a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 3 Jun 2024 15:56:58 +0200 Subject: [PATCH 1722/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.31.0 (#3335) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index c68f5f5900..79451bab18 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.30.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.31.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 030444e512..b2d351e09d 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.31.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index ee3ad6d86f..8a5d647570 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.31.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 0083532373..e94d7bcd66 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.30.1"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.31.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 1292cf163b..047ec1b678 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.30.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.31.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 11e339aafd..dd33ace971 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.30.1 + 3.31.0 diff --git a/pom.xml b/pom.xml index e8934e565c..67520cf373 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.30.1 + 3.31.0 From 8673fe55e6d33e50c32a520a848cddc25eb6088e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 5 Jun 2024 16:23:27 +0200 Subject: [PATCH 1723/2268] deps: update github/codeql-action action to v2.25.8 (#3338) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 261d70d4ef..9c4b7820d7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@366cd9811409649a3e1276ce7f1a1c9023832b56 # v2.25.7 + uses: github/codeql-action/upload-sarif@6ac9fc7e8e290bda8fac86290b68e176def71959 # v2.25.8 with: sarif_file: results.sarif From 7e03ca6f7bc1ced305abc0c09879ceb5aebcc613 Mon Sep 17 00:00:00 2001 From: shollyman Date: Thu, 6 Jun 2024 07:40:15 -0700 Subject: [PATCH 1724/2268] testing: update SQL iteration option (#3336) Updates from the alpha `max_iteration` option to the expected `max_iterations` option. Related: b/344469351 --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 4 ++-- .../src/main/java/com/example/bigquery/CreateModel.java | 2 +- .../src/test/java/com/example/bigquery/CreateModelIT.java | 2 +- .../src/test/java/com/example/bigquery/DeleteModelIT.java | 2 +- .../src/test/java/com/example/bigquery/GetModelIT.java | 2 +- .../src/test/java/com/example/bigquery/ListModelsIT.java | 2 +- .../java/com/example/bigquery/UpdateModelDescriptionIT.java | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 6caecd26b3..e67c9486fc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2807,7 +2807,7 @@ public void testModelLifecycle() throws InterruptedException { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " @@ -5735,7 +5735,7 @@ public void testExtractJobWithModel() throws InterruptedException { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java b/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java index 6b45718ce7..dfc5467120 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateModel.java @@ -39,7 +39,7 @@ public static void main(String[] args) { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateModelIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateModelIT.java index 52af26303d..dd18a02f1a 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CreateModelIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateModelIT.java @@ -81,7 +81,7 @@ public void testCreateModel() { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/test/java/com/example/bigquery/DeleteModelIT.java b/samples/snippets/src/test/java/com/example/bigquery/DeleteModelIT.java index f33ad1d032..9df25a6581 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/DeleteModelIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/DeleteModelIT.java @@ -69,7 +69,7 @@ public void setUp() { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/test/java/com/example/bigquery/GetModelIT.java b/samples/snippets/src/test/java/com/example/bigquery/GetModelIT.java index b7e1820d74..7a1c931ee6 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/GetModelIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/GetModelIT.java @@ -69,7 +69,7 @@ public void setUp() { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/test/java/com/example/bigquery/ListModelsIT.java b/samples/snippets/src/test/java/com/example/bigquery/ListModelsIT.java index fd99bc24ae..4ddac63bcb 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/ListModelsIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/ListModelsIT.java @@ -69,7 +69,7 @@ public void setUp() { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " diff --git a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java index 156e83d170..478cfec972 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/UpdateModelDescriptionIT.java @@ -68,7 +68,7 @@ public void setUp() { + "`" + "OPTIONS ( " + "model_type='linear_reg', " - + "max_iteration=1, " + + "max_iterations=1, " + "learn_rate=0.4, " + "learn_rate_strategy='constant' " + ") AS ( " From 3647cc1949d2098a63dcced49e89e6bf4736969d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:08:49 -0400 Subject: [PATCH 1725/2268] ci: [java] automatic kokoro label in and /gcbrun comment (#1965) (#3339) Source-Link: https://github.com/googleapis/synthtool/commit/bd2bae89f70bad380da47fab9ec25985dfb87d67 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:72f0d373307d128b2cb720c5cb4d90b31f0e86529dd138c632710ae0c69efae3 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/trusted-contribution.yml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5db36a5f7d..359fe71c19 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:68ba5f5164a4b55529d358bb262feaa000536a0c62980727dd05a91bbb47ea5e -# created: 2024-05-09T16:31:37.168667071Z + digest: sha256:72f0d373307d128b2cb720c5cb4d90b31f0e86529dd138c632710ae0c69efae3 +# created: 2024-06-05T18:32:21.724930324Z diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index a0ba1f7d90..88d3ac9bf1 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,3 +1,9 @@ trustedContributors: - renovate-bot - gcf-owl-bot[bot] + +annotations: +- type: comment + text: "/gcbrun" +- type: label + text: "kokoro:force-run" From 0d3e7fe0ed5a5bb4d2762be9c851494124bc76a0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 7 Jun 2024 15:30:13 +0200 Subject: [PATCH 1726/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.40.0 (#3340) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 67520cf373..7f0f9ff39a 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.39.0 + 2.40.0 test From 354fbf93b9121d33c7c8a72e5b27438c9e124827 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Jun 2024 16:52:02 +0200 Subject: [PATCH 1727/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.47.0 (#3341) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7f0f9ff39a..52897a16b3 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.46.0 + 2.47.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e2528bd7ec..6f065933e9 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.46.0 + 2.47.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 22c0937f24..09b253c37b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.46.0 + 2.47.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c803be6ff0..32e356a0ad 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.46.0 + 2.47.0 test From e3b934fa133679a2d61baeea6f4de15eed287f7f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Jun 2024 17:02:18 +0200 Subject: [PATCH 1728/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.51.0 (#3343) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 52897a16b3..6af5b7ea83 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.50.0 + 1.51.0 pom import From 79e34c256ddf99a43d546788535a9e8fa0e97e6d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Jun 2024 18:07:44 +0200 Subject: [PATCH 1729/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.47.0 (#3342) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6af5b7ea83..584e8fc66d 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.46.0 + 2.47.0 test From 4650fefc1bbdd20ba1648d49a1b452fef1c47451 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Jun 2024 19:19:21 +0200 Subject: [PATCH 1730/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.39.5 (#3344) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6f065933e9..89db86a583 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.39.4 + 2.39.5 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 09b253c37b..315490c5fc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.39.4 + 2.39.5 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 32e356a0ad..e69bc60269 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.39.4 + 2.39.5 test From a566927c3a4125a84d20481be8a59501102bbe90 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 12 Jun 2024 04:51:45 +0200 Subject: [PATCH 1731/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.6.0 (#3345) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 584e8fc66d..94a02f12ef 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.5.2 + 3.6.0 pom import From 4b9613d71f9af3fd91042736e9072e70b6568afd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 03:18:19 +0000 Subject: [PATCH 1732/2268] chore(main): release 2.40.3 (#3325) :robot: I have created a release *beep* *boop* --- ## [2.40.3](https://togithub.com/googleapis/java-bigquery/compare/v2.40.2...v2.40.3) (2024-06-12) ### Dependencies * Update actions/checkout action to v4.1.6 ([#3309](https://togithub.com/googleapis/java-bigquery/issues/3309)) ([c7d6362](https://togithub.com/googleapis/java-bigquery/commit/c7d6362d47cb985abf3c08f5c4e89f651480c4c8)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.46.0 ([#3328](https://togithub.com/googleapis/java-bigquery/issues/3328)) ([a6661ad](https://togithub.com/googleapis/java-bigquery/commit/a6661ade5e297102ff54d314fa55caac9201ac67)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.47.0 ([#3342](https://togithub.com/googleapis/java-bigquery/issues/3342)) ([79e34c2](https://togithub.com/googleapis/java-bigquery/commit/79e34c256ddf99a43d546788535a9e8fa0e97e6d)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.50.0 ([#3330](https://togithub.com/googleapis/java-bigquery/issues/3330)) ([cabb0ab](https://togithub.com/googleapis/java-bigquery/commit/cabb0ab1bc09ba10c43a2cf109f1390268441693)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.51.0 ([#3343](https://togithub.com/googleapis/java-bigquery/issues/3343)) ([e3b934f](https://togithub.com/googleapis/java-bigquery/commit/e3b934fa133679a2d61baeea6f4de15eed287f7f)) * Update dependency com.google.cloud:sdk-platform-java-config to v3.31.0 ([#3335](https://togithub.com/googleapis/java-bigquery/issues/3335)) ([0623455](https://togithub.com/googleapis/java-bigquery/commit/062345501c392c2a186c3cd82dee8d20ceda2a0a)) * Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.36.0 ([#3305](https://togithub.com/googleapis/java-bigquery/issues/3305)) ([d05e554](https://togithub.com/googleapis/java-bigquery/commit/d05e5547e97f52ccfdcec1d6fe167e6587dd00c6)) * Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.36.0 ([#3306](https://togithub.com/googleapis/java-bigquery/issues/3306)) ([0eeed66](https://togithub.com/googleapis/java-bigquery/commit/0eeed668b5f88f9c59ef6c1b309e7a81f5c1f0e9)) * Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.2 ([#3311](https://togithub.com/googleapis/java-bigquery/issues/3311)) ([3912a92](https://togithub.com/googleapis/java-bigquery/commit/3912a9232788e09c10fc4e91ef6d65514fc106e4)) * Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.2 ([#3312](https://togithub.com/googleapis/java-bigquery/issues/3312)) ([9737a5d](https://togithub.com/googleapis/java-bigquery/commit/9737a5d63d545ed197879bbd9dbfd3f1dbc15d93)) * Update github/codeql-action action to v2.25.6 ([#3307](https://togithub.com/googleapis/java-bigquery/issues/3307)) ([8999d33](https://togithub.com/googleapis/java-bigquery/commit/8999d337b92d7030825c5a36686ddd082cadc816)) * Update github/codeql-action action to v2.25.7 ([#3334](https://togithub.com/googleapis/java-bigquery/issues/3334)) ([768342d](https://togithub.com/googleapis/java-bigquery/commit/768342da168921251c34163b51ffc3cddfefc0ce)) * Update github/codeql-action action to v2.25.8 ([#3338](https://togithub.com/googleapis/java-bigquery/issues/3338)) ([8673fe5](https://togithub.com/googleapis/java-bigquery/commit/8673fe55e6d33e50c32a520a848cddc25eb6088e)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 19 +++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d65694b11..74c10885b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.40.3](https://github.com/googleapis/java-bigquery/compare/v2.40.2...v2.40.3) (2024-06-12) + + +### Dependencies + +* Update actions/checkout action to v4.1.6 ([#3309](https://github.com/googleapis/java-bigquery/issues/3309)) ([c7d6362](https://github.com/googleapis/java-bigquery/commit/c7d6362d47cb985abf3c08f5c4e89f651480c4c8)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.46.0 ([#3328](https://github.com/googleapis/java-bigquery/issues/3328)) ([a6661ad](https://github.com/googleapis/java-bigquery/commit/a6661ade5e297102ff54d314fa55caac9201ac67)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.47.0 ([#3342](https://github.com/googleapis/java-bigquery/issues/3342)) ([79e34c2](https://github.com/googleapis/java-bigquery/commit/79e34c256ddf99a43d546788535a9e8fa0e97e6d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.50.0 ([#3330](https://github.com/googleapis/java-bigquery/issues/3330)) ([cabb0ab](https://github.com/googleapis/java-bigquery/commit/cabb0ab1bc09ba10c43a2cf109f1390268441693)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.51.0 ([#3343](https://github.com/googleapis/java-bigquery/issues/3343)) ([e3b934f](https://github.com/googleapis/java-bigquery/commit/e3b934fa133679a2d61baeea6f4de15eed287f7f)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.31.0 ([#3335](https://github.com/googleapis/java-bigquery/issues/3335)) ([0623455](https://github.com/googleapis/java-bigquery/commit/062345501c392c2a186c3cd82dee8d20ceda2a0a)) +* Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.36.0 ([#3305](https://github.com/googleapis/java-bigquery/issues/3305)) ([d05e554](https://github.com/googleapis/java-bigquery/commit/d05e5547e97f52ccfdcec1d6fe167e6587dd00c6)) +* Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.36.0 ([#3306](https://github.com/googleapis/java-bigquery/issues/3306)) ([0eeed66](https://github.com/googleapis/java-bigquery/commit/0eeed668b5f88f9c59ef6c1b309e7a81f5c1f0e9)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.2 ([#3311](https://github.com/googleapis/java-bigquery/issues/3311)) ([3912a92](https://github.com/googleapis/java-bigquery/commit/3912a9232788e09c10fc4e91ef6d65514fc106e4)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.2 ([#3312](https://github.com/googleapis/java-bigquery/issues/3312)) ([9737a5d](https://github.com/googleapis/java-bigquery/commit/9737a5d63d545ed197879bbd9dbfd3f1dbc15d93)) +* Update github/codeql-action action to v2.25.6 ([#3307](https://github.com/googleapis/java-bigquery/issues/3307)) ([8999d33](https://github.com/googleapis/java-bigquery/commit/8999d337b92d7030825c5a36686ddd082cadc816)) +* Update github/codeql-action action to v2.25.7 ([#3334](https://github.com/googleapis/java-bigquery/issues/3334)) ([768342d](https://github.com/googleapis/java-bigquery/commit/768342da168921251c34163b51ffc3cddfefc0ce)) +* Update github/codeql-action action to v2.25.8 ([#3338](https://github.com/googleapis/java-bigquery/issues/3338)) ([8673fe5](https://github.com/googleapis/java-bigquery/commit/8673fe55e6d33e50c32a520a848cddc25eb6088e)) + ## [2.40.2](https://github.com/googleapis/java-bigquery/compare/v2.40.1...v2.40.2) (2024-05-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 52a03210ee..34936aa4b3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.3-SNAPSHOT + 2.40.3 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index dd33ace971..62c3d4efca 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.3-SNAPSHOT + 2.40.3 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3-SNAPSHOT + 2.40.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5d797f92c4..7c4aeb0b2a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.3-SNAPSHOT + 2.40.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.3-SNAPSHOT + 2.40.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 94a02f12ef..076fac5219 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.3-SNAPSHOT + 2.40.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3-SNAPSHOT + 2.40.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 315490c5fc..673234c1dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3-SNAPSHOT + 2.40.3 diff --git a/versions.txt b/versions.txt index d7c22bcb18..77a4710e89 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.2:2.40.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.40.3:2.40.3 \ No newline at end of file From 2814dc49dfdd5671257b6a9933a5dd381d889dd1 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:30:19 -0400 Subject: [PATCH 1733/2268] feat: add MetadataCacheMode to ExternalTableDefinition (#3351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add MetadataCacheMode to ExternalTableDefinition * Update comment * 🦉 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 --- README.md | 8 ++-- .../bigquery/ExternalTableDefinition.java | 40 +++++++++++++++++++ .../bigquery/ExternalTableDefinitionTest.java | 4 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 26 ++++++++++++ 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f8cebcd7eb..1976f6bb1c 100644 --- a/README.md +++ b/README.md @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.40.0') +implementation platform('com.google.cloud:libraries-bom:26.41.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.40.2' +implementation 'com.google.cloud:google-cloud-bigquery:2.40.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.3" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.2 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.3 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 9f8aa40124..363f9507e1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -186,6 +186,20 @@ public Builder setObjectMetadata(String objectMetadata) { abstract Builder setObjectMetadataInner(String objectMetadata); + /** + * [Optional] Metadata Cache Mode for the table. Set this to enable caching of metadata from + * external data source. + * + * @see + * MetadataCacheMode + */ + public Builder setMetadataCacheMode(String metadataCacheMode) { + return setMetadataCacheModeInner(metadataCacheMode); + } + + abstract Builder setMetadataCacheModeInner(String metadataCacheMode); + /** Creates an {@code ExternalTableDefinition} object. */ @Override public abstract ExternalTableDefinition build(); @@ -276,6 +290,21 @@ public String getObjectMetadata() { @Nullable abstract String getObjectMetadataInner(); + /** + * Returns the metadata cache mode. + * + * @see + * MetadataCacheMode + */ + @Nullable + public String getMetadataCacheMode() { + return getMetadataCacheModeInner(); + } + + @Nullable + abstract String getMetadataCacheModeInner(); + /** * Returns the source format, and possibly some parsing options, of the external data. Supported * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. @@ -387,6 +416,10 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC externalConfigurationPb.setObjectMetadata(getObjectMetadata()); } + if (getMetadataCacheMode() != null) { + externalConfigurationPb.setMetadataCacheMode(getMetadataCacheMode()); + } + return externalConfigurationPb; } @@ -580,6 +613,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (externalDataConfiguration.getObjectMetadata() != null) { builder.setObjectMetadata(externalDataConfiguration.getObjectMetadata()); } + if (externalDataConfiguration.getMetadataCacheMode() != null) { + builder.setMetadataCacheMode(externalDataConfiguration.getMetadataCacheMode()); + } } return builder.build(); } @@ -647,6 +683,10 @@ static ExternalTableDefinition fromExternalDataConfiguration( builder.setObjectMetadata(externalDataConfiguration.getObjectMetadata()); } + if (externalDataConfiguration.getMetadataCacheMode() != null) { + builder.setMetadataCacheMode(externalDataConfiguration.getMetadataCacheMode()); + } + return builder.build(); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index ed56598916..2562e1763c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -59,6 +59,8 @@ public class ExternalTableDefinitionTest { .setSourceUriPrefix(SOURCE_URIS.get(0)) .build(); private static final String OBJECT_METADATA = "SIMPLE"; + + private static final String METADATA_CACHE_MODE = "AUTOMATIC"; private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") @@ -70,6 +72,7 @@ public class ExternalTableDefinitionTest { .setAutodetect(AUTODETECT) .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) .setObjectMetadata(OBJECT_METADATA) + .setMetadataCacheMode(METADATA_CACHE_MODE) .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = @@ -170,5 +173,6 @@ private void compareExternalTableDefinition( assertEquals(expected.getAutodetect(), value.getAutodetect()); assertEquals(expected.getHivePartitioningOptions(), value.getHivePartitioningOptions()); assertEquals(expected.getObjectMetadata(), value.getObjectMetadata()); + assertEquals(expected.getMetadataCacheMode(), value.getMetadataCacheMode()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e67c9486fc..d6a80e86ea 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6832,6 +6832,32 @@ public void testExternalTableMetadataCachingNotEnable() throws InterruptedExcept assertTrue(remoteTable.delete()); } + @Test + public void testExternalMetadataCacheModeFailForNonBiglake() { + // Validate that MetadataCacheMode is passed to the backend. + // TODO: Enhance this test after BigLake testing infrastructure is inplace. + String tableName = "test_metadata_cache_mode_fail_for_non_biglake"; + TableId tableId = TableId.of(DATASET, tableName); + ExternalTableDefinition externalTableDefinition = + ExternalTableDefinition.newBuilder( + "gs://" + BUCKET + "/" + JSON_LOAD_FILE, TABLE_SCHEMA, FormatOptions.json()) + .setMetadataCacheMode("AUTOMATIC") + .build(); + TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); + + try { + bigquery.create(tableInfo); + fail("BigQueryException was expected"); + } catch (BigQueryException e) { + BigQueryError error = e.getError(); + assertNotNull(error); + assertEquals("invalid", error.getReason()); + assertThat( + e.getMessage().contains("metadataCacheMode provided for non BigLake external table")) + .isTrue(); + } + } + @Test public void testObjectTable() throws InterruptedException { String tableName = "test_object_table"; From ccbd708fc459ace9f96c1aa324e1071918556fbb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Jun 2024 20:19:41 +0200 Subject: [PATCH 1734/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0 (#3353) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0 * 🦉 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 Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> --- README.md | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1976f6bb1c..7428c3de6e 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.41.0') +implementation platform('com.google.cloud:libraries-bom:26.42.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/pom.xml b/pom.xml index 076fac5219..fafc5757ae 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.5.0 + 3.6.0 From 8b6feffa0e8add73a7587ce1762989713c2af38b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Jun 2024 21:28:31 +0200 Subject: [PATCH 1735/2268] deps: update github/codeql-action action to v2.25.10 (#3348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.25.10 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9c4b7820d7..2a1c0c45a4 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@6ac9fc7e8e290bda8fac86290b68e176def71959 # v2.25.8 + uses: github/codeql-action/upload-sarif@a073c66b2accf653a511d88537804dcafa07812e # v2.25.10 with: sarif_file: results.sarif From 3d33ab9a0694b637c283c153e8ad6928ee052ff0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Jun 2024 21:45:50 +0200 Subject: [PATCH 1736/2268] build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0 (#3352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0 * 🦉 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 Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index cb49561656..db3ce2f184 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -111,7 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.3.0 **/*IT From 085723491e4aca58d670c313bc18b0c044cfdca8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Jun 2024 21:46:13 +0200 Subject: [PATCH 1737/2268] deps: update actions/checkout action to v4.1.7 (#3349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/checkout action to v4.1.7 * 🦉 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 Co-authored-by: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 2a1c0c45a4..d278d4481f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: persist-credentials: false From 4c4c8908ca8cbda78ada1058332783cf4afde676 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Jun 2024 13:51:09 +0200 Subject: [PATCH 1738/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.3 (#3347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.40.3 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7428c3de6e..3a77fbac98 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 89db86a583..3a8f8d9976 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.40.2 + 2.40.3 From 7b7e52b339f57af752c573a222df68196f1808f5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Jun 2024 16:50:52 +0200 Subject: [PATCH 1739/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240602-2.0.0 (#3273) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fafc5757ae..263995e8e2 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240323-2.0.0 + v2-rev20240602-2.0.0 From 2f3cbe39619bcc93cb7d504417accd84b418dd41 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:07:48 -0400 Subject: [PATCH 1740/2268] feat: add columnNameCharacterMap to LoadJobConfiguration (#3356) * feat: add columnNameCharacterMap to LoadJobConfiguration * fix: unintentional empty line delete * fix: lint/format --- .../cloud/bigquery/LoadJobConfiguration.java | 37 +++++++++++ .../bigquery/LoadJobConfigurationTest.java | 2 + .../cloud/bigquery/it/ITBigQueryTest.java | 64 +++++++++++++++++++ 3 files changed, 103 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index fefff3409f..2d348f0d45 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -39,6 +39,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final List sourceUris; private final String fileSetSpecType; + private final String columnNameCharacterMap; private final TableId destinationTable; private final List decimalTargetTypes; private final EncryptionConfiguration destinationEncryptionConfiguration; @@ -69,6 +70,8 @@ public static final class Builder extends JobConfiguration.Builder sourceUris; private String fileSetSpecType; + private String columnNameCharacterMap; + private TableId destinationTable; private List decimalTargetTypes; private EncryptionConfiguration destinationEncryptionConfiguration; @@ -110,6 +113,7 @@ private Builder(LoadJobConfiguration loadConfiguration) { this.ignoreUnknownValues = loadConfiguration.ignoreUnknownValues; this.sourceUris = loadConfiguration.sourceUris; this.fileSetSpecType = loadConfiguration.fileSetSpecType; + this.columnNameCharacterMap = loadConfiguration.columnNameCharacterMap; this.schemaUpdateOptions = loadConfiguration.schemaUpdateOptions; this.autodetect = loadConfiguration.autodetect; this.destinationEncryptionConfiguration = @@ -181,6 +185,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getFileSetSpecType() != null) { this.fileSetSpecType = loadConfigurationPb.getFileSetSpecType(); } + if (loadConfigurationPb.getColumnNameCharacterMap() != null) { + this.columnNameCharacterMap = loadConfigurationPb.getColumnNameCharacterMap(); + } if (loadConfigurationPb.getSchemaUpdateOptions() != null) { ImmutableList.Builder schemaUpdateOptionsBuilder = new ImmutableList.Builder<>(); @@ -323,6 +330,20 @@ public Builder setFileSetSpecType(String fileSetSpecType) { return this; } + /** + * [Optional] Character map supported for column names in CSV/Parquet loads. Defaults to STRICT + * and can be overridden by Project Config Service. Using this option with unsupporting load + * formats will result in an error. + * + * @see + * ColumnNameCharacterMap + */ + public Builder setColumnNameCharacterMap(String columnNameCharacterMap) { + this.columnNameCharacterMap = columnNameCharacterMap; + return this; + } + /** * Defines the list of possible SQL data types to which the source decimal values are converted. * This list and the precision and the scale parameters of the decimal field determine the @@ -421,6 +442,7 @@ private LoadJobConfiguration(Builder builder) { super(builder); this.sourceUris = builder.sourceUris; this.fileSetSpecType = builder.fileSetSpecType; + this.columnNameCharacterMap = builder.columnNameCharacterMap; this.destinationTable = builder.destinationTable; this.decimalTargetTypes = builder.decimalTargetTypes; this.createDisposition = builder.createDisposition; @@ -519,6 +541,17 @@ public String getFileSetSpecType() { return fileSetSpecType; } + /** + * Returns the column name character map used in CSV/Parquet loads. + * + * @see + * ColumnNameCharacterMap + */ + public String getColumnNameCharacterMap() { + return columnNameCharacterMap; + } + public List getDecimalTargetTypes() { return decimalTargetTypes; } @@ -598,6 +631,7 @@ ToStringHelper toStringHelper() { .add("ignoreUnknownValue", ignoreUnknownValues) .add("sourceUris", sourceUris) .add("fileSetSpecType", fileSetSpecType) + .add("columnNameCharacterMap", columnNameCharacterMap) .add("schemaUpdateOptions", schemaUpdateOptions) .add("autodetect", autodetect) .add("timePartitioning", timePartitioning) @@ -681,6 +715,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (fileSetSpecType != null) { loadConfigurationPb.setFileSetSpecType(fileSetSpecType); } + if (columnNameCharacterMap != null) { + loadConfigurationPb.setColumnNameCharacterMap(columnNameCharacterMap); + } if (decimalTargetTypes != null) { loadConfigurationPb.setDecimalTargetTypes(ImmutableList.copyOf(decimalTargetTypes)); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 563a3f34a1..85709a74a2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -92,6 +92,7 @@ public class LoadJobConfigurationTest { .setWriteDisposition(WRITE_DISPOSITION) .setFormatOptions(CSV_OPTIONS) .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") + .setColumnNameCharacterMap("STRICT") .setIgnoreUnknownValues(IGNORE_UNKNOWN_VALUES) .setMaxBadRecords(MAX_BAD_RECORDS) .setSchema(TABLE_SCHEMA) @@ -242,6 +243,7 @@ private void compareLoadJobConfiguration( assertEquals(expected, value); assertEquals(expected.hashCode(), value.hashCode()); assertEquals(expected.getFileSetSpecType(), value.getFileSetSpecType()); + assertEquals(expected.getColumnNameCharacterMap(), value.getColumnNameCharacterMap()); assertEquals(expected.toString(), value.toString()); assertEquals(expected.getDestinationTable(), value.getDestinationTable()); assertEquals(expected.getDecimalTargetTypes(), value.getDecimalTargetTypes()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index d6a80e86ea..b346b16928 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -586,6 +586,8 @@ public class ITBigQueryTest { RangePartitioning.newBuilder().setField("IntegerField").setRange(RANGE).build(); private static final String LOAD_FILE = "load.csv"; private static final String LOAD_FILE_LARGE = "load_large.csv"; + + private static final String LOAD_FILE_FLEXIBLE_COLUMN_NAME = "load_flexible_column_name.csv"; private static final String JSON_LOAD_FILE = "load.json"; private static final String JSON_LOAD_FILE_BQ_RESULTSET = "load_bq_resultset.json"; private static final String JSON_LOAD_FILE_SIMPLE = "load_simple.json"; @@ -601,6 +603,7 @@ public class ITBigQueryTest { private static final TableId TABLE_ID_FASTQUERY_BQ_RESULTSET = TableId.of(DATASET, "fastquery_testing_bq_resultset"); private static final String CSV_CONTENT = "StringValue1\nStringValue2\n"; + private static final String CSV_CONTENT_FLEXIBLE_COLUMN = "name,&ersand\nrow_name,1"; private static final String JSON_CONTENT = "{" @@ -1019,6 +1022,11 @@ public static void beforeClass() throws InterruptedException, IOException { storage.create( BlobInfo.newBuilder(BUCKET, LOAD_FILE).setContentType("text/plain").build(), CSV_CONTENT.getBytes(StandardCharsets.UTF_8)); + storage.create( + BlobInfo.newBuilder(BUCKET, LOAD_FILE_FLEXIBLE_COLUMN_NAME) + .setContentType("text/plain") + .build(), + CSV_CONTENT_FLEXIBLE_COLUMN.getBytes(StandardCharsets.UTF_8)); storage.create( BlobInfo.newBuilder(BUCKET, JSON_LOAD_FILE).setContentType("application/json").build(), JSON_CONTENT.getBytes(StandardCharsets.UTF_8)); @@ -6934,4 +6942,60 @@ public void testQueryExportStatistics() throws InterruptedException { assertEquals(1L, queryStatistics.getExportDataStats().getFileCount().longValue()); assertEquals(3L, queryStatistics.getExportDataStats().getRowCount().longValue()); } + + @Test + public void testLoadConfigurationFlexibleColumnName() throws InterruptedException { + // See https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#columnnamecharactermap for + // mapping. + + // Test v1 mapping. + String v1TableName = "flexible_column_name_data_testing_table_v1"; + TableId v1TableId = TableId.of(DATASET, v1TableName); + try { + LoadJobConfiguration loadJobConfigurationV1 = + LoadJobConfiguration.newBuilder( + v1TableId, + "gs://" + BUCKET + "/" + LOAD_FILE_FLEXIBLE_COLUMN_NAME, + FormatOptions.csv()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setAutodetect(true) + .setColumnNameCharacterMap("V1") + .build(); + Job jobV1 = bigquery.create(JobInfo.of(loadJobConfigurationV1)); + jobV1 = jobV1.waitFor(); + assertNull(jobV1.getStatus().getError()); + + Table remoteTableV1 = bigquery.getTable(DATASET, v1TableName); + assertNotNull(remoteTableV1); + assertEquals( + "_ampersand", remoteTableV1.getDefinition().getSchema().getFields().get(1).getName()); + } finally { + bigquery.delete(v1TableId); + } + + // Test v2 mapping. + String v2TableName = "flexible_column_name_data_testing_table_v2"; + TableId v2TableId = TableId.of(DATASET, v2TableName); + try { + LoadJobConfiguration loadJobConfigurationV2 = + LoadJobConfiguration.newBuilder( + v2TableId, + "gs://" + BUCKET + "/" + LOAD_FILE_FLEXIBLE_COLUMN_NAME, + FormatOptions.csv()) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setAutodetect(true) + .setColumnNameCharacterMap("V2") + .build(); + Job jobV2 = bigquery.create(JobInfo.of(loadJobConfigurationV2)); + jobV2 = jobV2.waitFor(); + assertNull(jobV2.getStatus().getError()); + + Table remoteTableV2 = bigquery.getTable(DATASET, v2TableName); + assertNotNull(remoteTableV2); + assertEquals( + "&ersand", remoteTableV2.getDefinition().getSchema().getFields().get(1).getName()); + } finally { + bigquery.delete(v2TableId); + } + } } From b8c17bf77abc32703226c8a1f0f12af4fc5fd5de Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 23:05:20 -0400 Subject: [PATCH 1741/2268] chore(main): release 2.40.4-SNAPSHOT (#3346) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 34936aa4b3..497f739232 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.3 + 2.40.4-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 62c3d4efca..8e1780f9a0 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.3 + 2.40.4-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3 + 2.40.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7c4aeb0b2a..66ddc0a7fd 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.3 + 2.40.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.3 + 2.40.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 263995e8e2..21a4433162 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.3 + 2.40.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3 + 2.40.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 673234c1dd..9806b947c4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3 + 2.40.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 77a4710e89..5e47bd9a9e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.3:2.40.3 \ No newline at end of file +google-cloud-bigquery:2.40.3:2.40.4-SNAPSHOT \ No newline at end of file From 5d52bc9f4ef93f84200335685901c6ac0256b769 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:25:21 -0400 Subject: [PATCH 1742/2268] fix: add clustering value to ListTables result (#3359) --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 3 +- .../cloud/bigquery/it/ITBigQueryTest.java | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 5dd39eaed9..93337d8cac 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -364,7 +364,8 @@ public Table apply(TableList.Tables tablePb) { .setType(tablePb.getType()) .setCreationTime(tablePb.getCreationTime()) .setTimePartitioning(tablePb.getTimePartitioning()) - .setRangePartitioning(tablePb.getRangePartitioning()); + .setRangePartitioning(tablePb.getRangePartitioning()) + .setClustering(tablePb.getClustering()); } })); } catch (IOException ex) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b346b16928..6a7a4e26bd 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1903,6 +1903,41 @@ public void testCreateAndGetTable() { assertTrue(remoteTable.delete()); } + @Test + public void testCreateAndListTable() { + String tableName = "test_create_and_list_table"; + TableId tableId = TableId.of(DATASET, tableName); + TimePartitioning partitioning = TimePartitioning.of(Type.DAY); + Clustering clustering = + Clustering.newBuilder().setFields(ImmutableList.of(STRING_FIELD_SCHEMA.getName())).build(); + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder() + .setSchema(TABLE_SCHEMA) + .setTimePartitioning(partitioning) + .setClustering(clustering) + .build(); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + assertEquals(DATASET, createdTable.getTableId().getDataset()); + assertEquals(tableName, createdTable.getTableId().getTable()); + + Page

    tables = bigquery.listTables(DATASET); + boolean found = false; + Iterator
    tableIterator = tables.getValues().iterator(); + // Find createdTable and validate the table definition. + while (tableIterator.hasNext() && !found) { + Table table = tableIterator.next(); + if (table.getTableId().equals(createdTable.getTableId())) { + StandardTableDefinition definition = table.getDefinition(); + assertThat(definition.getClustering()).isNotNull(); + assertThat(definition.getTimePartitioning()).isNotNull(); + found = true; + } + } + assertTrue(found); + assertTrue(createdTable.delete()); + } + @Test public void testCreateAndGetTableWithBasicTableMetadataView() { String tableName = "test_create_and_get_table_with_basic_metadata_view"; From 4420996e89fef49270771bb4f01ffa4e871e7885 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jun 2024 21:28:27 +0200 Subject: [PATCH 1743/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.32.0 (#3360) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 79451bab18..ee2d3db7a6 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.31.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.32.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index b2d351e09d..91d2c3bc7d 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.31.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.32.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 8a5d647570..3f34dd7532 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.31.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.32.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index e94d7bcd66..e4416de916 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.31.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.32.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 047ec1b678..519c2e3ce3 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.31.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.32.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8e1780f9a0..e4b7994f6c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.31.0 + 3.32.0 diff --git a/pom.xml b/pom.xml index 21a4433162..cb4c723281 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.31.0 + 3.32.0 From 7cb6b3ef857d80be98c70acf60b85a09314eb04e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Jun 2024 23:42:52 +0200 Subject: [PATCH 1744/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.6.1 (#3362) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb4c723281..04e92e37cc 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.6.0 + 3.6.1 pom import From 9f76c3806ea16d129fb166a9b1d05c726aeabaef Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 18:18:48 -0400 Subject: [PATCH 1745/2268] chore(main): release 2.41.0 (#3357) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Joe Wang --- CHANGELOG.md | 21 +++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74c10885b2..e962971e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [2.41.0](https://github.com/googleapis/java-bigquery/compare/v2.40.3...v2.41.0) (2024-06-25) + + +### Features + +* Add columnNameCharacterMap to LoadJobConfiguration ([#3356](https://github.com/googleapis/java-bigquery/issues/3356)) ([2f3cbe3](https://github.com/googleapis/java-bigquery/commit/2f3cbe39619bcc93cb7d504417accd84b418dd41)) +* Add MetadataCacheMode to ExternalTableDefinition ([#3351](https://github.com/googleapis/java-bigquery/issues/3351)) ([2814dc4](https://github.com/googleapis/java-bigquery/commit/2814dc49dfdd5671257b6a9933a5dd381d889dd1)) + + +### Bug Fixes + +* Add clustering value to ListTables result ([#3359](https://github.com/googleapis/java-bigquery/issues/3359)) ([5d52bc9](https://github.com/googleapis/java-bigquery/commit/5d52bc9f4ef93f84200335685901c6ac0256b769)) + + +### Dependencies + +* Update actions/checkout action to v4.1.7 ([#3349](https://github.com/googleapis/java-bigquery/issues/3349)) ([0857234](https://github.com/googleapis/java-bigquery/commit/085723491e4aca58d670c313bc18b0c044cfdca8)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240602-2.0.0 ([#3273](https://github.com/googleapis/java-bigquery/issues/3273)) ([7b7e52b](https://github.com/googleapis/java-bigquery/commit/7b7e52b339f57af752c573a222df68196f1808f5)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.32.0 ([#3360](https://github.com/googleapis/java-bigquery/issues/3360)) ([4420996](https://github.com/googleapis/java-bigquery/commit/4420996e89fef49270771bb4f01ffa4e871e7885)) +* Update github/codeql-action action to v2.25.10 ([#3348](https://github.com/googleapis/java-bigquery/issues/3348)) ([8b6feff](https://github.com/googleapis/java-bigquery/commit/8b6feffa0e8add73a7587ce1762989713c2af38b)) + ## [2.40.3](https://github.com/googleapis/java-bigquery/compare/v2.40.2...v2.40.3) (2024-06-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 497f739232..7bc7e664f8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.40.4-SNAPSHOT + 2.41.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e4b7994f6c..02d85f13fc 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.40.4-SNAPSHOT + 2.41.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.40.4-SNAPSHOT + 2.41.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 66ddc0a7fd..3a4fa4af07 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.40.4-SNAPSHOT + 2.41.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.40.4-SNAPSHOT + 2.41.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 04e92e37cc..bdbd671348 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.40.4-SNAPSHOT + 2.41.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.40.4-SNAPSHOT + 2.41.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9806b947c4..a37cbe6f3a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.40.4-SNAPSHOT + 2.41.0 diff --git a/versions.txt b/versions.txt index 5e47bd9a9e..5534bc5ee6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.40.3:2.40.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.41.0:2.41.0 \ No newline at end of file From 22e304598ebb00961596c5cce00ad2d3e0627a12 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Jun 2024 00:02:32 +0200 Subject: [PATCH 1746/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.41.0 (#3364) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.41.0 * 🦉 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 --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3a77fbac98..f76b50a0c8 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.40.3 + 2.41.0 ``` @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.40.3' +implementation 'com.google.cloud:google-cloud-bigquery:2.41.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.40.3" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.41.0" ``` @@ -351,7 +351,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.40.3 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.41.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a8f8d9976..26b6ce981f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.40.3 + 2.41.0 From bc63544453b561684b9748207799b3a858c206a1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Jun 2024 18:25:58 +0200 Subject: [PATCH 1747/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.40.1 (#3367) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bdbd671348..bc0741aa23 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.40.0 + 2.40.1 test From bde4f81c9568286fd40cb0b8b53c527cc7e99318 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Jun 2024 18:37:51 +0200 Subject: [PATCH 1748/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.1 (#3365) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.1 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc0741aa23..c111f0e5de 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.6.0 + 3.6.1 From ceb270c5cc2af4d69948ac89af1d72990fe1a7ee Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Jun 2024 20:16:41 +0200 Subject: [PATCH 1749/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240616-2.0.0 (#3368) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c111f0e5de..633f8cbcd3 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240602-2.0.0 + v2-rev20240616-2.0.0 From 34f16fbaad236f5a6db26d693efde2025913d540 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:53:29 -0400 Subject: [PATCH 1750/2268] feat: add additional parameters to CsvOptions and ParquetOptions (#3370) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add additional parameters to CsvOptions and ParquetOptions * fix lint * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Addressed review comments --------- Co-authored-by: Owl Bot --- .../com/google/cloud/bigquery/CsvOptions.java | 29 ++++++++++++++- .../google/cloud/bigquery/ParquetOptions.java | 35 +++++++++++++++++-- .../google/cloud/bigquery/CsvOptionsTest.java | 4 +++ .../cloud/bigquery/ParquetOptionsTest.java | 14 ++++++-- 4 files changed, 76 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java index cbcce2173e..b39c82a7ed 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java @@ -26,12 +26,13 @@ */ public final class CsvOptions extends FormatOptions { - private static final long serialVersionUID = 2193570529308612708L; + private static final long serialVersionUID = 2193570529308612709L; private final Boolean allowJaggedRows; private final Boolean allowQuotedNewLines; private final String encoding; private final String fieldDelimiter; + private final String nullMarker; private final String quote; private final Long skipLeadingRows; private final Boolean preserveAsciiControlCharacters; @@ -42,6 +43,7 @@ public static final class Builder { private Boolean allowQuotedNewLines; private String encoding; private String fieldDelimiter; + private String nullMarker; private String quote; private Long skipLeadingRows; private Boolean preserveAsciiControlCharacters; @@ -53,6 +55,7 @@ private Builder(CsvOptions csvOptions) { this.allowQuotedNewLines = csvOptions.allowQuotedNewLines; this.encoding = csvOptions.encoding; this.fieldDelimiter = csvOptions.fieldDelimiter; + this.nullMarker = csvOptions.nullMarker; this.quote = csvOptions.quote; this.skipLeadingRows = csvOptions.skipLeadingRows; this.preserveAsciiControlCharacters = csvOptions.preserveAsciiControlCharacters; @@ -110,6 +113,18 @@ public Builder setFieldDelimiter(String fieldDelimiter) { return this; } + /** + * [Optional] Specifies a string that represents a null value in a CSV file. For example, if you + * specify \"\\N\", BigQuery interprets \"\\N\" as a null value when querying a CSV file. The + * default value is the empty string. If you set this property to a custom value, BigQuery + * throws an error if an empty string is present for all data types except for STRING and BYTE. + * For STRING and BYTE columns, BigQuery interprets the empty string as an empty value. + */ + public Builder setNullMarker(String nullMarker) { + this.nullMarker = nullMarker; + return this; + } + /** * Sets the value that is used to quote data sections in a CSV file. BigQuery converts the * string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split @@ -154,6 +169,7 @@ private CsvOptions(Builder builder) { this.allowQuotedNewLines = builder.allowQuotedNewLines; this.encoding = builder.encoding; this.fieldDelimiter = builder.fieldDelimiter; + this.nullMarker = builder.nullMarker; this.quote = builder.quote; this.skipLeadingRows = builder.skipLeadingRows; this.preserveAsciiControlCharacters = builder.preserveAsciiControlCharacters; @@ -192,6 +208,11 @@ public String getFieldDelimiter() { return fieldDelimiter; } + /** Returns the string that represents a null value in a CSV file. */ + public String getNullMarker() { + return nullMarker; + } + /** Returns the value that is used to quote data sections in a CSV file. */ public String getQuote() { return quote; @@ -226,6 +247,7 @@ public String toString() { .add("allowQuotedNewLines", allowQuotedNewLines) .add("encoding", encoding) .add("fieldDelimiter", fieldDelimiter) + .add("nullMarker", nullMarker) .add("quote", quote) .add("skipLeadingRows", skipLeadingRows) .add("preserveAsciiControlCharacters", preserveAsciiControlCharacters) @@ -240,6 +262,7 @@ public int hashCode() { allowQuotedNewLines, encoding, fieldDelimiter, + nullMarker, quote, skipLeadingRows, preserveAsciiControlCharacters); @@ -258,6 +281,7 @@ com.google.api.services.bigquery.model.CsvOptions toPb() { csvOptions.setAllowQuotedNewlines(allowQuotedNewLines); csvOptions.setEncoding(encoding); csvOptions.setFieldDelimiter(fieldDelimiter); + csvOptions.setNullMarker(nullMarker); csvOptions.setQuote(quote); csvOptions.setSkipLeadingRows(skipLeadingRows); csvOptions.setPreserveAsciiControlCharacters(preserveAsciiControlCharacters); @@ -283,6 +307,9 @@ static CsvOptions fromPb(com.google.api.services.bigquery.model.CsvOptions csvOp if (csvOptions.getFieldDelimiter() != null) { builder.setFieldDelimiter(csvOptions.getFieldDelimiter()); } + if (csvOptions.getNullMarker() != null) { + builder.setNullMarker(csvOptions.getNullMarker()); + } if (csvOptions.getQuote() != null) { builder.setQuote(csvOptions.getQuote()); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java index 174da41d86..b150f3b06b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java @@ -21,10 +21,11 @@ public class ParquetOptions extends FormatOptions { - private static final long serialVersionUID = 1992L; + private static final long serialVersionUID = 1993L; private final Boolean enableListInference; private final Boolean enumAsString; + private final String mapTargetType; public Boolean getEnableListInference() { return enableListInference; @@ -34,16 +35,23 @@ public Boolean getEnumAsString() { return enumAsString; } + /** Returns how the Parquet map is represented. */ + public String getMapTargetType() { + return mapTargetType; + } + /** A builder for {@code ParquetOptions} objects. */ public static final class Builder { private Boolean enableListInference; private Boolean enumAsString; + private String mapTargetType; private Builder() {} private Builder(ParquetOptions parquetOptions) { this.enableListInference = parquetOptions.enableListInference; this.enumAsString = parquetOptions.enumAsString; + this.mapTargetType = parquetOptions.mapTargetType; } public Builder setEnableListInference(Boolean enableListInference) { @@ -56,6 +64,17 @@ public Builder setEnumAsString(Boolean enumAsString) { return this; } + /** + * [Optional] Indicates how to represent a Parquet map if present. + * + * @see + * MapTargetType + */ + public Builder setMapTargetType(String mapTargetType) { + this.mapTargetType = mapTargetType; + return this; + } + public ParquetOptions build() { return new ParquetOptions(this); } @@ -69,6 +88,7 @@ public Builder toBuilder() { super(FormatOptions.PARQUET); enableListInference = builder.enableListInference; enumAsString = builder.enumAsString; + mapTargetType = builder.mapTargetType; } @Override @@ -76,12 +96,13 @@ public String toString() { return MoreObjects.toStringHelper(this) .add("enableListInference", enableListInference) .add("enumAsString", enumAsString) + .add("mapTargetType", mapTargetType) .toString(); } @Override public final int hashCode() { - return Objects.hash(enableListInference, enumAsString); + return Objects.hash(enableListInference, enumAsString, mapTargetType); } @Override @@ -93,7 +114,9 @@ public final boolean equals(Object obj) { return false; } ParquetOptions other = (ParquetOptions) obj; - return enableListInference == other.enableListInference && enumAsString == other.enumAsString; + return enableListInference == other.enableListInference + && enumAsString == other.enumAsString + && Objects.equals(mapTargetType, ((ParquetOptions) obj).getMapTargetType()); } /** Returns a builder for a {@link ParquetOptions} object. */ @@ -110,6 +133,9 @@ static ParquetOptions fromPb( if (parquetOptions.getEnumAsString() != null) { builder.setEnumAsString(parquetOptions.getEnumAsString()); } + if (parquetOptions.getMapTargetType() != null) { + builder.setMapTargetType(parquetOptions.getMapTargetType()); + } return builder.build(); } @@ -122,6 +148,9 @@ com.google.api.services.bigquery.model.ParquetOptions toPb() { if (enumAsString != null) { parquetOptions.setEnumAsString(enumAsString); } + if (mapTargetType != null) { + parquetOptions.setMapTargetType(mapTargetType); + } return parquetOptions; } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java index fa05cddc50..fb0293a97a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java @@ -28,6 +28,7 @@ public class CsvOptionsTest { private static final Boolean ALLOW_QUOTED_NEWLINE = true; private static final Charset ENCODING = StandardCharsets.UTF_8; private static final String FIELD_DELIMITER = ","; + private static final String NULL_MARKER = "\\N"; private static final String QUOTE = "\""; private static final long SKIP_LEADING_ROWS = 42L; @@ -38,6 +39,7 @@ public class CsvOptionsTest { .setAllowQuotedNewLines(ALLOW_QUOTED_NEWLINE) .setEncoding(ENCODING) .setFieldDelimiter(FIELD_DELIMITER) + .setNullMarker(NULL_MARKER) .setQuote(QUOTE) .setSkipLeadingRows(SKIP_LEADING_ROWS) .setPreserveAsciiControlCharacters(PRESERVE_ASCII_CONTROL_CHARACTERS) @@ -65,6 +67,7 @@ public void testBuilder() { assertEquals(ALLOW_QUOTED_NEWLINE, CSV_OPTIONS.allowQuotedNewLines()); assertEquals(ENCODING.name(), CSV_OPTIONS.getEncoding()); assertEquals(FIELD_DELIMITER, CSV_OPTIONS.getFieldDelimiter()); + assertEquals(NULL_MARKER, CSV_OPTIONS.getNullMarker()); assertEquals(QUOTE, CSV_OPTIONS.getQuote()); assertEquals(SKIP_LEADING_ROWS, (long) CSV_OPTIONS.getSkipLeadingRows()); assertEquals( @@ -84,6 +87,7 @@ private void compareCsvOptions(CsvOptions expected, CsvOptions value) { assertEquals(expected.allowQuotedNewLines(), value.allowQuotedNewLines()); assertEquals(expected.getEncoding(), value.getEncoding()); assertEquals(expected.getFieldDelimiter(), value.getFieldDelimiter()); + assertEquals(expected.getNullMarker(), value.getNullMarker()); assertEquals(expected.getQuote(), value.getQuote()); assertEquals(expected.getSkipLeadingRows(), value.getSkipLeadingRows()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java index 8812b2e274..ca21d805c6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java @@ -24,14 +24,23 @@ public class ParquetOptionsTest { private static final ParquetOptions OPTIONS = - ParquetOptions.newBuilder().setEnableListInference(true).setEnumAsString(true).build(); + ParquetOptions.newBuilder() + .setEnableListInference(true) + .setEnumAsString(true) + .setMapTargetType("ARRAY_OF_STRUCT") + .build(); @Test public void testToBuilder() { compareParquetOptions(OPTIONS, OPTIONS.toBuilder().build()); ParquetOptions parquetOptions = OPTIONS.toBuilder().setEnableListInference(true).build(); assertEquals(true, parquetOptions.getEnableListInference()); - parquetOptions = parquetOptions.toBuilder().setEnumAsString(true).build(); + parquetOptions = + parquetOptions + .toBuilder() + .setEnumAsString(true) + .setMapTargetType("ARRAY_OF_STRUCT") + .build(); compareParquetOptions(OPTIONS, parquetOptions); } @@ -47,6 +56,7 @@ public void testBuilder() { assertEquals(FormatOptions.PARQUET, OPTIONS.getType()); assertEquals(true, OPTIONS.getEnableListInference()); assertEquals(true, OPTIONS.getEnumAsString()); + assertEquals("ARRAY_OF_STRUCT", OPTIONS.getMapTargetType()); } @Test From 2e804c56eeef5009cc46c7544fe9b04bfdd65d7a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Jun 2024 17:28:56 +0200 Subject: [PATCH 1751/2268] deps: update dependency org.junit.vintage:junit-vintage-engine to v5.10.3 (#3371) --- samples/native-image-sample/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index db3ce2f184..e3fab731cc 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -93,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.10.2 + 5.10.3 test From d3c8feb4198e96cc7fc3fc283b1a3e879faf053b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Jun 2024 17:34:20 +0200 Subject: [PATCH 1752/2268] test(deps): update dependency com.google.truth:truth to v1.4.3 (#3372) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/native-image-sample/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 633f8cbcd3..7073fb5c70 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ com.google.truth truth - 1.4.2 + 1.4.3 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 26b6ce981f..6e2499c351 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.4.2 + 1.4.3 test diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index e3fab731cc..e4e71f8902 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -62,7 +62,7 @@ com.google.truth truth - 1.4.2 + 1.4.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a37cbe6f3a..491335af0a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.4.2 + 1.4.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e69bc60269..a3823f02d1 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.4.2 + 1.4.3 test From 0d8859ba14de4beb25966b87dc9202838aeeef36 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Jun 2024 17:43:57 +0200 Subject: [PATCH 1753/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.48.0 (#3373) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7073fb5c70..b816a49b3a 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.47.0 + 2.48.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6e2499c351..b91fea99af 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.47.0 + 2.48.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 491335af0a..6d2ff504a7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.47.0 + 2.48.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a3823f02d1..5a7d87de62 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.47.0 + 2.48.0 test From 45b7f20e1b324d9b77183c0f8bb5ae14724d6aef Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Jun 2024 17:52:28 +0200 Subject: [PATCH 1754/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.48.0 (#3374) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b816a49b3a..e9d7bc77d7 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.47.0 + 2.48.0 test From 2115c0448b242ddd887f2bac3d68c45847273c3d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Jun 2024 18:13:57 +0200 Subject: [PATCH 1755/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.52.0 (#3375) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e9d7bc77d7..02d80460c7 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.51.0 + 1.52.0 pom import From f1e0014dca5ca04522796b44ff313696d2b41176 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 2 Jul 2024 19:07:50 +0200 Subject: [PATCH 1756/2268] deps: update github/codeql-action action to v2.25.11 (#3376) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d278d4481f..f1704c9764 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@a073c66b2accf653a511d88537804dcafa07812e # v2.25.10 + uses: github/codeql-action/upload-sarif@d958b976dc5b990f802df244f2dc5d807113327f # v2.25.11 with: sarif_file: results.sarif From 85e0daa8df47c75dcf648662bfb967654d217da5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:55:01 -0400 Subject: [PATCH 1757/2268] chore(main): release 2.41.1-SNAPSHOT (#3363) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7bc7e664f8..11388a6741 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.41.0 + 2.41.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 02d85f13fc..f88c59d6be 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.41.0 + 2.41.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.41.0 + 2.41.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 3a4fa4af07..c3bf567ca2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.41.0 + 2.41.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.41.0 + 2.41.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 02d80460c7..9a9915350c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.41.0 + 2.41.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.41.0 + 2.41.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6d2ff504a7..43223d25e5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.41.0 + 2.41.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5534bc5ee6..f2e6b27281 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.41.0:2.41.0 \ No newline at end of file +google-cloud-bigquery:2.41.0:2.41.1-SNAPSHOT \ No newline at end of file From 04098bb93c8b5af2ec0d1ba9b67fc65937ec99d1 Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 3 Jul 2024 12:37:58 -0400 Subject: [PATCH 1758/2268] chore: remove bigquery native image sample in favor of sample in google-cloud-java (#3377) * chore: remove bigquery native image sample in favor of sample in google-cloud-java --- README.md | 1 - samples/native-image-sample/README.md | 81 --------- samples/native-image-sample/pom.xml | 156 ---------------- .../bigquery/NativeImageBigquerySample.java | 170 ------------------ .../bigquery/NativeImageBigquerySampleIT.java | 69 ------- samples/pom.xml | 1 - 6 files changed, 478 deletions(-) delete mode 100644 samples/native-image-sample/README.md delete mode 100644 samples/native-image-sample/pom.xml delete mode 100644 samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java delete mode 100644 samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java diff --git a/README.md b/README.md index f76b50a0c8..6ead322537 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Native Image Bigquery Sample | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java) | | Add Column Load Append | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddColumnLoadAppend.java) | | Add Empty Column | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AddEmptyColumn.java) | | Auth Drive Scope | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/AuthDriveScope.java) | diff --git a/samples/native-image-sample/README.md b/samples/native-image-sample/README.md deleted file mode 100644 index ed54aa6fac..0000000000 --- a/samples/native-image-sample/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# BigQuery Sample Application with Native Image - -The BigQuery sample application demonstrates some common operations with [Google Cloud BigQuery](https://cloud.google.com/bigquery) and is compatible with Native Image compilation. - - -## Setup Instructions - -You will need to follow these prerequisite steps in order to run the samples: - -1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). - -2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials. - - Once installed, log in with Application Default Credentials using the following command: - - ``` - gcloud auth application-default login - ``` - - **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use. - -3. Install the native image compiler. - - You can follow [the installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm). - After following the instructions, ensure that you install the native image extension installed by running: - - ``` - gu install native-image - ``` - - Once you finish following the instructions, verify that the default version of Java is set to the correct version by running `java -version` in a terminal. - - You will see something similar to the below output: - - ``` - $ java -version - - openjdk version "17.0.3" 2022-04-19 - OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06) - OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing) - ``` - -2. [Enable the BigQuery APIs](https://console.cloud.google.com/apis/api/bigquery.googleapis.com). - -### Run with Native Image Support - -Navigate to this directory in a new terminal. - -1. Compile the application using the native image Compiler. This step may take a few minutes. - - ``` - mvn package -P native -DskipTests - ``` - -2. Run the application: - - ``` - ./target/native-image-sample - ``` - -3. The application will create a sample BigQuery dataset in your GCP project called `nativeimage_test_dataset` and perform some simple operations like creating a table, inserting data, and running a query. - - If you would like to delete the BigQuery dataset later, you can manage your BigQuery resources through [Google Cloud Console](https://console.cloud.google.com/bigquery) to clean up BigQuery resources under your project. - - When you run the application, you'll see output like this in the terminal: - - ``` - Created new table: nativeimage_test_table_2351b0891d2f48af9309bd289c3bad13 - Successfully inserted test row. - Queried the following records: - User id: TestUser-2f39e3ec-d81a-483f-9ec0-b9bd54155710 | age: 40 - Deleted table: nativeimage_test_table_2351b0891d2f48af9309bd289c3bad13 - ``` - -### Sample Integration test with Native Image Support - -In order to run the sample integration test, call the following command: - -``` -mvn test -Pnative -``` diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml deleted file mode 100644 index e4e71f8902..0000000000 --- a/samples/native-image-sample/pom.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - 4.0.0 - com.example.bigquery - native-image-sample - Native Image Sample - - - com.google.cloud.samples - shared-configuration - 1.2.0 - - - - 1.8 - 1.8 - UTF-8 - - - - - - com.google.cloud - libraries-bom - 26.20.0 - pom - import - - - - - - - com.google.cloud - google-cloud-bigquery - - - - - junit - junit - 4.13.2 - test - - - com.google.truth - truth - 1.4.3 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - com.example.bigquery.NativeImageBigquerySample - - - - - - - - - - - - native - - - - org.junit.vintage - junit-vintage-engine - 5.10.3 - test - - - org.graalvm.buildtools - junit-platform-native - 0.10.2 - test - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - 3.3.0 - - - **/*IT - - - - - org.graalvm.buildtools - native-maven-plugin - 0.10.2 - true - - com.example.bigquery.NativeImageBigquerySample - - - --no-fallback - --no-server - - - - - build-native - - build - test - - package - - - test-native - - test - - test - - - - - - - - diff --git a/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java b/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java deleted file mode 100644 index e7f1b35c5d..0000000000 --- a/samples/native-image-sample/src/main/java/com/example/bigquery/NativeImageBigquerySample.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.bigquery; - -import com.google.api.gax.paging.Page; -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryError; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.Dataset; -import com.google.cloud.bigquery.DatasetInfo; -import com.google.cloud.bigquery.Field; -import com.google.cloud.bigquery.FieldValueList; -import com.google.cloud.bigquery.InsertAllRequest; -import com.google.cloud.bigquery.InsertAllResponse; -import com.google.cloud.bigquery.QueryJobConfiguration; -import com.google.cloud.bigquery.Schema; -import com.google.cloud.bigquery.StandardSQLTypeName; -import com.google.cloud.bigquery.StandardTableDefinition; -import com.google.cloud.bigquery.Table; -import com.google.cloud.bigquery.TableDefinition; -import com.google.cloud.bigquery.TableId; -import com.google.cloud.bigquery.TableInfo; -import com.google.cloud.bigquery.TableResult; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -/** - * Sample application demonstrating BigQuery operations. - * - *

    Note: This application will create a BigQuery dataset in your GCP project. You can delete this - * by viewing BigQuery in Cloud Console https://console.cloud.google.com/bigquery or by uncommenting - * the call to `deleteDataset(..)` made in main(). - */ -public class NativeImageBigquerySample { - - private static final String DATASET_ID = "nativeimage_test_dataset"; - - private static final String TABLE_ID = "nativeimage_test_table"; - - private static final Schema TABLE_SCHEMA = - Schema.of( - Field.of("id", StandardSQLTypeName.STRING), Field.of("age", StandardSQLTypeName.INT64)); - - /** Entrypoint to the application. */ - public static void main(String[] args) throws InterruptedException { - BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService(); - - if (!hasDataset(bigQuery, DATASET_ID)) { - createDataset(bigQuery, DATASET_ID); - } - - String tableName = TABLE_ID + "_" + UUID.randomUUID().toString().replace("-", ""); - createTable(bigQuery, DATASET_ID, tableName, TABLE_SCHEMA); - String testId = "TestUser-" + UUID.randomUUID().toString(); - int testAge = 40; - insertTestRecord(bigQuery, DATASET_ID, tableName, testId, testAge); - queryTable(bigQuery, DATASET_ID, tableName); - - // Clean up resources. - deleteTable(bigQuery, DATASET_ID, tableName); - - // Uncomment this to delete the created dataset. - // deleteDataset(bigQuery, DATASET_ID); - } - - static String queryTable(BigQuery bigQuery, String datasetName, String tableName) - throws InterruptedException { - String fullyQualifiedTable = datasetName + "." + tableName; - String query = "SELECT * FROM " + fullyQualifiedTable; - - QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build(); - TableResult results = bigQuery.query(queryConfig); - - String result = ""; - System.out.println("Queried the following records: "); - for (FieldValueList row : results.iterateAll()) { - String rowStatement = - String.format( - "User id: %s | age: %d\n", - row.get("id").getStringValue(), row.get("age").getLongValue()); - result += rowStatement; - System.out.println(row); - } - return result; - } - - static void insertTestRecord( - BigQuery bigQuery, String datasetName, String tableName, String id, int age) { - - Map rowContent = new HashMap<>(); - rowContent.put("id", id); - rowContent.put("age", age); - - InsertAllRequest request = - InsertAllRequest.newBuilder(datasetName, tableName).addRow(rowContent).build(); - - InsertAllResponse response = bigQuery.insertAll(request); - - if (response.hasErrors()) { - System.out.println("Insert resulted in errors:"); - for (Map.Entry> entry : response.getInsertErrors().entrySet()) { - System.out.println("Response error: \n" + entry.getValue()); - } - } else { - System.out.println("Successfully inserted test row."); - } - } - - static void createTable(BigQuery bigQuery, String datasetName, String tableName, Schema schema) { - - TableId tableId = TableId.of(datasetName, tableName); - TableDefinition tableDefinition = StandardTableDefinition.of(schema); - TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); - bigQuery.create(tableInfo); - System.out.println("Created new table: " + tableName); - } - - static boolean hasTable(BigQuery bigQuery, String datasetName, String tableName) { - - Page

    tables = bigQuery.listTables(datasetName); - for (Table table : tables.iterateAll()) { - if (tableName.equals(table.getTableId().getTable())) { - return true; - } - } - return false; - } - - static void createDataset(BigQuery bigQuery, String datasetName) { - DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); - Dataset newDataset = bigQuery.create(datasetInfo); - System.out.println("Created new dataset: " + newDataset.getDatasetId().getDataset()); - } - - static boolean hasDataset(BigQuery bigQuery, String datasetName) { - Page datasets = bigQuery.listDatasets(); - for (Dataset dataset : datasets.iterateAll()) { - if (datasetName.equals(dataset.getDatasetId().getDataset())) { - return true; - } - } - return false; - } - - static void deleteTable(BigQuery bigQuery, String datasetName, String tableName) { - bigQuery.getTable(datasetName, tableName).delete(); - System.out.println("Deleted table: " + tableName); - } - - static void deleteDataset(BigQuery bigQuery, String datasetName) { - bigQuery.getDataset(datasetName).delete(); - System.out.println("Deleting dataset " + datasetName); - } -} diff --git a/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java b/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java deleted file mode 100644 index 8cdb01ab9e..0000000000 --- a/samples/native-image-sample/src/test/java/com/example/bigquery/NativeImageBigquerySampleIT.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2022 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.bigquery; - -import static com.google.common.truth.Truth.assertThat; - -import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQueryOptions; -import com.google.cloud.bigquery.Field; -import com.google.cloud.bigquery.Schema; -import com.google.cloud.bigquery.StandardSQLTypeName; -import java.util.UUID; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -/** Tests for {@link NativeImageBigquerySample} */ -@Ignore -public class NativeImageBigquerySampleIT { - - private static final String DATASET_ID = "nativeimage_it_dataset"; - - private static final String TABLE_ID = "nativeimage_it_table"; - - private static final Schema TABLE_SCHEMA = - Schema.of( - Field.of("id", StandardSQLTypeName.STRING), Field.of("age", StandardSQLTypeName.INT64)); - - private BigQuery bigQuery; - - private String tableName; - - @Before - public void setUp() { - bigQuery = BigQueryOptions.getDefaultInstance().getService(); - tableName = TABLE_ID + "_" + UUID.randomUUID().toString().replace("-", ""); - if (!NativeImageBigquerySample.hasDataset(bigQuery, DATASET_ID)) { - NativeImageBigquerySample.createDataset(bigQuery, DATASET_ID); - } - NativeImageBigquerySample.createTable(bigQuery, DATASET_ID, tableName, TABLE_SCHEMA); - } - - @Test - public void testQueryTable() throws InterruptedException { - String testId = "TestUser-" + UUID.randomUUID(); - NativeImageBigquerySample.insertTestRecord(bigQuery, DATASET_ID, tableName, testId, 40); - - String result = NativeImageBigquerySample.queryTable(bigQuery, DATASET_ID, tableName); - - assertThat(result).isEqualTo("User id: " + testId + " | age: 40\n"); - - // Clean up - NativeImageBigquerySample.deleteTable(bigQuery, DATASET_ID, tableName); - } -} diff --git a/samples/pom.xml b/samples/pom.xml index cb1d804240..e15e1f5ffa 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -47,7 +47,6 @@ install-without-bom snapshot snippets - native-image-sample From efa1aef0a579baa379adbfbd2ee12f4ee5f3d987 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 8 Jul 2024 20:15:19 +0200 Subject: [PATCH 1759/2268] deps: update actions/upload-artifact action to v4.3.4 (#3382) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f1704c9764..3275a9c6ae 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 with: name: SARIF file path: results.sarif From 5f39b19e8839f06d956addb8d95cf05e4b60a3f1 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Tue, 9 Jul 2024 09:56:33 -0400 Subject: [PATCH 1760/2268] feat: add remaining Statement Types (#3381) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add remaining Statement Types * 🦉 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 --- .../google/cloud/bigquery/JobStatistics.java | 38 +++++++++++++++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 21 ++++++++++ 2 files changed, 59 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 64d31fab17..efbfda0222 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -452,6 +452,44 @@ public StatementType apply(String constant) { public static final StatementType DROP_FUNCTION = type.createAndRegister("DROP_FUNCTION"); public static final StatementType DROP_PROCEDURE = type.createAndRegister("DROP_PROCEDURE"); public static final StatementType MERGE = type.createAndRegister("MERGE"); + public static final StatementType CREATE_MATERIALIZED_VIEW = + type.createAndRegister("CREATE_MATERIALIZED_VIEW"); + public static final StatementType CREATE_TABLE_FUNCTION = + type.createAndRegister("CREATE_TABLE_FUNCTION"); + public static final StatementType CREATE_ROW_ACCESS_POLICY = + type.createAndRegister("CREATE_ROW_ACCESS_POLICY"); + public static final StatementType CREATE_SCHEMA = type.createAndRegister("CREATE_SCHEMA"); + public static final StatementType CREATE_SNAPSHOT_TABLE = + type.createAndRegister("CREATE_SNAPSHOT_TABLE"); + public static final StatementType CREATE_SEARCH_INDEX = + type.createAndRegister("CREATE_SEARCH_INDEX"); + public static final StatementType DROP_EXTERNAL_TABLE = + type.createAndRegister("DROP_EXTERNAL_TABLE"); + + public static final StatementType DROP_MODEL = type.createAndRegister("DROP_MODEL"); + public static final StatementType DROP_MATERIALIZED_VIEW = + type.createAndRegister("DROP_MATERIALIZED_VIEW"); + + public static final StatementType DROP_TABLE_FUNCTION = + type.createAndRegister("DROP_TABLE_FUNCTION"); + public static final StatementType DROP_SEARCH_INDEX = + type.createAndRegister("DROP_SEARCH_INDEX"); + public static final StatementType DROP_SCHEMA = type.createAndRegister("DROP_SCHEMA"); + public static final StatementType DROP_SNAPSHOT_TABLE = + type.createAndRegister("DROP_SNAPSHOT_TABLE"); + public static final StatementType DROP_ROW_ACCESS_POLICY = + type.createAndRegister("DROP_ROW_ACCESS_POLICY"); + public static final StatementType ALTER_MATERIALIZED_VIEW = + type.createAndRegister("ALTER_MATERIALIZED_VIEW"); + public static final StatementType ALTER_SCHEMA = type.createAndRegister("ALTER_SCHEMA"); + public static final StatementType SCRIPT = type.createAndRegister("SCRIPT"); + public static final StatementType TRUNCATE_TABLE = type.createAndRegister("TRUNCATE_TABLE"); + public static final StatementType CREATE_EXTERNAL_TABLE = + type.createAndRegister("CREATE_EXTERNAL_TABLE"); + public static final StatementType EXPORT_DATA = type.createAndRegister("EXPORT_DATA"); + public static final StatementType EXPORT_MODEL = type.createAndRegister("EXPORT_MODEL"); + public static final StatementType LOAD_DATA = type.createAndRegister("LOAD_DATA"); + public static final StatementType CALL = type.createAndRegister("CALL"); private StatementType(String constant) { super(constant); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 6a7a4e26bd..cab716ff67 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -7033,4 +7033,25 @@ public void testLoadConfigurationFlexibleColumnName() throws InterruptedExceptio bigquery.delete(v2TableId); } } + + @Test + public void testStatementType() throws InterruptedException { + String tableName = "test_materialized_view_table_statemnt_type"; + String createQuery = + String.format( + "CREATE MATERIALIZED VIEW %s.%s.%s " + + "AS (SELECT MAX(TimestampField) AS TimestampField,StringField, MAX(BooleanField) AS BooleanField FROM %s.%s.%s GROUP BY StringField)", + PROJECT_ID, DATASET, tableName, PROJECT_ID, DATASET, TABLE_ID.getTable()); + TableResult result = bigquery.query(QueryJobConfiguration.of(createQuery)); + assertNotNull(result); + Job job = bigquery.getJob(result.getJobId()); + JobStatistics.QueryStatistics stats = job.getStatistics(); + assertEquals(StatementType.CREATE_MATERIALIZED_VIEW, stats.getStatementType()); + + // cleanup + Table remoteTable = bigquery.getTable(DATASET, tableName); + assertNotNull(remoteTable); + assertTrue(remoteTable.getDefinition() instanceof MaterializedViewDefinition); + assertTrue(remoteTable.delete()); + } } From 2ba09432045b79dd20d3d1377712dfb634240e23 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 9 Jul 2024 17:49:04 +0200 Subject: [PATCH 1761/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.40.0 (#3383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.40.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6ead322537..b170f4afa4 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.42.0') +implementation platform('com.google.cloud:libraries-bom:26.43.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b91fea99af..b739142176 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.39.5 + 2.40.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 43223d25e5..5b5e44814f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.39.5 + 2.40.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 5a7d87de62..3775b3b323 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.39.5 + 2.40.0 test From e1de34f0c4c67d75bcf15f35fe86c411b61d04ac Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 9 Jul 2024 17:49:15 +0200 Subject: [PATCH 1762/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240623-2.0.0 (#3384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240623-2.0.0 * 🦉 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 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a9915350c..61819a0eb9 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240616-2.0.0 + v2-rev20240623-2.0.0 From b9e96e3aa738a1813ad452cf6141f792f437e8de Mon Sep 17 00:00:00 2001 From: Obada Alabbadi <76101898+obada-ab@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:36:48 +0200 Subject: [PATCH 1763/2268] fix: null field mode inconsistency (#2863) * fix: null field mode inconsistency * chore: update null field mode test name --------- Co-authored-by: PhongChuong --- .../main/java/com/google/cloud/bigquery/Field.java | 2 +- .../java/com/google/cloud/bigquery/FieldTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 9fbc2ab910..3c959a73fe 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -201,7 +201,7 @@ public Builder setType(StandardSQLTypeName type, FieldList subFields) { /** Sets the mode of the field. When not specified {@link Mode#NULLABLE} is used. */ public Builder setMode(Mode mode) { - this.mode = mode != null ? mode.name() : Data.nullOf(String.class); + this.mode = mode != null ? mode.name() : null; return this; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java index 4db2028136..ce431ca295 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java @@ -30,6 +30,8 @@ public class FieldTest { private static final String FIELD_NAME1 = "StringField"; private static final String FIELD_NAME2 = "IntegerField"; private static final String FIELD_NAME3 = "RecordField"; + private static final String FIELD_NAME4 = "NullModeField"; + private static final String FIELD_NAME5 = "NullModeField2"; private static final LegacySQLTypeName FIELD_TYPE1 = LegacySQLTypeName.STRING; private static final LegacySQLTypeName FIELD_TYPE2 = LegacySQLTypeName.INTEGER; private static final StandardSQLTypeName FIELD_TYPE1_STANDARD = StandardSQLTypeName.STRING; @@ -79,6 +81,10 @@ public class FieldTest { .setMode(FIELD_MODE3) .setDescription(FIELD_DESCRIPTION3) .build(); + private static final Field STANDARD_FIELD_SCHEMA4 = + Field.newBuilder(FIELD_NAME4, StandardSQLTypeName.INT64).setMode(null).build(); + private static final Field STANDARD_FIELD_SCHEMA5 = + Field.newBuilder(FIELD_NAME5, StandardSQLTypeName.STRING).build(); @Test public void testToBuilder() { @@ -96,6 +102,8 @@ public void testToBuilderWithStandardSQLTypeName() { compareFieldSchemas(STANDARD_FIELD_SCHEMA1, STANDARD_FIELD_SCHEMA1.toBuilder().build()); compareFieldSchemas(STANDARD_FIELD_SCHEMA2, STANDARD_FIELD_SCHEMA2.toBuilder().build()); compareFieldSchemas(STANDARD_FIELD_SCHEMA3, STANDARD_FIELD_SCHEMA3.toBuilder().build()); + compareFieldSchemas(STANDARD_FIELD_SCHEMA4, STANDARD_FIELD_SCHEMA4.toBuilder().build()); + compareFieldSchemas(STANDARD_FIELD_SCHEMA5, STANDARD_FIELD_SCHEMA5.toBuilder().build()); Field field = STANDARD_FIELD_SCHEMA1.toBuilder().setDescription("New Description").build(); assertEquals("New Description", field.getDescription()); field = field.toBuilder().setDescription(FIELD_DESCRIPTION1).build(); @@ -162,6 +170,8 @@ public void testBuilderWithStandardSQLTypeName() { assertEquals(FIELD_TYPE3, STANDARD_FIELD_SCHEMA3.getType()); assertEquals(FIELD_MODE3, STANDARD_FIELD_SCHEMA3.getMode()); assertEquals(FIELD_DESCRIPTION3, STANDARD_FIELD_SCHEMA3.getDescription()); + assertEquals(null, STANDARD_FIELD_SCHEMA4.getMode()); + assertEquals(null, STANDARD_FIELD_SCHEMA5.getMode()); assertEquals( FieldList.of(STANDARD_FIELD_SCHEMA1, STANDARD_FIELD_SCHEMA2), STANDARD_FIELD_SCHEMA3.getSubFields()); @@ -181,6 +191,8 @@ public void testToAndFromPbWithStandardSQLTypeName() { compareFieldSchemas(STANDARD_FIELD_SCHEMA1, Field.fromPb(STANDARD_FIELD_SCHEMA1.toPb())); compareFieldSchemas(STANDARD_FIELD_SCHEMA2, Field.fromPb(STANDARD_FIELD_SCHEMA2.toPb())); compareFieldSchemas(STANDARD_FIELD_SCHEMA3, Field.fromPb(STANDARD_FIELD_SCHEMA3.toPb())); + compareFieldSchemas(STANDARD_FIELD_SCHEMA4, Field.fromPb(STANDARD_FIELD_SCHEMA4.toPb())); + compareFieldSchemas(STANDARD_FIELD_SCHEMA5, Field.fromPb(STANDARD_FIELD_SCHEMA5.toPb())); Field field = Field.newBuilder(FIELD_NAME1, FIELD_TYPE1).build(); compareFieldSchemas(field, Field.fromPb(field.toPb())); } From af60b30cd774992c5d82063106471926dc6aaa6e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 Jul 2024 17:01:31 +0200 Subject: [PATCH 1764/2268] deps: update github/codeql-action action to v2.25.12 (#3387) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3275a9c6ae..87b2aa0cfb 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d958b976dc5b990f802df244f2dc5d807113327f # v2.25.11 + uses: github/codeql-action/upload-sarif@e113c555ef0956479345cfc3ed530c938d670db0 # v2.25.12 with: sarif_file: results.sarif From 7ce52c0712c7e73c2e3504e4f12fcbd865f76e59 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 Jul 2024 17:01:47 +0200 Subject: [PATCH 1765/2268] test(deps): update dependency com.google.truth:truth to v1.4.4 (#3388) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 61819a0eb9..b15874b2a8 100644 --- a/pom.xml +++ b/pom.xml @@ -119,7 +119,7 @@ com.google.truth truth - 1.4.3 + 1.4.4 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b739142176..1f236f9169 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -81,7 +81,7 @@ com.google.truth truth - 1.4.3 + 1.4.4 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5b5e44814f..4a3925a4d7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.truth truth - 1.4.3 + 1.4.4 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3775b3b323..d41b1ace7d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -97,7 +97,7 @@ com.google.truth truth - 1.4.3 + 1.4.4 test From 2dd9067097f191e05ead2ac0abde22f6162bdbfb Mon Sep 17 00:00:00 2001 From: shollyman Date: Wed, 17 Jul 2024 06:43:58 -0700 Subject: [PATCH 1766/2268] testing: reduce flakiness of tests (#3393) This PR addresses recent flakes observed in two tests. In the first, we change validation for a DML test to examine DML stats rather then rescanning row data. In the second, we switch a test query used for faster query to be deterministic, as the suspicion is that stale cached results are impacting assertions about how the query was run. --- .../cloud/bigquery/it/ITBigQueryTest.java | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index cab716ff67..b1352f5121 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -4257,26 +4257,11 @@ public void testFastDMLQuery() throws InterruptedException { TableResult result = bigquery.query(dmlConfig); assertNotNull(result.getJobId()); assertEquals(TABLE_SCHEMA, result.getSchema()); - assertEquals(2, result.getTotalRows()); - // Verify correctness of table content - String sqlQuery = String.format("SELECT * FROM %s.%s", DATASET, tableName); - QueryJobConfiguration sqlConfig = QueryJobConfiguration.newBuilder(sqlQuery).build(); - TableResult resultAfterDML = bigquery.query(sqlConfig); - assertNotNull(resultAfterDML.getJobId()); - for (FieldValueList row : resultAfterDML.getValues()) { - FieldValue timestampCell = row.get(0); - assertEquals(timestampCell, row.get("TimestampField")); - FieldValue stringCell = row.get(1); - assertEquals(stringCell, row.get("StringField")); - FieldValue booleanCell = row.get(3); - assertEquals(booleanCell, row.get("BooleanField")); - assertEquals(FieldValue.Attribute.PRIMITIVE, timestampCell.getAttribute()); - assertEquals(FieldValue.Attribute.PRIMITIVE, stringCell.getAttribute()); - assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); - assertEquals(1408452095220000L, timestampCell.getTimestampValue()); - assertEquals("hello", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); - } + // Using the job reference on the TableResult, lookup and verify DML statistics. + Job queryJob = bigquery.getJob(result.getJobId()); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + assertEquals(2L, statistics.getNumDmlAffectedRows().longValue()); + assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); } @Test @@ -6668,7 +6653,7 @@ public void testStatelessQueries() throws InterruptedException { } private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedException { - String query = "SELECT 1 as one"; + String query = "SELECT CURRENT_TIMESTAMP() as ts"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); TableResult result = bigQuery.query(config); return result; From e1d2b59e7ee5a221072ad6e4b340338a15125c8d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 17 Jul 2024 20:12:18 +0200 Subject: [PATCH 1767/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.2 (#3390) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b15874b2a8..7f1e404f18 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.6.1 + 3.6.2 From 352562da445e35a8207bcf77442130867f32e52d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jul 2024 17:02:59 +0200 Subject: [PATCH 1768/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240629-2.0.0 (#3392) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f1e404f18..0de44c9df2 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240623-2.0.0 + v2-rev20240629-2.0.0 From 95c8d6f65c5c5355fc52a0a2b54002d8f9cdb1ef Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 23 Jul 2024 15:43:34 +0200 Subject: [PATCH 1769/2268] deps: update github/codeql-action action to v2.25.13 (#3395) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 87b2aa0cfb..85324fd18b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e113c555ef0956479345cfc3ed530c938d670db0 # v2.25.12 + uses: github/codeql-action/upload-sarif@563dcafdfe28a0bb82e2c272d84924f17b628540 # v2.25.13 with: sarif_file: results.sarif From 1f91ae7fa2100a05f969a7429cb619a2b8b42dee Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:02:46 -0400 Subject: [PATCH 1770/2268] feat: Add ability to specify RetryOptions and BigQueryRetryConfig when create job and waitFor (#3398) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: initial implementation of customizable BigQueryRetryConfig * Add unit and integration tests * Fix lint issues * Revert unintentional changes to testQueryStatistics in ITBigQueryTest * Revert unintentional changes to testQueryStatistics in ITBigQueryTest * Revert unintentional changes to testQueryStatistics in ITBigQueryTest * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add additional comments to Job.waitFor() for BigQueryRetryConfig --------- Co-authored-by: Owl Bot --- .../com/google/cloud/bigquery/BigQuery.java | 12 +- .../google/cloud/bigquery/BigQueryImpl.java | 19 +- .../java/com/google/cloud/bigquery/Job.java | 51 +++++- .../cloud/bigquery/spi/v2/BigQueryRpc.java | 4 +- .../cloud/bigquery/BigQueryImplTest.java | 114 ++++++++++++ .../com/google/cloud/bigquery/JobTest.java | 170 ++++++++++++++++-- .../cloud/bigquery/it/ITBigQueryTest.java | 21 +++ 7 files changed, 370 insertions(+), 21 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 80fd6618dc..e391c054d9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -561,7 +561,7 @@ public static JobListOption fields(JobField... fields) { /** Class for specifying table get and create options. */ class JobOption extends Option { - private static final long serialVersionUID = -3111736712316353665L; + private static final long serialVersionUID = -3111736712316353664L; private JobOption(BigQueryRpc.Option option, Object value) { super(option, value); @@ -578,6 +578,16 @@ public static JobOption fields(JobField... fields) { return new JobOption( BigQueryRpc.Option.FIELDS, Helper.selector(JobField.REQUIRED_FIELDS, fields)); } + + /** Returns an option to specify the job's BigQuery retry configuration. */ + public static JobOption bigQueryRetryConfig(BigQueryRetryConfig bigQueryRetryConfig) { + return new JobOption(BigQueryRpc.Option.BIGQUERY_RETRY_CONFIG, bigQueryRetryConfig); + } + + /** Returns an option to specify the job's retry options. */ + public static JobOption retryOptions(RetryOption... options) { + return new JobOption(BigQueryRpc.Option.RETRY_OPTIONS, options); + } } /** Class for specifying query results options. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index acfa1b7f12..5760832157 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -39,6 +39,7 @@ import com.google.cloud.Policy; import com.google.cloud.RetryHelper; import com.google.cloud.RetryHelper.RetryHelperException; +import com.google.cloud.RetryOption; import com.google.cloud.Tuple; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; @@ -415,10 +416,15 @@ public com.google.api.services.bigquery.model.Job call() { } } }, - getOptions().getRetrySettings(), + getRetryOptions(optionsMap) != null + ? RetryOption.mergeToSettings( + getOptions().getRetrySettings(), getRetryOptions(optionsMap)) + : getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - DEFAULT_RETRY_CONFIG)); + getBigQueryRetryConfig(optionsMap) != null + ? getBigQueryRetryConfig(optionsMap) + : DEFAULT_RETRY_CONFIG)); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -1628,4 +1634,13 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() } return optionMap; } + + static BigQueryRetryConfig getBigQueryRetryConfig(Map options) { + return (BigQueryRetryConfig) + options.getOrDefault(BigQueryRpc.Option.BIGQUERY_RETRY_CONFIG, null); + } + + static RetryOption[] getRetryOptions(Map options) { + return (RetryOption[]) options.getOrDefault(BigQueryRpc.Option.RETRY_OPTIONS, null); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index d23e4ea52a..793b25687b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -196,12 +196,21 @@ public boolean isDone() { Job job = bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); return job == null || JobStatus.State.DONE.equals(job.getStatus().getState()); } + + /** See {@link #waitFor(BigQueryRetryConfig, RetryOption...)} */ + public Job waitFor(RetryOption... waitOptions) throws InterruptedException { + return waitForInternal(DEFAULT_RETRY_CONFIG, waitOptions); + } + /** * Blocks until this job completes its execution, either failing or succeeding. This method * returns current job's latest information. If the job no longer exists, this method returns * {@code null}. By default, the job status is checked using jittered exponential backoff with 1 * second as an initial delay, 2.0 as a backoff factor, 1 minute as maximum delay between polls, - * 12 hours as a total timeout and unlimited number of attempts. + * 12 hours as a total timeout and unlimited number of attempts. For query jobs, the job status + * check can be configured to retry on specific BigQuery error messages using {@link + * BigQueryRetryConfig}. This {@link BigQueryRetryConfig} configuration is not available for + * non-query jobs. * *

    Example usage of {@code waitFor()}. * @@ -232,18 +241,46 @@ public boolean isDone() { * } * } * + *

    Example usage of {@code waitFor()} with BigQuery retry configuration to retry on rate limit + * exceeded error messages for query jobs. + * + *

    {@code
    +   * Job completedJob =
    +   *     job.waitFor(
    +   *             BigQueryRetryConfig.newBuilder()
    +   *                 .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG)
    +   *                 .retryOnMessage(BigQueryErrorMessages.JOB_RATE_LIMIT_EXCEEDED_MSG)
    +   *                 .retryOnRegEx(BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX)
    +   *                 .build());
    +   * if (completedJob == null) {
    +   *   // job no longer exists
    +   * } else if (completedJob.getStatus().getError() != null) {
    +   *   // job failed, handle error
    +   * } else {
    +   *   // job completed successfully
    +   * }
    +   * }
    + * + * @param bigQueryRetryConfig configures retries for query jobs for BigQuery failures * @param waitOptions options to configure checking period and timeout * @throws BigQueryException upon failure, check {@link BigQueryException#getCause()} for details * @throws InterruptedException if the current thread gets interrupted while waiting for the job * to complete */ - public Job waitFor(RetryOption... waitOptions) throws InterruptedException { + public Job waitFor(BigQueryRetryConfig bigQueryRetryConfig, RetryOption... waitOptions) + throws InterruptedException { + return waitForInternal(bigQueryRetryConfig, waitOptions); + } + + private Job waitForInternal(BigQueryRetryConfig bigQueryRetryConfig, RetryOption... waitOptions) + throws InterruptedException { checkNotDryRun("waitFor"); Object completedJobResponse; if (getConfiguration().getType() == Type.QUERY) { completedJobResponse = waitForQueryResults( RetryOption.mergeToSettings(DEFAULT_JOB_WAIT_SETTINGS, waitOptions), + bigQueryRetryConfig, DEFAULT_QUERY_WAIT_OPTIONS); } else { completedJobResponse = @@ -294,7 +331,9 @@ public TableResult getQueryResults(QueryResultsOption... options) QueryResponse response = waitForQueryResults( - DEFAULT_JOB_WAIT_SETTINGS, waitOptions.toArray(new QueryResultsOption[0])); + DEFAULT_JOB_WAIT_SETTINGS, + DEFAULT_RETRY_CONFIG, + waitOptions.toArray(new QueryResultsOption[0])); // Get the job resource to determine if it has errored. Job job = this; @@ -334,7 +373,9 @@ public TableResult getQueryResults(QueryResultsOption... options) } private QueryResponse waitForQueryResults( - RetrySettings retrySettings, final QueryResultsOption... resultsOptions) + RetrySettings retrySettings, + BigQueryRetryConfig bigQueryRetryConfig, + final QueryResultsOption... resultsOptions) throws InterruptedException { if (getConfiguration().getType() != Type.QUERY) { throw new UnsupportedOperationException( @@ -360,7 +401,7 @@ public boolean shouldRetry( } }, options.getClock(), - DEFAULT_RETRY_CONFIG); + bigQueryRetryConfig); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 3416409190..57f1a05c01 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -57,7 +57,9 @@ enum Option { STATE_FILTER("stateFilter"), TIMEOUT("timeoutMs"), REQUESTED_POLICY_VERSION("requestedPolicyVersion"), - TABLE_METADATA_VIEW("view"); + TABLE_METADATA_VIEW("view"), + RETRY_OPTIONS("retryOptions"), + BIGQUERY_RETRY_CONFIG("bigQueryRetryConfig"); private final String value; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index d3d3740061..88b8f6dbf4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -27,6 +27,7 @@ import com.google.api.services.bigquery.model.*; import com.google.api.services.bigquery.model.JobStatistics; import com.google.cloud.Policy; +import com.google.cloud.RetryOption; import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; import com.google.cloud.bigquery.BigQuery.JobOption; @@ -1594,6 +1595,119 @@ public void testCreateJobFailureShouldRetry() { verify(bigqueryRpcMock, times(6)).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } + @Test + public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() { + // Validate create job with BigQueryRetryConfig that retries on rate limit error message. + JobOption bigQueryRetryConfigOption = + JobOption.bigQueryRetryConfig( + BigQueryRetryConfig.newBuilder() + .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) + .retryOnMessage(BigQueryErrorMessages.JOB_RATE_LIMIT_EXCEEDED_MSG) + .retryOnRegEx(BigQueryErrorMessages.RetryRegExPatterns.RATE_LIMIT_EXCEEDED_REGEX) + .build()); + + Map bigQueryRpcOptions = optionMap(bigQueryRetryConfigOption); + when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + .thenThrow( + new BigQueryException( + 400, RATE_LIMIT_ERROR_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG + .thenThrow(new BigQueryException(200, RATE_LIMIT_ERROR_MSG)) + .thenReturn(newJobPb()); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + ((BigQueryImpl) bigquery) + .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), bigQueryRetryConfigOption); + verify(bigqueryRpcMock, times(3)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + } + + @Test + public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() { + // Validate create job with BigQueryRetryConfig that does not retry on rate limit error message. + JobOption bigQueryRetryConfigOption = + JobOption.bigQueryRetryConfig(BigQueryRetryConfig.newBuilder().build()); + + Map bigQueryRpcOptions = optionMap(bigQueryRetryConfigOption); + when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + .thenThrow(new BigQueryException(400, RATE_LIMIT_ERROR_MSG)); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + try { + ((BigQueryImpl) bigquery) + .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), bigQueryRetryConfigOption); + fail("JobException expected"); + } catch (BigQueryException e) { + assertNotNull(e.getMessage()); + } + // Verify that getQueryResults is attempted only once and not retried since the error message + // does not match. + verify(bigqueryRpcMock, times(1)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + } + + @Test + public void testCreateJobWithRetryOptionsFailureShouldRetry() { + // Validate create job with RetryOptions. + JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(4)); + Map bigQueryRpcOptions = optionMap(retryOptions); + when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + .thenThrow(new BigQueryException(500, "InternalError")) + .thenThrow(new BigQueryException(502, "Bad Gateway")) + .thenThrow(new BigQueryException(503, "Service Unavailable")) + .thenReturn(newJobPb()); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + ((BigQueryImpl) bigquery) + .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), retryOptions); + verify(bigqueryRpcMock, times(4)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + } + + @Test + public void testCreateJobWithRetryOptionsFailureShouldNotRetry() { + // Validate create job with RetryOptions that only attempts once (no retry). + JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(1)); + Map bigQueryRpcOptions = optionMap(retryOptions); + when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + .thenThrow(new BigQueryException(500, "InternalError")) + .thenReturn(newJobPb()); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + try { + ((BigQueryImpl) bigquery) + .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), retryOptions); + fail("JobException expected"); + } catch (BigQueryException e) { + assertNotNull(e.getMessage()); + } + verify(bigqueryRpcMock, times(1)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + } + @Test public void testCreateJobWithSelectedFields() { when(bigqueryRpcMock.create( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index d10203444d..396bb754ac 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -65,6 +65,10 @@ public class JobTest { CopyStatistics.newBuilder().setCreationTimestamp(1L).setEndTime(3L).setStartTime(2L).build(); private static final CopyJobConfiguration COPY_CONFIGURATION = CopyJobConfiguration.of(TABLE_ID1, TABLE_ID2); + private static final QueryJobConfiguration DDL_QUERY_CONFIGURATION = + QueryJobConfiguration.newBuilder("CREATE VIEW").setDestinationTable(TABLE_ID1).build(); + private static final QueryJobConfiguration DRL_QUERY_CONFIGURATION = + QueryJobConfiguration.newBuilder("SELECT 1").setDestinationTable(TABLE_ID1).build(); private static final JobInfo JOB_INFO = JobInfo.newBuilder(COPY_CONFIGURATION) .setJobId(JOB_ID) @@ -85,6 +89,11 @@ public class JobTest { RetryOption.retryDelayMultiplier(1.0) }; + private static final BigQueryRetryConfig TEST_BIGQUERY_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder() + .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) + .build(); + @Rule public MockitoRule rule; private BigQuery bigquery; @@ -191,8 +200,6 @@ public void testWaitFor() throws InterruptedException { @Test public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { - QueryJobConfiguration jobConfig = - QueryJobConfiguration.newBuilder("CREATE VIEW").setDestinationTable(TABLE_ID1).build(); QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -200,7 +207,7 @@ public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { .setStartTime(2L) .build(); JobInfo jobInfo = - JobInfo.newBuilder(jobConfig) + JobInfo.newBuilder(DDL_QUERY_CONFIGURATION) .setJobId(JOB_ID) .setStatistics(jobStatistics) .setJobId(JOB_ID) @@ -228,7 +235,7 @@ public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) .thenReturn(completedQuery); when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(completedJob); - job = this.job.toBuilder().setConfiguration(jobConfig).build(); + job = this.job.toBuilder().setConfiguration(DDL_QUERY_CONFIGURATION).build(); assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob); assertThat(job.getQueryResults().iterateAll()).isEmpty(); verify(bigquery, times(2)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); @@ -237,8 +244,6 @@ public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { @Test public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedException { - QueryJobConfiguration jobConfig = - QueryJobConfiguration.newBuilder("CREATE VIEW").setDestinationTable(TABLE_ID1).build(); QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -246,7 +251,7 @@ public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedExc .setStartTime(2L) .build(); JobInfo jobInfo = - JobInfo.newBuilder(jobConfig) + JobInfo.newBuilder(DDL_QUERY_CONFIGURATION) .setJobId(JOB_ID) .setStatistics(jobStatistics) .setJobId(JOB_ID) @@ -274,7 +279,7 @@ public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedExc when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(completedJob); when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) .thenReturn(completedQuery); - job = this.job.toBuilder().setConfiguration(jobConfig).build(); + job = this.job.toBuilder().setConfiguration(DDL_QUERY_CONFIGURATION).build(); assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob); assertThat(job.getQueryResults().getSchema()) .isEqualTo(Schema.of(Field.of("field1", LegacySQLTypeName.BOOLEAN))); @@ -284,8 +289,6 @@ public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedExc @Test public void testWaitForAndGetQueryResults() throws InterruptedException { - QueryJobConfiguration jobConfig = - QueryJobConfiguration.newBuilder("SELECT 1").setDestinationTable(TABLE_ID1).build(); QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -293,7 +296,7 @@ public void testWaitForAndGetQueryResults() throws InterruptedException { .setStartTime(2L) .build(); JobInfo jobInfo = - JobInfo.newBuilder(jobConfig) + JobInfo.newBuilder(DRL_QUERY_CONFIGURATION) .setJobId(JOB_ID) .setStatistics(jobStatistics) .setJobId(JOB_ID) @@ -329,7 +332,7 @@ public void testWaitForAndGetQueryResults() throws InterruptedException { when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) .thenReturn(completedQuery); when(bigquery.listTableData(eq(TABLE_ID1), any(Schema.class))).thenReturn(result); - job = this.job.toBuilder().setConfiguration(jobConfig).build(); + job = this.job.toBuilder().setConfiguration(DRL_QUERY_CONFIGURATION).build(); assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob); assertThat(job.getQueryResults().iterateAll()).hasSize(0); verify(bigquery, times(2)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); @@ -406,6 +409,149 @@ public void testWaitForWithTimeout() throws InterruptedException { } } + @Test + public void testWaitForWithBigQueryRetryConfig() throws InterruptedException { + QueryStatistics jobStatistics = + QueryStatistics.newBuilder() + .setCreationTimestamp(1L) + .setEndTime(3L) + .setStartTime(2L) + .build(); + JobInfo jobInfo = + JobInfo.newBuilder(DRL_QUERY_CONFIGURATION) + .setJobId(JOB_ID) + .setStatistics(jobStatistics) + .setJobId(JOB_ID) + .setEtag(ETAG) + .setGeneratedId(GENERATED_ID) + .setSelfLink(SELF_LINK) + .setUserEmail(EMAIL) + .setStatus(JOB_STATUS) + .build(); + + when(bigquery.getOptions()).thenReturn(mockOptions); + when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); + Job completedJob = + expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); + QueryResponse completedQuery = + QueryResponse.newBuilder() + .setCompleted(true) + .setTotalRows(1) // Lies to force call of listTableData(). + .setSchema(Schema.of(Field.of("_f0", LegacySQLTypeName.INTEGER))) + .setErrors(ImmutableList.of()) + .build(); + + when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(completedJob); + when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) + .thenReturn(completedQuery); + job = this.job.toBuilder().setConfiguration(DRL_QUERY_CONFIGURATION).build(); + assertThat(job.waitFor(TEST_BIGQUERY_RETRY_CONFIG, TEST_RETRY_OPTIONS)) + .isSameInstanceAs(completedJob); + verify(bigquery, times(1)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); + verify(bigquery).getJob(JOB_INFO.getJobId()); + } + + @Test + public void testWaitForWithBigQueryRetryConfigShouldRetry() throws InterruptedException { + QueryStatistics jobStatistics = + QueryStatistics.newBuilder() + .setCreationTimestamp(1L) + .setEndTime(3L) + .setStartTime(2L) + .build(); + JobInfo jobInfo = + JobInfo.newBuilder(DRL_QUERY_CONFIGURATION) + .setJobId(JOB_ID) + .setStatistics(jobStatistics) + .setJobId(JOB_ID) + .setEtag(ETAG) + .setGeneratedId(GENERATED_ID) + .setSelfLink(SELF_LINK) + .setUserEmail(EMAIL) + .setStatus(JOB_STATUS) + .build(); + + when(bigquery.getOptions()).thenReturn(mockOptions); + when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); + Job completedJob = + expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); + QueryResponse completedQuery = + QueryResponse.newBuilder() + .setCompleted(true) + .setTotalRows(1) // Lies to force call of listTableData(). + .setSchema(Schema.of(Field.of("_f0", LegacySQLTypeName.INTEGER))) + .setErrors(ImmutableList.of()) + .build(); + + when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(completedJob); + BigQueryError bigQueryError = + new BigQueryError( + "testReasonRateLimitExceeded", "US", "testMessage: Exceeded rate limits:"); + + ImmutableList bigQueryErrorList = ImmutableList.of(bigQueryError); + BigQueryException bigQueryException = new BigQueryException(bigQueryErrorList); + when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) + .thenThrow(bigQueryException) + .thenReturn(completedQuery); + job = this.job.toBuilder().setConfiguration(DRL_QUERY_CONFIGURATION).build(); + assertThat(job.waitFor(TEST_BIGQUERY_RETRY_CONFIG, TEST_RETRY_OPTIONS)) + .isSameInstanceAs(completedJob); + // Verify that getQueryResults is attempted twice. First during bigQueryException with "Exceeded + // rate limits" error message and the second successful attempt. + verify(bigquery, times(2)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); + verify(bigquery).getJob(JOB_INFO.getJobId()); + } + + @Test + public void testWaitForWithBigQueryRetryConfigErrorShouldNotRetry() throws InterruptedException { + QueryStatistics jobStatistics = + QueryStatistics.newBuilder() + .setCreationTimestamp(1L) + .setEndTime(3L) + .setStartTime(2L) + .build(); + JobInfo jobInfo = + JobInfo.newBuilder(DRL_QUERY_CONFIGURATION) + .setJobId(JOB_ID) + .setStatistics(jobStatistics) + .setJobId(JOB_ID) + .setEtag(ETAG) + .setGeneratedId(GENERATED_ID) + .setSelfLink(SELF_LINK) + .setUserEmail(EMAIL) + .setStatus(JOB_STATUS) + .build(); + + when(bigquery.getOptions()).thenReturn(mockOptions); + when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); + QueryResponse completedQuery = + QueryResponse.newBuilder() + .setCompleted(true) + .setTotalRows(1) // Lies to force call of listTableData(). + .setSchema(Schema.of(Field.of("_f0", LegacySQLTypeName.INTEGER))) + .setErrors(ImmutableList.of()) + .build(); + + BigQueryError bigQueryError = + new BigQueryError("testReasonRateLimitExceeded", "US", "testMessage: do not retry error"); + + ImmutableList bigQueryErrorList = ImmutableList.of(bigQueryError); + BigQueryException bigQueryException = new BigQueryException(bigQueryErrorList); + when(bigquery.getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS)) + .thenThrow(bigQueryException) + .thenReturn(completedQuery); + job = this.job.toBuilder().setConfiguration(DRL_QUERY_CONFIGURATION).build(); + try { + job.waitFor(TEST_BIGQUERY_RETRY_CONFIG, TEST_RETRY_OPTIONS); + fail("JobException expected"); + } catch (BigQueryException e) { + assertNotNull(e.getErrors()); + } + // Verify that getQueryResults is attempted only once and not retried since the error message + // does not match. + verify(bigquery, times(1)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); + } + @Test public void testReload() { JobInfo updatedInfo = JOB_INFO.toBuilder().setEtag("etag").build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b1352f5121..63265d58a3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -57,6 +57,7 @@ import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.BigQueryResult; +import com.google.cloud.bigquery.BigQueryRetryConfig; import com.google.cloud.bigquery.BigQuerySQLException; import com.google.cloud.bigquery.CloneDefinition; import com.google.cloud.bigquery.Clustering; @@ -5256,6 +5257,26 @@ public void testCreateAndGetJob() throws InterruptedException, TimeoutException assertTrue(bigquery.delete(destinationTable)); } + @Test + public void testCreateJobAndWaitForWithRetryOptions() + throws InterruptedException, TimeoutException { + // Note: This only tests the non failure/retry case. For retry cases, see unit tests with mocked + // RPC calls. + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder("SELECT CURRENT_TIMESTAMP() as ts") + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .build(); + + BigQueryRetryConfig bigQueryRetryConfig = BigQueryRetryConfig.newBuilder().build(); + JobOption bigQueryRetryConfigOption = JobOption.bigQueryRetryConfig(bigQueryRetryConfig); + JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(1)); + + Job job = bigquery.create(JobInfo.of(config), bigQueryRetryConfigOption, retryOptions); + job = job.waitFor(bigQueryRetryConfig); + assertEquals(DONE, job.getStatus().getState()); + } + @Test public void testCreateAndGetJobWithSelectedFields() throws InterruptedException, TimeoutException { From 54ae77d3084058443187d99c09ab01376c912dd5 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:43:51 -0400 Subject: [PATCH 1771/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.43.0 (#3403) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:libraries-bom to v26.43.0 * 🦉 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 --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b170f4afa4..93c26f93d7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.20.0 + 26.43.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d41b1ace7d..983cdbbf4e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.20.0 + 26.43.0 pom import From d407baa3e95ad894d4028aa46def7ca8efe930c3 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:16:19 -0400 Subject: [PATCH 1772/2268] docs: add simple query connection read api sample (#3394) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Basic setup for connection api sample using simple query * Update sample to use Connection * Fix import/lint * Fix import order * Remove closing result set as it is not implemented * Remove necessary TODO comment * 🦉 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 --- README.md | 1 + .../SimpleQueryConnectionReadApi.java | 66 +++++++++++++++++++ .../SimpleQueryConnectionReadApiIT.java | 61 +++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/SimpleQueryConnectionReadApiIT.java diff --git a/README.md b/README.md index 93c26f93d7..bde8c658eb 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Set User Agent | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SetUserAgent.java) | | Simple App | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java) | | Simple Query | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleQuery.java) | +| Simple Query Connection Read Api | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java) | | Table Exists | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableExists.java) | | Table Insert Rows | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRows.java) | | Table Insert Rows Without Row Ids | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/TableInsertRowsWithoutRowIds.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java b/samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java new file mode 100644 index 0000000000..970c29a2ef --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/SimpleQueryConnectionReadApi.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_simple_query_connection_read_api] + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.BigQueryResult; +import com.google.cloud.bigquery.Connection; +import com.google.cloud.bigquery.ConnectionSettings; +import java.sql.ResultSet; +import java.sql.SQLException; + +public class SimpleQueryConnectionReadApi { + + public static void main(String[] args) { + String query = + "SELECT corpus, count(*) as corpus_count " + + "FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; + simpleQueryConnectionReadApi(query); + } + + public static void simpleQueryConnectionReadApi(String query) { + + try { + // Initialize client and create a Connection session. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setRequestTimeout(10L) + .setMaxResults(100L) + .setUseQueryCache(true) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + + // Execute the query using the Connection session. + BigQueryResult bigQueryResult = connection.executeSelect(query); + ResultSet resultSet = bigQueryResult.getResultSet(); + + while (resultSet.next()) { + System.out.print("corpus:" + resultSet.getString("corpus")); + System.out.print(", count:" + resultSet.getLong("corpus_count")); + System.out.println(); + } + System.out.println("Query ran successfully"); + } catch (SQLException e) { + System.out.println("Query did not run \n" + e.toString()); + } + } +} +// [END bigquery_simple_query_connection_read_api] diff --git a/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryConnectionReadApiIT.java b/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryConnectionReadApiIT.java new file mode 100644 index 0000000000..b7cb109c77 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/SimpleQueryConnectionReadApiIT.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class SimpleQueryConnectionReadApiIT { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testSimpleQueryConnectionReadApi() { + String query = + "SELECT corpus, count(*) as corpus_count " + + "FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; + + SimpleQueryConnectionReadApi.simpleQueryConnectionReadApi(query); + assertThat(bout.toString()).contains("Query ran successfully"); + } +} From a4a9999def9805b8fecbc1820cc9f6f6c1997991 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jul 2024 16:04:41 +0200 Subject: [PATCH 1773/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.33.0 (#3405) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ee2d3db7a6..6ff35226a3 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.32.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.33.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 91d2c3bc7d..05e0908b25 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.32.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 3f34dd7532..d0cff89d48 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.32.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index e4416de916..5791f668d9 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.32.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 519c2e3ce3..931f9bb005 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.32.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index f88c59d6be..681e94b5e1 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.32.0 + 3.33.0 diff --git a/pom.xml b/pom.xml index 0de44c9df2..b7680ffe27 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.32.0 + 3.33.0 From 1f44b4bbef353c6c0a8ece77e9f9b1f0337330db Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jul 2024 17:32:11 +0200 Subject: [PATCH 1774/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.41.0 (#3401) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1f236f9169..ecbb4246ab 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.40.0 + 2.41.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4a3925a4d7..2bffe8678a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.40.0 + 2.41.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 983cdbbf4e..cb51bc92fc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.40.0 + 2.41.0 test From a61ce7d710e2e8b000ee25ec9d295abbc2b63dd1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Jul 2024 18:15:38 +0200 Subject: [PATCH 1775/2268] deps: update github/codeql-action action to v2.25.15 (#3402) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 85324fd18b..8fab6c30b6 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@563dcafdfe28a0bb82e2c272d84924f17b628540 # v2.25.13 + uses: github/codeql-action/upload-sarif@3e0e84636c6f5df46a2cb232ae1dd1384713150d # v2.25.15 with: sarif_file: results.sarif From 6dca6fffe96937db87713e45f0501d64fd5b544f Mon Sep 17 00:00:00 2001 From: shollyman Date: Fri, 26 Jul 2024 16:52:29 -0700 Subject: [PATCH 1776/2268] docs: add short mode query sample (#3397) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: add short mode query sample * formatting * update comments * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update sample comments * 🦉 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 --- README.md | 1 + .../com/example/bigquery/QueryShortMode.java | 75 +++++++++++++++++++ .../example/bigquery/QueryShortModeIT.java | 62 +++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java diff --git a/README.md b/README.md index bde8c658eb..2b4dc4e6c0 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigquery/tree | Query Pagination | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPagination.java) | | Query Partitioned Table | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryPartitionedTable.java) | | Query Script | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryScript.java) | +| Query Short Mode | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java) | | Query Total Rows | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryTotalRows.java) | | Query With Array Of Structs Named Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayOfStructsNamedParameters.java) | | Query With Array Parameters | [source code](https://github.com/googleapis/java-bigquery/blob/main/samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigquery&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigquery/QueryWithArrayParameters.java) | diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java b/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java new file mode 100644 index 0000000000..b07f65f92a --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java @@ -0,0 +1,75 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_query_shortquery] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.TableResult; + +// Sample demonstrating short mode query execution. +// +// While this feature is still in preview, it is controlled by +// setting the environment variable QUERY_PREVIEW_ENABLED=TRUE +// to request short mode execution. +public class QueryShortMode { + + public static void main(String[] args) { + String query = + "SELECT name, gender, SUM(number) AS total FROM " + + "bigquery-public-data.usa_names.usa_1910_2013 GROUP BY " + + "name, gender ORDER BY total DESC LIMIT 10"; + queryShortMode(query); + } + + public static void queryShortMode(String query) { + try { + // Initialize client that will be used to send requests. This client only needs + // to be created once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + // Execute the query. The returned TableResult provides access information + // about the query execution as well as query results. + TableResult results = bigquery.query(QueryJobConfiguration.of(query)); + + JobId jobId = results.getJobId(); + if (jobId != null) { + System.out.println("Query was run with job state. Job ID: " + jobId.toString()); + } else { + System.out.println("Query was run in short mode. Query ID: " + results.getQueryId()); + } + + // Print the results. + results + .iterateAll() + .forEach( + row -> { + System.out.print("name:" + row.get("name").getStringValue()); + System.out.print(", gender: " + row.get("gender").getStringValue()); + System.out.print(", total: " + row.get("total").getLongValue()); + System.out.println(); + }); + + } catch (BigQueryException | InterruptedException e) { + System.out.println("Query not performed \n" + e.toString()); + } + } +} +// [END bigquery_query_shortquery] diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java new file mode 100644 index 0000000000..6500de7827 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class QueryShortModeIT { + + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testQueryBatch() { + String query = + "SELECT name, gender, SUM(number) AS total FROM " + + "bigquery-public-data.usa_names.usa_1910_2013 GROUP BY " + + "name, gender ORDER BY total DESC LIMIT 10"; + + QueryShortMode.queryShortMode(query); + assertThat(bout.toString()).contains("Query was run"); + } +} From 609c616c3197f0d0c3439050cd4974c41f892092 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 28 Jul 2024 02:00:33 +0200 Subject: [PATCH 1777/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.8.0 (#3409) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7680ffe27..43b4a5d739 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.6.1 + 3.8.0 pom import From 66777a2c3c7b0462330bd1c820e2f04ad4727465 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 28 Jul 2024 04:11:30 +0200 Subject: [PATCH 1778/2268] deps: update ossf/scorecard-action action to v2.4.0 (#3408) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8fab6c30b6..f56288789a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 with: results_file: results.sarif results_format: sarif From cea129c3fb4a4158230616d0d1cacc204a4e67d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 27 Jul 2024 22:46:51 -0400 Subject: [PATCH 1779/2268] chore(main): release 2.42.0 (#3378) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 46 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e962971e86..7a3cf23f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## [2.42.0](https://github.com/googleapis/java-bigquery/compare/v2.41.0...v2.42.0) (2024-07-28) + + +### Features + +* Add ability to specify RetryOptions and BigQueryRetryConfig when create job and waitFor ([#3398](https://github.com/googleapis/java-bigquery/issues/3398)) ([1f91ae7](https://github.com/googleapis/java-bigquery/commit/1f91ae7fa2100a05f969a7429cb619a2b8b42dee)) +* Add additional parameters to CsvOptions and ParquetOptions ([#3370](https://github.com/googleapis/java-bigquery/issues/3370)) ([34f16fb](https://github.com/googleapis/java-bigquery/commit/34f16fbaad236f5a6db26d693efde2025913d540)) +* Add remaining Statement Types ([#3381](https://github.com/googleapis/java-bigquery/issues/3381)) ([5f39b19](https://github.com/googleapis/java-bigquery/commit/5f39b19e8839f06d956addb8d95cf05e4b60a3f1)) + + +### Bug Fixes + +* Null field mode inconsistency ([#2863](https://github.com/googleapis/java-bigquery/issues/2863)) ([b9e96e3](https://github.com/googleapis/java-bigquery/commit/b9e96e3aa738a1813ad452cf6141f792f437e8de)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.3.4 ([#3382](https://github.com/googleapis/java-bigquery/issues/3382)) ([efa1aef](https://github.com/googleapis/java-bigquery/commit/efa1aef0a579baa379adbfbd2ee12f4ee5f3d987)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.48.0 ([#3374](https://github.com/googleapis/java-bigquery/issues/3374)) ([45b7f20](https://github.com/googleapis/java-bigquery/commit/45b7f20e1b324d9b77183c0f8bb5ae14724d6aef)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240616-2.0.0 ([#3368](https://github.com/googleapis/java-bigquery/issues/3368)) ([ceb270c](https://github.com/googleapis/java-bigquery/commit/ceb270c5cc2af4d69948ac89af1d72990fe1a7ee)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240623-2.0.0 ([#3384](https://github.com/googleapis/java-bigquery/issues/3384)) ([e1de34f](https://github.com/googleapis/java-bigquery/commit/e1de34f0c4c67d75bcf15f35fe86c411b61d04ac)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240629-2.0.0 ([#3392](https://github.com/googleapis/java-bigquery/issues/3392)) ([352562d](https://github.com/googleapis/java-bigquery/commit/352562da445e35a8207bcf77442130867f32e52d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.52.0 ([#3375](https://github.com/googleapis/java-bigquery/issues/3375)) ([2115c04](https://github.com/googleapis/java-bigquery/commit/2115c0448b242ddd887f2bac3d68c45847273c3d)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.33.0 ([#3405](https://github.com/googleapis/java-bigquery/issues/3405)) ([a4a9999](https://github.com/googleapis/java-bigquery/commit/a4a9999def9805b8fecbc1820cc9f6f6c1997991)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.3 ([#3371](https://github.com/googleapis/java-bigquery/issues/3371)) ([2e804c5](https://github.com/googleapis/java-bigquery/commit/2e804c56eeef5009cc46c7544fe9b04bfdd65d7a)) +* Update github/codeql-action action to v2.25.11 ([#3376](https://github.com/googleapis/java-bigquery/issues/3376)) ([f1e0014](https://github.com/googleapis/java-bigquery/commit/f1e0014dca5ca04522796b44ff313696d2b41176)) +* Update github/codeql-action action to v2.25.12 ([#3387](https://github.com/googleapis/java-bigquery/issues/3387)) ([af60b30](https://github.com/googleapis/java-bigquery/commit/af60b30cd774992c5d82063106471926dc6aaa6e)) +* Update github/codeql-action action to v2.25.13 ([#3395](https://github.com/googleapis/java-bigquery/issues/3395)) ([95c8d6f](https://github.com/googleapis/java-bigquery/commit/95c8d6f65c5c5355fc52a0a2b54002d8f9cdb1ef)) +* Update github/codeql-action action to v2.25.15 ([#3402](https://github.com/googleapis/java-bigquery/issues/3402)) ([a61ce7d](https://github.com/googleapis/java-bigquery/commit/a61ce7d710e2e8b000ee25ec9d295abbc2b63dd1)) +* Update ossf/scorecard-action action to v2.4.0 ([#3408](https://github.com/googleapis/java-bigquery/issues/3408)) ([66777a2](https://github.com/googleapis/java-bigquery/commit/66777a2c3c7b0462330bd1c820e2f04ad4727465)) + + +### Documentation + +* Add short mode query sample ([#3397](https://github.com/googleapis/java-bigquery/issues/3397)) ([6dca6ff](https://github.com/googleapis/java-bigquery/commit/6dca6fffe96937db87713e45f0501d64fd5b544f)) +* Add simple query connection read api sample ([#3394](https://github.com/googleapis/java-bigquery/issues/3394)) ([d407baa](https://github.com/googleapis/java-bigquery/commit/d407baa3e95ad894d4028aa46def7ca8efe930c3)) + ## [2.41.0](https://github.com/googleapis/java-bigquery/compare/v2.40.3...v2.41.0) (2024-06-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 11388a6741..4c3f217d51 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.41.1-SNAPSHOT + 2.42.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 681e94b5e1..8f31b495a9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.41.1-SNAPSHOT + 2.42.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.41.1-SNAPSHOT + 2.42.0
    diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c3bf567ca2..5d61bb426a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.41.1-SNAPSHOT + 2.42.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.41.1-SNAPSHOT + 2.42.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 43b4a5d739..41482a874e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.41.1-SNAPSHOT + 2.42.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.41.1-SNAPSHOT + 2.42.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2bffe8678a..afdb53dee2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.41.1-SNAPSHOT + 2.42.0 diff --git a/versions.txt b/versions.txt index f2e6b27281..030e1e1c6e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.41.0:2.41.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.42.0:2.42.0 \ No newline at end of file From 1fc8720fe49e061ba34bfe67987aa5be31b9f91f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:31:56 -0400 Subject: [PATCH 1780/2268] chore(main): release 2.42.1-SNAPSHOT (#3410) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4c3f217d51..c0056e3dc9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.0 + 2.42.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8f31b495a9..e984d884b9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.0 + 2.42.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1-SNAPSHOT
    diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5d61bb426a..74de39e9b1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.0 + 2.42.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 41482a874e..aebff36676 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.0 + 2.42.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index afdb53dee2..ab69220e76 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 030e1e1c6e..c1fafa3200 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.0:2.42.0 \ No newline at end of file +google-cloud-bigquery:2.42.0:2.42.1-SNAPSHOT \ No newline at end of file From 8a48fd1eb6762e42bbdc49d1aa4ebab36c3e8e26 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 30 Jul 2024 19:54:51 +0200 Subject: [PATCH 1781/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 (#3412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 * 🦉 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 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2b4dc4e6c0..6165b7ceb1 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.41.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.42.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.41.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.42.0" ``` @@ -352,7 +352,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.41.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/pom.xml b/pom.xml index aebff36676..7db40b3efa 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240629-2.0.0 + v2-rev20240714-2.0.0 From 57167517d63813db9f323a8b47ea033fd5a673fd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 31 Jul 2024 15:58:14 +0200 Subject: [PATCH 1782/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.0 (#3411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.0 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6165b7ceb1..12c06a0c91 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.41.0 + 2.42.0 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ecbb4246ab..3f01ebc5b4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.41.0 + 2.42.0 From 5d1953fc4b741b6f90d2c7eac5a46da71f2112ad Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Wed, 31 Jul 2024 16:55:16 -0400 Subject: [PATCH 1783/2268] chore: setup 2.40.x lts branch (#3415) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index ab97340a7a..7f8c0fbb77 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -23,6 +23,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.35.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.40.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 418e8ab988..2027cd1a0f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -107,6 +107,21 @@ branchProtectionRules: - cla/google - OwlBot Post Processor - javadoc + - pattern: 2.40.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - OwlBot Post Processor + - javadoc permissionRules: - team: api-bigquery permission: admin From 66b072d1b84f46d83dc84fc4a99410ef981804f4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 1 Aug 2024 22:30:18 +0200 Subject: [PATCH 1784/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.49.0 (#3416) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7db40b3efa..a7291f67b2 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.48.0 + 2.49.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3f01ebc5b4..9a18b48024 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.48.0 + 2.49.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ab69220e76..b952773594 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.48.0 + 2.49.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index cb51bc92fc..3742773e4b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.48.0 + 2.49.0 test From 0d3a1007859079b4489dbd73de9fcd9685ca5457 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 1 Aug 2024 22:35:32 +0200 Subject: [PATCH 1785/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.41.0 (#3419) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a7291f67b2..1d30a89dba 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.40.1 + 2.41.0 test From 6cff7f0c2241223c529321e2b613f15c84ecbdcc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 1 Aug 2024 22:35:51 +0200 Subject: [PATCH 1786/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.53.0 (#3418) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1d30a89dba..54848075af 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.52.0 + 1.53.0 pom import From 66336a8989681a7c5c3d901c11c7fc6cef0b9fef Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 1 Aug 2024 22:39:23 +0200 Subject: [PATCH 1787/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.49.0 (#3417) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54848075af..75dc7343da 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.48.0 + 2.49.0 test From d5ec87d16f64c231c8bfd87635952cb1a04f5e25 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 7 Aug 2024 16:28:56 +0200 Subject: [PATCH 1788/2268] deps: update actions/upload-artifact action to v4.3.5 (#3420) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f56288789a..9dcf90cb98 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 + uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 with: name: SARIF file path: results.sarif From 91d780b0db2b9b05923b60621cf80251293be184 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 9 Aug 2024 15:58:45 +0200 Subject: [PATCH 1789/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 (#3421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 * 🦉 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 From c7d07b3f1d6fa2c2259fa7315b284bcaf48ee5f2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 Aug 2024 17:16:50 +0200 Subject: [PATCH 1790/2268] deps: update actions/upload-artifact action to v4.3.5 (#3422) From a9d6869251fa3df80d639c6998b62992468d6625 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 Aug 2024 17:08:57 +0200 Subject: [PATCH 1791/2268] deps: update actions/upload-artifact action to v4.3.5 (#3424) From 16f350c28ec60dc4011b77cbda6416c9de45d431 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 14 Aug 2024 17:28:50 +0200 Subject: [PATCH 1792/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 (#3423) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 * 🦉 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 From 2fc15b3e9f89289f0a047bb0a6ae7fb5bb71d253 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:03:15 -0400 Subject: [PATCH 1793/2268] docs: update iam policy sample user to be consistent with other languages (#3429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update iam policy sample user to be consistent with other language samples * fix format * 🦉 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 --- README.md | 2 +- .../src/main/java/com/example/bigquery/CreateIamPolicy.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 12c06a0c91..030bed3271 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.43.0') +implementation platform('com.google.cloud:libraries-bom:26.44.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java b/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java index 960f280717..96f0c3f16a 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateIamPolicy.java @@ -46,7 +46,9 @@ public static void createIamPolicy(String datasetName, String tableName) { Policy policy = bigquery.getIamPolicy(tableId); policy .toBuilder() - .addIdentity(Role.of("roles/bigquery.dataViewer"), Identity.allUsers()) + .addIdentity( + Role.of("roles/bigquery.dataViewer"), + Identity.user("example-analyst-group@google.com")) .build(); bigquery.setIamPolicy(tableId, policy); System.out.println("Iam policy created successfully"); From 022eb578ae0b6f02e943662c8d4e453590f7c209 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Aug 2024 20:00:17 +0200 Subject: [PATCH 1794/2268] deps: update actions/upload-artifact action to v4.3.5 (#3427) From c7aacbaeddc4809e283c6dfcdedd9610eac7730f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 16 Aug 2024 18:30:34 +0200 Subject: [PATCH 1795/2268] deps: update actions/upload-artifact action to v4.3.5 (#3430) From a48acde9852fe51783096249fd119d36fa7a7b16 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 17:05:58 +0200 Subject: [PATCH 1796/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.42.0 (#3425) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.42.0 * 🦉 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 --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9a18b48024..804fa8a05e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.41.0 + 2.42.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b952773594..a44778e259 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.41.0 + 2.42.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3742773e4b..d43627c845 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.41.0 + 2.42.0 test From 0a6574fa11aa83b5c899f1dcd3b1132aa4f46ebd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 19:31:43 +0200 Subject: [PATCH 1797/2268] deps: update github/codeql-action action to v2.26.2 (#3426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update github/codeql-action action to v2.26.2 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9dcf90cb98..19683d81b4 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@3e0e84636c6f5df46a2cb232ae1dd1384713150d # v2.25.15 + uses: github/codeql-action/upload-sarif@366883a76d75dcee5428da5c3ae7abf9386e35ac # v2.26.2 with: sarif_file: results.sarif From 9ae6ecac3337eb19bced14b9fcd7ce74580d7326 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 19:32:05 +0200 Subject: [PATCH 1798/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 (#3428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 * 🦉 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 From b7e8244cffdef926465e2d2700766b98ad687247 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 19:32:29 +0200 Subject: [PATCH 1799/2268] deps: update actions/upload-artifact action to v4.3.5 (#3432) From 76e51307977f3d6af550c39d6cefbaa15de48d90 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 21:38:07 +0200 Subject: [PATCH 1800/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.3 (#3434) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index c0056e3dc9..e5aa6b8ef2 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 true diff --git a/samples/pom.xml b/samples/pom.xml index e15e1f5ffa..b0ed2cf7ba 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d43627c845..c7679699e5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 true From 801f44172f7be43e0649a116fb0bb556507fc572 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 19 Aug 2024 21:38:57 +0200 Subject: [PATCH 1801/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.34.0 (#3433) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 6ff35226a3..dffbc2f701 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.33.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.34.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 05e0908b25..92ffa46f75 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.34.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index d0cff89d48..c3ebb3c155 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.34.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 5791f668d9..e7ddf639b5 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.33.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.34.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 931f9bb005..e211e47fc6 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.33.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.34.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e984d884b9..b268dd6478 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.33.0 + 3.34.0 diff --git a/pom.xml b/pom.xml index 75dc7343da..4b1a62ec8e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.33.0 + 3.34.0 From ccefd6e755042b1e4c2aaec10228abb05779ed87 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 20 Aug 2024 20:17:31 +0200 Subject: [PATCH 1802/2268] deps: update actions/upload-artifact action to v4.3.5 (#3436) From b4e20db60b30dac9039407d724b8f7c816301e5c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Aug 2024 16:25:12 +0200 Subject: [PATCH 1803/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240803-2.0.0 (#3435) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b1a62ec8e..32bef1ff2f 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240714-2.0.0 + v2-rev20240803-2.0.0 From c83611b1bd73d5637c3771466092050f8902b5ce Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Aug 2024 16:32:01 +0200 Subject: [PATCH 1804/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.42.0 (#3439) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32bef1ff2f..08d4f43e5b 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.41.0 + 2.42.0 test From 390e1824bffef17e85d0ec142b4fcca6dff80a9c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Aug 2024 16:47:58 +0200 Subject: [PATCH 1805/2268] deps: update github/codeql-action action to v2.26.3 (#3438) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 19683d81b4..83fe49d994 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@366883a76d75dcee5428da5c3ae7abf9386e35ac # v2.26.2 + uses: github/codeql-action/upload-sarif@d65d0c9607eef71d396c103df6032f9561fcb3c6 # v2.26.3 with: sarif_file: results.sarif From 916fe9ad67e5162a9f24852a96e40a2051ebffbd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Aug 2024 19:20:41 +0200 Subject: [PATCH 1806/2268] deps: update actions/upload-artifact action to v4.3.5 (#3440) From 187f099edbf785e3ef50ae28fce6ae194d44dfb3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 21 Aug 2024 20:24:31 +0200 Subject: [PATCH 1807/2268] deps: update actions/upload-artifact action to v4.3.5 (#3443) From 04aea5e1d0eeab02f8ea92ff3467c64507dc05c9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Aug 2024 04:19:55 +0200 Subject: [PATCH 1808/2268] deps: update actions/upload-artifact action to v4.3.5 (#3444) From 37016833850c717c2ffea14a137cb85d0a509e42 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 22 Aug 2024 16:32:32 +0200 Subject: [PATCH 1809/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.8.1 (#3442) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08d4f43e5b..9142ac4094 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.8.0 + 3.8.1 pom import From d0d758a6e5e90502491eefa64e3a7409bdcea6a9 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:48:48 -0400 Subject: [PATCH 1810/2268] fix: NPE for executeSelect nonFast path with empty result (#3445) * fix: NPE for executeSelect nonFast path with empty result * remove commented out extraneous code --- .../google/cloud/bigquery/ConnectionImpl.java | 16 +++++---- .../cloud/bigquery/ConnectionImplTest.java | 33 ++++++++++++++++++- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 2d0367790e..413243396e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -53,6 +53,7 @@ import com.google.common.util.concurrent.ListeningExecutorService; import com.google.common.util.concurrent.MoreExecutors; import java.io.IOException; +import java.math.BigInteger; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; @@ -418,12 +419,15 @@ public ListenableFuture executeSelectAsync( @VisibleForTesting BigQueryResult getResultSet( GetQueryResultsResponse firstPage, JobId jobId, String sql, Boolean hasQueryParameters) { - return getSubsequentQueryResultsWithJob( - firstPage.getTotalRows().longValue(), - (long) firstPage.getRows().size(), - jobId, - firstPage, - hasQueryParameters); + if (firstPage.getTotalRows().compareTo(BigInteger.ZERO) > 0) { + return getSubsequentQueryResultsWithJob( + firstPage.getTotalRows().longValue(), + (long) firstPage.getRows().size(), + jobId, + firstPage, + hasQueryParameters); + } + return new BigQueryResultImpl(Schema.fromPb(firstPage.getSchema()), 0, null, null); } static class EndOfFieldValueList diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index dff73d6bdf..58cb69ba7e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -100,6 +100,15 @@ public class ConnectionImplTest { .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)) .setSchema(FAST_QUERY_TABLESCHEMA); + private static final GetQueryResultsResponse GET_QUERY_RESULTS_RESPONSE_EMPTY = + new GetQueryResultsResponse() + .setJobReference(QUERY_JOB.toPb()) + .setJobComplete(true) + .setCacheHit(false) + .setPageToken(PAGE_TOKEN) + .setTotalBytesProcessed(0L) + .setTotalRows(BigInteger.valueOf(0L)) + .setSchema(FAST_QUERY_TABLESCHEMA); private static final GetQueryResultsResponse GET_QUERY_RESULTS_RESPONSE_NULL_SCHEMA = new GetQueryResultsResponse() @@ -375,7 +384,6 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() - // .setConfiguration(QUERY_JOB.g) .setJobReference(QUERY_JOB.toPb()) .setId(JOB) .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")); @@ -401,6 +409,29 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException { .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); } + // calls executeSelect with a nonFast query where the query returns an empty result. + @Test + public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException { + ConnectionImpl connectionSpy = Mockito.spy(connection); + com.google.api.services.bigquery.model.Job jobResponseMock = + new com.google.api.services.bigquery.model.Job() + .setJobReference(QUERY_JOB.toPb()) + .setId(JOB) + .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")); + // emulating a legacy query + doReturn(false).when(connectionSpy).isFastQuerySupported(); + doReturn(GET_QUERY_RESULTS_RESPONSE_EMPTY) + .when(connectionSpy) + .getQueryResultsFirstPage(any(JobId.class)); + when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + .thenReturn(jobResponseMock); // RPC call in createQueryJob + BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); + assertEquals(res.getTotalRows(), 0); + assertEquals(QUERY_SCHEMA, res.getSchema()); + verify(bigqueryRpcMock, times(1)) + .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + } + // exercises getSubsequentQueryResultsWithJob for fast running queries @Test public void testFastQueryLongRunning() throws SQLException { From cc9da9576fa276afe069caff075c50e41e412ce1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Aug 2024 17:39:44 +0200 Subject: [PATCH 1811/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.54.0 (#3450) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9142ac4094..9ae0fc0f07 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.53.0 + 1.54.0 pom import From c6e93cd1996f2feca3c79bf5ec4a079bd821c0f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Aug 2024 17:40:00 +0200 Subject: [PATCH 1812/2268] deps: update actions/upload-artifact action to v4.3.5 (#3449) From 58aacc5a92e18b790a03c0b9b4a75062928768c2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Aug 2024 17:46:15 +0200 Subject: [PATCH 1813/2268] deps: update github/codeql-action action to v2.26.5 (#3446) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 83fe49d994..f8bc8f3c3a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d65d0c9607eef71d396c103df6032f9561fcb3c6 # v2.26.3 + uses: github/codeql-action/upload-sarif@e8b34a2aaa1d35eab0b758128337086bb22bc6bf # v2.26.5 with: sarif_file: results.sarif From 4256184777bad166b73728cfc37990b30b5fc1cc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 26 Aug 2024 19:13:48 +0200 Subject: [PATCH 1814/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.50.0 (#3447) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9ae0fc0f07..8d5fb63bbc 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.49.0 + 2.50.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 804fa8a05e..1276073260 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.49.0 + 2.50.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a44778e259..7148928d58 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.49.0 + 2.50.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c7679699e5..315bf04175 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.49.0 + 2.50.0 test From fbfc1064688ba594a0d232c413e6f8b54558590f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 03:11:58 +0200 Subject: [PATCH 1815/2268] deps: update actions/upload-artifact action to v4.3.5 (#3455) From 165e9b9c3924216581da8d8c8413acba86f79bff Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 03:14:07 +0200 Subject: [PATCH 1816/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.43.0 (#3453) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1276073260..d285e01cf8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.42.0 + 2.43.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7148928d58..9334e0cb42 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.42.0 + 2.43.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 315bf04175..c4c72ca905 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.42.0 + 2.43.0 test From 2c128398b04c28ccd0844d028e2f8c467f8723f0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 03:17:57 +0200 Subject: [PATCH 1817/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.50.0 (#3448) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8d5fb63bbc..e5a54296ec 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.49.0 + 2.50.0 test From 8796aee5f669414169dc8baf88f9121697f4cd04 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 03:21:47 +0200 Subject: [PATCH 1818/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240815-2.0.0 (#3454) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5a54296ec..4ba75a3dfc 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240803-2.0.0 + v2-rev20240815-2.0.0 From 8e5a790b1c124d57b22c4f0d325ac1d3706dbed5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 03:22:04 +0200 Subject: [PATCH 1819/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.7.0 (#3451) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ba75a3dfc..9d42dc0568 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.6.2 + 3.7.0 From c4afbef9d4df03c798241d56d8988adb5724d008 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 27 Aug 2024 19:38:58 +0200 Subject: [PATCH 1820/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.9.0 (#3457) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9d42dc0568..52b90fa7e7 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.8.1 + 3.9.0 pom import From 421c8250de28b33fb5d2e175b88f1042194f8dc2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:52:54 -0400 Subject: [PATCH 1821/2268] chore(main): release 2.42.1 (#3414) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 +-- google-cloud-bigquery/pom.xml | 4 +-- pom.xml | 4 +-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 52 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3cf23f27..9feeb72909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## [2.42.1](https://github.com/googleapis/java-bigquery/compare/v2.42.0...v2.42.1) (2024-08-27) + + +### Bug Fixes + +* NPE for executeSelect nonFast path with empty result ([#3445](https://github.com/googleapis/java-bigquery/issues/3445)) ([d0d758a](https://github.com/googleapis/java-bigquery/commit/d0d758a6e5e90502491eefa64e3a7409bdcea6a9)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.3.5 ([#3420](https://github.com/googleapis/java-bigquery/issues/3420)) ([d5ec87d](https://github.com/googleapis/java-bigquery/commit/d5ec87d16f64c231c8bfd87635952cb1a04f5e25)) +* Update actions/upload-artifact action to v4.3.5 ([#3422](https://github.com/googleapis/java-bigquery/issues/3422)) ([c7d07b3](https://github.com/googleapis/java-bigquery/commit/c7d07b3f1d6fa2c2259fa7315b284bcaf48ee5f2)) +* Update actions/upload-artifact action to v4.3.5 ([#3424](https://github.com/googleapis/java-bigquery/issues/3424)) ([a9d6869](https://github.com/googleapis/java-bigquery/commit/a9d6869251fa3df80d639c6998b62992468d6625)) +* Update actions/upload-artifact action to v4.3.5 ([#3427](https://github.com/googleapis/java-bigquery/issues/3427)) ([022eb57](https://github.com/googleapis/java-bigquery/commit/022eb578ae0b6f02e943662c8d4e453590f7c209)) +* Update actions/upload-artifact action to v4.3.5 ([#3430](https://github.com/googleapis/java-bigquery/issues/3430)) ([c7aacba](https://github.com/googleapis/java-bigquery/commit/c7aacbaeddc4809e283c6dfcdedd9610eac7730f)) +* Update actions/upload-artifact action to v4.3.5 ([#3432](https://github.com/googleapis/java-bigquery/issues/3432)) ([b7e8244](https://github.com/googleapis/java-bigquery/commit/b7e8244cffdef926465e2d2700766b98ad687247)) +* Update actions/upload-artifact action to v4.3.5 ([#3436](https://github.com/googleapis/java-bigquery/issues/3436)) ([ccefd6e](https://github.com/googleapis/java-bigquery/commit/ccefd6e755042b1e4c2aaec10228abb05779ed87)) +* Update actions/upload-artifact action to v4.3.5 ([#3440](https://github.com/googleapis/java-bigquery/issues/3440)) ([916fe9a](https://github.com/googleapis/java-bigquery/commit/916fe9ad67e5162a9f24852a96e40a2051ebffbd)) +* Update actions/upload-artifact action to v4.3.5 ([#3443](https://github.com/googleapis/java-bigquery/issues/3443)) ([187f099](https://github.com/googleapis/java-bigquery/commit/187f099edbf785e3ef50ae28fce6ae194d44dfb3)) +* Update actions/upload-artifact action to v4.3.5 ([#3444](https://github.com/googleapis/java-bigquery/issues/3444)) ([04aea5e](https://github.com/googleapis/java-bigquery/commit/04aea5e1d0eeab02f8ea92ff3467c64507dc05c9)) +* Update actions/upload-artifact action to v4.3.5 ([#3449](https://github.com/googleapis/java-bigquery/issues/3449)) ([c6e93cd](https://github.com/googleapis/java-bigquery/commit/c6e93cd1996f2feca3c79bf5ec4a079bd821c0f6)) +* Update actions/upload-artifact action to v4.3.5 ([#3455](https://github.com/googleapis/java-bigquery/issues/3455)) ([fbfc106](https://github.com/googleapis/java-bigquery/commit/fbfc1064688ba594a0d232c413e6f8b54558590f)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.49.0 ([#3417](https://github.com/googleapis/java-bigquery/issues/3417)) ([66336a8](https://github.com/googleapis/java-bigquery/commit/66336a8989681a7c5c3d901c11c7fc6cef0b9fef)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.50.0 ([#3448](https://github.com/googleapis/java-bigquery/issues/3448)) ([2c12839](https://github.com/googleapis/java-bigquery/commit/2c128398b04c28ccd0844d028e2f8c467f8723f0)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240714-2.0.0 ([#3412](https://github.com/googleapis/java-bigquery/issues/3412)) ([8a48fd1](https://github.com/googleapis/java-bigquery/commit/8a48fd1eb6762e42bbdc49d1aa4ebab36c3e8e26)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 ([#3421](https://github.com/googleapis/java-bigquery/issues/3421)) ([91d780b](https://github.com/googleapis/java-bigquery/commit/91d780b0db2b9b05923b60621cf80251293be184)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 ([#3423](https://github.com/googleapis/java-bigquery/issues/3423)) ([16f350c](https://github.com/googleapis/java-bigquery/commit/16f350c28ec60dc4011b77cbda6416c9de45d431)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240727-2.0.0 ([#3428](https://github.com/googleapis/java-bigquery/issues/3428)) ([9ae6eca](https://github.com/googleapis/java-bigquery/commit/9ae6ecac3337eb19bced14b9fcd7ce74580d7326)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240803-2.0.0 ([#3435](https://github.com/googleapis/java-bigquery/issues/3435)) ([b4e20db](https://github.com/googleapis/java-bigquery/commit/b4e20db60b30dac9039407d724b8f7c816301e5c)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240815-2.0.0 ([#3454](https://github.com/googleapis/java-bigquery/issues/3454)) ([8796aee](https://github.com/googleapis/java-bigquery/commit/8796aee5f669414169dc8baf88f9121697f4cd04)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.9.0 ([c4afbef](https://github.com/googleapis/java-bigquery/commit/c4afbef9d4df03c798241d56d8988adb5724d008)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.53.0 ([#3418](https://github.com/googleapis/java-bigquery/issues/3418)) ([6cff7f0](https://github.com/googleapis/java-bigquery/commit/6cff7f0c2241223c529321e2b613f15c84ecbdcc)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.54.0 ([#3450](https://github.com/googleapis/java-bigquery/issues/3450)) ([cc9da95](https://github.com/googleapis/java-bigquery/commit/cc9da9576fa276afe069caff075c50e41e412ce1)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.34.0 ([#3433](https://github.com/googleapis/java-bigquery/issues/3433)) ([801f441](https://github.com/googleapis/java-bigquery/commit/801f44172f7be43e0649a116fb0bb556507fc572)) +* Update github/codeql-action action to v2.26.2 ([#3426](https://github.com/googleapis/java-bigquery/issues/3426)) ([0a6574f](https://github.com/googleapis/java-bigquery/commit/0a6574fa11aa83b5c899f1dcd3b1132aa4f46ebd)) +* Update github/codeql-action action to v2.26.3 ([#3438](https://github.com/googleapis/java-bigquery/issues/3438)) ([390e182](https://github.com/googleapis/java-bigquery/commit/390e1824bffef17e85d0ec142b4fcca6dff80a9c)) +* Update github/codeql-action action to v2.26.5 ([#3446](https://github.com/googleapis/java-bigquery/issues/3446)) ([58aacc5](https://github.com/googleapis/java-bigquery/commit/58aacc5a92e18b790a03c0b9b4a75062928768c2)) + + +### Documentation + +* Update iam policy sample user to be consistent with other languages ([#3429](https://github.com/googleapis/java-bigquery/issues/3429)) ([2fc15b3](https://github.com/googleapis/java-bigquery/commit/2fc15b3e9f89289f0a047bb0a6ae7fb5bb71d253)) + ## [2.42.0](https://github.com/googleapis/java-bigquery/compare/v2.41.0...v2.42.0) (2024-07-28) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e5aa6b8ef2..67a787c31a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.1-SNAPSHOT + 2.42.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index b268dd6478..a990c552e7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.1-SNAPSHOT + 2.42.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1-SNAPSHOT + 2.42.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 74de39e9b1..5a05da0914 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.1-SNAPSHOT + 2.42.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.1-SNAPSHOT + 2.42.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 52b90fa7e7..4ef47a0118 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.1-SNAPSHOT + 2.42.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1-SNAPSHOT + 2.42.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9334e0cb42..c172ebc2d8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1-SNAPSHOT + 2.42.1 diff --git a/versions.txt b/versions.txt index c1fafa3200..8baf376f31 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.0:2.42.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.42.1:2.42.1 \ No newline at end of file From f00977ccf60227bf1415795da5b6e0a208f21b2c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Aug 2024 16:00:44 +0200 Subject: [PATCH 1822/2268] deps: update actions/upload-artifact action to v4.3.5 (#3456) From e1c6e92813c739fcd861e0622413b74c638cb547 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Aug 2024 17:59:00 +0200 Subject: [PATCH 1823/2268] deps: update actions/upload-artifact action to v4.3.5 (#3462) From 95ac790f46cd063d45ce90cad49c8bdeef22f981 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 28 Aug 2024 20:46:49 +0200 Subject: [PATCH 1824/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.1 (#3461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.1 * 🦉 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 --- README.md | 10 +++++----- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 030bed3271..abd52c9d75 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1 ``` @@ -53,20 +53,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.44.0') +implementation platform('com.google.cloud:libraries-bom:26.45.0') implementation 'com.google.cloud:google-cloud-bigquery' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.42.0' +implementation 'com.google.cloud:google-cloud-bigquery:2.42.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.42.0" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.42.1" ``` @@ -352,7 +352,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.1 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d285e01cf8..55d2b7b480 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.42.0 + 2.42.1 From cd82235475310cacf1f607a412418be97c83559f Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:26:46 -0400 Subject: [PATCH 1825/2268] =?UTF-8?q?fix:=20executeSelect=20now=20use=20pr?= =?UTF-8?q?ovided=20credentials=20instead=20of=20GOOGLE=5FAPP=E2=80=A6=20(?= =?UTF-8?q?#3465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: executeSelect now use provided credentials instead of GOOGLE_APPLICATION_CREDENTIALS * 🦉 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 --- .../google/cloud/bigquery/ConnectionImpl.java | 9 +++- .../cloud/bigquery/it/ITBigQueryTest.java | 51 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 413243396e..1f08bf4eb5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -21,6 +21,7 @@ import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; +import com.google.api.gax.core.FixedCredentialsProvider; import com.google.api.services.bigquery.model.GetQueryResultsResponse; import com.google.api.services.bigquery.model.JobConfigurationQuery; import com.google.api.services.bigquery.model.QueryParameter; @@ -35,6 +36,7 @@ import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; import com.google.cloud.bigquery.storage.v1.ArrowSchema; import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; +import com.google.cloud.bigquery.storage.v1.BigQueryReadSettings; import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; import com.google.cloud.bigquery.storage.v1.DataFormat; import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; @@ -955,7 +957,12 @@ BigQueryResult highThroughPutRead( try { if (bqReadClient == null) { // if the read client isn't already initialized. Not thread safe. - bqReadClient = BigQueryReadClient.create(); + BigQueryReadSettings settings = + BigQueryReadSettings.newBuilder() + .setCredentialsProvider( + FixedCredentialsProvider.create(bigQueryOptions.getCredentials())) + .build(); + bqReadClient = BigQueryReadClient.create(settings); } String parent = String.format("projects/%s", destinationTable.getProject()); String srcTable = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 63265d58a3..9f07350949 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3249,6 +3249,57 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { assertEquals(42, bigQueryResult.getTotalRows()); } + @Test + public void testExecuteSelectWithCredentials() throws SQLException { + // This test validate that executeSelect uses the same credential provided by the BigQuery + // object used to create the Connection client. + // This is done the following scenarios: + // 1. Validate that setting a valid credential executes the query. + // 2. Validate that setting an invalid credential causes failure. + + // Scenario 1. + // Create a new bigQuery object but explicitly set the credentials. + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQueryOptions bigQueryOptions = + bigqueryHelper + .getOptions() + .toBuilder() + .setCredentials(bigquery.getOptions().getCredentials()) + .build(); + BigQuery bigQueryGoodCredentials = bigQueryOptions.getService(); + + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setJobTimeoutMs(10L) // Force non-fast query to use BigQueryReadClient. + .setDefaultDataset(DatasetId.of(DATASET)) + .build(); + Connection connectionGoodCredentials = + bigQueryGoodCredentials.createConnection(connectionSettings); + String query = + "SELECT * FROM " + + TABLE_ID_LARGE.getTable(); // Large query result is needed to use BigQueryReadClient. + BigQueryResult bigQueryResult = connectionGoodCredentials.executeSelect(query); + assertEquals(313348, bigQueryResult.getTotalRows()); + + // Scenario 2. + // Create a new bigQuery object but explicitly an invalid credential. + BigQueryOptions bigQueryOptionsBadCredentials = + bigqueryHelper + .getOptions() + .toBuilder() + .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_GOOGLE_DOMAIN)) + .build(); + BigQuery bigQueryBadCredentials = bigQueryOptionsBadCredentials.getService(); + Connection connectionBadCredentials = + bigQueryBadCredentials.createConnection(connectionSettings); + try { + connectionBadCredentials.executeSelect(query); + fail(); // this line should not be reached + } catch (BigQuerySQLException e) { + assertNotNull(e); + } + } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryTimeStamp() throws InterruptedException { From fd67f50edbf7c7dd2502fede503d337d99838cc7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:27:18 -0400 Subject: [PATCH 1826/2268] chore(main): release 2.42.2-SNAPSHOT (#3458) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 67a787c31a..20fa1f9f84 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.1 + 2.42.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index a990c552e7..dc197288ee 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.1 + 2.42.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5a05da0914..050ee9abc5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.1 + 2.42.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4ef47a0118..80c419b203 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.1 + 2.42.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c172ebc2d8..b434849cde 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8baf376f31..a4794d6a51 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.1:2.42.1 \ No newline at end of file +google-cloud-bigquery:2.42.1:2.42.2-SNAPSHOT \ No newline at end of file From 2aeb44d8b2ff5fa264cb14a8fc31e9494d77cb6b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 29 Aug 2024 22:29:12 +0200 Subject: [PATCH 1827/2268] deps: update github/codeql-action action to v2.26.6 (#3464) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f8bc8f3c3a..3a8c107df9 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e8b34a2aaa1d35eab0b758128337086bb22bc6bf # v2.26.5 + uses: github/codeql-action/upload-sarif@be8b74c09c1778bcdbea38e1a45efea2cb73e18c # v2.26.6 with: sarif_file: results.sarif From ba91227b972acb1d0796d5a9470ba790dfb8d5b0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 29 Aug 2024 22:50:22 +0200 Subject: [PATCH 1828/2268] deps: update actions/upload-artifact action to v4.3.6 (#3463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/upload-artifact action to v4.3.5 * 🦉 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 From e46454b28ad737905405f3ec94ccd89a8d2dfea7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:34:41 -0400 Subject: [PATCH 1829/2268] chore(main): release 2.42.2 (#3466) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9feeb72909..977d0fd386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.42.2](https://github.com/googleapis/java-bigquery/compare/v2.42.1...v2.42.2) (2024-08-29) + + +### Bug Fixes + +* ExecuteSelect now use provided credentials instead of GOOGLE_APP… ([#3465](https://github.com/googleapis/java-bigquery/issues/3465)) ([cd82235](https://github.com/googleapis/java-bigquery/commit/cd82235475310cacf1f607a412418be97c83559f)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.3.5 ([#3456](https://github.com/googleapis/java-bigquery/issues/3456)) ([f00977c](https://github.com/googleapis/java-bigquery/commit/f00977ccf60227bf1415795da5b6e0a208f21b2c)) +* Update actions/upload-artifact action to v4.3.5 ([#3462](https://github.com/googleapis/java-bigquery/issues/3462)) ([e1c6e92](https://github.com/googleapis/java-bigquery/commit/e1c6e92813c739fcd861e0622413b74c638cb547)) +* Update actions/upload-artifact action to v4.3.6 ([#3463](https://github.com/googleapis/java-bigquery/issues/3463)) ([ba91227](https://github.com/googleapis/java-bigquery/commit/ba91227b972acb1d0796d5a9470ba790dfb8d5b0)) +* Update github/codeql-action action to v2.26.6 ([#3464](https://github.com/googleapis/java-bigquery/issues/3464)) ([2aeb44d](https://github.com/googleapis/java-bigquery/commit/2aeb44d8b2ff5fa264cb14a8fc31e9494d77cb6b)) + ## [2.42.1](https://github.com/googleapis/java-bigquery/compare/v2.42.0...v2.42.1) (2024-08-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 20fa1f9f84..2a2c4822a1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.2-SNAPSHOT + 2.42.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index dc197288ee..d1cb43ce5e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.2-SNAPSHOT + 2.42.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2-SNAPSHOT + 2.42.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 050ee9abc5..6bdcea1563 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.2-SNAPSHOT + 2.42.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.2-SNAPSHOT + 2.42.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 80c419b203..c7e8820185 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.2-SNAPSHOT + 2.42.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2-SNAPSHOT + 2.42.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b434849cde..16454c42ae 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2-SNAPSHOT + 2.42.2 diff --git a/versions.txt b/versions.txt index a4794d6a51..c3a664ab6b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.1:2.42.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.42.2:2.42.2 \ No newline at end of file From 7acec7726684016a1d3949b22523053f6c16696d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:53:16 -0400 Subject: [PATCH 1830/2268] chore(main): release 2.42.3-SNAPSHOT (#3468) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2a2c4822a1..75d36852c1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.2 + 2.42.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index d1cb43ce5e..07d77a26d3 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.2 + 2.42.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2 + 2.42.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6bdcea1563..98624a69ca 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.2 + 2.42.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.2 + 2.42.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index c7e8820185..cf9247eb86 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.2 + 2.42.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2 + 2.42.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 16454c42ae..48c34d4526 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2 + 2.42.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index c3a664ab6b..151c1a8c4d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.2:2.42.2 \ No newline at end of file +google-cloud-bigquery:2.42.2:2.42.3-SNAPSHOT \ No newline at end of file From 08b28c510a2280119a03da3caa385ec31e0c944c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Sep 2024 20:32:11 +0200 Subject: [PATCH 1831/2268] deps: update actions/upload-artifact action to v4.4.0 (#3467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: update actions/upload-artifact action to v4.4.0 * 🦉 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 --- .github/workflows/scorecard.yml | 2 +- README.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3a8c107df9..fe9c5506fe 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: SARIF file path: results.sarif diff --git a/README.md b/README.md index abd52c9d75..f9d10e2862 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ implementation 'com.google.cloud:google-cloud-bigquery' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-bigquery:2.42.1' +implementation 'com.google.cloud:google-cloud-bigquery:2.42.2' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.42.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.42.2" ``` @@ -352,7 +352,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.1 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.2 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From d63107d69d8b4298e200f64e0fd4ccd33e3e0b63 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Sep 2024 13:54:46 +0200 Subject: [PATCH 1832/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.2 (#3469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.2 * 🦉 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 --- README.md | 2 +- samples/install-without-bom/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9d10e2862..42b0b9f7e4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2 ``` diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 55d2b7b480..16cee0a111 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.42.1 + 2.42.2 From fa9ac5d73ec4f21ab7d12949e413b4ee9d11aa6d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Sep 2024 18:38:42 +0200 Subject: [PATCH 1833/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.35.0 (#3472) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index dffbc2f701..afb216fe98 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.34.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.35.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 92ffa46f75..2cc9221ca0 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.34.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.35.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index c3ebb3c155..2148ec30e6 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.34.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.35.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index e7ddf639b5..ac21121c9a 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.34.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.35.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index e211e47fc6..85ab5c49b1 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.34.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.35.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 07d77a26d3..8cc3585919 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.34.0 + 3.35.0 diff --git a/pom.xml b/pom.xml index cf9247eb86..626c97afb0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.34.0 + 3.35.0 From a72603d15897bc36a73c40b2b4e9de7eaae170f4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Sep 2024 21:22:58 +0200 Subject: [PATCH 1834/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.9.1 (#3473) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 626c97afb0..037d2fa2ec 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.9.0 + 3.9.1 pom import From 8101e98b351eb8f89c0ec83a2b4b92b238d55a3d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:53:38 -0400 Subject: [PATCH 1835/2268] chore(main): release 2.42.3 (#3470) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 977d0fd386..68f8926166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.42.3](https://github.com/googleapis/java-bigquery/compare/v2.42.2...v2.42.3) (2024-09-12) + + +### Dependencies + +* Update actions/upload-artifact action to v4.4.0 ([#3467](https://github.com/googleapis/java-bigquery/issues/3467)) ([08b28c5](https://github.com/googleapis/java-bigquery/commit/08b28c510a2280119a03da3caa385ec31e0c944c)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.35.0 ([#3472](https://github.com/googleapis/java-bigquery/issues/3472)) ([fa9ac5d](https://github.com/googleapis/java-bigquery/commit/fa9ac5d73ec4f21ab7d12949e413b4ee9d11aa6d)) + ## [2.42.2](https://github.com/googleapis/java-bigquery/compare/v2.42.1...v2.42.2) (2024-08-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 75d36852c1..bb84ee9242 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.3-SNAPSHOT + 2.42.3 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8cc3585919..1ce80558e8 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.3-SNAPSHOT + 2.42.3 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3-SNAPSHOT + 2.42.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 98624a69ca..35c15c8d23 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.3-SNAPSHOT + 2.42.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.3-SNAPSHOT + 2.42.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 037d2fa2ec..e2cfe82786 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.3-SNAPSHOT + 2.42.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3-SNAPSHOT + 2.42.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 48c34d4526..1653ac85aa 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3-SNAPSHOT + 2.42.3 diff --git a/versions.txt b/versions.txt index 151c1a8c4d..608a669722 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.2:2.42.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.42.3:2.42.3 \ No newline at end of file From 83bd7e410dd089c31c1689a6e586533964da4972 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:19:36 -0400 Subject: [PATCH 1836/2268] chore(main): release 2.42.4-SNAPSHOT (#3477) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bb84ee9242..f72121d683 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.3 + 2.42.4-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 1ce80558e8..36c1f386d8 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.3 + 2.42.4-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3 + 2.42.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 35c15c8d23..38a28018e1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.3 + 2.42.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.3 + 2.42.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e2cfe82786..e066c9c582 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.3 + 2.42.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3 + 2.42.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1653ac85aa..5b62bd0f7e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3 + 2.42.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 608a669722..4e535f9d06 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.3:2.42.3 \ No newline at end of file +google-cloud-bigquery:2.42.3:2.42.4-SNAPSHOT \ No newline at end of file From 9a7dcaa34b80cebaec07056770202de17edbded0 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:51:31 +0000 Subject: [PATCH 1837/2268] chore: remove owlbot postprocessor check (#3475) --- .github/sync-repo-settings.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 2027cd1a0f..fc078dbe3f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -15,7 +15,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - javadoc - pattern: 1.127.12-sp isAdminEnforced: true @@ -61,7 +60,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - pattern: 2.10.x isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -76,7 +74,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - pattern: 2.19.x isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -91,7 +88,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - pattern: 2.35.x isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -105,7 +101,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - javadoc - pattern: 2.40.x isAdminEnforced: true @@ -120,7 +115,6 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor - javadoc permissionRules: - team: api-bigquery From 292f39534a8895705f85e936689051ee66903419 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:51:47 +0000 Subject: [PATCH 1838/2268] chore: disable owlbot (#3476) --- .github/.OwlBot.lock.yaml | 17 ------- .github/.OwlBot.yaml | 16 ------ .github/generated-files-bot.yml | 12 ----- codecov.yaml | 7 --- owlbot.py | 30 ----------- synth.metadata | 90 --------------------------------- 6 files changed, 172 deletions(-) delete mode 100644 .github/.OwlBot.lock.yaml delete mode 100644 .github/.OwlBot.yaml delete mode 100644 .github/generated-files-bot.yml delete mode 100644 codecov.yaml delete mode 100644 owlbot.py delete mode 100644 synth.metadata diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml deleted file mode 100644 index 359fe71c19..0000000000 --- a/.github/.OwlBot.lock.yaml +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:72f0d373307d128b2cb720c5cb4d90b31f0e86529dd138c632710ae0c69efae3 -# created: 2024-06-05T18:32:21.724930324Z diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml deleted file mode 100644 index 5d9a9d8b56..0000000000 --- a/.github/.OwlBot.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml deleted file mode 100644 index c644a24e11..0000000000 --- a/.github/generated-files-bot.yml +++ /dev/null @@ -1,12 +0,0 @@ -externalManifests: -- type: json - file: 'synth.metadata' - jsonpath: '$.generatedFiles[*]' -- type: json - file: '.github/readme/synth.metadata/synth.metadata' - jsonpath: '$.generatedFiles[*]' -ignoreAuthors: -- 'renovate-bot' -- 'yoshi-automation' -- 'release-please[bot]' -- 'gcf-owl-bot[bot]' diff --git a/codecov.yaml b/codecov.yaml deleted file mode 100644 index c00182958c..0000000000 --- a/codecov.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com -coverage: - round: down - range: "50...100" \ No newline at end of file diff --git a/owlbot.py b/owlbot.py deleted file mode 100644 index a2540ce52e..0000000000 --- a/owlbot.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool.languages.java as java - -java.common_templates(excludes=[ - '.kokoro/nightly/samples.cfg', - '.kokoro/nightly/integration.cfg', - '.kokoro/presubmit/samples.cfg', - '.kokoro/presubmit/graalvm-native.cfg', - '.kokoro/presubmit/graalvm-native-17.cfg', - 'codecov.yaml', - 'renovate.json', - '.kokoro/build.sh' - '.kokoro/requirements.in', - '.kokoro/requirements.txt' -]) \ No newline at end of file diff --git a/synth.metadata b/synth.metadata deleted file mode 100644 index db25ea1e36..0000000000 --- a/synth.metadata +++ /dev/null @@ -1,90 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/java-bigquery.git", - "sha": "611689c0bd72c789e7e1adf9451e8abfcd143983" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e" - } - } - ], - "generatedFiles": [ - ".github/CODEOWNERS", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/blunderbuss.yml", - ".github/generated-files-bot.yml", - ".github/release-please.yml", - ".github/release-trigger.yml", - ".github/snippet-bot.yml", - ".github/sync-repo-settings.yaml", - ".github/trusted-contribution.yml", - ".github/workflows/approve-readme.yaml", - ".github/workflows/auto-release.yaml", - ".github/workflows/ci.yaml", - ".github/workflows/samples.yaml", - ".kokoro/build.bat", - ".kokoro/build.sh", - ".kokoro/coerce_logs.sh", - ".kokoro/common.cfg", - ".kokoro/common.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/java8.cfg", - ".kokoro/nightly/common.cfg", - ".kokoro/nightly/integration.cfg", - ".kokoro/nightly/java11.cfg", - ".kokoro/nightly/java7.cfg", - ".kokoro/nightly/java8-osx.cfg", - ".kokoro/nightly/java8-win.cfg", - ".kokoro/nightly/java8.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/clirr.cfg", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/dependencies.cfg", - ".kokoro/presubmit/integration.cfg", - ".kokoro/presubmit/java11.cfg", - ".kokoro/presubmit/java7.cfg", - ".kokoro/presubmit/java8-osx.cfg", - ".kokoro/presubmit/java8-win.cfg", - ".kokoro/presubmit/java8.cfg", - ".kokoro/presubmit/linkage-monitor.cfg", - ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", - ".kokoro/readme.sh", - ".kokoro/release/bump_snapshot.cfg", - ".kokoro/release/common.cfg", - ".kokoro/release/common.sh", - ".kokoro/release/drop.cfg", - ".kokoro/release/drop.sh", - ".kokoro/release/promote.cfg", - ".kokoro/release/promote.sh", - ".kokoro/release/publish_javadoc.cfg", - ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/publish_javadoc11.cfg", - ".kokoro/release/publish_javadoc11.sh", - ".kokoro/release/snapshot.cfg", - ".kokoro/release/snapshot.sh", - ".kokoro/release/stage.cfg", - ".kokoro/release/stage.sh", - ".kokoro/trampoline.sh", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "SECURITY.md", - "java.header", - "license-checks.xml", - "samples/install-without-bom/pom.xml", - "samples/pom.xml", - "samples/snapshot/pom.xml", - "samples/snippets/pom.xml" - ] -} \ No newline at end of file From d423dc0f731e09eec5eb964019d15d84029ee210 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Sep 2024 21:17:50 +0200 Subject: [PATCH 1839/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.51.0 (#3479) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e066c9c582..a6523d233f 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.50.0 + 2.51.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 16cee0a111..052a4841f6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.50.0 + 2.51.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5b62bd0f7e..60f160b1b5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.50.0 + 2.51.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c4c72ca905..04a499ab92 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.50.0 + 2.51.0 test From 6e6ee91b626766d172b511bd962c7ede11242716 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Sep 2024 21:38:14 +0200 Subject: [PATCH 1840/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.3 (#3478) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 052a4841f6..a82b15a637 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.42.2 + 2.42.3 From 8908cfd82332d09997a5538113fbe8e382f52c4a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Sep 2024 21:38:29 +0200 Subject: [PATCH 1841/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.55.0 (#3481) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a6523d233f..a8fa231540 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.54.0 + 1.55.0 pom import From a6508a29f81b6729e41e827096e90f1d1bf07f4d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Sep 2024 21:39:24 +0200 Subject: [PATCH 1842/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240905-2.0.0 (#3483) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8fa231540..2eea36e9fc 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240815-2.0.0 + v2-rev20240905-2.0.0 From e2c94b601781ebe236c25cd3f40059e7543ba387 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Sep 2024 21:55:59 +0200 Subject: [PATCH 1843/2268] deps: update github/codeql-action action to v2.26.7 (#3482) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index fe9c5506fe..d5d39e6735 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@be8b74c09c1778bcdbea38e1a45efea2cb73e18c # v2.26.6 + uses: github/codeql-action/upload-sarif@2fe1a3da42c8b4f96ced91264bda7407d8c65539 # v2.26.7 with: sarif_file: results.sarif From a54329cae956635b5818ea61f1ef96d1f446f681 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Sep 2024 19:53:50 +0200 Subject: [PATCH 1844/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.44.0 (#3485) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a82b15a637..d0796dd0cb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.43.0 + 2.44.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 60f160b1b5..df13e79d49 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.43.0 + 2.44.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 04a499ab92..153bbfba10 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.43.0 + 2.44.0 test From 986b036a022c8f68db59dd9d5944f3b724777533 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Sep 2024 19:54:30 +0200 Subject: [PATCH 1845/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.51.0 (#3480) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2eea36e9fc..8a0439d29f 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.50.0 + 2.51.0 test From bb2cd471fda5a2218580c41839c09edc5fa6b483 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Sep 2024 19:54:52 +0200 Subject: [PATCH 1846/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.43.0 (#3486) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8a0439d29f..bbe7ebcdd4 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.42.0 + 2.43.0 test From a6d75de60b822dcc5433afab55b5d392e6a6caf5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Sep 2024 17:16:42 +0200 Subject: [PATCH 1847/2268] deps: update github/codeql-action action to v2.26.8 (#3488) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d5d39e6735..9e127de398 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@2fe1a3da42c8b4f96ced91264bda7407d8c65539 # v2.26.7 + uses: github/codeql-action/upload-sarif@422b177bb3935638109d3175d95e4dbf97066060 # v2.26.8 with: sarif_file: results.sarif From a72c5825c93f359d295fb78e0e541752f535876b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 23 Sep 2024 22:02:23 +0200 Subject: [PATCH 1848/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.36.0 (#3490) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index afb216fe98..de55aece77 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.35.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 2cc9221ca0..e265be4865 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.35.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 2148ec30e6..672b4e5e6f 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.35.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index ac21121c9a..64ece72e51 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.35.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 85ab5c49b1..bf7743f744 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.35.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 36c1f386d8..52515bd428 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.35.0 + 3.36.0 diff --git a/pom.xml b/pom.xml index bbe7ebcdd4..e9e30a1ca9 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.35.0 + 3.36.0 From 2dc1956f4159952b676ad6063eedfa2829218aa6 Mon Sep 17 00:00:00 2001 From: shollyman Date: Tue, 24 Sep 2024 10:34:39 -0700 Subject: [PATCH 1849/2268] testing: ignore testExecuteSelectWithCredentials (#3493) * testing: ignore flaky test for the time being Related: https://github.com/googleapis/java-bigquery/issues/3471 --- .../test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9f07350949..509933c7e5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -191,6 +191,7 @@ import java.util.logging.Logger; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; @@ -3250,6 +3251,7 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { } @Test + @Ignore("https://github.com/googleapis/java-bigquery/issues/3471") public void testExecuteSelectWithCredentials() throws SQLException { // This test validate that executeSelect uses the same credential provided by the BigQuery // object used to create the Connection client. From 815404319a43a8a14d1d8aaa8ab22dd924b48175 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Sep 2024 17:29:03 +0200 Subject: [PATCH 1850/2268] deps: update github/codeql-action action to v2.26.9 (#3494) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9e127de398..ee3717445f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@422b177bb3935638109d3175d95e4dbf97066060 # v2.26.8 + uses: github/codeql-action/upload-sarif@d97ba04b39135f37e9d60c84a6995bb18b7ac328 # v2.26.9 with: sarif_file: results.sarif From 8f2e5c542760ecd7c217c36c80cb3b5aebee6a73 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Sep 2024 16:40:23 +0200 Subject: [PATCH 1851/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.36.1 (#3496) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index de55aece77..ed67dafd7d 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index e265be4865..2c30e6a610 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 672b4e5e6f..a916f44475 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 64ece72e51..bd1939de4f 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index bf7743f744..96a8059b9b 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 52515bd428..8a7365f77e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.36.0 + 3.36.1 diff --git a/pom.xml b/pom.xml index e9e30a1ca9..71687d6a5b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.36.0 + 3.36.1 From 4930093a6de17db2cf32d15d81515056f3cf194d Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 26 Sep 2024 16:08:29 -0400 Subject: [PATCH 1852/2268] test: fix flaky IT testExecuteSelectWithCredentials (#3497) Use priority instead of job timeout to force non-fast query in executeSelect. --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 509933c7e5..15fe5eb8cf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -109,6 +109,7 @@ import com.google.cloud.bigquery.PolicyTags; import com.google.cloud.bigquery.PrimaryKey; import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.Priority; import com.google.cloud.bigquery.QueryParameterValue; import com.google.cloud.bigquery.Range; import com.google.cloud.bigquery.RangePartitioning; @@ -191,7 +192,6 @@ import java.util.logging.Logger; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; @@ -3251,7 +3251,6 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { } @Test - @Ignore("https://github.com/googleapis/java-bigquery/issues/3471") public void testExecuteSelectWithCredentials() throws SQLException { // This test validate that executeSelect uses the same credential provided by the BigQuery // object used to create the Connection client. @@ -3272,7 +3271,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() - .setJobTimeoutMs(10L) // Force non-fast query to use BigQueryReadClient. + .setPriority(Priority.INTERACTIVE) // Force non-fast query to use BigQueryReadClient. .setDefaultDataset(DatasetId.of(DATASET)) .build(); Connection connectionGoodCredentials = From b57fefbdfee7b8dacdb12502d1df72af21323b51 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Sep 2024 22:28:28 +0200 Subject: [PATCH 1853/2268] deps: update actions/checkout action to v4.2.0 (#3495) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index ee3717445f..b8e4469d88 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: persist-credentials: false From 4f87adec6c010b572675f98b651f88d14323e2e2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 27 Sep 2024 15:02:04 +0200 Subject: [PATCH 1854/2268] deps: update dependency ubuntu to v24 (#3498) --- .github/workflows/renovate_config_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml index 7c5ec7865e..36da117bc7 100644 --- a/.github/workflows/renovate_config_check.yaml +++ b/.github/workflows/renovate_config_check.yaml @@ -7,7 +7,7 @@ on: jobs: renovate_bot_config_validation: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout code From ca712948b1adfb26bb1f9ef2250be10fe45d3424 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:27:57 +0200 Subject: [PATCH 1855/2268] deps: update github/codeql-action action to v2.26.10 (#3506) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b8e4469d88..1b947e7e21 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d97ba04b39135f37e9d60c84a6995bb18b7ac328 # v2.26.9 + uses: github/codeql-action/upload-sarif@85b07cf1e13dd512be7c27c37a33c5864c252fcc # v2.26.10 with: sarif_file: results.sarif From 40768cd85067e7e1eaa9ee7f6412f41ae7ecc771 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:28:13 +0200 Subject: [PATCH 1856/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.43.1 (#3500) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 71687d6a5b..0539a75f4d 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.43.0 + 2.43.1 test From ba1ae3f58939341bff553921462cde5427120695 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:28:39 +0200 Subject: [PATCH 1857/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.44.1 (#3502) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d0796dd0cb..17d38604cc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.44.0 + 2.44.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index df13e79d49..6d145a19fd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.44.0 + 2.44.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 153bbfba10..558f3cb3f6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.44.0 + 2.44.1 test From 5ce8c7cd8dd4ebcf88495470557d164b55f23b77 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:29:28 +0200 Subject: [PATCH 1858/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.53.0 (#3503) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0539a75f4d..db17f55c05 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.51.0 + 2.53.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 17d38604cc..8d3d0e4d5d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.51.0 + 2.53.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6d145a19fd..1c1fd01b1c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.51.0 + 2.53.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 558f3cb3f6..a0ea893ac5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.51.0 + 2.53.0 test From 57ce9018448ebf4f09d3ecf9760054ebd117bc36 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:29:39 +0200 Subject: [PATCH 1859/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.53.0 (#3504) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db17f55c05..910254d456 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.51.0 + 2.53.0 test From 6e78f56d17bb0d30b361220c86b1c66f21e9bd48 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 18:29:50 +0200 Subject: [PATCH 1860/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.57.0 (#3505) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 910254d456..80a899ad2a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.55.0 + 1.57.0 pom import From f24b9596f68b450942eb2ff661d8f4f1dc73f045 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 30 Sep 2024 22:08:27 +0200 Subject: [PATCH 1861/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.9.2 (#3507) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 80a899ad2a..faabfb08d7 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.9.1 + 3.9.2 pom import From a60d02513843fb9493ad1830a8b97789d7b5978c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:47:39 -0400 Subject: [PATCH 1862/2268] chore(main): release 2.42.4 (#3484) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f8926166..6215a14654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.42.4](https://github.com/googleapis/java-bigquery/compare/v2.42.3...v2.42.4) (2024-09-30) + + +### Dependencies + +* Update actions/checkout action to v4.2.0 ([#3495](https://github.com/googleapis/java-bigquery/issues/3495)) ([b57fefb](https://github.com/googleapis/java-bigquery/commit/b57fefbdfee7b8dacdb12502d1df72af21323b51)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.51.0 ([#3480](https://github.com/googleapis/java-bigquery/issues/3480)) ([986b036](https://github.com/googleapis/java-bigquery/commit/986b036a022c8f68db59dd9d5944f3b724777533)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.53.0 ([#3504](https://github.com/googleapis/java-bigquery/issues/3504)) ([57ce901](https://github.com/googleapis/java-bigquery/commit/57ce9018448ebf4f09d3ecf9760054ebd117bc36)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240905-2.0.0 ([#3483](https://github.com/googleapis/java-bigquery/issues/3483)) ([a6508a2](https://github.com/googleapis/java-bigquery/commit/a6508a29f81b6729e41e827096e90f1d1bf07f4d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.55.0 ([#3481](https://github.com/googleapis/java-bigquery/issues/3481)) ([8908cfd](https://github.com/googleapis/java-bigquery/commit/8908cfd82332d09997a5538113fbe8e382f52c4a)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.57.0 ([#3505](https://github.com/googleapis/java-bigquery/issues/3505)) ([6e78f56](https://github.com/googleapis/java-bigquery/commit/6e78f56d17bb0d30b361220c86b1c66f21e9bd48)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.0 ([#3490](https://github.com/googleapis/java-bigquery/issues/3490)) ([a72c582](https://github.com/googleapis/java-bigquery/commit/a72c5825c93f359d295fb78e0e541752f535876b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.1 ([#3496](https://github.com/googleapis/java-bigquery/issues/3496)) ([8f2e5c5](https://github.com/googleapis/java-bigquery/commit/8f2e5c542760ecd7c217c36c80cb3b5aebee6a73)) +* Update dependency ubuntu to v24 ([#3498](https://github.com/googleapis/java-bigquery/issues/3498)) ([4f87ade](https://github.com/googleapis/java-bigquery/commit/4f87adec6c010b572675f98b651f88d14323e2e2)) +* Update github/codeql-action action to v2.26.10 ([#3506](https://github.com/googleapis/java-bigquery/issues/3506)) ([ca71294](https://github.com/googleapis/java-bigquery/commit/ca712948b1adfb26bb1f9ef2250be10fe45d3424)) +* Update github/codeql-action action to v2.26.7 ([#3482](https://github.com/googleapis/java-bigquery/issues/3482)) ([e2c94b6](https://github.com/googleapis/java-bigquery/commit/e2c94b601781ebe236c25cd3f40059e7543ba387)) +* Update github/codeql-action action to v2.26.8 ([#3488](https://github.com/googleapis/java-bigquery/issues/3488)) ([a6d75de](https://github.com/googleapis/java-bigquery/commit/a6d75de60b822dcc5433afab55b5d392e6a6caf5)) +* Update github/codeql-action action to v2.26.9 ([#3494](https://github.com/googleapis/java-bigquery/issues/3494)) ([8154043](https://github.com/googleapis/java-bigquery/commit/815404319a43a8a14d1d8aaa8ab22dd924b48175)) + ## [2.42.3](https://github.com/googleapis/java-bigquery/compare/v2.42.2...v2.42.3) (2024-09-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index f72121d683..4d0539e0d1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.4-SNAPSHOT + 2.42.4 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8a7365f77e..a4bba7434e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.4-SNAPSHOT + 2.42.4 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4-SNAPSHOT + 2.42.4 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 38a28018e1..7d3a4ddc0c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.4-SNAPSHOT + 2.42.4 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.4-SNAPSHOT + 2.42.4 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index faabfb08d7..53e4b5b9a3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.4-SNAPSHOT + 2.42.4 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4-SNAPSHOT + 2.42.4 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1c1fd01b1c..be36735e93 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4-SNAPSHOT + 2.42.4 diff --git a/versions.txt b/versions.txt index 4e535f9d06..5ab44bc138 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.3:2.42.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.42.4:2.42.4 \ No newline at end of file From 4153057158169c37b7b9c5721c69f634c94f485c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 1 Oct 2024 16:02:35 +0200 Subject: [PATCH 1863/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.42.4 (#3509) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 8d3d0e4d5d..2b950de1a2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.42.3 + 2.42.4 From f1ebd5be5877a68f76efafc30e3b5b0763f343c5 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:58:34 -0400 Subject: [PATCH 1864/2268] feat: add max staleness to ExternalTableDefinition (#3499) * feat: add max staleness TODO: Remove the manual testing anchors * test: add max staleness to ExternalTableDefinition * Format fix * Remove unintentional changes --- .../bigquery/ExternalTableDefinition.java | 36 +++++++++++++++++++ .../bigquery/ExternalTableDefinitionTest.java | 4 ++- .../cloud/bigquery/it/ITBigQueryTest.java | 6 +++- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 363f9507e1..5af3085e20 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -200,6 +200,20 @@ public Builder setMetadataCacheMode(String metadataCacheMode) { abstract Builder setMetadataCacheModeInner(String metadataCacheMode); + /** + * [Optional] Metadata Cache Mode for the table. Set this to enable caching of metadata from + * external data source. + * + * @see + * MaxStaleness + */ + public Builder setMaxStaleness(String maxStaleness) { + return setMaxStalenessInner(maxStaleness); + } + + abstract Builder setMaxStalenessInner(String maxStaleness); + /** Creates an {@code ExternalTableDefinition} object. */ @Override public abstract ExternalTableDefinition build(); @@ -305,6 +319,22 @@ public String getMetadataCacheMode() { @Nullable abstract String getMetadataCacheModeInner(); + /** + * Returns the maximum staleness of data that could be returned when the table is queried. + * Staleness encoded as a string encoding of sql IntervalValue type. + * + * @see + * MaxStaleness + */ + @Nullable + public String getMaxStaleness() { + return getMaxStalenessInner(); + } + + @Nullable + abstract String getMaxStalenessInner(); + /** * Returns the source format, and possibly some parsing options, of the external data. Supported * formats are {@code CSV} and {@code NEWLINE_DELIMITED_JSON}. @@ -351,6 +381,9 @@ public HivePartitioningOptions getHivePartitioningOptions() { com.google.api.services.bigquery.model.Table toPb() { Table tablePb = super.toPb(); tablePb.setExternalDataConfiguration(toExternalDataConfigurationPb()); + if (getMaxStaleness() != null) { + tablePb.setMaxStaleness(getMaxStaleness()); + } return tablePb; } @@ -616,6 +649,9 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (externalDataConfiguration.getMetadataCacheMode() != null) { builder.setMetadataCacheMode(externalDataConfiguration.getMetadataCacheMode()); } + if (tablePb.getMaxStaleness() != null) { + builder.setMaxStaleness(tablePb.getMaxStaleness()); + } } return builder.build(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 2562e1763c..e6e7e0fcc6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -59,8 +59,8 @@ public class ExternalTableDefinitionTest { .setSourceUriPrefix(SOURCE_URIS.get(0)) .build(); private static final String OBJECT_METADATA = "SIMPLE"; - private static final String METADATA_CACHE_MODE = "AUTOMATIC"; + private static final String MAX_STALENESS = "INTERVAL 15 MINUTE"; private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") @@ -73,6 +73,7 @@ public class ExternalTableDefinitionTest { .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) .setObjectMetadata(OBJECT_METADATA) .setMetadataCacheMode(METADATA_CACHE_MODE) + .setMaxStaleness(MAX_STALENESS) .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = @@ -174,5 +175,6 @@ private void compareExternalTableDefinition( assertEquals(expected.getHivePartitioningOptions(), value.getHivePartitioningOptions()); assertEquals(expected.getObjectMetadata(), value.getObjectMetadata()); assertEquals(expected.getMetadataCacheMode(), value.getMetadataCacheMode()); + assertEquals(expected.getMaxStaleness(), value.getMaxStaleness()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 15fe5eb8cf..b1cb8d8451 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2111,9 +2111,13 @@ public void testCreateAndGetTableWithSelectedField() { public void testCreateExternalTable() throws InterruptedException { String tableName = "test_create_external_table"; TableId tableId = TableId.of(DATASET, tableName); + ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.of( - "gs://" + BUCKET + "/" + JSON_LOAD_FILE, TABLE_SCHEMA, FormatOptions.json()); + "gs://" + BUCKET + "/" + JSON_LOAD_FILE, TABLE_SCHEMA, FormatOptions.json()) + .toBuilder() + .setMaxStaleness("INTERVAL 15 MINUTE") + .build(); TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); Table createdTable = bigquery.create(tableInfo); assertNotNull(createdTable); From 69e70b08cc2e60dfd53e91c49d0644364f0f69f3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:02:32 -0400 Subject: [PATCH 1865/2268] chore(main): release 2.42.5-SNAPSHOT (#3508) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4d0539e0d1..d010c39516 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.4 + 2.42.5-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index a4bba7434e..06a45b1a70 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.4 + 2.42.5-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4 + 2.42.5-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 7d3a4ddc0c..66da2ad6a4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.4 + 2.42.5-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.4 + 2.42.5-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 53e4b5b9a3..e85182edd9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.4 + 2.42.5-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4 + 2.42.5-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index be36735e93..063d739e45 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4 + 2.42.5-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5ab44bc138..021718836f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.4:2.42.4 \ No newline at end of file +google-cloud-bigquery:2.42.4:2.42.5-SNAPSHOT \ No newline at end of file From 5344e9bdd09f91236d54b2d54729e21e37d519e3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:26:58 -0400 Subject: [PATCH 1866/2268] chore(main): release 2.43.0 (#3511) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6215a14654..fb2cbc21b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.43.0](https://github.com/googleapis/java-bigquery/compare/v2.42.4...v2.43.0) (2024-10-01) + + +### Features + +* Add max staleness to ExternalTableDefinition ([#3499](https://github.com/googleapis/java-bigquery/issues/3499)) ([f1ebd5b](https://github.com/googleapis/java-bigquery/commit/f1ebd5be5877a68f76efafc30e3b5b0763f343c5)) + ## [2.42.4](https://github.com/googleapis/java-bigquery/compare/v2.42.3...v2.42.4) (2024-09-30) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d010c39516..ee61a32033 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.42.5-SNAPSHOT + 2.43.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 06a45b1a70..51f0dd1c6d 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.42.5-SNAPSHOT + 2.43.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.42.5-SNAPSHOT + 2.43.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 66da2ad6a4..6425692d9d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.42.5-SNAPSHOT + 2.43.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.42.5-SNAPSHOT + 2.43.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e85182edd9..1caff5398e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.42.5-SNAPSHOT + 2.43.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.42.5-SNAPSHOT + 2.43.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 063d739e45..14e69ed837 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.42.5-SNAPSHOT + 2.43.0 diff --git a/versions.txt b/versions.txt index 021718836f..4f2cdbe2ac 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.42.4:2.42.5-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.43.0:2.43.0 \ No newline at end of file From dd087e8491fd7343071c3a814ca1ae70d0efa232 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:56:54 -0400 Subject: [PATCH 1867/2268] build: update samples/stylecheck to use java 11 to match new style guide as indicated in: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md#java-version (#3516) This fixes the samples/stylecheck in PR#3487 --- .github/workflows/samples.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index 03b2939567..f833b80225 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 8 + java-version: 11 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check working-directory: samples/snippets From 447e0139c2812d12d9c74484faf66febe824040e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 3 Oct 2024 20:00:59 +0200 Subject: [PATCH 1868/2268] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.2.2 (#3487) --- samples/install-without-bom/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2b950de1a2..374a28e1d6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.2.2 diff --git a/samples/pom.xml b/samples/pom.xml index b0ed2cf7ba..d493a5953d 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -34,7 +34,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.2.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 14e69ed837..9c91678836 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -30,7 +30,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.2.2 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a0ea893ac5..ca9df4b67e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -29,7 +29,7 @@ com.google.cloud.samples shared-configuration - 1.2.0 + 1.2.2 From b6b1baff30cbe78988594d98c4af3485e7d1b64c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:18:31 -0400 Subject: [PATCH 1869/2268] chore(main): release 2.43.1-SNAPSHOT (#3512) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ee61a32033..eb5a15e1b0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.0 + 2.43.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 51f0dd1c6d..94238c55fe 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.0 + 2.43.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.0 + 2.43.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6425692d9d..6903f11ab5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.0 + 2.43.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.0 + 2.43.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1caff5398e..7ee6f8b718 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.0 + 2.43.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.0 + 2.43.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9c91678836..77d12837e2 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.0 + 2.43.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 4f2cdbe2ac..d75ed7e234 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.0:2.43.0 \ No newline at end of file +google-cloud-bigquery:2.43.0:2.43.1-SNAPSHOT \ No newline at end of file From 9fe382927ff4718252e22ac20c4e012f490e6b0e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Oct 2024 17:19:23 +0200 Subject: [PATCH 1870/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20240919-2.0.0 (#3514) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7ee6f8b718..8e20db07db 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240905-2.0.0 + v2-rev20240919-2.0.0 From c04a83d0ad6ed5be4b6f2623efbb8c94d3335edb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Oct 2024 17:21:42 +0200 Subject: [PATCH 1871/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.45.0 (#3515) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 374a28e1d6..ce65338db7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.44.1 + 2.45.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 77d12837e2..299443fb3c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.44.1 + 2.45.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ca9df4b67e..97033ca329 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.44.1 + 2.45.0 test From ac736bb50bf4b2e629dcbfe7de90b846e07038e4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Oct 2024 17:22:06 +0200 Subject: [PATCH 1872/2268] deps: update github/codeql-action action to v2.26.11 (#3517) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1b947e7e21..33899812d3 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@85b07cf1e13dd512be7c27c37a33c5864c252fcc # v2.26.10 + uses: github/codeql-action/upload-sarif@430e27ef200cf61455a15dd5b56e130c8227a563 # v2.26.11 with: sarif_file: results.sarif From 1f3da80dbfac58c7189aad3fe03b0476b5ce1da9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 7 Oct 2024 20:05:10 +0200 Subject: [PATCH 1873/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.43.0 (#3513) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ce65338db7..80ebad0046 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.42.4 + 2.43.0 From fdf8dc4b7cb4e26939da10002e47c810d71bad6c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Oct 2024 16:53:49 +0200 Subject: [PATCH 1874/2268] deps: update github/codeql-action action to v2.26.12 (#3522) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 33899812d3..fdff8726e7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@430e27ef200cf61455a15dd5b56e130c8227a563 # v2.26.11 + uses: github/codeql-action/upload-sarif@4d85deb8548d03be541760228f3fe9e6a4d5d27d # v2.26.12 with: sarif_file: results.sarif From ad8175af06d5308a9366f8109055d61c115a4852 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Oct 2024 17:05:43 +0200 Subject: [PATCH 1875/2268] deps: update actions/checkout action to v4.2.1 (#3520) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index fdff8726e7..3fa2672091 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: persist-credentials: false From dc21975cc6f3597d8f789f12a58feaa5b9b94da0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 8 Oct 2024 17:06:33 +0200 Subject: [PATCH 1876/2268] deps: update actions/upload-artifact action to v4.4.1 (#3521) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3fa2672091..eea48d1a6e 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1 with: name: SARIF file path: results.sarif From bf4d37a15f13ada3cf0045b2d45355193d2c2f34 Mon Sep 17 00:00:00 2001 From: Min Zhu Date: Tue, 8 Oct 2024 20:41:06 -0400 Subject: [PATCH 1877/2268] chore(deps): update dependency sdk-platform-java-config and google-cloud-bigquery-bom (#3525) * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.9.3 * deps: update dependency com.google.cloud:sdk-platform-java-config to v3.37.0 --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ed67dafd7d..ef7f25f5e6 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.36.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.37.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 2c30e6a610..0b98d0a81d 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.37.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index a916f44475..c468a59f76 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.37.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index bd1939de4f..9d44e53042 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.36.1"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.37.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 96a8059b9b..e6553bd6e4 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.37.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 94238c55fe..911be95219 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.36.1 + 3.37.0 diff --git a/pom.xml b/pom.xml index 8e20db07db..2553bb9405 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.36.1 + 3.37.0 @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.9.2 + 3.9.3 pom import From a86202f654a63064ddadaee03e16cbe971271873 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:14:28 -0400 Subject: [PATCH 1878/2268] chore(main): release 2.43.1 (#3519) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2cbc21b8..aaf9551fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.43.1](https://github.com/googleapis/java-bigquery/compare/v2.43.0...v2.43.1) (2024-10-09) + + +### Dependencies + +* Update actions/checkout action to v4.2.1 ([#3520](https://github.com/googleapis/java-bigquery/issues/3520)) ([ad8175a](https://github.com/googleapis/java-bigquery/commit/ad8175af06d5308a9366f8109055d61c115a4852)) +* Update actions/upload-artifact action to v4.4.1 ([#3521](https://github.com/googleapis/java-bigquery/issues/3521)) ([dc21975](https://github.com/googleapis/java-bigquery/commit/dc21975cc6f3597d8f789f12a58feaa5b9b94da0)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20240919-2.0.0 ([#3514](https://github.com/googleapis/java-bigquery/issues/3514)) ([9fe3829](https://github.com/googleapis/java-bigquery/commit/9fe382927ff4718252e22ac20c4e012f490e6b0e)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.37.0 ([bf4d37a](https://github.com/googleapis/java-bigquery/commit/bf4d37a15f13ada3cf0045b2d45355193d2c2f34)) +* Update github/codeql-action action to v2.26.11 ([#3517](https://github.com/googleapis/java-bigquery/issues/3517)) ([ac736bb](https://github.com/googleapis/java-bigquery/commit/ac736bb50bf4b2e629dcbfe7de90b846e07038e4)) +* Update github/codeql-action action to v2.26.12 ([#3522](https://github.com/googleapis/java-bigquery/issues/3522)) ([fdf8dc4](https://github.com/googleapis/java-bigquery/commit/fdf8dc4b7cb4e26939da10002e47c810d71bad6c)) + ## [2.43.0](https://github.com/googleapis/java-bigquery/compare/v2.42.4...v2.43.0) (2024-10-01) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index eb5a15e1b0..080adb3e29 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.1-SNAPSHOT + 2.43.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 911be95219..33fef70f23 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.1-SNAPSHOT + 2.43.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1-SNAPSHOT + 2.43.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6903f11ab5..b394562813 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.1-SNAPSHOT + 2.43.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.1-SNAPSHOT + 2.43.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2553bb9405..45acaae346 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.1-SNAPSHOT + 2.43.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1-SNAPSHOT + 2.43.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 299443fb3c..2a0bd1db27 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1-SNAPSHOT + 2.43.1 diff --git a/versions.txt b/versions.txt index d75ed7e234..3a4efcace5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.0:2.43.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.43.1:2.43.1 \ No newline at end of file From bff393c4463ccccff6a2cd05385fc74150c1864c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Oct 2024 15:27:50 +0200 Subject: [PATCH 1879/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.43.2 (#3526) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 45acaae346..02529ba0a9 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.43.1 + 2.43.2 test From 776a5541cc94e8ffb1f5e5c6969ae06585571b45 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Oct 2024 15:55:54 +0200 Subject: [PATCH 1880/2268] deps: update actions/upload-artifact action to v4.4.2 (#3524) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index eea48d1a6e..725beb86ff 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1 + uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 with: name: SARIF file path: results.sarif From d95d0a4267be258378dac944a2472cfc14f3a517 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Oct 2024 15:57:56 +0200 Subject: [PATCH 1881/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.43.1 (#3528) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 80ebad0046..3b733b41db 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.43.0 + 2.43.1 From 98694ea4aec57b9c1317da1b42703cb4e175086f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:44:35 -0400 Subject: [PATCH 1882/2268] chore(main): release 2.43.2-SNAPSHOT (#3527) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 080adb3e29..2d1239ead1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.1 + 2.43.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 33fef70f23..32d22c8b4c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.1 + 2.43.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1 + 2.43.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b394562813..845a34a39d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.1 + 2.43.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.1 + 2.43.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 02529ba0a9..3823f9458e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.1 + 2.43.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1 + 2.43.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2a0bd1db27..00ea151e9b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1 + 2.43.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 3a4efcace5..c189d4ed94 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.1:2.43.1 \ No newline at end of file +google-cloud-bigquery:2.43.1:2.43.2-SNAPSHOT \ No newline at end of file From 25be311c1477db0993a5825a2b839a295170790f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Oct 2024 17:16:46 +0200 Subject: [PATCH 1883/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.54.0 (#3532) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3823f9458e..86570700a1 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.53.0 + 2.54.0 test From 2f87fd9d777175cb5a8e5b0dc55f07546351e504 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Oct 2024 17:17:56 +0200 Subject: [PATCH 1884/2268] deps: update actions/upload-artifact action to v4.4.3 (#3530) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 725beb86ff..8872597ec7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: SARIF file path: results.sarif From cad26430f21a37eec2b87ea417f0cf67dcf9c97a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Oct 2024 17:18:42 +0200 Subject: [PATCH 1885/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.58.0 (#3533) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86570700a1..33236b670e 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.57.0 + 1.58.0 pom import From c0d2056d1f13998332146ea2fc0fecb2ce3122f0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 11 Oct 2024 19:03:12 +0200 Subject: [PATCH 1886/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.54.0 (#3531) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 33236b670e..6cf78489db 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.53.0 + 2.54.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3b733b41db..fe9ea02b02 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.53.0 + 2.54.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 00ea151e9b..0ee2b245ee 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.53.0 + 2.54.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 97033ca329..4c4308c57a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.53.0 + 2.54.0 test From 844744f3dea804a31abc806592f557a26cffbab4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 15 Oct 2024 16:19:03 +0200 Subject: [PATCH 1887/2268] deps: update github/codeql-action action to v2.26.13 (#3536) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8872597ec7..7d2892a2f3 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4d85deb8548d03be541760228f3fe9e6a4d5d27d # v2.26.12 + uses: github/codeql-action/upload-sarif@083cd45dc7d463f048a5d0975943f0e19e9c9378 # v2.26.13 with: sarif_file: results.sarif From e78e78cba7769a55b3e5937cf6a5a84f5259d116 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 15 Oct 2024 17:07:31 +0200 Subject: [PATCH 1888/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.45.1 (#3535) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fe9ea02b02..667606a0a4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0ee2b245ee..7f45a7209f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 4c4308c57a..68190cb051 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.45.0 + 2.45.1 test From 903a0f7db0926f3d166eebada1710413056fb4a2 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:03:27 -0400 Subject: [PATCH 1889/2268] docs: Update SimpleApp to explicitly set project id (#3534) * docs: Update SimpleApp to explicitly set project id When running in Google Cloud console, the default google cloud project might not be set leading to 404 errors. This update requires the reader to explicitly set the project value. * Removes the explicit use of UUID to set jobId as the library now internally generates the value. * Fix missing braces * Add try/catch for errors * Add missing import * Add more missing import * Add requireEnvVar check * Add missing test import * Add missing test import --- .../java/com/example/bigquery/SimpleApp.java | 90 ++++++++++--------- .../com/example/bigquery/SimpleAppIT.java | 18 +++- 2 files changed, 67 insertions(+), 41 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java index 65ebbc241d..49975a9cc0 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java +++ b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java @@ -20,6 +20,7 @@ // [START bigquery_simple_app_deps] import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.FieldValueList; import com.google.cloud.bigquery.Job; @@ -27,56 +28,65 @@ import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.TableResult; -import java.util.UUID; // [END bigquery_simple_app_deps] public class SimpleApp { + public static void main(String... args) throws Exception { - // [START bigquery_simple_app_client] - BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); - // [END bigquery_simple_app_client] - // [START bigquery_simple_app_query] - QueryJobConfiguration queryConfig = - QueryJobConfiguration.newBuilder( - "SELECT CONCAT('https://stackoverflow.com/questions/', " - + "CAST(id as STRING)) as url, view_count " - + "FROM `bigquery-public-data.stackoverflow.posts_questions` " - + "WHERE tags like '%google-bigquery%' " - + "ORDER BY view_count DESC " - + "LIMIT 10") - // Use standard SQL syntax for queries. - // See: https://cloud.google.com/bigquery/sql-reference/ - .setUseLegacySql(false) - .build(); + // TODO(developer): Replace these variables before running the app. + String projectId = "MY_PROJECT_ID"; + simpleApp(projectId); + } - // Create a job ID so that we can safely retry. - JobId jobId = JobId.of(UUID.randomUUID().toString()); - Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).setJobId(jobId).build()); + public static void simpleApp(String projectId) { + try { + // [START bigquery_simple_app_client] + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + // [END bigquery_simple_app_client] + // [START bigquery_simple_app_query] + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder( + "SELECT CONCAT('https://stackoverflow.com/questions/', " + + "CAST(id as STRING)) as url, view_count " + + "FROM `bigquery-public-data.stackoverflow.posts_questions` " + + "WHERE tags like '%google-bigquery%' " + + "ORDER BY view_count DESC " + + "LIMIT 10") + // Use standard SQL syntax for queries. + // See: https://cloud.google.com/bigquery/sql-reference/ + .setUseLegacySql(false) + .build(); - // Wait for the query to complete. - queryJob = queryJob.waitFor(); + JobId jobId = JobId.newBuilder().setProject(projectId).build(); + Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).setJobId(jobId).build()); - // Check for errors - if (queryJob == null) { - throw new RuntimeException("Job no longer exists"); - } else if (queryJob.getStatus().getError() != null) { - // You can also look at queryJob.getStatus().getExecutionErrors() for all - // errors, not just the latest one. - throw new RuntimeException(queryJob.getStatus().getError().toString()); - } - // [END bigquery_simple_app_query] + // Wait for the query to complete. + queryJob = queryJob.waitFor(); + + // Check for errors + if (queryJob == null) { + throw new RuntimeException("Job no longer exists"); + } else if (queryJob.getStatus().getError() != null) { + // You can also look at queryJob.getStatus().getExecutionErrors() for all + // errors, not just the latest one. + throw new RuntimeException(queryJob.getStatus().getError().toString()); + } + // [END bigquery_simple_app_query] - // [START bigquery_simple_app_print] - // Get the results. - TableResult result = queryJob.getQueryResults(); + // [START bigquery_simple_app_print] + // Get the results. + TableResult result = queryJob.getQueryResults(); - // Print all pages of the results. - for (FieldValueList row : result.iterateAll()) { - // String type - String url = row.get("url").getStringValue(); - String viewCount = row.get("view_count").getStringValue(); - System.out.printf("%s : %s views\n", url, viewCount); + // Print all pages of the results. + for (FieldValueList row : result.iterateAll()) { + // String type + String url = row.get("url").getStringValue(); + String viewCount = row.get("view_count").getStringValue(); + System.out.printf("%s : %s views\n", url, viewCount); + } + } catch (BigQueryException | InterruptedException e) { + System.out.println("Simple App failed due to error: \n" + e.toString()); } // [END bigquery_simple_app_print] } diff --git a/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java b/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java index cfb77f1079..4c4030c7dc 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/SimpleAppIT.java @@ -17,6 +17,7 @@ package com.example.bigquery; import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -24,6 +25,7 @@ import java.util.logging.Logger; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -37,6 +39,20 @@ public class SimpleAppIT { private ByteArrayOutputStream bout; private PrintStream out; private PrintStream originalPrintStream; + private static final String PROJECT_ID = requireEnvVar("GOOGLE_CLOUD_PROJECT"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar("GOOGLE_CLOUD_PROJECT"); + } @Before public void setUp() { @@ -56,7 +72,7 @@ public void tearDown() { @Test public void testQuickstart() throws Exception { - SimpleApp.main(); + SimpleApp.simpleApp(PROJECT_ID); String got = bout.toString(); assertThat(got).contains("https://stackoverflow.com/questions/"); } From 16448eec7c7f00a113c923a0fcde463c8ac91f9b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 18:11:26 +0200 Subject: [PATCH 1890/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.38.0 (#3542) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ef7f25f5e6..d34d268f91 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.37.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.38.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 0b98d0a81d..d2374101e7 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.37.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.38.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index c468a59f76..1ef28925b6 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.37.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.38.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 9d44e53042..cef8b0b6c9 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.37.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.38.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index e6553bd6e4..e434ee6847 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.37.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.38.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 32d22c8b4c..b949a354f9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.37.0 + 3.38.0 diff --git a/pom.xml b/pom.xml index 6cf78489db..1cbbf7c7d8 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.37.0 + 3.38.0 From 4763f73ad854ca4bfdddbbdc0bb43fe639238665 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:39:54 +0000 Subject: [PATCH 1891/2268] docs: reformat javadoc (#3545) * docs: reformat javadoc * lint --- .../com/google/cloud/bigquery/BigQuery.java | 843 ++++++++---------- 1 file changed, 366 insertions(+), 477 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index e391c054d9..675e6c1e86 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -699,20 +699,17 @@ public int hashCode() { * *

    Example of creating a dataset. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   Dataset dataset = null;
    -   *   DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build();
    -   *   try {
    -   *     // the dataset was created
    -   *     dataset = bigquery.create(datasetInfo);
    -   *   } catch (BigQueryException e) {
    -   *     // the dataset was not created
    -   *   }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * Dataset dataset = null;
    +   * DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build();
    +   * try {
    +   *   // the dataset was created
    +   *   dataset = bigquery.create(datasetInfo);
    +   * } catch (BigQueryException e) {
    +   *   // the dataset was not created
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -723,22 +720,19 @@ public int hashCode() { * *

    Example of creating a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   String fieldName = "string_field";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   // Table field definition
    -   *   Field field = Field.of(fieldName, LegacySQLTypeName.STRING);
    -   *   // Table schema definition
    -   *   Schema schema = Schema.of(field);
    -   *   TableDefinition tableDefinition = StandardTableDefinition.of(schema);
    -   *   TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();
    -   *   Table table = bigquery.create(tableInfo);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * String fieldName = "string_field";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * // Table field definition
    +   * Field field = Field.of(fieldName, LegacySQLTypeName.STRING);
    +   * // Table schema definition
    +   * Schema schema = Schema.of(field);
    +   * TableDefinition tableDefinition = StandardTableDefinition.of(schema);
    +   * TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build();
    +   * Table table = bigquery.create(tableInfo);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -756,46 +750,41 @@ public int hashCode() { * *

    Example of loading a newline-delimited-json file with textual fields from GCS to a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   String sourceUri = "gs://cloud-samples-data/bigquery/us-states/us-states.json";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   // Table field definition
    -   *   Field[] fields = new Field[] { Field.of("name", LegacySQLTypeName.STRING),
    -   *       Field.of("post_abbr", LegacySQLTypeName.STRING) };
    -   *   // Table schema definition
    -   *   Schema schema = Schema.of(fields);
    -   *   LoadJobConfiguration configuration = LoadJobConfiguration.builder(tableId, sourceUri)
    -   *       .setFormatOptions(FormatOptions.json()).setCreateDisposition(CreateDisposition.CREATE_IF_NEEDED)
    -   *       .setSchema(schema).build();
    -   *   // Load the table
    -   *   Job loadJob = bigquery.create(JobInfo.of(configuration));
    -   *   loadJob = loadJob.waitFor();
    -   *   // Check the table
    -   *   System.out.println("State: " + loadJob.getStatus().getState());
    -   *   return ((StandardTableDefinition) bigquery.getTable(tableId).getDefinition()).getNumRows();
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * String sourceUri = "gs://cloud-samples-data/bigquery/us-states/us-states.json";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * // Table field definition
    +   * Field[] fields = new Field[] { Field.of("name", LegacySQLTypeName.STRING),
    +   * Field.of("post_abbr", LegacySQLTypeName.STRING) };
    +   * // Table schema definition
    +   * Schema schema = Schema.of(fields);
    +   * LoadJobConfiguration configuration = LoadJobConfiguration.builder(tableId, sourceUri)
    +   *     .setFormatOptions(FormatOptions.json())
    +   *     .setCreateDisposition(CreateDisposition.CREATE_IF_NEEDED)
    +   *     .setSchema(schema).build();
    +   * // Load the table
    +   * Job loadJob = bigquery.create(JobInfo.of(configuration));
    +   * loadJob = loadJob.waitFor();
    +   * // Check the table
    +   * System.out.println("State: " + loadJob.getStatus().getState());
    +   * return ((StandardTableDefinition) bigquery.getTable(tableId).getDefinition()).getNumRows();
    +   * }
    * *

    Example of creating a query job. * - *

    -   * {
    -   *   @code
    -   *   String query = "SELECT field FROM my_dataset_name.my_table_name";
    -   *   Job job = null;
    -   *   JobConfiguration jobConfiguration = QueryJobConfiguration.of(query);
    -   *   JobInfo jobInfo = JobInfo.of(jobConfiguration);
    -   *   try {
    -   *     job = bigquery.create(jobInfo);
    -   *   } catch (BigQueryException e) {
    -   *     // the job was not created
    -   *   }
    +   * 
    {@code
    +   * String query = "SELECT field FROM my_dataset_name.my_table_name";
    +   * Job job = null;
    +   * JobConfiguration jobConfiguration = QueryJobConfiguration.of(query);
    +   * JobInfo jobInfo = JobInfo.of(jobConfiguration);
    +   * try {
    +   *   job = bigquery.create(jobInfo);
    +   * } catch (BigQueryException e) {
    +   *   // the job was not created
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -808,18 +797,15 @@ public int hashCode() { * *

    Example of creating a query connection. * - *

    -   * {
    -   *   @code
    -   *       ConnectionSettings connectionSettings =
    -   *         ConnectionSettings.newBuilder()
    -   *             .setRequestTimeout(10L)
    -   *             .setMaxResults(100L)
    -   *             .setUseQueryCache(true)
    -   *             .build();
    -   *       Connection connection = bigquery.createConnection(connectionSettings);
    -   * }
    -   * 
    + *
    {@code
    +   * ConnectionSettings connectionSettings =
    +   *     ConnectionSettings.newBuilder()
    +   *         .setRequestTimeout(10L)
    +   *         .setMaxResults(100L)
    +   *         .setUseQueryCache(true)
    +   *         .build();
    +   * Connection connection = bigquery.createConnection(connectionSettings);
    +   * }
    * * @throws BigQueryException upon failure * @param connectionSettings @@ -836,12 +822,9 @@ public int hashCode() { * *

    Example of creating a query connection. * - *

    -   * {
    -   *   @code
    -   *       Connection connection = bigquery.createConnection();
    -   * }
    -   * 
    + *
    {@code
    +   * Connection connection = bigquery.createConnection();
    +   * }
    * * @throws BigQueryException upon failure */ @@ -853,13 +836,10 @@ public int hashCode() { * *

    Example of getting a dataset. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset";
    -   *   Dataset dataset = bigquery.getDataset(datasetName);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset";
    +   * Dataset dataset = bigquery.getDataset(datasetName);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -870,15 +850,12 @@ public int hashCode() { * *

    Example of getting a dataset. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   DatasetId datasetId = DatasetId.of(projectId, datasetName);
    -   *   Dataset dataset = bigquery.getDataset(datasetId);
    -   * }
    -   * 
    + *
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * DatasetId datasetId = DatasetId.of(projectId, datasetName);
    +   * Dataset dataset = bigquery.getDataset(datasetId);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -892,16 +869,13 @@ public int hashCode() { * *

    Example of listing datasets, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   // List datasets in the default project
    -   *   Page<Dataset> datasets = bigquery.listDatasets(DatasetListOption.pageSize(100));
    -   *   for (Dataset dataset : datasets.iterateAll()) {
    -   *     // do something with the dataset
    -   *   }
    +   * 
    {@code
    +   * // List datasets in the default project
    +   * Page datasets = bigquery.listDatasets(DatasetListOption.pageSize(100));
    +   * for (Dataset dataset : datasets.iterateAll()) {
    +   *   // do something with the dataset
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -915,17 +889,14 @@ public int hashCode() { * *

    Example of listing datasets in a project, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   // List datasets in a specified project
    -   *   Page<{@link Dataset}> datasets = bigquery.listDatasets(projectId, DatasetListOption.pageSize(100));
    -   *   for (Dataset dataset : datasets.iterateAll()) {
    -   *     // do something with the dataset
    -   *   }
    +   * 
    {@code
    +   * String projectId = "my_project_id";
    +   * // List datasets in a specified project
    +   * Page datasets = bigquery.listDatasets(projectId, DatasetListOption.pageSize(100));
    +   * for (Dataset dataset : datasets.iterateAll()) {
    +   *   // do something with the dataset
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -936,18 +907,15 @@ public int hashCode() { * *

    Example of deleting a dataset from its id, even if non-empty. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   boolean deleted = bigquery.delete(datasetName, DatasetDeleteOption.deleteContents());
    -   *   if (deleted) {
    -   *     // the dataset was deleted
    -   *   } else {
    -   *     // the dataset was not found
    -   *   }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * boolean deleted = bigquery.delete(datasetName, DatasetDeleteOption.deleteContents());
    +   * if (deleted) {
    +   *   // the dataset was deleted
    +   * } else {
    +   *   // the dataset was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if dataset was deleted, {@code false} if it was not found * @throws BigQueryException upon failure @@ -959,20 +927,17 @@ public int hashCode() { * *

    Example of deleting a dataset, even if non-empty. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   DatasetId datasetId = DatasetId.of(projectId, datasetName);
    -   *   boolean deleted = bigquery.delete(datasetId, DatasetDeleteOption.deleteContents());
    -   *   if (deleted) {
    -   *     // the dataset was deleted
    -   *   } else {
    -   *     // the dataset was not found
    -   *   }
    +   * 
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * DatasetId datasetId = DatasetId.of(projectId, datasetName);
    +   * boolean deleted = bigquery.delete(datasetId, DatasetDeleteOption.deleteContents());
    +   * if (deleted) {
    +   *   // the dataset was deleted
    +   * } else {
    +   *   // the dataset was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if dataset was deleted, {@code false} if it was not found * @throws BigQueryException upon failure @@ -996,21 +961,18 @@ public int hashCode() { * *

    Example of deleting a table. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   TableId tableId = TableId.of(projectId, datasetName, tableName);
    -   *   boolean deleted = bigquery.delete(tableId);
    -   *   if (deleted) {
    -   *     // the table was deleted
    -   *   } else {
    -   *     // the table was not found
    -   *   }
    +   * 
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * TableId tableId = TableId.of(projectId, datasetName, tableName);
    +   * boolean deleted = bigquery.delete(tableId);
    +   * if (deleted) {
    +   *   // the table was deleted
    +   * } else {
    +   *   // the table was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if table was deleted, {@code false} if it was not found * @throws BigQueryException upon failure @@ -1022,21 +984,18 @@ public int hashCode() { * *

    Example of deleting a model. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_model_name";
    -   *   ModelId modelId = ModelId.of(projectId, datasetName, modelName);
    -   *   boolean deleted = bigquery.delete(modelId);
    -   *   if (deleted) {
    -   *     // the model was deleted
    -   *   } else {
    -   *     // the model was not found
    -   *   }
    +   * 
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_model_name";
    +   * ModelId modelId = ModelId.of(projectId, datasetName, modelName);
    +   * boolean deleted = bigquery.delete(modelId);
    +   * if (deleted) {
    +   *   // the model was deleted
    +   * } else {
    +   *   // the model was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if model was deleted, {@code false} if it was not found * @throws BigQueryException upon failure @@ -1081,19 +1040,15 @@ public int hashCode() { * * - *
    -   * {
    -   *   @code
    -   *   // String datasetName = "my_dataset_name";
    -   *   // String tableName = "my_table_name";
    -   *   // String newDescription = "new_description";
    -   *
    -   *   Table beforeTable = bigquery.getTable(datasetName, tableName);
    -   *   TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build();
    -   *   Table afterTable = bigquery.update(tableInfo);
    +   * 
    {@code
    +   * // String datasetName = "my_dataset_name";
    +   * // String tableName = "my_table_name";
    +   * // String newDescription = "new_description";
        *
    -   * }
    -   * 
    + * Table beforeTable = bigquery.getTable(datasetName, tableName); + * TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build(); + * Table afterTable = bigquery.update(tableInfo); + * }
    * * * @@ -1106,33 +1061,27 @@ public int hashCode() { * *

    Example of updating a table by changing its description. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   String newDescription = "new_description";
    -   *   Table beforeTable = bigquery.getTable(datasetName, tableName);
    -   *   TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build();
    -   *   Table afterTable = bigquery.update(tableInfo);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * String newDescription = "new_description";
    +   * Table beforeTable = bigquery.getTable(datasetName, tableName);
    +   * TableInfo tableInfo = beforeTable.toBuilder().setDescription(newDescription).build();
    +   * Table afterTable = bigquery.update(tableInfo);
    +   * }
    * *

    Example of updating a table by changing its expiration. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   Table beforeTable = bigquery.getTable(datasetName, tableName);
    -   *
    -   *   // Set table to expire 5 days from now.
    -   *   long expirationMillis = DateTime.now().plusDays(5).getMillis();
    -   *   TableInfo tableInfo = beforeTable.toBuilder().setExpirationTime(expirationMillis).build();
    -   *   Table afterTable = bigquery.update(tableInfo);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * Table beforeTable = bigquery.getTable(datasetName, tableName);
    +   *
    +   * // Set table to expire 5 days from now.
    +   * long expirationMillis = DateTime.now().plusDays(5).getMillis();
    +   * TableInfo tableInfo = beforeTable.toBuilder().setExpirationTime(expirationMillis).build();
    +   * Table afterTable = bigquery.update(tableInfo);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1143,33 +1092,27 @@ public int hashCode() { * *

    Example of updating a model by changing its description. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String modelName = "my_model_name";
    -   *   String newDescription = "new_description";
    -   *   Model beforeModel = bigquery.getModel(datasetName, modelName);
    -   *   ModelInfo modelInfo = beforeModel.toBuilder().setDescription(newDescription).build();
    -   *   Model afterModel = bigquery.update(modelInfo);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String modelName = "my_model_name";
    +   * String newDescription = "new_description";
    +   * Model beforeModel = bigquery.getModel(datasetName, modelName);
    +   * ModelInfo modelInfo = beforeModel.toBuilder().setDescription(newDescription).build();
    +   * Model afterModel = bigquery.update(modelInfo);
    +   * }
    * *

    Example of updating a model by changing its expiration. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String modelName = "my_model_name";
    -   *   Model beforeModel = bigquery.getModel(datasetName, modelName);
    -   *
    -   *   // Set model to expire 5 days from now.
    -   *   long expirationMillis = DateTime.now().plusDays(5).getMillis();
    -   *   ModelInfo modelInfo = beforeModel.toBuilder().setExpirationTime(expirationMillis).build();
    -   *   Model afterModel = bigquery.update(modelInfo);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String modelName = "my_model_name";
    +   * Model beforeModel = bigquery.getModel(datasetName, modelName);
    +   *
    +   * // Set model to expire 5 days from now.
    +   * long expirationMillis = DateTime.now().plusDays(5).getMillis();
    +   * ModelInfo modelInfo = beforeModel.toBuilder().setExpirationTime(expirationMillis).build();
    +   * Model afterModel = bigquery.update(modelInfo);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1187,14 +1130,11 @@ public int hashCode() { * *

    Example of getting a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   Table table = bigquery.getTable(datasetName, tableName);
    -   * }
    -   * 
    + *
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * Table table = bigquery.getTable(datasetName, tableName);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1205,16 +1145,13 @@ public int hashCode() { * *

    Example of getting a table. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   TableId tableId = TableId.of(projectId, datasetName, tableName);
    -   *   Table table = bigquery.getTable(tableId);
    -   * }
    -   * 
    + *
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * TableId tableId = TableId.of(projectId, datasetName, tableName);
    +   * Table table = bigquery.getTable(tableId);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1232,16 +1169,13 @@ public int hashCode() { * *

    Example of getting a model. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   String modelName = "my_model_name";
    -   *   ModelId modelId = ModelId.of(projectId, datasetName, tableName);
    -   *   Model model = bigquery.getModel(modelId);
    -   * }
    -   * 
    + *
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * String modelName = "my_model_name";
    +   * ModelId modelId = ModelId.of(projectId, datasetName, tableName);
    +   * Model model = bigquery.getModel(modelId);
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1275,16 +1209,13 @@ public int hashCode() { * *

    Example of listing the tables in a dataset, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   Page<Table> tables = bigquery.listTables(datasetName, TableListOption.pageSize(100));
    -   *   for (Table table : tables.iterateAll()) {
    -   *     // do something with the table
    -   *   }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * Page
    tables = bigquery.listTables(datasetName, TableListOption.pageSize(100)); + * for (Table table : tables.iterateAll()) { + * // do something with the table * } - * + * } * * @throws BigQueryException upon failure */ @@ -1298,18 +1229,15 @@ public int hashCode() { * *

    Example of listing the tables in a dataset. * - *

    -   * {
    -   *   @code
    -   *   String projectId = "my_project_id";
    -   *   String datasetName = "my_dataset_name";
    -   *   DatasetId datasetId = DatasetId.of(projectId, datasetName);
    -   *   Page<Table> tables = bigquery.listTables(datasetId, TableListOption.pageSize(100));
    -   *   for (Table table : tables.iterateAll()) {
    -   *     // do something with the table
    -   *   }
    +   * 
    {@code
    +   * String projectId = "my_project_id";
    +   * String datasetName = "my_dataset_name";
    +   * DatasetId datasetId = DatasetId.of(projectId, datasetName);
    +   * Page
    tables = bigquery.listTables(datasetId, TableListOption.pageSize(100)); + * for (Table table : tables.iterateAll()) { + * // do something with the table * } - * + * } * * @throws BigQueryException upon failure */ @@ -1332,33 +1260,30 @@ public int hashCode() { * *

    Example of inserting rows into a table without running a load job. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   // Values of the row to insert
    -   *   Map<String, Object> rowContent = new HashMap<>();
    -   *   rowContent.put("booleanField", true);
    -   *   // Bytes are passed in base64
    -   *   rowContent.put("bytesField", "Cg0NDg0="); // 0xA, 0xD, 0xD, 0xE, 0xD in base64
    -   *   // Records are passed as a map
    -   *   Map<String, Object> recordsContent = new HashMap<>();
    -   *   recordsContent.put("stringField", "Hello, World!");
    -   *   rowContent.put("recordField", recordsContent);
    -   *   InsertAllResponse response = bigquery.insertAll(InsertAllRequest.newBuilder(tableId).addRow("rowId", rowContent)
    -   *       // More rows can be added in the same RPC by invoking .addRow() on the
    -   *       // builder
    -   *       .build());
    -   *   if (response.hasErrors()) {
    -   *     // If any of the insertions failed, this lets you inspect the errors
    -   *     for (Entry<Long, List<BigQueryError>> entry : response.getInsertErrors().entrySet()) {
    -   *       // inspect row error
    -   *     }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * // Values of the row to insert
    +   * Map rowContent = new HashMap<>();
    +   * rowContent.put("booleanField", true);
    +   * // Bytes are passed in base64
    +   * rowContent.put("bytesField", "Cg0NDg0="); // 0xA, 0xD, 0xD, 0xE, 0xD in base64
    +   * // Records are passed as a map
    +   * Map recordsContent = new HashMap<>();
    +   * recordsContent.put("stringField", "Hello, World!");
    +   * rowContent.put("recordField", recordsContent);
    +   * InsertAllResponse response = bigquery.insertAll(InsertAllRequest.newBuilder(tableId).addRow("rowId", rowContent)
    +   *     // More rows can be added in the same RPC by invoking .addRow() on the
    +   *     // builder
    +   *     .build());
    +   * if (response.hasErrors()) {
    +   *   // If any of the insertions failed, this lets you inspect the errors
    +   *   for (Entry> entry : response.getInsertErrors().entrySet()) {
    +   *     // inspect row error
        *   }
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1369,20 +1294,17 @@ public int hashCode() { * *

    Example of listing table rows, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   // This example reads the result 100 rows per RPC call. If there's no need
    -   *   // to limit the number,
    -   *   // simply omit the option.
    -   *   TableResult tableData = bigquery.listTableData(datasetName, tableName, TableDataListOption.pageSize(100));
    -   *   for (FieldValueList row : tableData.iterateAll()) {
    -   *     // do something with the row
    -   *   }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * // This example reads the result 100 rows per RPC call. If there's no need
    +   * // to limit the number,
    +   * // simply omit the option.
    +   * TableResult tableData = bigquery.listTableData(datasetName, tableName, TableDataListOption.pageSize(100));
    +   * for (FieldValueList row : tableData.iterateAll()) {
    +   *   // do something with the row
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1393,21 +1315,18 @@ public int hashCode() { * *

    Example of listing table rows, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   TableId tableIdObject = TableId.of(datasetName, tableName);
    -   *   // This example reads the result 100 rows per RPC call. If there's no need
    -   *   // to limit the number,
    -   *   // simply omit the option.
    -   *   TableResult tableData = bigquery.listTableData(tableIdObject, TableDataListOption.pageSize(100));
    -   *   for (FieldValueList row : tableData.iterateAll()) {
    -   *     // do something with the row
    -   *   }
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * TableId tableIdObject = TableId.of(datasetName, tableName);
    +   * // This example reads the result 100 rows per RPC call. If there's no need
    +   * // to limit the number,
    +   * // simply omit the option.
    +   * TableResult tableData = bigquery.listTableData(tableIdObject, TableDataListOption.pageSize(100));
    +   * for (FieldValueList row : tableData.iterateAll()) {
    +   *   // do something with the row
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1441,18 +1360,15 @@ TableResult listTableData( * *

    Example of listing table rows with schema. * - *

    -   * {
    -   *   @code
    -   *   Schema schema = Schema.of(Field.of("word", LegacySQLTypeName.STRING),
    -   *       Field.of("word_count", LegacySQLTypeName.STRING), Field.of("corpus", LegacySQLTypeName.STRING),
    -   *       Field.of("corpus_date", LegacySQLTypeName.STRING));
    -   *   TableResult tableData = bigquery.listTableData(TableId.of("bigquery-public-data", "samples", "shakespeare"),
    -   *       schema);
    -   *   FieldValueList row = tableData.getValues().iterator().next();
    -   *   System.out.println(row.get("word").getStringValue());
    -   * }
    -   * 
    + *
    {@code
    +   * Schema schema = Schema.of(Field.of("word", LegacySQLTypeName.STRING),
    +   *     Field.of("word_count", LegacySQLTypeName.STRING), Field.of("corpus", LegacySQLTypeName.STRING),
    +   *     Field.of("corpus_date", LegacySQLTypeName.STRING));
    +   * TableResult tableData = bigquery.listTableData(TableId.of("bigquery-public-data", "samples", "shakespeare"),
    +   *     schema);
    +   * FieldValueList row = tableData.getValues().iterator().next();
    +   * System.out.println(row.get("word").getStringValue());
    +   * }
    * * @throws BigQueryException upon failure */ @@ -1464,16 +1380,13 @@ TableResult listTableData( * *

    Example of getting a job. * - *

    -   * {
    -   *   @code
    -   *   String jobName = "my_job_name";
    -   *   Job job = bigquery.getJob(jobName);
    -   *   if (job == null) {
    -   *     // job was not found
    -   *   }
    +   * 
    {@code
    +   * String jobName = "my_job_name";
    +   * Job job = bigquery.getJob(jobName);
    +   * if (job == null) {
    +   *   // job was not found
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1485,17 +1398,14 @@ TableResult listTableData( * *

    Example of getting a job. * - *

    -   * {
    -   *   @code
    -   *   String jobName = "my_job_name";
    -   *   JobId jobIdObject = JobId.of(jobName);
    -   *   Job job = bigquery.getJob(jobIdObject);
    -   *   if (job == null) {
    -   *     // job was not found
    -   *   }
    +   * 
    {@code
    +   * String jobName = "my_job_name";
    +   * JobId jobIdObject = JobId.of(jobName);
    +   * Job job = bigquery.getJob(jobIdObject);
    +   * if (job == null) {
    +   *   // job was not found
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1506,15 +1416,12 @@ TableResult listTableData( * *

    Example of listing jobs, specifying the page size. * - *

    -   * {
    -   *   @code
    -   *   Page<Job> jobs = bigquery.listJobs(JobListOption.pageSize(100));
    -   *   for (Job job : jobs.iterateAll()) {
    -   *     // do something with the job
    -   *   }
    +   * 
    {@code
    +   * Page jobs = bigquery.listJobs(JobListOption.pageSize(100));
    +   * for (Job job : jobs.iterateAll()) {
    +   *   // do something with the job
        * }
    -   * 
    + * }
    * * @throws BigQueryException upon failure */ @@ -1529,18 +1436,15 @@ TableResult listTableData( * *

    Example of cancelling a job. * - *

    -   * {
    -   *   @code
    -   *   String jobName = "my_job_name";
    -   *   boolean success = bigquery.cancel(jobName);
    -   *   if (success) {
    -   *     // job was cancelled
    -   *   } else {
    -   *     // job was not found
    -   *   }
    +   * 
    {@code
    +   * String jobName = "my_job_name";
    +   * boolean success = bigquery.cancel(jobName);
    +   * if (success) {
    +   *   // job was cancelled
    +   * } else {
    +   *   // job was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if cancel was requested successfully, {@code false} if the job was not * found @@ -1558,19 +1462,16 @@ TableResult listTableData( * *

    Example of cancelling a job. * - *

    -   * {
    -   *   @code
    -   *   String jobName = "my_job_name";
    -   *   JobId jobId = JobId.of(jobName);
    -   *   boolean success = bigquery.cancel(jobId);
    -   *   if (success) {
    -   *     // job was cancelled
    -   *   } else {
    -   *     // job was not found
    -   *   }
    +   * 
    {@code
    +   * String jobName = "my_job_name";
    +   * JobId jobId = JobId.of(jobName);
    +   * boolean success = bigquery.cancel(jobId);
    +   * if (success) {
    +   *   // job was cancelled
    +   * } else {
    +   *   // job was not found
        * }
    -   * 
    + * }
    * * @return {@code true} if cancel was requested successfully, {@code false} if the job was not * found @@ -1589,22 +1490,19 @@ TableResult listTableData( * *

    Example of running a query. * - *

    -   * {
    -   *   @code
    -   *   // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
    -   *   String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    -   *   QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build();
    -   *
    -   *   // Print the results.
    -   *   for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) {
    -   *     for (FieldValue val : row) {
    -   *       System.out.printf("%s,", val.toString());
    -   *     }
    -   *     System.out.printf("\n");
    +   * 
    {@code
    +   * // BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
    +   * String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;";
    +   * QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(query).build();
    +   *
    +   * // Print the results.
    +   * for (FieldValueList row : bigquery.query(queryConfig).iterateAll()) {
    +   *   for (FieldValue val : row) {
    +   *     System.out.printf("%s,", val.toString());
        *   }
    +   *   System.out.printf("\n");
        * }
    -   * 
    + * }
    * * This method supports query-related preview features via environmental variables (enabled by * setting the {@code QUERY_PREVIEW_ENABLED} environment variable to "TRUE"). Specifically, this @@ -1630,7 +1528,7 @@ TableResult query(QueryJobConfiguration configuration, JobOption... options) *

    If the location of the job is not "US" or "EU", the {@code jobId} must specify the job * location. * - *

    This method cannot be used in conjuction with {@link QueryJobConfiguration#dryRun()} + *

    This method cannot be used in conjunction with {@link QueryJobConfiguration#dryRun()} * queries. Since dry-run queries are not actually executed, there's no way to retrieve results. * *

    See {@link #query(QueryJobConfiguration, JobOption...)} for examples on populating a {@link @@ -1659,56 +1557,50 @@ TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... * *

    Example of creating a channel with which to write to a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   String csvData = "StringValue1\nStringValue2\n";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    -   *       .setFormatOptions(FormatOptions.csv()).build();
    -   *   TableDataWriteChannel writer = bigquery.writer(writeChannelConfiguration);
    -   *   // Write data to writer
    -   *   try {
    -   *     writer.write(ByteBuffer.wrap(csvData.getBytes(Charsets.UTF_8)));
    -   *   } finally {
    -   *     writer.close();
    -   *   }
    -   *   // Get load job
    -   *   Job job = writer.getJob();
    -   *   job = job.waitFor();
    -   *   LoadStatistics stats = job.getStatistics();
    -   *   return stats.getOutputRows();
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * String csvData = "StringValue1\nStringValue2\n";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    +   *     .setFormatOptions(FormatOptions.csv()).build();
    +   * TableDataWriteChannel writer = bigquery.writer(writeChannelConfiguration);
    +   * // Write data to writer
    +   * try {
    +   *   writer.write(ByteBuffer.wrap(csvData.getBytes(Charsets.UTF_8)));
    +   * } finally {
    +   *   writer.close();
        * }
    -   * 
    + * // Get load job + * Job job = writer.getJob(); + * job = job.waitFor(); + * LoadStatistics stats = job.getStatistics(); + * return stats.getOutputRows(); + * }
    * *

    Example of writing a local file to a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   Path csvPath = FileSystems.getDefault().getPath(".", "my-data.csv");
    -   *   String location = "us";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    -   *       .setFormatOptions(FormatOptions.csv()).build();
    -   *   // The location must be specified; other fields can be auto-detected.
    -   *   JobId jobId = JobId.newBuilder().setLocation(location).build();
    -   *   TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration);
    -   *   // Write data to writer
    -   *   try (OutputStream stream = Channels.newOutputStream(writer)) {
    -   *     Files.copy(csvPath, stream);
    -   *   }
    -   *   // Get load job
    -   *   Job job = writer.getJob();
    -   *   job = job.waitFor();
    -   *   LoadStatistics stats = job.getStatistics();
    -   *   return stats.getOutputRows();
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * Path csvPath = FileSystems.getDefault().getPath(".", "my-data.csv");
    +   * String location = "us";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    +   *     .setFormatOptions(FormatOptions.csv()).build();
    +   * // The location must be specified; other fields can be auto-detected.
    +   * JobId jobId = JobId.newBuilder().setLocation(location).build();
    +   * TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration);
    +   * // Write data to writer
    +   * try (OutputStream stream = Channels.newOutputStream(writer)) {
    +   *   Files.copy(csvPath, stream);
        * }
    -   * 
    + * // Get load job + * Job job = writer.getJob(); + * job = job.waitFor(); + * LoadStatistics stats = job.getStatistics(); + * return stats.getOutputRows(); + * }
    * * @throws BigQueryException upon failure */ @@ -1721,32 +1613,29 @@ TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... * *

    Example of creating a channel with which to write to a table. * - *

    -   * {
    -   *   @code
    -   *   String datasetName = "my_dataset_name";
    -   *   String tableName = "my_table_name";
    -   *   String csvData = "StringValue1\nStringValue2\n";
    -   *   String location = "us";
    -   *   TableId tableId = TableId.of(datasetName, tableName);
    -   *   WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    -   *       .setFormatOptions(FormatOptions.csv()).build();
    -   *   // The location must be specified; other fields can be auto-detected.
    -   *   JobId jobId = JobId.newBuilder().setLocation(location).build();
    -   *   TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration);
    -   *   // Write data to writer
    -   *   try {
    -   *     writer.write(ByteBuffer.wrap(csvData.getBytes(Charsets.UTF_8)));
    -   *   } finally {
    -   *     writer.close();
    -   *   }
    -   *   // Get load job
    -   *   Job job = writer.getJob();
    -   *   job = job.waitFor();
    -   *   LoadStatistics stats = job.getStatistics();
    -   *   return stats.getOutputRows();
    +   * 
    {@code
    +   * String datasetName = "my_dataset_name";
    +   * String tableName = "my_table_name";
    +   * String csvData = "StringValue1\nStringValue2\n";
    +   * String location = "us";
    +   * TableId tableId = TableId.of(datasetName, tableName);
    +   * WriteChannelConfiguration writeChannelConfiguration = WriteChannelConfiguration.newBuilder(tableId)
    +   *     .setFormatOptions(FormatOptions.csv()).build();
    +   * // The location must be specified; other fields can be auto-detected.
    +   * JobId jobId = JobId.newBuilder().setLocation(location).build();
    +   * TableDataWriteChannel writer = bigquery.writer(jobId, writeChannelConfiguration);
    +   * // Write data to writer
    +   * try {
    +   *   writer.write(ByteBuffer.wrap(csvData.getBytes(Charsets.UTF_8)));
    +   * } finally {
    +   *   writer.close();
        * }
    -   * 
    + * // Get load job + * Job job = writer.getJob(); + * job = job.waitFor(); + * LoadStatistics stats = job.getStatistics(); + * return stats.getOutputRows(); + * }
    */ TableDataWriteChannel writer(JobId jobId, WriteChannelConfiguration writeChannelConfiguration); From c0d8839a0930cce03713b9a915519367df087387 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 21:04:28 +0200 Subject: [PATCH 1892/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.8.0 (#3539) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1cbbf7c7d8..482f53a0b4 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.7.0 + 3.8.0 From 1616a0f6057916e21f3b4a6d418d1431d8d1fa16 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 21:05:06 +0200 Subject: [PATCH 1893/2268] deps: update github/codeql-action action to v2.27.0 (#3540) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 7d2892a2f3..4802d1f8a2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@083cd45dc7d463f048a5d0975943f0e19e9c9378 # v2.26.13 + uses: github/codeql-action/upload-sarif@6a89f57882288b3d2f190cda65000eec9e9ebb7c # v2.27.0 with: sarif_file: results.sarif From c36c123f5cd298b1481c9073ac9f5e634b0e1e68 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 21:05:38 +0200 Subject: [PATCH 1894/2268] deps: update actions/checkout action to v4.2.2 (#3541) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4802d1f8a2..1be1c2a32a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,7 +32,7 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false From fa796cb836fc588e64c4b7260ff9ceba6e703e91 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 21:06:05 +0200 Subject: [PATCH 1895/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.44.0 (#3543) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 482f53a0b4..cc8c6dc590 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.43.2 + 2.44.0 test From 0c42092e34912d21a4d13f041577056faadf914a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Oct 2024 21:06:27 +0200 Subject: [PATCH 1896/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20241013-2.0.0 (#3544) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cc8c6dc590..8fc92a393e 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20240919-2.0.0 + v2-rev20241013-2.0.0 From 0bd3c862636271c5a851fcd229b4cf6878a8c5d4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 25 Oct 2024 00:30:43 +0200 Subject: [PATCH 1897/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.0 (#3546) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8fc92a393e..9165396fa0 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.9.3 + 3.10.0 pom import From 616b2f611f313994bf0ec2889daea3b569a84baf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 26 Oct 2024 03:53:39 +0200 Subject: [PATCH 1898/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.39.0 (#3548) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index d34d268f91..4df9466e7d 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.38.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.39.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index d2374101e7..4bc28d0afa 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.38.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.39.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 1ef28925b6..33a4a9d957 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.38.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.39.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index cef8b0b6c9..ba53eb9ce2 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.38.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.39.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index e434ee6847..418a399b75 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.38.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.39.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index b949a354f9..21f719a499 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.38.0 + 3.39.0 diff --git a/pom.xml b/pom.xml index 9165396fa0..da427159ba 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.38.0 + 3.39.0 From c03a63a0da4f4915e9761dc1ca7429c46748688c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 27 Oct 2024 02:37:55 +0100 Subject: [PATCH 1899/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.1 (#3550) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da427159ba..57a54a70be 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.10.0 + 3.10.1 pom import From fb5cabdb875456a894c98cb7b63d524faedded9d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sun, 27 Oct 2024 02:39:25 +0100 Subject: [PATCH 1900/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.44.1 (#3549) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 57a54a70be..eab2b84b77 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.44.0 + 2.44.1 test From 1e33145110a2d273fc9cf49f6f3b2c87e2673eed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:17:11 -0400 Subject: [PATCH 1901/2268] chore(main): release 2.43.2 (#3529) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaf9551fee..36bb39c294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.43.2](https://github.com/googleapis/java-bigquery/compare/v2.43.1...v2.43.2) (2024-10-27) + + +### Dependencies + +* Update actions/checkout action to v4.2.2 ([#3541](https://github.com/googleapis/java-bigquery/issues/3541)) ([c36c123](https://github.com/googleapis/java-bigquery/commit/c36c123f5cd298b1481c9073ac9f5e634b0e1e68)) +* Update actions/upload-artifact action to v4.4.2 ([#3524](https://github.com/googleapis/java-bigquery/issues/3524)) ([776a554](https://github.com/googleapis/java-bigquery/commit/776a5541cc94e8ffb1f5e5c6969ae06585571b45)) +* Update actions/upload-artifact action to v4.4.3 ([#3530](https://github.com/googleapis/java-bigquery/issues/3530)) ([2f87fd9](https://github.com/googleapis/java-bigquery/commit/2f87fd9d777175cb5a8e5b0dc55f07546351e504)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.54.0 ([#3532](https://github.com/googleapis/java-bigquery/issues/3532)) ([25be311](https://github.com/googleapis/java-bigquery/commit/25be311c1477db0993a5825a2b839a295170790f)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20241013-2.0.0 ([#3544](https://github.com/googleapis/java-bigquery/issues/3544)) ([0c42092](https://github.com/googleapis/java-bigquery/commit/0c42092e34912d21a4d13f041577056faadf914a)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.0 ([0bd3c86](https://github.com/googleapis/java-bigquery/commit/0bd3c862636271c5a851fcd229b4cf6878a8c5d4)) +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.1 ([c03a63a](https://github.com/googleapis/java-bigquery/commit/c03a63a0da4f4915e9761dc1ca7429c46748688c)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.58.0 ([#3533](https://github.com/googleapis/java-bigquery/issues/3533)) ([cad2643](https://github.com/googleapis/java-bigquery/commit/cad26430f21a37eec2b87ea417f0cf67dcf9c97a)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.38.0 ([#3542](https://github.com/googleapis/java-bigquery/issues/3542)) ([16448ee](https://github.com/googleapis/java-bigquery/commit/16448eec7c7f00a113c923a0fcde463c8ac91f9b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.39.0 ([#3548](https://github.com/googleapis/java-bigquery/issues/3548)) ([616b2f6](https://github.com/googleapis/java-bigquery/commit/616b2f611f313994bf0ec2889daea3b569a84baf)) +* Update github/codeql-action action to v2.26.13 ([#3536](https://github.com/googleapis/java-bigquery/issues/3536)) ([844744f](https://github.com/googleapis/java-bigquery/commit/844744f3dea804a31abc806592f557a26cffbab4)) +* Update github/codeql-action action to v2.27.0 ([#3540](https://github.com/googleapis/java-bigquery/issues/3540)) ([1616a0f](https://github.com/googleapis/java-bigquery/commit/1616a0f6057916e21f3b4a6d418d1431d8d1fa16)) + + +### Documentation + +* Reformat javadoc ([#3545](https://github.com/googleapis/java-bigquery/issues/3545)) ([4763f73](https://github.com/googleapis/java-bigquery/commit/4763f73ad854ca4bfdddbbdc0bb43fe639238665)) +* Update SimpleApp to explicitly set project id ([#3534](https://github.com/googleapis/java-bigquery/issues/3534)) ([903a0f7](https://github.com/googleapis/java-bigquery/commit/903a0f7db0926f3d166eebada1710413056fb4a2)) + ## [2.43.1](https://github.com/googleapis/java-bigquery/compare/v2.43.0...v2.43.1) (2024-10-09) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2d1239ead1..ec1f12a3d6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.2-SNAPSHOT + 2.43.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 21f719a499..8035b666c9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.2-SNAPSHOT + 2.43.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2-SNAPSHOT + 2.43.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 845a34a39d..ca7e318347 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.2-SNAPSHOT + 2.43.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.2-SNAPSHOT + 2.43.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index eab2b84b77..5dacb64d5f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.2-SNAPSHOT + 2.43.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2-SNAPSHOT + 2.43.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7f45a7209f..78ddff3b7f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2-SNAPSHOT + 2.43.2 diff --git a/versions.txt b/versions.txt index c189d4ed94..40ca7de531 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.1:2.43.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.43.2:2.43.2 \ No newline at end of file From 8ab87c4953a1891fde2109d61f6a753d750be4b2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:07:23 -0400 Subject: [PATCH 1902/2268] chore(main): release 2.43.3-SNAPSHOT (#3551) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ec1f12a3d6..5c88ff11b7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.2 + 2.43.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8035b666c9..0650b251ec 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.2 + 2.43.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2 + 2.43.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ca7e318347..983820234f 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.2 + 2.43.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.2 + 2.43.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5dacb64d5f..22eae6781a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.2 + 2.43.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2 + 2.43.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 78ddff3b7f..3d68c79ccf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.2 + 2.43.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 40ca7de531..d481a3f972 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.2:2.43.2 \ No newline at end of file +google-cloud-bigquery:2.43.2:2.43.3-SNAPSHOT \ No newline at end of file From 19fc1843f7db8ab6fb361bf7f8119014033bc1c6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Oct 2024 01:23:06 +0100 Subject: [PATCH 1903/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.2 (#3556) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 22eae6781a..4a654e6f12 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.10.1 + 3.10.2 pom import From 056ce2f8bc0b41667de48508f9306f527c59a697 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:21:08 -0400 Subject: [PATCH 1904/2268] chore(main): release 2.43.3 (#3557) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36bb39c294..ac6b1d9e93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.43.3](https://github.com/googleapis/java-bigquery/compare/v2.43.2...v2.43.3) (2024-10-29) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.2 ([19fc184](https://github.com/googleapis/java-bigquery/commit/19fc1843f7db8ab6fb361bf7f8119014033bc1c6)) + ## [2.43.2](https://github.com/googleapis/java-bigquery/compare/v2.43.1...v2.43.2) (2024-10-27) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5c88ff11b7..a371796e0d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.3-SNAPSHOT + 2.43.3 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 0650b251ec..c52bc5d4b7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.3-SNAPSHOT + 2.43.3 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3-SNAPSHOT + 2.43.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 983820234f..52538ce4f0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.3-SNAPSHOT + 2.43.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.3-SNAPSHOT + 2.43.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4a654e6f12..31168bf894 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.3-SNAPSHOT + 2.43.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3-SNAPSHOT + 2.43.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3d68c79ccf..358fb3bb4e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3-SNAPSHOT + 2.43.3 diff --git a/versions.txt b/versions.txt index d481a3f972..aa33dddd58 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.2:2.43.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.43.3:2.43.3 \ No newline at end of file From 950ad0cce6370e332a568d3b2e9ef3911503d206 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Oct 2024 18:31:19 +0100 Subject: [PATCH 1905/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.55.0 (#3559) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 31168bf894..0bb623e1c8 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.54.0 + 2.55.0 test From 1bd24a1ad28d168587b7cba95ec348cb1308a803 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Oct 2024 18:32:34 +0100 Subject: [PATCH 1906/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.59.0 (#3561) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0bb623e1c8..79c2d984d9 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.58.0 + 1.59.0 pom import From f3332cbef5847b75b3f0fe5edfd6bf94d6b19967 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Oct 2024 18:41:05 +0100 Subject: [PATCH 1907/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.43.3 (#3553) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 667606a0a4..a18bafdc3c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.43.1 + 2.43.3 From 7a03899d869d6f93891943159b56b69f3e8725fc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:21:56 -0400 Subject: [PATCH 1908/2268] chore(main): release 2.43.4-SNAPSHOT (#3560) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a371796e0d..4b1715bc20 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.3 + 2.43.4-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index c52bc5d4b7..dd70305e4d 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.3 + 2.43.4-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3 + 2.43.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 52538ce4f0..67ba9eae27 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.3 + 2.43.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.3 + 2.43.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 79c2d984d9..bf2518332b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.3 + 2.43.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3 + 2.43.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 358fb3bb4e..0f2e1b497e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3 + 2.43.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index aa33dddd58..5963ed5962 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.3:2.43.3 \ No newline at end of file +google-cloud-bigquery:2.43.3:2.43.4-SNAPSHOT \ No newline at end of file From bd24fd8c550bfbd1207b194ed5c863a4a9924d48 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:48:47 -0700 Subject: [PATCH 1909/2268] feat: Enable maxTimeTravelHours in BigQuery java client library (#3555) * Enable maxTimeTravelHours in BigQuery java client library The BigQuery API contains a field called maxTimeTravelHours that refers to the Time Travel Window feature. This feature allows users to query deleted or updated data for an amount of time specified in the maxTimeTravelHours parameter. This change exposes the maxTimeTravelHours to users of the client library so they can set and update the amount of time that deleted or updated data is stored for a given dataset. * Update maxTimeTravelHours description to match discovery doc. Fix formatting errors. * Add DatasetInfo.Builder.setMaxTimeTravelHours() to clirr-ignored file. --- .../clirr-ignored-differences.xml | 5 +++ .../com/google/cloud/bigquery/Dataset.java | 6 +++ .../google/cloud/bigquery/DatasetInfo.java | 29 +++++++++++++ .../cloud/bigquery/DatasetInfoTest.java | 23 +++++++++++ .../google/cloud/bigquery/DatasetTest.java | 5 +++ .../cloud/bigquery/it/ITBigQueryTest.java | 41 +++++++++++++++++++ 6 files changed, 109 insertions(+) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 9c69fd6a68..b6546847fe 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -129,4 +129,9 @@ com/google/cloud/bigquery/StandardTableDefinition* *BigLakeConfiguration(*) + + 7013 + com/google/cloud/bigquery/DatasetInfo* + *setMaxTimeTravelHours(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index daadb9a857..4fc8577853 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -164,6 +164,12 @@ public Builder setStorageBillingModel(String storageBillingModel) { return this; } + @Override + public Builder setMaxTimeTravelHours(Long maxTimeTravelHours) { + infoBuilder.setMaxTimeTravelHours(maxTimeTravelHours); + return this; + } + @Override public Dataset build() { return new Dataset(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index b5fabe97d1..f9b7f03e17 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -75,6 +75,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final String defaultCollation; private final ExternalDatasetReference externalDatasetReference; private final String storageBillingModel; + private final Long maxTimeTravelHours; /** A builder for {@code DatasetInfo} objects. */ public abstract static class Builder { @@ -142,6 +143,12 @@ public abstract Builder setExternalDatasetReference( */ public abstract Builder setStorageBillingModel(String storageBillingModel); + /** + * Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2 + * to 7 days). The default value is 168 hours if this is not set. The value may be {@code null}. + */ + public abstract Builder setMaxTimeTravelHours(Long maxTimeTravelHours); + /** * The default encryption key for all tables in the dataset. Once this property is set, all * newly-created partitioned tables in the dataset will have encryption key set to this value, @@ -200,6 +207,7 @@ static final class BuilderImpl extends Builder { private String defaultCollation; private ExternalDatasetReference externalDatasetReference; private String storageBillingModel; + private Long maxTimeTravelHours; BuilderImpl() {} @@ -221,6 +229,7 @@ static final class BuilderImpl extends Builder { this.defaultCollation = datasetInfo.defaultCollation; this.externalDatasetReference = datasetInfo.externalDatasetReference; this.storageBillingModel = datasetInfo.storageBillingModel; + this.maxTimeTravelHours = datasetInfo.maxTimeTravelHours; } BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) { @@ -260,6 +269,7 @@ public Acl apply(Dataset.Access accessPb) { ExternalDatasetReference.fromPb(datasetPb.getExternalDatasetReference()); } this.storageBillingModel = datasetPb.getStorageBillingModel(); + this.maxTimeTravelHours = datasetPb.getMaxTimeTravelHours(); } @Override @@ -372,6 +382,12 @@ public Builder setStorageBillingModel(String storageBillingModel) { return this; } + @Override + public Builder setMaxTimeTravelHours(Long maxTimeTravelHours) { + this.maxTimeTravelHours = maxTimeTravelHours; + return this; + } + @Override public DatasetInfo build() { return new DatasetInfo(this); @@ -396,6 +412,7 @@ public DatasetInfo build() { defaultCollation = builder.defaultCollation; externalDatasetReference = builder.externalDatasetReference; storageBillingModel = builder.storageBillingModel; + maxTimeTravelHours = builder.maxTimeTravelHours; } /** Returns the dataset identity. */ @@ -529,6 +546,14 @@ public String getStorageBillingModel() { return storageBillingModel; } + /** + * Returns the number of hours that deleted or updated data will be available to be queried for + * all tables in the dataset. + */ + public Long getMaxTimeTravelHours() { + return maxTimeTravelHours; + } + /** * Returns information about the external metadata storage where the dataset is defined. Filled * out when the dataset type is EXTERNAL. @@ -562,6 +587,7 @@ public String toString() { .add("defaultCollation", defaultCollation) .add("externalDatasetReference", externalDatasetReference) .add("storageBillingModel", storageBillingModel) + .add("maxTimeTravelHours", maxTimeTravelHours) .toString(); } @@ -646,6 +672,9 @@ public Dataset.Access apply(Acl acl) { if (storageBillingModel != null) { datasetPb.setStorageBillingModel(storageBillingModel); } + if (maxTimeTravelHours != null) { + datasetPb.setMaxTimeTravelHours(maxTimeTravelHours); + } return datasetPb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index df62b7dac8..49a392baf7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -59,6 +60,8 @@ public class DatasetInfoTest { private static final EncryptionConfiguration DATASET_ENCRYPTION_CONFIGURATION = EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); private static final String STORAGE_BILLING_MODEL = "LOGICAL"; + private static final Long MAX_TIME_TRAVEL_HOURS_5_DAYS = 120L; + private static final Long MAX_TIME_TRAVEL_HOURS_7_DAYS = 168L; private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = ExternalDatasetReference.newBuilder() @@ -81,6 +84,7 @@ public class DatasetInfoTest { .setDefaultEncryptionConfiguration(DATASET_ENCRYPTION_CONFIGURATION) .setDefaultPartitionExpirationMs(DEFAULT_PARTITION__EXPIRATION) .setStorageBillingModel(STORAGE_BILLING_MODEL) + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS_7_DAYS) .build(); private static final DatasetInfo DATASET_INFO_COMPLETE = DATASET_INFO @@ -92,6 +96,8 @@ public class DatasetInfoTest { DATASET_INFO.toBuilder().setAcl(ACCESS_RULES_IAM_MEMBER).build(); private static final DatasetInfo DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE = DATASET_INFO.toBuilder().setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE).build(); + private static final DatasetInfo DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS = + DATASET_INFO.toBuilder().setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS_5_DAYS).build(); @Test public void testToBuilder() { @@ -173,6 +179,10 @@ public void testBuilder() { EXTERNAL_DATASET_REFERENCE, DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.getExternalDatasetReference()); assertEquals(STORAGE_BILLING_MODEL, DATASET_INFO_COMPLETE.getStorageBillingModel()); + assertEquals(MAX_TIME_TRAVEL_HOURS_7_DAYS, DATASET_INFO.getMaxTimeTravelHours()); + assertEquals( + MAX_TIME_TRAVEL_HOURS_5_DAYS, + DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS.getMaxTimeTravelHours()); } @Test @@ -194,6 +204,7 @@ public void testOf() { assertTrue(datasetInfo.getLabels().isEmpty()); assertNull(datasetInfo.getExternalDatasetReference()); assertNull(datasetInfo.getStorageBillingModel()); + assertNull(datasetInfo.getMaxTimeTravelHours()); datasetInfo = DatasetInfo.of(DATASET_ID); assertEquals(DATASET_ID, datasetInfo.getDatasetId()); @@ -212,6 +223,7 @@ public void testOf() { assertTrue(datasetInfo.getLabels().isEmpty()); assertNull(datasetInfo.getExternalDatasetReference()); assertNull(datasetInfo.getStorageBillingModel()); + assertNull(datasetInfo.getMaxTimeTravelHours()); } @Test @@ -229,6 +241,16 @@ public void testSetProjectId() { assertEquals(DATASET_INFO_COMPLETE, DATASET_INFO.setProjectId("project")); } + @Test + public void testSetMaxTimeTravelHours() { + assertNotEquals( + DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS.getMaxTimeTravelHours(), + DATASET_INFO.getMaxTimeTravelHours()); + assertEquals( + DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS, + DATASET_INFO.toBuilder().setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS_5_DAYS).build()); + } + private void compareDatasets(DatasetInfo expected, DatasetInfo value) { assertEquals(expected, value); assertEquals(expected.getDatasetId(), value.getDatasetId()); @@ -249,5 +271,6 @@ private void compareDatasets(DatasetInfo expected, DatasetInfo value) { expected.getDefaultPartitionExpirationMs(), value.getDefaultPartitionExpirationMs()); assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); + assertEquals(expected.getMaxTimeTravelHours(), value.getMaxTimeTravelHours()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index bc42976b23..e2d7c635ce 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -67,6 +67,7 @@ public class DatasetTest { private static final DatasetInfo DATASET_INFO = DatasetInfo.newBuilder(DATASET_ID).build(); private static final Field FIELD = Field.of("FieldName", LegacySQLTypeName.INTEGER); private static final String STORAGE_BILLING_MODEL = "LOGICAL"; + private static final Long MAX_TIME_TRAVEL_HOURS = 168L; private static final StandardTableDefinition TABLE_DEFINITION = StandardTableDefinition.of(Schema.of(FIELD)); private static final ViewDefinition VIEW_DEFINITION = ViewDefinition.of("QUERY"); @@ -122,6 +123,7 @@ public void testBuilder() { .setSelfLink(SELF_LINK) .setLabels(LABELS) .setStorageBillingModel(STORAGE_BILLING_MODEL) + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) .build(); assertEquals(DATASET_ID, builtDataset.getDatasetId()); assertEquals(ACCESS_RULES, builtDataset.getAcl()); @@ -136,6 +138,7 @@ public void testBuilder() { assertEquals(SELF_LINK, builtDataset.getSelfLink()); assertEquals(LABELS, builtDataset.getLabels()); assertEquals(STORAGE_BILLING_MODEL, builtDataset.getStorageBillingModel()); + assertEquals(MAX_TIME_TRAVEL_HOURS, builtDataset.getMaxTimeTravelHours()); } @Test @@ -344,6 +347,7 @@ public void testExternalDatasetReference() { .setLabels(LABELS) .setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE) .setStorageBillingModel(STORAGE_BILLING_MODEL) + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) .build(); assertEquals( EXTERNAL_DATASET_REFERENCE, @@ -374,5 +378,6 @@ private void compareDatasetInfo(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.getLastModified(), value.getLastModified()); assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); + assertEquals(expected.getMaxTimeTravelHours(), value.getMaxTimeTravelHours()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index b1cb8d8451..86ccd7c7d8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -213,6 +213,8 @@ public class ITBigQueryTest { private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); private static final String RANDOM_ID = UUID.randomUUID().toString().substring(0, 8); private static final String STORAGE_BILLING_MODEL = "LOGICAL"; + private static final Long MAX_TIME_TRAVEL_HOURS = 120L; + private static final Long MAX_TIME_TRAVEL_HOURS_DEFAULT = 168L; private static final String CLOUD_SAMPLES_DATA = Optional.fromNullable(System.getenv("CLOUD_SAMPLES_DATA_BUCKET")).or("cloud-samples-data"); private static final Map LABELS = @@ -1214,6 +1216,7 @@ public void testGetDatasetWithSelectedFields() { assertNull(dataset.getLocation()); assertNull(dataset.getSelfLink()); assertNull(dataset.getStorageBillingModel()); + assertNull(dataset.getMaxTimeTravelHours()); } @Test @@ -1230,6 +1233,7 @@ public void testUpdateDataset() { assertThat(dataset.getDescription()).isEqualTo("Some Description"); assertThat(dataset.getLabels()).containsExactly("a", "b"); assertThat(dataset.getStorageBillingModel()).isNull(); + assertThat(dataset.getMaxTimeTravelHours()).isNull(); Map updateLabels = new HashMap<>(); updateLabels.put("x", "y"); @@ -1241,10 +1245,12 @@ public void testUpdateDataset() { .setDescription("Updated Description") .setLabels(updateLabels) .setStorageBillingModel("LOGICAL") + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) .build()); assertThat(updatedDataset.getDescription()).isEqualTo("Updated Description"); assertThat(updatedDataset.getLabels()).containsExactly("x", "y"); assertThat(updatedDataset.getStorageBillingModel()).isEqualTo("LOGICAL"); + assertThat(updatedDataset.getMaxTimeTravelHours()).isEqualTo(MAX_TIME_TRAVEL_HOURS); updatedDataset = bigquery.update(updatedDataset.toBuilder().setLabels(null).build()); assertThat(updatedDataset.getLabels()).isEmpty(); @@ -1275,6 +1281,7 @@ public void testUpdateDatasetWithSelectedFields() { assertNull(updatedDataset.getLocation()); assertNull(updatedDataset.getSelfLink()); assertNull(updatedDataset.getStorageBillingModel()); + assertNull(updatedDataset.getMaxTimeTravelHours()); assertTrue(dataset.delete()); } @@ -1630,6 +1637,40 @@ public void testCreateDatasetWithSpecifiedStorageBillingModel() { RemoteBigQueryHelper.forceDelete(bigquery, billingModelDataset); } + @Test + public void testCreateDatasetWithSpecificMaxTimeTravelHours() { + String timeTravelDataset = RemoteBigQueryHelper.generateDatasetName(); + DatasetInfo info = + DatasetInfo.newBuilder(timeTravelDataset) + .setDescription(DESCRIPTION) + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) + .setLabels(LABELS) + .build(); + bigquery.create(info); + + Dataset dataset = bigquery.getDataset(DatasetId.of(timeTravelDataset)); + assertEquals(MAX_TIME_TRAVEL_HOURS, dataset.getMaxTimeTravelHours()); + + RemoteBigQueryHelper.forceDelete(bigquery, timeTravelDataset); + } + + @Test + public void testCreateDatasetWithDefaultMaxTimeTravelHours() { + String timeTravelDataset = RemoteBigQueryHelper.generateDatasetName(); + DatasetInfo info = + DatasetInfo.newBuilder(timeTravelDataset) + .setDescription(DESCRIPTION) + .setLabels(LABELS) + .build(); + bigquery.create(info); + + Dataset dataset = bigquery.getDataset(DatasetId.of(timeTravelDataset)); + // In the backend, BigQuery sets the default Time Travel Window to be 168 hours (7 days). + assertEquals(MAX_TIME_TRAVEL_HOURS_DEFAULT, dataset.getMaxTimeTravelHours()); + + RemoteBigQueryHelper.forceDelete(bigquery, timeTravelDataset); + } + @Test public void testCreateDatasetWithDefaultCollation() { String collationDataset = RemoteBigQueryHelper.generateDatasetName(); From 20826f1b08a3cc5bdcce5637b7ea21d467b2bce2 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:06:59 -0400 Subject: [PATCH 1910/2268] fix: Update experimental methods documentation to @internalapi (#3552) * docs: Update experimental methods documentation to @InternalApi * docs: Update experimental methods documentation to @InternalApi --- .../cloud/bigquery/LoadConfiguration.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java index d4ed810449..58cf986706 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadConfiguration.java @@ -16,6 +16,7 @@ package com.google.cloud.bigquery; +import com.google.api.core.InternalApi; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; import com.google.cloud.bigquery.JobInfo.WriteDisposition; @@ -99,17 +100,17 @@ interface Builder { Builder setIgnoreUnknownValues(Boolean ignoreUnknownValues); /** - * [Experimental] Sets options allowing the schema of the destination table to be updated as a - * side effect of the load job. Schema update options are supported in two cases: when - * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination - * table is a partition of a table, specified by partition decorators. For normal tables, - * WRITE_TRUNCATE will always overwrite the schema. + * Sets options allowing the schema of the destination table to be updated as a side effect of + * the load job. Schema update options are supported in two cases: when writeDisposition is + * WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a + * partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE + * will always overwrite the schema. */ + @InternalApi Builder setSchemaUpdateOptions(List schemaUpdateOptions); - /** - * [Experimental] Sets automatic inference of the options and schema for CSV and JSON sources. - */ + /** Sets automatic inference of the options and schema for CSV and JSON sources. */ + @InternalApi Builder setAutodetect(Boolean autodetect); /** Sets the time partitioning specification for the destination table. */ @@ -202,18 +203,19 @@ interface Builder { DatastoreBackupOptions getDatastoreBackupOptions(); /** - * [Experimental] Returns options allowing the schema of the destination table to be updated as a - * side effect of the load job. Schema update options are supported in two cases: when - * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination - * table is a partition of a table, specified by partition decorators. For normal tables, - * WRITE_TRUNCATE will always overwrite the schema. + * Returns options allowing the schema of the destination table to be updated as a side effect of + * the load job. Schema update options are supported in two cases: when writeDisposition is + * WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition + * of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always + * overwrite the schema. */ + @InternalApi List getSchemaUpdateOptions(); /** - * [Experimental] Returns whether automatic inference of the options and schema for CSV and JSON - * sources is set. + * Returns whether automatic inference of the options and schema for CSV and JSON sources is set. */ + @InternalApi Boolean getAutodetect(); /** Returns the time partitioning specification defined for the destination table. */ From 26e4ac1d2e434448ed568144797cee8de4c336f4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 31 Oct 2024 18:08:52 +0100 Subject: [PATCH 1911/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.55.0 (#3558) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index bf2518332b..f24d9907fd 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.54.0 + 2.55.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index a18bafdc3c..5dd4a19a0c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.54.0 + 2.55.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0f2e1b497e..25a50c821d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.54.0 + 2.55.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 68190cb051..2e4556244f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.54.0 + 2.55.0 test From 20705d196e8bc2c7721f53705607da000e809b3c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 31 Oct 2024 19:17:51 +0100 Subject: [PATCH 1912/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.46.0 (#3562) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 5dd4a19a0c..22eaa7ee70 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.45.1 + 2.46.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 25a50c821d..286bafd799 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.45.1 + 2.46.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2e4556244f..709d349cc6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.45.1 + 2.46.0 test From 552f49132af370f66aa1ccdde86e6280f638da22 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:45:14 -0500 Subject: [PATCH 1913/2268] docs: fix BigQuery documentation formating (#3565) * fix parentheses and use @see to link direct link * more doc fix --- .../com/google/cloud/bigquery/BigQuery.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 675e6c1e86..613134fa06 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -244,8 +244,9 @@ private DatasetListOption(BigQueryRpc.Option option, Object value) { } /** - * Returns an option to specify a label filter. See - * https://cloud.google.com/bigquery/docs/adding-using-labels#filtering_datasets_using_labels + * Returns an option to specify a label filter. @see Filtering + * using labels * * @param labelFilter In the form "labels.key:value" */ @@ -280,7 +281,7 @@ private DatasetOption(BigQueryRpc.Option option, Object value) { /** * Returns an option to specify the dataset's fields to be returned by the RPC call. If this - * option is not provided all dataset's fields are returned. { code DatasetOption.fields} can be + * option is not provided all dataset's fields are returned. {@code DatasetOption.fields} can be * used to specify only the fields of interest. {@link Dataset#getDatasetId()} is always * returned, even if not specified. */ @@ -864,8 +865,7 @@ public int hashCode() { /** * Lists the project's datasets. This method returns partial information on each dataset: ({@link * Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and {@link - * Dataset#getGeneratedId()}). To get complete information use either {@link #getDataset(String, - * DatasetOption...)} or {@link #getDataset(DatasetId, DatasetOption...)}. + * Dataset#getGeneratedId()}). To get complete information use {@link #getDataset}. * *

    Example of listing datasets, specifying the page size. * @@ -884,8 +884,7 @@ public int hashCode() { /** * Lists the datasets in the provided project. This method returns partial information on each * dataset: ({@link Dataset#getDatasetId()}, {@link Dataset#getFriendlyName()} and {@link - * Dataset#getGeneratedId()}). To get complete information use either {@link #getDataset(String, - * DatasetOption...)} or {@link #getDataset(DatasetId, DatasetOption...)}. + * Dataset#getGeneratedId()}). To get complete information use either {@link #getDataset}. * *

    Example of listing datasets in a project, specifying the page size. * @@ -1205,7 +1204,7 @@ public int hashCode() { * Lists the tables in the dataset. This method returns partial information on each table: ({@link * Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type, * which is part of {@link Table#getDefinition()}). To get complete information use either {@link - * #getTable(TableId, TableOption...)} or {@link #getTable(String, String, TableOption...)}. + * #getTable}. * *

    Example of listing the tables in a dataset, specifying the page size. * @@ -1225,7 +1224,7 @@ public int hashCode() { * Lists the tables in the dataset. This method returns partial information on each table: ({@link * Table#getTableId()}, {@link Table#getFriendlyName()}, {@link Table#getGeneratedId()} and type, * which is part of {@link Table#getDefinition()}). To get complete information use either {@link - * #getTable(TableId, TableOption...)} or {@link #getTable(String, String, TableOption...)}. + * #getTable}. * *

    Example of listing the tables in a dataset. * @@ -1429,8 +1428,7 @@ TableResult listTableData( /** * Sends a job cancel request. This call will return immediately. The job status can then be - * checked using either {@link #getJob(JobId, JobOption...)} or {@link #getJob(String, - * JobOption...)}). + * checked by using {@link #getJob}. * *

    If the location of the job is not "US" or "EU", {@link #cancel(JobId)} must be used instead. * @@ -1454,8 +1452,7 @@ TableResult listTableData( /** * Sends a job cancel request. This call will return immediately. The job status can then be - * checked using either {@link #getJob(JobId, JobOption...)} or {@link #getJob(String, - * JobOption...)}). + * checked using {@link #getJob}. * *

    If the location of the job is not "US" or "EU", the {@code jobId} must specify the job * location. From e154ee300485dc9d900343a8b5ceb7f6633bc3ff Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Nov 2024 15:28:52 +0100 Subject: [PATCH 1914/2268] deps: update github/codeql-action action to v2.27.1 (#3567) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1be1c2a32a..8c490195b7 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@6a89f57882288b3d2f190cda65000eec9e9ebb7c # v2.27.0 + uses: github/codeql-action/upload-sarif@e96cea3a2effd357d270bca8686d8d8b04ee0773 # v2.27.1 with: sarif_file: results.sarif From b5ccfccb552e731ccb09be923715849a4282d44d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Nov 2024 17:03:36 +0100 Subject: [PATCH 1915/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20241027-2.0.0 (#3568) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f24d9907fd..4f9b2a8bb8 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20241013-2.0.0 + v2-rev20241027-2.0.0 From 3707a402039365c49e1976a388593f621231dc02 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 13 Nov 2024 18:24:53 +0100 Subject: [PATCH 1916/2268] deps: update github/codeql-action action to v2.27.3 (#3569) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8c490195b7..f7fa6605db 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e96cea3a2effd357d270bca8686d8d8b04ee0773 # v2.27.1 + uses: github/codeql-action/upload-sarif@cb6549f9103a3855e5c5084c8f44b706e1b0a83f # v2.27.3 with: sarif_file: results.sarif From 2c7b4f750f4c8bf03c0ba74402d745341382a209 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Nov 2024 00:49:30 +0100 Subject: [PATCH 1917/2268] deps: update github/codeql-action action to v2.27.4 (#3572) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f7fa6605db..7b7392924e 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@cb6549f9103a3855e5c5084c8f44b706e1b0a83f # v2.27.3 + uses: github/codeql-action/upload-sarif@5b62e7a9f186342c830e01bc69a4626fd1573b6e # v2.27.4 with: sarif_file: results.sarif From 8efbb39db8168456817dff4f52fd9278a633b65e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Nov 2024 00:50:36 +0100 Subject: [PATCH 1918/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.47.0 (#3573) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 22eaa7ee70..62a0e492eb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.46.0 + 2.47.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 286bafd799..9e713b908c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.46.0 + 2.47.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 709d349cc6..53dd50eb76 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.46.0 + 2.47.0 test From d5fa951b8255ec1bcbcdf9bb3c29f247e38a0c7e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 18 Nov 2024 00:51:01 +0100 Subject: [PATCH 1919/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.40.0 (#3576) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 4df9466e7d..39ab435d5d 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.39.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 4bc28d0afa..30a89e0a55 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.39.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 33a4a9d957..b78f2e1fa4 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.39.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index ba53eb9ce2..4dbae8340e 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.39.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 418a399b75..a836c97f04 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.39.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index dd70305e4d..c5107c5cbf 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.39.0 + 3.40.0 diff --git a/pom.xml b/pom.xml index 4f9b2a8bb8..b55af2977b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.39.0 + 3.40.0 From 4207f44453427a1d2a5da54e98d957b4c54e1917 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:26:46 -0500 Subject: [PATCH 1920/2268] chore(main): release 2.44.0 (#3563) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 37 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac6b1d9e93..7c9f9565ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.44.0](https://github.com/googleapis/java-bigquery/compare/v2.43.3...v2.44.0) (2024-11-17) + + +### Features + +* Enable maxTimeTravelHours in BigQuery java client library ([#3555](https://github.com/googleapis/java-bigquery/issues/3555)) ([bd24fd8](https://github.com/googleapis/java-bigquery/commit/bd24fd8c550bfbd1207b194ed5c863a4a9924d48)) + + +### Bug Fixes + +* Update experimental methods documentation to [@internalapi](https://github.com/internalapi) ([#3552](https://github.com/googleapis/java-bigquery/issues/3552)) ([20826f1](https://github.com/googleapis/java-bigquery/commit/20826f1b08a3cc5bdcce5637b7ea21d467b2bce2)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.55.0 ([#3559](https://github.com/googleapis/java-bigquery/issues/3559)) ([950ad0c](https://github.com/googleapis/java-bigquery/commit/950ad0cce6370e332a568d3b2e9ef3911503d206)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20241027-2.0.0 ([#3568](https://github.com/googleapis/java-bigquery/issues/3568)) ([b5ccfcc](https://github.com/googleapis/java-bigquery/commit/b5ccfccb552e731ccb09be923715849a4282d44d)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.59.0 ([#3561](https://github.com/googleapis/java-bigquery/issues/3561)) ([1bd24a1](https://github.com/googleapis/java-bigquery/commit/1bd24a1ad28d168587b7cba95ec348cb1308a803)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.40.0 ([#3576](https://github.com/googleapis/java-bigquery/issues/3576)) ([d5fa951](https://github.com/googleapis/java-bigquery/commit/d5fa951b8255ec1bcbcdf9bb3c29f247e38a0c7e)) +* Update github/codeql-action action to v2.27.1 ([#3567](https://github.com/googleapis/java-bigquery/issues/3567)) ([e154ee3](https://github.com/googleapis/java-bigquery/commit/e154ee300485dc9d900343a8b5ceb7f6633bc3ff)) +* Update github/codeql-action action to v2.27.3 ([#3569](https://github.com/googleapis/java-bigquery/issues/3569)) ([3707a40](https://github.com/googleapis/java-bigquery/commit/3707a402039365c49e1976a388593f621231dc02)) +* Update github/codeql-action action to v2.27.4 ([#3572](https://github.com/googleapis/java-bigquery/issues/3572)) ([2c7b4f7](https://github.com/googleapis/java-bigquery/commit/2c7b4f750f4c8bf03c0ba74402d745341382a209)) + + +### Documentation + +* Fix BigQuery documentation formating ([#3565](https://github.com/googleapis/java-bigquery/issues/3565)) ([552f491](https://github.com/googleapis/java-bigquery/commit/552f49132af370f66aa1ccdde86e6280f638da22)) + ## [2.43.3](https://github.com/googleapis/java-bigquery/compare/v2.43.2...v2.43.3) (2024-10-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4b1715bc20..e7c22a8df3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.43.4-SNAPSHOT + 2.44.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index c5107c5cbf..9e21d015b0 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.43.4-SNAPSHOT + 2.44.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.43.4-SNAPSHOT + 2.44.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 67ba9eae27..e4a5bb416c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.43.4-SNAPSHOT + 2.44.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.43.4-SNAPSHOT + 2.44.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b55af2977b..3ff9940dea 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.43.4-SNAPSHOT + 2.44.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.43.4-SNAPSHOT + 2.44.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9e713b908c..8f2ddaee2b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.43.4-SNAPSHOT + 2.44.0 diff --git a/versions.txt b/versions.txt index 5963ed5962..e384f6fdaa 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.43.3:2.43.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.44.0:2.44.0 \ No newline at end of file From 829086560d3b0600d3dd2e335599c44abf3fb4a6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 02:45:16 -0500 Subject: [PATCH 1921/2268] chore(main): release 2.44.1-SNAPSHOT (#3577) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index e7c22a8df3..a459346de3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.44.0 + 2.44.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 9e21d015b0..71accd6f7c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.44.0 + 2.44.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.44.0 + 2.44.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e4a5bb416c..0feea48304 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.44.0 + 2.44.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.44.0 + 2.44.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3ff9940dea..7888df5316 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.44.0 + 2.44.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.44.0 + 2.44.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8f2ddaee2b..add00b377c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.44.0 + 2.44.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index e384f6fdaa..530a7c3ed7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.44.0:2.44.0 \ No newline at end of file +google-cloud-bigquery:2.44.0:2.44.1-SNAPSHOT \ No newline at end of file From 6a7401af5e458e15815284c1a2d86ce50476e48e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:17:52 +0100 Subject: [PATCH 1922/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.45.0 (#3579) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7888df5316..86986753d1 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.44.1 + 2.45.0 test From d0116ee427c6d2e95736a36db9d563482bf5dca1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:18:17 +0100 Subject: [PATCH 1923/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.10.3 (#3580) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86986753d1..d44623ff16 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.10.2 + 3.10.3 pom import From fbfc5bcfbe6a365d099c9b1aae0ec485706f02fa Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:19:08 +0100 Subject: [PATCH 1924/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.56.0 (#3581) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d44623ff16..a82eb5f235 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.55.0 + 2.56.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 62a0e492eb..76fa79c4de 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.55.0 + 2.56.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index add00b377c..08985bc57d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.55.0 + 2.56.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 53dd50eb76..32014ec9d3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.55.0 + 2.56.0 test From 34dd8bc22c8188f2b61dc9939b24a8d820548e2b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:19:31 +0100 Subject: [PATCH 1925/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.60.0 (#3583) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a82eb5f235..9219ca1ecf 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.59.0 + 1.60.0 pom import From e4600f1a71b00a83f5161bf7fcd3fc55ba32ab78 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:21:26 +0100 Subject: [PATCH 1926/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.44.0 (#3584) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 76fa79c4de..60d8d34d6b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.43.3 + 2.44.0 From d2ae87ba43f53ca703ca51335a05a9c1865ca8c0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:22:39 +0100 Subject: [PATCH 1927/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.48.0 (#3585) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 60d8d34d6b..32cb239d6f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.47.0 + 2.48.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 08985bc57d..3f0b600223 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.47.0 + 2.48.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 32014ec9d3..dd4aa5e9e5 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.47.0 + 2.48.0 test From 3f9407570fea5317aaf212b058ca1da05985eda9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Nov 2024 09:23:03 +0100 Subject: [PATCH 1928/2268] deps: update github/codeql-action action to v2.27.5 (#3588) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 7b7392924e..e82f85f397 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@5b62e7a9f186342c830e01bc69a4626fd1573b6e # v2.27.4 + uses: github/codeql-action/upload-sarif@e2b57b01d64b69ac273abfbea5d3ed15231e1706 # v2.27.5 with: sarif_file: results.sarif From 6767aaeb9735db15bcff8e9b90a473ea460faf51 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:45:11 +0000 Subject: [PATCH 1929/2268] chore: mark the unmanaged dependency check required (#3593) --- .github/sync-repo-settings.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index fc078dbe3f..be7c5c0fe1 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -16,6 +16,7 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - javadoc + - unmanaged_dependency_check - pattern: 1.127.12-sp isAdminEnforced: true requiredApprovingReviewCount: 1 From 616ee2aa8ccf3d2975274b256252f2f249775960 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 2 Dec 2024 04:34:03 +0100 Subject: [PATCH 1930/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.56.0 (#3582) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9219ca1ecf..2e94bc0248 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.55.0 + 2.56.0 test From 3eef3a9959bcfdb76c26fdf9069d9acf89f93a7a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 2 Dec 2024 04:34:18 +0100 Subject: [PATCH 1931/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20241111-2.0.0 (#3591) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2e94bc0248..2eabd261cc 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20241027-2.0.0 + v2-rev20241111-2.0.0 From c0b874aa0150e63908450b13d019864b8cbfbfe3 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:25:38 -0800 Subject: [PATCH 1932/2268] feat: Enable Lossless Timestamps in BQ java client lib (#3589) * feat: Enable Lossless Timestamps in BQ java client lib * Fix Formatting. * Fix tests for FieldValue and FieldValueList. * Add more robust testing to IT test, minor formatting fixes. --- .../google/cloud/bigquery/BigQueryImpl.java | 18 ++++--- .../cloud/bigquery/BigQueryOptions.java | 18 ++++++- .../com/google/cloud/bigquery/FieldValue.java | 51 ++++++++++++++----- .../google/cloud/bigquery/FieldValueList.java | 8 ++- .../cloud/bigquery/QueryRequestInfo.java | 12 ++++- .../cloud/bigquery/FieldValueListTest.java | 26 ++++++++++ .../google/cloud/bigquery/FieldValueTest.java | 19 +++++++ .../cloud/bigquery/QueryRequestInfoTest.java | 23 +++++++-- .../cloud/bigquery/it/ITBigQueryTest.java | 36 +++++++++++++ 9 files changed, 183 insertions(+), 28 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 5760832157..770345000c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1206,7 +1206,7 @@ public TableDataList call() { new PageImpl<>( new TableDataPageFetcher(tableId, schema, serviceOptions, cursor, pageOptionMap), cursor, - transformTableData(result.getRows(), schema)), + transformTableData(result.getRows(), schema, serviceOptions.getUseInt64Timestamps())), result.getTotalRows()); } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -1214,7 +1214,7 @@ public TableDataList call() { } private static Iterable transformTableData( - Iterable tableDataPb, final Schema schema) { + Iterable tableDataPb, final Schema schema, boolean useInt64Timestamps) { return ImmutableList.copyOf( Iterables.transform( tableDataPb != null ? tableDataPb : ImmutableList.of(), @@ -1223,7 +1223,7 @@ private static Iterable transformTableData( @Override public FieldValueList apply(TableRow rowPb) { - return FieldValueList.fromPb(rowPb.getF(), fields); + return FieldValueList.fromPb(rowPb.getF(), fields, useInt64Timestamps); } })); } @@ -1347,7 +1347,8 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path - QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); + QueryRequestInfo requestInfo = + new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); if (requestInfo.isFastQuerySupported(null)) { String projectId = getOptions().getProjectId(); QueryRequest content = requestInfo.toPb(); @@ -1420,7 +1421,8 @@ public com.google.api.services.bigquery.model.QueryResponse call() { // fetch next pages of results new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), cursor, - transformTableData(results.getRows(), schema))) + transformTableData( + results.getRows(), schema, getOptions().getUseInt64Timestamps()))) .setJobId(jobId) .setQueryId(results.getQueryId()) .build(); @@ -1433,7 +1435,8 @@ public com.google.api.services.bigquery.model.QueryResponse call() { new PageImpl<>( new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), null, - transformTableData(results.getRows(), schema))) + transformTableData( + results.getRows(), schema, getOptions().getUseInt64Timestamps()))) // Return the JobID of the successful job .setJobId( results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) @@ -1448,7 +1451,8 @@ public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOp // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path - QueryRequestInfo requestInfo = new QueryRequestInfo(configuration); + QueryRequestInfo requestInfo = + new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); if (requestInfo.isFastQuerySupported(jobId)) { // Be careful when setting the projectID in JobId, if a projectID is specified in the JobId, // the job created by the query method will use that project. This may cause the query to diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index e53439f023..465cc83058 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -34,10 +34,11 @@ public class BigQueryOptions extends ServiceOptions { private static final int DEFAULT_READ_API_TIME_OUT = 60000; private static final String BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery"; private static final Set SCOPES = ImmutableSet.of(BIGQUERY_SCOPE); - private static final long serialVersionUID = -2437598817433266049L; + private static final long serialVersionUID = -2437598817433266048L; private final String location; // set the option ThrowNotFound when you want to throw the exception when the value not found private boolean setThrowNotFound; + private boolean useInt64Timestamps; private String queryPreviewEnabled = System.getenv("QUERY_PREVIEW_ENABLED"); public static class DefaultBigQueryFactory implements BigQueryFactory { @@ -63,6 +64,7 @@ public ServiceRpc create(BigQueryOptions options) { public static class Builder extends ServiceOptions.Builder { private String location; + private boolean useInt64Timestamps; private Builder() {} @@ -84,6 +86,11 @@ public Builder setLocation(String location) { return this; } + public Builder setUseInt64Timestamps(boolean useInt64Timestamps) { + this.useInt64Timestamps = useInt64Timestamps; + return this; + } + @Override public BigQueryOptions build() { return new BigQueryOptions(this); @@ -93,6 +100,7 @@ public BigQueryOptions build() { private BigQueryOptions(Builder builder) { super(BigQueryFactory.class, BigQueryRpcFactory.class, builder, new BigQueryDefaults()); this.location = builder.location; + this.useInt64Timestamps = builder.useInt64Timestamps; } private static class BigQueryDefaults implements ServiceDefaults { @@ -140,6 +148,10 @@ public void setThrowNotFound(boolean setThrowNotFound) { this.setThrowNotFound = setThrowNotFound; } + public void setUseInt64Timestamps(boolean useInt64Timestamps) { + this.useInt64Timestamps = useInt64Timestamps; + } + @VisibleForTesting public void setQueryPreviewEnabled(String queryPreviewEnabled) { this.queryPreviewEnabled = queryPreviewEnabled; @@ -149,6 +161,10 @@ public boolean getThrowNotFound() { return setThrowNotFound; } + public boolean getUseInt64Timestamps() { + return useInt64Timestamps; + } + @SuppressWarnings("unchecked") @Override public Builder toBuilder() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java index c5a8fab07c..d11df4b956 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValue.java @@ -26,6 +26,7 @@ import com.google.common.io.BaseEncoding; import java.io.Serializable; import java.math.BigDecimal; +import java.math.BigInteger; import java.math.RoundingMode; import java.time.Duration; import java.time.Instant; @@ -46,10 +47,11 @@ public class FieldValue implements Serializable { private static final int MICROSECONDS = 1000000; - private static final long serialVersionUID = 469098630191710061L; + private static final long serialVersionUID = 469098630191710062L; private final Attribute attribute; private final Object value; + private final Boolean useInt64Timestamps; /** The field value's attribute, giving information on the field's content type. */ public enum Attribute { @@ -74,8 +76,13 @@ public enum Attribute { } private FieldValue(Attribute attribute, Object value) { + this(attribute, value, false); + } + + private FieldValue(Attribute attribute, Object value, Boolean useInt64Timestamps) { this.attribute = checkNotNull(attribute); this.value = value; + this.useInt64Timestamps = useInt64Timestamps; } /** @@ -107,6 +114,10 @@ public Object getValue() { return value; } + public Boolean getUseInt64Timestamps() { + return useInt64Timestamps; + } + /** * Returns this field's value as a {@link String}. This method should only be used if the * corresponding field has primitive type ({@link LegacySQLTypeName#BYTES}, {@link @@ -207,6 +218,9 @@ public boolean getBooleanValue() { */ @SuppressWarnings("unchecked") public long getTimestampValue() { + if (useInt64Timestamps) { + return new BigInteger(getStringValue()).longValue(); + } // timestamps are encoded in the format 1408452095.22 where the integer part is seconds since // epoch (e.g. 1408452095.22 == 2014-08-19 07:41:35.220 -05:00) BigDecimal secondsWithMicro = new BigDecimal(getStringValue()); @@ -317,12 +331,13 @@ public String toString() { return MoreObjects.toStringHelper(this) .add("attribute", attribute) .add("value", value) + .add("useInt64Timestamps", useInt64Timestamps) .toString(); } @Override public final int hashCode() { - return Objects.hash(attribute, value); + return Objects.hash(attribute, value, useInt64Timestamps); } @Override @@ -334,7 +349,9 @@ public final boolean equals(Object obj) { return false; } FieldValue other = (FieldValue) obj; - return attribute == other.attribute && Objects.equals(value, other.value); + return attribute == other.attribute + && Objects.equals(value, other.value) + && Objects.equals(useInt64Timestamps, other.useInt64Timestamps); } /** @@ -353,29 +370,38 @@ public final boolean equals(Object obj) { */ @BetaApi public static FieldValue of(Attribute attribute, Object value) { - return new FieldValue(attribute, value); + return of(attribute, value, false); + } + + @BetaApi + public static FieldValue of(Attribute attribute, Object value, Boolean useInt64Timestamps) { + return new FieldValue(attribute, value, useInt64Timestamps); } static FieldValue fromPb(Object cellPb) { - return fromPb(cellPb, null); + return fromPb(cellPb, null, false); } @SuppressWarnings("unchecked") - static FieldValue fromPb(Object cellPb, Field recordSchema) { + static FieldValue fromPb(Object cellPb, Field recordSchema, Boolean useInt64Timestamps) { if (Data.isNull(cellPb)) { - return FieldValue.of(Attribute.PRIMITIVE, null); + return FieldValue.of(Attribute.PRIMITIVE, null, useInt64Timestamps); } if (cellPb instanceof String) { if ((recordSchema != null) && (recordSchema.getType() == LegacySQLTypeName.RANGE) && (recordSchema.getRangeElementType() != null)) { return FieldValue.of( - Attribute.RANGE, Range.of((String) cellPb, recordSchema.getRangeElementType())); + Attribute.RANGE, + Range.of((String) cellPb, recordSchema.getRangeElementType()), + useInt64Timestamps); } - return FieldValue.of(Attribute.PRIMITIVE, cellPb); + return FieldValue.of(Attribute.PRIMITIVE, cellPb, useInt64Timestamps); } if (cellPb instanceof List) { - return FieldValue.of(Attribute.REPEATED, FieldValueList.fromPb((List) cellPb, null)); + return FieldValue.of( + Attribute.REPEATED, + FieldValueList.fromPb((List) cellPb, null, useInt64Timestamps)); } if (cellPb instanceof Map) { Map cellMapPb = (Map) cellPb; @@ -383,12 +409,13 @@ static FieldValue fromPb(Object cellPb, Field recordSchema) { FieldList subFieldsSchema = recordSchema != null ? recordSchema.getSubFields() : null; return FieldValue.of( Attribute.RECORD, - FieldValueList.fromPb((List) cellMapPb.get("f"), subFieldsSchema)); + FieldValueList.fromPb( + (List) cellMapPb.get("f"), subFieldsSchema, useInt64Timestamps)); } // This should never be the case when we are processing a first level table field (i.e. a // row's field, not a record sub-field) if (cellMapPb.containsKey("v")) { - return FieldValue.fromPb(cellMapPb.get("v"), recordSchema); + return FieldValue.fromPb(cellMapPb.get("v"), recordSchema, useInt64Timestamps); } } throw new IllegalArgumentException("Unexpected table cell format"); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java index 5035bb164a..18d2155a58 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java @@ -112,6 +112,10 @@ FieldValueList withSchema(FieldList schema) { } static FieldValueList fromPb(List rowPb, FieldList schema) { + return fromPb(rowPb, schema, false); + } + + static FieldValueList fromPb(List rowPb, FieldList schema, Boolean useInt64Timestamps) { List row = new ArrayList<>(rowPb.size()); if (schema != null) { if (schema.size() != rowPb.size()) { @@ -120,11 +124,11 @@ static FieldValueList fromPb(List rowPb, FieldList schema) { Iterator schemaIter = schema.iterator(); Iterator rowPbIter = rowPb.iterator(); while (rowPbIter.hasNext() && schemaIter.hasNext()) { - row.add(FieldValue.fromPb(rowPbIter.next(), schemaIter.next())); + row.add(FieldValue.fromPb(rowPbIter.next(), schemaIter.next(), useInt64Timestamps)); } } else { for (Object cellPb : rowPb) { - row.add(FieldValue.fromPb(cellPb, null)); + row.add(FieldValue.fromPb(cellPb, null, useInt64Timestamps)); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 00a11f723b..1a56872a15 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -16,6 +16,7 @@ package com.google.cloud.bigquery; +import com.google.api.services.bigquery.model.DataFormatOptions; import com.google.api.services.bigquery.model.QueryParameter; import com.google.api.services.bigquery.model.QueryRequest; import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; @@ -42,8 +43,9 @@ final class QueryRequestInfo { private final Boolean useQueryCache; private final Boolean useLegacySql; private final JobCreationMode jobCreationMode; + private final DataFormatOptions formatOptions; - QueryRequestInfo(QueryJobConfiguration config) { + QueryRequestInfo(QueryJobConfiguration config, Boolean useInt64Timestamps) { this.config = config; this.connectionProperties = config.getConnectionProperties(); this.defaultDataset = config.getDefaultDataset(); @@ -58,6 +60,7 @@ final class QueryRequestInfo { this.useLegacySql = config.useLegacySql(); this.useQueryCache = config.useQueryCache(); this.jobCreationMode = config.getJobCreationMode(); + this.formatOptions = new DataFormatOptions().setUseInt64Timestamp(useInt64Timestamps); } boolean isFastQuerySupported(JobId jobId) { @@ -122,6 +125,9 @@ QueryRequest toPb() { if (jobCreationMode != null) { request.setJobCreationMode(jobCreationMode.toString()); } + if (formatOptions != null) { + request.setFormatOptions(formatOptions); + } return request; } @@ -141,6 +147,7 @@ public String toString() { .add("useQueryCache", useQueryCache) .add("useLegacySql", useLegacySql) .add("jobCreationMode", jobCreationMode) + .add("formatOptions", formatOptions.getUseInt64Timestamp()) .toString(); } @@ -159,7 +166,8 @@ public int hashCode() { createSession, useQueryCache, useLegacySql, - jobCreationMode); + jobCreationMode, + formatOptions); } @Override diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java index 7d10a97504..5ade7c2298 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import com.google.api.client.util.Data; @@ -52,6 +53,12 @@ public class FieldValueListTest { Field.of("tenth", LegacySQLTypeName.NUMERIC), Field.of("eleventh", LegacySQLTypeName.BIGNUMERIC)); + private final FieldList schemaLosslessTimestamp = + FieldList.of( + Field.of("first", LegacySQLTypeName.BOOLEAN), + Field.of("second", LegacySQLTypeName.INTEGER), + Field.of("third", LegacySQLTypeName.TIMESTAMP)); + private final Map integerPb = ImmutableMap.of("v", "1"); private final Map floatPb = ImmutableMap.of("v", "1.5"); private final Map stringPb = ImmutableMap.of("v", "string"); @@ -68,10 +75,15 @@ public class FieldValueListTest { "v", "99999999999999999999999999999999999999.99999999999999999999999999999999999999"); private final FieldValue booleanFv = FieldValue.of(Attribute.PRIMITIVE, "false"); + private final FieldValue booleanLosslessTimestampFv = + FieldValue.of(Attribute.PRIMITIVE, "false", true); private final FieldValue integerFv = FieldValue.of(Attribute.PRIMITIVE, "1"); + private final FieldValue integerLosslessTimestampFv = + FieldValue.of(Attribute.PRIMITIVE, "1", true); private final FieldValue floatFv = FieldValue.of(Attribute.PRIMITIVE, "1.5"); private final FieldValue stringFv = FieldValue.of(Attribute.PRIMITIVE, "string"); private final FieldValue timestampFv = FieldValue.of(Attribute.PRIMITIVE, "42"); + private final FieldValue losslessTimestampFv = FieldValue.of(Attribute.PRIMITIVE, "42", true); private final FieldValue bytesFv = FieldValue.of(Attribute.PRIMITIVE, BYTES_BASE64); private final FieldValue nullFv = FieldValue.of(Attribute.PRIMITIVE, null); private final FieldValue repeatedFv = @@ -117,11 +129,25 @@ public class FieldValueListTest { bigNumericFv), schema); + private final List fieldValuesLosslessTimestampPb = + ImmutableList.of(booleanPb, integerPb, timestampPb); + private final FieldValueList fieldValuesLosslessTimestamp = + FieldValueList.of( + ImmutableList.of( + booleanLosslessTimestampFv, integerLosslessTimestampFv, losslessTimestampFv), + schemaLosslessTimestamp); + @Test public void testFromPb() { assertEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, schema)); // Schema does not influence values equality assertEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null)); + + assertNotEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null, true)); + + assertEquals( + fieldValuesLosslessTimestamp, + FieldValueList.fromPb(fieldValuesLosslessTimestampPb, null, true)); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index 6dbe817078..4ec527f7ce 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -132,6 +132,25 @@ public void testTimestamp() { assertEquals(expected, received); } + @Test + public void testInt64Timestamp() { + FieldValue lossyFieldValue = + FieldValue.of(FieldValue.Attribute.PRIMITIVE, "1.9954383398377106E10"); + long lossy = lossyFieldValue.getTimestampValue(); + + FieldValue losslessFieldValue = + FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", true); + long lossless = losslessFieldValue.getTimestampValue(); + + assertEquals(lossy, lossless); + + FieldValue fieldValue = + FieldValue.of(FieldValue.Attribute.PRIMITIVE, "19954383398377106", true); + long received = fieldValue.getTimestampValue(); + long expected = 19954383398377106L; + assertEquals(expected, received); + } + @Test public void testEquals() { FieldValue booleanValue = FieldValue.of(FieldValue.Attribute.PRIMITIVE, "false"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 0d9464c768..420c014846 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -17,7 +17,9 @@ package com.google.cloud.bigquery; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertTrue; import com.google.api.services.bigquery.model.QueryRequest; import com.google.cloud.bigquery.JobInfo.CreateDisposition; @@ -136,7 +138,7 @@ public class QueryRequestInfoTest { .setMaxResults(100L) .setJobCreationMode(jobCreationModeRequired) .build(); - QueryRequestInfo REQUEST_INFO = new QueryRequestInfo(QUERY_JOB_CONFIGURATION); + QueryRequestInfo REQUEST_INFO = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SUPPORTED = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -150,7 +152,8 @@ public class QueryRequestInfoTest { .setCreateSession(CREATE_SESSION) .setMaxResults(100L) .build(); - QueryRequestInfo REQUEST_INFO_SUPPORTED = new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED); + QueryRequestInfo REQUEST_INFO_SUPPORTED = + new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED, false); @Test public void testIsFastQuerySupported() { @@ -171,8 +174,19 @@ public void testToPb() { @Test public void equalTo() { compareQueryRequestInfo( - new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED), REQUEST_INFO_SUPPORTED); - compareQueryRequestInfo(new QueryRequestInfo(QUERY_JOB_CONFIGURATION), REQUEST_INFO); + new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED, false), REQUEST_INFO_SUPPORTED); + compareQueryRequestInfo(new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false), REQUEST_INFO); + } + + @Test + public void testInt64Timestamp() { + QueryRequestInfo requestInfo = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false); + QueryRequest requestPb = requestInfo.toPb(); + assertFalse(requestPb.getFormatOptions().getUseInt64Timestamp()); + + QueryRequestInfo requestInfoLosslessTs = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, true); + QueryRequest requestLosslessTsPb = requestInfoLosslessTs.toPb(); + assertTrue(requestLosslessTsPb.getFormatOptions().getUseInt64Timestamp()); } /* @@ -199,5 +213,6 @@ private void compareQueryRequestInfo(QueryRequestInfo expected, QueryRequestInfo assertEquals(expectedQueryReq.getUseQueryCache(), actualQueryReq.getUseQueryCache()); assertEquals(expectedQueryReq.getUseLegacySql(), actualQueryReq.getUseLegacySql()); assertEquals(expectedQueryReq.get("jobCreationMode"), actualQueryReq.get("jobCreationMode")); + assertEquals(expectedQueryReq.getFormatOptions(), actualQueryReq.getFormatOptions()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 86ccd7c7d8..84944d49c7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3235,6 +3235,42 @@ public void testTimestamp() throws InterruptedException { } } + @Test + public void testLosslessTimestamp() throws InterruptedException { + String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; + long expectedTimestamp = 1643068465095574L; + + TableResult result = + bigquery.query( + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .build()); + assertNotNull(result.getJobId()); + for (FieldValueList row : result.getValues()) { + FieldValue timeStampCell = row.get(0); + assertFalse(timeStampCell.getUseInt64Timestamps()); + assertEquals(expectedTimestamp, timeStampCell.getTimestampValue()); + } + + // Create new BQ object to toggle lossless timestamps without affecting + // other tests. + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQuery bigqueryLossless = bigqueryHelper.getOptions().getService(); + bigqueryLossless.getOptions().setUseInt64Timestamps(true); + + TableResult resultLossless = + bigqueryLossless.query( + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DatasetId.of(DATASET)) + .build()); + assertNotNull(resultLossless.getJobId()); + for (FieldValueList row : resultLossless.getValues()) { + FieldValue timeStampCellLossless = row.get(0); + assertTrue(timeStampCellLossless.getUseInt64Timestamps()); + assertEquals(expectedTimestamp, timeStampCellLossless.getTimestampValue()); + } + } + /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQuery() throws InterruptedException { From 31fb15fb963c18e4c29391e9fe56dfde31577511 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Mon, 2 Dec 2024 19:27:31 -0500 Subject: [PATCH 1933/2268] feat: introduce `java.time` methods and variables (#3586) * feat: introduce `java.time` methods and variables * remove threeten dependency --- google-cloud-bigquery/pom.xml | 4 --- .../cloud/bigquery/benchmark/Benchmark.java | 6 ++--- .../google/cloud/bigquery/BigQueryImpl.java | 6 ++--- .../bigquery/BigQueryRetryAlgorithm.java | 4 +-- .../java/com/google/cloud/bigquery/Job.java | 14 +++++------ .../cloud/bigquery/QueryParameterValue.java | 25 +++++++++++-------- .../testing/RemoteBigQueryHelper.java | 12 ++++----- .../com/google/cloud/bigquery/JobTest.java | 9 ++++--- .../bigquery/QueryParameterValueTest.java | 21 ++++++++-------- .../cloud/bigquery/it/ITBigQueryTest.java | 8 +++--- .../testing/RemoteBigQueryHelperTest.java | 8 +++--- 11 files changed, 59 insertions(+), 58 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 0feea48304..4ddcb2d771 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -85,10 +85,6 @@ com.google.api gax - - org.threeten - threetenbp - com.google.code.gson gson diff --git a/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java b/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java index caec16676f..9d05f6b2b4 100644 --- a/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java +++ b/google-cloud-bigquery/src/benchmark/java/com/google/cloud/bigquery/benchmark/Benchmark.java @@ -23,10 +23,10 @@ import com.google.cloud.bigquery.QueryJobConfiguration; import com.google.cloud.bigquery.TableResult; import java.io.FileInputStream; +import java.time.Clock; +import java.time.Duration; +import java.time.Instant; import java.util.List; -import org.threeten.bp.Clock; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; public class Benchmark { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 770345000c..23cb001ac2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -60,8 +60,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.checkerframework.checker.nullness.qual.NonNull; -import org.threeten.bp.Instant; -import org.threeten.bp.temporal.ChronoUnit; final class BigQueryImpl extends BaseService implements BigQuery { @@ -450,7 +448,9 @@ public com.google.api.services.bigquery.model.Job call() { long jobCreationTime = job.getStatistics().getCreationTime(); long jobMinStaleTime = System.currentTimeMillis(); long jobMaxStaleTime = - Instant.ofEpochMilli(jobMinStaleTime).minus(1, ChronoUnit.DAYS).toEpochMilli(); + java.time.Instant.ofEpochMilli(jobMinStaleTime) + .minus(1, java.time.temporal.ChronoUnit.DAYS) + .toEpochMilli(); // Only return the job if it has been created in the past 24 hours. // This is assuming any job older than 24 hours is a valid duplicate JobID diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index 0429b7f005..7b168c12d1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -27,13 +27,13 @@ import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import java.time.Duration; import java.util.Iterator; import java.util.UUID; import java.util.concurrent.CancellationException; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; -import org.threeten.bp.Duration; public class BigQueryRetryAlgorithm extends RetryAlgorithm { private final BigQueryRetryConfig bigQueryRetryConfig; @@ -67,7 +67,7 @@ public boolean shouldRetry( // Log retry info int attemptCount = nextAttemptSettings == null ? 0 : nextAttemptSettings.getAttemptCount(); Duration retryDelay = - nextAttemptSettings == null ? Duration.ZERO : nextAttemptSettings.getRetryDelay(); + nextAttemptSettings == null ? Duration.ZERO : nextAttemptSettings.getRetryDelayDuration(); String errorMessage = previousThrowable != null ? previousThrowable.getMessage() : ""; // Implementing shouldRetryBasedOnBigQueryRetryConfig so that we can retry exceptions based on diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 793b25687b..00edefb9fb 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -31,13 +31,13 @@ import com.google.common.collect.ImmutableList; import java.io.IOException; import java.io.ObjectInputStream; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; -import org.threeten.bp.Duration; /** * A Google BigQuery Job. @@ -52,20 +52,20 @@ public class Job extends JobInfo { private static final RetrySettings DEFAULT_JOB_WAIT_SETTINGS = RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofHours(12L)) - .setInitialRetryDelay(Duration.ofSeconds(1L)) + .setTotalTimeoutDuration(Duration.ofHours(12L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(1L)) .setRetryDelayMultiplier(2.0) .setJittered(true) - .setMaxRetryDelay(Duration.ofMinutes(1L)) + .setMaxRetryDelayDuration(Duration.ofMinutes(1L)) .build(); static final RetrySettings DEFAULT_QUERY_JOB_WAIT_SETTINGS = RetrySettings.newBuilder() - .setTotalTimeout(Duration.ofHours(12L)) - .setInitialRetryDelay(Duration.ofSeconds(3L)) + .setTotalTimeoutDuration(Duration.ofHours(12L)) + .setInitialRetryDelayDuration(Duration.ofSeconds(3L)) .setRetryDelayMultiplier(1.0) .setJittered(true) - .setMaxRetryDelay(Duration.ofSeconds(3L)) + .setMaxRetryDelayDuration(Duration.ofSeconds(3L)) .build(); static final QueryResultsOption[] DEFAULT_QUERY_WAIT_OPTIONS = { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index a7469a3a68..900d04b4e8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -16,11 +16,12 @@ package com.google.cloud.bigquery; -import static org.threeten.bp.temporal.ChronoField.HOUR_OF_DAY; -import static org.threeten.bp.temporal.ChronoField.MINUTE_OF_HOUR; -import static org.threeten.bp.temporal.ChronoField.NANO_OF_SECOND; -import static org.threeten.bp.temporal.ChronoField.SECOND_OF_MINUTE; +import static java.time.temporal.ChronoField.HOUR_OF_DAY; +import static java.time.temporal.ChronoField.MINUTE_OF_HOUR; +import static java.time.temporal.ChronoField.NANO_OF_SECOND; +import static java.time.temporal.ChronoField.SECOND_OF_MINUTE; +import com.google.api.core.ObsoleteApi; import com.google.api.services.bigquery.model.QueryParameterType; import com.google.api.services.bigquery.model.RangeValue; import com.google.auto.value.AutoValue; @@ -33,17 +34,17 @@ import com.google.gson.JsonObject; import java.io.Serializable; import java.math.BigDecimal; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.DateTimeParseException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Nullable; -import org.threeten.bp.Instant; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeFormatterBuilder; -import org.threeten.bp.format.DateTimeParseException; import org.threeten.extra.PeriodDuration; /** @@ -345,7 +346,11 @@ public static QueryParameterValue interval(String value) { return of(value, StandardSQLTypeName.INTERVAL); } - /** Creates a {@code QueryParameterValue} object with a type of INTERVAL. */ + /** + * Creates a {@code QueryParameterValue} object with a type of INTERVAL. This method is obsolete. + * Use {@link #interval(String)} instead. + */ + @ObsoleteApi("Use interval(String) instead") public static QueryParameterValue interval(PeriodDuration value) { return of(value, StandardSQLTypeName.INTERVAL); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java index 784ca984fa..2853c46761 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java @@ -24,10 +24,10 @@ import com.google.cloud.http.HttpTransportOptions; import java.io.IOException; import java.io.InputStream; +import java.time.Duration; import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.Duration; /** * Utility to create a remote BigQuery configuration for testing. BigQuery options can be obtained @@ -144,13 +144,13 @@ private static RetrySettings retrySettings() { long totalTimeOut = 120000L; return RetrySettings.newBuilder() .setMaxAttempts(maxAttempts) - .setMaxRetryDelay(Duration.ofMillis(maxRetryDelay)) - .setTotalTimeout(Duration.ofMillis(totalTimeOut)) - .setInitialRetryDelay(Duration.ofMillis(initialRetryDelay)) + .setMaxRetryDelayDuration(Duration.ofMillis(maxRetryDelay)) + .setTotalTimeoutDuration(Duration.ofMillis(totalTimeOut)) + .setInitialRetryDelayDuration(Duration.ofMillis(initialRetryDelay)) .setRetryDelayMultiplier(retryDelayMultiplier) - .setInitialRpcTimeout(Duration.ofMillis(totalTimeOut)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(totalTimeOut)) .setRpcTimeoutMultiplier(retryDelayMultiplier) - .setMaxRpcTimeout(Duration.ofMillis(totalTimeOut)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(totalTimeOut)) .build(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index 396bb754ac..f12d9fcafa 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -41,6 +41,7 @@ import com.google.cloud.bigquery.JobStatistics.QueryStatistics; import com.google.cloud.bigquery.JobStatus.State; import com.google.common.collect.ImmutableList; +import java.time.Duration; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -48,7 +49,6 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.junit.MockitoRule; -import org.threeten.bp.Duration; @RunWith(MockitoJUnitRunner.class) public class JobTest { @@ -83,8 +83,8 @@ public class JobTest { private static final RetryOption[] TEST_RETRY_OPTIONS = new RetryOption[] { - RetryOption.totalTimeout(Duration.ofSeconds(3)), - RetryOption.initialRetryDelay(Duration.ofMillis(1L)), + RetryOption.totalTimeoutDuration(Duration.ofSeconds(3)), + RetryOption.initialRetryDelayDuration(Duration.ofMillis(1L)), RetryOption.jittered(false), RetryOption.retryDelayMultiplier(1.0) }; @@ -402,7 +402,8 @@ public void testWaitForWithTimeout() throws InterruptedException { when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(runningJob); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(runningJob); try { - job.waitFor(concat(TEST_RETRY_OPTIONS, RetryOption.totalTimeout(Duration.ofMillis(3)))); + job.waitFor( + concat(TEST_RETRY_OPTIONS, RetryOption.totalTimeoutDuration(Duration.ofMillis(3)))); Assert.fail(); } catch (BigQueryException expected) { Assert.assertNotNull(expected.getMessage()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index e0ea9d68dd..75060a4f04 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -17,17 +17,21 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; -import static org.threeten.bp.temporal.ChronoField.HOUR_OF_DAY; -import static org.threeten.bp.temporal.ChronoField.MINUTE_OF_HOUR; -import static org.threeten.bp.temporal.ChronoField.NANO_OF_SECOND; -import static org.threeten.bp.temporal.ChronoField.SECOND_OF_MINUTE; +import static java.time.temporal.ChronoField.HOUR_OF_DAY; +import static java.time.temporal.ChronoField.MINUTE_OF_HOUR; +import static java.time.temporal.ChronoField.NANO_OF_SECOND; +import static java.time.temporal.ChronoField.SECOND_OF_MINUTE; import com.google.api.services.bigquery.model.QueryParameterType; import com.google.common.collect.ImmutableMap; import com.google.gson.JsonObject; import java.math.BigDecimal; import java.text.ParseException; +import java.time.Instant; import java.time.Period; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -35,11 +39,6 @@ import java.util.Map; import org.junit.Assert; import org.junit.Test; -import org.threeten.bp.Instant; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeFormatterBuilder; -import org.threeten.bp.jdk8.Jdk8Methods; import org.threeten.extra.PeriodDuration; public class QueryParameterValueTest { @@ -338,8 +337,8 @@ public void testTimestampFromLong() { public void testTimestampWithFormatter() { long timestampInMicroseconds = 1571068536842L * 1000 + 123; long microseconds = 1_000_000; - long secs = Jdk8Methods.floorDiv(timestampInMicroseconds, microseconds); - int nano = (int) Jdk8Methods.floorMod(timestampInMicroseconds, microseconds) * 1000; + long secs = Math.floorDiv(timestampInMicroseconds, microseconds); + int nano = (int) Math.floorMod(timestampInMicroseconds, microseconds) * 1000; Instant instant = Instant.ofEpochSecond(secs, nano); String expected = TIMESTAMPFORMATTER.format(instant); assertThat(expected) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 84944d49c7..86652c1648 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -169,6 +169,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Time; +import java.time.Duration; import java.time.Instant; import java.time.LocalTime; import java.time.Period; @@ -195,7 +196,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.Timeout; -import org.threeten.bp.Duration; import org.threeten.extra.PeriodDuration; public class ITBigQueryTest { @@ -5383,7 +5383,7 @@ public void testCreateAndGetJob() throws InterruptedException, TimeoutException assertEquals(createdJob.getSelfLink(), remoteJob.getSelfLink()); assertEquals(createdJob.getUserEmail(), remoteJob.getUserEmail()); - Job completedJob = remoteJob.waitFor(RetryOption.totalTimeout(Duration.ofMinutes(1))); + Job completedJob = remoteJob.waitFor(RetryOption.totalTimeoutDuration(Duration.ofMinutes(1))); assertNotNull(completedJob); assertNull(completedJob.getStatus().getError()); assertTrue(createdTable.delete()); @@ -5451,8 +5451,8 @@ public void testCreateAndGetJobWithSelectedFields() assertNull(remoteJob.getUserEmail()); Job completedJob = remoteJob.waitFor( - RetryOption.initialRetryDelay(Duration.ofSeconds(1)), - RetryOption.totalTimeout(Duration.ofMinutes(1))); + RetryOption.initialRetryDelayDuration(Duration.ofSeconds(1)), + RetryOption.totalTimeoutDuration(Duration.ofMinutes(1))); assertNotNull(completedJob); assertTrue(createdTable.delete()); assertNull(completedJob.getStatus().getError()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java index 9b2ef4804f..5aadd11e33 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java @@ -25,12 +25,12 @@ import com.google.cloud.http.HttpTransportOptions; import java.io.ByteArrayInputStream; import java.io.InputStream; +import java.time.Duration; import java.util.concurrent.ExecutionException; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import org.threeten.bp.Duration; @RunWith(MockitoJUnitRunner.class) public class RemoteBigQueryHelperTest { @@ -83,8 +83,8 @@ public void testCreateFromStream() { assertEquals(60000, ((HttpTransportOptions) options.getTransportOptions()).getConnectTimeout()); assertEquals(60000, ((HttpTransportOptions) options.getTransportOptions()).getReadTimeout()); assertEquals(10, options.getRetrySettings().getMaxAttempts()); - assertEquals(Duration.ofMillis(30000), options.getRetrySettings().getMaxRetryDelay()); - assertEquals(Duration.ofMillis(120000), options.getRetrySettings().getTotalTimeout()); - assertEquals(Duration.ofMillis(250), options.getRetrySettings().getInitialRetryDelay()); + assertEquals(Duration.ofMillis(30000), options.getRetrySettings().getMaxRetryDelayDuration()); + assertEquals(Duration.ofMillis(120000), options.getRetrySettings().getTotalTimeoutDuration()); + assertEquals(Duration.ofMillis(250), options.getRetrySettings().getInitialRetryDelayDuration()); } } From 8cf4387fae22c81d40635b470b216fa4c126d681 Mon Sep 17 00:00:00 2001 From: Oleksandr Shevchenko Date: Tue, 3 Dec 2024 09:40:22 +0200 Subject: [PATCH 1934/2268] fix(test): Update schema for broken ConnImplBenchmark test (#3574) * Fix ConnImplBenchmark test * refactor --- .../ConnImplBenchmark.java | 206 +++++++----------- 1 file changed, 81 insertions(+), 125 deletions(-) diff --git a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java index f202df6669..670e31ff6e 100644 --- a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java +++ b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java @@ -20,6 +20,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import java.util.logging.Level; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; @@ -48,31 +49,19 @@ public class ConnImplBenchmark { public int rowLimit; private ConnectionSettings connectionSettingsReadAPIEnabled, connectionSettingsReadAPIDisabled; - private long numBuffRows = 100000L; - private final String DATASET = "new_york_taxi_trips"; private final String QUERY = "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; - public static final long NUM_PAGE_ROW_CNT_RATIO = - 10; // ratio of [records in the current page :: total rows] to be met to use read API - public static final long NUM_MIN_RESULT_SIZE = - 200000; // min number of records to use to ReadAPI with @Setup public void setUp() throws IOException { java.util.logging.Logger.getGlobal().setLevel(Level.ALL); - connectionSettingsReadAPIEnabled = - ConnectionSettings.newBuilder() - .setUseReadAPI(true) // enable read api - .build(); + connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder().setUseReadAPI(true).build(); connectionSettingsReadAPIDisabled = - ConnectionSettings.newBuilder() - .setUseReadAPI(false) // disable read api - .build(); + ConnectionSettings.newBuilder().setUseReadAPI(false).build(); } @Benchmark - // uses bigquery.query public void iterateRecordsWithBigQuery_Query(Blackhole blackhole) throws InterruptedException { String selectQuery = String.format(QUERY, rowLimit); BigQuery bigQuery = BigQueryOptions.getDefaultInstance().getService(); @@ -81,81 +70,35 @@ public void iterateRecordsWithBigQuery_Query(Blackhole blackhole) throws Interru TableResult result = bigQuery.query(config); long hash = 0L; int cnt = 0; - System.out.print("\n Running"); - // iterate al the records and compute the hash + long lastTime = System.currentTimeMillis(); + System.out.println("\n Running"); for (FieldValueList row : result.iterateAll()) { - hash += - row.get("vendor_id").getStringValue() == null - ? 0 - : row.get("vendor_id").getStringValue().hashCode(); - hash += - row.get("pickup_datetime").getStringValue() == null - ? 0 - : row.get("pickup_datetime").getStringValue().hashCode(); - hash += - row.get("dropoff_datetime").getStringValue() == null - ? 0 - : row.get("dropoff_datetime").getStringValue().hashCode(); - hash += - row.get("passenger_count").getValue() == null - ? 0 - : row.get("passenger_count").getLongValue(); - hash += - row.get("trip_distance").getValue() == null - ? 0 - : row.get("trip_distance").getDoubleValue(); - hash += - row.get("pickup_longitude").getValue() == null - ? 0 - : row.get("pickup_longitude").getDoubleValue(); - hash += - row.get("pickup_latitude").getValue() == null - ? 0 - : row.get("pickup_latitude").getDoubleValue(); - hash += - row.get("rate_code").getStringValue() == null - ? 0 - : row.get("rate_code").getStringValue().hashCode(); - hash += - row.get("store_and_fwd_flag").getStringValue() == null - ? 0 - : row.get("store_and_fwd_flag").getStringValue().hashCode(); - hash += - row.get("payment_type").getStringValue() == null - ? 0 - : row.get("payment_type").getStringValue().hashCode(); - hash += - row.get("pickup_location_id").getStringValue() == null - ? 0 - : row.get("pickup_location_id").getStringValue().hashCode(); - hash += - row.get("dropoff_location_id").getStringValue() == null - ? 0 - : row.get("dropoff_location_id").getStringValue().hashCode(); - hash += - row.get("dropoff_longitude").getValue() == null - ? 0 - : row.get("dropoff_longitude").getDoubleValue(); - hash += - row.get("dropoff_latitude").getValue() == null - ? 0 - : row.get("dropoff_latitude").getDoubleValue(); - hash += - row.get("fare_amount").getValue() == null ? 0 : row.get("fare_amount").getDoubleValue(); - hash += row.get("extra").getValue() == null ? 0 : row.get("extra").getDoubleValue(); - hash += row.get("mta_tax").getValue() == null ? 0 : row.get("mta_tax").getDoubleValue(); - hash += row.get("tip_amount").getValue() == null ? 0 : row.get("tip_amount").getDoubleValue(); - hash += - row.get("tolls_amount").getValue() == null ? 0 : row.get("tolls_amount").getDoubleValue(); - hash += - row.get("imp_surcharge").getValue() == null - ? 0 - : row.get("imp_surcharge").getDoubleValue(); - hash += - row.get("total_amount").getValue() == null ? 0 : row.get("total_amount").getDoubleValue(); + hash += computeHash(row.get("vendor_id"), FieldValue::getStringValue); + hash += computeHash(row.get("pickup_datetime"), FieldValue::getStringValue); + hash += computeHash(row.get("dropoff_datetime"), FieldValue::getStringValue); + hash += computeHash(row.get("passenger_count"), FieldValue::getLongValue); + hash += computeHash(row.get("trip_distance"), FieldValue::getDoubleValue); + hash += computeHash(row.get("rate_code"), FieldValue::getStringValue); + hash += computeHash(row.get("store_and_fwd_flag"), FieldValue::getStringValue); + hash += computeHash(row.get("payment_type"), FieldValue::getStringValue); + hash += computeHash(row.get("fare_amount"), FieldValue::getDoubleValue); + hash += computeHash(row.get("extra"), FieldValue::getDoubleValue); + hash += computeHash(row.get("mta_tax"), FieldValue::getDoubleValue); + hash += computeHash(row.get("tip_amount"), FieldValue::getDoubleValue); + hash += computeHash(row.get("tolls_amount"), FieldValue::getDoubleValue); + hash += computeHash(row.get("imp_surcharge"), FieldValue::getDoubleValue); + hash += computeHash(row.get("airport_fee"), FieldValue::getDoubleValue); + hash += computeHash(row.get("total_amount"), FieldValue::getDoubleValue); + hash += computeHash(row.get("pickup_location_id"), FieldValue::getStringValue); + hash += computeHash(row.get("dropoff_location_id"), FieldValue::getStringValue); + hash += computeHash(row.get("data_file_year"), FieldValue::getLongValue); + hash += computeHash(row.get("data_file_month"), FieldValue::getLongValue); - if (++cnt % 100000 == 0) { // just to indicate the progress while long running benchmarks - System.out.print("."); + if (++cnt % 100_000 == 0) { + long now = System.currentTimeMillis(); + long duration = now - lastTime; + System.out.println("ROW " + cnt + " Time: " + duration + " ms"); + lastTime = now; } } System.out.println(cnt + " records processed using bigquery.query"); @@ -202,54 +145,67 @@ public void iterateRecordsWithoutUsingReadAPI(Blackhole blackhole) blackhole.consume(hash); } - // Hashes all the 20 columns of all the rows private long getResultHash(BigQueryResult bigQueryResultSet) throws SQLException { ResultSet rs = bigQueryResultSet.getResultSet(); long hash = 0L; int cnt = 0; - System.out.print("\n Running"); + long lastTime = System.currentTimeMillis(); + System.out.println("\n Running"); while (rs.next()) { - hash += rs.getString("vendor_id") == null ? 0 : rs.getString("vendor_id").hashCode(); - hash += - rs.getString("pickup_datetime") == null ? 0 : rs.getString("pickup_datetime").hashCode(); - hash += - rs.getString("dropoff_datetime") == null - ? 0 - : rs.getString("dropoff_datetime").hashCode(); - hash += rs.getLong("passenger_count"); - hash += rs.getDouble("trip_distance"); - hash += rs.getDouble("pickup_longitude"); - hash += rs.getDouble("pickup_latitude"); - hash += rs.getString("rate_code") == null ? 0 : rs.getString("rate_code").hashCode(); - hash += - rs.getString("store_and_fwd_flag") == null - ? 0 - : rs.getString("store_and_fwd_flag").hashCode(); - hash += rs.getDouble("dropoff_longitude"); - hash += rs.getDouble("dropoff_latitude"); - hash += rs.getString("payment_type") == null ? 0 : rs.getString("payment_type").hashCode(); - hash += rs.getDouble("fare_amount"); - hash += rs.getDouble("extra"); - hash += rs.getDouble("mta_tax"); - hash += rs.getDouble("tip_amount"); - hash += rs.getDouble("tolls_amount"); - hash += rs.getDouble("imp_surcharge"); - hash += rs.getDouble("total_amount"); - hash += - rs.getString("pickup_location_id") == null - ? 0 - : rs.getString("pickup_location_id").hashCode(); - hash += - rs.getString("dropoff_location_id") == null - ? 0 - : rs.getString("dropoff_location_id").hashCode(); - if (++cnt % 100000 == 0) { // just to indicate the progress while long running benchmarks - System.out.print("."); + hash += computeHash(rs, "vendor_id", ResultSet::getString); + hash += computeHash(rs, "pickup_datetime", ResultSet::getString); + hash += computeHash(rs, "dropoff_datetime", ResultSet::getString); + hash += computeHash(rs, "passenger_count", ResultSet::getLong); + hash += computeHash(rs, "trip_distance", ResultSet::getDouble); + hash += computeHash(rs, "rate_code", ResultSet::getString); + hash += computeHash(rs, "store_and_fwd_flag", ResultSet::getString); + hash += computeHash(rs, "payment_type", ResultSet::getString); + hash += computeHash(rs, "fare_amount", ResultSet::getDouble); + hash += computeHash(rs, "extra", ResultSet::getDouble); + hash += computeHash(rs, "mta_tax", ResultSet::getDouble); + hash += computeHash(rs, "tip_amount", ResultSet::getDouble); + hash += computeHash(rs, "tolls_amount", ResultSet::getDouble); + hash += computeHash(rs, "imp_surcharge", ResultSet::getDouble); + hash += computeHash(rs, "airport_fee", ResultSet::getDouble); + hash += computeHash(rs, "total_amount", ResultSet::getDouble); + hash += computeHash(rs, "pickup_location_id", ResultSet::getString); + hash += computeHash(rs, "dropoff_location_id", ResultSet::getString); + hash += computeHash(rs, "data_file_year", ResultSet::getLong); + hash += computeHash(rs, "data_file_month", ResultSet::getLong); + + if (++cnt % 100_000 == 0) { + long now = System.currentTimeMillis(); + long duration = now - lastTime; + System.out.println("ROW " + cnt + " Time: " + duration + " ms"); + lastTime = now; } } return hash; } + private long computeHash( + ResultSet rs, String columnName, SQLFunction extractor) { + try { + T value = extractor.apply(rs, columnName); + return (value == null) ? 0 : value.hashCode(); + } catch (SQLException e) { + return 0; + } + } + + @FunctionalInterface + private interface SQLFunction { + R apply(T t, String columnName) throws SQLException; + } + + private long computeHash(FieldValue fieldValue, Function extractor) { + if (fieldValue == null || fieldValue.isNull()) { + return 0; + } + T value = extractor.apply(fieldValue); + return (value == null) ? 0 : value.hashCode(); + } + public static void main(String[] args) throws Exception { Options opt = new OptionsBuilder().include(ConnImplBenchmark.class.getSimpleName()).build(); new Runner(opt).run(); From bc1f3b97a0c8ccc6e93a07b2f0ebcf8e05da9b48 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 04:44:58 +0100 Subject: [PATCH 1935/2268] deps: update github/codeql-action action to v2.27.6 (#3597) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index e82f85f397..3d326ab975 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e2b57b01d64b69ac273abfbea5d3ed15231e1706 # v2.27.5 + uses: github/codeql-action/upload-sarif@82a3f64131759f97922e0680c3730858bc7155a6 # v2.27.6 with: sarif_file: results.sarif From 554f77f6e64adf9775a8f6f0e1e3eacff27470a9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Dec 2024 04:45:22 +0100 Subject: [PATCH 1936/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.49.0 (#3598) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 32cb239d6f..319b3bd22f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.48.0 + 2.49.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3f0b600223..27a1f0273e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.48.0 + 2.49.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index dd4aa5e9e5..f94ddc7d48 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.48.0 + 2.49.0 test From 528426bf9b7801b1b9b45758b560f14a4c9bbc57 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Dec 2024 16:06:16 +0100 Subject: [PATCH 1937/2268] deps: update github/codeql-action action to v2.27.7 (#3603) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 3d326ab975..1c8355fdac 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@82a3f64131759f97922e0680c3730858bc7155a6 # v2.27.6 + uses: github/codeql-action/upload-sarif@d835c34a7026e284170c41a0a66c956e03f247d0 # v2.27.7 with: sarif_file: results.sarif From 6ee0c103771ef678f66cc7a584bdce27e21f29c4 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:05:35 -0800 Subject: [PATCH 1938/2268] docs(bigquery): Add javadoc description of timestamp() parameter. (#3604) * docs(bigquery): Add javadoc description of timestamp() parameter. * Fix formatting. --- .../com/google/cloud/bigquery/QueryParameterValue.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index 900d04b4e8..0487c3f7c3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -300,7 +300,12 @@ public static QueryParameterValue bytes(byte[] value) { return of(value, StandardSQLTypeName.BYTES); } - /** Creates a {@code QueryParameterValue} object with a type of TIMESTAMP. */ + /** + * Creates a {@code QueryParameterValue} object with a type of TIMESTAMP. + * + * @param value Microseconds since epoch, e.g. 1733945416000000 corresponds to 2024-12-11 + * 19:30:16.929Z + */ public static QueryParameterValue timestamp(Long value) { return of(value, StandardSQLTypeName.TIMESTAMP); } From 11499d16727934fd3dfa5c18226e6f20471a11ac Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 15:26:47 +0100 Subject: [PATCH 1939/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.41.0 (#3607) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 39ab435d5d..f971b05c95 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 30a89e0a55..cbccd336a0 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index b78f2e1fa4..d9c9d02051 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 4dbae8340e..80a629d235 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index a836c97f04..644bb62ce7 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 71accd6f7c..d83e939d7c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 diff --git a/pom.xml b/pom.xml index 2eabd261cc..a7b94678bf 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 From d2c4c29cff00b1490d707ec2aa30cbfcebe3bddc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 15:49:34 +0100 Subject: [PATCH 1940/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.11.0 (#3609) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a7b94678bf..6dd6a5c8eb 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.10.3 + 3.11.0 pom import From 41f9adbe4235329fa2bbfd0930f4113e63f72e05 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 15:56:14 +0100 Subject: [PATCH 1941/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20241115-2.0.0 (#3601) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6dd6a5c8eb..91f1c5bb3e 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20241111-2.0.0 + v2-rev20241115-2.0.0 From f22de8741662d0e5930f7ae5c24ecf8c05570a69 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 16:19:39 +0100 Subject: [PATCH 1942/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.46.0 (#3610) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 91f1c5bb3e..bb3aab6856 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.45.0 + 2.46.0 test From fc408ad72669bbec952d3d2b5f817581b31df0f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 16:28:47 +0100 Subject: [PATCH 1943/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.50.0 (#3605) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 319b3bd22f..78034de310 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.49.0 + 2.50.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 27a1f0273e..719dcbc61d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.49.0 + 2.50.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f94ddc7d48..f9af31307b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.49.0 + 2.50.0 test From 824e5662752b6cbac52a4ba163b5866745eb45e7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:57:17 -0500 Subject: [PATCH 1944/2268] chore(main): release 2.45.0 (#3590) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 39 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9f9565ce..9d8f525e2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [2.45.0](https://github.com/googleapis/java-bigquery/compare/v2.44.0...v2.45.0) (2024-12-13) + + +### Features + +* Enable Lossless Timestamps in BQ java client lib ([#3589](https://github.com/googleapis/java-bigquery/issues/3589)) ([c0b874a](https://github.com/googleapis/java-bigquery/commit/c0b874aa0150e63908450b13d019864b8cbfbfe3)) +* Introduce `java.time` methods and variables ([#3586](https://github.com/googleapis/java-bigquery/issues/3586)) ([31fb15f](https://github.com/googleapis/java-bigquery/commit/31fb15fb963c18e4c29391e9fe56dfde31577511)) + + +### Bug Fixes + +* **test:** Update schema for broken ConnImplBenchmark test ([#3574](https://github.com/googleapis/java-bigquery/issues/3574)) ([8cf4387](https://github.com/googleapis/java-bigquery/commit/8cf4387fae22c81d40635b470b216fa4c126d681)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.56.0 ([#3582](https://github.com/googleapis/java-bigquery/issues/3582)) ([616ee2a](https://github.com/googleapis/java-bigquery/commit/616ee2aa8ccf3d2975274b256252f2f249775960)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20241111-2.0.0 ([#3591](https://github.com/googleapis/java-bigquery/issues/3591)) ([3eef3a9](https://github.com/googleapis/java-bigquery/commit/3eef3a9959bcfdb76c26fdf9069d9acf89f93a7a)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20241115-2.0.0 ([#3601](https://github.com/googleapis/java-bigquery/issues/3601)) ([41f9adb](https://github.com/googleapis/java-bigquery/commit/41f9adbe4235329fa2bbfd0930f4113e63f72e05)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.60.0 ([#3583](https://github.com/googleapis/java-bigquery/issues/3583)) ([34dd8bc](https://github.com/googleapis/java-bigquery/commit/34dd8bc22c8188f2b61dc9939b24a8d820548e2b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.41.0 ([#3607](https://github.com/googleapis/java-bigquery/issues/3607)) ([11499d1](https://github.com/googleapis/java-bigquery/commit/11499d16727934fd3dfa5c18226e6f20471a11ac)) +* Update github/codeql-action action to v2.27.5 ([#3588](https://github.com/googleapis/java-bigquery/issues/3588)) ([3f94075](https://github.com/googleapis/java-bigquery/commit/3f9407570fea5317aaf212b058ca1da05985eda9)) +* Update github/codeql-action action to v2.27.6 ([#3597](https://github.com/googleapis/java-bigquery/issues/3597)) ([bc1f3b9](https://github.com/googleapis/java-bigquery/commit/bc1f3b97a0c8ccc6e93a07b2f0ebcf8e05da9b48)) +* Update github/codeql-action action to v2.27.7 ([#3603](https://github.com/googleapis/java-bigquery/issues/3603)) ([528426b](https://github.com/googleapis/java-bigquery/commit/528426bf9b7801b1b9b45758b560f14a4c9bbc57)) + + +### Documentation + +* **bigquery:** Add javadoc description of timestamp() parameter. ([#3604](https://github.com/googleapis/java-bigquery/issues/3604)) ([6ee0c10](https://github.com/googleapis/java-bigquery/commit/6ee0c103771ef678f66cc7a584bdce27e21f29c4)) + ## [2.44.0](https://github.com/googleapis/java-bigquery/compare/v2.43.3...v2.44.0) (2024-11-17) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a459346de3..b6daf595e9 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.44.1-SNAPSHOT + 2.45.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index d83e939d7c..0a689e33f8 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.44.1-SNAPSHOT + 2.45.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.44.1-SNAPSHOT + 2.45.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4ddcb2d771..c040d4fc37 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.44.1-SNAPSHOT + 2.45.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.44.1-SNAPSHOT + 2.45.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bb3aab6856..6fd0cd64e7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.44.1-SNAPSHOT + 2.45.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.44.1-SNAPSHOT + 2.45.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 719dcbc61d..d6700af907 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.44.1-SNAPSHOT + 2.45.0 diff --git a/versions.txt b/versions.txt index 530a7c3ed7..13c2e61d78 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.44.0:2.44.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.45.0:2.45.0 \ No newline at end of file From b622600e11a44f16be24537b4aa663b145ed6deb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:31:22 -0500 Subject: [PATCH 1945/2268] chore(main): release 2.45.1-SNAPSHOT (#3611) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b6daf595e9..de56289e62 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.45.0 + 2.45.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 0a689e33f8..7214bf10cf 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.45.0 + 2.45.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.45.0 + 2.45.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c040d4fc37..a18a1d1ada 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.45.0 + 2.45.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.45.0 + 2.45.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6fd0cd64e7..61f2542bb7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.45.0 + 2.45.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.45.0 + 2.45.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d6700af907..ef0ad0976a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.45.0 + 2.45.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 13c2e61d78..b964bf3a4d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.45.0:2.45.0 \ No newline at end of file +google-cloud-bigquery:2.45.0:2.45.1-SNAPSHOT \ No newline at end of file From 18a9fe7fc93e7718ed3a2e8360cb23eab3810e31 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:50:03 -0500 Subject: [PATCH 1946/2268] test: fix benchmark test missing maven configuration (#3596) --- benchmark/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index de56289e62..71f23707f5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -38,6 +38,15 @@ org.apache.maven.plugins maven-compiler-plugin 3.13.0 + + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + + + org.apache.maven.plugins From 567ce01ed77d44760ddcd872a0d61abdd6a09832 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Dec 2024 16:46:09 +0100 Subject: [PATCH 1947/2268] deps: update github/codeql-action action to v2.27.9 (#3608) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1c8355fdac..91885df005 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@d835c34a7026e284170c41a0a66c956e03f247d0 # v2.27.7 + uses: github/codeql-action/upload-sarif@277b89701e930e6af7a758f50afa5185bfc53c81 # v2.27.9 with: sarif_file: results.sarif From f4e9856abe936a6f6d190cddb9127e3e20b61f5d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Dec 2024 16:46:31 +0100 Subject: [PATCH 1948/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.45.0 (#3612) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 78034de310..4486c9ecbe 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.44.0 + 2.45.0 From f5faa69bc5b6fdae137724df5693f8aecf27d609 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 17:27:01 +0100 Subject: [PATCH 1949/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.37.0 (#3614) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4486c9ecbe..3a8e388724 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.36.0 + 1.37.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ef0ad0976a..3114a28322 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.36.0 + 1.37.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index f9af31307b..9b100ec0e0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.36.0 + 1.37.0 com.google.oauth-client From a6c79443a5e675a01ecb91e362e261a6f6ecc055 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 17:27:47 +0100 Subject: [PATCH 1950/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.37.0 (#3615) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a8e388724..f44550cdcd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.36.0 + 1.37.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3114a28322..9a15805e3c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.36.0 + 1.37.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9b100ec0e0..c8844a422b 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.36.0 + 1.37.0 From 51370a92e7ab29dfce91199666f23576d2d1b64a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 17:29:03 +0100 Subject: [PATCH 1951/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.57.0 (#3617) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 61f2542bb7..fb52dbd90b 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.56.0 + 2.57.0 test From 88021f7894f592e5211af0caaf9003b1f15a0a52 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 17:29:58 +0100 Subject: [PATCH 1952/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.57.0 (#3616) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fb52dbd90b..afe44da8ad 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.56.0 + 2.57.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f44550cdcd..ae4a934395 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.56.0 + 2.57.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9a15805e3c..4a4d5be3ea 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.56.0 + 2.57.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c8844a422b..8f51b65bd9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.56.0 + 2.57.0 test From 6cba626ff14cebbc04fa4f6058b273de0c5dd96e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 17:31:10 +0100 Subject: [PATCH 1953/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.61.0 (#3618) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index afe44da8ad..28ba37474a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.60.0 + 1.61.0 pom import From 08c483cb726bb36951680687260dd2d0371a9dc0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Dec 2024 18:15:49 +0100 Subject: [PATCH 1954/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.51.0 (#3619) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ae4a934395..978da1f36b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.50.0 + 2.51.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4a4d5be3ea..190337e249 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.50.0 + 2.51.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8f51b65bd9..b6476b2bdb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.50.0 + 2.51.0 test From 6696a9c7d42970e3c24bda4da713a855dbe40ce5 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:19:49 -0800 Subject: [PATCH 1955/2268] feat(bigquery): support IAM conditions in datasets in Java client. (#3602) * feat(bigquery): support IAM conditions in datasets in Java client. * Fix formatting * Account for possible null condition field in Acl. * Add toString() method to Acl.Expr object. Use service account in integration test instead of hardcoded personal account. Change Database API calls to only have one branch, toggling only the access policy version in a conditional. * Change Acl.User to be default google credentials in IT test * fix formatting * Add Acl.Expr builder. Fix review nits. * fix formatting --- .../java/com/google/cloud/bigquery/Acl.java | 161 +++++++++++++++++- .../com/google/cloud/bigquery/BigQuery.java | 18 ++ .../cloud/bigquery/spi/v2/BigQueryRpc.java | 3 +- .../bigquery/spi/v2/HttpBigQueryRpc.java | 55 ++++-- .../com/google/cloud/bigquery/AclTest.java | 10 ++ .../cloud/bigquery/BigQueryImplTest.java | 15 ++ .../cloud/bigquery/it/ITBigQueryTest.java | 160 +++++++++++++++++ 7 files changed, 400 insertions(+), 22 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index e4107cdfda..e6a2a0b91d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -21,6 +21,7 @@ import com.google.api.core.ApiFunction; import com.google.api.services.bigquery.model.Dataset.Access; import com.google.api.services.bigquery.model.DatasetAccessEntry; +import com.google.api.services.bigquery.model.Expr; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; import java.io.Serializable; @@ -41,6 +42,7 @@ public final class Acl implements Serializable { private final Entity entity; private final Role role; + private final Expr condition; /** * Dataset roles supported by BigQuery. @@ -568,9 +570,147 @@ Access toPb() { } } + /** Expr represents the conditional information related to dataset access policies. */ + public static final class Expr implements Serializable { + // Textual representation of an expression in Common Expression Language syntax. + private final String expression; + /** + * Optional. Title for the expression, i.e. a short string describing its purpose. This can be + * used e.g. in UIs which allow to enter the expression. + */ + private final String title; + /** + * Optional. Description of the expression. This is a longer text which describes the + * expression, e.g. when hovered over it in a UI. + */ + private final String description; + /** + * Optional. String indicating the location of the expression for error reporting, e.g. a file + * name and a position in the file. + */ + private final String location; + + private static final long serialVersionUID = 7358264726377291156L; + + static final class Builder { + private String expression; + private String title; + private String description; + private String location; + + Builder() {} + + Builder(Expr expr) { + this.expression = expr.expression; + this.title = expr.title; + this.description = expr.description; + this.location = expr.location; + } + + Builder(com.google.api.services.bigquery.model.Expr bqExpr) { + this.expression = bqExpr.getExpression(); + if (bqExpr.getTitle() != null) { + this.title = bqExpr.getTitle(); + } + if (bqExpr.getDescription() != null) { + this.description = bqExpr.getDescription(); + } + if (bqExpr.getLocation() != null) { + this.location = bqExpr.getLocation(); + } + } + + public Builder setExpression(String expression) { + this.expression = expression; + return this; + } + + public Builder setTitle(String title) { + this.title = title; + return this; + } + + public Builder setDescription(String description) { + this.description = description; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Expr build() { + return new Expr(this); + } + } + + public Expr(Builder builder) { + this.expression = builder.expression; + this.title = builder.title; + this.description = builder.description; + this.location = builder.location; + } + + public Expr(String expression, String title, String description, String location) { + this.expression = expression; + this.title = title; + this.description = description; + this.location = location; + } + + com.google.api.services.bigquery.model.Expr toPb() { + com.google.api.services.bigquery.model.Expr bqExpr = + new com.google.api.services.bigquery.model.Expr(); + bqExpr.setExpression(this.expression); + bqExpr.setTitle(this.title); + bqExpr.setDescription(this.description); + bqExpr.setLocation(this.location); + return bqExpr; + } + + static Expr fromPb(com.google.api.services.bigquery.model.Expr bqExpr) { + return new Builder(bqExpr).build(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + @Override + public int hashCode() { + return Objects.hash(expression, title, description, location); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + final Expr other = (Expr) obj; + return Objects.equals(this.expression, other.expression) + && Objects.equals(this.title, other.title) + && Objects.equals(this.description, other.description) + && Objects.equals(this.location, other.location); + } + + @Override + public String toString() { + return toPb().toString(); + } + } + private Acl(Entity entity, Role role) { + this(entity, role, null); + } + + private Acl(Entity entity, Role role, Expr condition) { this.entity = checkNotNull(entity); this.role = role; + this.condition = condition; } /** @return Returns the entity for this ACL. */ @@ -582,6 +722,10 @@ public Entity getEntity() { public Role getRole() { return role; } + /** @return Returns the condition specified by this ACL. */ + public Expr getCondition() { + return condition; + } /** * @return Returns an Acl object. @@ -592,6 +736,10 @@ public static Acl of(Entity entity, Role role) { return new Acl(entity, role); } + public static Acl of(Entity entity, Role role, Expr condition) { + return new Acl(entity, role, condition); + } + /** * @param datasetAclEntity * @return Returns an Acl object for a datasetAclEntity. @@ -618,7 +766,7 @@ public static Acl of(Routine routine) { @Override public int hashCode() { - return Objects.hash(entity, role); + return Objects.hash(entity, role, condition); } @Override @@ -635,7 +783,9 @@ public boolean equals(Object obj) { return false; } final Acl other = (Acl) obj; - return Objects.equals(this.entity, other.entity) && Objects.equals(this.role, other.role); + return Objects.equals(this.entity, other.entity) + && Objects.equals(this.role, other.role) + && Objects.equals(this.condition, other.condition); } Access toPb() { @@ -643,11 +793,16 @@ Access toPb() { if (role != null) { accessPb.setRole(role.name()); } + if (condition != null) { + accessPb.setCondition(condition.toPb()); + } return accessPb; } static Acl fromPb(Access access) { return Acl.of( - Entity.fromPb(access), access.getRole() != null ? Role.valueOf(access.getRole()) : null); + Entity.fromPb(access), + access.getRole() != null ? Role.valueOf(access.getRole()) : null, + access.getCondition() != null ? Expr.fromPb(access.getCondition()) : null); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 613134fa06..2a7d498c09 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -289,6 +289,24 @@ public static DatasetOption fields(DatasetField... fields) { return new DatasetOption( BigQueryRpc.Option.FIELDS, Helper.selector(DatasetField.REQUIRED_FIELDS, fields)); } + + /** + * Returns an option to specify the dataset's access policy version for conditional access. If + * this option is not provided the field remains unset and conditional access cannot be used. + * Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests + * for conditional access policy binding in datasets must specify version 3. Datasets with no + * conditional role bindings in access policy may specify any valid value or leave the field + * unset. This field will be mapped to IAM Policy version and will be + * used to fetch the policy from IAM. If unset or if 0 or 1 the value is used for a dataset with + * conditional bindings, access entry with condition will have role string appended by + * 'withcond' string followed by a hash value. Please refer to Troubleshooting + * withcond for more details. + */ + public static DatasetOption accessPolicyVersion(Integer accessPolicyVersion) { + return new DatasetOption(BigQueryRpc.Option.ACCESS_POLICY_VERSION, accessPolicyVersion); + } } /** Class for specifying dataset delete options. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 57f1a05c01..8b0a83531e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -59,7 +59,8 @@ enum Option { REQUESTED_POLICY_VERSION("requestedPolicyVersion"), TABLE_METADATA_VIEW("view"), RETRY_OPTIONS("retryOptions"), - BIGQUERY_RETRY_CONFIG("bigQueryRetryConfig"); + BIGQUERY_RETRY_CONFIG("bigQueryRetryConfig"), + ACCESS_POLICY_VERSION("accessPolicyVersion"); private final String value; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 93337d8cac..3946f83f54 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -130,12 +130,19 @@ private void validateRPC() throws BigQueryException, IOException { public Dataset getDataset(String projectId, String datasetId, Map options) { try { validateRPC(); - return bigquery - .datasets() - .get(projectId, datasetId) - .setFields(Option.FIELDS.getString(options)) - .setPrettyPrint(false) - .execute(); + + Bigquery.Datasets.Get bqGetRequest = + bigquery + .datasets() + .get(projectId, datasetId) + .setFields(Option.FIELDS.getString(options)) + .setPrettyPrint(false); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqGetRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqGetRequest.execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -174,12 +181,18 @@ public Tuple> listDatasets(String projectId, Map options) { try { validateRPC(); - return bigquery - .datasets() - .insert(dataset.getDatasetReference().getProjectId(), dataset) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Datasets.Insert bqCreateRequest = + bigquery + .datasets() + .insert(dataset.getDatasetReference().getProjectId(), dataset) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqCreateRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqCreateRequest.execute(); } catch (IOException ex) { throw translate(ex); } @@ -277,12 +290,18 @@ public Dataset patch(Dataset dataset, Map options) { try { validateRPC(); DatasetReference reference = dataset.getDatasetReference(); - return bigquery - .datasets() - .patch(reference.getProjectId(), reference.getDatasetId(), dataset) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Datasets.Patch bqPatchRequest = + bigquery + .datasets() + .patch(reference.getProjectId(), reference.getDatasetId(), dataset) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqPatchRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqPatchRequest.execute(); } catch (IOException ex) { throw translate(ex); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java index 30866c2b60..0b53f32ff4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java @@ -23,6 +23,7 @@ import com.google.cloud.bigquery.Acl.Domain; import com.google.cloud.bigquery.Acl.Entity; import com.google.cloud.bigquery.Acl.Entity.Type; +import com.google.cloud.bigquery.Acl.Expr; import com.google.cloud.bigquery.Acl.Group; import com.google.cloud.bigquery.Acl.IamMember; import com.google.cloud.bigquery.Acl.Role; @@ -136,4 +137,13 @@ public void testOf() { assertEquals(routine, acl.getEntity()); assertEquals(null, acl.getRole()); } + + @Test + public void testOfWithCondition() { + Expr expr = new Expr("expression", "title", "description", "location"); + Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER, expr); + Dataset.Access pb = acl.toPb(); + assertEquals(acl, Acl.fromPb(pb)); + assertEquals(acl.getCondition(), expr); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 88b8f6dbf4..c13d272d2e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -30,6 +30,7 @@ import com.google.cloud.RetryOption; import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQuery.DatasetOption; import com.google.cloud.bigquery.BigQuery.JobOption; import com.google.cloud.bigquery.BigQuery.QueryResultsOption; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; @@ -572,6 +573,20 @@ public void testCreateDatasetWithSelectedFields() { verify(bigqueryRpcMock).create(eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture()); } + @Test + public void testCreateDatasetWithAccessPolicy() { + DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); + DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + when(bigqueryRpcMock.create(datasetInfo.toPb(), optionMap(datasetOption))) + .thenReturn(datasetInfo.toPb()); + BigQueryOptions bigQueryOptions = + createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); + bigquery = bigQueryOptions.getService(); + Dataset dataset = bigquery.create(datasetInfo, datasetOption); + assertEquals(new Dataset(bigquery, new DatasetInfo.BuilderImpl(datasetInfo)), dataset); + verify(bigqueryRpcMock).create(datasetInfo.toPb(), optionMap(datasetOption)); + } + @Test public void testGetDataset() { when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 86652c1648..bf8d51314b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -41,6 +41,8 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.Acl; import com.google.cloud.bigquery.Acl.DatasetAclEntity; +import com.google.cloud.bigquery.Acl.Expr; +import com.google.cloud.bigquery.Acl.User; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption; import com.google.cloud.bigquery.BigQuery.DatasetField; @@ -1219,6 +1221,48 @@ public void testGetDatasetWithSelectedFields() { assertNull(dataset.getMaxTimeTravelHours()); } + @Test + public void testGetDatasetWithAccessPolicyVersion() throws IOException { + String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); + ServiceAccountCredentials credentials = + (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); + User user = new User(credentials.getClientEmail()); + Acl.Role role = Acl.Role.WRITER; + Acl.Expr condition = + new Expr( + "request.time > timestamp('2024-01-01T00:00:00Z')", + "test condition", + "requests after the year 2024", + "location"); + Acl acl = Acl.of(user, role, condition); + DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + + Dataset dataset = + bigquery.create( + DatasetInfo.newBuilder(accessPolicyDataset) + .setDescription("Some Description") + .setAcl(ImmutableList.of(acl)) + .build(), + datasetOption); + assertThat(dataset).isNotNull(); + + Dataset remoteDataset = bigquery.getDataset(accessPolicyDataset, datasetOption); + assertNotNull(remoteDataset); + assertEquals(dataset.getDescription(), remoteDataset.getDescription()); + assertNotNull(remoteDataset.getCreationTime()); + + Acl remoteAclWithCond = null; + for (Acl remoteAcl : remoteDataset.getAcl()) { + if (remoteAcl.getCondition() != null) { + remoteAclWithCond = remoteAcl; + } + } + assertNotNull(remoteAclWithCond); + assertEquals(remoteAclWithCond.getCondition(), condition); + + RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); + } + @Test public void testUpdateDataset() { Dataset dataset = @@ -1285,6 +1329,58 @@ public void testUpdateDatasetWithSelectedFields() { assertTrue(dataset.delete()); } + @Test + public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { + String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); + ServiceAccountCredentials credentials = + (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); + Dataset dataset = + bigquery.create( + DatasetInfo.newBuilder(accessPolicyDataset) + .setDescription("Some Description") + .setLabels(Collections.singletonMap("a", "b")) + .build()); + assertThat(dataset).isNotNull(); + + User user = new User(credentials.getClientEmail()); + Acl.Role role = Acl.Role.WRITER; + Acl.Expr condition = + new Expr( + "request.time > timestamp('2024-01-01T00:00:00Z')", + "test condition", + "requests after the year 2024", + "location"); + Acl acl = Acl.of(user, role, condition); + List acls = new ArrayList<>(); + acls.addAll(dataset.getAcl()); + acls.add(acl); + + DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + Dataset updatedDataset = + bigquery.update( + dataset + .toBuilder() + .setDescription("Updated Description") + .setLabels(null) + .setAcl(acls) + .build(), + datasetOption); + assertNotNull(updatedDataset); + assertEquals(updatedDataset.getDescription(), "Updated Description"); + assertThat(updatedDataset.getLabels().isEmpty()); + + Acl updatedAclWithCond = null; + for (Acl updatedAcl : updatedDataset.getAcl()) { + if (updatedAcl.getCondition() != null) { + updatedAclWithCond = updatedAcl; + } + } + assertNotNull(updatedAclWithCond); + assertEquals(updatedAclWithCond.getCondition(), condition); + + RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); + } + @Test public void testGetNonExistingTable() { assertNull(bigquery.getTable(DATASET, "test_get_non_existing_table")); @@ -1688,6 +1784,70 @@ public void testCreateDatasetWithDefaultCollation() { RemoteBigQueryHelper.forceDelete(bigquery, collationDataset); } + @Test + public void testCreateDatasetWithAccessPolicyVersion() throws IOException { + String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); + ServiceAccountCredentials credentials = + (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); + User user = new User(credentials.getClientEmail()); + Acl.Role role = Acl.Role.OWNER; + Acl.Expr condition = + new Expr( + "request.time > timestamp('2024-01-01T00:00:00Z')", + "test condition", + "requests after the year 2024", + "location"); + Acl acl = Acl.of(user, role, condition); + DatasetInfo info = + DatasetInfo.newBuilder(accessPolicyDataset) + .setDescription(DESCRIPTION) + .setLabels(LABELS) + .setAcl(ImmutableList.of(acl)) + .build(); + DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + Dataset dataset = bigquery.create(info, datasetOption); + assertNotNull(dataset); + assertEquals(dataset.getDescription(), DESCRIPTION); + + Acl remoteAclWithCond = null; + for (Acl remoteAcl : dataset.getAcl()) { + if (remoteAcl.getCondition() != null) { + remoteAclWithCond = remoteAcl; + } + } + assertNotNull(remoteAclWithCond); + assertEquals(remoteAclWithCond.getCondition(), condition); + + RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); + } + + @Test(expected = BigQueryException.class) + public void testCreateDatabaseWithInvalidAccessPolicyVersion() throws IOException { + String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); + ServiceAccountCredentials credentials = + (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); + User user = new User(credentials.getClientEmail()); + Acl.Role role = Acl.Role.READER; + Acl.Expr condition = + new Expr( + "request.time > timestamp('2024-01-01T00:00:00Z')", + "test condition", + "requests after the year 2024", + "location"); + Acl acl = Acl.of(user, role, condition); + DatasetInfo info = + DatasetInfo.newBuilder(accessPolicyDataset) + .setDescription(DESCRIPTION) + .setLabels(LABELS) + .setAcl(ImmutableList.of(acl)) + .build(); + DatasetOption datasetOption = DatasetOption.accessPolicyVersion(4); + Dataset dataset = bigquery.create(info, datasetOption); + assertNotNull(dataset); + + RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); + } + @Test public void testCreateTableWithDefaultCollation() { String tableName = "test_create_table_with_default_collation"; From cc25099f81cbf94e9e2ee9db03a7d9ecd913c176 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Jan 2025 17:06:59 +0100 Subject: [PATCH 1956/2268] deps: update actions/upload-artifact action to v4.5.0 (#3620) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 91885df005..f60cb51d42 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: SARIF file path: results.sarif From e0e09ec4954f5b5e2f094e4c67600f38353f453c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Jan 2025 17:48:10 +0100 Subject: [PATCH 1957/2268] deps: update github/codeql-action action to v2.28.0 (#3621) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f60cb51d42..43e77e296a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@277b89701e930e6af7a758f50afa5185bfc53c81 # v2.27.9 + uses: github/codeql-action/upload-sarif@673cceb2b4886e2dfff697ab64a1ecd1c0a14a05 # v2.28.0 with: sarif_file: results.sarif From 4061922e46135d673bfa48c00bbf284efa46e065 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 6 Jan 2025 17:48:40 +0100 Subject: [PATCH 1958/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20241222-2.0.0 (#3623) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28ba37474a..819a34a1e3 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20241115-2.0.0 + v2-rev20241222-2.0.0 From 9a0b05a3b57797b7cdd8ca9739699fc018dbd868 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 9 Jan 2025 08:56:09 -0500 Subject: [PATCH 1959/2268] fix: NPE when reading BigQueryResultSet from empty tables (#3627) * fix: NPE when reading BigQueryResultSet from empty tables * Add unittests --- .../cloud/bigquery/BigQueryResultImpl.java | 3 +++ .../com/google/cloud/bigquery/Connection.java | 2 +- .../cloud/bigquery/ConnectionImplTest.java | 6 +++++- .../cloud/bigquery/it/ITBigQueryTest.java | 18 ++++++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java index e944efceba..a1bb4d4069 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -113,6 +113,9 @@ private class BigQueryResultSet extends AbstractJdbcResultSet { @Override /*Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation*/ public boolean next() throws SQLException { + if (buffer == null) { + return false; + } if (hasReachedEnd) { // if end of stream is reached then we can simply return false return false; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java index afc8eb848b..83ea0fc0dc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Connection.java @@ -140,7 +140,7 @@ ListenableFuture executeSelectAsync(String sql) * @code * ConnectionSettings connectionSettings = * ConnectionSettings.newBuilder() - * ..setUseReadAPI(true) + * .setUseReadAPI(true) * .build(); * Connection connection = bigquery.createConnection(connectionSettings); * String selectQuery = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 58cb69ba7e..7eea1570ae 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -411,7 +411,7 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException { // calls executeSelect with a nonFast query where the query returns an empty result. @Test - public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException { + public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException, SQLException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() @@ -428,6 +428,10 @@ public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 0); assertEquals(QUERY_SCHEMA, res.getSchema()); + assertEquals( + false, + res.getResultSet() + .next()); // Validates that NPE does not occur when reading from empty ResultSet. verify(bigqueryRpcMock, times(1)) .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index bf8d51314b..24bf84f6ea 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3491,6 +3491,24 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { assertEquals(42, bigQueryResult.getTotalRows()); } + @Test + public void testExecuteSelectReadApiEmptyResultSet() throws SQLException { + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setJobTimeoutMs( + Long.MAX_VALUE) // Force executeSelect to use ReadAPI instead of fast query. + .setUseReadAPI(true) + .setUseQueryCache(false) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z' LIMIT 0"; + BigQueryResult bigQueryResult = connection.executeSelect(query); + + ResultSet rs = bigQueryResult.getResultSet(); + assertThat(rs.next()).isFalse(); + assertThat(bigQueryResult.getTotalRows()).isEqualTo(0); + } + @Test public void testExecuteSelectWithCredentials() throws SQLException { // This test validate that executeSelect uses the same credential provided by the BigQuery From 5ca7d4acbbc40d6ef337732464b3bbd130c86430 Mon Sep 17 00:00:00 2001 From: Oleksandr Shevchenko Date: Thu, 9 Jan 2025 16:31:23 +0200 Subject: [PATCH 1960/2268] fix(test): Force usage of ReadAPI (#3625) --- .../ConnImplBenchmark.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java index 670e31ff6e..eb239463fd 100644 --- a/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java +++ b/benchmark/src/main/java/com.google.cloud.bigquery/ConnImplBenchmark.java @@ -56,9 +56,14 @@ public class ConnImplBenchmark { public void setUp() throws IOException { java.util.logging.Logger.getGlobal().setLevel(Level.ALL); - connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder().setUseReadAPI(true).build(); - connectionSettingsReadAPIDisabled = - ConnectionSettings.newBuilder().setUseReadAPI(false).build(); + connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder() + .setUseReadAPI(true) + .setMaxResults(500L) + .setJobTimeoutMs(Long.MAX_VALUE) + .build(); + connectionSettingsReadAPIDisabled = ConnectionSettings.newBuilder() + .setUseReadAPI(false) + .build(); } @Benchmark @@ -153,8 +158,8 @@ private long getResultHash(BigQueryResult bigQueryResultSet) throws SQLException System.out.println("\n Running"); while (rs.next()) { hash += computeHash(rs, "vendor_id", ResultSet::getString); - hash += computeHash(rs, "pickup_datetime", ResultSet::getString); - hash += computeHash(rs, "dropoff_datetime", ResultSet::getString); + hash += computeHash(rs, "pickup_datetime", ResultSet::getLong); + hash += computeHash(rs, "dropoff_datetime", ResultSet::getLong); hash += computeHash(rs, "passenger_count", ResultSet::getLong); hash += computeHash(rs, "trip_distance", ResultSet::getDouble); hash += computeHash(rs, "rate_code", ResultSet::getString); From 442d217606b7d93d26887344a7a4a01303b18b8c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 Jan 2025 15:46:15 +0100 Subject: [PATCH 1961/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.41.1 (#3628) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index f971b05c95..5ced7ae24d 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index cbccd336a0..a512b35af9 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index d9c9d02051..554601f249 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 80a629d235..4218cff43a 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.1"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 644bb62ce7..b070666b48 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7214bf10cf..730162fd8a 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.41.0 + 3.41.1 diff --git a/pom.xml b/pom.xml index 819a34a1e3..051846e58b 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.41.0 + 3.41.1 From d1d52ac6776a2c70177f92182a676e93c04cd069 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 9 Jan 2025 15:46:52 +0100 Subject: [PATCH 1962/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.47.0 (#3629) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 051846e58b..62e6e94bfa 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.46.0 + 2.47.0 test From 3afc06b82559c49b199d79da7f125f2579070722 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 17:09:04 +0100 Subject: [PATCH 1963/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.58.0 (#3630) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 62e6e94bfa..162a8a0af7 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.57.0 + 2.58.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 978da1f36b..6badfec9c8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.57.0 + 2.58.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 190337e249..731df595ce 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.57.0 + 2.58.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index b6476b2bdb..bc783dde29 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.57.0 + 2.58.0 test From b0ea0d5bc4ac730b0e2eaf47e8a7441dc113686b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 17:09:17 +0100 Subject: [PATCH 1964/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.58.0 (#3631) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 162a8a0af7..84a8812fb4 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.57.0 + 2.58.0 test From e9ff265041f6771a71c8c378ed3ff5fdec6e837b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 17:11:11 +0100 Subject: [PATCH 1965/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.62.0 (#3632) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84a8812fb4..e4c359a133 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.61.0 + 1.62.0 pom import From ca20aa47ea7826594975ab6aeb8498e2377f8553 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 10 Jan 2025 19:07:50 +0100 Subject: [PATCH 1966/2268] deps: update actions/upload-artifact action to v4.6.0 (#3633) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 43e77e296a..185f0ef115 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: name: SARIF file path: results.sarif From 1eb844f2ab7f86d1e830ca551146fb82d43961f2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 11 Jan 2025 04:12:17 +0100 Subject: [PATCH 1967/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.11.1 (#3636) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4c359a133..47994ff596 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.11.0 + 3.11.1 pom import From bbbeed499108c24e6897340569bee8bd127728ee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:59:48 -0500 Subject: [PATCH 1968/2268] chore(main): release 2.46.0 (#3613) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 38 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d8f525e2f..3e93809751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [2.46.0](https://github.com/googleapis/java-bigquery/compare/v2.45.0...v2.46.0) (2025-01-11) + + +### Features + +* **bigquery:** Support IAM conditions in datasets in Java client. ([#3602](https://github.com/googleapis/java-bigquery/issues/3602)) ([6696a9c](https://github.com/googleapis/java-bigquery/commit/6696a9c7d42970e3c24bda4da713a855dbe40ce5)) + + +### Bug Fixes + +* NPE when reading BigQueryResultSet from empty tables ([#3627](https://github.com/googleapis/java-bigquery/issues/3627)) ([9a0b05a](https://github.com/googleapis/java-bigquery/commit/9a0b05a3b57797b7cdd8ca9739699fc018dbd868)) +* **test:** Force usage of ReadAPI ([#3625](https://github.com/googleapis/java-bigquery/issues/3625)) ([5ca7d4a](https://github.com/googleapis/java-bigquery/commit/5ca7d4acbbc40d6ef337732464b3bbd130c86430)) + + +### Dependencies + +* Update actions/upload-artifact action to v4.5.0 ([#3620](https://github.com/googleapis/java-bigquery/issues/3620)) ([cc25099](https://github.com/googleapis/java-bigquery/commit/cc25099f81cbf94e9e2ee9db03a7d9ecd913c176)) +* Update actions/upload-artifact action to v4.6.0 ([#3633](https://github.com/googleapis/java-bigquery/issues/3633)) ([ca20aa4](https://github.com/googleapis/java-bigquery/commit/ca20aa47ea7826594975ab6aeb8498e2377f8553)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.57.0 ([#3617](https://github.com/googleapis/java-bigquery/issues/3617)) ([51370a9](https://github.com/googleapis/java-bigquery/commit/51370a92e7ab29dfce91199666f23576d2d1b64a)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.58.0 ([#3631](https://github.com/googleapis/java-bigquery/issues/3631)) ([b0ea0d5](https://github.com/googleapis/java-bigquery/commit/b0ea0d5bc4ac730b0e2eaf47e8a7441dc113686b)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20241222-2.0.0 ([#3623](https://github.com/googleapis/java-bigquery/issues/3623)) ([4061922](https://github.com/googleapis/java-bigquery/commit/4061922e46135d673bfa48c00bbf284efa46e065)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.61.0 ([#3618](https://github.com/googleapis/java-bigquery/issues/3618)) ([6cba626](https://github.com/googleapis/java-bigquery/commit/6cba626ff14cebbc04fa4f6058b273de0c5dd96e)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.62.0 ([#3632](https://github.com/googleapis/java-bigquery/issues/3632)) ([e9ff265](https://github.com/googleapis/java-bigquery/commit/e9ff265041f6771a71c8c378ed3ff5fdec6e837b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.41.1 ([#3628](https://github.com/googleapis/java-bigquery/issues/3628)) ([442d217](https://github.com/googleapis/java-bigquery/commit/442d217606b7d93d26887344a7a4a01303b18b8c)) +* Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.37.0 ([#3614](https://github.com/googleapis/java-bigquery/issues/3614)) ([f5faa69](https://github.com/googleapis/java-bigquery/commit/f5faa69bc5b6fdae137724df5693f8aecf27d609)) +* Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.37.0 ([#3615](https://github.com/googleapis/java-bigquery/issues/3615)) ([a6c7944](https://github.com/googleapis/java-bigquery/commit/a6c79443a5e675a01ecb91e362e261a6f6ecc055)) +* Update github/codeql-action action to v2.27.9 ([#3608](https://github.com/googleapis/java-bigquery/issues/3608)) ([567ce01](https://github.com/googleapis/java-bigquery/commit/567ce01ed77d44760ddcd872a0d61abdd6a09832)) +* Update github/codeql-action action to v2.28.0 ([#3621](https://github.com/googleapis/java-bigquery/issues/3621)) ([e0e09ec](https://github.com/googleapis/java-bigquery/commit/e0e09ec4954f5b5e2f094e4c67600f38353f453c)) + ## [2.45.0](https://github.com/googleapis/java-bigquery/compare/v2.44.0...v2.45.0) (2024-12-13) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 71f23707f5..18d5535d1a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.45.1-SNAPSHOT + 2.46.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 730162fd8a..3326027c8e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.45.1-SNAPSHOT + 2.46.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.45.1-SNAPSHOT + 2.46.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a18a1d1ada..ed717baf09 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.45.1-SNAPSHOT + 2.46.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.45.1-SNAPSHOT + 2.46.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 47994ff596..55b63fffa1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.45.1-SNAPSHOT + 2.46.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.45.1-SNAPSHOT + 2.46.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 731df595ce..291f257b10 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.45.1-SNAPSHOT + 2.46.0 diff --git a/versions.txt b/versions.txt index b964bf3a4d..a944a00ff4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.45.0:2.45.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.46.0:2.46.0 \ No newline at end of file From 858e51792d98276f10fd780ef6edd0bb4a1b4f54 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 Jan 2025 16:57:19 +0100 Subject: [PATCH 1969/2268] deps: update github/codeql-action action to v2.28.1 (#3637) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 185f0ef115..b04c8ba875 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -67,6 +67,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@673cceb2b4886e2dfff697ab64a1ecd1c0a14a05 # v2.28.0 + uses: github/codeql-action/upload-sarif@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1 with: sarif_file: results.sarif From afd1821ed6cbf9c854d8ffcd728a1a44b061f6d2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 Jan 2025 17:15:59 +0100 Subject: [PATCH 1970/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.46.0 (#3640) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6badfec9c8..59fbad99f2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.45.0 + 2.46.0 From 5ed5f49886052a051b335e943feedd11f6f1f5d2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 14 Jan 2025 19:48:26 +0100 Subject: [PATCH 1971/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.51.1 (#3638) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 59fbad99f2..9f33fb2e60 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.51.0 + 2.51.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 291f257b10..7fba9968be 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.51.0 + 2.51.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bc783dde29..635d02a71c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.51.0 + 2.51.1 test From 09c98bf56f8e2685405a847802a04b14b7b8109e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:03:27 -0500 Subject: [PATCH 1972/2268] chore(main): release 2.46.1-SNAPSHOT (#3639) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 18d5535d1a..8caef6763a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.46.0 + 2.46.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3326027c8e..5804c1ae31 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.46.0 + 2.46.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.46.0 + 2.46.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ed717baf09..882c22006c 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.46.0 + 2.46.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.46.0 + 2.46.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 55b63fffa1..68d2538378 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.46.0 + 2.46.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.46.0 + 2.46.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7fba9968be..fc97dddd7c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.46.0 + 2.46.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index a944a00ff4..4c6875fee5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.46.0:2.46.0 \ No newline at end of file +google-cloud-bigquery:2.46.0:2.46.1-SNAPSHOT \ No newline at end of file From fadd992a63fd1bc87c99cc689ed103f05de49a99 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:10:37 -0800 Subject: [PATCH 1973/2268] fix(bigquery): Remove ReadAPI bypass in executeSelect() (#3624) * fix(bigquery): Remove ReadAPI bypass in executeSelect() for fast query requests. * Enable fast query and read API. Move readAPI condition check from getExecuteSelectResponse() to queryRpc(). This allows fast query to be used with ReadAPI. * Check for null for fast query results.getTotalRows() * Remove test file. * Add internal query state to keep track of ReadAPI usage. A Boolean field is added to keep track of whether or not the high throughput ReadAPI is used. This is mostly for testing to avoid another regression in the future. * Move tests into IT test file * Fix formatting changes. Again :/ * Add VisibleForTesting Annotation --- .../google/cloud/bigquery/ConnectionImpl.java | 24 +++++--- .../google/cloud/bigquery/JobStatistics.java | 15 +++++ .../cloud/bigquery/it/ITBigQueryTest.java | 58 +++++++++++++++++++ 3 files changed, 89 insertions(+), 8 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 1f08bf4eb5..728a1fdaee 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -476,22 +476,29 @@ private BigQueryResult queryRpc( } // Query finished running and we can paginate all the results - if (results.getJobComplete() && results.getSchema() != null) { + // Results should be read using the high throughput read API if sufficiently large. + boolean resultsLargeEnoughForReadApi = + connectionSettings.getUseReadAPI() + && results.getTotalRows() != null + && results.getTotalRows().longValue() > connectionSettings.getMinResultSize(); + if (results.getJobComplete() && results.getSchema() != null && !resultsLargeEnoughForReadApi) { return processQueryResponseResults(results); } else { - // Query is long-running (> 10s) and hasn't completed yet, or query completed but didn't - // return the schema, fallback to jobs.insert path. Some operations don't return the schema - // and can be optimized here, but this is left as future work. - Long totalRows = results.getTotalRows() == null ? null : results.getTotalRows().longValue(); - Long pageRows = results.getRows() == null ? null : (long) (results.getRows().size()); + // Query is long-running (> 10s) and hasn't completed yet, query completed but didn't + // return the schema, or results are sufficiently large to use the high throughput read API, + // fallback to jobs.insert path. Some operations don't return the schema and can be optimized + // here, but this is left as future work. + JobId jobId = JobId.fromPb(results.getJobReference()); + GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); + Long totalRows = + firstPage.getTotalRows() == null ? null : firstPage.getTotalRows().longValue(); + Long pageRows = firstPage.getRows() == null ? null : (long) (firstPage.getRows().size()); logger.log( Level.WARNING, "\n" + String.format( "results.getJobComplete(): %s, isSchemaNull: %s , totalRows: %s, pageRows: %s", results.getJobComplete(), results.getSchema() == null, totalRows, pageRows)); - JobId jobId = JobId.fromPb(results.getJobReference()); - GetQueryResultsResponse firstPage = getQueryResultsFirstPage(jobId); return getSubsequentQueryResultsWithJob( totalRows, pageRows, jobId, firstPage, hasQueryParameters); } @@ -996,6 +1003,7 @@ BigQueryResult highThroughPutRead( schema); logger.log(Level.INFO, "\n Using BigQuery Read API"); + stats.getQueryStatistics().setUseReadApi(true); return new BigQueryResultImpl(schema, totalRows, bufferRow, stats); } catch (IOException e) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index efbfda0222..407e25a8f3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -27,6 +27,7 @@ import com.google.auto.value.AutoValue; import com.google.cloud.StringEnumType; import com.google.cloud.StringEnumValue; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects.ToStringHelper; @@ -396,6 +397,7 @@ public static class QueryStatistics extends JobStatistics { private final BiEngineStats biEngineStats; private final Integer billingTier; private final Boolean cacheHit; + private Boolean useReadApi; private final String ddlOperationPerformed; private final TableId ddlTargetTable; private final RoutineId ddlTargetRoutine; @@ -796,6 +798,7 @@ private QueryStatistics(Builder builder) { this.biEngineStats = builder.biEngineStats; this.billingTier = builder.billingTier; this.cacheHit = builder.cacheHit; + this.useReadApi = false; this.ddlOperationPerformed = builder.ddlOperationPerformed; this.ddlTargetTable = builder.ddlTargetTable; this.ddlTargetRoutine = builder.ddlTargetRoutine; @@ -835,6 +838,18 @@ public Boolean getCacheHit() { return cacheHit; } + /** Returns whether the query result is read from the high throughput ReadAPI. */ + @VisibleForTesting + public Boolean getUseReadApi() { + return useReadApi; + } + + /** Sets internal state to reflect the use of the high throughput ReadAPI. */ + @VisibleForTesting + public void setUseReadApi(Boolean useReadApi) { + this.useReadApi = useReadApi; + } + /** [BETA] For DDL queries, returns the operation applied to the DDL target table. */ public String getDdlOperationPerformed() { return ddlOperationPerformed; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 24bf84f6ea..0178ac10ad 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3489,6 +3489,63 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; BigQueryResult bigQueryResult = connection.executeSelect(query); assertEquals(42, bigQueryResult.getTotalRows()); + assertFalse(bigQueryResult.getBigQueryResultStats().getQueryStatistics().getUseReadApi()); + } + + @Test + public void testExecuteSelectWithReadApi() throws SQLException { + final int rowLimit = 5000; + final String QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; + // Job timeout is somewhat arbitrary - just ensures that fast query is not used. + // min result size and page row count ratio ensure that the ReadAPI is used. + ConnectionSettings connectionSettingsReadAPIEnabledFastQueryDisabled = + ConnectionSettings.newBuilder() + .setUseReadAPI(true) + .setJobTimeoutMs(Long.MAX_VALUE) + .setMinResultSize(500) + .setTotalToPageRowCountRatio(1) + .build(); + + Connection connectionReadAPIEnabled = + bigquery.createConnection(connectionSettingsReadAPIEnabledFastQueryDisabled); + + String selectQuery = String.format(QUERY, rowLimit); + + BigQueryResult bigQueryResultSet = connectionReadAPIEnabled.executeSelect(selectQuery); + ResultSet rs = bigQueryResultSet.getResultSet(); + // Paginate results to avoid an InterruptedException + while (rs.next()) {} + + assertTrue(bigQueryResultSet.getBigQueryResultStats().getQueryStatistics().getUseReadApi()); + connectionReadAPIEnabled.close(); + } + + @Test + public void testExecuteSelectWithFastQueryReadApi() throws SQLException { + final int rowLimit = 5000; + final String QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; + // min result size and page row count ratio ensure that the ReadAPI is used. + ConnectionSettings connectionSettingsReadAPIEnabledFastQueryDisabled = + ConnectionSettings.newBuilder() + .setUseReadAPI(true) + .setMinResultSize(500) + .setTotalToPageRowCountRatio(1) + .build(); + + Connection connectionReadAPIEnabled = + bigquery.createConnection(connectionSettingsReadAPIEnabledFastQueryDisabled); + + String selectQuery = String.format(QUERY, rowLimit); + + BigQueryResult bigQueryResultSet = connectionReadAPIEnabled.executeSelect(selectQuery); + ResultSet rs = bigQueryResultSet.getResultSet(); + // Paginate results to avoid an InterruptedException + while (rs.next()) {} + + assertTrue(bigQueryResultSet.getBigQueryResultStats().getQueryStatistics().getUseReadApi()); + connectionReadAPIEnabled.close(); } @Test @@ -3540,6 +3597,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { + TABLE_ID_LARGE.getTable(); // Large query result is needed to use BigQueryReadClient. BigQueryResult bigQueryResult = connectionGoodCredentials.executeSelect(query); assertEquals(313348, bigQueryResult.getTotalRows()); + assertTrue(bigQueryResult.getBigQueryResultStats().getQueryStatistics().getUseReadApi()); // Scenario 2. // Create a new bigQuery object but explicitly an invalid credential. From 8833c97d73e3ba8e6a2061bbc55a6254b9e6668e Mon Sep 17 00:00:00 2001 From: Naung Nine Date: Fri, 17 Jan 2025 00:13:52 +0900 Subject: [PATCH 1974/2268] fix: Close bq read client (#3644) * Shutdown bqReadClient after high throughput read * Code formatted to google-java-format --- .../google/cloud/bigquery/ConnectionImpl.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 728a1fdaee..5ad9fe2843 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -97,6 +97,7 @@ class ConnectionImpl implements Connection { private final Logger logger = Logger.getLogger(this.getClass().getName()); private BigQueryReadClient bqReadClient; private static final long EXECUTOR_TIMEOUT_SEC = 10; + private static final long BIGQUERY_TIMEOUT_SEC = 10; private BlockingQueue> bufferFvl; // initialized lazily iff we end up using the tabledata.list end point private BlockingQueue @@ -148,8 +149,15 @@ public synchronized boolean close() throws BigQuerySQLException { flagEndOfStream(); // an End of Stream flag in the buffer so that the `ResultSet.next()` stops // advancing the cursor queryTaskExecutor.shutdownNow(); + boolean isBqReadClientTerminated = true; try { - if (queryTaskExecutor.awaitTermination(EXECUTOR_TIMEOUT_SEC, TimeUnit.SECONDS)) { + if (bqReadClient != null) { + bqReadClient.shutdownNow(); + isBqReadClientTerminated = + bqReadClient.awaitTermination(BIGQUERY_TIMEOUT_SEC, TimeUnit.SECONDS); + } + if (queryTaskExecutor.awaitTermination(EXECUTOR_TIMEOUT_SEC, TimeUnit.SECONDS) + && isBqReadClientTerminated) { return true; } // else queryTaskExecutor.isShutdown() will be returned outside this try block } catch (InterruptedException e) { @@ -159,7 +167,9 @@ public synchronized boolean close() throws BigQuerySQLException { e); // Logging InterruptedException instead of throwing the exception back, close method // will return queryTaskExecutor.isShutdown() } - return queryTaskExecutor.isShutdown(); // check if the executor has been shutdown + + return queryTaskExecutor.isShutdown() + && isBqReadClientTerminated; // check if the executor has been shutdown } /** @@ -992,7 +1002,6 @@ BigQueryResult highThroughPutRead( // DO a regex check using order by and use multiple streams ; ReadSession readSession = bqReadClient.createReadSession(builder.build()); - bufferRow = new LinkedBlockingDeque<>(getBufferSize()); Map arrowNameToIndex = new HashMap<>(); // deserialize and populate the buffer async, so that the client isn't blocked @@ -1050,6 +1059,7 @@ private void processArrowStreamAsync( "\n" + Thread.currentThread().getName() + " Interrupted @ markLast", e); } + bqReadClient.shutdownNow(); // Shutdown the read client queryTaskExecutor.shutdownNow(); // Shutdown the thread pool } }; From fd06100c4c18b0416d384ec1f6bdfc796b70ad9f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 27 Jan 2025 16:56:52 +0100 Subject: [PATCH 1975/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250112-2.0.0 (#3651) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68d2538378..4d19534b49 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20241222-2.0.0 + v2-rev20250112-2.0.0 From e10a1bef929cdc01b1020e17f5843625c1df8cf5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Jan 2025 19:49:02 +0100 Subject: [PATCH 1976/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.48.0 (#3654) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d19534b49..463504f420 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.47.0 + 2.48.0 test From 1a143428c7f584db3dd6e827c2ee8fe980afe18c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 28 Jan 2025 19:49:24 +0100 Subject: [PATCH 1977/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.42.0 (#3653) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 5ced7ae24d..813d09f1ba 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.42.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index a512b35af9..ce53947530 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.42.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 554601f249..ffdac23782 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.42.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 4218cff43a..6331bd5861 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.1"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.42.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index b070666b48..f08c4be3e0 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.42.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 5804c1ae31..27abe1df62 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.41.1 + 3.42.0 diff --git a/pom.xml b/pom.xml index 463504f420..58546b2d50 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.41.1 + 3.42.0 From 01e0b742b9ffeafaa89b080a39d8a66c12c1fd3b Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Tue, 28 Jan 2025 11:37:00 -0800 Subject: [PATCH 1978/2268] feat(bigquery): Support resource tags for datasets in java client (#3647) * feat(bigquery): Support resource tags for datasets in java client * add method to clirr-ignored-diff file * Try Acl permissions to grant tag permissions * Add exception to func signature * Remove IT tests --- .../clirr-ignored-differences.xml | 5 +++ .../com/google/cloud/bigquery/Dataset.java | 6 +++ .../google/cloud/bigquery/DatasetInfo.java | 41 +++++++++++++++++++ .../cloud/bigquery/DatasetInfoTest.java | 7 ++++ .../google/cloud/bigquery/DatasetTest.java | 8 ++++ 5 files changed, 67 insertions(+) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index b6546847fe..9ef680c667 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -134,4 +134,9 @@ com/google/cloud/bigquery/DatasetInfo* *setMaxTimeTravelHours(*) + + 7013 + com/google/cloud/bigquery/DatasetInfo* + *setResourceTags(*) + \ No newline at end of file diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java index 4fc8577853..18606e7013 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java @@ -170,6 +170,12 @@ public Builder setMaxTimeTravelHours(Long maxTimeTravelHours) { return this; } + @Override + public Builder setResourceTags(Map resourceTags) { + infoBuilder.setResourceTags(resourceTags); + return this; + } + @Override public Dataset build() { return new Dataset(bigquery, infoBuilder); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index f9b7f03e17..90d6c2cd55 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -76,6 +76,7 @@ public Dataset apply(DatasetInfo datasetInfo) { private final ExternalDatasetReference externalDatasetReference; private final String storageBillingModel; private final Long maxTimeTravelHours; + private final Annotations resourceTags; /** A builder for {@code DatasetInfo} objects. */ public abstract static class Builder { @@ -184,6 +185,19 @@ public abstract Builder setDefaultEncryptionConfiguration( */ public abstract Builder setDefaultCollation(String defaultCollation); + /** + * Optional. The tags attached to this + * dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, + * for example "123456789012/environment" where 123456789012 is the ID of the parent + * organization or project resource for this tag key. Tag value is expected to be the short + * name, for example "Production". + * + * @see Tag + * definitions for more details. + * @param resourceTags resourceTags or {@code null} for none + */ + public abstract Builder setResourceTags(Map resourceTags); + /** Creates a {@code DatasetInfo} object. */ public abstract DatasetInfo build(); } @@ -208,6 +222,7 @@ static final class BuilderImpl extends Builder { private ExternalDatasetReference externalDatasetReference; private String storageBillingModel; private Long maxTimeTravelHours; + private Annotations resourceTags = Annotations.ZERO; BuilderImpl() {} @@ -230,6 +245,7 @@ static final class BuilderImpl extends Builder { this.externalDatasetReference = datasetInfo.externalDatasetReference; this.storageBillingModel = datasetInfo.storageBillingModel; this.maxTimeTravelHours = datasetInfo.maxTimeTravelHours; + this.resourceTags = datasetInfo.resourceTags; } BuilderImpl(com.google.api.services.bigquery.model.Dataset datasetPb) { @@ -270,6 +286,7 @@ public Acl apply(Dataset.Access accessPb) { } this.storageBillingModel = datasetPb.getStorageBillingModel(); this.maxTimeTravelHours = datasetPb.getMaxTimeTravelHours(); + this.resourceTags = Annotations.fromPb(datasetPb.getResourceTags()); } @Override @@ -388,6 +405,12 @@ public Builder setMaxTimeTravelHours(Long maxTimeTravelHours) { return this; } + @Override + public Builder setResourceTags(Map resourceTags) { + this.resourceTags = Annotations.fromUser(resourceTags); + return this; + } + @Override public DatasetInfo build() { return new DatasetInfo(this); @@ -413,6 +436,7 @@ public DatasetInfo build() { externalDatasetReference = builder.externalDatasetReference; storageBillingModel = builder.storageBillingModel; maxTimeTravelHours = builder.maxTimeTravelHours; + resourceTags = builder.resourceTags; } /** Returns the dataset identity. */ @@ -554,6 +578,21 @@ public Long getMaxTimeTravelHours() { return maxTimeTravelHours; } + /** + * Optional. The tags attached to this + * dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for + * example "123456789012/environment" where 123456789012 is the ID of the parent organization or + * project resource for this tag key. Tag value is expected to be the short name, for example + * "Production". + * + * @see Tag + * definitions for more details. + * @return value or {@code null} for none + */ + public Map getResourceTags() { + return resourceTags.userMap(); + } + /** * Returns information about the external metadata storage where the dataset is defined. Filled * out when the dataset type is EXTERNAL. @@ -588,6 +627,7 @@ public String toString() { .add("externalDatasetReference", externalDatasetReference) .add("storageBillingModel", storageBillingModel) .add("maxTimeTravelHours", maxTimeTravelHours) + .add("resourceTags", resourceTags) .toString(); } @@ -675,6 +715,7 @@ public Dataset.Access apply(Acl acl) { if (maxTimeTravelHours != null) { datasetPb.setMaxTimeTravelHours(maxTimeTravelHours); } + datasetPb.setResourceTags(resourceTags.toPb()); return datasetPb; } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index 49a392baf7..e999b86e25 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -62,6 +62,10 @@ public class DatasetInfoTest { private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final Long MAX_TIME_TRAVEL_HOURS_5_DAYS = 120L; private static final Long MAX_TIME_TRAVEL_HOURS_7_DAYS = 168L; + private static final Map RESOURCE_TAGS = + ImmutableMap.of( + "example-key1", "example-value1", + "example-key2", "example-value2"); private static final ExternalDatasetReference EXTERNAL_DATASET_REFERENCE = ExternalDatasetReference.newBuilder() @@ -85,6 +89,7 @@ public class DatasetInfoTest { .setDefaultPartitionExpirationMs(DEFAULT_PARTITION__EXPIRATION) .setStorageBillingModel(STORAGE_BILLING_MODEL) .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS_7_DAYS) + .setResourceTags(RESOURCE_TAGS) .build(); private static final DatasetInfo DATASET_INFO_COMPLETE = DATASET_INFO @@ -183,6 +188,7 @@ public void testBuilder() { assertEquals( MAX_TIME_TRAVEL_HOURS_5_DAYS, DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS.getMaxTimeTravelHours()); + assertEquals(RESOURCE_TAGS, DATASET_INFO.getResourceTags()); } @Test @@ -272,5 +278,6 @@ private void compareDatasets(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); assertEquals(expected.getMaxTimeTravelHours(), value.getMaxTimeTravelHours()); + assertEquals(expected.getResourceTags(), value.getResourceTags()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index e2d7c635ce..d138e3cb51 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -68,6 +68,10 @@ public class DatasetTest { private static final Field FIELD = Field.of("FieldName", LegacySQLTypeName.INTEGER); private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final Long MAX_TIME_TRAVEL_HOURS = 168L; + private static final Map RESOURCE_TAGS = + ImmutableMap.of( + "example-key1", "example-value1", + "example-key2", "example-value2"); private static final StandardTableDefinition TABLE_DEFINITION = StandardTableDefinition.of(Schema.of(FIELD)); private static final ViewDefinition VIEW_DEFINITION = ViewDefinition.of("QUERY"); @@ -124,6 +128,7 @@ public void testBuilder() { .setLabels(LABELS) .setStorageBillingModel(STORAGE_BILLING_MODEL) .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) + .setResourceTags(RESOURCE_TAGS) .build(); assertEquals(DATASET_ID, builtDataset.getDatasetId()); assertEquals(ACCESS_RULES, builtDataset.getAcl()); @@ -139,6 +144,7 @@ public void testBuilder() { assertEquals(LABELS, builtDataset.getLabels()); assertEquals(STORAGE_BILLING_MODEL, builtDataset.getStorageBillingModel()); assertEquals(MAX_TIME_TRAVEL_HOURS, builtDataset.getMaxTimeTravelHours()); + assertEquals(RESOURCE_TAGS, builtDataset.getResourceTags()); } @Test @@ -348,6 +354,7 @@ public void testExternalDatasetReference() { .setExternalDatasetReference(EXTERNAL_DATASET_REFERENCE) .setStorageBillingModel(STORAGE_BILLING_MODEL) .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) + .setResourceTags(RESOURCE_TAGS) .build(); assertEquals( EXTERNAL_DATASET_REFERENCE, @@ -379,5 +386,6 @@ private void compareDatasetInfo(DatasetInfo expected, DatasetInfo value) { assertEquals(expected.getExternalDatasetReference(), value.getExternalDatasetReference()); assertEquals(expected.getStorageBillingModel(), value.getStorageBillingModel()); assertEquals(expected.getMaxTimeTravelHours(), value.getMaxTimeTravelHours()); + assertEquals(expected.getResourceTags(), value.getResourceTags()); } } From 52fdbfae08ba84f4497a0f71d8a558bee1db4ba9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 29 Jan 2025 05:10:31 +0100 Subject: [PATCH 1979/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.11.2 (#3656) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 58546b2d50..40807a7dbc 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.11.1 + 3.11.2 pom import From fa641a8f58cc2a3a24570517b16e665c127c362b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 23:40:24 -0500 Subject: [PATCH 1980/2268] chore(main): release 2.47.0 (#3643) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e93809751..addb3d7233 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.47.0](https://github.com/googleapis/java-bigquery/compare/v2.46.0...v2.47.0) (2025-01-29) + + +### Features + +* **bigquery:** Support resource tags for datasets in java client ([#3647](https://github.com/googleapis/java-bigquery/issues/3647)) ([01e0b74](https://github.com/googleapis/java-bigquery/commit/01e0b742b9ffeafaa89b080a39d8a66c12c1fd3b)) + + +### Bug Fixes + +* **bigquery:** Remove ReadAPI bypass in executeSelect() ([#3624](https://github.com/googleapis/java-bigquery/issues/3624)) ([fadd992](https://github.com/googleapis/java-bigquery/commit/fadd992a63fd1bc87c99cc689ed103f05de49a99)) +* Close bq read client ([#3644](https://github.com/googleapis/java-bigquery/issues/3644)) ([8833c97](https://github.com/googleapis/java-bigquery/commit/8833c97d73e3ba8e6a2061bbc55a6254b9e6668e)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250112-2.0.0 ([#3651](https://github.com/googleapis/java-bigquery/issues/3651)) ([fd06100](https://github.com/googleapis/java-bigquery/commit/fd06100c4c18b0416d384ec1f6bdfc796b70ad9f)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.42.0 ([#3653](https://github.com/googleapis/java-bigquery/issues/3653)) ([1a14342](https://github.com/googleapis/java-bigquery/commit/1a143428c7f584db3dd6e827c2ee8fe980afe18c)) +* Update github/codeql-action action to v2.28.1 ([#3637](https://github.com/googleapis/java-bigquery/issues/3637)) ([858e517](https://github.com/googleapis/java-bigquery/commit/858e51792d98276f10fd780ef6edd0bb4a1b4f54)) + ## [2.46.0](https://github.com/googleapis/java-bigquery/compare/v2.45.0...v2.46.0) (2025-01-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8caef6763a..602d048577 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.46.1-SNAPSHOT + 2.47.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 27abe1df62..3a5c6f3e1d 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.46.1-SNAPSHOT + 2.47.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.46.1-SNAPSHOT + 2.47.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 882c22006c..13651acacb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.46.1-SNAPSHOT + 2.47.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.46.1-SNAPSHOT + 2.47.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 40807a7dbc..d6826d5665 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.46.1-SNAPSHOT + 2.47.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.46.1-SNAPSHOT + 2.47.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index fc97dddd7c..bb0ca36c12 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.46.1-SNAPSHOT + 2.47.0 diff --git a/versions.txt b/versions.txt index 4c6875fee5..d6010fec4a 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.46.0:2.46.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.47.0:2.47.0 \ No newline at end of file From 58f80926f743eb2fd7258c19acb060b870f8841c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Jan 2025 16:19:37 +0100 Subject: [PATCH 1981/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.47.0 (#3658) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 9f33fb2e60..2b580c6d47 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.46.0 + 2.47.0 From 728e312887856b3cfb243f650a4392d354c7a4d5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Jan 2025 16:20:56 +0100 Subject: [PATCH 1982/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.59.0 (#3659) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d6826d5665..a3ee30d416 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.58.0 + 2.59.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 2b580c6d47..b5f6b66f5b 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.58.0 + 2.59.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index bb0ca36c12..600522b26f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.58.0 + 2.59.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 635d02a71c..69ea0c9e16 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.58.0 + 2.59.0 test From 3a6228b4adc638759d3b2725c612e97e1a3b9cec Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Jan 2025 16:21:19 +0100 Subject: [PATCH 1983/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.59.0 (#3660) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a3ee30d416..497654fc9f 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.58.0 + 2.59.0 test From 9bc8c0115dc16fb950567cd85cc7dfaa9df50d7d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 30 Jan 2025 19:51:08 +0100 Subject: [PATCH 1984/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.63.0 (#3661) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 497654fc9f..5b1d3a0d76 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.62.0 + 1.63.0 pom import From c7ef94be115cd572df589385f9be801033d72d6d Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:56:57 -0500 Subject: [PATCH 1985/2268] feat: implement wasNull for BigQueryResultSet (#3650) * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet * feat: implement wasNull for BigQueryResultSet --- .../cloud/bigquery/BigQueryResultImpl.java | 407 +++++++++++------- .../bigquery/BigQueryResultImplTest.java | 257 +++++++++++ 2 files changed, 505 insertions(+), 159 deletions(-) create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java index a1bb4d4069..e1e129eaea 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -24,14 +24,17 @@ import java.sql.Timestamp; import java.time.LocalDateTime; import java.time.LocalTime; -import java.time.ZoneId; import java.util.Map; -import java.util.TimeZone; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; import org.apache.arrow.vector.util.JsonStringArrayList; import org.apache.arrow.vector.util.Text; +/** + * An implementation of BigQueryResult. + * + *

    This class and the ResultSet it returns is not thread-safe. + */ public class BigQueryResultImpl implements BigQueryResult { private static final String NULL_CURSOR_MSG = @@ -109,6 +112,7 @@ private class BigQueryResultSet extends AbstractJdbcResultSet { private boolean hasReachedEnd = false; // flag which will be set to true when we have encountered a EndOfStream or when // curTup.isLast(). Ref: https://github.com/googleapis/java-bigquery/issues/2033 + private boolean wasNull = false; @Override /*Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation*/ @@ -148,6 +152,14 @@ private boolean isEndOfStream(T cursor) { return cursor instanceof ConnectionImpl.EndOfFieldValueList; } + private Object getCurrentValueForReadApiData(String fieldName) throws SQLException { + Row curRow = (Row) cursor; + if (!curRow.hasField(fieldName)) { + throw new SQLException(String.format("Field %s not found", fieldName)); + } + return curRow.get(fieldName); + } + @Override public Object getObject(String fieldName) throws SQLException { if (fieldName == null) { @@ -157,13 +169,20 @@ public Object getObject(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) ? null : fieldValue.getValue(); + if (fieldValue == null || fieldValue.getValue() == null) { + wasNull = true; + return null; + } + wasNull = false; + return fieldValue.getValue(); } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return null; } - return curRow.get(fieldName); + wasNull = false; + return curVal; } } @@ -173,7 +192,12 @@ public Object getObject(int columnIndex) throws SQLException { return null; } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) ? null : fieldValue.getValue(); + if (fieldValue == null || fieldValue.getValue() == null) { + wasNull = true; + return null; + } + wasNull = false; + return fieldValue.getValue(); } else { // Data received from Read API (Arrow) return getObject(schemaFieldList.get(columnIndex).getName()); } @@ -189,23 +213,23 @@ public String getString(String fieldName) throws SQLException { } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; return null; - } else if (fieldValue - .getAttribute() - .equals(FieldValue.Attribute.REPEATED)) { // Case for Arrays + } + wasNull = false; + if (fieldValue.getAttribute().equals(FieldValue.Attribute.REPEATED)) { // Case for Arrays return fieldValue.getValue().toString(); } else { return fieldValue.getStringValue(); } } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); - } - Object currentVal = curRow.get(fieldName); + Object currentVal = getCurrentValueForReadApiData(fieldName); if (currentVal == null) { + wasNull = true; return null; - } else if (currentVal instanceof JsonStringArrayList) { // arrays + } + wasNull = false; + if (currentVal instanceof JsonStringArrayList) { // arrays JsonStringArrayList jsnAry = (JsonStringArrayList) currentVal; return jsnAry.toString(); } else if (currentVal instanceof LocalDateTime) { @@ -224,9 +248,12 @@ public String getString(int columnIndex) throws SQLException { return null; } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : fieldValue.getStringValue(); + if (fieldValue == null || fieldValue.getValue() == null) { + wasNull = true; + return null; + } + wasNull = false; + return fieldValue.getStringValue(); } else { // Data received from Read API (Arrow) return getString(schemaFieldList.get(columnIndex).getName()); } @@ -242,27 +269,27 @@ public int getInt(String fieldName) throws SQLException { // java.sql.ResultSet definition } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0 - : fieldValue.getNumericValue().intValue(); - } else { // Data received from Read API (Arrow) - - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return 0; } - Object curVal = curRow.get(fieldName); - if (curVal == null) { + wasNull = false; + return fieldValue.getNumericValue().intValue(); + } else { // Data received from Read API (Arrow) + Object currentVal = getCurrentValueForReadApiData(fieldName); + if (currentVal == null) { + wasNull = true; return 0; } - if (curVal instanceof Text) { // parse from text to int - return Integer.parseInt(((Text) curVal).toString()); - } else if (curVal + wasNull = false; + if (currentVal instanceof Text) { // parse from text to int + return Integer.parseInt((currentVal).toString()); + } else if (currentVal instanceof Long) { // incase getInt is called for a Long value. Loss of precision might occur - return ((Long) curVal).intValue(); + return ((Long) currentVal).intValue(); } - return ((BigDecimal) curVal).intValue(); + return ((BigDecimal) currentVal).intValue(); } } @@ -273,9 +300,11 @@ public int getInt(int columnIndex) throws SQLException { // java.sql.ResultSet definition } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0 - : fieldValue.getNumericValue().intValue(); + if (fieldValue == null || fieldValue.getValue() == null) { + wasNull = true; + return 0; + } + return fieldValue.getNumericValue().intValue(); } else { // Data received from Read API (Arrow) return getInt(schemaFieldList.get(columnIndex).getName()); } @@ -290,20 +319,21 @@ public long getLong(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0L - : fieldValue.getNumericValue().longValue(); - } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return 0L; } - Object curVal = curRow.get(fieldName); + wasNull = false; + return fieldValue.getNumericValue().longValue(); + } else { // Data received from Read API (Arrow) + Object curVal = getCurrentValueForReadApiData(fieldName); if (curVal == null) { + wasNull = true; return 0L; - } else { // value will be Long or BigDecimal, but are Number - return ((Number) curVal).longValue(); } + wasNull = false; + // value will be Long or BigDecimal, but are Number + return ((Number) curVal).longValue(); } } @@ -314,9 +344,12 @@ public long getLong(int columnIndex) throws SQLException { // java.sql.ResultSet definition } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0L - : fieldValue.getNumericValue().longValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return 0L; + } + wasNull = false; + return fieldValue.getNumericValue().longValue(); } else { // Data received from Read API (Arrow) return getInt(schemaFieldList.get(columnIndex).getName()); } @@ -331,16 +364,20 @@ public double getDouble(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0d - : fieldValue.getNumericValue().doubleValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return 0.0d; + } + wasNull = false; + return fieldValue.getNumericValue().doubleValue(); } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return 0.0d; } - Object curVal = curRow.get(fieldName); - return curVal == null ? 0.0d : new BigDecimal(curVal.toString()).doubleValue(); + wasNull = false; + return new BigDecimal(curVal.toString()).doubleValue(); } } @@ -351,9 +388,12 @@ public double getDouble(int columnIndex) throws SQLException { // java.sql.ResultSet definition } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? 0d - : fieldValue.getNumericValue().doubleValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return 0.0d; + } + wasNull = false; + return fieldValue.getNumericValue().doubleValue(); } else { // Data received from Read API (Arrow) return getDouble(schemaFieldList.get(columnIndex).getName()); } @@ -368,10 +408,19 @@ public BigDecimal getBigDecimal(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); } else { // Data received from Read API (Arrow) + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return null; + } + wasNull = false; return BigDecimal.valueOf(getDouble(fieldName)); } } @@ -382,9 +431,12 @@ public BigDecimal getBigDecimal(int columnIndex) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return BigDecimal.valueOf(fieldValue.getNumericValue().doubleValue()); } else { // Data received from Read API (Arrow) return getBigDecimal(schemaFieldList.get(columnIndex).getName()); } @@ -399,14 +451,20 @@ public boolean getBoolean(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return fieldValue.getValue() != null && fieldValue.getBooleanValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return false; + } + wasNull = false; + return fieldValue.getBooleanValue(); } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return false; } - Object curVal = curRow.get(fieldName); - return curVal != null && (Boolean) curVal; + wasNull = false; + return (Boolean) curVal; } } @@ -416,7 +474,12 @@ public boolean getBoolean(int columnIndex) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return fieldValue.getValue() != null && fieldValue.getBooleanValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return false; + } + wasNull = false; + return fieldValue.getBooleanValue(); } else { // Data received from Read API (Arrow) return getBoolean(schemaFieldList.get(columnIndex).getName()); } @@ -431,16 +494,20 @@ public byte[] getBytes(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : fieldValue.getBytesValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return fieldValue.getBytesValue(); } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return null; } - Object curVal = curRow.get(fieldName); - return curVal == null ? null : (byte[]) curVal; + wasNull = false; + return (byte[]) curVal; } } @@ -450,9 +517,12 @@ public byte[] getBytes(int columnIndex) throws SQLException { return null; // if the value is SQL NULL, the value returned is null } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : fieldValue.getBytesValue(); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return fieldValue.getBytesValue(); } else { // Data received from Read API (Arrow) return getBytes(schemaFieldList.get(columnIndex).getName()); } @@ -467,21 +537,23 @@ public Timestamp getTimestamp(String fieldName) throws SQLException { return null; // if the value is SQL NULL, the value returned is null } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : new Timestamp( - fieldValue.getTimestampValue() - / 1000); // getTimestampValue returns time in microseconds, and TimeStamp - // expects it in millis + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return new Timestamp( + fieldValue.getTimestampValue() + / 1000); // getTimestampValue returns time in microseconds, and TimeStamp expects it + // in millis } else { - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return null; } - Object timeStampVal = curRow.get(fieldName); - return timeStampVal == null - ? null - : new Timestamp((Long) timeStampVal / 1000); // Timestamp is represented as a Long + wasNull = false; + return new Timestamp((Long) curVal / 1000); // Timestamp is represented as a Long } } @@ -491,12 +563,15 @@ public Timestamp getTimestamp(int columnIndex) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : new Timestamp( - fieldValue.getTimestampValue() - / 1000); // getTimestampValue returns time in microseconds, and TimeStamp - // expects it in millis + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return new Timestamp( + fieldValue.getTimestampValue() + / 1000); // getTimestampValue returns time in microseconds, and TimeStamp expects it + // in millis } else { // Data received from Read API (Arrow) return getTimestamp(schemaFieldList.get(columnIndex).getName()); } @@ -511,61 +586,62 @@ public Time getTime(String fieldName) throws SQLException { return null; // if the value is SQL NULL, the value returned is null } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; return getTimeFromFieldVal(fieldValue); } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; + return null; } - Object timeStampObj = curRow.get(fieldName); - return timeStampObj == null - ? null - : new Time( - ((Long) timeStampObj) - / 1000); // Time.toString() will return 12:11:35 in GMT as 17:41:35 in - // (GMT+5:30). This can be offset using getTimeZoneOffset + wasNull = false; + return new Time( + ((Long) curVal) + / 1000); // Time.toString() will return 12:11:35 in GMT as 17:41:35 in (GMT+5:30). + // This can be offset using getTimeZoneOffset } } - private int getTimeZoneOffset() { - TimeZone timeZone = TimeZone.getTimeZone(ZoneId.systemDefault()); - return timeZone.getOffset(new java.util.Date().getTime()); // offset in seconds - } - @Override public Time getTime(int columnIndex) throws SQLException { if (cursor == null) { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; return getTimeFromFieldVal(fieldValue); } else { // Data received from Read API (Arrow) return getTime(schemaFieldList.get(columnIndex).getName()); } } + // Expects fieldValue.getValue() != null. private Time getTimeFromFieldVal(FieldValue fieldValue) throws SQLException { - if (fieldValue.getValue() != null) { - // Time ranges from 00:00:00 to 23:59:59.99999. in BigQuery. Parsing it to java.sql.Time - String strTime = fieldValue.getStringValue(); - String[] timeSplt = strTime.split(":"); - if (timeSplt.length != 3) { - throw new SQLException("Can not parse the value " + strTime + " to java.sql.Time"); - } - int hr = Integer.parseInt(timeSplt[0]); - int min = Integer.parseInt(timeSplt[1]); - int sec = 0, nanoSec = 0; - if (timeSplt[2].contains(".")) { - String[] secSplt = timeSplt[2].split("\\."); - sec = Integer.parseInt(secSplt[0]); - nanoSec = Integer.parseInt(secSplt[1]); - } else { - sec = Integer.parseInt(timeSplt[2]); - } - return Time.valueOf(LocalTime.of(hr, min, sec, nanoSec)); + // Time ranges from 00:00:00 to 23:59:59.99999. in BigQuery. Parsing it to java.sql.Time + String strTime = fieldValue.getStringValue(); + String[] timeSplt = strTime.split(":"); + if (timeSplt.length != 3) { + throw new SQLException("Can not parse the value " + strTime + " to java.sql.Time"); + } + int hr = Integer.parseInt(timeSplt[0]); + int min = Integer.parseInt(timeSplt[1]); + int sec, nanoSec = 0; + if (timeSplt[2].contains(".")) { + String[] secSplt = timeSplt[2].split("\\."); + sec = Integer.parseInt(secSplt[0]); + nanoSec = Integer.parseInt(secSplt[1]); } else { - return null; + sec = Integer.parseInt(timeSplt[2]); } + return Time.valueOf(LocalTime.of(hr, min, sec, nanoSec)); } @Override @@ -577,26 +653,26 @@ public Date getDate(String fieldName) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : Date.valueOf(fieldValue.getStringValue()); - } else { // Data received from Read API (Arrow) - Row curRow = (Row) cursor; - if (!curRow.hasField(fieldName)) { - throw new SQLException(String.format("Field %s not found", fieldName)); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; } - Object dateObj = curRow.get(fieldName); - if (dateObj == null) { + wasNull = false; + return Date.valueOf(fieldValue.getStringValue()); + } else { // Data received from Read API (Arrow) + Object curVal = getCurrentValueForReadApiData(fieldName); + if (curVal == null) { + wasNull = true; return null; - } else { - Integer dateInt = (Integer) dateObj; - long dateInMillis = - TimeUnit.DAYS.toMillis( - Long.valueOf( - dateInt)); // For example int 18993 represents 2022-01-01, converting time to - // milli seconds - return new Date(dateInMillis); } + wasNull = false; + Integer dateInt = (Integer) curVal; + long dateInMillis = + TimeUnit.DAYS.toMillis( + Long.valueOf( + dateInt)); // For example int 18993 represents 2022-01-01, converting time to + // milli seconds + return new Date(dateInMillis); } } @@ -606,13 +682,26 @@ public Date getDate(int columnIndex) throws SQLException { throw new BigQuerySQLException(NULL_CURSOR_MSG); } else if (cursor instanceof FieldValueList) { FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); - return (fieldValue == null || fieldValue.getValue() == null) - ? null - : Date.valueOf(fieldValue.getStringValue()); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + return Date.valueOf(fieldValue.getStringValue()); } else { // Data received from Read API (Arrow) return getDate(schemaFieldList.get(columnIndex).getName()); } } + + /** + * Returns whether the last column read had a value of SQL NULL. Note that you must first call + * one of the getter methods on a column to try to read its value and then call the method + * wasNull to see if the value read was SQL NULL. * + */ + @Override + public boolean wasNull() { + return wasNull; + } } @Override diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java new file mode 100644 index 0000000000..6431673e34 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.ConnectionImpl.EndOfFieldValueList; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.common.collect.ImmutableList; +import com.google.common.io.BaseEncoding; +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalTime; +import java.util.AbstractList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingDeque; +import org.apache.arrow.vector.util.Text; +import org.junit.Test; + +public class BigQueryResultImplTest { + + private static final Schema SCHEMA = + Schema.of( + Field.newBuilder("boolean", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("long", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("double", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("string", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("bytes", StandardSQLTypeName.BYTES).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("timestamp", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .build(), + Field.newBuilder("time", StandardSQLTypeName.TIME).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("date", StandardSQLTypeName.DATE).setMode(Field.Mode.NULLABLE).build()); + + private static final FieldList FIELD_LIST_SCHEMA = + FieldList.of( + Field.of("boolean", LegacySQLTypeName.BOOLEAN), + Field.of("long", LegacySQLTypeName.INTEGER), + Field.of("double", LegacySQLTypeName.FLOAT), + Field.of("string", LegacySQLTypeName.STRING), + Field.of("bytes", LegacySQLTypeName.BYTES), + Field.of("timestamp", LegacySQLTypeName.TIMESTAMP), + Field.of("time", LegacySQLTypeName.TIME), + Field.of("date", LegacySQLTypeName.DATE)); + + private static final byte[] BYTES = {0xD, 0xE, 0xA, 0xD}; + private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); + private static final Timestamp EXPECTED_TIMESTAMP = Timestamp.valueOf("2025-01-02 03:04:05.0"); + private static final String TIME = "20:21:22"; + private static final Time EXPECTED_TIME = Time.valueOf(LocalTime.of(20, 21, 22)); + private static final String DATE = "2020-01-21"; + private static final int DATE_INT = 0; + private static final Date EXPECTED_DATE = java.sql.Date.valueOf(DATE); + private static final int BUFFER_SIZE = 10; + + @Test + public void testResultSetFieldValueList() throws InterruptedException, SQLException { + BlockingQueue> buffer = new LinkedBlockingDeque<>(BUFFER_SIZE); + FieldValueList fieldValues = + FieldValueList.of( + ImmutableList.of( + FieldValue.of(Attribute.PRIMITIVE, "false"), + FieldValue.of(Attribute.PRIMITIVE, "1"), + FieldValue.of(Attribute.PRIMITIVE, "1.5"), + FieldValue.of(Attribute.PRIMITIVE, "string_value"), + FieldValue.of(Attribute.PRIMITIVE, BYTES_BASE64), + FieldValue.of( + Attribute.PRIMITIVE, + Long.toString(EXPECTED_TIMESTAMP.getTime() / 1000), + false), // getTime is in milliseconds. + FieldValue.of(Attribute.PRIMITIVE, TIME), + FieldValue.of(Attribute.PRIMITIVE, DATE)), + FIELD_LIST_SCHEMA); + buffer.put(fieldValues); + + FieldValueList nullValues = + FieldValueList.of( + ImmutableList.of( + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.PRIMITIVE, null)), + FIELD_LIST_SCHEMA); + buffer.put(nullValues); + + buffer.put(new EndOfFieldValueList()); // End of buffer marker. + + BigQueryResultImpl> bigQueryResult = + new BigQueryResultImpl<>(SCHEMA, 1, buffer, null); + ResultSet resultSet = bigQueryResult.getResultSet(); + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getObject("string")).isEqualTo("string_value"); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getString("string")).isEqualTo("string_value"); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getInt("long")).isEqualTo(1); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getLong("long")).isEqualTo(1); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getDouble("double")).isEqualTo(1.5); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBigDecimal("double")).isEqualTo(BigDecimal.valueOf(1.5)); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBoolean("boolean")).isFalse(); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBytes("bytes")).isEqualTo(BYTES); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getTimestamp("timestamp")).isEqualTo(EXPECTED_TIMESTAMP); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getTime("time").getTime()).isEqualTo(EXPECTED_TIME.getTime()); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getDate("date").getTime()).isEqualTo(EXPECTED_DATE.getTime()); + assertThat(resultSet.wasNull()).isFalse(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getObject("string")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getString("string")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getInt("long")).isEqualTo(0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getLong("long")).isEqualTo(0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getDouble("double")).isEqualTo(0.0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBigDecimal("double")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBoolean("boolean")).isFalse(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBytes("bytes")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getTimestamp("timestamp")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getTime("time")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getDate("date")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + + assertThat(resultSet.next()).isFalse(); + } + + @Test + public void testResultSetReadApi() throws InterruptedException, SQLException { + BlockingQueue buffer = new LinkedBlockingDeque<>(BUFFER_SIZE); + + Map rowValues = new HashMap<>(); + rowValues.put("boolean", false); + rowValues.put("long", 1L); + rowValues.put("double", 1.5); + rowValues.put("string", new Text("string_value")); + rowValues.put("bytes", BYTES); + rowValues.put("timestamp", EXPECTED_TIMESTAMP.getTime() * 1000); + rowValues.put("time", EXPECTED_TIME.getTime() * 1000); + rowValues.put("date", DATE_INT); + buffer.put(new BigQueryResultImpl.Row(rowValues)); + + Map nullValues = new HashMap<>(); + nullValues.put("boolean", null); + nullValues.put("long", null); + nullValues.put("double", null); + nullValues.put("string", null); + nullValues.put("bytes", null); + nullValues.put("timestamp", null); + nullValues.put("time", null); + nullValues.put("date", null); + buffer.put(new BigQueryResultImpl.Row(nullValues)); + + buffer.put(new BigQueryResultImpl.Row(null, true)); // End of buffer marker. + + BigQueryResultImpl bigQueryResult = + new BigQueryResultImpl<>(SCHEMA, 1, buffer, null); + ResultSet resultSet = bigQueryResult.getResultSet(); + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getObject("string")).isEqualTo(new Text("string_value")); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getString("string")).isEqualTo("string_value"); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getInt("long")).isEqualTo(1); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getLong("long")).isEqualTo(1); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getDouble("double")).isEqualTo(1.5); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBigDecimal("double")).isEqualTo(BigDecimal.valueOf(1.5)); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBoolean("boolean")).isFalse(); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getBytes("bytes")).isEqualTo(BYTES); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getTimestamp("timestamp")).isEqualTo(EXPECTED_TIMESTAMP); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getTime("time").getTime()).isEqualTo(EXPECTED_TIME.getTime()); + assertThat(resultSet.wasNull()).isFalse(); + // Do not check date value as Date object do not have timezone but its toString() applies the + // JVM default timezone which causes flakes in non-UTC zones. + assertThat(resultSet.getDate("date")).isNotNull(); + assertThat(resultSet.wasNull()).isFalse(); + + assertThat(resultSet.next()).isTrue(); + assertThat(resultSet.getObject("string")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getString("string")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getInt("long")).isEqualTo(0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getLong("long")).isEqualTo(0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getDouble("double")).isEqualTo(0.0); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBigDecimal("double")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBoolean("boolean")).isFalse(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getBytes("bytes")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getTimestamp("timestamp")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getTime("time")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getDate("date")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + + assertThat(resultSet.next()).isFalse(); + } +} From c91d2a6c6aae5904eab6fc4fe43dc1c68ca879b7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:52:45 -0500 Subject: [PATCH 1986/2268] chore(main): release 2.47.1-SNAPSHOT (#3657) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 602d048577..cf8e308002 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3a5c6f3e1d..7980f17e49 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.47.0 + 2.47.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 13651acacb..10e5fbb27d 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.47.0 + 2.47.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.47.0 + 2.47.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 5b1d3a0d76..8b5acdfa0e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.47.0 + 2.47.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 600522b26f..8b26b3f5ad 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.47.0 + 2.47.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index d6010fec4a..8ab96d478e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.47.0:2.47.0 \ No newline at end of file +google-cloud-bigquery:2.47.0:2.47.1-SNAPSHOT \ No newline at end of file From 0fc7179d906c2d65ef5d92a644aea9192a4e3cff Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 3 Feb 2025 19:50:16 +0100 Subject: [PATCH 1987/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.51.2 (#3665) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b5f6b66f5b..f92ed0e2c8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.51.1 + 2.51.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8b26b3f5ad..42c8707f4e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.51.1 + 2.51.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 69ea0c9e16..275dc8a8e7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.51.1 + 2.51.2 test From 21910c7c4450ab4a1c85434745a7059220c3ba8d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 4 Feb 2025 15:41:23 +0100 Subject: [PATCH 1988/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.48.1 (#3666) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b5acdfa0e..8592d12ce0 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.48.0 + 2.48.1 test From 0b92af6eba4a633bb514089c24b7dd19cf286789 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 10 Feb 2025 16:21:30 +0100 Subject: [PATCH 1989/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250128-2.0.0 (#3667) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8592d12ce0..cf7498430d 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250112-2.0.0 + v2-rev20250128-2.0.0 From 4d9e0ff30269127f47484910e71fa7a21a735492 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Feb 2025 18:29:05 +0100 Subject: [PATCH 1990/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.43.0 (#3669) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 813d09f1ba..2df44688d8 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.42.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.43.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index ce53947530..b9d88e7769 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.42.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.43.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index ffdac23782..12e3b21adb 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.42.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.43.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 6331bd5861..5b6a943cde 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.42.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.43.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index f08c4be3e0..f78bafd26e 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.42.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.43.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7980f17e49..c81b3c8a87 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.42.0 + 3.43.0 diff --git a/pom.xml b/pom.xml index cf7498430d..dbf083b4cf 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.42.0 + 3.43.0 From 009b9a2b3940ab66220e68ddd565710b8552cc45 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:41:49 -0500 Subject: [PATCH 1991/2268] docs: update CONTRIBUTING.md for users without branch permissions (#3670) --- CONTRIBUTING.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b65dd279c9..0599033d79 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,9 +18,13 @@ again. ## Code reviews All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult -[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more -information on using pull requests. +use GitHub pull requests for this purpose. Consult the +[GitHub Help: about pull requests](https://help.github.com/articles/about-pull-requests/) +article for more information on using pull requests. If you do not have +permission to create a branch, then fork the repository and submit a pull +request from the forked repository. Consult +[Github Help: about forks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#about-forks) +article for more information. ## Community Guidelines From 367dd4da0c1f4c824a2f4e1c4151f018d202e41d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 12 Feb 2025 23:44:44 +0100 Subject: [PATCH 1992/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.48.2 (#3674) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dbf083b4cf..10600c05fd 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.48.1 + 2.48.2 test From abbdde0e7797712d98183ea2d5390671f92d5407 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Feb 2025 01:32:07 +0100 Subject: [PATCH 1993/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.11.3 (#3675) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 10600c05fd..2b73fe2a72 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.11.2 + 3.11.3 pom import From 759cb0a6706e91043c39b9dfc71fbaf7b7ffbc20 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:23:44 -0500 Subject: [PATCH 1994/2268] chore(main): release 2.48.0 (#3663) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index addb3d7233..c91011f887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.48.0](https://github.com/googleapis/java-bigquery/compare/v2.47.0...v2.48.0) (2025-02-13) + + +### Features + +* Implement wasNull for BigQueryResultSet ([#3650](https://github.com/googleapis/java-bigquery/issues/3650)) ([c7ef94b](https://github.com/googleapis/java-bigquery/commit/c7ef94be115cd572df589385f9be801033d72d6d)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.59.0 ([#3660](https://github.com/googleapis/java-bigquery/issues/3660)) ([3a6228b](https://github.com/googleapis/java-bigquery/commit/3a6228b4adc638759d3b2725c612e97e1a3b9cec)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250128-2.0.0 ([#3667](https://github.com/googleapis/java-bigquery/issues/3667)) ([0b92af6](https://github.com/googleapis/java-bigquery/commit/0b92af6eba4a633bb514089c24b7dd19cf286789)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.63.0 ([#3661](https://github.com/googleapis/java-bigquery/issues/3661)) ([9bc8c01](https://github.com/googleapis/java-bigquery/commit/9bc8c0115dc16fb950567cd85cc7dfaa9df50d7d)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.43.0 ([#3669](https://github.com/googleapis/java-bigquery/issues/3669)) ([4d9e0ff](https://github.com/googleapis/java-bigquery/commit/4d9e0ff30269127f47484910e71fa7a21a735492)) + + +### Documentation + +* Update CONTRIBUTING.md for users without branch permissions ([#3670](https://github.com/googleapis/java-bigquery/issues/3670)) ([009b9a2](https://github.com/googleapis/java-bigquery/commit/009b9a2b3940ab66220e68ddd565710b8552cc45)) + ## [2.47.0](https://github.com/googleapis/java-bigquery/compare/v2.46.0...v2.47.0) (2025-01-29) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cf8e308002..120d16cedf 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index c81b3c8a87..e1a74b5e99 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.47.1-SNAPSHOT + 2.48.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 10e5fbb27d..bec0e10d35 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.47.1-SNAPSHOT + 2.48.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.47.1-SNAPSHOT + 2.48.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2b73fe2a72..12b44c3595 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.47.1-SNAPSHOT + 2.48.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 42c8707f4e..f274559a2b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.47.1-SNAPSHOT + 2.48.0 diff --git a/versions.txt b/versions.txt index 8ab96d478e..a184e92b96 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.47.0:2.47.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.48.0:2.48.0 \ No newline at end of file From aa1c36ea156b80babfe503739532f43ce6a72d44 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:45:44 -0500 Subject: [PATCH 1995/2268] chore(main): release 2.48.1-SNAPSHOT (#3677) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 120d16cedf..b0d222a13d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.48.0 + 2.48.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e1a74b5e99..aa8cd84dff 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.48.0 + 2.48.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.48.0 + 2.48.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index bec0e10d35..2a937587b9 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.48.0 + 2.48.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.48.0 + 2.48.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 12b44c3595..786bb2675c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.48.0 + 2.48.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.48.0 + 2.48.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f274559a2b..8714e964ae 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.48.0 + 2.48.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index a184e92b96..869ae9f8f7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.48.0:2.48.0 \ No newline at end of file +google-cloud-bigquery:2.48.0:2.48.1-SNAPSHOT \ No newline at end of file From d9d574b22082d1755e2919e8556cb5ee24b92bd8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 13 Feb 2025 17:16:27 +0100 Subject: [PATCH 1996/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.48.0 (#3678) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f92ed0e2c8..c03f3dae7d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.47.0 + 2.48.0 From 4bfb2a2d45ec7ec36526d51448c531c45eaa128c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Feb 2025 16:40:41 +0100 Subject: [PATCH 1997/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.60.0 (#3679) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 786bb2675c..e5284ff4e3 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.59.0 + 2.60.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c03f3dae7d..c5ee059ea7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.59.0 + 2.60.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8714e964ae..b646069813 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.59.0 + 2.60.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 275dc8a8e7..18b34d3ab4 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.59.0 + 2.60.0 test From 6d9a40d55a6bbcbff7df39723d33f0af2b24f66e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Feb 2025 16:41:34 +0100 Subject: [PATCH 1998/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.60.0 (#3680) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5284ff4e3..405060a780 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.59.0 + 2.60.0 test From 9e4e26116226d17cc42ae030eed284bd6674b74b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Feb 2025 16:42:01 +0100 Subject: [PATCH 1999/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.64.0 (#3681) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 405060a780..0186bfff79 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.63.0 + 1.64.0 pom import From 98bdc1b4cc5535bf65edaeb9b214d376f36d68c7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Feb 2025 16:01:35 +0100 Subject: [PATCH 2000/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.52.0 (#3684) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c5ee059ea7..6fe540a724 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.51.2 + 2.52.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b646069813..f7a9d91490 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.51.2 + 2.52.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 18b34d3ab4..a0593a19e8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.51.2 + 2.52.0 test From 53bd7af47783674a3accbadb1172edbcf628ab2b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Feb 2025 16:05:35 +0100 Subject: [PATCH 2001/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.38.0 (#3685) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6fe540a724..59224e0544 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.37.0 + 1.38.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f7a9d91490..57a1c0b268 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.37.0 + 1.38.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index a0593a19e8..d88d64694a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.37.0 + 1.38.0 com.google.oauth-client From d71b2a34a728fb6ee1c88cdc895b87959e230b7a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 18 Feb 2025 16:06:32 +0100 Subject: [PATCH 2002/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.38.0 (#3686) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 59224e0544..acb6282615 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.37.0 + 1.38.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 57a1c0b268..73c3228749 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.37.0 + 1.38.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d88d64694a..fd724683f3 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.37.0 + 1.38.0 From e3beb6ffe433db8ad4087d0f27a8f0d23e7c9322 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Feb 2025 16:16:31 +0100 Subject: [PATCH 2003/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250216-2.0.0 (#3688) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0186bfff79..7ea8199016 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250128-2.0.0 + v2-rev20250216-2.0.0 From 95ee27f6da92b205cf8529dab02b8418a153522e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Feb 2025 16:16:42 +0100 Subject: [PATCH 2004/2268] build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.14.0 (#3689) --- benchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index b0d222a13d..a49d95a561 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.13.0 + 3.14.0 From cdb61febcb1a64f6ddd3c0e3c29fa7995f1d3fa5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Feb 2025 16:08:15 +0100 Subject: [PATCH 2005/2268] deps: update ossf/scorecard-action action to v2.4.1 (#3690) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b04c8ba875..ecdc2758de 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 with: results_file: results.sarif results_format: sarif From 9c0edea7c00b3ffbe6b6a404e4161f768acb34f2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 24 Feb 2025 16:54:38 +0100 Subject: [PATCH 2006/2268] deps: update actions/upload-artifact action to v4.6.1 (#3691) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index ecdc2758de..1831a7d089 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 with: name: SARIF file path: results.sarif From f69fbd371f18da6ddc43d4f32f532e684026fe16 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 26 Feb 2025 15:21:11 +0100 Subject: [PATCH 2007/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.44.0 (#3694) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 2df44688d8..a0be30d589 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.43.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.44.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index b9d88e7769..401a49543f 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.43.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.44.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 12e3b21adb..46fd893e67 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.43.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.44.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 5b6a943cde..6eb22ef1ab 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.43.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.44.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index f78bafd26e..39151469c7 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.43.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.44.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index aa8cd84dff..3274996be7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.43.0 + 3.44.0 diff --git a/pom.xml b/pom.xml index 7ea8199016..3ad4d9f332 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.43.0 + 3.44.0 From 082d2b23b620d58b6688254cf1abd55c83ea052c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 26 Feb 2025 18:36:36 +0100 Subject: [PATCH 2008/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.11.4 (#3695) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ad4d9f332..5df9d0064b 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.11.3 + 3.11.4 pom import From 4be11f9c9221c805962d861d85a984565554df2d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 26 Feb 2025 19:18:27 +0100 Subject: [PATCH 2009/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.49.0 (#3696) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5df9d0064b..f9a0f3fe14 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.48.2 + 2.49.0 test From c36484bb049cdcba73a0a751b9155b914ec320fe Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:32:27 -0500 Subject: [PATCH 2010/2268] chore(main): release 2.48.1 (#3682) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c91011f887..7f7a8e397f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.48.1](https://github.com/googleapis/java-bigquery/compare/v2.48.0...v2.48.1) (2025-02-26) + + +### Dependencies + +* Update actions/upload-artifact action to v4.6.1 ([#3691](https://github.com/googleapis/java-bigquery/issues/3691)) ([9c0edea](https://github.com/googleapis/java-bigquery/commit/9c0edea7c00b3ffbe6b6a404e4161f768acb34f2)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.60.0 ([#3680](https://github.com/googleapis/java-bigquery/issues/3680)) ([6d9a40d](https://github.com/googleapis/java-bigquery/commit/6d9a40d55a6bbcbff7df39723d33f0af2b24f66e)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250216-2.0.0 ([#3688](https://github.com/googleapis/java-bigquery/issues/3688)) ([e3beb6f](https://github.com/googleapis/java-bigquery/commit/e3beb6ffe433db8ad4087d0f27a8f0d23e7c9322)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.64.0 ([#3681](https://github.com/googleapis/java-bigquery/issues/3681)) ([9e4e261](https://github.com/googleapis/java-bigquery/commit/9e4e26116226d17cc42ae030eed284bd6674b74b)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.44.0 ([#3694](https://github.com/googleapis/java-bigquery/issues/3694)) ([f69fbd3](https://github.com/googleapis/java-bigquery/commit/f69fbd371f18da6ddc43d4f32f532e684026fe16)) +* Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.38.0 ([#3685](https://github.com/googleapis/java-bigquery/issues/3685)) ([53bd7af](https://github.com/googleapis/java-bigquery/commit/53bd7af47783674a3accbadb1172edbcf628ab2b)) +* Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.38.0 ([#3686](https://github.com/googleapis/java-bigquery/issues/3686)) ([d71b2a3](https://github.com/googleapis/java-bigquery/commit/d71b2a34a728fb6ee1c88cdc895b87959e230b7a)) +* Update ossf/scorecard-action action to v2.4.1 ([#3690](https://github.com/googleapis/java-bigquery/issues/3690)) ([cdb61fe](https://github.com/googleapis/java-bigquery/commit/cdb61febcb1a64f6ddd3c0e3c29fa7995f1d3fa5)) + ## [2.48.0](https://github.com/googleapis/java-bigquery/compare/v2.47.0...v2.48.0) (2025-02-13) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a49d95a561..5e4aa301be 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3274996be7..a8bface754 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.48.1-SNAPSHOT + 2.48.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2a937587b9..8b98af7ced 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.48.1-SNAPSHOT + 2.48.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.48.1-SNAPSHOT + 2.48.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index f9a0f3fe14..32533bbab1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.48.1-SNAPSHOT + 2.48.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 73c3228749..42f9d95873 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1-SNAPSHOT + 2.48.1 diff --git a/versions.txt b/versions.txt index 869ae9f8f7..86c1675242 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.48.0:2.48.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.48.1:2.48.1 \ No newline at end of file From 2f93b3b0d689f4046740d95c02f5d285ee775705 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Feb 2025 19:37:32 +0100 Subject: [PATCH 2011/2268] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.9.0 (#3698) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32533bbab1..9e8698bfe9 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.8.0 + 3.9.0 From 1f69002add97aca1ec3da10331eb9016267dc649 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Feb 2025 19:37:55 +0100 Subject: [PATCH 2012/2268] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.4 (#3699) --- benchmark/pom.xml | 2 +- samples/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5e4aa301be..dbad6ca31e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -84,7 +84,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.3 + 3.1.4 true diff --git a/samples/pom.xml b/samples/pom.xml index d493a5953d..c6ac76b1dd 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.3 + 3.1.4 true diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index fd724683f3..df62bbb042 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.3 + 3.1.4 true From 0af6ad6c556fc8831ee70bc224f30c339607eca2 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Feb 2025 19:38:22 +0100 Subject: [PATCH 2013/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.48.1 (#3700) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index acb6282615..fe8a6e9aca 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.48.0 + 2.48.1 From d15d30dcf5cbaefba3da8f7a6c91fe7090724e60 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:36:21 -0500 Subject: [PATCH 2014/2268] chore(main): release 2.48.2-SNAPSHOT (#3697) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index dbad6ca31e..9664c88f35 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index a8bface754..ea94894d05 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.48.1 + 2.48.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 8b98af7ced..becf16cdeb 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.48.1 + 2.48.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.48.1 + 2.48.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9e8698bfe9..ce734adaa1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.48.1 + 2.48.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 42f9d95873..cd3b6173a4 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1 + 2.48.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 86c1675242..f9e66ad7f8 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.48.1:2.48.1 \ No newline at end of file +google-cloud-bigquery:2.48.1:2.48.2-SNAPSHOT \ No newline at end of file From 56f3074f3cfcd79bc385913e37c5868270fdbb27 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Feb 2025 17:24:53 +0100 Subject: [PATCH 2015/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.61.0 (#3702) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ce734adaa1..18e2af0cd4 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.60.0 + 2.61.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fe8a6e9aca..0002dca925 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.60.0 + 2.61.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cd3b6173a4..53260dc752 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.60.0 + 2.61.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index df62bbb042..c70e3b76b1 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.60.0 + 2.61.0 test From 53b68b13a505aa5d38e56032eaeb8c95bf3e9078 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Feb 2025 17:25:04 +0100 Subject: [PATCH 2016/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.65.0 (#3704) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 18e2af0cd4..a08e2ec7ec 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.64.0 + 1.65.0 pom import From b46a6ccc959f8defb145279ea18ff2e4f1bac58f Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Fri, 28 Feb 2025 17:52:47 +0000 Subject: [PATCH 2017/2268] feat: next release from main branch is 2.49.0 (#3706) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index 7f8c0fbb77..48231f76e4 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -27,6 +27,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.40.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.48.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index be7c5c0fe1..c3a3263dd7 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -117,6 +117,21 @@ branchProtectionRules: - 'Kokoro - Test: Integration' - cla/google - javadoc + - pattern: 2.48.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - javadoc + - unmanaged_dependency_check permissionRules: - team: api-bigquery permission: admin From cc84e2b27578d0e608028970c626e2d16305d8be Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 28 Feb 2025 20:32:28 +0100 Subject: [PATCH 2018/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.53.0 (#3707) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0002dca925..857c613937 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.52.0 + 2.53.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 53260dc752..ffcd462b23 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.52.0 + 2.53.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index c70e3b76b1..6a5539e6f7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.52.0 + 2.53.0 test From 53b07b0e77f6ef57c8518df2b106edace679f79a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 3 Mar 2025 15:17:50 +0100 Subject: [PATCH 2019/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.61.0 (#3703) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a08e2ec7ec..a9db710d72 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.60.0 + 2.61.0 test From 252e3b9e530132a1934a65c868ad12906ca30d7e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 4 Mar 2025 15:50:54 +0100 Subject: [PATCH 2020/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.54.0 (#3709) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 857c613937..c7dd2fd398 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.53.0 + 2.54.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ffcd462b23..ad173ad6fc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.53.0 + 2.54.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 6a5539e6f7..d969a94ebb 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.53.0 + 2.54.0 test From c0c6352b8d02145fe9513e3e23d316e045360d2d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 4 Mar 2025 15:51:13 +0100 Subject: [PATCH 2021/2268] deps: update dependency com.google.oauth-client:google-oauth-client-java6 to v1.39.0 (#3710) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c7dd2fd398..6f3e56104d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -52,7 +52,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.38.0 + 1.39.0 com.google.oauth-client diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ad173ad6fc..8f4b7f829a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -50,7 +50,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.38.0 + 1.39.0 com.google.oauth-client diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d969a94ebb..bdf93cb8d7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -66,7 +66,7 @@ com.google.oauth-client google-oauth-client-java6 - 1.38.0 + 1.39.0 com.google.oauth-client From 43b86e91a664dd9d3edaea7b31b46ac635fb22b0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 4 Mar 2025 16:18:31 +0100 Subject: [PATCH 2022/2268] deps: update dependency com.google.oauth-client:google-oauth-client-jetty to v1.39.0 (#3711) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6f3e56104d..03617ce82a 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -57,7 +57,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.38.0 + 1.39.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8f4b7f829a..133768b85e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -55,7 +55,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.38.0 + 1.39.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index bdf93cb8d7..2e0a3320d0 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -71,7 +71,7 @@ com.google.oauth-client google-oauth-client-jetty - 1.38.0 + 1.39.0 From e2a3f2c1a1406bf7bc9a035dce3acfde78f0eaa4 Mon Sep 17 00:00:00 2001 From: Liam <44932470+whuffman36@users.noreply.github.com> Date: Fri, 7 Mar 2025 14:26:19 -0800 Subject: [PATCH 2023/2268] feat(bigquery): Implement getArray in BigQueryResultImpl (#3693) * Implement getArray in BigQueryResultImpl * deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250216-2.0.0 (#3688) * build(deps): update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.14.0 (#3689) * deps: update ossf/scorecard-action action to v2.4.1 (#3690) * deps: update actions/upload-artifact action to v4.6.1 (#3691) * Remove public from BigQueryResultSet class def * Remove INTEGER_ARRAY_FIELD_LIST from IT test file * Add ReadApi IT test * Try old IT test values * Convert Time objects to strings for comparison * Fix Formatting --------- Co-authored-by: Mend Renovate --- .../cloud/bigquery/BigQueryResultImpl.java | 124 ++++++++++++++++++ .../bigquery/BigQueryResultImplTest.java | 47 ++++++- .../cloud/bigquery/it/ITBigQueryTest.java | 82 ++++++++++++ 3 files changed, 249 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java index e1e129eaea..b705e77c11 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryResultImpl.java @@ -16,14 +16,19 @@ package com.google.cloud.bigquery; +import com.google.cloud.bigquery.FieldValue.Attribute; import java.math.BigDecimal; import java.sql.Date; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.sql.Time; import java.sql.Timestamp; import java.time.LocalDateTime; import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; @@ -114,6 +119,77 @@ private class BigQueryResultSet extends AbstractJdbcResultSet { // curTup.isLast(). Ref: https://github.com/googleapis/java-bigquery/issues/2033 private boolean wasNull = false; + private class BigQueryArrayResult implements java.sql.Array { + List array; + + public BigQueryArrayResult(Object array) { + if (array instanceof Object[]) { + this.array = new ArrayList<>(Arrays.asList((Object[]) array)); + } else if (array instanceof FieldValueList) { + this.array = new ArrayList<>((FieldValueList) array); + } else { + this.array = (List) array; + } + } + + @Override + public String getBaseTypeName() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public int getBaseType() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Object getArray() throws SQLException { + return array; + } + + @Override + public Object getArray(java.util.Map> map) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Object getArray(long index, int count) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public Object getArray(long index, int count, java.util.Map> map) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public ResultSet getResultSet() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public ResultSet getResultSet(java.util.Map> map) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public ResultSet getResultSet(long index, int count) throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public ResultSet getResultSet(long index, int count, java.util.Map> map) + throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + + @Override + public void free() throws SQLException { + throw new SQLFeatureNotSupportedException(); + } + } + @Override /*Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation*/ public boolean next() throws SQLException { @@ -160,6 +236,54 @@ private Object getCurrentValueForReadApiData(String fieldName) throws SQLExcepti return curRow.get(fieldName); } + @Override + public java.sql.Array getArray(String fieldName) throws SQLException { + if (fieldName == null) { + throw new SQLException("fieldName can't be null"); + } + if (cursor == null) { + throw new BigQuerySQLException(NULL_CURSOR_MSG); + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(fieldName); + if ((fieldValue == null || fieldValue.getValue() == null)) { + wasNull = true; + return null; + } + wasNull = false; + if (fieldValue.getAttribute().equals(Attribute.REPEATED)) { + return new BigQueryArrayResult(fieldValue.getValue()); + } else { + wasNull = true; + return null; + } + } else { // Data received from Read API (Arrow) + Object currentVal = getCurrentValueForReadApiData(fieldName); + if (currentVal == null) { + wasNull = true; + return null; + } + wasNull = false; + return new BigQueryArrayResult(currentVal); + } + } + + @Override + public java.sql.Array getArray(int columnIndex) throws SQLException { + if (cursor == null) { + return null; + } else if (cursor instanceof FieldValueList) { + FieldValue fieldValue = ((FieldValueList) cursor).get(columnIndex); + if (fieldValue == null || fieldValue.getValue() == null) { + wasNull = true; + return null; + } + wasNull = false; + return new BigQueryArrayResult(fieldValue.getValue()); + } else { + return getArray(schemaFieldList.get(columnIndex).getName()); + } + } + @Override public Object getObject(String fieldName) throws SQLException { if (fieldName == null) { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java index 6431673e34..ca150eb1ba 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java @@ -30,6 +30,8 @@ import java.sql.Timestamp; import java.time.LocalTime; import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.concurrent.BlockingQueue; @@ -58,7 +60,13 @@ public class BigQueryResultImplTest { .setMode(Field.Mode.NULLABLE) .build(), Field.newBuilder("time", StandardSQLTypeName.TIME).setMode(Field.Mode.NULLABLE).build(), - Field.newBuilder("date", StandardSQLTypeName.DATE).setMode(Field.Mode.NULLABLE).build()); + Field.newBuilder("date", StandardSQLTypeName.DATE).setMode(Field.Mode.NULLABLE).build(), + Field.newBuilder("intArray", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REPEATED) + .build(), + Field.newBuilder("stringArray", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REPEATED) + .build()); private static final FieldList FIELD_LIST_SCHEMA = FieldList.of( @@ -69,7 +77,9 @@ public class BigQueryResultImplTest { Field.of("bytes", LegacySQLTypeName.BYTES), Field.of("timestamp", LegacySQLTypeName.TIMESTAMP), Field.of("time", LegacySQLTypeName.TIME), - Field.of("date", LegacySQLTypeName.DATE)); + Field.of("date", LegacySQLTypeName.DATE), + Field.of("intArray", LegacySQLTypeName.INTEGER), + Field.of("stringArray", LegacySQLTypeName.STRING)); private static final byte[] BYTES = {0xD, 0xE, 0xA, 0xD}; private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); @@ -79,6 +89,11 @@ public class BigQueryResultImplTest { private static final String DATE = "2020-01-21"; private static final int DATE_INT = 0; private static final Date EXPECTED_DATE = java.sql.Date.valueOf(DATE); + private static final ArrayList EXPECTED_INT_ARRAY = + new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4)); + private static final String[] STRING_ARRAY = {"str1", "str2", "str3"}; + private static final ArrayList EXPECTED_STRING_ARRAY = + new ArrayList<>(Arrays.asList(STRING_ARRAY)); private static final int BUFFER_SIZE = 10; @Test @@ -97,7 +112,9 @@ public void testResultSetFieldValueList() throws InterruptedException, SQLExcept Long.toString(EXPECTED_TIMESTAMP.getTime() / 1000), false), // getTime is in milliseconds. FieldValue.of(Attribute.PRIMITIVE, TIME), - FieldValue.of(Attribute.PRIMITIVE, DATE)), + FieldValue.of(Attribute.PRIMITIVE, DATE), + FieldValue.of(Attribute.REPEATED, EXPECTED_INT_ARRAY), + FieldValue.of(Attribute.REPEATED, STRING_ARRAY)), FIELD_LIST_SCHEMA); buffer.put(fieldValues); @@ -111,7 +128,9 @@ public void testResultSetFieldValueList() throws InterruptedException, SQLExcept FieldValue.of(Attribute.PRIMITIVE, null), FieldValue.of(Attribute.PRIMITIVE, null), FieldValue.of(Attribute.PRIMITIVE, null), - FieldValue.of(Attribute.PRIMITIVE, null)), + FieldValue.of(Attribute.PRIMITIVE, null), + FieldValue.of(Attribute.REPEATED, null), + FieldValue.of(Attribute.REPEATED, null)), FIELD_LIST_SCHEMA); buffer.put(nullValues); @@ -143,6 +162,10 @@ public void testResultSetFieldValueList() throws InterruptedException, SQLExcept assertThat(resultSet.wasNull()).isFalse(); assertThat(resultSet.getDate("date").getTime()).isEqualTo(EXPECTED_DATE.getTime()); assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getArray("intArray").getArray()).isEqualTo(EXPECTED_INT_ARRAY); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getArray("stringArray").getArray()).isEqualTo(EXPECTED_STRING_ARRAY); + assertThat(resultSet.wasNull()).isFalse(); assertThat(resultSet.next()).isTrue(); assertThat(resultSet.getObject("string")).isNull(); @@ -167,6 +190,10 @@ public void testResultSetFieldValueList() throws InterruptedException, SQLExcept assertThat(resultSet.wasNull()).isTrue(); assertThat(resultSet.getDate("date")).isNull(); assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getArray("intArray")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getArray("stringArray")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); assertThat(resultSet.next()).isFalse(); } @@ -184,6 +211,8 @@ public void testResultSetReadApi() throws InterruptedException, SQLException { rowValues.put("timestamp", EXPECTED_TIMESTAMP.getTime() * 1000); rowValues.put("time", EXPECTED_TIME.getTime() * 1000); rowValues.put("date", DATE_INT); + rowValues.put("intArray", EXPECTED_INT_ARRAY); + rowValues.put("stringArray", STRING_ARRAY); buffer.put(new BigQueryResultImpl.Row(rowValues)); Map nullValues = new HashMap<>(); @@ -195,6 +224,8 @@ public void testResultSetReadApi() throws InterruptedException, SQLException { nullValues.put("timestamp", null); nullValues.put("time", null); nullValues.put("date", null); + nullValues.put("intArray", null); + nullValues.put("stringArray", null); buffer.put(new BigQueryResultImpl.Row(nullValues)); buffer.put(new BigQueryResultImpl.Row(null, true)); // End of buffer marker. @@ -227,6 +258,10 @@ public void testResultSetReadApi() throws InterruptedException, SQLException { // JVM default timezone which causes flakes in non-UTC zones. assertThat(resultSet.getDate("date")).isNotNull(); assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getArray("intArray")).isNotNull(); + assertThat(resultSet.wasNull()).isFalse(); + assertThat(resultSet.getArray("stringArray")).isNotNull(); + assertThat(resultSet.wasNull()).isFalse(); assertThat(resultSet.next()).isTrue(); assertThat(resultSet.getObject("string")).isNull(); @@ -251,6 +286,10 @@ public void testResultSetReadApi() throws InterruptedException, SQLException { assertThat(resultSet.wasNull()).isTrue(); assertThat(resultSet.getDate("date")).isNull(); assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getArray("intArray")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); + assertThat(resultSet.getArray("stringArray")).isNull(); + assertThat(resultSet.wasNull()).isTrue(); assertThat(resultSet.next()).isFalse(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 0178ac10ad..a7bf5fa3e0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -3925,6 +3925,75 @@ public void testExecuteSelectSinglePageTableRow() throws SQLException { (com.google.cloud.bigquery.FieldValueList) rs.getObject("IntegerArrayField"); assertEquals(4, integerArrayFieldValue.size()); // Array has 4 elements assertEquals(3, (integerArrayFieldValue.get(2).getNumericValue()).intValue()); + List integerArrayFieldValueList = + (List) rs.getArray("IntegerArrayField").getArray(); + assertEquals(4, integerArrayFieldValueList.size()); + assertEquals(3, integerArrayFieldValueList.get(2).getNumericValue().intValue()); + + assertFalse(rs.next()); // no 3rd row in the table + } + + @Test + public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException { + String query = + "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " + + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + " order by TimestampField"; + ConnectionSettings connectionSettings = + ConnectionSettings.newBuilder() + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseReadAPI(true) + .setMinResultSize(1) + .setTotalToPageRowCountRatio(1) + .build(); + Connection connection = bigquery.createConnection(connectionSettings); + BigQueryResult bigQueryResult = connection.executeSelect(query); + assertTrue(bigQueryResult.getBigQueryResultStats().getQueryStatistics().getUseReadApi()); + ResultSet rs = bigQueryResult.getResultSet(); + Schema sc = bigQueryResult.getSchema(); + + assertEquals(BQ_RESULTSET_EXPECTED_SCHEMA, sc); // match the schema + assertEquals(2, bigQueryResult.getTotalRows()); // Expecting 2 rows + + assertTrue(rs.next()); // first row + // checking for the null or 0 column values + assertNull(rs.getString("StringField")); + assertTrue(rs.getDouble("BigNumericField") == 0.0d); + assertFalse(rs.getBoolean("BooleanField")); + assertNull(rs.getBytes("BytesField")); + assertEquals(rs.getInt("IntegerField"), 0); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getDate("DateField")); + assertTrue(rs.getDouble("FloatField") == 0.0d); + assertTrue(rs.getDouble("NumericField") == 0.0d); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getString("DateTimeField")); + assertNull(rs.getString("GeographyField")); + assertNull(rs.getBytes("BytesField_1")); + assertFalse(rs.getBoolean("BooleanField_1")); + + assertTrue(rs.next()); // second row + // second row is non null, comparing the values + assertEquals("StringValue1", rs.getString("StringField")); + assertTrue(rs.getDouble("BigNumericField") == 0.3333333333333333d); + assertFalse(rs.getBoolean("BooleanField")); + assertNotNull(rs.getBytes("BytesField")); + assertEquals(1, rs.getInt("IntegerField")); + assertEquals(1534680695123L, rs.getTimestamp("TimestampField").getTime()); + assertEquals(java.sql.Date.valueOf("2018-08-19"), rs.getDate("DateField")); + assertTrue(rs.getDouble("FloatField") == 10.1d); + assertTrue(rs.getDouble("NumericField") == 100.0d); + assertEquals( + Time.valueOf(LocalTime.of(12, 11, 35, 123456)).toString(), + rs.getTime("TimeField").toString()); + assertEquals("2018-08-19T12:11:35.123456", rs.getString("DateTimeField")); + assertEquals("POINT(-122.35022 47.649154)", rs.getString("GeographyField")); + assertNotNull(rs.getBytes("BytesField_1")); + assertTrue(rs.getBoolean("BooleanField_1")); + List integerArray = (List) rs.getArray("IntegerArrayField").getArray(); + assertEquals(4, integerArray.size()); + assertEquals(3, integerArray.get(2).intValue()); assertFalse(rs.next()); // no 3rd row in the table } @@ -4278,6 +4347,19 @@ public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { (integerArrayFieldValue.get(2).getNumericValue()).intValue(), (integerArrayFieldValueColInd.get(2).getNumericValue()).intValue()); } + + List integerArrayFieldValueList = + (List) rs.getArray("IntegerArrayField").getArray(); + List integerArrayFieldValueListColInd = + (List) rs.getArray(14).getArray(); + assertEquals( + integerArrayFieldValueList.size(), + integerArrayFieldValueListColInd.size()); // Array has 4 elements + if (integerArrayFieldValueList.size() == 4) { // as we are picking the third index + assertEquals( + (integerArrayFieldValueList.get(2).getNumericValue()).intValue(), + (integerArrayFieldValueListColInd.get(2).getNumericValue()).intValue()); + } } } From 251def5659d2648dff0833ba967a65435e11b643 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 11 Mar 2025 19:36:55 +0100 Subject: [PATCH 2024/2268] deps: update dependency node to v22 (#3713) --- .github/workflows/renovate_config_check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml index 36da117bc7..47b9e87c98 100644 --- a/.github/workflows/renovate_config_check.yaml +++ b/.github/workflows/renovate_config_check.yaml @@ -16,7 +16,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: '22' - name: Install Renovate and Config Validator run: | From 9eb555ff61bef42a3bdfe197da8423b7bf14f493 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 12 Mar 2025 15:23:07 -0400 Subject: [PATCH 2025/2268] docs: update error handling comment to be more precise in samples (#3712) * docs: update error handling comment to be more precise in samples * style * style * update comment * ignoredUnusedDeclaredDependencies * revert wrong commit/PR push ignoredUnusedDeclaredDependencies --- .../src/main/java/com/example/bigquery/SimpleApp.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java index 49975a9cc0..7b72bb0f94 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java +++ b/samples/snippets/src/main/java/com/example/bigquery/SimpleApp.java @@ -67,10 +67,12 @@ public static void simpleApp(String projectId) { // Check for errors if (queryJob == null) { throw new RuntimeException("Job no longer exists"); - } else if (queryJob.getStatus().getError() != null) { - // You can also look at queryJob.getStatus().getExecutionErrors() for all - // errors, not just the latest one. - throw new RuntimeException(queryJob.getStatus().getError().toString()); + } else if (queryJob.getStatus().getExecutionErrors() != null + && queryJob.getStatus().getExecutionErrors().size() > 0) { + // TODO(developer): Handle errors here. An error here do not necessarily mean that the job + // has completed or was unsuccessful. + // For more details: https://cloud.google.com/bigquery/troubleshooting-errors + throw new RuntimeException("An unhandled error has occurred"); } // [END bigquery_simple_app_query] From 11b580949b910b38732c1c8d64704c54c260214e Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 12 Mar 2025 15:47:00 -0400 Subject: [PATCH 2026/2268] =?UTF-8?q?deps:=20exclude=20io.netty:netty-comm?= =?UTF-8?q?on=20from=20org.apache.arrow:arrow-memor=E2=80=A6=20(#3715)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: exclude io.netty:netty-common from org.apache.arrow:arrow-memory-netty * use dep version override instead of exclusion * use dep version override instead of exclusion * ignoredUnusedDeclaredDependencies --- google-cloud-bigquery/pom.xml | 31 +++++++++++++++++++++++++++++++ pom.xml | 2 ++ 2 files changed, 33 insertions(+) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index becf16cdeb..9e77999e84 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,6 +15,7 @@ google-cloud-bigquery + 4.1.118.Final @@ -116,6 +117,36 @@ org.apache.arrow arrow-memory-netty + + + + io.netty + netty-common + + + io.netty + netty-buffer + + + runtime + + + + io.netty + netty-common + ${netty.version} + runtime + + + io.netty + netty-buffer + ${netty.version} runtime diff --git a/pom.xml b/pom.xml index a9db710d72..6acbe66227 100644 --- a/pom.xml +++ b/pom.xml @@ -168,6 +168,8 @@ maven-dependency-plugin + io.netty:netty-buffer + io.netty:netty-common org.apache.arrow:arrow-memory-netty From 83245b961950ca9a993694082e533834ee364417 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:18:17 -0400 Subject: [PATCH 2027/2268] fix: retry ExceptionHandler not retrying on IOException (#3668) * fix: retry ExceptionHandler not retrying on IOException due to exception translation * fix: retry ExceptionHandler not retrying on IOException due to exception translation * fix: retry ExceptionHandler not retrying on IOException due to exception translation * fix: retry ExceptionHandler not retrying on IOException due to exception translation * fix: retry ExceptionHandler not retrying on IOException due to exception translation * cast to HttpBigQueryRpc * cast to HttpBigQueryRpc * fix BigQueryRpc mocks in unit tests * fix clirr check and format * fix clirr * fix clirr * refactor HttpBigQueryRpc.write * refactor HttpBigQueryRpc.write * refactor ConnectionImpl HttpBigQueryRpc call * refactor ConnectionImpl HttpBigQueryRpc call * refactor create table * refactor create table * refactor BigQueryImpl * refactor ConnectionImpl * add missing unit test for BigQueryImpl deleteJob * add tests to validate retry on BIGQUERY_EXCEPTION_HANDLER * handle exception wrapping/unwrapping with new methods * update runWithRetries to use BigQuery ruWithRetries to correctly handle thrown IOExceptions * fix unit test * add unit tests for retry in TableDataWriteChannel * remove unnecessary null check * fix unit test where null is returned in mocks causing errors --- .../clirr-ignored-differences.xml | 7 + .../cloud/bigquery/BigQueryBaseService.java | 1 + .../google/cloud/bigquery/BigQueryImpl.java | 461 ++++--- .../cloud/bigquery/BigQueryOptions.java | 5 +- .../cloud/bigquery/BigQueryRetryHelper.java | 6 + .../google/cloud/bigquery/ConnectionImpl.java | 74 +- .../cloud/bigquery/TableDataWriteChannel.java | 31 +- .../bigquery/spi/v2/HttpBigQueryRpc.java | 1079 ++++++++++------- .../cloud/bigquery/BigQueryImplTest.java | 1027 ++++++++++------ .../cloud/bigquery/ConnectionImplTest.java | 89 +- .../bigquery/TableDataWriteChannelTest.java | 149 ++- 11 files changed, 1791 insertions(+), 1138 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 9ef680c667..37e349413f 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -14,6 +14,13 @@ com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer) getQueryResultsWithRowLimit is just used by ConnectionImpl at the moment so it should be fine to update the signature instead of writing an overloaded method + + 7006 + com/google/cloud/bigquery/BigQueryOptions* + *getBigQueryRpcV2(*) + com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc + getBigQueryRpcV2 is protected and is only used within the BigQuery package + 7013 com/google/cloud/bigquery/ExternalTableDefinition* diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java index aefb4329b6..9760158735 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java @@ -31,6 +31,7 @@ protected BigQueryBaseService(ServiceOptions options) { .abortOn(RuntimeException.class) .retryOn(java.net.ConnectException.class) // retry on Connection Exception .retryOn(java.net.UnknownHostException.class) // retry on UnknownHostException + .retryOn(java.net.SocketException.class) // retry on SocketException .addInterceptors(EXCEPTION_HANDLER_INTERCEPTOR) .build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 23cb001ac2..3db8c88f77 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -15,7 +15,6 @@ */ package com.google.cloud.bigquery; -import static com.google.cloud.RetryHelper.runWithRetries; import static com.google.cloud.bigquery.PolicyHelper.convertFromApiPolicy; import static com.google.cloud.bigquery.PolicyHelper.convertToApiPolicy; import static com.google.common.base.Preconditions.checkArgument; @@ -37,13 +36,13 @@ import com.google.cloud.PageImpl; import com.google.cloud.PageImpl.NextPageFetcher; import com.google.cloud.Policy; -import com.google.cloud.RetryHelper; -import com.google.cloud.RetryHelper.RetryHelperException; import com.google.cloud.RetryOption; import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.Strings; @@ -53,6 +52,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -242,7 +242,11 @@ public Page getNextPage() { } } - private final BigQueryRpc bigQueryRpc; + private final HttpBigQueryRpc bigQueryRpc; + + private static final BigQueryRetryConfig EMPTY_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder().build(); + private static final BigQueryRetryConfig DEFAULT_RETRY_CONFIG = BigQueryRetryConfig.newBuilder() .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) @@ -268,17 +272,18 @@ public Dataset create(DatasetInfo datasetInfo, DatasetOption... options) { try { return Dataset.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Dataset call() { - return bigQueryRpc.create(datasetPb, optionsMap); + public com.google.api.services.bigquery.model.Dataset call() throws IOException { + return bigQueryRpc.createSkipExceptionTranslation(datasetPb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -297,17 +302,18 @@ public Table create(TableInfo tableInfo, TableOption... options) { try { return Table.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Table call() { - return bigQueryRpc.create(tablePb, optionsMap); + public com.google.api.services.bigquery.model.Table call() throws IOException { + return bigQueryRpc.createSkipExceptionTranslation(tablePb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -335,17 +341,18 @@ public Routine create(RoutineInfo routineInfo, RoutineOption... options) { try { return Routine.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Routine call() { - return bigQueryRpc.create(routinePb, optionsMap); + public com.google.api.services.bigquery.model.Routine call() throws IOException { + return bigQueryRpc.createSkipExceptionTranslation(routinePb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -397,7 +404,7 @@ Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Job call() { + public com.google.api.services.bigquery.model.Job call() throws IOException { if (idRandom) { // re-generate a new random job with the same jobInfo when jobId is not // provided by the user @@ -406,11 +413,11 @@ public com.google.api.services.bigquery.model.Job call() { com.google.api.services.bigquery.model.Job newJobPb = recreatedJobInfo.setProjectId(getOptions().getProjectId()).toPb(); finalJobId[0] = recreatedJobInfo.getJobId(); - return bigQueryRpc.create(newJobPb, optionsMap); + return bigQueryRpc.createSkipExceptionTranslation(newJobPb, optionsMap); } else { com.google.api.services.bigquery.model.Job jobPb = jobInfo.setProjectId(getOptions().getProjectId()).toPb(); - return bigQueryRpc.create(jobPb, optionsMap); + return bigQueryRpc.createSkipExceptionTranslation(jobPb, optionsMap); } } }, @@ -423,7 +430,7 @@ public com.google.api.services.bigquery.model.Job call() { getBigQueryRetryConfig(optionsMap) != null ? getBigQueryRetryConfig(optionsMap) : DEFAULT_RETRY_CONFIG)); - } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } catch (BigQueryException e) { @@ -490,22 +497,26 @@ public Dataset getDataset(final DatasetId datasetId, DatasetOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.bigquery.model.Dataset answer = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Dataset call() { - return bigQueryRpc.getDataset( + public com.google.api.services.bigquery.model.Dataset call() throws IOException { + return bigQueryRpc.getDatasetSkipExceptionTranslation( completeDatasetId.getProject(), completeDatasetId.getDataset(), optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - if (getOptions().getThrowNotFound() && answer == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Dataset not found"); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + return Dataset.fromPb(this, answer); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + if (getOptions().getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Dataset not found"); + } + return null; } - return answer == null ? null : Dataset.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -526,18 +537,21 @@ private static Page listDatasets( final Map optionsMap) { try { Tuple> result = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable< Tuple>>() { @Override public Tuple> - call() { - return serviceOptions.getBigQueryRpcV2().listDatasets(projectId, optionsMap); + call() throws IOException { + return serviceOptions + .getBigQueryRpcV2() + .listDatasetsSkipExceptionTranslation(projectId, optionsMap); } }, serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); String cursor = result.x(); return new PageImpl<>( new DatasetPageFetcher(projectId, serviceOptions, cursor, optionsMap), @@ -550,7 +564,7 @@ public Dataset apply(com.google.api.services.bigquery.model.Dataset dataset) { return Dataset.fromPb(serviceOptions.getService(), dataset); } })); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -565,18 +579,22 @@ public boolean delete(DatasetId datasetId, DatasetDeleteOption... options) { final DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); final Map optionsMap = optionMap(options); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.deleteDataset( + public Boolean call() throws IOException { + return bigQueryRpc.deleteDatasetSkipExceptionTranslation( completeDatasetId.getProject(), completeDatasetId.getDataset(), optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + return false; + } throw BigQueryException.translateAndThrow(e); } } @@ -594,11 +612,11 @@ public boolean delete(TableId tableId) { ? getOptions().getProjectId() : tableId.getProject()); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.deleteTable( + public Boolean call() throws IOException { + return bigQueryRpc.deleteTableSkipExceptionTranslation( completeTableId.getProject(), completeTableId.getDataset(), completeTableId.getTable()); @@ -606,8 +624,12 @@ public Boolean call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + return false; + } throw BigQueryException.translateAndThrow(e); } } @@ -620,11 +642,11 @@ public boolean delete(ModelId modelId) { ? getOptions().getProjectId() : modelId.getProject()); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.deleteModel( + public Boolean call() throws IOException { + return bigQueryRpc.deleteModelSkipExceptionTranslation( completeModelId.getProject(), completeModelId.getDataset(), completeModelId.getModel()); @@ -632,8 +654,12 @@ public Boolean call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + return false; + } throw BigQueryException.translateAndThrow(e); } } @@ -646,11 +672,11 @@ public boolean delete(RoutineId routineId) { ? getOptions().getProjectId() : routineId.getProject()); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.deleteRoutine( + public Boolean call() throws IOException { + return bigQueryRpc.deleteRoutineSkipExceptionTranslation( completeRoutineId.getProject(), completeRoutineId.getDataset(), completeRoutineId.getRoutine()); @@ -658,8 +684,12 @@ public Boolean call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + return false; + } throw BigQueryException.translateAndThrow(e); } } @@ -672,18 +702,19 @@ public boolean delete(JobId jobId) { ? getOptions().getProjectId() : jobId.getProject()); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.deleteJob( + public Boolean call() throws IOException { + return bigQueryRpc.deleteJobSkipExceptionTranslation( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -696,17 +727,18 @@ public Dataset update(DatasetInfo datasetInfo, DatasetOption... options) { try { return Dataset.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Dataset call() { - return bigQueryRpc.patch(datasetPb, optionsMap); + public com.google.api.services.bigquery.model.Dataset call() throws IOException { + return bigQueryRpc.patchSkipExceptionTranslation(datasetPb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -725,17 +757,18 @@ public Table update(TableInfo tableInfo, TableOption... options) { try { return Table.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Table call() { - return bigQueryRpc.patch(tablePb, optionsMap); + public com.google.api.services.bigquery.model.Table call() throws IOException { + return bigQueryRpc.patchSkipExceptionTranslation(tablePb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -753,17 +786,18 @@ public Model update(ModelInfo modelInfo, ModelOption... options) { try { return Model.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Model call() { - return bigQueryRpc.patch(modelPb, optionsMap); + public com.google.api.services.bigquery.model.Model call() throws IOException { + return bigQueryRpc.patchSkipExceptionTranslation(modelPb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -781,17 +815,18 @@ public Routine update(RoutineInfo routineInfo, RoutineOption... options) { try { return Routine.fromPb( this, - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Routine call() { - return bigQueryRpc.update(routinePb, optionsMap); + public com.google.api.services.bigquery.model.Routine call() throws IOException { + return bigQueryRpc.updateSkipExceptionTranslation(routinePb, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -813,11 +848,11 @@ public Table getTable(TableId tableId, TableOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.bigquery.model.Table answer = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Table call() { - return bigQueryRpc.getTable( + public com.google.api.services.bigquery.model.Table call() throws IOException { + return bigQueryRpc.getTableSkipExceptionTranslation( completeTableId.getProject(), completeTableId.getDataset(), completeTableId.getTable(), @@ -826,12 +861,16 @@ public com.google.api.services.bigquery.model.Table call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - if (getOptions().getThrowNotFound() && answer == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Table not found"); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + return Table.fromPb(this, answer); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + if (getOptions().getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Table not found"); + } + return null; } - return answer == null ? null : Table.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -851,11 +890,11 @@ public Model getModel(ModelId modelId, ModelOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.bigquery.model.Model answer = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Model call() { - return bigQueryRpc.getModel( + public com.google.api.services.bigquery.model.Model call() throws IOException { + return bigQueryRpc.getModelSkipExceptionTranslation( completeModelId.getProject(), completeModelId.getDataset(), completeModelId.getModel(), @@ -864,12 +903,16 @@ public com.google.api.services.bigquery.model.Model call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - if (getOptions().getThrowNotFound() && answer == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Model not found"); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + return Model.fromPb(this, answer); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + if (getOptions().getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Model not found"); + } + return null; } - return answer == null ? null : Model.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -889,11 +932,11 @@ public Routine getRoutine(RoutineId routineId, RoutineOption... options) { final Map optionsMap = optionMap(options); try { com.google.api.services.bigquery.model.Routine answer = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Routine call() { - return bigQueryRpc.getRoutine( + public com.google.api.services.bigquery.model.Routine call() throws IOException { + return bigQueryRpc.getRoutineSkipExceptionTranslation( completeRoutineId.getProject(), completeRoutineId.getDataset(), completeRoutineId.getRoutine(), @@ -902,12 +945,16 @@ public com.google.api.services.bigquery.model.Routine call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - if (getOptions().getThrowNotFound() && answer == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Routine not found"); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + return Routine.fromPb(this, answer); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + if (getOptions().getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Routine not found"); + } + return null; } - return answer == null ? null : Routine.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -978,20 +1025,22 @@ private static Page

    listTables( final Map optionsMap) { try { Tuple> result = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable< Tuple>>() { @Override - public Tuple> - call() { + public Tuple> call() + throws IOException { return serviceOptions .getBigQueryRpcV2() - .listTables(datasetId.getProject(), datasetId.getDataset(), optionsMap); + .listTablesSkipExceptionTranslation( + datasetId.getProject(), datasetId.getDataset(), optionsMap); } }, serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); String cursor = result.x(); Iterable
    tables = Iterables.transform( @@ -1004,7 +1053,7 @@ public Table apply(com.google.api.services.bigquery.model.Table table) { }); return new PageImpl<>( new TablePageFetcher(datasetId, serviceOptions, cursor, optionsMap), cursor, tables); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1015,20 +1064,22 @@ private static Page listModels( final Map optionsMap) { try { Tuple> result = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable< Tuple>>() { @Override - public Tuple> - call() { + public Tuple> call() + throws IOException { return serviceOptions .getBigQueryRpcV2() - .listModels(datasetId.getProject(), datasetId.getDataset(), optionsMap); + .listModelsSkipExceptionTranslation( + datasetId.getProject(), datasetId.getDataset(), optionsMap); } }, serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); String cursor = result.x(); Iterable models = Iterables.transform( @@ -1041,7 +1092,7 @@ public Model apply(com.google.api.services.bigquery.model.Model model) { }); return new PageImpl<>( new ModelPageFetcher(datasetId, serviceOptions, cursor, optionsMap), cursor, models); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1052,20 +1103,22 @@ private static Page listRoutines( final Map optionsMap) { try { Tuple> result = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable< Tuple>>() { @Override public Tuple> - call() { + call() throws IOException { return serviceOptions .getBigQueryRpcV2() - .listRoutines(datasetId.getProject(), datasetId.getDataset(), optionsMap); + .listRoutinesSkipExceptionTranslation( + datasetId.getProject(), datasetId.getDataset(), optionsMap); } }, serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); String cursor = result.x(); Iterable routines = Iterables.transform( @@ -1078,7 +1131,7 @@ public Routine apply(com.google.api.services.bigquery.model.Routine routinePb) { }); return new PageImpl<>( new RoutinePageFetcher(datasetId, serviceOptions, cursor, optionsMap), cursor, routines); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1120,21 +1173,23 @@ public Rows apply(RowToInsert rowToInsert) { // allowing retries only if all row insertIds are set (used for deduplication) try { responsePb = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override public TableDataInsertAllResponse call() throws Exception { - return bigQueryRpc.insertAll( + return bigQueryRpc.insertAllSkipExceptionTranslation( tableId.getProject(), tableId.getDataset(), tableId.getTable(), requestPb); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } else { + // Use insertAll that translate the exception as we are not retrying. responsePb = bigQueryRpc.insertAll( tableId.getProject(), tableId.getDataset(), tableId.getTable(), requestPb); @@ -1183,13 +1238,13 @@ private static Tuple, Long> listTableData( ? serviceOptions.getProjectId() : tableId.getProject()); TableDataList result = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public TableDataList call() { + public TableDataList call() throws IOException { return serviceOptions .getBigQueryRpcV2() - .listTableData( + .listTableDataSkipExceptionTranslation( completeTableId.getProject(), completeTableId.getDataset(), completeTableId.getTable(), @@ -1198,7 +1253,8 @@ public TableDataList call() { }, serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); String cursor = result.getPageToken(); Map pageOptionMap = Strings.isNullOrEmpty(cursor) ? optionsMap : optionMap(TableDataListOption.startIndex(0)); @@ -1208,7 +1264,7 @@ public TableDataList call() { cursor, transformTableData(result.getRows(), schema, serviceOptions.getUseInt64Timestamps())), result.getTotalRows()); - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1245,11 +1301,11 @@ public Job getJob(JobId jobId, JobOption... options) { : jobId.getLocation()); try { com.google.api.services.bigquery.model.Job answer = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Job call() { - return bigQueryRpc.getJob( + public com.google.api.services.bigquery.model.Job call() throws IOException { + return bigQueryRpc.getJobSkipExceptionTranslation( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), @@ -1258,12 +1314,16 @@ public com.google.api.services.bigquery.model.Job call() { }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - if (getOptions().getThrowNotFound() && answer == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Job not found"); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + return Job.fromPb(this, answer); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + if (getOptions().getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Job not found"); + } + return null; } - return answer == null ? null : Job.fromPb(this, answer); - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1275,30 +1335,36 @@ public Page listJobs(JobListOption... options) { private static Page listJobs( final BigQueryOptions serviceOptions, final Map optionsMap) { - Tuple> result = - runWithRetries( - new Callable>>() { - @Override - public Tuple> call() { - return serviceOptions - .getBigQueryRpcV2() - .listJobs(serviceOptions.getProjectId(), optionsMap); - } - }, - serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - serviceOptions.getClock()); - String cursor = result.x(); - Iterable jobs = - Iterables.transform( - result.y(), - new Function() { - @Override - public Job apply(com.google.api.services.bigquery.model.Job job) { - return Job.fromPb(serviceOptions.getService(), job); - } - }); - return new PageImpl<>(new JobPageFetcher(serviceOptions, cursor, optionsMap), cursor, jobs); + try { + Tuple> result = + BigQueryRetryHelper.runWithRetries( + new Callable>>() { + @Override + public Tuple> call() + throws IOException { + return serviceOptions + .getBigQueryRpcV2() + .listJobsSkipExceptionTranslation(serviceOptions.getProjectId(), optionsMap); + } + }, + serviceOptions.getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getClock(), + EMPTY_RETRY_CONFIG); + String cursor = result.x(); + Iterable jobs = + Iterables.transform( + result.y(), + new Function() { + @Override + public Job apply(com.google.api.services.bigquery.model.Job job) { + return Job.fromPb(serviceOptions.getService(), job); + } + }); + return new PageImpl<>(new JobPageFetcher(serviceOptions, cursor, optionsMap), cursor, jobs); + } catch (BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } } @Override @@ -1316,18 +1382,22 @@ public boolean cancel(JobId jobId) { ? getOptions().getLocation() : jobId.getLocation()); try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public Boolean call() { - return bigQueryRpc.cancel( + public Boolean call() throws IOException { + return bigQueryRpc.cancelSkipExceptionTranslation( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation()); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (isRetryErrorCodeHttpNotFound(e)) { + return false; + } throw BigQueryException.translateAndThrow(e); } } @@ -1370,8 +1440,9 @@ private TableResult queryRpc( BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.QueryResponse call() { - return bigQueryRpc.queryRpc(projectId, content); + public com.google.api.services.bigquery.model.QueryResponse call() + throws IOException { + return bigQueryRpc.queryRpcSkipExceptionTranslation(projectId, content); } }, getOptions().getRetrySettings(), @@ -1498,10 +1569,10 @@ private static QueryResponse getQueryResults( BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public GetQueryResultsResponse call() { + public GetQueryResultsResponse call() throws IOException { return serviceOptions .getBigQueryRpcV2() - .getQueryResults( + .getQueryResultsSkipExceptionTranslation( completeJobId.getProject(), completeJobId.getJob(), completeJobId.getLocation(), @@ -1528,7 +1599,7 @@ public GetQueryResultsResponse call() { .setTotalRows(results.getTotalRows() == null ? 0 : results.getTotalRows().longValue()) .setErrors(errors.build()) .build(); - } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1558,17 +1629,19 @@ public Policy getIamPolicy(TableId tableId, IAMOption... options) { try { final Map optionsMap = optionMap(options); return convertFromApiPolicy( - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Policy call() { - return bigQueryRpc.getIamPolicy(completeTableId.getIAMResourceName(), optionsMap); + public com.google.api.services.bigquery.model.Policy call() throws IOException { + return bigQueryRpc.getIamPolicySkipExceptionTranslation( + completeTableId.getIAMResourceName(), optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelper.RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1583,18 +1656,19 @@ public Policy setIamPolicy(TableId tableId, final Policy policy, IAMOption... op try { final Map optionsMap = optionMap(options); return convertFromApiPolicy( - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Policy call() { - return bigQueryRpc.setIamPolicy( + public com.google.api.services.bigquery.model.Policy call() throws IOException { + return bigQueryRpc.setIamPolicySkipExceptionTranslation( completeTableId.getIAMResourceName(), convertToApiPolicy(policy), optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock())); - } catch (RetryHelperException e) { + getOptions().getClock(), + EMPTY_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1610,21 +1684,23 @@ public List testIamPermissions( try { final Map optionsMap = optionMap(options); com.google.api.services.bigquery.model.TestIamPermissionsResponse response = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() { - return bigQueryRpc.testIamPermissions( + public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() + throws IOException { + return bigQueryRpc.testIamPermissionsSkipExceptionTranslation( completeTableId.getIAMResourceName(), permissions, optionsMap); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); return response.getPermissions() == null ? ImmutableList.of() : ImmutableList.copyOf(response.getPermissions()); - } catch (RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1647,4 +1723,13 @@ static BigQueryRetryConfig getBigQueryRetryConfig(Map opt static RetryOption[] getRetryOptions(Map options) { return (RetryOption[]) options.getOrDefault(BigQueryRpc.Option.RETRY_OPTIONS, null); } + + private static boolean isRetryErrorCodeHttpNotFound(BigQueryRetryHelperException e) { + if (e.getCause() instanceof BigQueryException) { + if (((BigQueryException) e.getCause()).getCode() == HTTP_NOT_FOUND) { + return true; + } + } + return false; + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 465cc83058..ca34a2d2dd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -21,7 +21,6 @@ import com.google.cloud.ServiceRpc; import com.google.cloud.TransportOptions; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; -import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.cloud.http.HttpTransportOptions; import com.google.common.annotations.VisibleForTesting; @@ -132,8 +131,8 @@ protected Set getScopes() { return SCOPES; } - protected BigQueryRpc getBigQueryRpcV2() { - return (BigQueryRpc) getRpc(); + protected HttpBigQueryRpc getBigQueryRpcV2() { + return (HttpBigQueryRpc) getRpc(); } public String getLocation() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java index 405a2371ed..d315241a3c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java @@ -25,6 +25,7 @@ import com.google.api.gax.retrying.RetryingFuture; import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.cloud.RetryHelper; +import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.logging.Level; @@ -52,6 +53,11 @@ public static V runWithRetries( algorithm, bigQueryRetryConfig); } catch (Exception e) { + // Checks for IOException and translate it into BigQueryException. The BigQueryException + // constructor parses the IOException and translate it into internal code. + if (e.getCause() instanceof IOException) { + throw new BigQueryRetryHelperException(new BigQueryException((IOException) e.getCause())); + } throw new BigQueryRetryHelperException(e.getCause()); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index 5ad9fe2843..d524cedfc8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -16,7 +16,6 @@ package com.google.cloud.bigquery; -import static com.google.cloud.RetryHelper.runWithRetries; import static java.net.HttpURLConnection.HTTP_NOT_FOUND; import com.google.api.core.BetaApi; @@ -28,8 +27,8 @@ import com.google.api.services.bigquery.model.QueryRequest; import com.google.api.services.bigquery.model.TableDataList; import com.google.api.services.bigquery.model.TableRow; -import com.google.cloud.RetryHelper; import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException; import com.google.cloud.bigquery.JobStatistics.QueryStatistics; import com.google.cloud.bigquery.JobStatistics.SessionInfo; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; @@ -102,6 +101,8 @@ class ConnectionImpl implements Connection { bufferFvl; // initialized lazily iff we end up using the tabledata.list end point private BlockingQueue bufferRow; // initialized lazily iff we end up using Read API + private static final BigQueryRetryConfig EMPTY_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder().build(); ConnectionImpl( ConnectionSettings connectionSettings, @@ -466,12 +467,15 @@ private BigQueryResult queryRpc( try { results = BigQueryRetryHelper.runWithRetries( - () -> bigQueryRpc.queryRpc(projectId, queryRequest), + () -> + bigQueryOptions + .getBigQueryRpcV2() + .queryRpcSkipExceptionTranslation(projectId, queryRequest), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), retryConfig); - } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -914,21 +918,30 @@ private Job getQueryJobRpc(JobId jobId) { com.google.api.services.bigquery.model.Job jobPb; try { jobPb = - runWithRetries( + BigQueryRetryHelper.runWithRetries( () -> - bigQueryRpc.getQueryJob( - completeJobId.getProject(), - completeJobId.getJob(), - completeJobId.getLocation()), + bigQueryOptions + .getBigQueryRpcV2() + .getQueryJobSkipExceptionTranslation( + completeJobId.getProject(), + completeJobId.getJob(), + completeJobId.getLocation()), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - bigQueryOptions.getClock()); - if (bigQueryOptions.getThrowNotFound() && jobPb == null) { - throw new BigQueryException(HTTP_NOT_FOUND, "Query job not found"); + bigQueryOptions.getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + if (e.getCause() instanceof BigQueryException) { + if (((BigQueryException) e.getCause()).getCode() == HTTP_NOT_FOUND) { + if (bigQueryOptions.getThrowNotFound()) { + throw new BigQueryException(HTTP_NOT_FOUND, "Query job not found"); + } + return null; + } } - } catch (RetryHelper.RetryHelperException e) { throw BigQueryException.translateAndThrow(e); } + // getQueryJobSkipExceptionTranslation will never return null so this is safe. return Job.fromPb(bigQueryOptions.getService(), jobPb); } @@ -948,11 +961,11 @@ TableDataList tableDataListRpc(TableId destinationTable, String pageToken) { ? bigQueryOptions.getProjectId() : destinationTable.getProject()); TableDataList results = - runWithRetries( + BigQueryRetryHelper.runWithRetries( () -> bigQueryOptions .getBigQueryRpcV2() - .listTableDataWithRowLimit( + .listTableDataWithRowLimitSkipExceptionTranslation( completeTableId.getProject(), completeTableId.getDataset(), completeTableId.getTable(), @@ -960,10 +973,11 @@ TableDataList tableDataListRpc(TableId destinationTable, String pageToken) { pageToken), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - bigQueryOptions.getClock()); + bigQueryOptions.getClock(), + EMPTY_RETRY_CONFIG); return results; - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -1177,12 +1191,14 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { results = BigQueryRetryHelper.runWithRetries( () -> - bigQueryRpc.getQueryResultsWithRowLimit( - completeJobId.getProject(), - completeJobId.getJob(), - completeJobId.getLocation(), - connectionSettings.getMaxResultPerPage(), - timeoutMs), + bigQueryOptions + .getBigQueryRpcV2() + .getQueryResultsWithRowLimitSkipExceptionTranslation( + completeJobId.getProject(), + completeJobId.getJob(), + completeJobId.getLocation(), + connectionSettings.getMaxResultPerPage(), + timeoutMs), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), @@ -1197,7 +1213,7 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { // with the case where there is a HTTP error throw new BigQueryException(bigQueryErrors); } - } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { + } catch (BigQueryRetryHelperException e) { logger.log(Level.WARNING, "\n Error occurred while calling getQueryResultsWithRowLimit", e); throw BigQueryException.translateAndThrow(e); } @@ -1442,7 +1458,10 @@ com.google.api.services.bigquery.model.Job createQueryJob( try { queryJob = BigQueryRetryHelper.runWithRetries( - () -> bigQueryRpc.createJobForQuery(jobPb), + () -> + bigQueryOptions + .getBigQueryRpcV2() + .createJobForQuerySkipExceptionTranslation(jobPb), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), @@ -1482,7 +1501,10 @@ com.google.api.services.bigquery.model.Job createDryRunJob(String sql) { try { dryRunJob = BigQueryRetryHelper.runWithRetries( - () -> bigQueryRpc.createJobForQuery(jobPb), + () -> + bigQueryOptions + .getBigQueryRpcV2() + .createJobForQuerySkipExceptionTranslation(jobPb), bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java index 0f9632aea8..aabd87d471 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java @@ -16,12 +16,11 @@ package com.google.cloud.bigquery; -import static com.google.cloud.RetryHelper.runWithRetries; - import com.google.cloud.BaseWriteChannel; import com.google.cloud.RestorableState; -import com.google.cloud.RetryHelper; import com.google.cloud.WriteChannel; +import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException; +import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.concurrent.Callable; @@ -34,6 +33,9 @@ public class TableDataWriteChannel extends BaseWriteChannel { + private static final BigQueryRetryConfig EMPTY_RETRY_CONFIG = + BigQueryRetryConfig.newBuilder().build(); + private Job job; TableDataWriteChannel( @@ -50,20 +52,22 @@ public class TableDataWriteChannel protected void flushBuffer(final int length, final boolean last) { try { com.google.api.services.bigquery.model.Job jobPb = - runWithRetries( + BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public com.google.api.services.bigquery.model.Job call() { + public com.google.api.services.bigquery.model.Job call() throws IOException { return getOptions() .getBigQueryRpcV2() - .write(getUploadId(), getBuffer(), 0, getPosition(), length, last); + .writeSkipExceptionTranslation( + getUploadId(), getBuffer(), 0, getPosition(), length, last); } }, getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock()); + getOptions().getClock(), + EMPTY_RETRY_CONFIG); job = jobPb != null ? Job.fromPb(getOptions().getService(), jobPb) : null; - } catch (RetryHelper.RetryHelperException e) { + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } @@ -78,13 +82,13 @@ private static String open( final JobId jobId, final WriteChannelConfiguration writeChannelConfiguration) { try { - return runWithRetries( + return BigQueryRetryHelper.runWithRetries( new Callable() { @Override - public String call() { + public String call() throws IOException { return options .getBigQueryRpcV2() - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setConfiguration(writeChannelConfiguration.toPb()) .setJobReference(jobId.toPb())); @@ -92,8 +96,9 @@ public String call() { }, options.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - options.getClock()); - } catch (RetryHelper.RetryHelperException e) { + options.getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 3946f83f54..14a14fdb9f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -129,20 +129,7 @@ private void validateRPC() throws BigQueryException, IOException { @Override public Dataset getDataset(String projectId, String datasetId, Map options) { try { - validateRPC(); - - Bigquery.Datasets.Get bqGetRequest = - bigquery - .datasets() - .get(projectId, datasetId) - .setFields(Option.FIELDS.getString(options)) - .setPrettyPrint(false); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqGetRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } - } - return bqGetRequest.execute(); + return getDatasetSkipExceptionTranslation(projectId, datasetId, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -152,130 +139,175 @@ public Dataset getDataset(String projectId, String datasetId, Map opt } } + @InternalApi("internal to java-bigquery") + public Dataset getDatasetSkipExceptionTranslation( + String projectId, String datasetId, Map options) throws IOException { + validateRPC(); + Bigquery.Datasets.Get bqGetRequest = + bigquery + .datasets() + .get(projectId, datasetId) + .setFields(Option.FIELDS.getString(options)) + .setPrettyPrint(false); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqGetRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqGetRequest.execute(); + } + @Override public Tuple> listDatasets(String projectId, Map options) { try { - validateRPC(); - DatasetList datasetsList = - bigquery - .datasets() - .list(projectId) - .setPrettyPrint(false) - .setAll(Option.ALL_DATASETS.getBoolean(options)) - .setFilter(Option.LABEL_FILTER.getString(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); - Iterable datasets = datasetsList.getDatasets(); - return Tuple.of( - datasetsList.getNextPageToken(), - Iterables.transform( - datasets != null ? datasets : ImmutableList.of(), - LIST_TO_DATASET)); + return listDatasetsSkipExceptionTranslation(projectId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Tuple> listDatasetsSkipExceptionTranslation( + String projectId, Map options) throws IOException { + validateRPC(); + DatasetList datasetsList = + bigquery + .datasets() + .list(projectId) + .setPrettyPrint(false) + .setAll(Option.ALL_DATASETS.getBoolean(options)) + .setFilter(Option.LABEL_FILTER.getString(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .execute(); + Iterable datasets = datasetsList.getDatasets(); + return Tuple.of( + datasetsList.getNextPageToken(), + Iterables.transform( + datasets != null ? datasets : ImmutableList.of(), + LIST_TO_DATASET)); + } + @Override public Dataset create(Dataset dataset, Map options) { try { - validateRPC(); - Bigquery.Datasets.Insert bqCreateRequest = - bigquery - .datasets() - .insert(dataset.getDatasetReference().getProjectId(), dataset) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqCreateRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } - } - return bqCreateRequest.execute(); + return createSkipExceptionTranslation(dataset, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Dataset createSkipExceptionTranslation(Dataset dataset, Map options) + throws IOException { + validateRPC(); + Bigquery.Datasets.Insert bqCreateRequest = + bigquery + .datasets() + .insert(dataset.getDatasetReference().getProjectId(), dataset) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqCreateRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqCreateRequest.execute(); + } + @Override public Table create(Table table, Map options) { try { - validateRPC(); - // unset the type, as it is output only - table.setType(null); - TableReference reference = table.getTableReference(); - return bigquery - .tables() - .insert(reference.getProjectId(), reference.getDatasetId(), table) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return createSkipExceptionTranslation(table, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Table createSkipExceptionTranslation(Table table, Map options) + throws IOException { + validateRPC(); + // unset the type, as it is output only + table.setType(null); + TableReference reference = table.getTableReference(); + return bigquery + .tables() + .insert(reference.getProjectId(), reference.getDatasetId(), table) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Routine create(Routine routine, Map options) { try { - validateRPC(); - RoutineReference reference = routine.getRoutineReference(); - return bigquery - .routines() - .insert(reference.getProjectId(), reference.getDatasetId(), routine) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return createSkipExceptionTranslation(routine, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Routine createSkipExceptionTranslation(Routine routine, Map options) + throws IOException { + validateRPC(); + RoutineReference reference = routine.getRoutineReference(); + return bigquery + .routines() + .insert(reference.getProjectId(), reference.getDatasetId(), routine) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Job create(Job job, Map options) { try { - validateRPC(); - String projectId = - job.getJobReference() != null - ? job.getJobReference().getProjectId() - : this.options.getProjectId(); - return bigquery - .jobs() - .insert(projectId, job) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return createSkipExceptionTranslation(job, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Job createSkipExceptionTranslation(Job job, Map options) throws IOException { + validateRPC(); + String projectId = + job.getJobReference() != null + ? job.getJobReference().getProjectId() + : this.options.getProjectId(); + return bigquery + .jobs() + .insert(projectId, job) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Job createJobForQuery(Job job) { try { - validateRPC(); - String projectId = - job.getJobReference() != null - ? job.getJobReference().getProjectId() - : this.options.getProjectId(); - return bigquery.jobs().insert(projectId, job).setPrettyPrint(false).execute(); + return createJobForQuerySkipExceptionTranslation(job); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Job createJobForQuerySkipExceptionTranslation(Job job) throws IOException { + validateRPC(); + String projectId = + job.getJobReference() != null + ? job.getJobReference().getProjectId() + : this.options.getProjectId(); + return bigquery.jobs().insert(projectId, job).setPrettyPrint(false).execute(); + } + @Override public boolean deleteDataset(String projectId, String datasetId, Map options) { try { - validateRPC(); - bigquery - .datasets() - .delete(projectId, datasetId) - .setPrettyPrint(false) - .setDeleteContents(Option.DELETE_CONTENTS.getBoolean(options)) - .execute(); - return true; + return deleteDatasetSkipExceptionTranslation(projectId, datasetId, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -285,59 +317,77 @@ public boolean deleteDataset(String projectId, String datasetId, Map } } + @InternalApi("internal to java-bigquery") + public boolean deleteDatasetSkipExceptionTranslation( + String projectId, String datasetId, Map options) throws IOException { + validateRPC(); + bigquery + .datasets() + .delete(projectId, datasetId) + .setPrettyPrint(false) + .setDeleteContents(Option.DELETE_CONTENTS.getBoolean(options)) + .execute(); + return true; + } + @Override public Dataset patch(Dataset dataset, Map options) { try { - validateRPC(); - DatasetReference reference = dataset.getDatasetReference(); - Bigquery.Datasets.Patch bqPatchRequest = - bigquery - .datasets() - .patch(reference.getProjectId(), reference.getDatasetId(), dataset) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqPatchRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } - } - return bqPatchRequest.execute(); + return patchSkipExceptionTranslation(dataset, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Dataset patchSkipExceptionTranslation(Dataset dataset, Map options) + throws IOException { + validateRPC(); + DatasetReference reference = dataset.getDatasetReference(); + Bigquery.Datasets.Patch bqPatchRequest = + bigquery + .datasets() + .patch(reference.getProjectId(), reference.getDatasetId(), dataset) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + for (Map.Entry entry : options.entrySet()) { + if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { + bqPatchRequest.setAccessPolicyVersion((Integer) entry.getValue()); + } + } + return bqPatchRequest.execute(); + } + @Override public Table patch(Table table, Map options) { try { - validateRPC(); - // unset the type, as it is output only - table.setType(null); - TableReference reference = table.getTableReference(); - return bigquery - .tables() - .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)) - .execute(); + return patchSkipExceptionTranslation(table, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Table patchSkipExceptionTranslation(Table table, Map options) + throws IOException { + validateRPC(); + // unset the type, as it is output only + table.setType(null); + TableReference reference = table.getTableReference(); + return bigquery + .tables() + .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)) + .execute(); + } + @Override public Table getTable( String projectId, String datasetId, String tableId, Map options) { try { - validateRPC(); - return bigquery - .tables() - .get(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .setView(getTableMetadataOption(options)) - .execute(); + return getTableSkipExceptionTranslation(projectId, datasetId, tableId, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -347,6 +397,20 @@ public Table getTable( } } + @InternalApi("internal to java-bigquery") + public Table getTableSkipExceptionTranslation( + String projectId, String datasetId, String tableId, Map options) + throws IOException { + validateRPC(); + return bigquery + .tables() + .get(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .setView(getTableMetadataOption(options)) + .execute(); + } + private String getTableMetadataOption(Map options) { if (options.containsKey(Option.TABLE_METADATA_VIEW)) { return options.get(Option.TABLE_METADATA_VIEW).toString(); @@ -358,46 +422,50 @@ private String getTableMetadataOption(Map options) { public Tuple> listTables( String projectId, String datasetId, Map options) { try { - validateRPC(); - TableList tableList = - bigquery - .tables() - .list(projectId, datasetId) - .setPrettyPrint(false) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); - Iterable tables = tableList.getTables(); - return Tuple.of( - tableList.getNextPageToken(), - Iterables.transform( - tables != null ? tables : ImmutableList.of(), - new Function() { - @Override - public Table apply(TableList.Tables tablePb) { - return new Table() - .setFriendlyName(tablePb.getFriendlyName()) - .setId(tablePb.getId()) - .setKind(tablePb.getKind()) - .setTableReference(tablePb.getTableReference()) - .setType(tablePb.getType()) - .setCreationTime(tablePb.getCreationTime()) - .setTimePartitioning(tablePb.getTimePartitioning()) - .setRangePartitioning(tablePb.getRangePartitioning()) - .setClustering(tablePb.getClustering()); - } - })); + return listTablesSkipExceptionTranslation(projectId, datasetId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Tuple> listTablesSkipExceptionTranslation( + String projectId, String datasetId, Map options) throws IOException { + validateRPC(); + TableList tableList = + bigquery + .tables() + .list(projectId, datasetId) + .setPrettyPrint(false) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .execute(); + Iterable tables = tableList.getTables(); + return Tuple.of( + tableList.getNextPageToken(), + Iterables.transform( + tables != null ? tables : ImmutableList.of(), + new Function() { + @Override + public Table apply(TableList.Tables tablePb) { + return new Table() + .setFriendlyName(tablePb.getFriendlyName()) + .setId(tablePb.getId()) + .setKind(tablePb.getKind()) + .setTableReference(tablePb.getTableReference()) + .setType(tablePb.getType()) + .setCreationTime(tablePb.getCreationTime()) + .setTimePartitioning(tablePb.getTimePartitioning()) + .setRangePartitioning(tablePb.getRangePartitioning()) + .setClustering(tablePb.getClustering()); + } + })); + } + @Override public boolean deleteTable(String projectId, String datasetId, String tableId) { try { - validateRPC(); - bigquery.tables().delete(projectId, datasetId, tableId).execute(); - return true; + return deleteTableSkipExceptionTranslation(projectId, datasetId, tableId); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -407,34 +475,42 @@ public boolean deleteTable(String projectId, String datasetId, String tableId) { } } + @InternalApi("internal to java-bigquery") + public boolean deleteTableSkipExceptionTranslation( + String projectId, String datasetId, String tableId) throws IOException { + validateRPC(); + bigquery.tables().delete(projectId, datasetId, tableId).execute(); + return true; + } + @Override public Model patch(Model model, Map options) { try { - validateRPC(); - // unset the type, as it is output only - ModelReference reference = model.getModelReference(); - return bigquery - .models() - .patch(reference.getProjectId(), reference.getDatasetId(), reference.getModelId(), model) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return patchSkipExceptionTranslation(model, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Model patchSkipExceptionTranslation(Model model, Map options) + throws IOException { + validateRPC(); + // unset the type, as it is output only + ModelReference reference = model.getModelReference(); + return bigquery + .models() + .patch(reference.getProjectId(), reference.getDatasetId(), reference.getModelId(), model) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Model getModel( String projectId, String datasetId, String modelId, Map options) { try { - validateRPC(); - return bigquery - .models() - .get(projectId, datasetId, modelId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return getModelSkipExceptionTranslation(projectId, datasetId, modelId, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -444,33 +520,50 @@ public Model getModel( } } + @InternalApi("internal to java-bigquery") + public Model getModelSkipExceptionTranslation( + String projectId, String datasetId, String modelId, Map options) + throws IOException { + validateRPC(); + return bigquery + .models() + .get(projectId, datasetId, modelId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Tuple> listModels( String projectId, String datasetId, Map options) { try { - validateRPC(); - ListModelsResponse modelList = - bigquery - .models() - .list(projectId, datasetId) - .setPrettyPrint(false) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); - Iterable models = - modelList.getModels() != null ? modelList.getModels() : ImmutableList.of(); - return Tuple.of(modelList.getNextPageToken(), models); + return listModelsSkipExceptionTranslation(projectId, datasetId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Tuple> listModelsSkipExceptionTranslation( + String projectId, String datasetId, Map options) throws IOException { + validateRPC(); + ListModelsResponse modelList = + bigquery + .models() + .list(projectId, datasetId) + .setPrettyPrint(false) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .execute(); + Iterable models = + modelList.getModels() != null ? modelList.getModels() : ImmutableList.of(); + return Tuple.of(modelList.getNextPageToken(), models); + } + @Override public boolean deleteModel(String projectId, String datasetId, String modelId) { try { - validateRPC(); - bigquery.models().delete(projectId, datasetId, modelId).execute(); - return true; + return deleteModelSkipExceptionTranslation(projectId, datasetId, modelId); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -480,34 +573,42 @@ public boolean deleteModel(String projectId, String datasetId, String modelId) { } } + @InternalApi("internal to java-bigquery") + public boolean deleteModelSkipExceptionTranslation( + String projectId, String datasetId, String modelId) throws IOException { + validateRPC(); + bigquery.models().delete(projectId, datasetId, modelId).execute(); + return true; + } + @Override public Routine update(Routine routine, Map options) { try { - validateRPC(); - RoutineReference reference = routine.getRoutineReference(); - return bigquery - .routines() - .update( - reference.getProjectId(), reference.getDatasetId(), reference.getRoutineId(), routine) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return updateSkipExceptionTranslation(routine, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Routine updateSkipExceptionTranslation(Routine routine, Map options) + throws IOException { + validateRPC(); + RoutineReference reference = routine.getRoutineReference(); + return bigquery + .routines() + .update( + reference.getProjectId(), reference.getDatasetId(), reference.getRoutineId(), routine) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Routine getRoutine( String projectId, String datasetId, String routineId, Map options) { try { - validateRPC(); - return bigquery - .routines() - .get(projectId, datasetId, routineId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return getRoutineSkipExceptionTranslation(projectId, datasetId, routineId, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -517,35 +618,50 @@ public Routine getRoutine( } } + @InternalApi("internal to java-bigquery") + public Routine getRoutineSkipExceptionTranslation( + String projectId, String datasetId, String routineId, Map options) + throws IOException { + validateRPC(); + return bigquery + .routines() + .get(projectId, datasetId, routineId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Tuple> listRoutines( String projectId, String datasetId, Map options) { try { - validateRPC(); - ListRoutinesResponse routineList = - bigquery - .routines() - .list(projectId, datasetId) - .setPrettyPrint(false) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); - Iterable routines = - routineList.getRoutines() != null - ? routineList.getRoutines() - : ImmutableList.of(); - return Tuple.of(routineList.getNextPageToken(), routines); + return listRoutinesSkipExceptionTranslation(projectId, datasetId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Tuple> listRoutinesSkipExceptionTranslation( + String projectId, String datasetId, Map options) throws IOException { + validateRPC(); + ListRoutinesResponse routineList = + bigquery + .routines() + .list(projectId, datasetId) + .setPrettyPrint(false) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .execute(); + Iterable routines = + routineList.getRoutines() != null ? routineList.getRoutines() : ImmutableList.of(); + return Tuple.of(routineList.getNextPageToken(), routines); + } + @Override public boolean deleteRoutine(String projectId, String datasetId, String routineId) { try { - validateRPC(); - bigquery.routines().delete(projectId, datasetId, routineId).execute(); - return true; + return deleteRoutineSkipExceptionTranslation(projectId, datasetId, routineId); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -555,42 +671,64 @@ public boolean deleteRoutine(String projectId, String datasetId, String routineI } } + @InternalApi("internal to java-bigquery") + public boolean deleteRoutineSkipExceptionTranslation( + String projectId, String datasetId, String routineId) throws IOException { + validateRPC(); + bigquery.routines().delete(projectId, datasetId, routineId).execute(); + return true; + } + @Override public TableDataInsertAllResponse insertAll( String projectId, String datasetId, String tableId, TableDataInsertAllRequest request) { try { - validateRPC(); - return bigquery - .tabledata() - .insertAll(projectId, datasetId, tableId, request) - .setPrettyPrint(false) - .execute(); + return insertAllSkipExceptionTranslation(projectId, datasetId, tableId, request); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public TableDataInsertAllResponse insertAllSkipExceptionTranslation( + String projectId, String datasetId, String tableId, TableDataInsertAllRequest request) + throws IOException { + validateRPC(); + return bigquery + .tabledata() + .insertAll(projectId, datasetId, tableId, request) + .setPrettyPrint(false) + .execute(); + } + @Override public TableDataList listTableData( String projectId, String datasetId, String tableId, Map options) { try { - validateRPC(); - return bigquery - .tabledata() - .list(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setStartIndex( - Option.START_INDEX.getLong(options) != null - ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) - : null) - .execute(); + return listTableDataSkipExceptionTranslation(projectId, datasetId, tableId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public TableDataList listTableDataSkipExceptionTranslation( + String projectId, String datasetId, String tableId, Map options) + throws IOException { + validateRPC(); + return bigquery + .tabledata() + .list(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setStartIndex( + Option.START_INDEX.getLong(options) != null + ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) + : null) + .execute(); + } + @Override public TableDataList listTableDataWithRowLimit( String projectId, @@ -599,30 +737,35 @@ public TableDataList listTableDataWithRowLimit( Integer maxResultPerPage, String pageToken) { try { - validateRPC(); - return bigquery - .tabledata() - .list(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setMaxResults(Long.valueOf(maxResultPerPage)) - .setPageToken(pageToken) - .execute(); + return listTableDataWithRowLimitSkipExceptionTranslation( + projectId, datasetId, tableId, maxResultPerPage, pageToken); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public TableDataList listTableDataWithRowLimitSkipExceptionTranslation( + String projectId, + String datasetId, + String tableId, + Integer maxResultPerPage, + String pageToken) + throws IOException { + validateRPC(); + return bigquery + .tabledata() + .list(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .setPageToken(pageToken) + .execute(); + } + @Override public Job getJob(String projectId, String jobId, String location, Map options) { try { - validateRPC(); - return bigquery - .jobs() - .get(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setFields(Option.FIELDS.getString(options)) - .execute(); + return getJobSkipExceptionTranslation(projectId, jobId, location, options); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -632,16 +775,23 @@ public Job getJob(String projectId, String jobId, String location, Map options) throws IOException { + validateRPC(); + return bigquery + .jobs() + .get(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setFields(Option.FIELDS.getString(options)) + .execute(); + } + @Override public Job getQueryJob(String projectId, String jobId, String location) { try { - validateRPC(); - return bigquery - .jobs() - .get(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .execute(); + return getQueryJobSkipExceptionTranslation(projectId, jobId, location); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -651,72 +801,83 @@ public Job getQueryJob(String projectId, String jobId, String location) { } } + @InternalApi("internal to java-bigquery") + public Job getQueryJobSkipExceptionTranslation(String projectId, String jobId, String location) + throws IOException { + validateRPC(); + return bigquery + .jobs() + .get(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .execute(); + } + @Override public Tuple> listJobs(String projectId, Map options) { try { - validateRPC(); - Bigquery.Jobs.List request = - bigquery - .jobs() - .list(projectId) - .setPrettyPrint(false) - .setAllUsers(Option.ALL_USERS.getBoolean(options)) - .setFields(Option.FIELDS.getString(options)) - .setStateFilter(Option.STATE_FILTER.>get(options)) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setProjection(DEFAULT_PROJECTION) - .setParentJobId(Option.PARENT_JOB_ID.getString(options)); - if (Option.MIN_CREATION_TIME.getLong(options) != null) { - request.setMinCreationTime(BigInteger.valueOf(Option.MIN_CREATION_TIME.getLong(options))); - } - if (Option.MAX_CREATION_TIME.getLong(options) != null) { - request.setMaxCreationTime(BigInteger.valueOf(Option.MAX_CREATION_TIME.getLong(options))); - } - JobList jobsList = request.execute(); - - Iterable jobs = jobsList.getJobs(); - return Tuple.of( - jobsList.getNextPageToken(), - Iterables.transform( - jobs != null ? jobs : ImmutableList.of(), - new Function() { - @Override - public Job apply(JobList.Jobs jobPb) { - JobStatus statusPb = - jobPb.getStatus() != null ? jobPb.getStatus() : new JobStatus(); - if (statusPb.getState() == null) { - statusPb.setState(jobPb.getState()); - } - if (statusPb.getErrorResult() == null) { - statusPb.setErrorResult(jobPb.getErrorResult()); - } - return new Job() - .setConfiguration(jobPb.getConfiguration()) - .setId(jobPb.getId()) - .setJobReference(jobPb.getJobReference()) - .setKind(jobPb.getKind()) - .setStatistics(jobPb.getStatistics()) - .setStatus(statusPb) - .setUserEmail(jobPb.getUserEmail()); - } - })); + return listJobsSkipExceptionTranslation(projectId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Tuple> listJobsSkipExceptionTranslation( + String projectId, Map options) throws IOException { + validateRPC(); + Bigquery.Jobs.List request = + bigquery + .jobs() + .list(projectId) + .setPrettyPrint(false) + .setAllUsers(Option.ALL_USERS.getBoolean(options)) + .setFields(Option.FIELDS.getString(options)) + .setStateFilter(Option.STATE_FILTER.>get(options)) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setProjection(DEFAULT_PROJECTION) + .setParentJobId(Option.PARENT_JOB_ID.getString(options)); + if (Option.MIN_CREATION_TIME.getLong(options) != null) { + request.setMinCreationTime(BigInteger.valueOf(Option.MIN_CREATION_TIME.getLong(options))); + } + if (Option.MAX_CREATION_TIME.getLong(options) != null) { + request.setMaxCreationTime(BigInteger.valueOf(Option.MAX_CREATION_TIME.getLong(options))); + } + JobList jobsList = request.execute(); + + Iterable jobs = jobsList.getJobs(); + return Tuple.of( + jobsList.getNextPageToken(), + Iterables.transform( + jobs != null ? jobs : ImmutableList.of(), + new Function() { + @Override + public Job apply(JobList.Jobs jobPb) { + JobStatus statusPb = + jobPb.getStatus() != null ? jobPb.getStatus() : new JobStatus(); + if (statusPb.getState() == null) { + statusPb.setState(jobPb.getState()); + } + if (statusPb.getErrorResult() == null) { + statusPb.setErrorResult(jobPb.getErrorResult()); + } + return new Job() + .setConfiguration(jobPb.getConfiguration()) + .setId(jobPb.getId()) + .setJobReference(jobPb.getJobReference()) + .setKind(jobPb.getKind()) + .setStatistics(jobPb.getStatistics()) + .setStatus(statusPb) + .setUserEmail(jobPb.getUserEmail()); + } + })); + } + @Override public boolean cancel(String projectId, String jobId, String location) { try { - validateRPC(); - bigquery - .jobs() - .cancel(projectId, jobId) - .setLocation(location) - .setPrettyPrint(false) - .execute(); - return true; + return cancelSkipExceptionTranslation(projectId, jobId, location); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { @@ -726,95 +887,134 @@ public boolean cancel(String projectId, String jobId, String location) { } } + @InternalApi("internal to java-bigquery") + public boolean cancelSkipExceptionTranslation(String projectId, String jobId, String location) + throws IOException { + validateRPC(); + bigquery.jobs().cancel(projectId, jobId).setLocation(location).setPrettyPrint(false).execute(); + return true; + } + @Override public boolean deleteJob(String projectId, String jobName, String location) { try { - validateRPC(); - bigquery - .jobs() - .delete(projectId, jobName) - .setLocation(location) - .setPrettyPrint(false) - .execute(); - return true; + return deleteJobSkipExceptionTranslation(projectId, jobName, location); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public boolean deleteJobSkipExceptionTranslation( + String projectId, String jobName, String location) throws IOException { + validateRPC(); + bigquery + .jobs() + .delete(projectId, jobName) + .setLocation(location) + .setPrettyPrint(false) + .execute(); + return true; + } + @Override public GetQueryResultsResponse getQueryResults( String projectId, String jobId, String location, Map options) { try { - validateRPC(); - return bigquery - .jobs() - .getQueryResults(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setStartIndex( - Option.START_INDEX.getLong(options) != null - ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) - : null) - .setTimeoutMs(Option.TIMEOUT.getLong(options)) - .execute(); + return getQueryResultsSkipExceptionTranslation(projectId, jobId, location, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public GetQueryResultsResponse getQueryResultsSkipExceptionTranslation( + String projectId, String jobId, String location, Map options) throws IOException { + validateRPC(); + return bigquery + .jobs() + .getQueryResults(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setStartIndex( + Option.START_INDEX.getLong(options) != null + ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) + : null) + .setTimeoutMs(Option.TIMEOUT.getLong(options)) + .execute(); + } + @Override public GetQueryResultsResponse getQueryResultsWithRowLimit( String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) { try { - validateRPC(); - return bigquery - .jobs() - .getQueryResults(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setMaxResults(Long.valueOf(maxResultPerPage)) - .setTimeoutMs(timeoutMs) - .execute(); + return getQueryResultsWithRowLimitSkipExceptionTranslation( + projectId, jobId, location, maxResultPerPage, timeoutMs); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public GetQueryResultsResponse getQueryResultsWithRowLimitSkipExceptionTranslation( + String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) + throws IOException { + validateRPC(); + return bigquery + .jobs() + .getQueryResults(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .setTimeoutMs(timeoutMs) + .execute(); + } + @Override public QueryResponse queryRpc(String projectId, QueryRequest content) { try { - validateRPC(); - return bigquery.jobs().query(projectId, content).execute(); + return queryRpcSkipExceptionTranslation(projectId, content); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public QueryResponse queryRpcSkipExceptionTranslation(String projectId, QueryRequest content) + throws IOException { + validateRPC(); + return bigquery.jobs().query(projectId, content).execute(); + } + @Override public String open(Job loadJob) { try { - String builder = options.getResolvedApiaryHost("bigquery"); - if (!builder.endsWith("/")) { - builder += "/"; - } - builder += BASE_RESUMABLE_URI + options.getProjectId() + "/jobs"; - GenericUrl url = new GenericUrl(builder); - url.set("uploadType", "resumable"); - JsonFactory jsonFactory = bigquery.getJsonFactory(); - HttpRequestFactory requestFactory = bigquery.getRequestFactory(); - HttpRequest httpRequest = - requestFactory.buildPostRequest(url, new JsonHttpContent(jsonFactory, loadJob)); - httpRequest.getHeaders().set("X-Upload-Content-Value", "application/octet-stream"); - HttpResponse response = httpRequest.execute(); - return response.getHeaders().getLocation(); + return openSkipExceptionTranslation(loadJob); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public String openSkipExceptionTranslation(Job loadJob) throws IOException { + String builder = options.getResolvedApiaryHost("bigquery"); + if (!builder.endsWith("/")) { + builder += "/"; + } + builder += BASE_RESUMABLE_URI + options.getProjectId() + "/jobs"; + GenericUrl url = new GenericUrl(builder); + url.set("uploadType", "resumable"); + JsonFactory jsonFactory = bigquery.getJsonFactory(); + HttpRequestFactory requestFactory = bigquery.getRequestFactory(); + HttpRequest httpRequest = + requestFactory.buildPostRequest(url, new JsonHttpContent(jsonFactory, loadJob)); + httpRequest.getHeaders().set("X-Upload-Content-Value", "application/octet-stream"); + HttpResponse response = httpRequest.execute(); + return response.getHeaders().getLocation(); + } + @Override public Job write( String uploadId, @@ -824,101 +1024,126 @@ public Job write( int length, boolean last) { try { - if (length == 0) { - return null; - } - GenericUrl url = new GenericUrl(uploadId); - HttpRequest httpRequest = - bigquery - .getRequestFactory() - .buildPutRequest(url, new ByteArrayContent(null, toWrite, toWriteOffset, length)); - httpRequest.setParser(bigquery.getObjectParser()); - long limit = destOffset + length; - StringBuilder range = new StringBuilder("bytes "); - range.append(destOffset).append('-').append(limit - 1).append('/'); - if (last) { - range.append(limit); - } else { - range.append('*'); - } - httpRequest.getHeaders().setContentRange(range.toString()); - int code; - String message; - IOException exception = null; - HttpResponse response = null; - try { - response = httpRequest.execute(); - code = response.getStatusCode(); - message = response.getStatusMessage(); - } catch (HttpResponseException ex) { - exception = ex; - code = ex.getStatusCode(); - message = ex.getStatusMessage(); - } - if (!last && code != HTTP_RESUME_INCOMPLETE - || last && !(code == HTTP_OK || code == HTTP_CREATED)) { - if (exception != null) { - throw exception; - } - throw new BigQueryException(code, message); - } - return last && response != null ? response.parseAs(Job.class) : null; + return writeSkipExceptionTranslation( + uploadId, toWrite, toWriteOffset, destOffset, length, last); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Job writeSkipExceptionTranslation( + String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last) + throws IOException { + if (length == 0) { + return null; + } + GenericUrl url = new GenericUrl(uploadId); + HttpRequest httpRequest = + bigquery + .getRequestFactory() + .buildPutRequest(url, new ByteArrayContent(null, toWrite, toWriteOffset, length)); + httpRequest.setParser(bigquery.getObjectParser()); + long limit = destOffset + length; + StringBuilder range = new StringBuilder("bytes "); + range.append(destOffset).append('-').append(limit - 1).append('/'); + if (last) { + range.append(limit); + } else { + range.append('*'); + } + httpRequest.getHeaders().setContentRange(range.toString()); + int code; + String message; + IOException exception = null; + HttpResponse response = null; + try { + response = httpRequest.execute(); + code = response.getStatusCode(); + message = response.getStatusMessage(); + } catch (HttpResponseException ex) { + exception = ex; + code = ex.getStatusCode(); + message = ex.getStatusMessage(); + } + if (!last && code != HTTP_RESUME_INCOMPLETE + || last && !(code == HTTP_OK || code == HTTP_CREATED)) { + if (exception != null) { + throw exception; + } + throw new BigQueryException(code, message); + } + return last && response != null ? response.parseAs(Job.class) : null; + } + @Override public Policy getIamPolicy(String resourceId, Map options) { try { - validateRPC(); - GetIamPolicyRequest policyRequest = new GetIamPolicyRequest(); - if (null != Option.REQUESTED_POLICY_VERSION.getLong(options)) { - policyRequest = - policyRequest.setOptions( - new GetPolicyOptions() - .setRequestedPolicyVersion( - Option.REQUESTED_POLICY_VERSION.getLong(options).intValue())); - } - return bigquery - .tables() - .getIamPolicy(resourceId, policyRequest) - .setPrettyPrint(false) - .execute(); + return getIamPolicySkipExceptionTranslation(resourceId, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Policy getIamPolicySkipExceptionTranslation(String resourceId, Map options) + throws IOException { + validateRPC(); + GetIamPolicyRequest policyRequest = new GetIamPolicyRequest(); + if (null != Option.REQUESTED_POLICY_VERSION.getLong(options)) { + policyRequest = + policyRequest.setOptions( + new GetPolicyOptions() + .setRequestedPolicyVersion( + Option.REQUESTED_POLICY_VERSION.getLong(options).intValue())); + } + return bigquery + .tables() + .getIamPolicy(resourceId, policyRequest) + .setPrettyPrint(false) + .execute(); + } + @Override public Policy setIamPolicy(String resourceId, Policy policy, Map options) { try { - validateRPC(); - SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy); - return bigquery - .tables() - .setIamPolicy(resourceId, policyRequest) - .setPrettyPrint(false) - .execute(); + return setIamPolicySkipExceptionTranslation(resourceId, policy, options); } catch (IOException ex) { throw translate(ex); } } + @InternalApi("internal to java-bigquery") + public Policy setIamPolicySkipExceptionTranslation( + String resourceId, Policy policy, Map options) throws IOException { + validateRPC(); + SetIamPolicyRequest policyRequest = new SetIamPolicyRequest().setPolicy(policy); + return bigquery + .tables() + .setIamPolicy(resourceId, policyRequest) + .setPrettyPrint(false) + .execute(); + } + @Override public TestIamPermissionsResponse testIamPermissions( String resourceId, List permissions, Map options) { try { - validateRPC(); - TestIamPermissionsRequest permissionsRequest = - new TestIamPermissionsRequest().setPermissions(permissions); - return bigquery - .tables() - .testIamPermissions(resourceId, permissionsRequest) - .setPrettyPrint(false) - .execute(); + return testIamPermissionsSkipExceptionTranslation(resourceId, permissions, options); } catch (IOException ex) { throw translate(ex); } } + + public TestIamPermissionsResponse testIamPermissionsSkipExceptionTranslation( + String resourceId, List permissions, Map options) throws IOException { + validateRPC(); + TestIamPermissionsRequest permissionsRequest = + new TestIamPermissionsRequest().setPermissions(permissions); + return bigquery + .tables() + .testIamPermissions(resourceId, permissionsRequest) + .setPrettyPrint(false) + .execute(); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index c13d272d2e..1fa7481992 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -36,11 +36,14 @@ import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.common.base.Function; import com.google.common.base.Supplier; import com.google.common.collect.*; import java.io.IOException; import java.math.BigInteger; +import java.net.ConnectException; +import java.net.UnknownHostException; import java.util.Collections; import java.util.List; import java.util.Map; @@ -50,6 +53,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; +import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) @@ -497,7 +501,7 @@ public class BigQueryImplTest { .build(); private BigQueryOptions options; private BigQueryRpcFactory rpcFactoryMock; - private BigQueryRpc bigqueryRpcMock; + private HttpBigQueryRpc bigqueryRpcMock; private BigQuery bigquery; private static final String RATE_LIMIT_ERROR_MSG = "Job exceeded rate limits: Your table exceeded quota for table update operations. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas"; @@ -533,7 +537,7 @@ private BigQueryOptions createBigQueryOptionsForProjectWithLocation( @Before public void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); - bigqueryRpcMock = mock(BigQueryRpc.class); + bigqueryRpcMock = mock(HttpBigQueryRpc.class); when(rpcFactoryMock.create(any(BigQueryOptions.class))).thenReturn(bigqueryRpcMock); options = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); } @@ -545,21 +549,22 @@ public void testGetOptions() { } @Test - public void testCreateDataset() { + public void testCreateDataset() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.create(datasetInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.createSkipExceptionTranslation(datasetInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(datasetInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Dataset dataset = bigquery.create(datasetInfo); assertEquals(new Dataset(bigquery, new DatasetInfo.BuilderImpl(datasetInfo)), dataset); - verify(bigqueryRpcMock).create(datasetInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).createSkipExceptionTranslation(datasetInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testCreateDatasetWithSelectedFields() { - when(bigqueryRpcMock.create(eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) + public void testCreateDatasetWithSelectedFields() throws IOException { + when(bigqueryRpcMock.createSkipExceptionTranslation( + eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.create(DATASET_INFO, DATASET_OPTION_FIELDS); @@ -570,50 +575,54 @@ public void testCreateDatasetWithSelectedFields() { assertEquals(28, selector.length()); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock).create(eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture()); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation( + eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture()); } @Test - public void testCreateDatasetWithAccessPolicy() { + public void testCreateDatasetWithAccessPolicy() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); - when(bigqueryRpcMock.create(datasetInfo.toPb(), optionMap(datasetOption))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + datasetInfo.toPb(), optionMap(datasetOption))) .thenReturn(datasetInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Dataset dataset = bigquery.create(datasetInfo, datasetOption); assertEquals(new Dataset(bigquery, new DatasetInfo.BuilderImpl(datasetInfo)), dataset); - verify(bigqueryRpcMock).create(datasetInfo.toPb(), optionMap(datasetOption)); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation(datasetInfo.toPb(), optionMap(datasetOption)); } @Test - public void testGetDataset() { - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + public void testGetDataset() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.getDataset(DATASET); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetNotFoundWhenThrowIsDisabled() { - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + public void testGetDatasetNotFoundWhenThrowIsDisabled() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); options.setThrowNotFound(false); bigquery = options.getService(); Dataset dataset = bigquery.getDataset(DATASET); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetNotFoundWhenThrowIsEnabled() { - when(bigqueryRpcMock.getDataset(PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS)) - .thenReturn(null) + public void testGetDatasetNotFoundWhenThrowIsEnabled() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( + PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Dataset not found")); options.setThrowNotFound(true); bigquery = options.getService(); @@ -623,35 +632,39 @@ public void testGetDatasetNotFoundWhenThrowIsEnabled() { } catch (BigQueryException ex) { Assert.assertNotNull(ex.getMessage()); } - verify(bigqueryRpcMock).getDataset(PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getDatasetSkipExceptionTranslation(PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetFromDatasetId() { - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + public void testGetDatasetFromDatasetId() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.getDataset(DatasetId.of(DATASET)); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetFromDatasetIdWithProject() { + public void testGetDatasetFromDatasetIdWithProject() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); DatasetId datasetId = DatasetId.of(OTHER_PROJECT, DATASET); - when(bigqueryRpcMock.getDataset(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( + OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(datasetInfo.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.getDataset(datasetId); assertEquals(new Dataset(bigquery, new DatasetInfo.BuilderImpl(datasetInfo)), dataset); - verify(bigqueryRpcMock).getDataset(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getDatasetSkipExceptionTranslation(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetWithSelectedFields() { - when(bigqueryRpcMock.getDataset(eq(PROJECT), eq(DATASET), capturedOptions.capture())) + public void testGetDatasetWithSelectedFields() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( + eq(PROJECT), eq(DATASET), capturedOptions.capture())) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.getDataset(DATASET, DATASET_OPTION_FIELDS); @@ -662,11 +675,12 @@ public void testGetDatasetWithSelectedFields() { assertEquals(28, selector.length()); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock).getDataset(eq(PROJECT), eq(DATASET), capturedOptions.capture()); + verify(bigqueryRpcMock) + .getDatasetSkipExceptionTranslation(eq(PROJECT), eq(DATASET), capturedOptions.capture()); } @Test - public void testListDatasets() { + public void testListDatasets() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -674,16 +688,17 @@ public void testListDatasets() { new Dataset(bigquery, new DatasetInfo.BuilderImpl(OTHER_DATASET_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(datasetList, DatasetInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listDatasets(PROJECT, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listDatasetsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listDatasets(); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals( datasetList.toArray(), Iterables.toArray(page.getValues(), DatasetInfo.class)); - verify(bigqueryRpcMock).listDatasets(PROJECT, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listDatasetsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS); } @Test - public void testListDatasetsWithProjects() { + public void testListDatasetsWithProjects() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -691,30 +706,32 @@ public void testListDatasetsWithProjects() { bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO.setProjectId(OTHER_PROJECT)))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(datasetList, DatasetInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listDatasets(OTHER_PROJECT, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listDatasetsSkipExceptionTranslation(OTHER_PROJECT, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listDatasets(OTHER_PROJECT); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals( datasetList.toArray(), Iterables.toArray(page.getValues(), DatasetInfo.class)); - verify(bigqueryRpcMock).listDatasets(OTHER_PROJECT, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listDatasetsSkipExceptionTranslation(OTHER_PROJECT, EMPTY_RPC_OPTIONS); } @Test - public void testListEmptyDatasets() { + public void testListEmptyDatasets() throws IOException { ImmutableList datasets = ImmutableList.of(); Tuple> result = Tuple.>of(null, datasets); - when(bigqueryRpcMock.listDatasets(PROJECT, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listDatasetsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS)) + .thenReturn(result); bigquery = options.getService(); Page page = bigquery.listDatasets(); assertNull(page.getNextPageToken()); assertArrayEquals( ImmutableList.of().toArray(), Iterables.toArray(page.getValues(), Dataset.class)); - verify(bigqueryRpcMock).listDatasets(PROJECT, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listDatasetsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS); } @Test - public void testListDatasetsWithOptions() { + public void testListDatasetsWithOptions() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -722,71 +739,85 @@ public void testListDatasetsWithOptions() { new Dataset(bigquery, new DatasetInfo.BuilderImpl(OTHER_DATASET_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(datasetList, DatasetInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listDatasets(PROJECT, DATASET_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listDatasetsSkipExceptionTranslation(PROJECT, DATASET_LIST_OPTIONS)) + .thenReturn(result); Page page = bigquery.listDatasets(DATASET_LIST_ALL, DATASET_LIST_PAGE_TOKEN, DATASET_LIST_PAGE_SIZE); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals( datasetList.toArray(), Iterables.toArray(page.getValues(), DatasetInfo.class)); - verify(bigqueryRpcMock).listDatasets(PROJECT, DATASET_LIST_OPTIONS); + verify(bigqueryRpcMock).listDatasetsSkipExceptionTranslation(PROJECT, DATASET_LIST_OPTIONS); } @Test - public void testDeleteDataset() { - when(bigqueryRpcMock.deleteDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(true); + public void testDeleteDataset() throws IOException { + when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(DATASET)); - verify(bigqueryRpcMock).deleteDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testDeleteDatasetFromDatasetId() { - when(bigqueryRpcMock.deleteDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(true); + public void testDeleteDatasetFromDatasetId() throws IOException { + when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(DatasetId.of(DATASET))); - verify(bigqueryRpcMock).deleteDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testDeleteDatasetFromDatasetIdWithProject() { + public void testDeleteDatasetFromDatasetIdWithProject() throws IOException { DatasetId datasetId = DatasetId.of(OTHER_PROJECT, DATASET); - when(bigqueryRpcMock.deleteDataset(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(true); + when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation( + OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(datasetId)); - verify(bigqueryRpcMock).deleteDataset(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .deleteDatasetSkipExceptionTranslation(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testDeleteDatasetWithOptions() { - when(bigqueryRpcMock.deleteDataset(PROJECT, DATASET, DATASET_DELETE_OPTIONS)).thenReturn(true); + public void testDeleteDatasetWithOptions() throws IOException { + when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation( + PROJECT, DATASET, DATASET_DELETE_OPTIONS)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(DATASET, DATASET_DELETE_CONTENTS)); - verify(bigqueryRpcMock).deleteDataset(PROJECT, DATASET, DATASET_DELETE_OPTIONS); + verify(bigqueryRpcMock) + .deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, DATASET_DELETE_OPTIONS); } @Test - public void testUpdateDataset() { + public void testUpdateDataset() throws IOException { DatasetInfo updatedDatasetInfo = DATASET_INFO .setProjectId(OTHER_PROJECT) .toBuilder() .setDescription("newDescription") .build(); - when(bigqueryRpcMock.patch(updatedDatasetInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.patchSkipExceptionTranslation( + updatedDatasetInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(updatedDatasetInfo.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.update(updatedDatasetInfo); assertEquals(new Dataset(bigquery, new DatasetInfo.BuilderImpl(updatedDatasetInfo)), dataset); - verify(bigqueryRpcMock).patch(updatedDatasetInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .patchSkipExceptionTranslation(updatedDatasetInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testUpdateDatasetWithSelectedFields() { + public void testUpdateDatasetWithSelectedFields() throws IOException { DatasetInfo updatedDatasetInfo = DATASET_INFO.toBuilder().setDescription("newDescription").build(); DatasetInfo updatedDatasetInfoWithProject = DATASET_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); - when(bigqueryRpcMock.patch(eq(updatedDatasetInfoWithProject.toPb()), capturedOptions.capture())) + when(bigqueryRpcMock.patchSkipExceptionTranslation( + eq(updatedDatasetInfoWithProject.toPb()), capturedOptions.capture())) .thenReturn(updatedDatasetInfoWithProject.toPb()); bigquery = options.getService(); Dataset dataset = bigquery.update(updatedDatasetInfo, DATASET_OPTION_FIELDS); @@ -798,23 +829,25 @@ public void testUpdateDatasetWithSelectedFields() { assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(updatedDatasetInfoWithProject)), dataset); verify(bigqueryRpcMock) - .patch(eq(updatedDatasetInfoWithProject.toPb()), capturedOptions.capture()); + .patchSkipExceptionTranslation( + eq(updatedDatasetInfoWithProject.toPb()), capturedOptions.capture()); } @Test - public void testCreateTable() { + public void testCreateTable() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.create(tableInfo.toPb(), EMPTY_RPC_OPTIONS)).thenReturn(tableInfo.toPb()); + when(bigqueryRpcMock.createSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS)) + .thenReturn(tableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.create(tableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table); - verify(bigqueryRpcMock).create(tableInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).createSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void tesCreateExternalTable() { + public void tesCreateExternalTable() throws IOException { TableInfo createTableInfo = TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) .setProjectId(OTHER_PROJECT); @@ -822,32 +855,34 @@ public void tesCreateExternalTable() { com.google.api.services.bigquery.model.Table expectedCreateInput = createTableInfo.toPb().setSchema(TABLE_SCHEMA.toPb()); expectedCreateInput.getExternalDataConfiguration().setSchema(null); - when(bigqueryRpcMock.create(expectedCreateInput, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.createSkipExceptionTranslation(expectedCreateInput, EMPTY_RPC_OPTIONS)) .thenReturn(createTableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.create(createTableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(createTableInfo)), table); - verify(bigqueryRpcMock).create(expectedCreateInput, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).createSkipExceptionTranslation(expectedCreateInput, EMPTY_RPC_OPTIONS); } @Test - public void testCreateTableWithoutProject() { + public void testCreateTableWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); tableInfo.toBuilder().setTableId(tableId); - when(bigqueryRpcMock.create(tableInfo.toPb(), EMPTY_RPC_OPTIONS)).thenReturn(tableInfo.toPb()); + when(bigqueryRpcMock.createSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS)) + .thenReturn(tableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.create(tableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table); - verify(bigqueryRpcMock).create(tableInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).createSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testCreateTableWithSelectedFields() { - when(bigqueryRpcMock.create(eq(TABLE_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) + public void testCreateTableWithSelectedFields() throws IOException { + when(bigqueryRpcMock.createSkipExceptionTranslation( + eq(TABLE_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Table table = bigquery.create(TABLE_INFO, TABLE_OPTION_FIELDS); @@ -857,34 +892,40 @@ public void testCreateTableWithSelectedFields() { assertTrue(selector.contains("etag")); assertEquals(31, selector.length()); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PROJECT)), table); - verify(bigqueryRpcMock).create(eq(TABLE_INFO_WITH_PROJECT.toPb()), capturedOptions.capture()); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation( + eq(TABLE_INFO_WITH_PROJECT.toPb()), capturedOptions.capture()); } @Test - public void testGetTable() { - when(bigqueryRpcMock.getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + public void testGetTable() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Table table = bigquery.getTable(DATASET, TABLE); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PROJECT)), table); - verify(bigqueryRpcMock).getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetModel() { - when(bigqueryRpcMock.getModel(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) + public void testGetModel() throws IOException { + when(bigqueryRpcMock.getModelSkipExceptionTranslation( + PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) .thenReturn(MODEL_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Model model = bigquery.getModel(DATASET, MODEL); assertEquals(new Model(bigquery, new ModelInfo.BuilderImpl(MODEL_INFO_WITH_PROJECT)), model); - verify(bigqueryRpcMock).getModel(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getModelSkipExceptionTranslation(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS); } @Test - public void testGetModelNotFoundWhenThrowIsEnabled() { + public void testGetModelNotFoundWhenThrowIsEnabled() throws IOException { String expected = "Model not found"; - when(bigqueryRpcMock.getModel(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) - .thenReturn(null) + when(bigqueryRpcMock.getModelSkipExceptionTranslation( + PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, expected)); options.setThrowNotFound(true); bigquery = options.getService(); @@ -893,39 +934,45 @@ public void testGetModelNotFoundWhenThrowIsEnabled() { } catch (BigQueryException ex) { assertEquals(expected, ex.getMessage()); } - verify(bigqueryRpcMock).getModel(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getModelSkipExceptionTranslation(PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS); } @Test - public void testListPartition() { - when(bigqueryRpcMock.getTable( + public void testListPartition() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, "table$__PARTITIONS_SUMMARY__", EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_PARTITIONS.toPb()); - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_WITH_PARTITIONS); bigquery = options.getService(); List partition = bigquery.listPartitions(TABLE_ID_WITH_PROJECT); assertEquals(3, partition.size()); verify(bigqueryRpcMock) - .getTable(PROJECT, DATASET, "table$__PARTITIONS_SUMMARY__", EMPTY_RPC_OPTIONS); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + .getTableSkipExceptionTranslation( + PROJECT, DATASET, "table$__PARTITIONS_SUMMARY__", EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetTableNotFoundWhenThrowIsDisabled() { - when(bigqueryRpcMock.getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + public void testGetTableNotFoundWhenThrowIsDisabled() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); options.setThrowNotFound(false); bigquery = options.getService(); Table table = bigquery.getTable(DATASET, TABLE); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PROJECT)), table); - verify(bigqueryRpcMock).getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetTableNotFoundWhenThrowIsEnabled() { - when(bigqueryRpcMock.getTable(PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS)) - .thenReturn(null) + public void testGetTableNotFoundWhenThrowIsEnabled() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Table not found")); options.setThrowNotFound(true); bigquery = options.getService(); @@ -935,49 +982,57 @@ public void testGetTableNotFoundWhenThrowIsEnabled() { } catch (BigQueryException ex) { Assert.assertNotNull(ex.getMessage()); } - verify(bigqueryRpcMock).getTable(PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS); } @Test - public void testGetTableFromTableId() { - when(bigqueryRpcMock.getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + public void testGetTableFromTableId() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Table table = bigquery.getTable(TABLE_ID); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PROJECT)), table); - verify(bigqueryRpcMock).getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetTableFromTableIdWithProject() { + public void testGetTableFromTableIdWithProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT); TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.getTable(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(tableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.getTable(tableId); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table); - verify(bigqueryRpcMock).getTable(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetTableFromTableIdWithoutProject() { + public void testGetTableFromTableIdWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); - when(bigqueryRpcMock.getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(tableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.getTable(tableId); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table); - verify(bigqueryRpcMock).getTable(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getTableSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testGetTableWithSelectedFields() { - when(bigqueryRpcMock.getTable(eq(PROJECT), eq(DATASET), eq(TABLE), capturedOptions.capture())) + public void testGetTableWithSelectedFields() throws IOException { + when(bigqueryRpcMock.getTableSkipExceptionTranslation( + eq(PROJECT), eq(DATASET), eq(TABLE), capturedOptions.capture())) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); Table table = bigquery.getTable(TABLE_ID, TABLE_OPTION_FIELDS); @@ -988,11 +1043,12 @@ public void testGetTableWithSelectedFields() { assertEquals(31, selector.length()); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PROJECT)), table); verify(bigqueryRpcMock) - .getTable(eq(PROJECT), eq(DATASET), eq(TABLE), capturedOptions.capture()); + .getTableSkipExceptionTranslation( + eq(PROJECT), eq(DATASET), eq(TABLE), capturedOptions.capture()); } @Test - public void testListTables() { + public void testListTables() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1001,60 +1057,67 @@ public void testListTables() { new Table(bigquery, new TableInfo.BuilderImpl(MODEL_TABLE_INFO_WITH_PROJECT))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DATASET); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testListTablesReturnedParameters() { + public void testListTablesReturnedParameters() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PARTITIONS))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DATASET, TABLE_LIST_PAGE_SIZE, TABLE_LIST_PAGE_TOKEN); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS); } @Test - public void testListTablesReturnedParametersNullType() { + public void testListTablesReturnedParametersNullType() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_WITH_PARTITIONS_NULL_TYPE))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DATASET, TABLE_LIST_PAGE_SIZE, TABLE_LIST_PAGE_TOKEN); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS); } @Test - public void testListTablesWithRangePartitioning() { + public void testListTablesWithRangePartitioning() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO_RANGE_PARTITIONING))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DATASET, TABLE_LIST_PAGE_SIZE, TABLE_LIST_PAGE_TOKEN); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS); } @Test - public void testListTablesFromDatasetId() { + public void testListTablesFromDatasetId() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1062,30 +1125,34 @@ public void testListTablesFromDatasetId() { new Table(bigquery, new TableInfo.BuilderImpl(OTHER_TABLE_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DatasetId.of(DATASET)); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testListTablesFromDatasetIdWithProject() { + public void testListTablesFromDatasetIdWithProject() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO.setProjectId(OTHER_PROJECT)))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation( + OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DatasetId.of(OTHER_PROJECT, DATASET)); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listTablesSkipExceptionTranslation(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testListTablesWithOptions() { + public void testListTablesWithOptions() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1093,15 +1160,17 @@ public void testListTablesWithOptions() { new Table(bigquery, new TableInfo.BuilderImpl(OTHER_TABLE_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS)) + .thenReturn(result); Page
    page = bigquery.listTables(DATASET, TABLE_LIST_PAGE_SIZE, TABLE_LIST_PAGE_TOKEN); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); - verify(bigqueryRpcMock).listTables(PROJECT, DATASET, TABLE_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTablesSkipExceptionTranslation(PROJECT, DATASET, TABLE_LIST_OPTIONS); } @Test - public void testListModels() { + public void testListModels() throws IOException { bigquery = options.getService(); ImmutableList modelList = ImmutableList.of( @@ -1109,15 +1178,16 @@ public void testListModels() { new Model(bigquery, new ModelInfo.BuilderImpl(OTHER_MODEL_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(modelList, ModelInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listModels(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listModelsSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listModels(DATASET); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(modelList.toArray(), Iterables.toArray(page.getValues(), Model.class)); - verify(bigqueryRpcMock).listModels(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listModelsSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testListModelsWithModelId() { + public void testListModelsWithModelId() throws IOException { bigquery = options.getService(); ImmutableList modelList = ImmutableList.of( @@ -1125,92 +1195,100 @@ public void testListModelsWithModelId() { new Model(bigquery, new ModelInfo.BuilderImpl(OTHER_MODEL_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(modelList, ModelInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listModels(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listModelsSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listModels(DatasetId.of(DATASET)); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(modelList.toArray(), Iterables.toArray(page.getValues(), Model.class)); - verify(bigqueryRpcMock).listModels(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listModelsSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testDeleteTable() { - when(bigqueryRpcMock.deleteTable(PROJECT, DATASET, TABLE)).thenReturn(true); + public void testDeleteTable() throws IOException { + when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(TABLE_ID)); - verify(bigqueryRpcMock).deleteTable(PROJECT, DATASET, TABLE); + verify(bigqueryRpcMock).deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE); } @Test - public void testDeleteTableFromTableId() { - when(bigqueryRpcMock.deleteTable(PROJECT, DATASET, TABLE)).thenReturn(true); + public void testDeleteTableFromTableId() throws IOException { + when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(TABLE_ID)); - verify(bigqueryRpcMock).deleteTable(PROJECT, DATASET, TABLE); + verify(bigqueryRpcMock).deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE); } @Test - public void testDeleteTableFromTableIdWithProject() { + public void testDeleteTableFromTableIdWithProject() throws IOException { TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.deleteTable(OTHER_PROJECT, DATASET, TABLE)).thenReturn(true); + when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE)) + .thenReturn(true); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); assertTrue(bigquery.delete(tableId)); - verify(bigqueryRpcMock).deleteTable(OTHER_PROJECT, DATASET, TABLE); + verify(bigqueryRpcMock).deleteTableSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE); } @Test - public void testDeleteTableFromTableIdWithoutProject() { + public void testDeleteTableFromTableIdWithoutProject() throws IOException { TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); - when(bigqueryRpcMock.deleteTable(PROJECT, DATASET, TABLE)).thenReturn(true); + when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) + .thenReturn(true); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); assertTrue(bigquery.delete(tableId)); - verify(bigqueryRpcMock).deleteTable(PROJECT, DATASET, TABLE); + verify(bigqueryRpcMock).deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE); } @Test - public void testDeleteModel() { - when(bigqueryRpcMock.deleteModel(PROJECT, DATASET, MODEL)).thenReturn(true); + public void testDeleteModel() throws IOException { + when(bigqueryRpcMock.deleteModelSkipExceptionTranslation(PROJECT, DATASET, MODEL)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(ModelId.of(DATASET, MODEL))); - verify(bigqueryRpcMock).deleteModel(PROJECT, DATASET, MODEL); + verify(bigqueryRpcMock).deleteModelSkipExceptionTranslation(PROJECT, DATASET, MODEL); } @Test - public void testUpdateModel() { + public void testUpdateModel() throws IOException { ModelInfo updateModelInfo = MODEL_INFO_WITH_PROJECT .setProjectId(OTHER_PROJECT) .toBuilder() .setDescription("newDescription") .build(); - when(bigqueryRpcMock.patch(updateModelInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.patchSkipExceptionTranslation(updateModelInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(updateModelInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Model actualModel = bigquery.update(updateModelInfo); assertEquals(new Model(bigquery, new ModelInfo.BuilderImpl(updateModelInfo)), actualModel); - verify(bigqueryRpcMock).patch(updateModelInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .patchSkipExceptionTranslation(updateModelInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testUpdateTable() { + public void testUpdateTable() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT).toBuilder().setDescription("newDescription").build(); - when(bigqueryRpcMock.patch(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.patchSkipExceptionTranslation(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(updatedTableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.update(updatedTableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfo)), table); - verify(bigqueryRpcMock).patch(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .patchSkipExceptionTranslation(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testUpdateExternalTableWithNewSchema() { + public void testUpdateExternalTableWithNewSchema() throws IOException { TableInfo updatedTableInfo = TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) .setProjectId(OTHER_PROJECT); @@ -1218,35 +1296,37 @@ public void testUpdateExternalTableWithNewSchema() { com.google.api.services.bigquery.model.Table expectedPatchInput = updatedTableInfo.toPb().setSchema(TABLE_SCHEMA.toPb()); expectedPatchInput.getExternalDataConfiguration().setSchema(null); - when(bigqueryRpcMock.patch(expectedPatchInput, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.patchSkipExceptionTranslation(expectedPatchInput, EMPTY_RPC_OPTIONS)) .thenReturn(updatedTableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.update(updatedTableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfo)), table); - verify(bigqueryRpcMock).patch(expectedPatchInput, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).patchSkipExceptionTranslation(expectedPatchInput, EMPTY_RPC_OPTIONS); } @Test - public void testUpdateTableWithoutProject() { + public void testUpdateTableWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); tableInfo.toBuilder().setTableId(tableId); - when(bigqueryRpcMock.patch(tableInfo.toPb(), EMPTY_RPC_OPTIONS)).thenReturn(tableInfo.toPb()); + when(bigqueryRpcMock.patchSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS)) + .thenReturn(tableInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Table table = bigquery.update(tableInfo); assertEquals(new Table(bigquery, new TableInfo.BuilderImpl(tableInfo)), table); - verify(bigqueryRpcMock).patch(tableInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).patchSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testUpdateTableWithSelectedFields() { + public void testUpdateTableWithSelectedFields() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.toBuilder().setDescription("newDescription").build(); TableInfo updatedTableInfoWithProject = TABLE_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); - when(bigqueryRpcMock.patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture())) + when(bigqueryRpcMock.patchSkipExceptionTranslation( + eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture())) .thenReturn(updatedTableInfoWithProject.toPb()); bigquery = options.getService(); Table table = bigquery.update(updatedTableInfo, TABLE_OPTION_FIELDS); @@ -1258,15 +1338,17 @@ public void testUpdateTableWithSelectedFields() { assertEquals( new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfoWithProject)), table); verify(bigqueryRpcMock) - .patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); + .patchSkipExceptionTranslation( + eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); } @Test - public void testUpdateTableWithAutoDetectSchema() { + public void testUpdateTableWithAutoDetectSchema() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.toBuilder().setDescription("newDescription").build(); TableInfo updatedTableInfoWithProject = TABLE_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); - when(bigqueryRpcMock.patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture())) + when(bigqueryRpcMock.patchSkipExceptionTranslation( + eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture())) .thenReturn(updatedTableInfoWithProject.toPb()); bigquery = options.getService(); Table table = bigquery.update(updatedTableInfo, BigQuery.TableOption.autodetectSchema(true)); @@ -1276,11 +1358,12 @@ public void testUpdateTableWithAutoDetectSchema() { assertEquals( new Table(bigquery, new TableInfo.BuilderImpl(updatedTableInfoWithProject)), table); verify(bigqueryRpcMock) - .patch(eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); + .patchSkipExceptionTranslation( + eq(updatedTableInfoWithProject.toPb()), capturedOptions.capture()); } @Test - public void testInsertAllWithRowIdShouldRetry() { + public void testInsertAllWithRowIdShouldRetry() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1315,7 +1398,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); - when(bigqueryRpcMock.insertAll(PROJECT, DATASET, TABLE, requestPb)) + when(bigqueryRpcMock.insertAllSkipExceptionTranslation(PROJECT, DATASET, TABLE, requestPb)) .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(responsePb); bigquery = @@ -1329,7 +1412,8 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { assertNull(response.getErrorsFor(1L)); assertEquals(1, response.getErrorsFor(0L).size()); assertEquals("ErrorMessage", response.getErrorsFor(0L).get(0).getMessage()); - verify(bigqueryRpcMock, times(2)).insertAll(PROJECT, DATASET, TABLE, requestPb); + verify(bigqueryRpcMock, times(2)) + .insertAllSkipExceptionTranslation(PROJECT, DATASET, TABLE, requestPb); } @Test @@ -1378,7 +1462,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { } @Test - public void testInsertAllWithProject() { + public void testInsertAllWithProject() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1414,7 +1498,8 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); - when(bigqueryRpcMock.insertAll(OTHER_PROJECT, DATASET, TABLE, requestPb)) + when(bigqueryRpcMock.insertAllSkipExceptionTranslation( + OTHER_PROJECT, DATASET, TABLE, requestPb)) .thenReturn(responsePb); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); @@ -1424,11 +1509,12 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { assertNull(response.getErrorsFor(1L)); assertEquals(1, response.getErrorsFor(0L).size()); assertEquals("ErrorMessage", response.getErrorsFor(0L).get(0).getMessage()); - verify(bigqueryRpcMock).insertAll(OTHER_PROJECT, DATASET, TABLE, requestPb); + verify(bigqueryRpcMock) + .insertAllSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE, requestPb); } @Test - public void testInsertAllWithProjectInTable() { + public void testInsertAllWithProjectInTable() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1464,7 +1550,8 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { new TableDataInsertAllResponse.InsertErrors() .setIndex(0L) .setErrors(ImmutableList.of(new ErrorProto().setMessage("ErrorMessage"))))); - when(bigqueryRpcMock.insertAll("project-different-from-option", DATASET, TABLE, requestPb)) + when(bigqueryRpcMock.insertAllSkipExceptionTranslation( + "project-different-from-option", DATASET, TABLE, requestPb)) .thenReturn(responsePb); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); @@ -1474,47 +1561,56 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { assertNull(response.getErrorsFor(1L)); assertEquals(1, response.getErrorsFor(0L).size()); assertEquals("ErrorMessage", response.getErrorsFor(0L).get(0).getMessage()); - verify(bigqueryRpcMock).insertAll("project-different-from-option", DATASET, TABLE, requestPb); + verify(bigqueryRpcMock) + .insertAllSkipExceptionTranslation( + "project-different-from-option", DATASET, TABLE, requestPb); } @Test - public void testListTableData() { - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + public void testListTableData() throws IOException { + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_PB); bigquery = options.getService(); Page page = bigquery.listTableData(DATASET, TABLE); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class)); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testListTableDataFromTableId() { - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + public void testListTableDataFromTableId() throws IOException { + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_PB); bigquery = options.getService(); Page page = bigquery.listTableData(TableId.of(DATASET, TABLE)); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class)); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testListTableDataFromTableIdWithProject() { + public void testListTableDataFromTableIdWithProject() throws IOException { TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.listTableData(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_PB); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Page page = bigquery.listTableData(tableId); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class)); - verify(bigqueryRpcMock).listTableData(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testListTableDataWithOptions() { - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS)) + public void testListTableDataWithOptions() throws IOException { + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS)) .thenReturn(TABLE_DATA_PB); bigquery = options.getService(); Page page = @@ -1526,14 +1622,15 @@ public void testListTableDataWithOptions() { TABLE_DATA_LIST_START_INDEX); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class)); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); } @Test - public void testListTableDataWithNextPage() { + public void testListTableDataWithNextPage() throws IOException { doReturn(TABLE_DATA_PB) .when(bigqueryRpcMock) - .listTableData(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); bigquery = options.getService(); TableResult page = bigquery.listTableData( @@ -1543,7 +1640,8 @@ public void testListTableDataWithNextPage() { TABLE_DATA_LIST_PAGE_TOKEN, TABLE_DATA_LIST_START_INDEX); assertEquals(CURSOR, page.getNextPageToken()); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); assertArrayEquals(TABLE_DATA.toArray(), Iterables.toArray(page.getValues(), List.class)); Map SECOND_TABLE_DATA_LIST_OPTIONS = ImmutableMap.of(BigQueryRpc.Option.PAGE_TOKEN, CURSOR, BigQueryRpc.Option.START_INDEX, 0L); @@ -1556,11 +1654,14 @@ public void testListTableDataWithNextPage() { new TableRow().setF(ImmutableList.of(new TableCell().setV("Value3"))), new TableRow().setF(ImmutableList.of(new TableCell().setV("Value4")))))) .when(bigqueryRpcMock) - .listTableData(PROJECT, DATASET, TABLE, SECOND_TABLE_DATA_LIST_OPTIONS); + .listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, SECOND_TABLE_DATA_LIST_OPTIONS); assertTrue(page.hasNextPage()); page = page.getNextPage(); assertNull(page.getNextPageToken()); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, SECOND_TABLE_DATA_LIST_OPTIONS); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, SECOND_TABLE_DATA_LIST_OPTIONS); } // The "minimally initialized" Job that lets Job.fromPb run without throwing. @@ -1572,23 +1673,47 @@ private static com.google.api.services.bigquery.model.Job newJobPb() { } @Test - public void testCreateJobSuccess() { + public void testCreateJobSuccess() throws IOException { String id = "testCreateJobSuccess-id"; JobId jobId = JobId.of(id); String query = "SELECT * in FOO"; - when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenReturn(newJobPb()); bigquery = options.getService(); assertThat(bigquery.create(JobInfo.of(jobId, QueryJobConfiguration.of(query)))).isNotNull(); assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); - verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } @Test - public void testCreateJobFailureShouldRetry() { - when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + public void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws IOException { + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + .thenThrow(new UnknownHostException()) + .thenThrow(new ConnectException()) + .thenReturn(newJobPb()); + + bigquery = options.getService(); + bigquery = + options + .toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService(); + + ((BigQueryImpl) bigquery).create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY)); + verify(bigqueryRpcMock, times(3)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + } + + @Test + public void testCreateJobFailureShouldRetry() throws IOException { + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -1607,11 +1732,12 @@ public void testCreateJobFailureShouldRetry() { .getService(); ((BigQueryImpl) bigquery).create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY)); - verify(bigqueryRpcMock, times(6)).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock, times(6)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } @Test - public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() { + public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() throws IOException { // Validate create job with BigQueryRetryConfig that retries on rate limit error message. JobOption bigQueryRetryConfigOption = JobOption.bigQueryRetryConfig( @@ -1622,7 +1748,8 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() { .build()); Map bigQueryRpcOptions = optionMap(bigQueryRetryConfigOption); - when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(bigQueryRpcOptions))) .thenThrow( new BigQueryException( 400, RATE_LIMIT_ERROR_MSG)) // retrial on based on RATE_LIMIT_EXCEEDED_MSG @@ -1639,19 +1766,27 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() { ((BigQueryImpl) bigquery) .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), bigQueryRetryConfigOption); - verify(bigqueryRpcMock, times(3)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + verify(bigqueryRpcMock, times(3)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(bigQueryRpcOptions)); } @Test - public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() { + public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws IOException { // Validate create job with BigQueryRetryConfig that does not retry on rate limit error message. JobOption bigQueryRetryConfigOption = JobOption.bigQueryRetryConfig(BigQueryRetryConfig.newBuilder().build()); Map bigQueryRpcOptions = optionMap(bigQueryRetryConfigOption); - when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(bigQueryRpcOptions))) .thenThrow(new BigQueryException(400, RATE_LIMIT_ERROR_MSG)); + // Job create will attempt to retrieve the job even in the case when the job is created in a + // returned failure. + when(bigqueryRpcMock.getJobSkipExceptionTranslation( + nullable(String.class), nullable(String.class), nullable(String.class), Mockito.any())) + .thenThrow(new BigQueryException(500, "InternalError")); + bigquery = options.getService(); bigquery = options @@ -1669,15 +1804,17 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() { } // Verify that getQueryResults is attempted only once and not retried since the error message // does not match. - verify(bigqueryRpcMock, times(1)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + verify(bigqueryRpcMock, times(1)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(bigQueryRpcOptions)); } @Test - public void testCreateJobWithRetryOptionsFailureShouldRetry() { + public void testCreateJobWithRetryOptionsFailureShouldRetry() throws IOException { // Validate create job with RetryOptions. JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(4)); Map bigQueryRpcOptions = optionMap(retryOptions); - when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(bigQueryRpcOptions))) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -1693,18 +1830,26 @@ public void testCreateJobWithRetryOptionsFailureShouldRetry() { ((BigQueryImpl) bigquery) .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), retryOptions); - verify(bigqueryRpcMock, times(4)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + verify(bigqueryRpcMock, times(4)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(bigQueryRpcOptions)); } @Test - public void testCreateJobWithRetryOptionsFailureShouldNotRetry() { + public void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOException { // Validate create job with RetryOptions that only attempts once (no retry). JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(1)); Map bigQueryRpcOptions = optionMap(retryOptions); - when(bigqueryRpcMock.create(jobCapture.capture(), eq(bigQueryRpcOptions))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(bigQueryRpcOptions))) .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(newJobPb()); + // Job create will attempt to retrieve the job even in the case when the job is created in a + // returned failure. + when(bigqueryRpcMock.getJobSkipExceptionTranslation( + nullable(String.class), nullable(String.class), nullable(String.class), Mockito.any())) + .thenThrow(new BigQueryException(500, "InternalError")); + bigquery = options.getService(); bigquery = options @@ -1720,12 +1865,13 @@ public void testCreateJobWithRetryOptionsFailureShouldNotRetry() { } catch (BigQueryException e) { assertNotNull(e.getMessage()); } - verify(bigqueryRpcMock, times(1)).create(jobCapture.capture(), eq(bigQueryRpcOptions)); + verify(bigqueryRpcMock, times(1)) + .createSkipExceptionTranslation(jobCapture.capture(), eq(bigQueryRpcOptions)); } @Test - public void testCreateJobWithSelectedFields() { - when(bigqueryRpcMock.create( + public void testCreateJobWithSelectedFields() throws IOException { + when(bigqueryRpcMock.createSkipExceptionTranslation( any(com.google.api.services.bigquery.model.Job.class), capturedOptions.capture())) .thenReturn(newJobPb()); @@ -1740,16 +1886,18 @@ public void testCreateJobWithSelectedFields() { .asList() .containsExactly("jobReference", "configuration", "user_email"); verify(bigqueryRpcMock) - .create(any(com.google.api.services.bigquery.model.Job.class), capturedOptions.capture()); + .createSkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class), capturedOptions.capture()); } @Test - public void testCreateJobNoGet() { + public void testCreateJobNoGet() throws IOException { String id = "testCreateJobNoGet-id"; JobId jobId = JobId.of(id); String query = "SELECT * in FOO"; - when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow(new BigQueryException(409, "already exists, for some reason")); bigquery = options.getService(); @@ -1759,11 +1907,12 @@ public void testCreateJobNoGet() { } catch (BigQueryException e) { assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); } - verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } @Test - public void testCreateJobTryGet() { + public void testCreateJobTryGet() throws IOException { final String id = "testCreateJobTryGet-id"; String query = "SELECT * in FOO"; Supplier idProvider = @@ -1774,33 +1923,37 @@ public JobId get() { } }; - when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow(new BigQueryException(409, "already exists, for some reason")); - when(bigqueryRpcMock.getJob( + when(bigqueryRpcMock.getJobSkipExceptionTranslation( any(String.class), eq(id), eq((String) null), eq(EMPTY_RPC_OPTIONS))) .thenReturn(newJobPb()); bigquery = options.getService(); ((BigQueryImpl) bigquery).create(JobInfo.of(QueryJobConfiguration.of(query)), idProvider); assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); - verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); verify(bigqueryRpcMock) - .getJob(any(String.class), eq(id), eq((String) null), eq(EMPTY_RPC_OPTIONS)); + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation( + any(String.class), eq(id), eq((String) null), eq(EMPTY_RPC_OPTIONS)); } @Test - public void testCreateJobTryGetNotRandom() { + public void testCreateJobTryGetNotRandom() throws IOException { Map withStatisticOption = optionMap(JobOption.fields(STATISTICS)); final String id = "testCreateJobTryGet-id"; String query = "SELECT * in FOO"; - when(bigqueryRpcMock.create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) + when(bigqueryRpcMock.createSkipExceptionTranslation( + jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow( new BigQueryException( 409, "already exists, for some reason", new RuntimeException("Already Exists: Job"))); - when(bigqueryRpcMock.getJob( + when(bigqueryRpcMock.getJobSkipExceptionTranslation( any(String.class), eq(id), eq((String) null), eq(withStatisticOption))) .thenReturn( newJobPb() @@ -1812,18 +1965,21 @@ public void testCreateJobTryGetNotRandom() { ((BigQueryImpl) bigquery).create(JobInfo.of(JobId.of(id), QueryJobConfiguration.of(query))); assertThat(job).isNotNull(); assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); - verify(bigqueryRpcMock).create(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); verify(bigqueryRpcMock) - .getJob(any(String.class), eq(id), eq((String) null), eq(withStatisticOption)); + .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation( + any(String.class), eq(id), eq((String) null), eq(withStatisticOption)); } @Test - public void testCreateJobWithProjectId() { + public void testCreateJobWithProjectId() throws IOException { JobInfo jobInfo = JobInfo.newBuilder(QUERY_JOB_CONFIGURATION.setProjectId(OTHER_PROJECT)) .setJobId(JobId.of(OTHER_PROJECT, JOB)) .build(); - when(bigqueryRpcMock.create(eq(jobInfo.toPb()), capturedOptions.capture())) + when(bigqueryRpcMock.createSkipExceptionTranslation( + eq(jobInfo.toPb()), capturedOptions.capture())) .thenReturn(jobInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); @@ -1835,46 +1991,58 @@ public void testCreateJobWithProjectId() { assertTrue(selector.contains("configuration")); assertTrue(selector.contains("user_email")); assertEquals(37, selector.length()); - verify(bigqueryRpcMock).create(eq(jobInfo.toPb()), capturedOptions.capture()); + verify(bigqueryRpcMock) + .createSkipExceptionTranslation(eq(jobInfo.toPb()), capturedOptions.capture()); } @Test - public void testGetJob() { - when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + public void testDeleteJob() throws IOException { + JobId jobId = JobId.newBuilder().setJob(JOB).setProject(PROJECT).setLocation(LOCATION).build(); + when(bigqueryRpcMock.deleteJobSkipExceptionTranslation(PROJECT, JOB, LOCATION)) + .thenReturn(true); + bigquery = options.getService(); + assertTrue(bigquery.delete(jobId)); + verify(bigqueryRpcMock).deleteJobSkipExceptionTranslation(PROJECT, JOB, LOCATION); + } + + @Test + public void testGetJob() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); bigquery = options.getService(); Job job = bigquery.getJob(JOB); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(COMPLETE_COPY_JOB)), job); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobWithLocation() { - when(bigqueryRpcMock.getJob(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) + public void testGetJobWithLocation() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); bigquery = options.getService(); Job job = bigquery.getJob(JOB); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(COMPLETE_COPY_JOB)), job); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobNotFoundWhenThrowIsDisabled() { - when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + public void testGetJobNotFoundWhenThrowIsDisabled() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); options.setThrowNotFound(false); bigquery = options.getService(); Job job = bigquery.getJob(JOB); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(COMPLETE_COPY_JOB)), job); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobNotFoundWhenThrowIsEnabled() { - when(bigqueryRpcMock.getJob(PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS)) - .thenReturn(null) - .thenThrow(new BigQueryException(404, "Job not found")); + public void testGetJobNotFoundWhenThrowIsEnabled() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation( + PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS)) + .thenThrow(new IOException("Job not found")); options.setThrowNotFound(true); bigquery = options.getService(); try { @@ -1883,57 +2051,63 @@ public void testGetJobNotFoundWhenThrowIsEnabled() { } catch (BigQueryException ex) { Assert.assertNotNull(ex.getMessage()); } - verify(bigqueryRpcMock).getJob(PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation(PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobFromJobId() { - when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + public void testGetJobFromJobId() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); bigquery = options.getService(); Job job = bigquery.getJob(JobId.of(JOB)); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(COMPLETE_COPY_JOB)), job); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobFromJobIdWithLocation() { - when(bigqueryRpcMock.getJob(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) + public void testGetJobFromJobIdWithLocation() throws IOException { + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); bigquery = options.getService(); Job job = bigquery.getJob(JobId.of(JOB)); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(COMPLETE_COPY_JOB)), job); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobFromJobIdWithProject() { + public void testGetJobFromJobIdWithProject() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); JobInfo jobInfo = COPY_JOB.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.getJob(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getJobSkipExceptionTranslation( + OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(jobInfo.toPb()); bigquery = options.getService(); Job job = bigquery.getJob(jobId); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(jobInfo)), job); - verify(bigqueryRpcMock).getJob(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobFromJobIdWithProjectWithLocation() { + public void testGetJobFromJobIdWithProjectWithLocation() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); JobInfo jobInfo = COPY_JOB.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.getJob(OTHER_PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getJobSkipExceptionTranslation( + OTHER_PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) .thenReturn(jobInfo.toPb()); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); bigquery = options.getService(); Job job = bigquery.getJob(jobId); assertEquals(new Job(bigquery, new JobInfo.BuilderImpl(jobInfo)), job); - verify(bigqueryRpcMock).getJob(OTHER_PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getJobSkipExceptionTranslation(OTHER_PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS); } @Test - public void testListJobs() { + public void testListJobs() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -1950,15 +2124,16 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { return job.toPb(); } })); - when(bigqueryRpcMock.listJobs(PROJECT, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listJobsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listJobs(); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(jobList.toArray(), Iterables.toArray(page.getValues(), Job.class)); - verify(bigqueryRpcMock).listJobs(PROJECT, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).listJobsSkipExceptionTranslation(PROJECT, EMPTY_RPC_OPTIONS); } @Test - public void testListJobsWithOptions() { + public void testListJobsWithOptions() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -1975,17 +2150,18 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { return job.toPb(); } })); - when(bigqueryRpcMock.listJobs(PROJECT, JOB_LIST_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listJobsSkipExceptionTranslation(PROJECT, JOB_LIST_OPTIONS)) + .thenReturn(result); Page page = bigquery.listJobs( JOB_LIST_ALL_USERS, JOB_LIST_STATE_FILTER, JOB_LIST_PAGE_TOKEN, JOB_LIST_PAGE_SIZE); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(jobList.toArray(), Iterables.toArray(page.getValues(), Job.class)); - verify(bigqueryRpcMock).listJobs(PROJECT, JOB_LIST_OPTIONS); + verify(bigqueryRpcMock).listJobsSkipExceptionTranslation(PROJECT, JOB_LIST_OPTIONS); } @Test - public void testListJobsWithSelectedFields() { + public void testListJobsWithSelectedFields() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -2002,7 +2178,8 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { return job.toPb(); } })); - when(bigqueryRpcMock.listJobs(eq(PROJECT), capturedOptions.capture())).thenReturn(result); + when(bigqueryRpcMock.listJobsSkipExceptionTranslation(eq(PROJECT), capturedOptions.capture())) + .thenReturn(result); Page page = bigquery.listJobs(JOB_LIST_OPTION_FIELD); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(jobList.toArray(), Iterables.toArray(page.getValues(), Job.class)); @@ -2015,36 +2192,37 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { assertTrue(selector.contains("errorResult")); assertTrue(selector.contains(")")); assertEquals(75, selector.length()); - verify(bigqueryRpcMock).listJobs(eq(PROJECT), capturedOptions.capture()); + verify(bigqueryRpcMock) + .listJobsSkipExceptionTranslation(eq(PROJECT), capturedOptions.capture()); } @Test - public void testCancelJob() { - when(bigqueryRpcMock.cancel(PROJECT, JOB, null)).thenReturn(true); + public void testCancelJob() throws IOException { + when(bigqueryRpcMock.cancelSkipExceptionTranslation(PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.cancel(JOB)); - verify(bigqueryRpcMock).cancel(PROJECT, JOB, null); + verify(bigqueryRpcMock).cancelSkipExceptionTranslation(PROJECT, JOB, null); } @Test - public void testCancelJobFromJobId() { - when(bigqueryRpcMock.cancel(PROJECT, JOB, null)).thenReturn(true); + public void testCancelJobFromJobId() throws IOException { + when(bigqueryRpcMock.cancelSkipExceptionTranslation(PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.cancel(JobId.of(PROJECT, JOB))); - verify(bigqueryRpcMock).cancel(PROJECT, JOB, null); + verify(bigqueryRpcMock).cancelSkipExceptionTranslation(PROJECT, JOB, null); } @Test - public void testCancelJobFromJobIdWithProject() { + public void testCancelJobFromJobIdWithProject() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); - when(bigqueryRpcMock.cancel(OTHER_PROJECT, JOB, null)).thenReturn(true); + when(bigqueryRpcMock.cancelSkipExceptionTranslation(OTHER_PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.cancel(jobId)); - verify(bigqueryRpcMock).cancel(OTHER_PROJECT, JOB, null); + verify(bigqueryRpcMock).cancelSkipExceptionTranslation(OTHER_PROJECT, JOB, null); } @Test - public void testQueryRequestCompleted() throws InterruptedException { + public void testQueryRequestCompleted() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb = new com.google.api.services.bigquery.model.Job() @@ -2064,13 +2242,13 @@ public void testQueryRequestCompleted() throws InterruptedException { .setTotalRows(BigInteger.valueOf(1L)) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.create( + when(bigqueryRpcMock.createSkipExceptionTranslation( JOB_INFO.toPb(), Collections.emptyMap())) .thenReturn(jobResponsePb); - when(bigqueryRpcMock.getQueryResults( + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb); - when(bigqueryRpcMock.listTableData( + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, Collections.emptyMap())) .thenReturn( new TableDataList() @@ -2087,16 +2265,19 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) assertThat(row.get(1).getLongValue()).isEqualTo(1); } verify(bigqueryRpcMock) - .create(JOB_INFO.toPb(), Collections.emptyMap()); + .createSkipExceptionTranslation( + JOB_INFO.toPb(), Collections.emptyMap()); verify(bigqueryRpcMock) - .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) - .listTableData(PROJECT, DATASET, TABLE, Collections.emptyMap()); + .listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, Collections.emptyMap()); } @Test - public void testFastQueryRequestCompleted() throws InterruptedException { + public void testFastQueryRequestCompleted() throws InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse queryResponsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2108,7 +2289,7 @@ public void testFastQueryRequestCompleted() throws InterruptedException { .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenReturn(queryResponsePb); bigquery = options.getService(); @@ -2131,11 +2312,12 @@ public void testFastQueryRequestCompleted() throws InterruptedException { assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); assertNull(requestPb.getLocation()); - verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test - public void testFastQueryRequestCompletedWithLocation() throws InterruptedException { + public void testFastQueryRequestCompletedWithLocation() throws InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse queryResponsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2147,7 +2329,7 @@ public void testFastQueryRequestCompletedWithLocation() throws InterruptedExcept .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenReturn(queryResponsePb); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); @@ -2171,11 +2353,12 @@ public void testFastQueryRequestCompletedWithLocation() throws InterruptedExcept assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); assertEquals(LOCATION, requestPb.getLocation()); - verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test - public void testFastQueryMultiplePages() throws InterruptedException { + public void testFastQueryMultiplePages() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job responseJob = new com.google.api.services.bigquery.model.Job() @@ -2184,8 +2367,9 @@ public void testFastQueryMultiplePages() throws InterruptedException { .setId(JOB) .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")); responseJob.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb()); - when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)).thenReturn(responseJob); - when(bigqueryRpcMock.listTableData( + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + .thenReturn(responseJob); + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR)))) .thenReturn( new TableDataList() @@ -2205,7 +2389,7 @@ PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenReturn(queryResponsePb); bigquery = options.getService(); @@ -2221,15 +2405,16 @@ PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR requestPb.getDefaultDataset().getDatasetId()); assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); verify(bigqueryRpcMock) - .listTableData( + .listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR))); - verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test - public void testFastQuerySlowDdl() throws InterruptedException { + public void testFastQuerySlowDdl() throws InterruptedException, IOException { // mock new fast query path response when running a query that takes more than 10s JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.QueryResponse queryResponsePb = @@ -2256,14 +2441,16 @@ public void testFastQuerySlowDdl() throws InterruptedException { .setTotalRows(BigInteger.valueOf(1L)) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenReturn(queryResponsePb); responseJob.getConfiguration().getQuery().setDestinationTable(TABLE_ID.toPb()); - when(bigqueryRpcMock.getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)).thenReturn(responseJob); - when(bigqueryRpcMock.getQueryResults( + when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + .thenReturn(responseJob); + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(queryResultsResponsePb); - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(new TableDataList().setRows(ImmutableList.of(TABLE_ROW)).setTotalRows(1L)); bigquery = options.getService(); @@ -2282,15 +2469,18 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) requestPb.getDefaultDataset().getDatasetId()); assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); - verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); - verify(bigqueryRpcMock).getJob(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); verify(bigqueryRpcMock) - .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock).getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + verify(bigqueryRpcMock) + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS); } @Test - public void testQueryRequestCompletedOptions() throws InterruptedException { + public void testQueryRequestCompletedOptions() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb = new com.google.api.services.bigquery.model.Job() @@ -2310,7 +2500,7 @@ public void testQueryRequestCompletedOptions() throws InterruptedException { .setTotalRows(BigInteger.valueOf(1L)) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.create( + when(bigqueryRpcMock.createSkipExceptionTranslation( JOB_INFO.toPb(), Collections.emptyMap())) .thenReturn(jobResponsePb); @@ -2318,10 +2508,10 @@ public void testQueryRequestCompletedOptions() throws InterruptedException { QueryResultsOption pageSizeOption = QueryResultsOption.pageSize(42L); optionMap.put(pageSizeOption.getRpcOption(), pageSizeOption.getValue()); - when(bigqueryRpcMock.getQueryResults( + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb); - when(bigqueryRpcMock.listTableData(PROJECT, DATASET, TABLE, optionMap)) + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, optionMap)) .thenReturn( new TableDataList() .setPageToken("") @@ -2338,14 +2528,17 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) assertThat(row.get(1).getLongValue()).isEqualTo(1); } verify(bigqueryRpcMock) - .create(JOB_INFO.toPb(), Collections.emptyMap()); + .createSkipExceptionTranslation( + JOB_INFO.toPb(), Collections.emptyMap()); + verify(bigqueryRpcMock) + .getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) - .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); - verify(bigqueryRpcMock).listTableData(PROJECT, DATASET, TABLE, optionMap); + .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, optionMap); } @Test - public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedException { + public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb1 = new com.google.api.services.bigquery.model.Job() @@ -2370,16 +2563,16 @@ public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedExcepti .setTotalRows(BigInteger.valueOf(1L)) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.create( + when(bigqueryRpcMock.createSkipExceptionTranslation( JOB_INFO.toPb(), Collections.emptyMap())) .thenReturn(jobResponsePb1); - when(bigqueryRpcMock.getQueryResults( + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb1); - when(bigqueryRpcMock.getQueryResults( + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) .thenReturn(responsePb2); - when(bigqueryRpcMock.listTableData( + when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, Collections.emptyMap())) .thenReturn( new TableDataList() @@ -2396,17 +2589,21 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) assertThat(row.get(1).getLongValue()).isEqualTo(1); } verify(bigqueryRpcMock) - .create(JOB_INFO.toPb(), Collections.emptyMap()); + .createSkipExceptionTranslation( + JOB_INFO.toPb(), Collections.emptyMap()); verify(bigqueryRpcMock) - .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) - .getQueryResults(PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); + .getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS)); verify(bigqueryRpcMock) - .listTableData(PROJECT, DATASET, TABLE, Collections.emptyMap()); + .listTableDataSkipExceptionTranslation( + PROJECT, DATASET, TABLE, Collections.emptyMap()); } @Test - public void testGetQueryResults() { + public void testGetQueryResults() throws IOException { JobId queryJob = JobId.of(JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2418,17 +2615,19 @@ public void testGetQueryResults() { .setPageToken(CURSOR) .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(responsePb); bigquery = options.getService(); QueryResponse response = bigquery.getQueryResults(queryJob); assertEquals(true, response.getCompleted()); assertEquals(null, response.getSchema()); - verify(bigqueryRpcMock).getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getQueryResultsSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetQueryResultsRetry() { + public void testGetQueryResultsRetry() throws IOException { JobId queryJob = JobId.of(JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2441,7 +2640,8 @@ public void testGetQueryResultsRetry() { .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -2467,11 +2667,12 @@ public void testGetQueryResultsRetry() { // EMPTY_RPC_OPTIONS) as there is no // identifier in this method which will can potentially differ and which can be used to // establish idempotency - verify(bigqueryRpcMock, times(6)).getQueryResults(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock, times(6)) + .getQueryResultsSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetQueryResultsWithProject() { + public void testGetQueryResultsWithProject() throws IOException { JobId queryJob = JobId.of(OTHER_PROJECT, JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2483,17 +2684,19 @@ public void testGetQueryResultsWithProject() { .setPageToken(CURSOR) .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.getQueryResults(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( + OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(responsePb); bigquery = options.getService(); QueryResponse response = bigquery.getQueryResults(queryJob); assertTrue(response.getCompleted()); assertEquals(null, response.getSchema()); - verify(bigqueryRpcMock).getQueryResults(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getQueryResultsSkipExceptionTranslation(OTHER_PROJECT, JOB, null, EMPTY_RPC_OPTIONS); } @Test - public void testGetQueryResultsWithOptions() { + public void testGetQueryResultsWithOptions() throws IOException { JobId queryJob = JobId.of(PROJECT, JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2504,7 +2707,8 @@ public void testGetQueryResultsWithOptions() { .setPageToken(CURSOR) .setTotalBytesProcessed(42L) .setTotalRows(BigInteger.valueOf(1L)); - when(bigqueryRpcMock.getQueryResults(PROJECT, JOB, null, QUERY_RESULTS_OPTIONS)) + when(bigqueryRpcMock.getQueryResultsSkipExceptionTranslation( + PROJECT, JOB, null, QUERY_RESULTS_OPTIONS)) .thenReturn(responsePb); bigquery = options.getService(); QueryResponse response = @@ -2516,12 +2720,13 @@ public void testGetQueryResultsWithOptions() { QUERY_RESULTS_OPTION_PAGE_TOKEN); assertEquals(true, response.getCompleted()); assertEquals(null, response.getSchema()); - verify(bigqueryRpcMock).getQueryResults(PROJECT, JOB, null, QUERY_RESULTS_OPTIONS); + verify(bigqueryRpcMock) + .getQueryResultsSkipExceptionTranslation(PROJECT, JOB, null, QUERY_RESULTS_OPTIONS); } @Test - public void testGetDatasetRetryableException() { - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + public void testGetDatasetRetryableException() throws IOException { + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = @@ -2533,13 +2738,14 @@ public void testGetDatasetRetryableException() { Dataset dataset = bigquery.getDataset(DATASET); assertEquals( new Dataset(bigquery, new DatasetInfo.BuilderImpl(DATASET_INFO_WITH_PROJECT)), dataset); - verify(bigqueryRpcMock, times(2)).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock, times(2)) + .getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testNonRetryableException() { + public void testNonRetryableException() throws IOException { String exceptionMessage = "Not Implemented"; - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(501, exceptionMessage)); bigquery = options @@ -2553,13 +2759,13 @@ public void testNonRetryableException() { } catch (BigQueryException ex) { Assert.assertEquals(exceptionMessage, ex.getMessage()); } - verify(bigqueryRpcMock).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testRuntimeException() { + public void testRuntimeException() throws IOException { String exceptionMessage = "Artificial runtime exception"; - when(bigqueryRpcMock.getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new RuntimeException(exceptionMessage)); bigquery = options @@ -2573,7 +2779,7 @@ public void testRuntimeException() { } catch (BigQueryException ex) { Assert.assertTrue(ex.getMessage().endsWith(exceptionMessage)); } - verify(bigqueryRpcMock).getDataset(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test @@ -2604,7 +2810,7 @@ public void testFastQuerySQLShouldRetry() throws Exception { .setTotalRows(BigInteger.valueOf(1L)) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -2630,7 +2836,8 @@ public void testFastQuerySQLShouldRetry() throws Exception { } assertTrue(idempotent); - verify(bigqueryRpcMock, times(5)).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock, times(5)) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test @@ -2645,7 +2852,7 @@ public void testFastQueryDMLShouldRetry() throws Exception { .setNumDmlAffectedRows(1L) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -2671,7 +2878,8 @@ public void testFastQueryDMLShouldRetry() throws Exception { } assertTrue(idempotent); - verify(bigqueryRpcMock, times(5)).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock, times(5)) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test @@ -2686,7 +2894,7 @@ public void testFastQueryRateLimitIdempotency() throws Exception { .setNumDmlAffectedRows(1L) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -2719,7 +2927,8 @@ public void testFastQueryRateLimitIdempotency() throws Exception { } assertTrue(idempotent); - verify(bigqueryRpcMock, times(6)).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock, times(6)) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test @@ -2757,7 +2966,7 @@ public void testFastQueryDDLShouldRetry() throws Exception { .setTotalBytesProcessed(42L) .setSchema(TABLE_SCHEMA.toPb()); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) .thenThrow(new BigQueryException(500, "InternalError")) .thenThrow(new BigQueryException(502, "Bad Gateway")) .thenThrow(new BigQueryException(503, "Service Unavailable")) @@ -2783,11 +2992,12 @@ public void testFastQueryDDLShouldRetry() throws Exception { } assertTrue(idempotent); - verify(bigqueryRpcMock, times(5)).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock, times(5)) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test - public void testFastQueryBigQueryException() throws InterruptedException { + public void testFastQueryBigQueryException() throws InterruptedException, IOException { List errorProtoList = ImmutableList.of( new ErrorProto() @@ -2804,7 +3014,8 @@ public void testFastQueryBigQueryException() throws InterruptedException { .setPageToken(null) .setErrors(errorProtoList); - when(bigqueryRpcMock.queryRpc(eq(PROJECT), requestPbCapture.capture())).thenReturn(responsePb); + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) + .thenReturn(responsePb); bigquery = options.getService(); try { @@ -2820,122 +3031,135 @@ public void testFastQueryBigQueryException() throws InterruptedException { QUERY_JOB_CONFIGURATION_FOR_QUERY.getDefaultDataset().getDataset(), requestPb.getDefaultDataset().getDatasetId()); assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.useQueryCache(), requestPb.getUseQueryCache()); - verify(bigqueryRpcMock).queryRpc(eq(PROJECT), requestPbCapture.capture()); + verify(bigqueryRpcMock) + .queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture()); } @Test - public void testCreateRoutine() { + public void testCreateRoutine() throws IOException { RoutineInfo routineInfo = ROUTINE_INFO.setProjectId(OTHER_PROJECT); - when(bigqueryRpcMock.create(routineInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.createSkipExceptionTranslation(routineInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(routineInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Routine actualRoutine = bigquery.create(routineInfo); assertEquals(new Routine(bigquery, new RoutineInfo.BuilderImpl(routineInfo)), actualRoutine); - verify(bigqueryRpcMock).create(routineInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).createSkipExceptionTranslation(routineInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testGetRoutine() { - when(bigqueryRpcMock.getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) + public void testGetRoutine() throws IOException { + when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( + PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenReturn(ROUTINE_INFO.toPb()); bigquery = options.getService(); Routine routine = bigquery.getRoutine(DATASET, ROUTINE); assertEquals(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO)), routine); - verify(bigqueryRpcMock).getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); } @Test - public void testGetRoutineWithRountineId() { - when(bigqueryRpcMock.getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) + public void testGetRoutineWithRountineId() throws IOException { + when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( + PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenReturn(ROUTINE_INFO.toPb()); bigquery = options.getService(); Routine routine = bigquery.getRoutine(ROUTINE_ID); assertEquals(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO)), routine); - verify(bigqueryRpcMock).getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); } @Test - public void testGetRoutineWithEnabledThrowNotFoundException() { - when(bigqueryRpcMock.getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) - .thenReturn(null) + public void testGetRoutineWithEnabledThrowNotFoundException() throws IOException { + when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( + PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Routine not found")); options.setThrowNotFound(true); bigquery = options.getService(); try { - Routine routine = bigquery.getRoutine(ROUTINE_ID); + bigquery.getRoutine(ROUTINE_ID); fail(); } catch (BigQueryException ex) { assertEquals("Routine not found", ex.getMessage()); } - verify(bigqueryRpcMock).getRoutine(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .getRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); } @Test - public void testUpdateRoutine() { + public void testUpdateRoutine() throws IOException { RoutineInfo updatedRoutineInfo = ROUTINE_INFO .setProjectId(OTHER_PROJECT) .toBuilder() .setDescription("newDescription") .build(); - when(bigqueryRpcMock.update(updatedRoutineInfo.toPb(), EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.updateSkipExceptionTranslation( + updatedRoutineInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(updatedRoutineInfo.toPb()); BigQueryOptions bigQueryOptions = createBigQueryOptionsForProject(OTHER_PROJECT, rpcFactoryMock); bigquery = bigQueryOptions.getService(); Routine routine = bigquery.update(updatedRoutineInfo); assertEquals(new Routine(bigquery, new RoutineInfo.BuilderImpl(updatedRoutineInfo)), routine); - verify(bigqueryRpcMock).update(updatedRoutineInfo.toPb(), EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .updateSkipExceptionTranslation(updatedRoutineInfo.toPb(), EMPTY_RPC_OPTIONS); } @Test - public void testListRoutines() { + public void testListRoutines() throws IOException { bigquery = options.getService(); ImmutableList routineList = ImmutableList.of(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(routineList, RoutineInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listRoutines(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listRoutinesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listRoutines(DATASET); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(routineList.toArray(), Iterables.toArray(page.getValues(), Routine.class)); - verify(bigqueryRpcMock).listRoutines(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listRoutinesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testListRoutinesWithDatasetId() { + public void testListRoutinesWithDatasetId() throws IOException { bigquery = options.getService(); ImmutableList routineList = ImmutableList.of(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO))); Tuple> result = Tuple.of(CURSOR, Iterables.transform(routineList, RoutineInfo.TO_PB_FUNCTION)); - when(bigqueryRpcMock.listRoutines(PROJECT, DATASET, EMPTY_RPC_OPTIONS)).thenReturn(result); + when(bigqueryRpcMock.listRoutinesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); Page page = bigquery.listRoutines(DatasetId.of(PROJECT, DATASET)); assertEquals(CURSOR, page.getNextPageToken()); assertArrayEquals(routineList.toArray(), Iterables.toArray(page.getValues(), Routine.class)); - verify(bigqueryRpcMock).listRoutines(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .listRoutinesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testDeleteRoutine() { - when(bigqueryRpcMock.deleteRoutine(PROJECT, DATASET, ROUTINE)).thenReturn(true); + public void testDeleteRoutine() throws IOException { + when(bigqueryRpcMock.deleteRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE)) + .thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.delete(ROUTINE_ID)); - verify(bigqueryRpcMock).deleteRoutine(PROJECT, DATASET, ROUTINE); + verify(bigqueryRpcMock).deleteRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE); } @Test public void testWriteWithJob() throws IOException { bigquery = options.getService(); Job job = new Job(bigquery, new JobInfo.BuilderImpl(JOB_INFO)); - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -2943,24 +3167,25 @@ public void testWriteWithJob() throws IOException { assertEquals(job, writer.getJob()); bigquery.writer(JOB_INFO.getJobId(), LOAD_CONFIGURATION); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write(eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); } @Test public void testWriteChannel() throws IOException { bigquery = options.getService(); Job job = new Job(bigquery, new JobInfo.BuilderImpl(JOB_INFO)); - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -2968,43 +3193,47 @@ public void testWriteChannel() throws IOException { assertEquals(job, writer.getJob()); bigquery.writer(LOAD_CONFIGURATION); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write(eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); } @Test - public void testGetIamPolicy() { + public void testGetIamPolicy() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final com.google.api.services.bigquery.model.Policy apiPolicy = PolicyHelper.convertToApiPolicy(SAMPLE_IAM_POLICY); - when(bigqueryRpcMock.getIamPolicy(resourceId, EMPTY_RPC_OPTIONS)).thenReturn(apiPolicy); + when(bigqueryRpcMock.getIamPolicySkipExceptionTranslation(resourceId, EMPTY_RPC_OPTIONS)) + .thenReturn(apiPolicy); bigquery = options.getService(); Policy policy = bigquery.getIamPolicy(TABLE_ID); assertEquals(policy, SAMPLE_IAM_POLICY); - verify(bigqueryRpcMock).getIamPolicy(resourceId, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock).getIamPolicySkipExceptionTranslation(resourceId, EMPTY_RPC_OPTIONS); } @Test - public void testSetIamPolicy() { + public void testSetIamPolicy() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final com.google.api.services.bigquery.model.Policy apiPolicy = PolicyHelper.convertToApiPolicy(SAMPLE_IAM_POLICY); - when(bigqueryRpcMock.setIamPolicy(resourceId, apiPolicy, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.setIamPolicySkipExceptionTranslation( + resourceId, apiPolicy, EMPTY_RPC_OPTIONS)) .thenReturn(apiPolicy); bigquery = options.getService(); Policy returnedPolicy = bigquery.setIamPolicy(TABLE_ID, SAMPLE_IAM_POLICY); assertEquals(returnedPolicy, SAMPLE_IAM_POLICY); - verify(bigqueryRpcMock).setIamPolicy(resourceId, apiPolicy, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .setIamPolicySkipExceptionTranslation(resourceId, apiPolicy, EMPTY_RPC_OPTIONS); } @Test - public void testTestIamPermissions() { + public void testTestIamPermissions() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final List checkedPermissions = ImmutableList.of("foo", "bar", "baz"); @@ -3012,16 +3241,19 @@ public void testTestIamPermissions() { final com.google.api.services.bigquery.model.TestIamPermissionsResponse response = new com.google.api.services.bigquery.model.TestIamPermissionsResponse() .setPermissions(grantedPermissions); - when(bigqueryRpcMock.testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.testIamPermissionsSkipExceptionTranslation( + resourceId, checkedPermissions, EMPTY_RPC_OPTIONS)) .thenReturn(response); bigquery = options.getService(); List perms = bigquery.testIamPermissions(TABLE_ID, checkedPermissions); assertEquals(perms, grantedPermissions); - verify(bigqueryRpcMock).testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .testIamPermissionsSkipExceptionTranslation( + resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); } @Test - public void testTestIamPermissionsWhenNoPermissionsGranted() { + public void testTestIamPermissionsWhenNoPermissionsGranted() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final List checkedPermissions = ImmutableList.of("foo", "bar", "baz"); @@ -3029,11 +3261,14 @@ public void testTestIamPermissionsWhenNoPermissionsGranted() { final com.google.api.services.bigquery.model.TestIamPermissionsResponse response = new com.google.api.services.bigquery.model.TestIamPermissionsResponse() .setPermissions(null); - when(bigqueryRpcMock.testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS)) + when(bigqueryRpcMock.testIamPermissionsSkipExceptionTranslation( + resourceId, checkedPermissions, EMPTY_RPC_OPTIONS)) .thenReturn(response); bigquery = options.getService(); List perms = bigquery.testIamPermissions(TABLE_ID, checkedPermissions); assertEquals(perms, ImmutableList.of()); - verify(bigqueryRpcMock).testIamPermissions(resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); + verify(bigqueryRpcMock) + .testIamPermissionsSkipExceptionTranslation( + resourceId, checkedPermissions, EMPTY_RPC_OPTIONS); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 7eea1570ae..65bbb6c56a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -27,9 +27,10 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; -import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; +import java.io.IOException; import java.math.BigInteger; import java.sql.SQLException; import java.util.AbstractList; @@ -50,7 +51,7 @@ public class ConnectionImplTest { private BigQueryOptions options; private BigQueryRpcFactory rpcFactoryMock; - private BigQueryRpc bigqueryRpcMock; + private HttpBigQueryRpc bigqueryRpcMock; private Connection connectionMock; private BigQuery bigquery; private ConnectionImpl connection; @@ -142,7 +143,7 @@ private BigQueryOptions createBigQueryOptionsForProject( @Before public void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); - bigqueryRpcMock = mock(BigQueryRpc.class); + bigqueryRpcMock = mock(HttpBigQueryRpc.class); connectionMock = mock(Connection.class); when(rpcFactoryMock.create(any(BigQueryOptions.class))).thenReturn(bigqueryRpcMock); options = createBigQueryOptionsForProject(PROJECT, rpcFactoryMock); @@ -164,10 +165,11 @@ public void setUp() { } @Test - public void testFastQuerySinglePage() throws BigQuerySQLException { + public void testFastQuerySinglePage() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); ConnectionImpl connectionSpy = Mockito.spy(connection); doReturn(BQ_RS_MOCK_RES) @@ -185,13 +187,14 @@ public void testFastQuerySinglePage() throws BigQuerySQLException { @Test // NOTE: This doesn't truly paginates. Returns a response while mocking // processQueryResponseResults - public void testFastQueryMultiplePages() throws BigQuerySQLException { + public void testFastQueryMultiplePages() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse() .setSchema(FAST_QUERY_TABLESCHEMA) .setJobComplete(true) .setPageToken(PAGE_TOKEN); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); ConnectionImpl connectionSpy = Mockito.spy(connection); @@ -215,7 +218,7 @@ public void testClose() throws BigQuerySQLException { } @Test - public void testQueryDryRun() throws BigQuerySQLException { + public void testQueryDryRun() throws BigQuerySQLException, IOException { List queryParametersMock = ImmutableList.of( new QueryParameter().setParameterType(new QueryParameterType().setType("STRING"))); @@ -237,17 +240,19 @@ public void testQueryDryRun() throws BigQuerySQLException { new com.google.api.services.bigquery.model.Job() .setStatistics(jobStatsMock) .setConfiguration(jobConfig); - when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + when(bigqueryRpcMock.createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class))) .thenReturn(mockDryRunJob); BigQueryDryRunResult dryRunResult = connection.dryRun(DRY_RUN_SQL); assertEquals(1, dryRunResult.getQueryParameters().size()); assertEquals(QUERY_SCHEMA, dryRunResult.getSchema()); verify(bigqueryRpcMock, times(1)) - .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + .createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class)); } @Test - public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException { + public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.JobStatistics2 queryMock = new com.google.api.services.bigquery.model.JobStatistics2() .setSchema(FAST_QUERY_TABLESCHEMA); @@ -265,13 +270,15 @@ public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException { new com.google.api.services.bigquery.model.Job() .setStatistics(jobStatsMock) .setConfiguration(jobConfig); - when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + when(bigqueryRpcMock.createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class))) .thenReturn(mockDryRunJob); BigQueryDryRunResult dryRunResult = connection.dryRun(DRY_RUN_SQL); assertEquals(0, dryRunResult.getQueryParameters().size()); assertEquals(QUERY_SCHEMA, dryRunResult.getSchema()); verify(bigqueryRpcMock, times(1)) - .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + .createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class)); } @Test @@ -358,8 +365,8 @@ public void testNextPageTask() throws InterruptedException { } @Test - public void testGetQueryResultsFirstPage() { - when(bigqueryRpcMock.getQueryResultsWithRowLimit( + public void testGetQueryResultsFirstPage() throws IOException { + when(bigqueryRpcMock.getQueryResultsWithRowLimitSkipExceptionTranslation( any(String.class), any(String.class), any(String.class), @@ -370,7 +377,7 @@ public void testGetQueryResultsFirstPage() { assertNotNull(response); assertEquals(GET_QUERY_RESULTS_RESPONSE, response); verify(bigqueryRpcMock, times(1)) - .getQueryResultsWithRowLimit( + .getQueryResultsWithRowLimitSkipExceptionTranslation( any(String.class), any(String.class), any(String.class), @@ -380,7 +387,7 @@ public void testGetQueryResultsFirstPage() { // calls executeSelect with a nonFast query and exercises createQueryJob @Test - public void testLegacyQuerySinglePage() throws BigQuerySQLException { + public void testLegacyQuerySinglePage() throws BigQuerySQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() @@ -400,18 +407,20 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException { any(JobId.class), any(GetQueryResultsResponse.class), any(Boolean.class)); - when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + when(bigqueryRpcMock.createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class))) .thenReturn(jobResponseMock); // RPC call in createQueryJob BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); verify(bigqueryRpcMock, times(1)) - .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + .createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class)); } // calls executeSelect with a nonFast query where the query returns an empty result. @Test - public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException, SQLException { + public void testLegacyQuerySinglePageEmptyResults() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() @@ -423,7 +432,8 @@ public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException, doReturn(GET_QUERY_RESULTS_RESPONSE_EMPTY) .when(connectionSpy) .getQueryResultsFirstPage(any(JobId.class)); - when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + when(bigqueryRpcMock.createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class))) .thenReturn(jobResponseMock); // RPC call in createQueryJob BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 0); @@ -433,12 +443,13 @@ public void testLegacyQuerySinglePageEmptyResults() throws BigQuerySQLException, res.getResultSet() .next()); // Validates that NPE does not occur when reading from empty ResultSet. verify(bigqueryRpcMock, times(1)) - .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + .createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class)); } // exercises getSubsequentQueryResultsWithJob for fast running queries @Test - public void testFastQueryLongRunning() throws SQLException { + public void testFastQueryLongRunning() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); // emulating a fast query doReturn(true).when(connectionSpy).isFastQuerySupported(); @@ -458,17 +469,19 @@ public void testFastQueryLongRunning() throws SQLException { .setTotalRows(new BigInteger(String.valueOf(4L))) .setJobReference(QUERY_JOB.toPb()) .setRows(TABLE_ROWS); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); - verify(bigqueryRpcMock, times(1)).queryRpc(any(String.class), any(QueryRequest.class)); + verify(bigqueryRpcMock, times(1)) + .queryRpcSkipExceptionTranslation(any(String.class), any(QueryRequest.class)); } @Test public void testFastQueryLongRunningAsync() - throws SQLException, ExecutionException, InterruptedException { + throws SQLException, ExecutionException, InterruptedException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); // emulating a fast query doReturn(true).when(connectionSpy).isFastQuerySupported(); @@ -488,7 +501,8 @@ public void testFastQueryLongRunningAsync() .setTotalRows(new BigInteger(String.valueOf(4L))) .setJobReference(QUERY_JOB.toPb()) .setRows(TABLE_ROWS); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); ListenableFuture executeSelectFut = connectionSpy.executeSelectAsync(SQL_QUERY); @@ -497,15 +511,17 @@ public void testFastQueryLongRunningAsync() assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); assertTrue(exSelRes.getIsSuccessful()); - verify(bigqueryRpcMock, times(1)).queryRpc(any(String.class), any(QueryRequest.class)); + verify(bigqueryRpcMock, times(1)) + .queryRpcSkipExceptionTranslation(any(String.class), any(QueryRequest.class)); } @Test public void testFastQuerySinglePageAsync() - throws BigQuerySQLException, ExecutionException, InterruptedException { + throws BigQuerySQLException, ExecutionException, InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); ConnectionImpl connectionSpy = Mockito.spy(connection); doReturn(BQ_RS_MOCK_RES) @@ -570,13 +586,14 @@ public void testExecuteSelectSlowWithParamsAsync() @Test public void testFastQueryMultiplePagesAsync() - throws BigQuerySQLException, ExecutionException, InterruptedException { + throws BigQuerySQLException, ExecutionException, InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse() .setSchema(FAST_QUERY_TABLESCHEMA) .setJobComplete(true) .setPageToken(PAGE_TOKEN); - when(bigqueryRpcMock.queryRpc(any(String.class), any(QueryRequest.class))) + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( + any(String.class), any(QueryRequest.class))) .thenReturn(mockQueryRes); ConnectionImpl connectionSpy = Mockito.spy(connection); @@ -600,7 +617,7 @@ public void testFastQueryMultiplePagesAsync() @Test // Emulates first page response using getQueryResultsFirstPage(jobId) and then subsequent pages // using getQueryResultsFirstPage(jobId) getSubsequentQueryResultsWithJob( - public void testLegacyQueryMultiplePages() throws SQLException { + public void testLegacyQueryMultiplePages() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.JobStatistics jobStatistics = new com.google.api.services.bigquery.model.JobStatistics(); @@ -619,13 +636,15 @@ public void testLegacyQueryMultiplePages() throws SQLException { .setId(JOB) .setStatus(new com.google.api.services.bigquery.model.JobStatus().setState("DONE")) .setStatistics(jobStatistics); - when(bigqueryRpcMock.createJobForQuery(any(com.google.api.services.bigquery.model.Job.class))) + when(bigqueryRpcMock.createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class))) .thenReturn(jobResponseMock); // RPC call in createQueryJob BigQueryResult res = connectionSpy.executeSelect(SQL_QUERY); assertEquals(res.getTotalRows(), 2); assertEquals(QUERY_SCHEMA, res.getSchema()); verify(bigqueryRpcMock, times(1)) - .createJobForQuery(any(com.google.api.services.bigquery.model.Job.class)); + .createJobForQuerySkipExceptionTranslation( + any(com.google.api.services.bigquery.model.Job.class)); verify(connectionSpy, times(1)) .tableDataList(any(GetQueryResultsResponse.class), any(JobId.class)); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java index a959a89916..a90b5c4d72 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java @@ -31,9 +31,11 @@ import com.google.cloud.RestorableState; import com.google.cloud.WriteChannel; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; -import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import java.io.IOException; +import java.net.ConnectException; import java.net.SocketException; +import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Random; @@ -68,7 +70,7 @@ public class TableDataWriteChannelTest { private BigQueryOptions options; private BigQueryRpcFactory rpcFactoryMock; - private BigQueryRpc bigqueryRpcMock; + private HttpBigQueryRpc bigqueryRpcMock; private BigQueryFactory bigqueryFactoryMock; private BigQuery bigqueryMock; private Job job; @@ -81,7 +83,7 @@ public class TableDataWriteChannelTest { @Before public void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); - bigqueryRpcMock = mock(BigQueryRpc.class); + bigqueryRpcMock = mock(HttpBigQueryRpc.class); bigqueryFactoryMock = mock(BigQueryFactory.class); bigqueryMock = mock(BigQuery.class); when(bigqueryMock.getOptions()).thenReturn(options); @@ -97,8 +99,8 @@ public void setUp() { } @Test - public void testCreate() { - when(bigqueryRpcMock.open( + public void testCreate() throws IOException { + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) @@ -107,26 +109,27 @@ public void testCreate() { assertTrue(writer.isOpen()); assertNull(writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); } @Test - public void testCreateRetryableError() { - BigQueryException exception = new BigQueryException(new SocketException("Socket closed")); - when(bigqueryRpcMock.open( + public void testCreateRetryableErrors() throws IOException { + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) - .thenThrow(exception) + .thenThrow(new SocketException("Socket closed")) + .thenThrow(new UnknownHostException()) + .thenThrow(new ConnectException()) .thenReturn(UPLOAD_ID); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); assertTrue(writer.isOpen()); assertNull(writer.getJob()); - verify(bigqueryRpcMock, times(2)) - .open( + verify(bigqueryRpcMock, times(4)) + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); @@ -134,12 +137,11 @@ public void testCreateRetryableError() { @Test public void testCreateNonRetryableError() throws IOException { - RuntimeException ex = new RuntimeException("expected"); - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) - .thenThrow(ex); + .thenThrow(new RuntimeException("expected")); try (TableDataWriteChannel channel = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION)) { Assert.fail(); @@ -147,7 +149,7 @@ public void testCreateNonRetryableError() throws IOException { Assert.assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); } verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); @@ -155,7 +157,7 @@ public void testCreateNonRetryableError() throws IOException { @Test public void testWriteWithoutFlush() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) @@ -164,7 +166,7 @@ public void testWriteWithoutFlush() throws IOException { assertEquals(MIN_CHUNK_SIZE, writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE))); assertNull(writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); @@ -172,12 +174,12 @@ public void testWriteWithoutFlush() throws IOException { @Test public void testWriteWithFlush() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), @@ -192,12 +194,12 @@ public void testWriteWithFlush() throws IOException { assertArrayEquals(buffer.array(), capturedBuffer.getValue()); assertNull(writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write( + .writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), @@ -207,19 +209,22 @@ public void testWriteWithFlush() throws IOException { } @Test - public void testWritesAndFlush() throws IOException { - when(bigqueryRpcMock.open( + public void testWritesAndFlushRetryableErrors() throws IOException { + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(DEFAULT_CHUNK_SIZE), eq(false))) + .thenThrow(new SocketException("Socket closed")) + .thenThrow(new UnknownHostException()) + .thenThrow(new ConnectException()) .thenReturn(null); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; @@ -235,12 +240,53 @@ public void testWritesAndFlush() throws IOException { } assertNull(writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); + verify(bigqueryRpcMock, times(4)) + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), + capturedBuffer.capture(), + eq(0), + eq(0L), + eq(DEFAULT_CHUNK_SIZE), + eq(false)); + } + + @Test + public void testWritesAndFlushNonRetryableError() throws IOException { + when(bigqueryRpcMock.openSkipExceptionTranslation( + new com.google.api.services.bigquery.model.Job() + .setJobReference(JOB_INFO.getJobId().toPb()) + .setConfiguration(LOAD_CONFIGURATION.toPb()))) + .thenReturn(UPLOAD_ID); + when(bigqueryRpcMock.writeSkipExceptionTranslation( + eq(UPLOAD_ID), + capturedBuffer.capture(), + eq(0), + eq(0L), + eq(DEFAULT_CHUNK_SIZE), + eq(false))) + .thenThrow(new RuntimeException("expected")); + try { + writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); + ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; + for (int i = 0; i < buffers.length; i++) { + buffers[i] = randomBuffer(MIN_CHUNK_SIZE); + assertEquals(MIN_CHUNK_SIZE, writer.write(buffers[i])); + } + Assert.fail(); + } catch (RuntimeException expected) { + Assert.assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); + } verify(bigqueryRpcMock) - .write( + .openSkipExceptionTranslation( + new com.google.api.services.bigquery.model.Job() + .setJobReference(JOB_INFO.getJobId().toPb()) + .setConfiguration(LOAD_CONFIGURATION.toPb())); + verify(bigqueryRpcMock, times(1)) + .writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), @@ -251,12 +297,12 @@ public void testWritesAndFlush() throws IOException { @Test public void testCloseWithoutFlush() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -266,23 +312,24 @@ public void testCloseWithoutFlush() throws IOException { assertTrue(!writer.isOpen()); assertEquals(job, writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write(eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); } @Test public void testCloseWithFlush() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); ByteBuffer buffer = randomBuffer(MIN_CHUNK_SIZE); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(MIN_CHUNK_SIZE), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -294,23 +341,23 @@ public void testCloseWithFlush() throws IOException { assertTrue(!writer.isOpen()); assertEquals(job, writer.getJob()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write( + .writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(MIN_CHUNK_SIZE), eq(true)); } @Test public void testWriteClosed() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -323,22 +370,23 @@ public void testWriteClosed() throws IOException { // expected } verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write(eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); } @Test public void testSaveAndRestore() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), @@ -359,12 +407,12 @@ public void testSaveAndRestore() throws IOException { assertArrayEquals(buffer2.array(), capturedBuffer.getAllValues().get(1)); assertEquals(new Long(DEFAULT_CHUNK_SIZE), capturedPosition.getAllValues().get(1)); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock, times(2)) - .write( + .writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), @@ -375,12 +423,12 @@ public void testSaveAndRestore() throws IOException { @Test public void testSaveAndRestoreClosed() throws IOException { - when(bigqueryRpcMock.open( + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenReturn(UPLOAD_ID); - when(bigqueryRpcMock.write( + when(bigqueryRpcMock.writeSkipExceptionTranslation( eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true))) .thenReturn(job.toPb()); writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); @@ -398,17 +446,18 @@ public void testSaveAndRestoreClosed() throws IOException { assertArrayEquals(new byte[0], capturedBuffer.getValue()); assertEquals(expectedWriterState, restoredWriter.capture()); verify(bigqueryRpcMock) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); verify(bigqueryRpcMock) - .write(eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); + .writeSkipExceptionTranslation( + eq(UPLOAD_ID), capturedBuffer.capture(), eq(0), eq(0L), eq(0), eq(true)); } @Test - public void testStateEquals() { - when(bigqueryRpcMock.open( + public void testStateEquals() throws IOException { + when(bigqueryRpcMock.openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) @@ -424,7 +473,7 @@ public void testStateEquals() { assertEquals(state.hashCode(), state2.hashCode()); assertEquals(state.toString(), state2.toString()); verify(bigqueryRpcMock, times(2)) - .open( + .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb())); From e4512aa5966e7b935fa55a062d940d9db0c834b3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Mar 2025 16:33:50 +0100 Subject: [PATCH 2028/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.45.1 (#3714) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index a0be30d589..ba965f65cc 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.44.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.45.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 401a49543f..7e3c1177da 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.44.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 46fd893e67..9216250efa 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.44.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 6eb22ef1ab..2ea1a05e0b 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.44.0"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 39151469c7..fb1979a33b 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.44.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index ea94894d05..0d9e1b0f07 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.44.0 + 3.45.1 diff --git a/pom.xml b/pom.xml index 6acbe66227..ddb8868a6c 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.44.0 + 3.45.1 From 2d222141faa4751b0b698bdbbaf896d21bd250bc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Mar 2025 17:44:23 +0100 Subject: [PATCH 2029/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.55.0 (#3718) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 03617ce82a..6c1467fd19 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.54.0 + 2.55.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 133768b85e..a837634531 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.54.0 + 2.55.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 2e0a3320d0..25a2e52f8e 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.54.0 + 2.55.0 test From 08a290adcfa7551ee27a58da0eaf5ac00a759b90 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Mar 2025 17:44:48 +0100 Subject: [PATCH 2030/2268] deps: update netty.version to v4.1.119.final (#3717) --- google-cloud-bigquery/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9e77999e84..48a692afda 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,7 +15,7 @@ google-cloud-bigquery - 4.1.118.Final + 4.1.119.Final From 59c3a365f6382bcfd5d17e8b68df37338ef4bf73 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Mar 2025 15:11:17 +0100 Subject: [PATCH 2031/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.50.0 (#3719) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ddb8868a6c..7a04583b13 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.49.0 + 2.50.0 test From c0b39029302c51e65ea31495d837598eefbe94e8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 17 Mar 2025 15:32:13 +0100 Subject: [PATCH 2032/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250302-2.0.0 (#3720) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a04583b13..5c38635f95 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250216-2.0.0 + v2-rev20250302-2.0.0 From 3d127777dec2983e72c6938d7e40b898c606d985 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Mar 2025 17:18:17 +0100 Subject: [PATCH 2033/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.56.0 (#3722) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 6c1467fd19..252e7c16ba 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.55.0 + 2.56.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a837634531..97bd988b85 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.55.0 + 2.56.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 25a2e52f8e..3cf272b95a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.55.0 + 2.56.0 test From 660bac374be405f89b808c7b095b6cc467776f8f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Mar 2025 17:20:33 +0100 Subject: [PATCH 2034/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.56.0 (#3722) From b8875a895d6d5e267086e24f97d0ed5fec36b9fe Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 19 Mar 2025 17:20:57 +0100 Subject: [PATCH 2035/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250313-2.0.0 (#3723) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c38635f95..4ad52f44c4 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250302-2.0.0 + v2-rev20250313-2.0.0 From 94798f6c7373163d09159342b6fb433f7b2030e0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 15:07:35 +0100 Subject: [PATCH 2036/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.12.0 (#3728) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ad52f44c4..e24176b370 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.11.4 + 3.12.0 pom import From 7339f94cfa53d1c988f8ef051ddd5a2d7668d430 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 15:08:28 +0100 Subject: [PATCH 2037/2268] deps: update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.66.0 (#3727) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e24176b370..a07b8f4495 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.65.0 + 1.66.0 pom import From 38e004b58134caf4f7b0d96257456930beb0e599 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 15:09:03 +0100 Subject: [PATCH 2038/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.62.0 (#3726) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a07b8f4495..3804f45cbf 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.61.0 + 2.62.0 test From 458cff63cc2993967131cb0f86983da80b505e9e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 17:08:37 +0100 Subject: [PATCH 2039/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigqueryconnection to v2.62.0 (#3725) --- pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 3804f45cbf..ecbeede6d6 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.61.0 + 2.62.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 252e7c16ba..f740b87c14 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.61.0 + 2.62.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 97bd988b85..aef78067de 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.61.0 + 2.62.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3cf272b95a..8b09f26429 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.61.0 + 2.62.0 test From 483f9305023988b3884329733d0e5fbcb6599eb1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 17:28:48 +0100 Subject: [PATCH 2040/2268] deps: update actions/upload-artifact action to v4.6.2 (#3724) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1831a7d089..87e8e13c43 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: SARIF file path: results.sarif From 426a59b9b999e836804f84c5cbe11d497128f0a8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 20 Mar 2025 17:31:15 +0100 Subject: [PATCH 2041/2268] deps: update actions/upload-artifact action to v4.6.2 (#3724) From f87a431004eeb26bb881e235c76fd67bc95e8381 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:46:39 -0400 Subject: [PATCH 2042/2268] chore(main): release 2.49.0 (#3705) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 36 +++++++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 45 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7a8e397f..a4937424c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## [2.49.0](https://github.com/googleapis/java-bigquery/compare/v2.48.1...v2.49.0) (2025-03-20) + + +### Features + +* **bigquery:** Implement getArray in BigQueryResultImpl ([#3693](https://github.com/googleapis/java-bigquery/issues/3693)) ([e2a3f2c](https://github.com/googleapis/java-bigquery/commit/e2a3f2c1a1406bf7bc9a035dce3acfde78f0eaa4)) +* Next release from main branch is 2.49.0 ([#3706](https://github.com/googleapis/java-bigquery/issues/3706)) ([b46a6cc](https://github.com/googleapis/java-bigquery/commit/b46a6ccc959f8defb145279ea18ff2e4f1bac58f)) + + +### Bug Fixes + +* Retry ExceptionHandler not retrying on IOException ([#3668](https://github.com/googleapis/java-bigquery/issues/3668)) ([83245b9](https://github.com/googleapis/java-bigquery/commit/83245b961950ca9a993694082e533834ee364417)) + + +### Dependencies + +* Exclude io.netty:netty-common from org.apache.arrow:arrow-memor… ([#3715](https://github.com/googleapis/java-bigquery/issues/3715)) ([11b5809](https://github.com/googleapis/java-bigquery/commit/11b580949b910b38732c1c8d64704c54c260214e)) +* Update actions/upload-artifact action to v4.6.2 ([#3724](https://github.com/googleapis/java-bigquery/issues/3724)) ([426a59b](https://github.com/googleapis/java-bigquery/commit/426a59b9b999e836804f84c5cbe11d497128f0a8)) +* Update actions/upload-artifact action to v4.6.2 ([#3724](https://github.com/googleapis/java-bigquery/issues/3724)) ([483f930](https://github.com/googleapis/java-bigquery/commit/483f9305023988b3884329733d0e5fbcb6599eb1)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.61.0 ([#3703](https://github.com/googleapis/java-bigquery/issues/3703)) ([53b07b0](https://github.com/googleapis/java-bigquery/commit/53b07b0e77f6ef57c8518df2b106edace679f79a)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.62.0 ([#3726](https://github.com/googleapis/java-bigquery/issues/3726)) ([38e004b](https://github.com/googleapis/java-bigquery/commit/38e004b58134caf4f7b0d96257456930beb0e599)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250302-2.0.0 ([#3720](https://github.com/googleapis/java-bigquery/issues/3720)) ([c0b3902](https://github.com/googleapis/java-bigquery/commit/c0b39029302c51e65ea31495d837598eefbe94e8)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250313-2.0.0 ([#3723](https://github.com/googleapis/java-bigquery/issues/3723)) ([b8875a8](https://github.com/googleapis/java-bigquery/commit/b8875a895d6d5e267086e24f97d0ed5fec36b9fe)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.65.0 ([#3704](https://github.com/googleapis/java-bigquery/issues/3704)) ([53b68b1](https://github.com/googleapis/java-bigquery/commit/53b68b13a505aa5d38e56032eaeb8c95bf3e9078)) +* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.66.0 ([#3727](https://github.com/googleapis/java-bigquery/issues/3727)) ([7339f94](https://github.com/googleapis/java-bigquery/commit/7339f94cfa53d1c988f8ef051ddd5a2d7668d430)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1 ([#3714](https://github.com/googleapis/java-bigquery/issues/3714)) ([e4512aa](https://github.com/googleapis/java-bigquery/commit/e4512aa5966e7b935fa55a062d940d9db0c834b3)) +* Update dependency com.google.oauth-client:google-oauth-client-java6 to v1.39.0 ([#3710](https://github.com/googleapis/java-bigquery/issues/3710)) ([c0c6352](https://github.com/googleapis/java-bigquery/commit/c0c6352b8d02145fe9513e3e23d316e045360d2d)) +* Update dependency com.google.oauth-client:google-oauth-client-jetty to v1.39.0 ([#3711](https://github.com/googleapis/java-bigquery/issues/3711)) ([43b86e9](https://github.com/googleapis/java-bigquery/commit/43b86e91a664dd9d3edaea7b31b46ac635fb22b0)) +* Update dependency node to v22 ([#3713](https://github.com/googleapis/java-bigquery/issues/3713)) ([251def5](https://github.com/googleapis/java-bigquery/commit/251def5659d2648dff0833ba967a65435e11b643)) +* Update netty.version to v4.1.119.final ([#3717](https://github.com/googleapis/java-bigquery/issues/3717)) ([08a290a](https://github.com/googleapis/java-bigquery/commit/08a290adcfa7551ee27a58da0eaf5ac00a759b90)) + + +### Documentation + +* Update error handling comment to be more precise in samples ([#3712](https://github.com/googleapis/java-bigquery/issues/3712)) ([9eb555f](https://github.com/googleapis/java-bigquery/commit/9eb555ff61bef42a3bdfe197da8423b7bf14f493)) + ## [2.48.1](https://github.com/googleapis/java-bigquery/compare/v2.48.0...v2.48.1) (2025-02-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9664c88f35..3c0b4987c4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.48.2-SNAPSHOT + 2.49.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 0d9e1b0f07..77a502ab84 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.48.2-SNAPSHOT + 2.49.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.48.2-SNAPSHOT + 2.49.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 48a692afda..073a72c76b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.48.2-SNAPSHOT + 2.49.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.48.2-SNAPSHOT + 2.49.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index ecbeede6d6..794f4733aa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.48.2-SNAPSHOT + 2.49.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.48.2-SNAPSHOT + 2.49.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index aef78067de..4b2ba49abf 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.48.2-SNAPSHOT + 2.49.0 diff --git a/versions.txt b/versions.txt index f9e66ad7f8..0d2589b1b2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.48.1:2.48.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.49.0:2.49.0 \ No newline at end of file From 4e0b2ee32bacdbc1eb554aa9c38779cef04f37b5 Mon Sep 17 00:00:00 2001 From: Mike Eltsufin Date: Thu, 20 Mar 2025 18:15:16 +0000 Subject: [PATCH 2043/2268] chore: group pull requests from one google-cloud-java release (#3730) Fixes: b/404966938. --- renovate.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 8034b03793..1ff055606e 100644 --- a/renovate.json +++ b/renovate.json @@ -91,7 +91,16 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" - } + }, + { + "matchPackageNames": [ + "com.google.cloud:google-cloud-datacatalog-bom", + "com.google.cloud:google-cloud-bigqueryconnection-v1", + "com.google.cloud:google-cloud-bigqueryconnection" + ], + "groupName": "Google Cloud Java Monorepo Updates", + "groupSlug": "google-cloud-java-monorepo-release-updates" + } ], "semanticCommits": true, "dependencyDashboard": true, From 08c636345e3f39ea6b477d9e69e944becbe3becf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:08:08 -0400 Subject: [PATCH 2044/2268] chore(main): release 2.49.1-SNAPSHOT (#3732) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3c0b4987c4..7cb5546d4c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.0 + 2.49.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 77a502ab84..90ccc6805c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.0 + 2.49.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.0 + 2.49.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 073a72c76b..07ae4b46b6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.0 + 2.49.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.0 + 2.49.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 794f4733aa..da71f55ede 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.0 + 2.49.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.0 + 2.49.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4b2ba49abf..81112bede9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.0 + 2.49.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 0d2589b1b2..726d760777 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.0:2.49.0 \ No newline at end of file +google-cloud-bigquery:2.49.0:2.49.1-SNAPSHOT \ No newline at end of file From 95566e644af9d6a0e9c424a1668dd28d71e94f35 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Mar 2025 16:40:01 +0100 Subject: [PATCH 2045/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.49.0 (#3733) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f740b87c14..3a8f65c31e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.48.1 + 2.49.0 From b5bfaabcc915101403c6121cc0b29b088684801f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 25 Mar 2025 16:25:27 +0100 Subject: [PATCH 2046/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.57.0 (#3738) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a8f65c31e..e36fac5385 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.56.0 + 2.57.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 81112bede9..e2bc180229 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.56.0 + 2.57.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8b09f26429..0ba079c8ea 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.56.0 + 2.57.0 test From 8634822e1836c5ccc0f8d0263ac57ac561578360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=81o=C5=9B?= Date: Tue, 25 Mar 2025 20:09:14 +0100 Subject: [PATCH 2047/2268] fix: Add labels to converter for listTables method (#3735) (#3736) --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 3 ++- .../cloud/bigquery/BigQueryImplTest.java | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 14a14fdb9f..ebb8f2644f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -457,7 +457,8 @@ public Table apply(TableList.Tables tablePb) { .setCreationTime(tablePb.getCreationTime()) .setTimePartitioning(tablePb.getTimePartitioning()) .setRangePartitioning(tablePb.getRangePartitioning()) - .setClustering(tablePb.getClustering()); + .setClustering(tablePb.getClustering()) + .setLabels(tablePb.getLabels()); } })); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 1fa7481992..12458742a2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -132,6 +132,7 @@ public class BigQueryImplTest { .setField("timestampField"); private static final TimePartitioning TIME_PARTITIONING_NULL_TYPE = TimePartitioning.fromPb(PB_TIMEPARTITIONING); + private static final ImmutableMap LABELS = ImmutableMap.of("key", "value"); private static final StandardTableDefinition TABLE_DEFINITION_WITH_PARTITIONING = StandardTableDefinition.newBuilder() .setSchema(TABLE_SCHEMA) @@ -155,6 +156,8 @@ public class BigQueryImplTest { TableInfo.of(TABLE_ID, TABLE_DEFINITION_WITH_RANGE_PARTITIONING); private static final TableInfo TABLE_INFO = TableInfo.of(TABLE_ID, TABLE_DEFINITION); private static final TableInfo OTHER_TABLE_INFO = TableInfo.of(OTHER_TABLE_ID, TABLE_DEFINITION); + private static final TableInfo OTHER_TABLE_WITH_LABELS_INFO = + TableInfo.newBuilder(OTHER_TABLE_ID, TABLE_DEFINITION).setLabels(LABELS).build(); private static final TableInfo TABLE_INFO_WITH_PROJECT = TableInfo.of(TABLE_ID_WITH_PROJECT, TABLE_DEFINITION); private static final TableInfo MODEL_TABLE_INFO_WITH_PROJECT = @@ -1151,6 +1154,23 @@ public void testListTablesFromDatasetIdWithProject() throws IOException { .listTablesSkipExceptionTranslation(OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS); } + @Test + public void testListTablesWithLabels() throws IOException { + bigquery = options.getService(); + ImmutableList
    tableList = + ImmutableList.of( + new Table(bigquery, new TableInfo.BuilderImpl(OTHER_TABLE_WITH_LABELS_INFO))); + Tuple> result = + Tuple.of(CURSOR, Iterables.transform(tableList, TableInfo.TO_PB_FUNCTION)); + when(bigqueryRpcMock.listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) + .thenReturn(result); + Page
    page = bigquery.listTables(DATASET); + assertEquals(CURSOR, page.getNextPageToken()); + assertArrayEquals(tableList.toArray(), Iterables.toArray(page.getValues(), Table.class)); + verify(bigqueryRpcMock).listTablesSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); + assertEquals(LABELS, page.getValues().iterator().next().getLabels()); + } + @Test public void testListTablesWithOptions() throws IOException { bigquery = options.getService(); From 82e55877e6fa253629ac0e2ddb6999b2d67b9e8f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 27 Mar 2025 16:01:52 +0100 Subject: [PATCH 2048/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.57.1 (#3740) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e36fac5385..ab70400aa5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.57.0 + 2.57.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e2bc180229..d122e13625 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.57.0 + 2.57.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0ba079c8ea..05089bea5c 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.57.0 + 2.57.1 test From 0700175c2baac18f6ec94507aa99fa3ab6d494f6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 2 Apr 2025 20:35:30 +0200 Subject: [PATCH 2049/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.57.3 (#3743) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ab70400aa5..30f14f205f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.57.1 + 2.57.3 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d122e13625..b40b150b5d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.57.1 + 2.57.3 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 05089bea5c..86e77230a7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.57.1 + 2.57.3 test From bb811c068b3efabf04fbe67dbb2979d562c604d9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 4 Apr 2025 15:39:12 +0200 Subject: [PATCH 2050/2268] deps: update netty.version to v4.2.0.final (#3745) --- google-cloud-bigquery/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 07ae4b46b6..4530d892dc 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,7 +15,7 @@ google-cloud-bigquery - 4.1.119.Final + 4.2.0.Final From a335927e16d0907d62e584f08fa8393daae40354 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 24 Apr 2025 17:17:23 +0100 Subject: [PATCH 2051/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.46.0 (#3753) * deps: update dependency com.google.cloud:sdk-platform-java-config to v3.46.0 * chore: use latest formatter in lint check * chore: use java 17 in linter job * chore: format java source files --------- Co-authored-by: Diego Marquez --- .github/workflows/ci.yaml | 2 +- .../workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/build.sh | 2 +- .kokoro/continuous/graalvm-native-17.cfg | 2 +- .kokoro/continuous/graalvm-native.cfg | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- .../java/com/google/cloud/bigquery/Acl.java | 60 +++++++++++++----- .../google/cloud/bigquery/BigQueryImpl.java | 3 +- .../google/cloud/bigquery/ConnectionImpl.java | 8 ++- .../cloud/bigquery/ConnectionProperty.java | 3 +- .../bigquery/ExternalTableDefinition.java | 6 +- .../google/cloud/bigquery/JobException.java | 1 + .../google/cloud/bigquery/JobStatistics.java | 9 ++- .../cloud/bigquery/LegacySQLTypeName.java | 14 +++++ .../google/cloud/bigquery/ParquetOptions.java | 1 + .../google/cloud/bigquery/RoutineInfo.java | 3 +- .../cloud/bigquery/spi/v2/BigQueryRpc.java | 1 + .../testing/RemoteBigQueryHelper.java | 6 +- .../cloud/bigquery/BigQueryImplTest.java | 63 ++++++------------- .../cloud/bigquery/ColumnReferenceTest.java | 3 +- .../cloud/bigquery/ConnectionImplTest.java | 3 +- .../bigquery/CopyJobConfigurationTest.java | 6 +- .../cloud/bigquery/DatasetInfoTest.java | 9 +-- .../bigquery/ExternalTableDefinitionTest.java | 6 +- .../bigquery/ExtractJobConfigurationTest.java | 12 ++-- .../google/cloud/bigquery/ForeignKeyTest.java | 3 +- .../bigquery/GoogleSheetsOptionsTest.java | 6 +- .../bigquery/LoadJobConfigurationTest.java | 12 ++-- .../cloud/bigquery/ParquetOptionsTest.java | 3 +- .../bigquery/QueryJobConfigurationTest.java | 9 +-- .../cloud/bigquery/RoutineInfoTest.java | 3 +- .../cloud/bigquery/TableConstraintsTest.java | 3 +- .../WriteChannelConfigurationTest.java | 6 +- .../cloud/bigquery/it/ITBigQueryTest.java | 63 +++++++------------ pom.xml | 2 +- 37 files changed, 166 insertions(+), 177 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b91fa381f5..4dd9974f26 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -104,7 +104,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 11 + java-version: 17 - run: java -version - run: .kokoro/build.sh env: diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ba965f65cc..26ecb69daa 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.45.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 64f559885e..cefb94a703 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -52,7 +52,7 @@ test) RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check -B -ntp + mvn com.spotify.fmt:fmt-maven-plugin:check -B -ntp RETURN_CODE=$? ;; javadoc) diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-17.cfg index 7e3c1177da..7d68556e9d 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native.cfg index 9216250efa..1a6cc8cce1 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 2ea1a05e0b..fd82cff87f 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.45.1"" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.0"" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index fb1979a33b..4477760a67 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 90ccc6805c..551570be20 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.45.1 + 3.46.0 diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java index e6a2a0b91d..d52124092a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java @@ -92,7 +92,9 @@ public static Role valueOf(String constant) { return type.valueOf(constant); } - /** @return Return the known values for Role. */ + /** + * @return Return the known values for Role. + */ public static Role[] values() { return type.values(); } @@ -184,7 +186,9 @@ public DatasetAclEntity(DatasetId id, List targetTypes) { this.targetTypes = targetTypes; } - /** @return Returns DatasetAclEntity's identity. */ + /** + * @return Returns DatasetAclEntity's identity. + */ public DatasetId getId() { return id; } @@ -240,7 +244,9 @@ public Domain(String domain) { this.domain = domain; } - /** @return Returns the domain name. */ + /** + * @return Returns the domain name. + */ public String getDomain() { return domain; } @@ -348,22 +354,30 @@ Access toPb() { } } - /** @return Returns a Group entity representing all project's owners. */ + /** + * @return Returns a Group entity representing all project's owners. + */ public static Group ofProjectOwners() { return new Group(PROJECT_OWNERS); } - /** @return Returns a Group entity representing all project's readers. */ + /** + * @return Returns a Group entity representing all project's readers. + */ public static Group ofProjectReaders() { return new Group(PROJECT_READERS); } - /** @return Returns a Group entity representing all project's writers. */ + /** + * @return Returns a Group entity representing all project's writers. + */ public static Group ofProjectWriters() { return new Group(PROJECT_WRITERS); } - /** @return Returns a Group entity representing all BigQuery authenticated users. */ + /** + * @return Returns a Group entity representing all BigQuery authenticated users. + */ public static Group ofAllAuthenticatedUsers() { return new Group(ALL_AUTHENTICATED_USERS); } @@ -385,7 +399,9 @@ public User(String email) { this.email = email; } - /** @return Returns user's email. */ + /** + * @return Returns user's email. + */ public String getEmail() { return email; } @@ -437,7 +453,9 @@ public View(TableId id) { this.id = id; } - /** @return Returns table's identity. */ + /** + * @return Returns table's identity. + */ public TableId getId() { return id; } @@ -489,7 +507,9 @@ public Routine(RoutineId id) { this.id = id; } - /** @return Returns routine's identity. */ + /** + * @return Returns routine's identity. + */ public RoutineId getId() { return id; } @@ -537,7 +557,9 @@ public IamMember(String iamMember) { this.iamMember = iamMember; } - /** @return Returns iamMember. */ + /** + * @return Returns iamMember. + */ public String getIamMember() { return iamMember; } @@ -574,16 +596,19 @@ Access toPb() { public static final class Expr implements Serializable { // Textual representation of an expression in Common Expression Language syntax. private final String expression; + /** * Optional. Title for the expression, i.e. a short string describing its purpose. This can be * used e.g. in UIs which allow to enter the expression. */ private final String title; + /** * Optional. Description of the expression. This is a longer text which describes the * expression, e.g. when hovered over it in a UI. */ private final String description; + /** * Optional. String indicating the location of the expression for error reporting, e.g. a file * name and a position in the file. @@ -713,16 +738,23 @@ private Acl(Entity entity, Role role, Expr condition) { this.condition = condition; } - /** @return Returns the entity for this ACL. */ + /** + * @return Returns the entity for this ACL. + */ public Entity getEntity() { return entity; } - /** @return Returns the role specified by this ACL. */ + /** + * @return Returns the role specified by this ACL. + */ public Role getRole() { return role; } - /** @return Returns the condition specified by this ACL. */ + + /** + * @return Returns the condition specified by this ACL. + */ public Expr getCondition() { return condition; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 3db8c88f77..8f8e45ad34 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1409,8 +1409,7 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio if (getOptions().isQueryPreviewEnabled()) { configuration = - configuration - .toBuilder() + configuration.toBuilder() .setJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL) .build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index d524cedfc8..eb3a32db74 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -135,6 +135,7 @@ private int getBufferSize() { ? 20000 : Math.min(connectionSettings.getNumBufferedRows() * 2, 100000)); } + /** * Cancel method shutdowns the pageFetcher and producerWorker threads gracefully using interrupt. * The pageFetcher threat will not request for any subsequent threads after interrupting and @@ -263,6 +264,7 @@ private BigQueryResult getExecuteSelectResponse( throw new BigQuerySQLException(e.getMessage(), e, e.getErrors()); } } + /** * Execute a SQL statement that returns a single ResultSet and returns a ListenableFuture to * process the response asynchronously. @@ -527,6 +529,7 @@ BigQueryResultStats getBigQueryResultSetStats(JobId jobId) { queryStatistics.getSessionInfo() == null ? null : queryStatistics.getSessionInfo(); return new BigQueryResultStatsImpl(queryStatistics, sessionInfo); } + /* This method processed the first page of GetQueryResultsResponse and then it uses tabledata.list */ @VisibleForTesting BigQueryResult tableDataList(GetQueryResultsResponse firstPage, JobId jobId) { @@ -1109,7 +1112,9 @@ private ArrowRowReader(ArrowSchema arrowSchema, Map arrowNameTo loader = new VectorLoader(root); } - /** @param batch object returned from the ReadRowsResponse. */ + /** + * @param batch object returned from the ReadRowsResponse. + */ private void processRows( ArrowRecordBatch batch, BlockingQueue buffer, Schema schema) throws IOException { // deserialize the values and consume the hash of the values @@ -1166,6 +1171,7 @@ public void close() { allocator.close(); } } + /*Returns just the first page of GetQueryResultsResponse using the jobId*/ @VisibleForTesting GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java index a6206712ed..7abd36b41b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java @@ -55,7 +55,8 @@ public static final class Builder { private String key; private String value; - private Builder() {}; + private Builder() {} + ; private Builder(ConnectionProperty properties) { this.key = properties.key; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index 5af3085e20..ea4cceeade 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -167,7 +167,8 @@ public Builder setFormatOptions(FormatOptions formatOptions) { /** Sets the table Hive partitioning options. */ public Builder setHivePartitioningOptions(HivePartitioningOptions hivePartitioningOptions) { return setHivePartitioningOptionsInner(hivePartitioningOptions); - }; + } + ; /** * When creating an external table, the user can provide a reference file with the table schema. @@ -253,7 +254,8 @@ public Builder setMaxStaleness(String maxStaleness) { @Nullable public Boolean ignoreUnknownValues() { return getIgnoreUnknownValues(); - }; + } + ; @Nullable public abstract Boolean getIgnoreUnknownValues(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobException.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobException.java index 612affd315..0bfa2572a3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobException.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobException.java @@ -34,6 +34,7 @@ public class JobException extends RuntimeException { public JobId getId() { return id; } + /** * The errors reported by the job. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java index 407e25a8f3..c78378ab53 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobStatistics.java @@ -1400,7 +1400,8 @@ public static class Builder { private String name; private Long slotMs; - private Builder() {}; + private Builder() {} + ; Builder setName(String name) { this.name = name; @@ -1486,7 +1487,8 @@ public static class Builder { private String transactionId; - private Builder() {}; + private Builder() {} + ; Builder setTransactionId(String transactionId) { this.transactionId = transactionId; @@ -1557,7 +1559,8 @@ public static class Builder { private String sessionId; - private Builder() {}; + private Builder() {} + ; Builder setSessionId(String sessionId) { this.sessionId = sessionId; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java index dec2583e90..334e3290b5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LegacySQLTypeName.java @@ -46,56 +46,70 @@ public LegacySQLTypeName apply(String constant) { /** Variable-length binary data. */ public static final LegacySQLTypeName BYTES = type.createAndRegister("BYTES").setStandardType(StandardSQLTypeName.BYTES); + /** Variable-length character (Unicode) data. */ public static final LegacySQLTypeName STRING = type.createAndRegister("STRING").setStandardType(StandardSQLTypeName.STRING); + /** A 64-bit signed integer value. */ public static final LegacySQLTypeName INTEGER = type.createAndRegister("INTEGER").setStandardType(StandardSQLTypeName.INT64); + /** A 64-bit IEEE binary floating-point value. */ public static final LegacySQLTypeName FLOAT = type.createAndRegister("FLOAT").setStandardType(StandardSQLTypeName.FLOAT64); + /** * A decimal value with 38 digits of precision and 9 digits of scale. Note, support for this type * is limited in legacy SQL. */ public static final LegacySQLTypeName NUMERIC = type.createAndRegister("NUMERIC").setStandardType(StandardSQLTypeName.NUMERIC); + /** * A decimal value with 76+ digits of precision (the 77th digit is partial) and 38 digits of scale */ public static final LegacySQLTypeName BIGNUMERIC = type.createAndRegister("BIGNUMERIC").setStandardType(StandardSQLTypeName.BIGNUMERIC); + /** A Boolean value (true or false). */ public static final LegacySQLTypeName BOOLEAN = type.createAndRegister("BOOLEAN").setStandardType(StandardSQLTypeName.BOOL); + /** Represents an absolute point in time, with microsecond precision. */ public static final LegacySQLTypeName TIMESTAMP = type.createAndRegister("TIMESTAMP").setStandardType(StandardSQLTypeName.TIMESTAMP); + /** Represents a logical calendar date. Note, support for this type is limited in legacy SQL. */ public static final LegacySQLTypeName DATE = type.createAndRegister("DATE").setStandardType(StandardSQLTypeName.DATE); + /** Represents a set of geographic points, represented as a Well Known Text (WKT) string. */ public static final LegacySQLTypeName GEOGRAPHY = type.createAndRegister("GEOGRAPHY").setStandardType(StandardSQLTypeName.GEOGRAPHY); + /** * Represents a time, independent of a specific date, to microsecond precision. Note, support for * this type is limited in legacy SQL. */ public static final LegacySQLTypeName TIME = type.createAndRegister("TIME").setStandardType(StandardSQLTypeName.TIME); + /** * Represents a year, month, day, hour, minute, second, and subsecond (microsecond precision). * Note, support for this type is limited in legacy SQL. */ public static final LegacySQLTypeName DATETIME = type.createAndRegister("DATETIME").setStandardType(StandardSQLTypeName.DATETIME); + /** A record type with a nested schema. */ public static final LegacySQLTypeName RECORD = type.createAndRegister("RECORD").setStandardType(StandardSQLTypeName.STRUCT); + /** Represents JSON data */ public static final LegacySQLTypeName JSON = type.createAndRegister("JSON").setStandardType(StandardSQLTypeName.JSON); + /** Represents duration or amount of time. */ public static final LegacySQLTypeName INTERVAL = type.createAndRegister("INTERVAL").setStandardType(StandardSQLTypeName.INTERVAL); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java index b150f3b06b..cc85eeda68 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ParquetOptions.java @@ -79,6 +79,7 @@ public ParquetOptions build() { return new ParquetOptions(this); } } + /** Returns a builder for the {@link ParquetOptions} object. */ public Builder toBuilder() { return new Builder(this); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java index 7cea99f93f..646a2fdeaa 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java @@ -429,7 +429,8 @@ public String getBody() { /** Returns the Remote function specific options. */ public RemoteFunctionOptions getRemoteFunctionOptions() { return remoteFunctionOptions; - }; + } + ; /** Returns the data governance type of the routine, e.g. DATA_MASKING. */ public String getDataGovernanceType() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index 8b0a83531e..bbde70dc5a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -234,6 +234,7 @@ Tuple> listModels( Tuple> listRoutines( String projectId, String datasetId, Map options); + /** * Deletes the requested routine. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java index 2853c46761..4b1767362c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java @@ -95,8 +95,7 @@ public static RemoteBigQueryHelper create(String projectId, InputStream keyStrea try { HttpTransportOptions transportOptions = BigQueryOptions.getDefaultHttpTransportOptions(); transportOptions = - transportOptions - .toBuilder() + transportOptions.toBuilder() .setConnectTimeout(connectTimeout) .setReadTimeout(connectTimeout) .build(); @@ -123,8 +122,7 @@ public static RemoteBigQueryHelper create(String projectId, InputStream keyStrea public static RemoteBigQueryHelper create() { HttpTransportOptions transportOptions = BigQueryOptions.getDefaultHttpTransportOptions(); transportOptions = - transportOptions - .toBuilder() + transportOptions.toBuilder() .setConnectTimeout(connectTimeout) .setReadTimeout(connectTimeout) .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 12458742a2..c0367beae4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -798,9 +798,7 @@ public void testDeleteDatasetWithOptions() throws IOException { @Test public void testUpdateDataset() throws IOException { DatasetInfo updatedDatasetInfo = - DATASET_INFO - .setProjectId(OTHER_PROJECT) - .toBuilder() + DATASET_INFO.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") .build(); when(bigqueryRpcMock.patchSkipExceptionTranslation( @@ -1276,9 +1274,7 @@ public void testDeleteModel() throws IOException { @Test public void testUpdateModel() throws IOException { ModelInfo updateModelInfo = - MODEL_INFO_WITH_PROJECT - .setProjectId(OTHER_PROJECT) - .toBuilder() + MODEL_INFO_WITH_PROJECT.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") .build(); when(bigqueryRpcMock.patchSkipExceptionTranslation(updateModelInfo.toPb(), EMPTY_RPC_OPTIONS)) @@ -1422,8 +1418,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1467,8 +1462,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { when(bigqueryRpcMock.insertAll(PROJECT, DATASET, TABLE, requestPb)) .thenThrow(new BigQueryException(500, "InternalError")); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1719,8 +1713,7 @@ public void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws I bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1745,8 +1738,7 @@ public void testCreateJobFailureShouldRetry() throws IOException { bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1778,8 +1770,7 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() throws IOEx bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1809,8 +1800,7 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws I bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1842,8 +1832,7 @@ public void testCreateJobWithRetryOptionsFailureShouldRetry() throws IOException bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -1872,8 +1861,7 @@ public void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOExcept bigquery = options.getService(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2674,8 +2662,7 @@ public void testGetQueryResultsRetry() throws IOException { .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2750,8 +2737,7 @@ public void testGetDatasetRetryableException() throws IOException { .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2768,8 +2754,7 @@ public void testNonRetryableException() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(501, exceptionMessage)); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2788,8 +2773,7 @@ public void testRuntimeException() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new RuntimeException(exceptionMessage)); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2806,8 +2790,7 @@ public void testRuntimeException() throws IOException { public void testQueryDryRun() throws Exception { // https://github.com/googleapis/google-cloud-java/issues/2479 try { - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService() @@ -2838,8 +2821,7 @@ public void testFastQuerySQLShouldRetry() throws Exception { .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2880,8 +2862,7 @@ public void testFastQueryDMLShouldRetry() throws Exception { .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2925,8 +2906,7 @@ public void testFastQueryRateLimitIdempotency() throws Exception { .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -2994,8 +2974,7 @@ public void testFastQueryDDLShouldRetry() throws Exception { .thenReturn(responsePb); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); @@ -3112,9 +3091,7 @@ public void testGetRoutineWithEnabledThrowNotFoundException() throws IOException @Test public void testUpdateRoutine() throws IOException { RoutineInfo updatedRoutineInfo = - ROUTINE_INFO - .setProjectId(OTHER_PROJECT) - .toBuilder() + ROUTINE_INFO.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") .build(); when(bigqueryRpcMock.updateSkipExceptionTranslation( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java index 7a6cac30f6..0cc680dddf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java @@ -32,8 +32,7 @@ public class ColumnReferenceTest { public void testToBuilder() { compareColumnReferenceDefinition(COLUMN_REFERENCE, COLUMN_REFERENCE.toBuilder().build()); ColumnReference columnReference = - COLUMN_REFERENCE - .toBuilder() + COLUMN_REFERENCE.toBuilder() .setReferencingColumn("col1") .setReferencedColumn("col2") .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 65bbb6c56a..4edc6f05d1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -155,8 +155,7 @@ public void setUp() { .setNumBufferedRows(DEFAULT_PAGE_SIZE) .build(); bigquery = - options - .toBuilder() + options.toBuilder() .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java index dfe76adafe..70a4983df7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java @@ -67,8 +67,7 @@ public void testToBuilder() { COPY_JOB_CONFIGURATION_MULTIPLE_TABLES, COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.toBuilder().build()); CopyJobConfiguration jobConfiguration = - COPY_JOB_CONFIGURATION - .toBuilder() + COPY_JOB_CONFIGURATION.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", jobConfiguration.getDestinationTable().getTable()); @@ -143,8 +142,7 @@ public void testSetProjectId() { @Test public void testSetProjectIdDoNotOverride() { CopyJobConfiguration configuration = - COPY_JOB_CONFIGURATION_MULTIPLE_TABLES - .toBuilder() + COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.toBuilder() .setSourceTables( Lists.transform( SOURCE_TABLES, diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index e999b86e25..1b75195cec 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -92,8 +92,7 @@ public class DatasetInfoTest { .setResourceTags(RESOURCE_TAGS) .build(); private static final DatasetInfo DATASET_INFO_COMPLETE = - DATASET_INFO - .toBuilder() + DATASET_INFO.toBuilder() .setDatasetId(DATASET_ID_COMPLETE) .setAcl(ACCESS_RULES_COMPLETE) .build(); @@ -111,8 +110,7 @@ public void testToBuilder() { DATASET_INFO_COMPLETE_WITH_IAM_MEMBER, DATASET_INFO_COMPLETE_WITH_IAM_MEMBER.toBuilder().build()); DatasetInfo datasetInfo = - DATASET_INFO - .toBuilder() + DATASET_INFO.toBuilder() .setDatasetId(DatasetId.of("dataset2")) .setDescription("description2") .build(); @@ -141,8 +139,7 @@ public void testToBuilderWithExternalDatasetReference() { .setConnection("connection2") .build(); DatasetInfo datasetInfo = - DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE - .toBuilder() + DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.toBuilder() .setExternalDatasetReference(externalDatasetReference) .build(); assertEquals(externalDatasetReference, datasetInfo.getExternalDatasetReference()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index e6e7e0fcc6..93a4425dfd 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -87,16 +87,14 @@ public void testToBuilder() { compareExternalTableDefinition( EXTERNAL_TABLE_DEFINITION, EXTERNAL_TABLE_DEFINITION.toBuilder().build()); ExternalTableDefinition externalTableDefinition = - EXTERNAL_TABLE_DEFINITION - .toBuilder() + EXTERNAL_TABLE_DEFINITION.toBuilder() .setCompression("NONE") .setConnectionId("00000") .build(); assertEquals("NONE", externalTableDefinition.getCompression()); assertEquals("00000", externalTableDefinition.getConnectionId()); externalTableDefinition = - externalTableDefinition - .toBuilder() + externalTableDefinition.toBuilder() .setCompression(COMPRESSION) .setConnectionId(CONNECTION_ID) .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java index 95142a0680..ce9e35dddf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java @@ -92,8 +92,7 @@ public void testToBuilder() { compareExtractJobConfiguration( EXTRACT_CONFIGURATION_MODEL, EXTRACT_CONFIGURATION_MODEL.toBuilder().build()); ExtractJobConfiguration modelJob = - EXTRACT_CONFIGURATION_MODEL - .toBuilder() + EXTRACT_CONFIGURATION_MODEL.toBuilder() .setSourceModel(ModelId.of("dataset", "newModel")) .build(); assertEquals("newModel", modelJob.getSourceModel().getModel()); @@ -102,8 +101,7 @@ public void testToBuilder() { compareExtractJobConfiguration( EXTRACT_CONFIGURATION_AVRO, EXTRACT_CONFIGURATION_AVRO.toBuilder().build()); ExtractJobConfiguration avroJob = - EXTRACT_CONFIGURATION_AVRO - .toBuilder() + EXTRACT_CONFIGURATION_AVRO.toBuilder() .setSourceTable(TableId.of("dataset", "avroTable")) .build(); assertEquals("avroTable", avroJob.getSourceTable().getTable()); @@ -223,15 +221,13 @@ public void testSetProjectId() { @Test public void testSetProjectIdDoNotOverride() { ExtractJobConfiguration configuration = - EXTRACT_CONFIGURATION - .toBuilder() + EXTRACT_CONFIGURATION.toBuilder() .setSourceTable(TABLE_ID.setProjectId(TEST_PROJECT_ID)) .build() .setProjectId("do-not-update"); assertEquals(TEST_PROJECT_ID, configuration.getSourceTable().getProject()); ExtractJobConfiguration modelConfiguration = - EXTRACT_CONFIGURATION_MODEL - .toBuilder() + EXTRACT_CONFIGURATION_MODEL.toBuilder() .setSourceModel(MODEL_ID.setProjectId(TEST_PROJECT_ID)) .build() .setProjectId("do-not-update"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java index 5cb2b418f2..1ebd93ef42 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java @@ -54,8 +54,7 @@ public void testToBuilder() { .setReferencedColumn("to2") .build()); ForeignKey foreignKey = - FOREIGN_KEY - .toBuilder() + FOREIGN_KEY.toBuilder() .setName("test") .setReferencedTable(referencedTable) .setColumnReferences(columnReferences) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java index d286358ca1..efbee79b69 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java @@ -44,16 +44,14 @@ public void testToBuilder() { compareGoogleSheetsOptions( GOOGLE_SHEETS_OPTIONS_RANGE, GOOGLE_SHEETS_OPTIONS_RANGE.toBuilder().build()); GoogleSheetsOptions googleSheetsOptionsRange = - GOOGLE_SHEETS_OPTIONS_RANGE - .toBuilder() + GOOGLE_SHEETS_OPTIONS_RANGE.toBuilder() .setSkipLeadingRows(123) .setRange("sheet1!A1:A100") .build(); assertThat(googleSheetsOptionsRange.getSkipLeadingRows()).isEqualTo(123); assertThat(googleSheetsOptionsRange.getRange()).isEqualTo("sheet1!A1:A100"); googleSheetsOptionsRange = - googleSheetsOptionsRange - .toBuilder() + googleSheetsOptionsRange.toBuilder() .setSkipLeadingRows(SKIP_LEADING_ROWS) .setRange(RANGE) .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 85709a74a2..92a6171875 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -151,8 +151,7 @@ public class LoadJobConfigurationTest { public void testToBuilder() { compareLoadJobConfiguration(LOAD_CONFIGURATION_CSV, LOAD_CONFIGURATION_CSV.toBuilder().build()); LoadJobConfiguration configurationCSV = - LOAD_CONFIGURATION_CSV - .toBuilder() + LOAD_CONFIGURATION_CSV.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", configurationCSV.getDestinationTable().getTable()); @@ -162,8 +161,7 @@ public void testToBuilder() { compareLoadJobConfiguration( LOAD_CONFIGURATION_BACKUP, LOAD_CONFIGURATION_BACKUP.toBuilder().build()); LoadJobConfiguration configurationBackup = - LOAD_CONFIGURATION_BACKUP - .toBuilder() + LOAD_CONFIGURATION_BACKUP.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", configurationBackup.getDestinationTable().getTable()); @@ -173,8 +171,7 @@ public void testToBuilder() { compareLoadJobConfiguration( LOAD_CONFIGURATION_AVRO, LOAD_CONFIGURATION_AVRO.toBuilder().build()); LoadJobConfiguration configurationAvro = - LOAD_CONFIGURATION_AVRO - .toBuilder() + LOAD_CONFIGURATION_AVRO.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", configurationAvro.getDestinationTable().getTable()); @@ -225,8 +222,7 @@ public void testSetProjectId() { @Test public void testSetProjectIdDoNotOverride() { LoadConfiguration configuration = - LOAD_CONFIGURATION_CSV - .toBuilder() + LOAD_CONFIGURATION_CSV.toBuilder() .setDestinationTable(TABLE_ID.setProjectId(TEST_PROJECT_ID)) .build() .setProjectId("do-not-update"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java index ca21d805c6..c70ac3355e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java @@ -36,8 +36,7 @@ public void testToBuilder() { ParquetOptions parquetOptions = OPTIONS.toBuilder().setEnableListInference(true).build(); assertEquals(true, parquetOptions.getEnableListInference()); parquetOptions = - parquetOptions - .toBuilder() + parquetOptions.toBuilder() .setEnumAsString(true) .setMapTargetType("ARRAY_OF_STRUCT") .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index f71e152e62..9dd3930044 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -141,14 +141,12 @@ public class QueryJobConfigurationTest { .setParameterMode(PARAMETER_MODE) .build(); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_ADD_POSITIONAL_PARAMETER = - QUERY_JOB_CONFIGURATION - .toBuilder() + QUERY_JOB_CONFIGURATION.toBuilder() .setPositionalParameters(ImmutableList.of()) .addPositionalParameter(STRING_PARAMETER) .build(); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SET_NAME_PARAMETER = - QUERY_JOB_CONFIGURATION - .toBuilder() + QUERY_JOB_CONFIGURATION.toBuilder() .setPositionalParameters(ImmutableList.of()) .setNamedParameters(NAME_PARAMETER) .build(); @@ -206,8 +204,7 @@ public void testSetProjectId() { @Test public void testSetProjectIdDoNotOverride() { QueryJobConfiguration configuration = - QUERY_JOB_CONFIGURATION - .toBuilder() + QUERY_JOB_CONFIGURATION.toBuilder() .setDestinationTable(TABLE_ID.setProjectId(TEST_PROJECT_ID)) .build() .setProjectId("update-only-on-dataset"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java index ae061b62f8..145dc8914c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java @@ -52,8 +52,7 @@ public class RoutineInfoTest { private static final String BODY = "body"; private static final RoutineInfo ROUTINE_INFO = - RoutineInfo.of(ROUTINE_ID) - .toBuilder() + RoutineInfo.of(ROUTINE_ID).toBuilder() .setEtag(ETAG) .setRoutineType(ROUTINE_TYPE) .setCreationTime(CREATION_TIME) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java index 05f3bbf41c..7d0f57ef76 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java @@ -81,8 +81,7 @@ public void testToBuilder() { .build(); TableConstraints tableConstraints = - TABLE_CONSTRAINTS - .toBuilder() + TABLE_CONSTRAINTS.toBuilder() .setForeignKeys(Arrays.asList(foreignKey1, foreignKey2)) .setPrimaryKey(primaryKey) .build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java index 7b912ce2bb..240f12185c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java @@ -124,8 +124,7 @@ public class WriteChannelConfigurationTest { public void testToBuilder() { compareLoadConfiguration(LOAD_CONFIGURATION_CSV, LOAD_CONFIGURATION_CSV.toBuilder().build()); WriteChannelConfiguration configuration = - LOAD_CONFIGURATION_CSV - .toBuilder() + LOAD_CONFIGURATION_CSV.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", configuration.getDestinationTable().getTable()); @@ -134,8 +133,7 @@ public void testToBuilder() { compareLoadConfiguration(LOAD_CONFIGURATION_AVRO, LOAD_CONFIGURATION_AVRO.toBuilder().build()); WriteChannelConfiguration configurationAvro = - LOAD_CONFIGURATION_AVRO - .toBuilder() + LOAD_CONFIGURATION_AVRO.toBuilder() .setDestinationTable(TableId.of("dataset", "newTable")) .build(); assertEquals("newTable", configurationAvro.getDestinationTable().getTable()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index a7bf5fa3e0..a28cb20ba2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1284,8 +1284,7 @@ public void testUpdateDataset() { updateLabels.put("a", null); Dataset updatedDataset = bigquery.update( - dataset - .toBuilder() + dataset.toBuilder() .setDescription("Updated Description") .setLabels(updateLabels) .setStorageBillingModel("LOGICAL") @@ -1358,8 +1357,7 @@ public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); Dataset updatedDataset = bigquery.update( - dataset - .toBuilder() + dataset.toBuilder() .setDescription("Updated Description") .setLabels(null) .setAcl(acls) @@ -2040,8 +2038,7 @@ public void testCreateAndUpdateTableWithPolicyTags() throws IOException { fieldList.add(stringFieldWithPolicy); Schema updatedSchemaWithPolicyTag = Schema.of(fieldList); Table updatedTable = - createdTableForUpdate - .toBuilder() + createdTableForUpdate.toBuilder() .setDefinition(StandardTableDefinition.of(updatedSchemaWithPolicyTag)) .build(); updatedTable.update(); @@ -2411,14 +2408,10 @@ public void testUpdatePermExternableTableWithAutodetectSchemaUpdatesSchema() { Table updatedTable = bigquery.update( - createdTable - .toBuilder() + createdTable.toBuilder() .setDefinition( ((ExternalTableDefinition) createdTable.getDefinition()) - .toBuilder() - .setSchema(null) - .setAutodetect(true) - .build()) + .toBuilder().setSchema(null).setAutodetect(true).build()) .build(), BigQuery.TableOption.autodetectSchema(true)); // Schema should change. @@ -2518,8 +2511,7 @@ public void testTableIAM() { // get and modify policy Policy policy = bigquery.getIamPolicy(tableId); Policy editedPolicy = - policy - .toBuilder() + policy.toBuilder() .addIdentity(Role.of("roles/bigquery.dataViewer"), Identity.allUsers()) .build(); Policy updatedPolicy = bigquery.setIamPolicy(tableId, editedPolicy); @@ -2655,8 +2647,7 @@ public void testUpdateTable() { updateLabels.put("a", null); Table updatedTable = bigquery.update( - createdTable - .toBuilder() + createdTable.toBuilder() .setDescription("Updated Description") .setLabels(updateLabels) .build()); @@ -2685,11 +2676,9 @@ public void testUpdateTimePartitioning() { .isNull(); table = - table - .toBuilder() + table.toBuilder() .setDefinition( - tableDefinition - .toBuilder() + tableDefinition.toBuilder() .setTimePartitioning(TimePartitioning.of(Type.DAY, 42L)) .build()) .build() @@ -2700,11 +2689,9 @@ public void testUpdateTimePartitioning() { .isEqualTo(42L); table = - table - .toBuilder() + table.toBuilder() .setDefinition( - tableDefinition - .toBuilder() + tableDefinition.toBuilder() .setTimePartitioning(TimePartitioning.of(Type.DAY)) .build()) .build() @@ -3144,8 +3131,7 @@ public void testRoutineLifecycle() throws InterruptedException { // Mutate metadata. RoutineInfo newInfo = - routine - .toBuilder() + routine.toBuilder() .setBody("x * 4") .setReturnType(routine.getReturnType()) .setArguments(routine.getArguments()) @@ -3578,9 +3564,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { // Create a new bigQuery object but explicitly set the credentials. RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = - bigqueryHelper - .getOptions() - .toBuilder() + bigqueryHelper.getOptions().toBuilder() .setCredentials(bigquery.getOptions().getCredentials()) .build(); BigQuery bigQueryGoodCredentials = bigQueryOptions.getService(); @@ -3602,9 +3586,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { // Scenario 2. // Create a new bigQuery object but explicitly an invalid credential. BigQueryOptions bigQueryOptionsBadCredentials = - bigqueryHelper - .getOptions() - .toBuilder() + bigqueryHelper.getOptions().toBuilder() .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_GOOGLE_DOMAIN)) .build(); BigQuery bigQueryBadCredentials = bigQueryOptionsBadCredentials.getService(); @@ -4090,7 +4072,8 @@ public void testReadAPIIterationAndOrder() @Test public void testReadAPIIterationAndOrderAsync() - throws SQLException, ExecutionException, + throws SQLException, + ExecutionException, InterruptedException { // use read API to read 300K records and check the order String query = "SELECT date, county, state_name, confirmed_cases, deaths / 10 FROM " @@ -4137,7 +4120,8 @@ public void testReadAPIIterationAndOrderAsync() // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the // specified amount of time public void testExecuteSelectAsyncCancel() - throws SQLException, ExecutionException, + throws SQLException, + ExecutionException, InterruptedException { // use read API to read 300K records and check the order String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " @@ -4183,7 +4167,8 @@ public void testExecuteSelectAsyncCancel() // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the // specified amount of time public void testExecuteSelectAsyncTimeout() - throws SQLException, ExecutionException, + throws SQLException, + ExecutionException, InterruptedException { // use read API to read 300K records and check the order String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " @@ -7219,9 +7204,7 @@ public void testStatelessQueriesWithLocation() throws Exception { public void testUniverseDomainWithInvalidUniverseDomain() { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = - bigqueryHelper - .getOptions() - .toBuilder() + bigqueryHelper.getOptions().toBuilder() .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_GOOGLE_DOMAIN)) .setUniverseDomain("invalid.domain") .build(); @@ -7245,9 +7228,7 @@ public void testUniverseDomainWithInvalidUniverseDomain() { public void testInvalidUniverseDomainWithMismatchCredentials() { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = - bigqueryHelper - .getOptions() - .toBuilder() + bigqueryHelper.getOptions().toBuilder() .setCredentials(loadCredentials(FAKE_JSON_CRED_WITH_INVALID_DOMAIN)) .build(); BigQuery bigQuery = bigQueryOptions.getService(); diff --git a/pom.xml b/pom.xml index da71f55ede..afdb556d22 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.45.1 + 3.46.0 From cf9cb5047d783353c47feb83b7068f0320e5a131 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 24 Apr 2025 14:33:12 -0400 Subject: [PATCH 2052/2268] build: introduce testing infra for GraalVM "C" (#3751) * build: introduce testing infra for GraalVM "C" * chore: use nightly jobs * chore: delete nightly jobs * chore: update images to the latest --- .kokoro/build.sh | 5 --- ...raalvm-native.cfg => graalvm-native-a.cfg} | 2 +- ...lvm-native-17.cfg => graalvm-native-b.cfg} | 4 +- .../graalvm-native-c.cfg} | 7 +++- .kokoro/nightly/graalvm-native-17.cfg | 38 ------------------- .kokoro/nightly/graalvm-native.cfg | 38 ------------------- .kokoro/presubmit/graalvm-native-17.cfg | 33 ---------------- 7 files changed, 9 insertions(+), 118 deletions(-) rename .kokoro/continuous/{graalvm-native.cfg => graalvm-native-a.cfg} (98%) rename .kokoro/continuous/{graalvm-native-17.cfg => graalvm-native-b.cfg} (95%) rename .kokoro/{presubmit/graalvm-native.cfg => continuous/graalvm-native-c.cfg} (90%) delete mode 100644 .kokoro/nightly/graalvm-native-17.cfg delete mode 100644 .kokoro/nightly/graalvm-native.cfg delete mode 100644 .kokoro/presubmit/graalvm-native-17.cfg diff --git a/.kokoro/build.sh b/.kokoro/build.sh index cefb94a703..084b07b25b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -75,11 +75,6 @@ graalvm) mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; -graalvm17) - # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test - RETURN_CODE=$? - ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. diff --git a/.kokoro/continuous/graalvm-native.cfg b/.kokoro/continuous/graalvm-native-a.cfg similarity index 98% rename from .kokoro/continuous/graalvm-native.cfg rename to .kokoro/continuous/graalvm-native-a.cfg index 1a6cc8cce1..6ae3c9e81b 100644 --- a/.kokoro/continuous/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-17.cfg b/.kokoro/continuous/graalvm-native-b.cfg similarity index 95% rename from .kokoro/continuous/graalvm-native-17.cfg rename to .kokoro/continuous/graalvm-native-b.cfg index 7d68556e9d..821f86ccae 100644 --- a/.kokoro/continuous/graalvm-native-17.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,12 +3,12 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.2" } env_vars: { key: "JOB_TYPE" - value: "graalvm17" + value: "graalvm" } # TODO: remove this after we've migrated all tests and scripts diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/continuous/graalvm-native-c.cfg similarity index 90% rename from .kokoro/presubmit/graalvm-native.cfg rename to .kokoro/continuous/graalvm-native-c.cfg index 4477760a67..16e3d4ca40 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.2" } env_vars: { @@ -31,3 +31,8 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-it-service-account" } + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file diff --git a/.kokoro/nightly/graalvm-native-17.cfg b/.kokoro/nightly/graalvm-native-17.cfg deleted file mode 100644 index 15ed86292b..0000000000 --- a/.kokoro/nightly/graalvm-native-17.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17" -} - -env_vars: { - key: "JOB_TYPE" - value: "nightly-graalvm17" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "true" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} \ No newline at end of file diff --git a/.kokoro/nightly/graalvm-native.cfg b/.kokoro/nightly/graalvm-native.cfg deleted file mode 100644 index 57c1e35116..0000000000 --- a/.kokoro/nightly/graalvm-native.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" -} - -env_vars: { - key: "JOB_TYPE" - value: "nightly-graalvm" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "ENABLE_FLAKYBOT" - value: "true" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg deleted file mode 100644 index fd82cff87f..0000000000 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.0"" -} - -env_vars: { - key: "JOB_TYPE" - value: "graalvm17" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "gcloud-devel" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/java-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "java-it-service-account" -} \ No newline at end of file From b71bd8f71d52a11026cac7dd6a98d71e9f2bc798 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 01:53:43 -0400 Subject: [PATCH 2053/2268] chore(main): release 2.49.1 (#3739) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4937424c6..a9100a72b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.49.1](https://github.com/googleapis/java-bigquery/compare/v2.49.0...v2.49.1) (2025-04-24) + + +### Bug Fixes + +* Add labels to converter for listTables method ([#3735](https://github.com/googleapis/java-bigquery/issues/3735)) ([#3736](https://github.com/googleapis/java-bigquery/issues/3736)) ([8634822](https://github.com/googleapis/java-bigquery/commit/8634822e1836c5ccc0f8d0263ac57ac561578360)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.46.0 ([#3753](https://github.com/googleapis/java-bigquery/issues/3753)) ([a335927](https://github.com/googleapis/java-bigquery/commit/a335927e16d0907d62e584f08fa8393daae40354)) +* Update netty.version to v4.2.0.final ([#3745](https://github.com/googleapis/java-bigquery/issues/3745)) ([bb811c0](https://github.com/googleapis/java-bigquery/commit/bb811c068b3efabf04fbe67dbb2979d562c604d9)) + ## [2.49.0](https://github.com/googleapis/java-bigquery/compare/v2.48.1...v2.49.0) (2025-03-20) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7cb5546d4c..3581e19ebe 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.1-SNAPSHOT + 2.49.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 551570be20..3b40c2e587 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.1-SNAPSHOT + 2.49.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1-SNAPSHOT + 2.49.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4530d892dc..fd0f5903f4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.1-SNAPSHOT + 2.49.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.1-SNAPSHOT + 2.49.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index afdb556d22..9c16da0d91 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.1-SNAPSHOT + 2.49.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1-SNAPSHOT + 2.49.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b40b150b5d..cee32cc66f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1-SNAPSHOT + 2.49.1 diff --git a/versions.txt b/versions.txt index 726d760777..83f8dfdab5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.0:2.49.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.49.1:2.49.1 \ No newline at end of file From 907e39fd467f972863deeb86356fc3bfb989a76d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 25 Apr 2025 17:25:26 +0100 Subject: [PATCH 2054/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.46.2 (#3756) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 26ecb69daa..1e7c416f91 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.2 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3b40c2e587..f178636f2e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.46.0 + 3.46.2 diff --git a/pom.xml b/pom.xml index 9c16da0d91..ba18613347 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.46.0 + 3.46.2 From b9c4200f39ca0421e690eaa363a7f0c978e17b0c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 26 Apr 2025 04:05:20 +0200 Subject: [PATCH 2055/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.13.0 (#3759) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ba18613347..d9bb505b74 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.12.0 + 3.13.0 pom import From 7c69e57205d3d75bb469ecbf8425a8555f31ae3a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 22:31:30 -0400 Subject: [PATCH 2056/2268] chore(main): release 2.49.2-SNAPSHOT (#3757) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 3581e19ebe..7d2f387fba 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.1 + 2.49.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index f178636f2e..3f738a6e15 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.1 + 2.49.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1 + 2.49.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index fd0f5903f4..655d947374 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.1 + 2.49.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.1 + 2.49.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d9bb505b74..130ad9596e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.1 + 2.49.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1 + 2.49.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index cee32cc66f..aeddb1794e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.1 + 2.49.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 83f8dfdab5..ff13f1e599 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.1:2.49.1 \ No newline at end of file +google-cloud-bigquery:2.49.1:2.49.2-SNAPSHOT \ No newline at end of file From fa0259569d31b8e904eb3a2bf7d769ff5c3aef56 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 00:28:09 -0400 Subject: [PATCH 2057/2268] chore(main): release 2.49.2 (#3761) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9100a72b8..a3a03a1a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.49.2](https://github.com/googleapis/java-bigquery/compare/v2.49.1...v2.49.2) (2025-04-26) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.46.2 ([#3756](https://github.com/googleapis/java-bigquery/issues/3756)) ([907e39f](https://github.com/googleapis/java-bigquery/commit/907e39fd467f972863deeb86356fc3bfb989a76d)) + ## [2.49.1](https://github.com/googleapis/java-bigquery/compare/v2.49.0...v2.49.1) (2025-04-24) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 7d2f387fba..520483d9d8 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.2-SNAPSHOT + 2.49.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3f738a6e15..3bdc365cee 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.2-SNAPSHOT + 2.49.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2-SNAPSHOT + 2.49.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 655d947374..aa47da579a 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.2-SNAPSHOT + 2.49.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.2-SNAPSHOT + 2.49.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 130ad9596e..18df2eb771 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.2-SNAPSHOT + 2.49.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2-SNAPSHOT + 2.49.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index aeddb1794e..130fb5b56a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2-SNAPSHOT + 2.49.2 diff --git a/versions.txt b/versions.txt index ff13f1e599..e16a23c8dd 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.1:2.49.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.49.2:2.49.2 \ No newline at end of file From acea61c20b69b44c8612ca22745458ad04bc6be4 Mon Sep 17 00:00:00 2001 From: shollyman Date: Mon, 28 Apr 2025 07:17:26 -0700 Subject: [PATCH 2058/2268] feat: add WRITE_TRUNCATE_DATA as an enum value for write disposition (#3752) * feat: add WRITE_TRUNCATE_DATA as an enum value for write disposition For existing tables, WRITE_TRUNCATE_DATA preserves schema/constraints and replaces data. internal issue: b/406848221 * formatting --- .../src/main/java/com/google/cloud/bigquery/JobInfo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java index 8f571ff551..fdf1b6e606 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java @@ -66,6 +66,12 @@ public enum WriteDisposition { /** Configures the job to overwrite the table data if table already exists. */ WRITE_TRUNCATE, + /** + * Configures the job to retain schema and constraints on an existing table, and truncate and + * replace data. + */ + WRITE_TRUNCATE_DATA, + /** Configures the job to append data to the table if it already exists. */ WRITE_APPEND, From 1381c8fe6c2552eec4519304c71697302733d6c7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 28 Apr 2025 16:49:14 +0200 Subject: [PATCH 2059/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250404-2.0.0 (#3754) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 18df2eb771..df75cc5382 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250313-2.0.0 + v2-rev20250404-2.0.0 From 2e026b27753f2badef1fab1dfa3ca24c91720839 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 28 Apr 2025 16:49:36 +0200 Subject: [PATCH 2060/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.51.0 (#3755) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df75cc5382..603c8478f2 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.50.0 + 2.51.0 test From eda96709f537019d348c01b9eb269be0dc102654 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 28 Apr 2025 16:49:56 +0200 Subject: [PATCH 2061/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.49.2 (#3758) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 30f14f205f..f74e1feae1 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.49.0 + 2.49.2 From f19eaa9b782f4e8419fc2ae42c05458f7814d14c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Apr 2025 22:03:07 +0200 Subject: [PATCH 2062/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.58.1 (#3764) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index f74e1feae1..c53041c7cd 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.57.3 + 2.58.1 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 130fb5b56a..0ed571f2c6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.57.3 + 2.58.1 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 86e77230a7..0f13a2e87f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.57.3 + 2.58.1 test From 2b033ba559b99728ed696212557a0657ea16a312 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 29 Apr 2025 22:03:19 +0200 Subject: [PATCH 2063/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.52.0 (#3765) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 603c8478f2..98138818ef 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.51.0 + 2.52.0 test From 3df4f2745ee745f717eeeab56bdbe9263d2649e0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:03:26 -0400 Subject: [PATCH 2064/2268] chore(main): release 2.49.3-SNAPSHOT (#3762) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 520483d9d8..a7681d23d6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.2 + 2.49.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3bdc365cee..123beae598 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.2 + 2.49.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2 + 2.49.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index aa47da579a..87f9e9bbd5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.2 + 2.49.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.2 + 2.49.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 98138818ef..2979a1ef53 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.2 + 2.49.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2 + 2.49.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 0ed571f2c6..c8c7f54f5d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2 + 2.49.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index e16a23c8dd..41a9363da6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.2:2.49.2 \ No newline at end of file +google-cloud-bigquery:2.49.2:2.49.3-SNAPSHOT \ No newline at end of file From 3e97f7c0c4676fcdda0862929a69bbabc69926f2 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Wed, 30 Apr 2025 14:16:48 -0700 Subject: [PATCH 2065/2268] feat(bigquery): Add support for reservation field in jobs. (#3768) --- .../cloud/bigquery/CopyJobConfiguration.java | 34 +++++++++++++++++-- .../bigquery/ExtractJobConfiguration.java | 34 +++++++++++++++++-- .../cloud/bigquery/LoadJobConfiguration.java | 33 ++++++++++++++++-- .../cloud/bigquery/QueryJobConfiguration.java | 34 +++++++++++++++++-- .../cloud/bigquery/QueryRequestInfo.java | 9 ++++- .../bigquery/CopyJobConfigurationTest.java | 4 +++ .../bigquery/ExtractJobConfigurationTest.java | 7 ++++ .../bigquery/LoadJobConfigurationTest.java | 5 +++ .../bigquery/QueryJobConfigurationTest.java | 4 +++ .../cloud/bigquery/QueryRequestInfoTest.java | 4 +++ 10 files changed, 158 insertions(+), 10 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java index 37955fec09..54e612271f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java @@ -45,6 +45,7 @@ public final class CopyJobConfiguration extends JobConfiguration { private final EncryptionConfiguration destinationEncryptionConfiguration; private final Map labels; private final Long jobTimeoutMs; + private final String reservation; public static final class Builder extends JobConfiguration.Builder { @@ -58,6 +59,7 @@ public static final class Builder private EncryptionConfiguration destinationEncryptionConfiguration; private Map labels; private Long jobTimeoutMs; + private String reservation; private Builder() { super(Type.COPY); @@ -74,6 +76,7 @@ private Builder(CopyJobConfiguration jobConfiguration) { this.destinationEncryptionConfiguration = jobConfiguration.destinationEncryptionConfiguration; this.labels = jobConfiguration.labels; this.jobTimeoutMs = jobConfiguration.jobTimeoutMs; + this.reservation = jobConfiguration.reservation; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -113,6 +116,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (configurationPb.getJobTimeoutMs() != null) { this.jobTimeoutMs = configurationPb.getJobTimeoutMs(); } + if (configurationPb.getReservation() != null) { + this.reservation = configurationPb.getReservation(); + } } /** Sets the source tables to copy. */ @@ -201,6 +207,19 @@ public Builder setJobTimeoutMs(Long jobTimeoutMs) { return this; } + /** + * [Optional] The reservation that job would use. User can specify a reservation to execute the + * job. If reservation is not set, reservation is determined based on the rules defined by the + * reservation assignments. The expected format is + * `projects/{project}/locations/{location}/reservations/{reservation}`. + * + * @param reservation reservation or {@code null} for none + */ + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + public CopyJobConfiguration build() { return new CopyJobConfiguration(this); } @@ -217,6 +236,7 @@ private CopyJobConfiguration(Builder builder) { this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration; this.labels = builder.labels; this.jobTimeoutMs = builder.jobTimeoutMs; + this.reservation = builder.reservation; } /** Returns the source tables to copy. */ @@ -275,6 +295,11 @@ public Long getJobTimeoutMs() { return jobTimeoutMs; } + /** Returns the reservation associated with this job */ + public String getReservation() { + return reservation; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -291,7 +316,8 @@ ToStringHelper toStringHelper() { .add("createDisposition", createDisposition) .add("writeDisposition", writeDisposition) .add("labels", labels) - .add("jobTimeoutMs", jobTimeoutMs); + .add("jobTimeoutMs", jobTimeoutMs) + .add("reservation", reservation); } @Override @@ -311,7 +337,8 @@ public int hashCode() { createDisposition, writeDisposition, labels, - jobTimeoutMs); + jobTimeoutMs, + reservation); } @Override @@ -366,6 +393,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (jobTimeoutMs != null) { jobConfiguration.setJobTimeoutMs(jobTimeoutMs); } + if (reservation != null) { + jobConfiguration.setReservation(reservation); + } jobConfiguration.setCopy(configurationPb); return jobConfiguration; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java index 29a256e9eb..d79959ee04 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExtractJobConfiguration.java @@ -47,6 +47,7 @@ public final class ExtractJobConfiguration extends JobConfiguration { private final Boolean useAvroLogicalTypes; private final Map labels; private final Long jobTimeoutMs; + private final String reservation; public static final class Builder extends JobConfiguration.Builder { @@ -61,6 +62,7 @@ public static final class Builder private Boolean useAvroLogicalTypes; private Map labels; private Long jobTimeoutMs; + private String reservation; private Builder() { super(Type.EXTRACT); @@ -78,6 +80,7 @@ private Builder(ExtractJobConfiguration jobInfo) { this.useAvroLogicalTypes = jobInfo.useAvroLogicalTypes; this.labels = jobInfo.labels; this.jobTimeoutMs = jobInfo.jobTimeoutMs; + this.reservation = jobInfo.reservation; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -101,6 +104,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (configurationPb.getJobTimeoutMs() != null) { this.jobTimeoutMs = configurationPb.getJobTimeoutMs(); } + if (configurationPb.getReservation() != null) { + this.reservation = configurationPb.getReservation(); + } } /** Sets the table to export. */ @@ -198,6 +204,19 @@ public Builder setJobTimeoutMs(Long jobTimeoutMs) { return this; } + /** + * [Optional] The reservation that job would use. User can specify a reservation to execute the + * job. If reservation is not set, reservation is determined based on the rules defined by the + * reservation assignments. The expected format is + * `projects/{project}/locations/{location}/reservations/{reservation}`. + * + * @param reservation reservation or {@code null} for none + */ + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + public ExtractJobConfiguration build() { return new ExtractJobConfiguration(this); } @@ -215,6 +234,7 @@ private ExtractJobConfiguration(Builder builder) { this.useAvroLogicalTypes = builder.useAvroLogicalTypes; this.labels = builder.labels; this.jobTimeoutMs = builder.jobTimeoutMs; + this.reservation = builder.reservation; } /** Returns the table to export. */ @@ -274,6 +294,11 @@ public Long getJobTimeoutMs() { return jobTimeoutMs; } + /** Returns the reservation associated with this job */ + public String getReservation() { + return reservation; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -291,7 +316,8 @@ ToStringHelper toStringHelper() { .add("compression", compression) .add("useAvroLogicalTypes", useAvroLogicalTypes) .add("labels", labels) - .add("jobTimeoutMs", jobTimeoutMs); + .add("jobTimeoutMs", jobTimeoutMs) + .add("reservation", reservation); } @Override @@ -313,7 +339,8 @@ public int hashCode() { compression, useAvroLogicalTypes, labels, - jobTimeoutMs); + jobTimeoutMs, + reservation); } @Override @@ -350,6 +377,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (jobTimeoutMs != null) { jobConfiguration.setJobTimeoutMs(jobTimeoutMs); } + if (reservation != null) { + jobConfiguration.setReservation(reservation); + } jobConfiguration.setExtract(extractConfigurationPb); return jobConfiguration; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 2d348f0d45..5d17554597 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -60,10 +60,9 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final RangePartitioning rangePartitioning; private final HivePartitioningOptions hivePartitioningOptions; private final String referenceFileSchemaUri; - private final List connectionProperties; - private final Boolean createSession; + private final String reservation; public static final class Builder extends JobConfiguration.Builder implements LoadConfiguration.Builder { @@ -95,6 +94,7 @@ public static final class Builder extends JobConfiguration.Builder connectionProperties; private Boolean createSession; + private String reservation; private Builder() { super(Type.LOAD); @@ -128,6 +128,7 @@ private Builder(LoadJobConfiguration loadConfiguration) { this.referenceFileSchemaUri = loadConfiguration.referenceFileSchemaUri; this.connectionProperties = loadConfiguration.connectionProperties; this.createSession = loadConfiguration.createSession; + this.reservation = loadConfiguration.reservation; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -234,6 +235,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur loadConfigurationPb.getConnectionProperties(), ConnectionProperty.FROM_PB_FUNCTION); } createSession = loadConfigurationPb.getCreateSession(); + if (configurationPb.getReservation() != null) { + this.reservation = configurationPb.getReservation(); + } } @Override @@ -432,6 +436,19 @@ public Builder setCreateSession(Boolean createSession) { return this; } + /** + * [Optional] The reservation that job would use. User can specify a reservation to execute the + * job. If reservation is not set, reservation is determined based on the rules defined by the + * reservation assignments. The expected format is + * `projects/{project}/locations/{location}/reservations/{reservation}`. + * + * @param reservation reservation or {@code null} for none + */ + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + @Override public LoadJobConfiguration build() { return new LoadJobConfiguration(this); @@ -465,6 +482,7 @@ private LoadJobConfiguration(Builder builder) { this.referenceFileSchemaUri = builder.referenceFileSchemaUri; this.connectionProperties = builder.connectionProperties; this.createSession = builder.createSession; + this.reservation = builder.reservation; } @Override @@ -611,6 +629,11 @@ public Boolean getCreateSession() { return createSession; } + /** Returns the reservation associated with this job */ + public String getReservation() { + return reservation; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -643,7 +666,8 @@ ToStringHelper toStringHelper() { .add("hivePartitioningOptions", hivePartitioningOptions) .add("referenceFileSchemaUri", referenceFileSchemaUri) .add("connectionProperties", connectionProperties) - .add("createSession", createSession); + .add("createSession", createSession) + .add("reservation", reservation); } @Override @@ -762,6 +786,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (createSession != null) { loadConfigurationPb.setCreateSession(createSession); } + if (reservation != null) { + jobConfiguration.setReservation(reservation); + } jobConfiguration.setLoad(loadConfigurationPb); return jobConfiguration; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 0ad85137b2..b460b6121a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -74,6 +74,7 @@ public final class QueryJobConfiguration extends JobConfiguration { // maxResults is only used for fast query path private final Long maxResults; private final JobCreationMode jobCreationMode; + private final String reservation; /** * Priority levels for a query. If not specified the priority is assumed to be {@link @@ -142,6 +143,7 @@ public static final class Builder private List connectionProperties; private Long maxResults; private JobCreationMode jobCreationMode; + private String reservation; private Builder() { super(Type.QUERY); @@ -178,6 +180,7 @@ private Builder(QueryJobConfiguration jobConfiguration) { this.connectionProperties = jobConfiguration.connectionProperties; this.maxResults = jobConfiguration.maxResults; this.jobCreationMode = jobConfiguration.jobCreationMode; + this.reservation = jobConfiguration.reservation; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -285,6 +288,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur queryConfigurationPb.getConnectionProperties(), ConnectionProperty.FROM_PB_FUNCTION); } + if (configurationPb.getReservation() != null) { + this.reservation = configurationPb.getReservation(); + } } /** Sets the BigQuery SQL query to execute. */ @@ -682,6 +688,19 @@ Builder setJobCreationMode(JobCreationMode jobCreationMode) { return this; } + /** + * [Optional] The reservation that job would use. User can specify a reservation to execute the + * job. If reservation is not set, reservation is determined based on the rules defined by the + * reservation assignments. The expected format is + * `projects/{project}/locations/{location}/reservations/{reservation}`. + * + * @param reservation reservation or {@code null} for none + */ + public Builder setReservation(String reservation) { + this.reservation = reservation; + return this; + } + public QueryJobConfiguration build() { return new QueryJobConfiguration(this); } @@ -727,6 +746,7 @@ private QueryJobConfiguration(Builder builder) { this.connectionProperties = builder.connectionProperties; this.maxResults = builder.maxResults; this.jobCreationMode = builder.jobCreationMode; + this.reservation = builder.reservation; } /** @@ -943,6 +963,11 @@ JobCreationMode getJobCreationMode() { return jobCreationMode; } + /** Returns the reservation associated with this job */ + public String getReservation() { + return reservation; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -978,7 +1003,8 @@ ToStringHelper toStringHelper() { .add("labels", labels) .add("rangePartitioning", rangePartitioning) .add("connectionProperties", connectionProperties) - .add("jobCreationMode", jobCreationMode); + .add("jobCreationMode", jobCreationMode) + .add("reservation", reservation); } @Override @@ -1016,7 +1042,8 @@ public int hashCode() { jobTimeoutMs, labels, rangePartitioning, - connectionProperties); + connectionProperties, + reservation); } @Override @@ -1125,6 +1152,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { queryConfigurationPb.setConnectionProperties( Lists.transform(connectionProperties, ConnectionProperty.TO_PB_FUNCTION)); } + if (reservation != null) { + configurationPb.setReservation(reservation); + } configurationPb.setQuery(queryConfigurationPb); return configurationPb; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 1a56872a15..7eebfea96d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -44,6 +44,7 @@ final class QueryRequestInfo { private final Boolean useLegacySql; private final JobCreationMode jobCreationMode; private final DataFormatOptions formatOptions; + private final String reservation; QueryRequestInfo(QueryJobConfiguration config, Boolean useInt64Timestamps) { this.config = config; @@ -61,6 +62,7 @@ final class QueryRequestInfo { this.useQueryCache = config.useQueryCache(); this.jobCreationMode = config.getJobCreationMode(); this.formatOptions = new DataFormatOptions().setUseInt64Timestamp(useInt64Timestamps); + this.reservation = config.getReservation(); } boolean isFastQuerySupported(JobId jobId) { @@ -128,6 +130,9 @@ QueryRequest toPb() { if (formatOptions != null) { request.setFormatOptions(formatOptions); } + if (reservation != null) { + request.setReservation(reservation); + } return request; } @@ -148,6 +153,7 @@ public String toString() { .add("useLegacySql", useLegacySql) .add("jobCreationMode", jobCreationMode) .add("formatOptions", formatOptions.getUseInt64Timestamp()) + .add("reservation", reservation) .toString(); } @@ -167,7 +173,8 @@ public int hashCode() { useQueryCache, useLegacySql, jobCreationMode, - formatOptions); + formatOptions, + reservation); } @Override diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java index 70a4983df7..3f21bf1c05 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java @@ -44,6 +44,7 @@ public class CopyJobConfigurationTest { EncryptionConfiguration.newBuilder().setKmsKeyName("KMS_KEY_1").build(); private static final Map LABELS = ImmutableMap.of("job-name", "copy"); private static final Long TIMEOUT = 10L; + private static final String RESERVATION = "reservation"; private static final CopyJobConfiguration COPY_JOB_CONFIGURATION = CopyJobConfiguration.newBuilder(DESTINATION_TABLE, SOURCE_TABLE) .setCreateDisposition(CREATE_DISPOSITION) @@ -51,6 +52,7 @@ public class CopyJobConfigurationTest { .setDestinationEncryptionConfiguration(COPY_JOB_ENCRYPTION_CONFIGURATION) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); private static final CopyJobConfiguration COPY_JOB_CONFIGURATION_MULTIPLE_TABLES = CopyJobConfiguration.newBuilder(DESTINATION_TABLE, SOURCE_TABLES) @@ -58,6 +60,7 @@ public class CopyJobConfigurationTest { .setWriteDisposition(WRITE_DISPOSITION) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); @Test @@ -181,5 +184,6 @@ private void compareCopyJobConfiguration( value.getDestinationEncryptionConfiguration()); assertEquals(expected.getLabels(), value.getLabels()); assertEquals(expected.getJobTimeoutMs(), value.getJobTimeoutMs()); + assertEquals(expected.getReservation(), value.getReservation()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java index ce9e35dddf..2bf1e80a23 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java @@ -43,6 +43,7 @@ public class ExtractJobConfigurationTest { private static final Map LABELS = ImmutableMap.of("test-job-name", "test-extract-job"); private static final Long TIMEOUT = 10L; + private static final String RESERVATION = "reservation"; private static final ExtractJobConfiguration EXTRACT_CONFIGURATION = ExtractJobConfiguration.newBuilder(TABLE_ID, DESTINATION_URIS) .setPrintHeader(PRINT_HEADER) @@ -51,6 +52,7 @@ public class ExtractJobConfigurationTest { .setFormat(FORMAT) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); private static final ExtractJobConfiguration EXTRACT_CONFIGURATION_ONE_URI = ExtractJobConfiguration.newBuilder(TABLE_ID, DESTINATION_URI) @@ -60,6 +62,7 @@ public class ExtractJobConfigurationTest { .setFormat(FORMAT) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); private static final ExtractJobConfiguration EXTRACT_CONFIGURATION_AVRO = ExtractJobConfiguration.newBuilder(TABLE_ID, DESTINATION_URI) @@ -70,6 +73,7 @@ public class ExtractJobConfigurationTest { .setUseAvroLogicalTypes(USEAVROLOGICALTYPES) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); private static final ExtractJobConfiguration EXTRACT_CONFIGURATION_MODEL = ExtractJobConfiguration.newBuilder(MODEL_ID, DESTINATION_URIS) @@ -80,6 +84,7 @@ public class ExtractJobConfigurationTest { .setUseAvroLogicalTypes(USEAVROLOGICALTYPES) .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) + .setReservation(RESERVATION) .build(); @Test @@ -185,6 +190,7 @@ public void testBuilder() { assertEquals(FORMAT, EXTRACT_CONFIGURATION_MODEL.getFormat()); assertEquals(LABELS, EXTRACT_CONFIGURATION_MODEL.getLabels()); assertEquals(TIMEOUT, EXTRACT_CONFIGURATION_MODEL.getJobTimeoutMs()); + assertEquals(RESERVATION, EXTRACT_CONFIGURATION_MODEL.getReservation()); } @Test @@ -256,5 +262,6 @@ private void compareExtractJobConfiguration( assertEquals(expected.getFormat(), value.getFormat()); assertEquals(expected.getLabels(), value.getLabels()); assertEquals(expected.getJobTimeoutMs(), value.getJobTimeoutMs()); + assertEquals(expected.getReservation(), value.getReservation()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 92a6171875..6d181a3287 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -67,6 +67,7 @@ public class LoadJobConfigurationTest { private static final Map LABELS = ImmutableMap.of("test-job-name", "test-load-job"); private static final Long TIMEOUT = 10L; + private static final String RESERVATION = "reservation"; private static final RangePartitioning.Range RANGE = RangePartitioning.Range.newBuilder().setStart(1L).setInterval(2L).setEnd(10L).build(); private static final RangePartitioning RANGE_PARTITIONING = @@ -108,6 +109,7 @@ public class LoadJobConfigurationTest { .setHivePartitioningOptions(HIVE_PARTITIONING_OPTIONS) .setConnectionProperties(CONNECTION_PROPERTIES) .setCreateSession(CREATE_SESSION) + .setReservation(RESERVATION) .build(); private static final DatastoreBackupOptions BACKUP_OPTIONS = @@ -127,6 +129,7 @@ public class LoadJobConfigurationTest { .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) .setRangePartitioning(RANGE_PARTITIONING) + .setReservation(RESERVATION) .build(); private static final LoadJobConfiguration LOAD_CONFIGURATION_AVRO = LoadJobConfiguration.newBuilder(TABLE_ID, SOURCE_URIS) @@ -145,6 +148,7 @@ public class LoadJobConfigurationTest { .setLabels(LABELS) .setJobTimeoutMs(TIMEOUT) .setRangePartitioning(RANGE_PARTITIONING) + .setReservation(RESERVATION) .build(); @Test @@ -266,5 +270,6 @@ private void compareLoadJobConfiguration( assertEquals(expected.getHivePartitioningOptions(), value.getHivePartitioningOptions()); assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); assertEquals(expected.getCreateSession(), value.getCreateSession()); + assertEquals(expected.getReservation(), value.getReservation()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index 9dd3930044..f25aa47eda 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -112,6 +112,7 @@ public class QueryJobConfigurationTest { ImmutableMap.of("string", STRING_PARAMETER, "timestamp", TIMESTAMP_PARAMETER); private static final String PARAMETER_MODE = "POSITIONAL"; private static final JobCreationMode JOB_CREATION_MODE = JobCreationMode.JOB_CREATION_OPTIONAL; + private static final String RESERVATION = "reservation"; private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -139,6 +140,7 @@ public class QueryJobConfigurationTest { .setConnectionProperties(CONNECTION_PROPERTIES) .setPositionalParameters(POSITIONAL_PARAMETER) .setParameterMode(PARAMETER_MODE) + .setReservation(RESERVATION) .build(); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_ADD_POSITIONAL_PARAMETER = QUERY_JOB_CONFIGURATION.toBuilder() @@ -188,6 +190,7 @@ public void testToPbAndFromPb() { assertNotNull(QUERY_JOB_CONFIGURATION.getConnectionProperties()); assertNotNull(QUERY_JOB_CONFIGURATION.getPositionalParameters()); assertNotNull(QUERY_JOB_CONFIGURATION.getNamedParameters()); + assertNotNull(QUERY_JOB_CONFIGURATION.getReservation()); compareQueryJobConfiguration( QUERY_JOB_CONFIGURATION, QueryJobConfiguration.fromPb(QUERY_JOB_CONFIGURATION.toPb())); QueryJobConfiguration job = QueryJobConfiguration.of(QUERY); @@ -271,5 +274,6 @@ private void compareQueryJobConfiguration( assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); assertEquals(expected.getPositionalParameters(), value.getPositionalParameters()); assertEquals(expected.getNamedParameters(), value.getNamedParameters()); + assertEquals(expected.getReservation(), value.getReservation()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 420c014846..ed9effe0b4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -110,6 +110,7 @@ public class QueryRequestInfoTest { ImmutableMap.of("string", STRING_PARAMETER, "timestamp", TIMESTAMP_PARAMETER); private static final JobCreationMode jobCreationModeRequired = JobCreationMode.JOB_CREATION_REQUIRED; + private static final String RESERVATION = "reservation"; private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -137,6 +138,7 @@ public class QueryRequestInfoTest { .setPositionalParameters(POSITIONAL_PARAMETER) .setMaxResults(100L) .setJobCreationMode(jobCreationModeRequired) + .setReservation(RESERVATION) .build(); QueryRequestInfo REQUEST_INFO = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SUPPORTED = @@ -151,6 +153,7 @@ public class QueryRequestInfoTest { .setPositionalParameters(POSITIONAL_PARAMETER) .setCreateSession(CREATE_SESSION) .setMaxResults(100L) + .setReservation(RESERVATION) .build(); QueryRequestInfo REQUEST_INFO_SUPPORTED = new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED, false); @@ -214,5 +217,6 @@ private void compareQueryRequestInfo(QueryRequestInfo expected, QueryRequestInfo assertEquals(expectedQueryReq.getUseLegacySql(), actualQueryReq.getUseLegacySql()); assertEquals(expectedQueryReq.get("jobCreationMode"), actualQueryReq.get("jobCreationMode")); assertEquals(expectedQueryReq.getFormatOptions(), actualQueryReq.getFormatOptions()); + assertEquals(expectedQueryReq.getReservation(), actualQueryReq.getReservation()); } } From 934389eb114d8fbb10c9c125d21ec26d503dca65 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 May 2025 16:12:55 +0200 Subject: [PATCH 2066/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.63.0 (#3770) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2979a1ef53..5ac54a00b5 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.62.0 + 2.63.0 test From c0795fe948e0ca231dbe8fc47c470603cb48ecc8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 May 2025 18:06:17 +0200 Subject: [PATCH 2067/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250427-2.0.0 (#3773) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ac54a00b5..00c96f786e 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250404-2.0.0 + v2-rev20250427-2.0.0 From ab166b6c33c574b4494368709db0443e055b4863 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 May 2025 18:06:28 +0200 Subject: [PATCH 2068/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.46.3 (#3772) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 1e7c416f91..1577125b02 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.3 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 6ae3c9e81b..ccfecbe582 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.3" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 821f86ccae..776dc2d73d 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.3" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 16e3d4ca40..c0fd4ef891 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.3" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 123beae598..d6e05c16a8 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.46.2 + 3.46.3 diff --git a/pom.xml b/pom.xml index 00c96f786e..c97ef128de 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.46.2 + 3.46.3 From 0deef8df1a18838f4234c86e4392fd19206f056d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 May 2025 18:27:19 +0200 Subject: [PATCH 2069/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.52.1 (#3771) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c97ef128de..9cbd68128e 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.52.0 + 2.52.1 test From 231b26345b2b8792c1791414f9b07c159e81b73e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 May 2025 20:08:06 +0200 Subject: [PATCH 2070/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.13.1 (#3777) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9cbd68128e..dd7c02a7b9 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.13.0 + 3.13.1 pom import From 782aa77e76955099a875491c4535bc0d15872edd Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Tue, 6 May 2025 10:59:22 -0400 Subject: [PATCH 2071/2268] fix: fix graalvm native test B (#3775) * fix: fix graalvm native test B * fix: add gax testlib to java-bigquery This includes the necessary build-time initialization flags (see [properties file](https://github.com/googleapis/sdk-platform-java/blob/1eb107d1c09d8a2182fe0f550bf23e3ca3ac414f/gax-java/gax/src/test/resources/META-INF/native-image/com.google.api/gax/native-image.properties) * chore: add gax testlib to dependency analyzer exemptions * chore: fix gax package reference * chore: convert tabs to spaces * chore: add presubmit checks for graalvm * chore: restore integration job after testing * chore: restore return code in integration test --- .kokoro/presubmit/graalvm-native-a.cfg | 38 ++++++++++++++++++++++++++ .kokoro/presubmit/graalvm-native-b.cfg | 38 ++++++++++++++++++++++++++ .kokoro/presubmit/graalvm-native-c.cfg | 38 ++++++++++++++++++++++++++ google-cloud-bigquery/pom.xml | 6 ++++ pom.xml | 1 + 5 files changed, 121 insertions(+) create mode 100644 .kokoro/presubmit/graalvm-native-a.cfg create mode 100644 .kokoro/presubmit/graalvm-native-b.cfg create mode 100644 .kokoro/presubmit/graalvm-native-c.cfg diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg new file mode 100644 index 0000000000..6ae3c9e81b --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.2" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg new file mode 100644 index 0000000000..821f86ccae --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.2" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg new file mode 100644 index 0000000000..16e3d4ca40 --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.2" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} \ No newline at end of file diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 87f9e9bbd5..c93f566fed 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -157,6 +157,12 @@ + + com.google.api + gax + testlib + test + com.google.cloud google-cloud-datacatalog diff --git a/pom.xml b/pom.xml index dd7c02a7b9..0ebe59dfe8 100644 --- a/pom.xml +++ b/pom.xml @@ -171,6 +171,7 @@ io.netty:netty-buffer io.netty:netty-common org.apache.arrow:arrow-memory-netty + com.google.api:gax From 8ccf0e6b5560b6cb01e52a621ab79d40d4c75ce0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 May 2025 20:13:36 +0200 Subject: [PATCH 2072/2268] chore(config): migrate config renovate.json (#3778) --- renovate.json | 101 ++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/renovate.json b/renovate.json index 1ff055606e..833ec769e8 100644 --- a/renovate.json +++ b/renovate.json @@ -7,10 +7,11 @@ ":updateNotScheduled", ":automergeDisabled", ":ignoreModulesAndTests", - ":maintainLockFilesDisabled", - ":autodetectPinVersions" + ":maintainLockFilesDisabled" + ], + "ignorePaths": [ + ".kokoro/requirements.txt" ], - "ignorePaths": [".kokoro/requirements.txt"], "customManagers": [ { "customType": "regex", @@ -18,7 +19,9 @@ "^.kokoro/continuous/graalvm-native.*.cfg$", "^.kokoro/presubmit/graalvm-native.*.cfg$" ], - "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], + "matchStrings": [ + "value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\"" + ], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" }, @@ -27,70 +30,72 @@ "fileMatch": [ "^.github/workflows/unmanaged_dependency_check.yaml$" ], - "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], + "matchStrings": [ + "uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n" + ], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" } ], "packageRules": [ { - "packagePatterns": [ - "^com.google.guava:" - ], - "versionScheme": "docker" + "versioning": "docker", + "matchPackageNames": [ + "/^com.google.guava:/" + ] }, { - "packagePatterns": [ - "*", - "^com.google.cloud:google-cloud-bigquerystorage" - ], "semanticCommitType": "deps", - "semanticCommitScope": null + "semanticCommitScope": null, + "matchPackageNames": [ + "*", + "/^com.google.cloud:google-cloud-bigquerystorage/" + ] }, { - "packagePatterns": [ - "^org.apache.maven", - "^org.jacoco:", - "^org.codehaus.mojo:", - "^org.sonatype.plugins:", - "^com.coveo:", - "^com.google.cloud:google-cloud-shared-config" - ], "semanticCommitType": "build", - "semanticCommitScope": "deps" + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^org.apache.maven/", + "/^org.jacoco:/", + "/^org.codehaus.mojo:/", + "/^org.sonatype.plugins:/", + "/^com.coveo:/", + "/^com.google.cloud:google-cloud-shared-config/" + ] }, { - "packagePatterns": [ - "^com.google.cloud:google-cloud-bigquery", - "^com.google.cloud:google-cloud-bigtable", - "^com.google.cloud:libraries-bom", - "^com.google.cloud.samples:shared-configuration" - ], "semanticCommitType": "chore", - "semanticCommitScope": "deps" + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^com.google.cloud:google-cloud-bigquery/", + "/^com.google.cloud:google-cloud-bigtable/", + "/^com.google.cloud:libraries-bom/", + "/^com.google.cloud.samples:shared-configuration/" + ] }, { - "packagePatterns": [ - "^junit:junit", - "^com.google.truth:truth", - "^org.mockito:mockito-core", - "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-storage" - ], "semanticCommitType": "test", - "semanticCommitScope": "deps" + "semanticCommitScope": "deps", + "matchPackageNames": [ + "/^junit:junit/", + "/^com.google.truth:truth/", + "/^org.mockito:mockito-core/", + "/^org.objenesis:objenesis/", + "/^com.google.cloud:google-cloud-storage/" + ] }, { - "packagePatterns": [ - "^com.google.cloud:google-cloud-" - ], - "ignoreUnstable": false + "ignoreUnstable": false, + "matchPackageNames": [ + "/^com.google.cloud:google-cloud-/" + ] }, { - "packagePatterns": [ - "^com.fasterxml.jackson.core" - ], - "groupName": "jackson dependencies" + "groupName": "jackson dependencies", + "matchPackageNames": [ + "/^com.fasterxml.jackson.core/" + ] }, { "matchPackageNames": [ @@ -100,9 +105,9 @@ ], "groupName": "Google Cloud Java Monorepo Updates", "groupSlug": "google-cloud-java-monorepo-release-updates" - } + } ], - "semanticCommits": true, + "semanticCommits": "enabled", "dependencyDashboard": true, "dependencyDashboardLabels": [ "type: process" From b27434b8a75e74184458e920142f5575fed9ba52 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 May 2025 20:26:53 +0200 Subject: [PATCH 2073/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.47.0 (#3779) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 1577125b02..729c93faef 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.46.3 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.47.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index ccfecbe582..f42fbbf49b 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.47.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 776dc2d73d..c99c02b8ed 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.47.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index c0fd4ef891..fb43593db6 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.47.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 6ae3c9e81b..f42fbbf49b 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.47.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 821f86ccae..c99c02b8ed 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.47.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 16e3d4ca40..fb43593db6 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.46.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.47.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index d6e05c16a8..3656d35ed1 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.46.3 + 3.47.0 diff --git a/pom.xml b/pom.xml index 0ebe59dfe8..1a3df157b0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.46.3 + 3.47.0 From f787c0a5ad87f2c297aca913316ace09711b4eae Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 May 2025 21:53:46 +0200 Subject: [PATCH 2074/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.14.0 (#3781) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1a3df157b0..7744f8cc57 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.13.1 + 3.14.0 pom import From d6e52e9221a48a374e59e65e46ff230f1424d218 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 16:55:18 -0400 Subject: [PATCH 2075/2268] chore(main): release 2.50.0 (#3766) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3a03a1a27..8751172703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.50.0](https://github.com/googleapis/java-bigquery/compare/v2.49.2...v2.50.0) (2025-05-06) + + +### Features + +* Add WRITE_TRUNCATE_DATA as an enum value for write disposition ([#3752](https://github.com/googleapis/java-bigquery/issues/3752)) ([acea61c](https://github.com/googleapis/java-bigquery/commit/acea61c20b69b44c8612ca22745458ad04bc6be4)) +* **bigquery:** Add support for reservation field in jobs. ([#3768](https://github.com/googleapis/java-bigquery/issues/3768)) ([3e97f7c](https://github.com/googleapis/java-bigquery/commit/3e97f7c0c4676fcdda0862929a69bbabc69926f2)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.63.0 ([#3770](https://github.com/googleapis/java-bigquery/issues/3770)) ([934389e](https://github.com/googleapis/java-bigquery/commit/934389eb114d8fbb10c9c125d21ec26d503dca65)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250404-2.0.0 ([#3754](https://github.com/googleapis/java-bigquery/issues/3754)) ([1381c8f](https://github.com/googleapis/java-bigquery/commit/1381c8fe6c2552eec4519304c71697302733d6c7)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250427-2.0.0 ([#3773](https://github.com/googleapis/java-bigquery/issues/3773)) ([c0795fe](https://github.com/googleapis/java-bigquery/commit/c0795fe948e0ca231dbe8fc47c470603cb48ecc8)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.46.3 ([#3772](https://github.com/googleapis/java-bigquery/issues/3772)) ([ab166b6](https://github.com/googleapis/java-bigquery/commit/ab166b6c33c574b4494368709db0443e055b4863)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.47.0 ([#3779](https://github.com/googleapis/java-bigquery/issues/3779)) ([b27434b](https://github.com/googleapis/java-bigquery/commit/b27434b8a75e74184458e920142f5575fed9ba52)) + ## [2.49.2](https://github.com/googleapis/java-bigquery/compare/v2.49.1...v2.49.2) (2025-04-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a7681d23d6..00ea6385a0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.49.3-SNAPSHOT + 2.50.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3656d35ed1..05c07017d1 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.49.3-SNAPSHOT + 2.50.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.49.3-SNAPSHOT + 2.50.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index c93f566fed..056b4384a2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.49.3-SNAPSHOT + 2.50.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.49.3-SNAPSHOT + 2.50.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7744f8cc57..8ca5e4418a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.49.3-SNAPSHOT + 2.50.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.49.3-SNAPSHOT + 2.50.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c8c7f54f5d..94efbdc118 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.49.3-SNAPSHOT + 2.50.0 diff --git a/versions.txt b/versions.txt index 41a9363da6..5fb4054f13 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.49.2:2.49.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.50.0:2.50.0 \ No newline at end of file From 6483588a3c5785b95ea841f21aa38f50ecf4226d Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Wed, 7 May 2025 11:01:13 -0700 Subject: [PATCH 2076/2268] docs(bigquery): Update TableResult.getTotalRows() docstring (#3785) --- .../src/main/java/com/google/cloud/bigquery/TableResult.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 1b4b0e1011..42044596bd 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -61,6 +61,11 @@ public static Builder newBuilder() { @Nullable public abstract Schema getSchema(); + /** + * Returns the total number of rows in the complete result set, which can be more than the number + * of rows in the first page of results. If no rows are returned, this value can still be greater + * than 0 if any rows were affected by the query, such as INSERT, UPDATE, or DELETE queries. + */ public abstract long getTotalRows(); public abstract Page getPageNoSchema(); From f128aa688388a557054a58d88e49fc145ca85a46 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 11:18:45 -0400 Subject: [PATCH 2077/2268] chore(main): release 2.50.1-SNAPSHOT (#3784) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 00ea6385a0..ec8c002e9e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.50.0 + 2.50.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 05c07017d1..ff8fc4abcd 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.50.0 + 2.50.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.50.0 + 2.50.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 056b4384a2..df7737f9c6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.50.0 + 2.50.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.50.0 + 2.50.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8ca5e4418a..e41bbd963d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.50.0 + 2.50.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.50.0 + 2.50.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 94efbdc118..aa7bdb3812 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.50.0 + 2.50.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5fb4054f13..62a1992cb4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.50.0:2.50.0 \ No newline at end of file +google-cloud-bigquery:2.50.0:2.50.1-SNAPSHOT \ No newline at end of file From 6dcd858eca788a8cb571368e12b4925993e380c4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 May 2025 19:29:02 +0200 Subject: [PATCH 2078/2268] deps: update netty.version to v4.2.1.final (#3780) --- google-cloud-bigquery/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index df7737f9c6..94daf260a7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,7 +15,7 @@ google-cloud-bigquery - 4.2.0.Final + 4.2.1.Final From c7b50fef5cdea92734da51687c7f85ecbad01273 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 12 May 2025 19:29:21 +0200 Subject: [PATCH 2079/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.50.0 (#3786) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c53041c7cd..7e37fcbac2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.49.2 + 2.50.0 From 19ae888ef84bd6224df86b94c4b1410566b8cd59 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 May 2025 16:38:44 +0200 Subject: [PATCH 2080/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.58.2 (#3788) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7e37fcbac2..da1da5e8cc 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.58.1 + 2.58.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index aa7bdb3812..e89ec11a59 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.58.1 + 2.58.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0f13a2e87f..0eb860c795 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.58.1 + 2.58.2 test From 347b6bb17f2ff10cf14462ba453c12f238d8c074 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 13 May 2025 16:39:12 +0200 Subject: [PATCH 2081/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.52.2 (#3782) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e41bbd963d..54e8463b2e 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.52.1 + 2.52.2 test From 206f06de115ead53b26f09a5f4781efd279b5a73 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 16 May 2025 18:04:20 +0200 Subject: [PATCH 2082/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.48.0 (#3790) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 729c93faef..7ce7c2267e 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.47.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.48.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index f42fbbf49b..3350e37789 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.48.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index c99c02b8ed..96ec9ba718 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.48.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index fb43593db6..c8ed10da9e 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.48.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index f42fbbf49b..3350e37789 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.48.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index c99c02b8ed..96ec9ba718 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.48.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index fb43593db6..c8ed10da9e 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.47.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.48.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index ff8fc4abcd..3039f6cc11 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.47.0 + 3.48.0 diff --git a/pom.xml b/pom.xml index 54e8463b2e..b2710d75ba 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.47.0 + 3.48.0 From a699619087d3cec91cb4120a24e9dd09c464b09c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 16 May 2025 19:41:29 +0200 Subject: [PATCH 2083/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.14.1 (#3792) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2710d75ba..7a49e7c8d7 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.14.0 + 3.14.1 pom import From e289390f5ab31aa8ef39c21721354a6102dc7aee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 10:13:07 -0400 Subject: [PATCH 2084/2268] chore(main): release 2.50.1 (#3789) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8751172703..201284f14d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.50.1](https://github.com/googleapis/java-bigquery/compare/v2.50.0...v2.50.1) (2025-05-16) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.48.0 ([#3790](https://github.com/googleapis/java-bigquery/issues/3790)) ([206f06d](https://github.com/googleapis/java-bigquery/commit/206f06de115ead53b26f09a5f4781efd279b5a73)) +* Update netty.version to v4.2.1.final ([#3780](https://github.com/googleapis/java-bigquery/issues/3780)) ([6dcd858](https://github.com/googleapis/java-bigquery/commit/6dcd858eca788a8cb571368e12b4925993e380c4)) + + +### Documentation + +* **bigquery:** Update TableResult.getTotalRows() docstring ([#3785](https://github.com/googleapis/java-bigquery/issues/3785)) ([6483588](https://github.com/googleapis/java-bigquery/commit/6483588a3c5785b95ea841f21aa38f50ecf4226d)) + ## [2.50.0](https://github.com/googleapis/java-bigquery/compare/v2.49.2...v2.50.0) (2025-05-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ec8c002e9e..13d1f6f573 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.50.1-SNAPSHOT + 2.50.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3039f6cc11..9761bae569 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.50.1-SNAPSHOT + 2.50.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1-SNAPSHOT + 2.50.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 94daf260a7..ff18bbb374 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.50.1-SNAPSHOT + 2.50.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.50.1-SNAPSHOT + 2.50.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 7a49e7c8d7..93fe963fe7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.50.1-SNAPSHOT + 2.50.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1-SNAPSHOT + 2.50.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e89ec11a59..958918c020 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1-SNAPSHOT + 2.50.1 diff --git a/versions.txt b/versions.txt index 62a1992cb4..6aa45c7695 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.50.0:2.50.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.50.1:2.50.1 \ No newline at end of file From a21cde8994e93337326cc4a2deb4bafd1596b77f Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Fri, 30 May 2025 14:18:20 -0700 Subject: [PATCH 2085/2268] feat(bigquery): job creation mode GA (#3804) * feat(bigquery): job creation mode GA * deprecate query preview * Update samples * rename snippet to job optional * fix style * rename sample test --- .../google/cloud/bigquery/BigQueryImpl.java | 11 +++---- .../cloud/bigquery/BigQueryOptions.java | 19 ++++++++---- .../cloud/bigquery/QueryJobConfiguration.java | 6 ++-- .../cloud/bigquery/QueryRequestInfo.java | 3 +- .../cloud/bigquery/it/ITBigQueryTest.java | 31 +++++++++---------- ...ryShortMode.java => QueryJobOptional.java} | 21 +++++++------ ...ortModeIT.java => QueryJobOptionalIT.java} | 4 +-- 7 files changed, 50 insertions(+), 45 deletions(-) rename samples/snippets/src/main/java/com/example/bigquery/{QueryShortMode.java => QueryJobOptional.java} (78%) rename samples/snippets/src/test/java/com/example/bigquery/{QueryShortModeIT.java => QueryJobOptionalIT.java} (95%) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 8f8e45ad34..e2854781fc 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -40,7 +40,6 @@ import com.google.cloud.Tuple; import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException; import com.google.cloud.bigquery.InsertAllRequest.RowToInsert; -import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.common.annotations.VisibleForTesting; @@ -1407,12 +1406,10 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); - if (getOptions().isQueryPreviewEnabled()) { - configuration = - configuration.toBuilder() - .setJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL) - .build(); - } + configuration = + configuration.toBuilder() + .setJobCreationMode(getOptions().getDefaultJobCreationMode()) + .build(); // If all parameters passed in configuration are supported by the query() method on the backend, // put on fast path diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index ca34a2d2dd..a1dacc4cf3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -20,10 +20,10 @@ import com.google.cloud.ServiceOptions; import com.google.cloud.ServiceRpc; import com.google.cloud.TransportOptions; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.cloud.http.HttpTransportOptions; -import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableSet; import java.util.Set; @@ -38,7 +38,7 @@ public class BigQueryOptions extends ServiceOptions { // set the option ThrowNotFound when you want to throw the exception when the value not found private boolean setThrowNotFound; private boolean useInt64Timestamps; - private String queryPreviewEnabled = System.getenv("QUERY_PREVIEW_ENABLED"); + private JobCreationMode defaultJobCreationMode = JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED; public static class DefaultBigQueryFactory implements BigQueryFactory { @@ -139,8 +139,9 @@ public String getLocation() { return location; } + @Deprecated public boolean isQueryPreviewEnabled() { - return queryPreviewEnabled != null && queryPreviewEnabled.equalsIgnoreCase("TRUE"); + return false; } public void setThrowNotFound(boolean setThrowNotFound) { @@ -151,9 +152,11 @@ public void setUseInt64Timestamps(boolean useInt64Timestamps) { this.useInt64Timestamps = useInt64Timestamps; } - @VisibleForTesting - public void setQueryPreviewEnabled(String queryPreviewEnabled) { - this.queryPreviewEnabled = queryPreviewEnabled; + @Deprecated + public void setQueryPreviewEnabled(String queryPreviewEnabled) {} + + public void setDefaultJobCreationMode(JobCreationMode jobCreationMode) { + this.defaultJobCreationMode = jobCreationMode; } public boolean getThrowNotFound() { @@ -164,6 +167,10 @@ public boolean getUseInt64Timestamps() { return useInt64Timestamps; } + public JobCreationMode getDefaultJobCreationMode() { + return defaultJobCreationMode; + } + @SuppressWarnings("unchecked") @Override public Builder toBuilder() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index b460b6121a..6490855409 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -97,7 +97,7 @@ public enum Priority { } /** Job Creation Mode provides different options on job creation. */ - enum JobCreationMode { + public enum JobCreationMode { /** Unspecified JobCreationMode, defaults to JOB_CREATION_REQUIRED. */ JOB_CREATION_MODE_UNSPECIFIED, /** Default. Job creation is always required. */ @@ -683,7 +683,7 @@ public Builder setMaxResults(Long maxResults) { * Provides different options on job creation. If not specified the job creation mode is assumed * to be {@link JobCreationMode#JOB_CREATION_REQUIRED}. */ - Builder setJobCreationMode(JobCreationMode jobCreationMode) { + public Builder setJobCreationMode(JobCreationMode jobCreationMode) { this.jobCreationMode = jobCreationMode; return this; } @@ -959,7 +959,7 @@ public Long getMaxResults() { } /** Returns the job creation mode. */ - JobCreationMode getJobCreationMode() { + public JobCreationMode getJobCreationMode() { return jobCreationMode; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 7eebfea96d..588b7cae8c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -86,7 +86,8 @@ boolean isFastQuerySupported(JobId jobId) { && config.getTableDefinitions() == null && config.getTimePartitioning() == null && config.getUserDefinedFunctions() == null - && config.getWriteDisposition() == null; + && config.getWriteDisposition() == null + && config.getJobCreationMode() != JobCreationMode.JOB_CREATION_REQUIRED; } QueryRequest toPb() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index a28cb20ba2..6b6ceeff87 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -111,6 +111,7 @@ import com.google.cloud.bigquery.PolicyTags; import com.google.cloud.bigquery.PrimaryKey; import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.QueryJobConfiguration.Priority; import com.google.cloud.bigquery.QueryParameterValue; import com.google.cloud.bigquery.Range; @@ -3483,6 +3484,7 @@ public void testExecuteSelectWithReadApi() throws SQLException { final int rowLimit = 5000; final String QUERY = "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; + bigquery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED); // Job timeout is somewhat arbitrary - just ensures that fast query is not used. // min result size and page row count ratio ensure that the ReadAPI is used. ConnectionSettings connectionSettingsReadAPIEnabledFastQueryDisabled = @@ -7084,26 +7086,19 @@ public void testStatelessQueries() throws InterruptedException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQuery bigQuery = bigqueryHelper.getOptions().getService(); - // Simulate setting the QUERY_PREVIEW_ENABLED environment variable. - bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + // Stateless query should have no job id. + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); TableResult tableResult = executeSimpleQuery(bigQuery); assertNotNull(tableResult.getQueryId()); assertNull(tableResult.getJobId()); - // The flag should be case-insensitive. - bigQuery.getOptions().setQueryPreviewEnabled("tRuE"); + // Job creation takes over, no query id is created. + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED); tableResult = executeSimpleQuery(bigQuery); - assertNotNull(tableResult.getQueryId()); - assertNull(tableResult.getJobId()); - - // Any other values won't enable optional job creation mode. - bigQuery.getOptions().setQueryPreviewEnabled("test_value"); - tableResult = executeSimpleQuery(bigQuery); - assertNotNull(tableResult.getQueryId()); + assertNull(tableResult.getQueryId()); assertNotNull(tableResult.getJobId()); - // Reset the flag. - bigQuery.getOptions().setQueryPreviewEnabled(null); + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED); tableResult = executeSimpleQuery(bigQuery); assertNotNull(tableResult.getQueryId()); assertNotNull(tableResult.getJobId()); @@ -7128,8 +7123,8 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { // Create local BigQuery for test scenario 1 to not contaminate global test parameters. RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQuery bigQuery = bigqueryHelper.getOptions().getService(); - // Simulate setting the QUERY_PREVIEW_ENABLED environment variable. - bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + // Allow queries to be stateless. + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); String query = "SELECT 1 as one"; QueryJobConfiguration configStateless = QueryJobConfiguration.newBuilder(query).build(); TableResult result = bigQuery.query(configStateless); @@ -7181,7 +7176,7 @@ public void testStatelessQueriesWithLocation() throws Exception { table.getTableId().getTable()); // Test stateless query when BigQueryOption location matches dataset location. - bigQuery.getOptions().setQueryPreviewEnabled("TRUE"); + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); TableResult tb = bigQuery.query(QueryJobConfiguration.of(query)); assertNull(tb.getJobId()); @@ -7189,7 +7184,9 @@ public void testStatelessQueriesWithLocation() throws Exception { try { BigQuery bigQueryWrongLocation = bigqueryHelper.getOptions().toBuilder().setLocation(wrongLocation).build().getService(); - bigQueryWrongLocation.getOptions().setQueryPreviewEnabled("TRUE"); + bigQueryWrongLocation + .getOptions() + .setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); bigQueryWrongLocation.query(QueryJobConfiguration.of(query)); fail("querying a table with wrong location shouldn't work"); } catch (BigQueryException e) { diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java b/samples/snippets/src/main/java/com/example/bigquery/QueryJobOptional.java similarity index 78% rename from samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java rename to samples/snippets/src/main/java/com/example/bigquery/QueryJobOptional.java index b07f65f92a..1abf580671 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryShortMode.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryJobOptional.java @@ -16,34 +16,37 @@ package com.example.bigquery; -// [START bigquery_query_shortquery] +// [START bigquery_query_job_optional] import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.JobId; import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.TableResult; // Sample demonstrating short mode query execution. // -// While this feature is still in preview, it is controlled by -// setting the environment variable QUERY_PREVIEW_ENABLED=TRUE -// to request short mode execution. -public class QueryShortMode { +// This feature is controlled by setting the defaultJobCreationMode +// field in the BigQueryOptions used for the client. JOB_CREATION_OPTIONAL +// allows for the execution of queries without creating a job. +public class QueryJobOptional { public static void main(String[] args) { String query = "SELECT name, gender, SUM(number) AS total FROM " + "bigquery-public-data.usa_names.usa_1910_2013 GROUP BY " + "name, gender ORDER BY total DESC LIMIT 10"; - queryShortMode(query); + queryJobOptional(query); } - public static void queryShortMode(String query) { + public static void queryJobOptional(String query) { try { // Initialize client that will be used to send requests. This client only needs // to be created once, and can be reused for multiple requests. - BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + BigQueryOptions options = BigQueryOptions.getDefaultInstance(); + options.setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); + BigQuery bigquery = options.getService(); // Execute the query. The returned TableResult provides access information // about the query execution as well as query results. @@ -72,4 +75,4 @@ public static void queryShortMode(String query) { } } } -// [END bigquery_query_shortquery] +// [END bigquery_query_job_optional] diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryJobOptionalIT.java similarity index 95% rename from samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java rename to samples/snippets/src/test/java/com/example/bigquery/QueryJobOptionalIT.java index 6500de7827..8e3e979098 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryShortModeIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryJobOptionalIT.java @@ -26,7 +26,7 @@ import org.junit.Before; import org.junit.Test; -public class QueryShortModeIT { +public class QueryJobOptionalIT { private final Logger log = Logger.getLogger(this.getClass().getName()); private ByteArrayOutputStream bout; @@ -56,7 +56,7 @@ public void testQueryBatch() { + "bigquery-public-data.usa_names.usa_1910_2013 GROUP BY " + "name, gender ORDER BY total DESC LIMIT 10"; - QueryShortMode.queryShortMode(query); + QueryJobOptional.queryJobOptional(query); assertThat(bout.toString()).contains("Query was run"); } } From bebf1c610e6d050c49fc05f30d3fa0247b7dfdcb Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Fri, 30 May 2025 14:18:32 -0700 Subject: [PATCH 2086/2268] feat(bigquery): Support Fine Grained ACLs for Datasets (#3803) * feat(bigquery): Support Fine Grained ACLs for Datasets * fix style * Change enum strings to uppercase * add unspecified enum option --- .../com/google/cloud/bigquery/BigQuery.java | 52 +++++++++++++++++++ .../cloud/bigquery/spi/v2/BigQueryRpc.java | 4 +- .../bigquery/spi/v2/HttpBigQueryRpc.java | 18 ++++--- .../cloud/bigquery/it/ITBigQueryTest.java | 14 +++-- 4 files changed, 75 insertions(+), 13 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 2a7d498c09..2e0747f6be 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -77,6 +77,42 @@ public String getSelector() { } } + enum DatasetView { + DATASET_VIEW_UNSPECIFIED("DATASET_VIEW_UNSPECIFIED"), + FULL("FULL"), + METADATA("METADATA"), + ACL("ACL"); + + private final String view; + + DatasetView(String view) { + this.view = view; + } + + @Override + public String toString() { + return view; + } + } + + enum DatasetUpdateMode { + UPDATE_MODE_UNSPECIFIED("UPDATE_MODE_UNSPECIFIED"), + UPDATE_FULL("UPDATE_FULL"), + UPDATE_METADATA("UPDATE_METADATA"), + UPDATE_ACL("UPDATE_ACL"); + + private final String updateMode; + + DatasetUpdateMode(String updateMode) { + this.updateMode = updateMode; + } + + @Override + public String toString() { + return updateMode; + } + } + /** * Fields of a BigQuery Table resource. * @@ -307,6 +343,22 @@ public static DatasetOption fields(DatasetField... fields) { public static DatasetOption accessPolicyVersion(Integer accessPolicyVersion) { return new DatasetOption(BigQueryRpc.Option.ACCESS_POLICY_VERSION, accessPolicyVersion); } + + /** + * Returns an option to specify the view that determines which dataset information is returned. + * By default, metadata and ACL information are returned. + */ + public static DatasetOption datasetView(DatasetView datasetView) { + return new DatasetOption(BigQueryRpc.Option.DATASET_VIEW, datasetView); + } + + /** + * Returns an option to specify the fields of dataset that update/patch operation is targeting. + * By default, both metadata and ACL fields are updated. + */ + public static DatasetOption updateMode(DatasetUpdateMode updateMode) { + return new DatasetOption(BigQueryRpc.Option.DATASET_UPDATE_MODE, updateMode); + } } /** Class for specifying dataset delete options. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java index bbde70dc5a..65fd45d02a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/BigQueryRpc.java @@ -60,7 +60,9 @@ enum Option { TABLE_METADATA_VIEW("view"), RETRY_OPTIONS("retryOptions"), BIGQUERY_RETRY_CONFIG("bigQueryRetryConfig"), - ACCESS_POLICY_VERSION("accessPolicyVersion"); + ACCESS_POLICY_VERSION("accessPolicyVersion"), + DATASET_VIEW("datasetView"), + DATASET_UPDATE_MODE("datasetUpdateMode"); private final String value; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index ebb8f2644f..87f05f1f75 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -149,10 +149,11 @@ public Dataset getDatasetSkipExceptionTranslation( .get(projectId, datasetId) .setFields(Option.FIELDS.getString(options)) .setPrettyPrint(false); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqGetRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } + if (options.containsKey(Option.ACCESS_POLICY_VERSION)) { + bqGetRequest.setAccessPolicyVersion((Integer) options.get(Option.ACCESS_POLICY_VERSION)); + } + if (options.containsKey(Option.DATASET_VIEW)) { + bqGetRequest.setDatasetView(options.get(Option.DATASET_VIEW).toString()); } return bqGetRequest.execute(); } @@ -350,10 +351,11 @@ public Dataset patchSkipExceptionTranslation(Dataset dataset, Map opt .patch(reference.getProjectId(), reference.getDatasetId(), dataset) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqPatchRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } + if (options.containsKey(Option.ACCESS_POLICY_VERSION)) { + bqPatchRequest.setAccessPolicyVersion((Integer) options.get(Option.ACCESS_POLICY_VERSION)); + } + if (options.containsKey(Option.DATASET_UPDATE_MODE)) { + bqPatchRequest.setUpdateMode(options.get(Option.DATASET_UPDATE_MODE).toString()); } return bqPatchRequest.execute(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 6b6ceeff87..9f80687c41 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -48,6 +48,8 @@ import com.google.cloud.bigquery.BigQuery.DatasetField; import com.google.cloud.bigquery.BigQuery.DatasetListOption; import com.google.cloud.bigquery.BigQuery.DatasetOption; +import com.google.cloud.bigquery.BigQuery.DatasetUpdateMode; +import com.google.cloud.bigquery.BigQuery.DatasetView; import com.google.cloud.bigquery.BigQuery.JobField; import com.google.cloud.bigquery.BigQuery.JobListOption; import com.google.cloud.bigquery.BigQuery.JobOption; @@ -1236,7 +1238,8 @@ public void testGetDatasetWithAccessPolicyVersion() throws IOException { "requests after the year 2024", "location"); Acl acl = Acl.of(user, role, condition); - DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + DatasetOption accessPolicyOption = DatasetOption.accessPolicyVersion(3); + DatasetOption viewOption = DatasetOption.datasetView(DatasetView.FULL); Dataset dataset = bigquery.create( @@ -1244,10 +1247,11 @@ public void testGetDatasetWithAccessPolicyVersion() throws IOException { .setDescription("Some Description") .setAcl(ImmutableList.of(acl)) .build(), - datasetOption); + accessPolicyOption); assertThat(dataset).isNotNull(); - Dataset remoteDataset = bigquery.getDataset(accessPolicyDataset, datasetOption); + Dataset remoteDataset = + bigquery.getDataset(accessPolicyDataset, accessPolicyOption, viewOption); assertNotNull(remoteDataset); assertEquals(dataset.getDescription(), remoteDataset.getDescription()); assertNotNull(remoteDataset.getCreationTime()); @@ -1356,6 +1360,7 @@ public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { acls.add(acl); DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); + DatasetOption updateModeOption = DatasetOption.updateMode(DatasetUpdateMode.UPDATE_FULL); Dataset updatedDataset = bigquery.update( dataset.toBuilder() @@ -1363,7 +1368,8 @@ public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { .setLabels(null) .setAcl(acls) .build(), - datasetOption); + datasetOption, + updateModeOption); assertNotNull(updatedDataset); assertEquals(updatedDataset.getDescription(), "Updated Description"); assertThat(updatedDataset.getLabels().isEmpty()); From f0dc90c50f211f075740929d6f73f64a7e471785 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 3 Jun 2025 21:04:30 +0200 Subject: [PATCH 2087/2268] chore(deps): update google cloud java monorepo updates (#3769) --- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 93fe963fe7..82f95b1e4a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.66.0 + 1.69.0 pom import @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.62.0 + 2.65.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index da1da5e8cc..e00921d05e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.62.0 + 2.65.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 958918c020..34c70d9fbe 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.62.0 + 2.65.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0eb860c795..7af1919c32 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.62.0 + 2.65.0 test From 0574eccec2975738804be7d0ccb4c973459c82c9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 3 Jun 2025 21:06:38 +0200 Subject: [PATCH 2088/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.65.0 (#3787) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 82f95b1e4a..1183691e45 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.63.0 + 2.65.0 test From 169ed3e99dab5a70732c7ee207f6811ae355d7fe Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 3 Jun 2025 21:06:52 +0200 Subject: [PATCH 2089/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.59.0 (#3793) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index e00921d05e..0719a50454 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.58.2 + 2.59.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 34c70d9fbe..8c8ce80a0e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.58.2 + 2.59.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7af1919c32..9ddab8dc91 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.58.2 + 2.59.0 test From d3bf724feef91469b44e1e5068738604d2b3cead Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 3 Jun 2025 21:07:03 +0200 Subject: [PATCH 2090/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20250511-2.0.0 (#3794) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1183691e45..138f081e69 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250427-2.0.0 + v2-rev20250511-2.0.0 From 4f178fedb2c7c46f89cc38b9f6a07d2878386631 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:50:51 -0400 Subject: [PATCH 2091/2268] chore(main): release 2.50.2-SNAPSHOT (#3796) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 13d1f6f573..8aec7658e6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.50.1 + 2.50.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 9761bae569..b231a29d5d 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.50.1 + 2.50.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1 + 2.50.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ff18bbb374..a9d3bb46b2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.50.1 + 2.50.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.50.1 + 2.50.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 138f081e69..6d8f73a804 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.50.1 + 2.50.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1 + 2.50.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8c8ce80a0e..72d3639498 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.50.1 + 2.50.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 6aa45c7695..00a01cc539 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.50.1:2.50.1 \ No newline at end of file +google-cloud-bigquery:2.50.1:2.50.2-SNAPSHOT \ No newline at end of file From 63b8bdb5f21ab28ff5c2ca3dbd34922463b5ea6f Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Wed, 4 Jun 2025 10:30:43 -0700 Subject: [PATCH 2092/2268] refactor(bigquery): Clean up sample test resources, fix comments (#3823) * refactor(bigquery): Clean up sample test resources, fix comments * fix style --- .../java/com/google/cloud/bigquery/BigQueryImpl.java | 3 --- .../google/cloud/bigquery/QueryJobConfiguration.java | 2 +- .../google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java | 6 ++---- .../com/google/cloud/bigquery/it/ITBigQueryTest.java | 10 ++++------ .../java/com/example/bigquery/GrantViewAccessIT.java | 1 + 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index e2854781fc..9ede028387 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -441,9 +441,6 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { && createException.getCause() != null && createException.getCause().getMessage() != null) { - /*GoogleJsonResponseException createExceptionCause = - (GoogleJsonResponseException) createException.getCause();*/ - Pattern pattern = Pattern.compile(".*Already.*Exists:.*Job.*", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(createException.getCause().getMessage()); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java index 6490855409..a62fbb5008 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryJobConfiguration.java @@ -187,7 +187,7 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this(); JobConfigurationQuery queryConfigurationPb = configurationPb.getQuery(); this.query = queryConfigurationPb.getQuery(); - // Allows to get undeclaredqueryparameters in jobstatistics2 + // Allows to get undeclared query parameters in jobstatistics if (queryConfigurationPb.getQueryParameters() == null && queryConfigurationPb.getParameterMode() != null) { parameterMode = queryConfigurationPb.getParameterMode(); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 87f05f1f75..03e1fb5866 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -208,10 +208,8 @@ public Dataset createSkipExceptionTranslation(Dataset dataset, Map op .insert(dataset.getDatasetReference().getProjectId(), dataset) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); - for (Map.Entry entry : options.entrySet()) { - if (entry.getKey() == Option.ACCESS_POLICY_VERSION && entry.getValue() != null) { - bqCreateRequest.setAccessPolicyVersion((Integer) entry.getValue()); - } + if (options.containsKey(Option.ACCESS_POLICY_VERSION)) { + bqCreateRequest.setAccessPolicyVersion((Integer) options.get(Option.ACCESS_POLICY_VERSION)); } return bqCreateRequest.execute(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 9f80687c41..bd17b14fcb 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1334,7 +1334,7 @@ public void testUpdateDatasetWithSelectedFields() { } @Test - public void testUpdateDatabaseWithAccessPolicyVersion() throws IOException { + public void testUpdateDatasetWithAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1827,7 +1827,7 @@ public void testCreateDatasetWithAccessPolicyVersion() throws IOException { } @Test(expected = BigQueryException.class) - public void testCreateDatabaseWithInvalidAccessPolicyVersion() throws IOException { + public void testCreateDatasetWithInvalidAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -4040,8 +4040,7 @@ public void testBQResultSetPagination() throws SQLException { assertEquals(300000, cnt); // total 300000 rows should be read } - // @Test - Temporarily disabling till https://github.com/googleapis/gax-java/issues/1712 or - // b/235591056 are resolved + @Test public void testReadAPIIterationAndOrder() throws SQLException { // use read API to read 300K records and check the order String query = @@ -4240,8 +4239,7 @@ public void testCreateDefaultConnection() throws BigQuerySQLException { assertTrue(connection.close()); } - // @Test - Temporarily disabling till https://github.com/googleapis/gax-java/issues/1712 or - // b/235591056 are resolved + @Test public void testReadAPIConnectionMultiClose() throws SQLException { // use read API to read 300K records, then closes the connection. This test diff --git a/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java b/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java index 11b1215ff6..d8655a9d58 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/GrantViewAccessIT.java @@ -94,6 +94,7 @@ public void tearDown() { DeleteTable.deleteTable(viewDatasetName, viewName); DeleteTable.deleteTable(viewDatasetName, tableName); DeleteDataset.deleteDataset(PROJECT_ID, datasetName); + DeleteDataset.deleteDataset(PROJECT_ID, viewDatasetName); // restores print statements in the original method System.out.flush(); System.setOut(originalPrintStream); From 45e464504c477f9a6e49bfd75f500e43248c31f7 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:02:40 -0400 Subject: [PATCH 2093/2268] test: temporarily disable flaky bot for graalvm IT (#3833) There is a known issue with graalvm IT being very flaky (b/422746465). Disabling flaky bot to reduce the noise until we investigate the issue further. --- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 3350e37789..35d360c349 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 96ec9ba718..ccd8afcdcd 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index c8ed10da9e..73d09b7005 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 3350e37789..35d360c349 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 96ec9ba718..ccd8afcdcd 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index c8ed10da9e..73d09b7005 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -34,5 +34,5 @@ env_vars: { env_vars: { key: "ENABLE_FLAKYBOT" - value: "true" + value: "false" } \ No newline at end of file From 94c71a090eab745c81dd9530bcdd3c8c1e734788 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:13:26 -0400 Subject: [PATCH 2094/2268] deps: rollback netty.version to v4.1.119.Final (#3827) --- google-cloud-bigquery/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a9d3bb46b2..aefc3f1f98 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,7 +15,7 @@ google-cloud-bigquery - 4.2.1.Final + 4.1.119.Final From 2c5ede4b115cf7cdd078d54d29ce93636c1cedf5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Jun 2025 03:56:58 +0200 Subject: [PATCH 2095/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 (#3811) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 7ce7c2267e..3f29452159 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.48.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.49.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 35d360c349..54d873dc1f 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index ccd8afcdcd..b7bd7ed2f9 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 73d09b7005..7090b33d1a 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 35d360c349..54d873dc1f 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index ccd8afcdcd..b7bd7ed2f9 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 73d09b7005..7090b33d1a 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.48.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index b231a29d5d..1672bae3cf 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.48.0 + 3.49.0 diff --git a/pom.xml b/pom.xml index 6d8f73a804..2846bc1043 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.48.0 + 3.49.0 From d7c6af4ec5812d1e97518579a138a004c7b0960b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 6 Jun 2025 19:28:21 +0200 Subject: [PATCH 2096/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.15.0 (#3831) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2846bc1043..bdc1d3ed4d 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.14.1 + 3.15.0 pom import From c5a5c2ad791229db2071123c2788d352f0ad7408 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:52:27 -0400 Subject: [PATCH 2097/2268] chore(main): release 2.51.0 (#3826) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 201284f14d..e9fe4fdd3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.51.0](https://github.com/googleapis/java-bigquery/compare/v2.50.1...v2.51.0) (2025-06-06) + + +### Features + +* **bigquery:** Job creation mode GA ([#3804](https://github.com/googleapis/java-bigquery/issues/3804)) ([a21cde8](https://github.com/googleapis/java-bigquery/commit/a21cde8994e93337326cc4a2deb4bafd1596b77f)) +* **bigquery:** Support Fine Grained ACLs for Datasets ([#3803](https://github.com/googleapis/java-bigquery/issues/3803)) ([bebf1c6](https://github.com/googleapis/java-bigquery/commit/bebf1c610e6d050c49fc05f30d3fa0247b7dfdcb)) + + +### Dependencies + +* Rollback netty.version to v4.1.119.Final ([#3827](https://github.com/googleapis/java-bigquery/issues/3827)) ([94c71a0](https://github.com/googleapis/java-bigquery/commit/94c71a090eab745c81dd9530bcdd3c8c1e734788)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.65.0 ([#3787](https://github.com/googleapis/java-bigquery/issues/3787)) ([0574ecc](https://github.com/googleapis/java-bigquery/commit/0574eccec2975738804be7d0ccb4c973459c82c9)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250511-2.0.0 ([#3794](https://github.com/googleapis/java-bigquery/issues/3794)) ([d3bf724](https://github.com/googleapis/java-bigquery/commit/d3bf724feef91469b44e1e5068738604d2b3cead)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#3811](https://github.com/googleapis/java-bigquery/issues/3811)) ([2c5ede4](https://github.com/googleapis/java-bigquery/commit/2c5ede4b115cf7cdd078d54d29ce93636c1cedf5)) + ## [2.50.1](https://github.com/googleapis/java-bigquery/compare/v2.50.0...v2.50.1) (2025-05-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8aec7658e6..6285defb6c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.50.2-SNAPSHOT + 2.51.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 1672bae3cf..66387cf2ef 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.50.2-SNAPSHOT + 2.51.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.50.2-SNAPSHOT + 2.51.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index aefc3f1f98..07cc6b0fb0 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.50.2-SNAPSHOT + 2.51.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.50.2-SNAPSHOT + 2.51.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index bdc1d3ed4d..e281937a32 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.50.2-SNAPSHOT + 2.51.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.50.2-SNAPSHOT + 2.51.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 72d3639498..f81a2b0d90 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.50.2-SNAPSHOT + 2.51.0 diff --git a/versions.txt b/versions.txt index 00a01cc539..b17f78a7bf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.50.1:2.50.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.51.0:2.51.0 \ No newline at end of file From 6e3e07a22b8397e1e9d5b567589e44abc55961f2 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:30:36 -0700 Subject: [PATCH 2098/2268] feat(bigquery): Integrate Otel in client lib (#3747) * feat(bigquery): Integrate Otel in client lib * Refactor Otel code into separate file * Add copyright comment * fix style * remove unused dependencies * remove unused test dependencies * fix dependency issue * fix it test * refactor out OtelHelper class * change test name to start with lowercase * change datasetId key to dataset * remove OtelHelper class * Clean up attribute values * Add spans to query and listPartitions * remove extraneous attributes * add attribute namespaces, change to snake_case * Resolve merge conflict * change previewEnable to JobCreationMode * fix style --- google-cloud-bigquery/pom.xml | 27 + .../google/cloud/bigquery/BigQueryImpl.java | 1012 +++++++++++++---- .../cloud/bigquery/BigQueryOptions.java | 50 + .../com/google/cloud/bigquery/DatasetId.java | 8 + .../google/cloud/bigquery/DatasetInfo.java | 13 + .../cloud/bigquery/InsertAllRequest.java | 12 + .../java/com/google/cloud/bigquery/JobId.java | 13 + .../com/google/cloud/bigquery/ModelId.java | 9 + .../com/google/cloud/bigquery/ModelInfo.java | 16 + .../com/google/cloud/bigquery/RoutineId.java | 9 + .../google/cloud/bigquery/RoutineInfo.java | 14 + .../com/google/cloud/bigquery/TableId.java | 9 + .../com/google/cloud/bigquery/TableInfo.java | 16 + .../cloud/bigquery/it/ITBigQueryTest.java | 202 ++++ pom.xml | 9 + 15 files changed, 1225 insertions(+), 194 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 07cc6b0fb0..9599d760c5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -156,6 +156,16 @@ error_prone_annotations + + + io.opentelemetry + opentelemetry-api + + + io.opentelemetry + opentelemetry-context + + com.google.api @@ -208,6 +218,23 @@ proto-google-cloud-datacatalog-v1 test + + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-common + test + + + io.opentelemetry + opentelemetry-sdk-trace + test + diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 9ede028387..2efe8f92ae 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -51,6 +51,9 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -268,7 +271,18 @@ public Dataset create(DatasetInfo datasetInfo, DatasetOption... options) { : datasetInfo.getDatasetId().getProject()) .toPb(); final Map optionsMap = optionMap(options); - try { + Span datasetCreate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + datasetCreate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.createDataset") + .setAllAttributes(datasetInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope datasetCreateScope = datasetCreate != null ? datasetCreate.makeCurrent() : null) { return Dataset.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -284,6 +298,10 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (datasetCreate != null) { + datasetCreate.end(); + } } } @@ -298,7 +316,18 @@ public Table create(TableInfo tableInfo, TableOption... options) { .toPb(); handleExternalTableSchema(tablePb); final Map optionsMap = optionMap(options); - try { + Span tableCreate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tableCreate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.createTable") + .setAllAttributes(tableInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tableCreateScope = tableCreate != null ? tableCreate.makeCurrent() : null) { return Table.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -314,6 +343,10 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (tableCreate != null) { + tableCreate.end(); + } } } @@ -337,7 +370,18 @@ public Routine create(RoutineInfo routineInfo, RoutineOption... options) { : routineInfo.getRoutineId().getProject()) .toPb(); final Map optionsMap = optionMap(options); - try { + Span routineCreate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routineCreate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.createRoutine") + .setAllAttributes(routineInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope createRoutineScope = routineCreate != null ? routineCreate.makeCurrent() : null) { return Routine.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -353,6 +397,10 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (routineCreate != null) { + routineCreate.end(); + } } } @@ -388,6 +436,17 @@ Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { final boolean idRandom = (jobInfo.getJobId() == null); final Map optionsMap = optionMap(options); + Span jobCreate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + jobCreate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.createJob") + .setAllAttributes(jobInfo.getJobId().getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } BigQueryException createException; // NOTE(pongad): This double-try structure is admittedly odd. // translateAndThrow itself throws, and pretends to return an exception only @@ -396,90 +455,96 @@ Job create(JobInfo jobInfo, Supplier idProvider, JobOption... options) { // Fixing this entails some work on BaseServiceException.translate. // Since that affects a bunch of APIs, we should fix this as a separate change. final JobId[] finalJobId = new JobId[1]; - try { + try (Scope jobCreateScope = jobCreate != null ? jobCreate.makeCurrent() : null) { try { - return Job.fromPb( - this, - BigQueryRetryHelper.runWithRetries( - new Callable() { - @Override - public com.google.api.services.bigquery.model.Job call() throws IOException { - if (idRandom) { - // re-generate a new random job with the same jobInfo when jobId is not - // provided by the user - JobInfo recreatedJobInfo = - jobInfo.toBuilder().setJobId(idProvider.get()).build(); - com.google.api.services.bigquery.model.Job newJobPb = - recreatedJobInfo.setProjectId(getOptions().getProjectId()).toPb(); - finalJobId[0] = recreatedJobInfo.getJobId(); - return bigQueryRpc.createSkipExceptionTranslation(newJobPb, optionsMap); - } else { - com.google.api.services.bigquery.model.Job jobPb = - jobInfo.setProjectId(getOptions().getProjectId()).toPb(); - return bigQueryRpc.createSkipExceptionTranslation(jobPb, optionsMap); + try { + return Job.fromPb( + this, + BigQueryRetryHelper.runWithRetries( + new Callable() { + @Override + public com.google.api.services.bigquery.model.Job call() throws IOException { + if (idRandom) { + // re-generate a new random job with the same jobInfo when jobId is not + // provided by the user + JobInfo recreatedJobInfo = + jobInfo.toBuilder().setJobId(idProvider.get()).build(); + com.google.api.services.bigquery.model.Job newJobPb = + recreatedJobInfo.setProjectId(getOptions().getProjectId()).toPb(); + finalJobId[0] = recreatedJobInfo.getJobId(); + return bigQueryRpc.createSkipExceptionTranslation(newJobPb, optionsMap); + } else { + com.google.api.services.bigquery.model.Job jobPb = + jobInfo.setProjectId(getOptions().getProjectId()).toPb(); + return bigQueryRpc.createSkipExceptionTranslation(jobPb, optionsMap); + } } - } - }, - getRetryOptions(optionsMap) != null - ? RetryOption.mergeToSettings( - getOptions().getRetrySettings(), getRetryOptions(optionsMap)) - : getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock(), - getBigQueryRetryConfig(optionsMap) != null - ? getBigQueryRetryConfig(optionsMap) - : DEFAULT_RETRY_CONFIG)); - } catch (BigQueryRetryHelperException e) { - throw BigQueryException.translateAndThrow(e); + }, + getRetryOptions(optionsMap) != null + ? RetryOption.mergeToSettings( + getOptions().getRetrySettings(), getRetryOptions(optionsMap)) + : getOptions().getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getClock(), + getBigQueryRetryConfig(optionsMap) != null + ? getBigQueryRetryConfig(optionsMap) + : DEFAULT_RETRY_CONFIG)); + } catch (BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + } catch (BigQueryException e) { + createException = e; } - } catch (BigQueryException e) { - createException = e; - } - - if (!idRandom) { - if (createException instanceof BigQueryException - && createException.getCause() != null - && createException.getCause().getMessage() != null) { - - Pattern pattern = Pattern.compile(".*Already.*Exists:.*Job.*", Pattern.CASE_INSENSITIVE); - Matcher matcher = pattern.matcher(createException.getCause().getMessage()); - - if (matcher.find()) { - // If the Job ALREADY EXISTS, retrieve it. - Job job = this.getJob(jobInfo.getJobId(), JobOption.fields(JobField.STATISTICS)); - - long jobCreationTime = job.getStatistics().getCreationTime(); - long jobMinStaleTime = System.currentTimeMillis(); - long jobMaxStaleTime = - java.time.Instant.ofEpochMilli(jobMinStaleTime) - .minus(1, java.time.temporal.ChronoUnit.DAYS) - .toEpochMilli(); - - // Only return the job if it has been created in the past 24 hours. - // This is assuming any job older than 24 hours is a valid duplicate JobID - // and not a false positive like b/290419183 - if (jobCreationTime >= jobMaxStaleTime && jobCreationTime <= jobMinStaleTime) { - return job; + + if (!idRandom) { + if (createException instanceof BigQueryException + && createException.getCause() != null + && createException.getCause().getMessage() != null) { + + Pattern pattern = Pattern.compile(".*Already.*Exists:.*Job.*", Pattern.CASE_INSENSITIVE); + Matcher matcher = pattern.matcher(createException.getCause().getMessage()); + + if (matcher.find()) { + // If the Job ALREADY EXISTS, retrieve it. + Job job = this.getJob(jobInfo.getJobId(), JobOption.fields(JobField.STATISTICS)); + + long jobCreationTime = job.getStatistics().getCreationTime(); + long jobMinStaleTime = System.currentTimeMillis(); + long jobMaxStaleTime = + java.time.Instant.ofEpochMilli(jobMinStaleTime) + .minus(1, java.time.temporal.ChronoUnit.DAYS) + .toEpochMilli(); + + // Only return the job if it has been created in the past 24 hours. + // This is assuming any job older than 24 hours is a valid duplicate JobID + // and not a false positive like b/290419183 + if (jobCreationTime >= jobMaxStaleTime && jobCreationTime <= jobMinStaleTime) { + return job; + } } } + throw createException; } - throw createException; - } - // If create RPC fails, it's still possible that the job has been successfully - // created, and get might work. - // We can only do this if we randomly generated the ID. Otherwise we might - // mistakenly fetch a job created by someone else. - Job job; - try { - job = getJob(finalJobId[0]); - } catch (BigQueryException e) { - throw createException; - } - if (job == null) { - throw createException; + // If create RPC fails, it's still possible that the job has been successfully + // created, and get might work. + // We can only do this if we randomly generated the ID. Otherwise we might + // mistakenly fetch a job created by someone else. + Job job; + try { + job = getJob(finalJobId[0]); + } catch (BigQueryException e) { + throw createException; + } + if (job == null) { + throw createException; + } + return job; + } finally { + if (jobCreate != null) { + jobCreate.end(); + } } - return job; } @Override @@ -491,7 +556,18 @@ public Dataset getDataset(String datasetId, DatasetOption... options) { public Dataset getDataset(final DatasetId datasetId, DatasetOption... options) { final DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); final Map optionsMap = optionMap(options); - try { + Span datasetGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + datasetGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getDataset") + .setAllAttributes(completeDatasetId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope datasetGetScope = datasetGet != null ? datasetGet.makeCurrent() : null) { com.google.api.services.bigquery.model.Dataset answer = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -514,6 +590,10 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException return null; } throw BigQueryException.translateAndThrow(e); + } finally { + if (datasetGet != null) { + datasetGet.end(); + } } } @@ -524,7 +604,24 @@ public Page listDatasets(DatasetListOption... options) { @Override public Page listDatasets(String projectId, DatasetListOption... options) { - return listDatasets(projectId, getOptions(), optionMap(options)); + Span datasetsList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + datasetsList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listDatasets") + .setAttribute("bq.dataset.project_id", projectId) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope datasetsListScope = datasetsList != null ? datasetsList.makeCurrent() : null) { + return listDatasets(projectId, getOptions(), optionMap(options)); + } finally { + if (datasetsList != null) { + datasetsList.end(); + } + } } private static Page listDatasets( @@ -574,7 +671,18 @@ public boolean delete(String datasetId, DatasetDeleteOption... options) { public boolean delete(DatasetId datasetId, DatasetDeleteOption... options) { final DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); final Map optionsMap = optionMap(options); - try { + Span datasetDelete = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + datasetDelete = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.deleteDataset") + .setAllAttributes(datasetId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope datasetDeleteScope = datasetDelete != null ? datasetDelete.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -592,6 +700,10 @@ public Boolean call() throws IOException { return false; } throw BigQueryException.translateAndThrow(e); + } finally { + if (datasetDelete != null) { + datasetDelete.end(); + } } } @@ -607,7 +719,17 @@ public boolean delete(TableId tableId) { Strings.isNullOrEmpty(tableId.getProject()) ? getOptions().getProjectId() : tableId.getProject()); - try { + Span tableDelete = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tableDelete = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.deleteTable") + .setAllAttributes(tableId.getOtelAttributes()) + .startSpan(); + } + try (Scope tableDeleteScope = tableDelete != null ? tableDelete.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -627,6 +749,10 @@ public Boolean call() throws IOException { return false; } throw BigQueryException.translateAndThrow(e); + } finally { + if (tableDelete != null) { + tableDelete.end(); + } } } @@ -637,7 +763,17 @@ public boolean delete(ModelId modelId) { Strings.isNullOrEmpty(modelId.getProject()) ? getOptions().getProjectId() : modelId.getProject()); - try { + Span modelDelete = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + modelDelete = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.deleteModel") + .setAllAttributes(modelId.getOtelAttributes()) + .startSpan(); + } + try (Scope modelDeleteScope = modelDelete != null ? modelDelete.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -657,6 +793,10 @@ public Boolean call() throws IOException { return false; } throw BigQueryException.translateAndThrow(e); + } finally { + if (modelDelete != null) { + modelDelete.end(); + } } } @@ -667,7 +807,17 @@ public boolean delete(RoutineId routineId) { Strings.isNullOrEmpty(routineId.getProject()) ? getOptions().getProjectId() : routineId.getProject()); - try { + Span routineDelete = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routineDelete = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.deleteRoutine") + .setAllAttributes(routineId.getOtelAttributes()) + .startSpan(); + } + try (Scope routineDeleteScope = routineDelete != null ? routineDelete.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -687,6 +837,10 @@ public Boolean call() throws IOException { return false; } throw BigQueryException.translateAndThrow(e); + } finally { + if (routineDelete != null) { + routineDelete.end(); + } } } @@ -697,6 +851,16 @@ public boolean delete(JobId jobId) { Strings.isNullOrEmpty(jobId.getProject()) ? getOptions().getProjectId() : jobId.getProject()); + Span jobDelete = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + jobDelete = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.deleteJob") + .setAllAttributes(completeJobId.getOtelAttributes()) + .startSpan(); + } try { return BigQueryRetryHelper.runWithRetries( new Callable() { @@ -712,6 +876,10 @@ public Boolean call() throws IOException { EMPTY_RETRY_CONFIG); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (jobDelete != null) { + jobDelete.end(); + } } } @@ -720,7 +888,18 @@ public Dataset update(DatasetInfo datasetInfo, DatasetOption... options) { final com.google.api.services.bigquery.model.Dataset datasetPb = datasetInfo.setProjectId(getOptions().getProjectId()).toPb(); final Map optionsMap = optionMap(options); - try { + Span datasetUpdate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + datasetUpdate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.updateDataset") + .setAllAttributes(datasetInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope datasetUpdateScope = datasetUpdate != null ? datasetUpdate.makeCurrent() : null) { return Dataset.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -736,6 +915,10 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (datasetUpdate != null) { + datasetUpdate.end(); + } } } @@ -750,7 +933,18 @@ public Table update(TableInfo tableInfo, TableOption... options) { .toPb(); handleExternalTableSchema(tablePb); final Map optionsMap = optionMap(options); - try { + Span tableUpdate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tableUpdate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.updateTable") + .setAllAttributes(tableInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tableUpdateScope = tableUpdate != null ? tableUpdate.makeCurrent() : null) { return Table.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -766,6 +960,10 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (tableUpdate != null) { + tableUpdate.end(); + } } } @@ -779,7 +977,18 @@ public Model update(ModelInfo modelInfo, ModelOption... options) { : modelInfo.getModelId().getProject()) .toPb(); final Map optionsMap = optionMap(options); - try { + Span modelUpdate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + modelUpdate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.updateModel") + .setAllAttributes(modelInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope modelUpdateScope = modelUpdate != null ? modelUpdate.makeCurrent() : null) { return Model.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -795,6 +1004,10 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (modelUpdate != null) { + modelUpdate.end(); + } } } @@ -808,7 +1021,18 @@ public Routine update(RoutineInfo routineInfo, RoutineOption... options) { : routineInfo.getRoutineId().getProject()) .toPb(); final Map optionsMap = optionMap(options); - try { + Span routineUpdate = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routineUpdate = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.updateRoutine") + .setAllAttributes(routineInfo.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope routineUpdateScope = routineUpdate != null ? routineUpdate.makeCurrent() : null) { return Routine.fromPb( this, BigQueryRetryHelper.runWithRetries( @@ -824,6 +1048,10 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (routineUpdate != null) { + routineUpdate.end(); + } } } @@ -842,7 +1070,18 @@ public Table getTable(TableId tableId, TableOption... options) { ? getOptions().getProjectId() : tableId.getProject()); final Map optionsMap = optionMap(options); - try { + Span tableGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tableGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getTable") + .setAllAttributes(tableId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tableGetScope = tableGet != null ? tableGet.makeCurrent() : null) { com.google.api.services.bigquery.model.Table answer = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -868,6 +1107,10 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { return null; } throw BigQueryException.translateAndThrow(e); + } finally { + if (tableGet != null) { + tableGet.end(); + } } } @@ -884,7 +1127,18 @@ public Model getModel(ModelId modelId, ModelOption... options) { ? getOptions().getProjectId() : modelId.getProject()); final Map optionsMap = optionMap(options); - try { + Span modelGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + modelGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getModel") + .setAllAttributes(modelId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope modelGetScope = modelGet != null ? modelGet.makeCurrent() : null) { com.google.api.services.bigquery.model.Model answer = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -910,6 +1164,10 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { return null; } throw BigQueryException.translateAndThrow(e); + } finally { + if (modelGet != null) { + modelGet.end(); + } } } @@ -926,7 +1184,18 @@ public Routine getRoutine(RoutineId routineId, RoutineOption... options) { ? getOptions().getProjectId() : routineId.getProject()); final Map optionsMap = optionMap(options); - try { + Span routineGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routineGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getRoutine") + .setAllAttributes(routineId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope routineGetScope = routineGet != null ? routineGet.makeCurrent() : null) { com.google.api.services.bigquery.model.Routine answer = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -952,67 +1221,189 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException return null; } throw BigQueryException.translateAndThrow(e); + } finally { + if (routineGet != null) { + routineGet.end(); + } } } @Override public Page
    listTables(String datasetId, TableListOption... options) { - return listTables( - DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + Span tablesList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tablesList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listTables") + .setAllAttributes(DatasetId.of(datasetId).getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tablesListScope = tablesList != null ? tablesList.makeCurrent() : null) { + return listTables( + DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + } finally { + if (tablesList != null) { + tablesList.end(); + } + } } @Override public Page
    listTables(DatasetId datasetId, TableListOption... options) { DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); - return listTables(completeDatasetId, getOptions(), optionMap(options)); + Span tablesList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tablesList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listTables") + .setAllAttributes(completeDatasetId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tablesListScope = tablesList != null ? tablesList.makeCurrent() : null) { + return listTables(completeDatasetId, getOptions(), optionMap(options)); + } finally { + if (tablesList != null) { + tablesList.end(); + } + } } @Override public Page listModels(String datasetId, ModelListOption... options) { - return listModels( - DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + Span modelsList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + modelsList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listModels") + .setAllAttributes(DatasetId.of(datasetId).getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope modelsListScope = modelsList != null ? modelsList.makeCurrent() : null) { + return listModels( + DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + } finally { + if (modelsList != null) { + modelsList.end(); + } + } } @Override public Page listModels(DatasetId datasetId, ModelListOption... options) { DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); - return listModels(completeDatasetId, getOptions(), optionMap(options)); + Span modelsList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + modelsList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listModels") + .setAllAttributes(datasetId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope modelsListScope = modelsList != null ? modelsList.makeCurrent() : null) { + return listModels(completeDatasetId, getOptions(), optionMap(options)); + } finally { + if (modelsList != null) { + modelsList.end(); + } + } } @Override public Page listRoutines(String datasetId, RoutineListOption... options) { - return listRoutines( - DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + Span routinesList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routinesList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listRoutines") + .setAllAttributes(DatasetId.of(datasetId).getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope routinesListScope = routinesList != null ? routinesList.makeCurrent() : null) { + return listRoutines( + DatasetId.of(getOptions().getProjectId(), datasetId), getOptions(), optionMap(options)); + } finally { + if (routinesList != null) { + routinesList.end(); + } + } } @Override public Page listRoutines(DatasetId datasetId, RoutineListOption... options) { DatasetId completeDatasetId = datasetId.setProjectId(getOptions().getProjectId()); - return listRoutines(completeDatasetId, getOptions(), optionMap(options)); + Span routinesList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + routinesList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listRoutines") + .setAllAttributes(datasetId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope routinesListScope = routinesList != null ? routinesList.makeCurrent() : null) { + return listRoutines(completeDatasetId, getOptions(), optionMap(options)); + } finally { + if (routinesList != null) { + routinesList.end(); + } + } } @Override public List listPartitions(TableId tableId) { - List partitions = new ArrayList(); - String partitionsTable = tableId.getTable() + "$__PARTITIONS_SUMMARY__"; - TableId metaTableId = - tableId.getProject() == null - ? TableId.of(tableId.getDataset(), partitionsTable) - : TableId.of(tableId.getProject(), tableId.getDataset(), partitionsTable); - Table metaTable = getTable(metaTableId); - Schema metaSchema = metaTable.getDefinition().getSchema(); - String partition_id = null; - for (Field field : metaSchema.getFields()) { - if (field.getName().equals("partition_id")) { - partition_id = field.getName(); - break; - } + Span listPartitions = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + listPartitions = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listPartitions") + .setAllAttributes(tableId.getOtelAttributes()) + .startSpan(); } - TableResult result = metaTable.list(metaSchema); - for (FieldValueList list : result.iterateAll()) { - partitions.add(list.get(partition_id).getStringValue()); + try (Scope listPartitionsScope = listPartitions != null ? listPartitions.makeCurrent() : null) { + List partitions = new ArrayList(); + String partitionsTable = tableId.getTable() + "$__PARTITIONS_SUMMARY__"; + TableId metaTableId = + tableId.getProject() == null + ? TableId.of(tableId.getDataset(), partitionsTable) + : TableId.of(tableId.getProject(), tableId.getDataset(), partitionsTable); + Table metaTable = getTable(metaTableId); + Schema metaSchema = metaTable.getDefinition().getSchema(); + String partition_id = null; + for (Field field : metaSchema.getFields()) { + if (field.getName().equals("partition_id")) { + partition_id = field.getName(); + break; + } + } + TableResult result = metaTable.list(metaSchema); + for (FieldValueList list : result.iterateAll()) { + partitions.add(list.get(partition_id).getStringValue()); + } + return partitions; + } finally { + if (listPartitions != null) { + listPartitions.end(); + } } - return partitions; } private static Page
    listTables( @@ -1165,33 +1556,52 @@ public Rows apply(RowToInsert rowToInsert) { requestPb.setRows(rowsPb); TableDataInsertAllResponse responsePb; - if (allInsertIdsSet[0]) { - // allowing retries only if all row insertIds are set (used for deduplication) - try { + Span insertAll = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + insertAll = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.insertAll") + .setAllAttributes(request.getOtelAttributes()) + .startSpan(); + } + try (Scope insertAllScope = insertAll != null ? insertAll.makeCurrent() : null) { + if (allInsertIdsSet[0]) { + // allowing retries only if all row insertIds are set (used for deduplication) + try { + responsePb = + BigQueryRetryHelper.runWithRetries( + new Callable() { + @Override + public TableDataInsertAllResponse call() throws Exception { + return bigQueryRpc.insertAllSkipExceptionTranslation( + tableId.getProject(), + tableId.getDataset(), + tableId.getTable(), + requestPb); + } + }, + getOptions().getRetrySettings(), + BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getClock(), + EMPTY_RETRY_CONFIG); + } catch (BigQueryRetryHelperException e) { + throw BigQueryException.translateAndThrow(e); + } + } else { + // Use insertAll that translate the exception as we are not retrying. responsePb = - BigQueryRetryHelper.runWithRetries( - new Callable() { - @Override - public TableDataInsertAllResponse call() throws Exception { - return bigQueryRpc.insertAllSkipExceptionTranslation( - tableId.getProject(), tableId.getDataset(), tableId.getTable(), requestPb); - } - }, - getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, - getOptions().getClock(), - EMPTY_RETRY_CONFIG); - } catch (BigQueryRetryHelperException e) { - throw BigQueryException.translateAndThrow(e); + bigQueryRpc.insertAll( + tableId.getProject(), tableId.getDataset(), tableId.getTable(), requestPb); } - } else { - // Use insertAll that translate the exception as we are not retrying. - responsePb = - bigQueryRpc.insertAll( - tableId.getProject(), tableId.getDataset(), tableId.getTable(), requestPb); - } - return InsertAllResponse.fromPb(responsePb); + return InsertAllResponse.fromPb(responsePb); + } finally { + if (insertAll != null) { + insertAll.end(); + } + } } @Override @@ -1215,11 +1625,28 @@ public TableResult listTableData( public TableResult listTableData(TableId tableId, Schema schema, TableDataListOption... options) { Tuple, Long> data = listTableData(tableId, schema, getOptions(), optionMap(options)); - return TableResult.newBuilder() - .setSchema(schema) - .setTotalRows(data.y()) - .setPageNoSchema(data.x()) - .build(); + Span tableDataList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + tableDataList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listTableData") + .setAllAttributes(tableId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope tableDataListScope = tableDataList != null ? tableDataList.makeCurrent() : null) { + return TableResult.newBuilder() + .setSchema(schema) + .setTotalRows(data.y()) + .setPageNoSchema(data.x()) + .build(); + } finally { + if (tableDataList != null) { + tableDataList.end(); + } + } } private static Tuple, Long> listTableData( @@ -1295,7 +1722,18 @@ public Job getJob(JobId jobId, JobOption... options) { jobId.getLocation() == null && getOptions().getLocation() != null ? getOptions().getLocation() : jobId.getLocation()); - try { + Span jobGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + jobGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getJob") + .setAllAttributes(completeJobId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope jobGetScope = jobGet != null ? jobGet.makeCurrent() : null) { com.google.api.services.bigquery.model.Job answer = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -1321,12 +1759,32 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { return null; } throw BigQueryException.translateAndThrow(e); + } finally { + if (jobGet != null) { + jobGet.end(); + } } } @Override public Page listJobs(JobListOption... options) { - return listJobs(getOptions(), optionMap(options)); + Span jobsList = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + jobsList = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.listJobs") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope jobsListScope = jobsList != null ? jobsList.makeCurrent() : null) { + return listJobs(getOptions(), optionMap(options)); + } finally { + if (jobsList != null) { + jobsList.end(); + } + } } private static Page listJobs( @@ -1377,7 +1835,17 @@ public boolean cancel(JobId jobId) { jobId.getLocation() == null && getOptions().getLocation() != null ? getOptions().getLocation() : jobId.getLocation()); - try { + Span jobCancel = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + jobCancel = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.cancelJob") + .setAllAttributes(completeJobId.getOtelAttributes()) + .startSpan(); + } + try (Scope jobCancelScope = jobCancel != null ? jobCancel.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -1395,6 +1863,10 @@ public Boolean call() throws IOException { return false; } throw BigQueryException.translateAndThrow(e); + } finally { + if (jobCancel != null) { + jobCancel.end(); + } } } @@ -1408,27 +1880,56 @@ public TableResult query(QueryJobConfiguration configuration, JobOption... optio .setJobCreationMode(getOptions().getDefaultJobCreationMode()) .build(); - // If all parameters passed in configuration are supported by the query() method on the backend, - // put on fast path - QueryRequestInfo requestInfo = - new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); - if (requestInfo.isFastQuerySupported(null)) { - String projectId = getOptions().getProjectId(); - QueryRequest content = requestInfo.toPb(); - if (getOptions().getLocation() != null) { - content.setLocation(getOptions().getLocation()); + Span querySpan = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + querySpan = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.query") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope queryScope = querySpan != null ? querySpan.makeCurrent() : null) { + // If all parameters passed in configuration are supported by the query() method on the + // backend, + // put on fast path + QueryRequestInfo requestInfo = + new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); + if (requestInfo.isFastQuerySupported(null)) { + String projectId = getOptions().getProjectId(); + QueryRequest content = requestInfo.toPb(); + if (getOptions().getLocation() != null) { + content.setLocation(getOptions().getLocation()); + } + return queryRpc(projectId, content, options); + } + // Otherwise, fall back to the existing create query job logic + return create(JobInfo.of(configuration), options).getQueryResults(); + } finally { + if (querySpan != null) { + querySpan.end(); } - return queryRpc(projectId, content, options); } - // Otherwise, fall back to the existing create query job logic - return create(JobInfo.of(configuration), options).getQueryResults(); } private TableResult queryRpc( final String projectId, final QueryRequest content, JobOption... options) throws InterruptedException { com.google.api.services.bigquery.model.QueryResponse results; - try { + Span queryRpc = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + queryRpc = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.queryRpc") + .setAttribute("bq.query.project_id", projectId) + .setAllAttributes(otelAttributesFromQueryRequest(content)) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope queryRpcScope = queryRpc != null ? queryRpc.makeCurrent() : null) { results = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -1444,6 +1945,10 @@ public com.google.api.services.bigquery.model.QueryResponse call() DEFAULT_RETRY_CONFIG); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (queryRpc != null) { + queryRpc.end(); + } } if (results.getErrors() != null) { @@ -1513,37 +2018,74 @@ public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOp throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); - // If all parameters passed in configuration are supported by the query() method on the backend, - // put on fast path - QueryRequestInfo requestInfo = - new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); - if (requestInfo.isFastQuerySupported(jobId)) { - // Be careful when setting the projectID in JobId, if a projectID is specified in the JobId, - // the job created by the query method will use that project. This may cause the query to - // fail with "Access denied" if the project do not have enough permissions to run the job. - - String projectId = - jobId.getProject() != null ? jobId.getProject() : getOptions().getProjectId(); - QueryRequest content = requestInfo.toPb(); - // Be careful when setting the location, if a location is specified in the BigQueryOption or - // JobId the job created by the query method will be in that location, even if the table to be - // queried is in a different location. This may cause the query to fail with - // "BigQueryException: Not found" - if (jobId.getLocation() != null) { - content.setLocation(jobId.getLocation()); - } else if (getOptions().getLocation() != null) { - content.setLocation(getOptions().getLocation()); - } + Span querySpan = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + querySpan = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.query") + .setAllAttributes(jobId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope queryScope = querySpan != null ? querySpan.makeCurrent() : null) { + // If all parameters passed in configuration are supported by the query() method on the + // backend, + // put on fast path + QueryRequestInfo requestInfo = + new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); + if (requestInfo.isFastQuerySupported(jobId)) { + // Be careful when setting the projectID in JobId, if a projectID is specified in the JobId, + // the job created by the query method will use that project. This may cause the query to + // fail with "Access denied" if the project do not have enough permissions to run the job. + + String projectId = + jobId.getProject() != null ? jobId.getProject() : getOptions().getProjectId(); + QueryRequest content = requestInfo.toPb(); + // Be careful when setting the location, if a location is specified in the BigQueryOption or + // JobId the job created by the query method will be in that location, even if the table to + // be + // queried is in a different location. This may cause the query to fail with + // "BigQueryException: Not found" + if (jobId.getLocation() != null) { + content.setLocation(jobId.getLocation()); + } else if (getOptions().getLocation() != null) { + content.setLocation(getOptions().getLocation()); + } - return queryRpc(projectId, content, options); + return queryRpc(projectId, content, options); + } + return create(JobInfo.of(jobId, configuration), options).getQueryResults(); + } finally { + if (querySpan != null) { + querySpan.end(); + } } - return create(JobInfo.of(jobId, configuration), options).getQueryResults(); } @Override public QueryResponse getQueryResults(JobId jobId, QueryResultsOption... options) { Map optionsMap = optionMap(options); - return getQueryResults(jobId, getOptions(), optionsMap); + Span getQueryResults = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + getQueryResults = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getQueryResults") + .setAllAttributes(jobId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope getQueryResultsScope = + getQueryResults != null ? getQueryResults.makeCurrent() : null) { + return getQueryResults(jobId, getOptions(), optionsMap); + } finally { + if (getQueryResults != null) { + getQueryResults.end(); + } + } } private static QueryResponse getQueryResults( @@ -1619,8 +2161,19 @@ public Policy getIamPolicy(TableId tableId, IAMOption... options) { ? getOptions().getProjectId() : tableId.getProject()); - try { - final Map optionsMap = optionMap(options); + final Map optionsMap = optionMap(options); + Span iamPolicyGet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + iamPolicyGet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.getIamPolicy") + .setAllAttributes(tableId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope iamPolicyGetScope = iamPolicyGet != null ? iamPolicyGet.makeCurrent() : null) { return convertFromApiPolicy( BigQueryRetryHelper.runWithRetries( new Callable() { @@ -1636,6 +2189,10 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (iamPolicyGet != null) { + iamPolicyGet.end(); + } } } @@ -1646,8 +2203,21 @@ public Policy setIamPolicy(TableId tableId, final Policy policy, IAMOption... op Strings.isNullOrEmpty(tableId.getProject()) ? getOptions().getProjectId() : tableId.getProject()); - try { - final Map optionsMap = optionMap(options); + + final Map optionsMap = optionMap(options); + Span iamPolicySet = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + iamPolicySet = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.setIamPolicy") + .setAllAttributes(tableId.getOtelAttributes()) + .setAllAttributes(otelAttributesFromPolicy(policy)) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope iamPolicySetScope = iamPolicySet != null ? iamPolicySet.makeCurrent() : null) { return convertFromApiPolicy( BigQueryRetryHelper.runWithRetries( new Callable() { @@ -1663,6 +2233,10 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { EMPTY_RETRY_CONFIG)); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (iamPolicySet != null) { + iamPolicySet.end(); + } } } @@ -1674,8 +2248,21 @@ public List testIamPermissions( Strings.isNullOrEmpty(tableId.getProject()) ? getOptions().getProjectId() : tableId.getProject()); - try { - final Map optionsMap = optionMap(options); + final Map optionsMap = optionMap(options); + Span testIamPermissions = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + testIamPermissions = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQuery.testIamPermissions") + .setAllAttributes(tableId.getOtelAttributes()) + .setAttribute("bq.iam.permissions", permissions.toString()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + try (Scope testIamPermissionsScope = + testIamPermissions != null ? testIamPermissions.makeCurrent() : null) { com.google.api.services.bigquery.model.TestIamPermissionsResponse response = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -1695,6 +2282,10 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() : ImmutableList.copyOf(response.getPermissions()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (testIamPermissions != null) { + testIamPermissions.end(); + } } } @@ -1708,6 +2299,39 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() return optionMap; } + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + private static Attributes otelAttributesFromOptions(Option... options) { + Attributes attributes = Attributes.builder().build(); + for (Option option : options) { + attributes = + attributes.toBuilder() + .put("bq.option." + option.getRpcOption().toString(), option.getValue().toString()) + .build(); + } + return attributes; + } + + private static Attributes otelAttributesFromQueryRequest(QueryRequest request) { + return Attributes.builder() + .put("bq.query.dry_run", getFieldAsString(request.getDryRun())) + .put("bq.query.job_creation_mode", getFieldAsString(request.getJobCreationMode())) + .put("bq.query.kind", getFieldAsString(request.getKind())) + .put("bq.query.location", getFieldAsString(request.getLocation())) + .put("bq.query.request_id", getFieldAsString(request.getRequestId())) + .put("bq.query.use_query_cache", getFieldAsString(request.getUseQueryCache())) + .build(); + } + + private static Attributes otelAttributesFromPolicy(Policy policy) { + return Attributes.builder() + .put("bq.policy.version", getFieldAsString(policy.getVersion())) + .put("bq.policy.bindings", getFieldAsString(policy.getBindings())) + .build(); + } + static BigQueryRetryConfig getBigQueryRetryConfig(Map options) { return (BigQueryRetryConfig) options.getOrDefault(BigQueryRpc.Option.BIGQUERY_RETRY_CONFIG, null); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index a1dacc4cf3..36eeb20869 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -16,6 +16,7 @@ package com.google.cloud.bigquery; +import com.google.api.core.BetaApi; import com.google.cloud.ServiceDefaults; import com.google.cloud.ServiceOptions; import com.google.cloud.ServiceRpc; @@ -25,6 +26,7 @@ import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.cloud.http.HttpTransportOptions; import com.google.common.collect.ImmutableSet; +import io.opentelemetry.api.trace.Tracer; import java.util.Set; public class BigQueryOptions extends ServiceOptions { @@ -39,6 +41,8 @@ public class BigQueryOptions extends ServiceOptions { private boolean setThrowNotFound; private boolean useInt64Timestamps; private JobCreationMode defaultJobCreationMode = JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED; + private boolean enableOpenTelemetryTracing; + private Tracer openTelemetryTracer; public static class DefaultBigQueryFactory implements BigQueryFactory { @@ -64,6 +68,8 @@ public static class Builder extends ServiceOptions.Builder { @@ -171,6 +201,26 @@ public JobCreationMode getDefaultJobCreationMode() { return defaultJobCreationMode; } + /** + * Returns whether this BigQuery instance has OpenTelemetry tracing enabled + * + * @return true if tracing is enabled, false if not + */ + @BetaApi("Span names and attributes are subject to change without notice") + public boolean isOpenTelemetryTracingEnabled() { + return enableOpenTelemetryTracing; + } + + /** + * Returns the OpenTelemetry tracer used by this BigQuery instance + * + * @return OpenTelemetry tracer object or {@code null} if not set + */ + @BetaApi("Span names and attributes are subject to change without notice") + public Tracer getOpenTelemetryTracer() { + return openTelemetryTracer; + } + @SuppressWarnings("unchecked") @Override public Builder toBuilder() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java index 0e2ad02b21..c06d257d7d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java @@ -20,6 +20,7 @@ import static com.google.common.base.Strings.isNullOrEmpty; import com.google.api.services.bigquery.model.DatasetReference; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Objects; @@ -84,4 +85,11 @@ DatasetReference toPb() { static DatasetId fromPb(DatasetReference datasetRef) { return new DatasetId(datasetRef.getProjectId(), datasetRef.getDatasetId()); } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.dataset.project", this.getProject()) + .put("bq.dataset.id", this.getDataset()) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java index 90d6c2cd55..9187619951 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetInfo.java @@ -27,6 +27,7 @@ import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.List; import java.util.Map; @@ -746,6 +747,18 @@ public static DatasetInfo of(String datasetId) { return newBuilder(datasetId).build(); } + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .putAll(this.getDatasetId().getOtelAttributes()) + .put("bq.dataset.last_modified", getFieldAsString(this.getLastModified())) + .put("bq.dataset.location", getFieldAsString(this.getLocation())) + .build(); + } + static DatasetInfo fromPb(Dataset datasetPb) { return new BuilderImpl(datasetPb).build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java index 53952bc6cf..ce93800987 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java @@ -22,6 +22,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; @@ -479,4 +480,15 @@ public boolean equals(Object obj) { && Objects.equals(skipInvalidRows, other.skipInvalidRows) && Objects.equals(templateSuffix, other.templateSuffix); } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + public Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.insert_all.table", getFieldAsString(this.getTable().getTable())) + .put("bq.insert_all.template_suffix", getFieldAsString(this.getTemplateSuffix())) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java index b966cebe1d..4bfc2aa002 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobId.java @@ -21,6 +21,7 @@ import com.google.api.services.bigquery.model.JobReference; import com.google.auto.value.AutoValue; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.UUID; import javax.annotation.Nullable; @@ -123,4 +124,16 @@ static JobId fromPb(JobReference jobRef) { .setLocation(jobRef.getLocation()) .build(); } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.job.id", getFieldAsString(this.getJob())) + .put("bq.job.location", getFieldAsString(this.getLocation())) + .put("bq.job.project", getFieldAsString(this.getProject())) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java index 9356c69355..adb497ffa0 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java @@ -21,6 +21,7 @@ import com.google.api.services.bigquery.model.ModelReference; import com.google.common.base.Function; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Objects; @@ -105,4 +106,12 @@ ModelReference toPb() { static ModelId fromPb(ModelReference modelRef) { return new ModelId(modelRef.getProjectId(), modelRef.getDatasetId(), modelRef.getModelId()); } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.model.project", this.getProject()) + .put("bq.model.dataset", this.getDataset()) + .put("bq.model.id", this.getModel()) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java index 922ed441c8..3039483b52 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelInfo.java @@ -26,6 +26,7 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Collections; import java.util.List; @@ -453,4 +454,19 @@ Model toPb() { static ModelInfo fromPb(Model modelPb) { return new BuilderImpl(modelPb).build(); } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .putAll(this.getModelId().getOtelAttributes()) + .put("bq.model.type", getFieldAsString(this.getModelType())) + .put("bq.model.creation_time", getFieldAsString(this.getCreationTime())) + .put("bq.model.last_modified_time", getFieldAsString(this.getLastModifiedTime())) + .put("bq.model.expiration_time", getFieldAsString(this.getExpirationTime())) + .put("bq.model.location", getFieldAsString(this.getLocation())) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java index c5c3dadb3c..a632fc5a1f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java @@ -21,6 +21,7 @@ import com.google.api.services.bigquery.model.RoutineReference; import com.google.common.base.Function; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Objects; @@ -108,4 +109,12 @@ static RoutineId fromPb(RoutineReference routineRef) { return new RoutineId( routineRef.getProjectId(), routineRef.getDatasetId(), routineRef.getRoutineId()); } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.routine.project", this.getProject()) + .put("bq.routine.dataset", this.getDataset()) + .put("bq.routine.id", this.getRoutine()) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java index 646a2fdeaa..c13b90b413 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineInfo.java @@ -24,6 +24,7 @@ import com.google.common.base.MoreObjects; import com.google.common.base.Strings; import com.google.common.collect.Lists; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Collections; import java.util.List; @@ -544,4 +545,17 @@ Routine toPb() { static RoutineInfo fromPb(Routine routinePb) { return new BuilderImpl(routinePb).build(); } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .putAll(this.getRoutineId().getOtelAttributes()) + .put("bq.routine.type", getFieldAsString(this.getRoutineType())) + .put("bq.routine.creation_time", getFieldAsString(this.getCreationTime())) + .put("bq.routine.last_modified_time", getFieldAsString(this.getLastModifiedTime())) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java index b74055d4f2..fcc208453a 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java @@ -22,6 +22,7 @@ import com.google.api.services.bigquery.model.TableReference; import com.google.common.base.Function; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.util.Objects; @@ -114,4 +115,12 @@ TableReference toPb() { static TableId fromPb(TableReference tableRef) { return new TableId(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()); } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .put("bq.table.project", this.getProject()) + .put("bq.table.dataset", this.getDataset()) + .put("bq.table.id", this.getTable()) + .build(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java index 6e050d0649..b3236f4c3d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableInfo.java @@ -25,6 +25,7 @@ import com.google.api.services.bigquery.model.Table; import com.google.common.base.Function; import com.google.common.base.MoreObjects; +import io.opentelemetry.api.common.Attributes; import java.io.Serializable; import java.math.BigInteger; import java.util.Map; @@ -763,4 +764,19 @@ Table toPb() { static TableInfo fromPb(Table tablePb) { return new BuilderImpl(tablePb).build(); } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } + + protected Attributes getOtelAttributes() { + return Attributes.builder() + .putAll(this.getTableId().getOtelAttributes()) + .put("bq.table.creation_time", getFieldAsString(this.getCreationTime())) + .put("bq.table.expiration_time", getFieldAsString(this.getExpirationTime())) + .put("bq.table.last_modified_time", getFieldAsString(this.getLastModifiedTime())) + .put("bq.table.num_bytes", getFieldAsString(this.getNumBytes())) + .put("bq.table.num_rows", getFieldAsString(this.getNumRows())) + .build(); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index bd17b14fcb..eceadcbca8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -161,6 +161,17 @@ import com.google.common.io.BaseEncoding; import com.google.common.util.concurrent.ListenableFuture; import com.google.gson.JsonObject; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.context.Scope; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import io.opentelemetry.sdk.trace.samplers.Sampler; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -220,6 +231,11 @@ public class ITBigQueryTest { private static final String STORAGE_BILLING_MODEL = "LOGICAL"; private static final Long MAX_TIME_TRAVEL_HOURS = 120L; private static final Long MAX_TIME_TRAVEL_HOURS_DEFAULT = 168L; + private static final Map, Object>> OTEL_ATTRIBUTES = + new HashMap, Object>>(); + private static final Map OTEL_PARENT_SPAN_IDS = new HashMap<>(); + private static final Map OTEL_SPAN_IDS_TO_NAMES = new HashMap<>(); + private static final String OTEL_PARENT_SPAN_ID = "0000000000000000"; private static final String CLOUD_SAMPLES_DATA = Optional.fromNullable(System.getenv("CLOUD_SAMPLES_DATA_BUCKET")).or("cloud-samples-data"); private static final Map LABELS = @@ -1017,6 +1033,32 @@ public class ITBigQueryTest { private static BigQuery bigquery; private static Storage storage; + private static OpenTelemetry otel; + + private static class TestSpanExporter implements io.opentelemetry.sdk.trace.export.SpanExporter { + @Override + public CompletableResultCode export(Collection collection) { + if (collection.isEmpty()) { + return CompletableResultCode.ofFailure(); + } + for (SpanData data : collection) { + OTEL_ATTRIBUTES.put(data.getName(), data.getAttributes().asMap()); + OTEL_PARENT_SPAN_IDS.put(data.getName(), data.getParentSpanId()); + OTEL_SPAN_IDS_TO_NAMES.put(data.getSpanId(), data.getName()); + } + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode flush() { + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode shutdown() { + return CompletableResultCode.ofSuccess(); + } + } @Rule public Timeout globalTimeout = Timeout.seconds(300); @@ -1025,6 +1067,13 @@ public static void beforeClass() throws InterruptedException, IOException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); RemoteStorageHelper storageHelper = RemoteStorageHelper.create(); Map labels = ImmutableMap.of("test-job-name", "test-load-job"); + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.create(new TestSpanExporter())) + .setSampler(Sampler.alwaysOn()) + .build(); + otel = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).buildAndRegisterGlobal(); + bigquery = bigqueryHelper.getOptions().getService(); storage = storageHelper.getOptions().getService(); storage.create(BucketInfo.of(BUCKET)); @@ -7493,4 +7542,157 @@ public void testStatementType() throws InterruptedException { assertTrue(remoteTable.getDefinition() instanceof MaterializedViewDefinition); assertTrue(remoteTable.delete()); } + + @Test + public void testOpenTelemetryTracingDatasets() { + Tracer tracer = otel.getTracer("Test Tracer"); + BigQueryOptions otelOptions = + BigQueryOptions.newBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build(); + BigQuery bigquery = otelOptions.getService(); + + Span parentSpan = + tracer + .spanBuilder("Test Parent Span") + .setNoParent() + .setAttribute("test-attribute", "test-value") + .startSpan(); + String billingModelDataset = RemoteBigQueryHelper.generateDatasetName(); + + try (Scope parentScope = parentSpan.makeCurrent()) { + DatasetInfo info = + DatasetInfo.newBuilder(billingModelDataset) + .setDescription(DESCRIPTION) + .setMaxTimeTravelHours(72L) + .setLabels(LABELS) + .build(); + + Dataset dataset = bigquery.create(info); + assertNotNull(dataset); + dataset = bigquery.getDataset(dataset.getDatasetId().getDataset()); + assertNotNull(dataset); + + DatasetInfo updatedInfo = + DatasetInfo.newBuilder(billingModelDataset) + .setDescription("Updated Description") + .setMaxTimeTravelHours(96L) + .setLabels(LABELS) + .build(); + + dataset = bigquery.update(updatedInfo, DatasetOption.accessPolicyVersion(2)); + assertEquals(dataset.getDescription(), "Updated Description"); + assertTrue(bigquery.delete(dataset.getDatasetId())); + } finally { + parentSpan.end(); + Map, Object> createMap = + OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.createDataset"); + assertEquals(createMap.get(AttributeKey.stringKey("bq.dataset.location")), "null"); + + Map, Object> getMap = + OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.getDataset"); + assertEquals(getMap.get(AttributeKey.stringKey("bq.dataset.id")), billingModelDataset); + + Map, Object> updateMap = + OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.updateDataset"); + assertEquals(updateMap.get(AttributeKey.stringKey("bq.option.ACCESS_POLICY_VERSION")), "2"); + + Map, Object> deleteMap = + OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.deleteDataset"); + assertEquals(deleteMap.get(AttributeKey.stringKey("bq.dataset.id")), billingModelDataset); + + // All should be children spans of parentSpan + assertEquals( + OTEL_SPAN_IDS_TO_NAMES.get( + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.getDataset")), + "Test Parent Span"); + assertEquals( + OTEL_SPAN_IDS_TO_NAMES.get( + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createDataset")), + "Test Parent Span"); + assertEquals( + OTEL_SPAN_IDS_TO_NAMES.get( + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.deleteDataset")), + "Test Parent Span"); + assertEquals(OTEL_PARENT_SPAN_IDS.get("Test Parent Span"), OTEL_PARENT_SPAN_ID); + RemoteBigQueryHelper.forceDelete(bigquery, billingModelDataset); + } + } + + @Test + public void testOpenTelemetryTracingTables() { + Tracer tracer = otel.getTracer("Test Tracer"); + BigQueryOptions otelOptions = + BigQueryOptions.newBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build(); + BigQuery bigquery = otelOptions.getService(); + + String tableName = "test_otel_table"; + StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); + TableInfo tableInfo = + TableInfo.newBuilder(TableId.of(DATASET, tableName), tableDefinition) + .setDescription("Some Description") + .build(); + Table createdTable = bigquery.create(tableInfo); + assertThat(createdTable.getDescription()).isEqualTo("Some Description"); + + assertEquals( + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createTable"), + OTEL_PARENT_SPAN_ID); + assertEquals( + OTEL_ATTRIBUTES + .get("com.google.cloud.bigquery.BigQuery.createTable") + .get(AttributeKey.stringKey("bq.table.id")), + tableName); + assertEquals( + OTEL_ATTRIBUTES + .get("com.google.cloud.bigquery.BigQuery.createTable") + .get(AttributeKey.stringKey("bq.table.creation_time")), + "null"); + + Table updatedTable = + bigquery.update(createdTable.toBuilder().setDescription("Updated Description").build()); + assertThat(updatedTable.getDescription()).isEqualTo("Updated Description"); + + assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.updateTable")); + assertEquals( + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.updateTable"), + OTEL_PARENT_SPAN_ID); + } + + @Test + public void testOpenTelemetryTracingQuery() throws InterruptedException { + Tracer tracer = otel.getTracer("Test Tracer"); + BigQueryOptions otelOptions = + BigQueryOptions.newBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build(); + BigQuery bigquery = otelOptions.getService(); + + // Stateless query + bigquery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); + TableResult tableResult = executeSimpleQuery(bigquery); + assertNotNull(tableResult.getQueryId()); + assertNull(tableResult.getJobId()); + + assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.queryRpc")); + + // Query job + String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); + QueryJobConfiguration config = + QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); + Job job = bigquery.create(JobInfo.of(JobId.of(), config)); + + TableResult result = job.getQueryResults(); + assertNotNull(result.getJobId()); + assertEquals(QUERY_RESULT_SCHEMA, result.getSchema()); + + assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.getQueryResults")); + assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.listTableData")); + assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.createJob")); + } } diff --git a/pom.xml b/pom.xml index e281937a32..b65439ecbc 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,15 @@ + + + io.opentelemetry + opentelemetry-bom + 1.48.0 + pom + import + + com.google.cloud google-cloud-shared-dependencies From b1962a7f0084ee4c3e248266b50406cf575cd657 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:30:59 -0700 Subject: [PATCH 2099/2268] fix(bigquery): Add MY_VIEW_DATASET_NAME_TEST_ to resource clean up sample (#3838) --- .../src/main/java/com/example/bigquery/ResourceCleanUp.java | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java b/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java index cc294f7a5f..a530885cf5 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java +++ b/samples/snippets/src/main/java/com/example/bigquery/ResourceCleanUp.java @@ -54,6 +54,7 @@ public static void main(String[] args) { || datasetName.contains("gcloud_test_") || datasetName.contains("SHARED_DATASET_TEST_") || datasetName.contains("WRITE_STREAM_TEST")) + || datasetName.contains("MY_VIEW_DATASET_NAME_TEST_") && dataset.getCreationTime() > sixHourAgo) { System.out.format("\tDeleting Dataset: %s\n", datasetName); bigquery.delete( From 69be5e7345fb8ca69d633d9dc99cf6c15fa5227b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jun 2025 18:20:54 +0200 Subject: [PATCH 2100/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.66.0 (#3835) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b65439ecbc..a713e0f59f 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.65.0 + 2.66.0 test From e9e5b690769491cd779ac275dfe6779d2af4e110 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jun 2025 18:31:33 +0200 Subject: [PATCH 2101/2268] chore(deps): update google cloud java monorepo updates (#3834) --- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a713e0f59f..f02c1908ab 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.69.0 + 1.70.0 pom import @@ -152,7 +152,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.65.0 + 2.66.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 0719a50454..679ea72bc2 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.65.0 + 2.66.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f81a2b0d90..4c62e8c104 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.65.0 + 2.66.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9ddab8dc91..3ec7e666e6 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.65.0 + 2.66.0 test From 08772af8d04a4200b1bb5539246208f16cea714b Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 12 Jun 2025 13:39:39 -0400 Subject: [PATCH 2102/2268] build: include arrow dependency suggested compiler flags (#3844) * build: include arrow dependency suggested compiler flags This follows https://arrow.apache.org/docs/java/install.html, where we add the indicated `--add-opens` flag. This is meant to follow from https://github.com/googleapis/java-bigquery/pull/3811#issuecomment-2941443802 * fix: only activate on JDK 9+ --- google-cloud-bigquery/pom.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9599d760c5..1bdc43faed 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -275,6 +275,27 @@ + + arrow-config + + [9,) + + + + + org.apache.maven.plugins + maven-compiler-plugin + + UTF-8 + true + + -J--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + + + + + java17 From 4c203c1e7f063fe9a8ea77974899f3a79a2d0fd7 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:40:32 -0400 Subject: [PATCH 2103/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.62.0 (#3848) --- README.md | 2 +- samples/snippets/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42b0b9f7e4..d8f6c46d87 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google com.google.cloud libraries-bom - 26.43.0 + 26.62.0 pom import diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3ec7e666e6..e233d277e8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.43.0 + 26.62.0 pom import From d0cea7d2cb958adcc85f5861cbca6f9c3d1c8183 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jun 2025 20:40:54 +0200 Subject: [PATCH 2104/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.60.0 (#3836) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 679ea72bc2..b7dd48f284 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.59.0 + 2.60.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4c62e8c104..d176a10ccc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.59.0 + 2.60.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e233d277e8..478359e9aa 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.59.0 + 2.60.0 test From 51321c22778fd41134cc0cdfc70bdc47f05883f1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Jun 2025 20:43:15 +0200 Subject: [PATCH 2105/2268] deps: update dependency io.opentelemetry:opentelemetry-bom to v1.51.0 (#3840) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f02c1908ab..97712df9f6 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ io.opentelemetry opentelemetry-bom - 1.48.0 + 1.51.0 pom import From 057f7626d8b0d178fd04d40e7eb31839e891d42a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:54:37 -0400 Subject: [PATCH 2106/2268] chore(main): release 2.51.1-SNAPSHOT (#3839) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 6285defb6c..cd645c356f 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.51.0 + 2.51.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 66387cf2ef..3d31594b72 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.51.0 + 2.51.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.51.0 + 2.51.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 1bdc43faed..98d88fdbbf 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.51.0 + 2.51.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.51.0 + 2.51.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 97712df9f6..fd844f0887 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.51.0 + 2.51.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -102,7 +102,7 @@ com.google.cloud google-cloud-bigquery - 2.51.0 + 2.51.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d176a10ccc..5bfcf1bf0c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.51.0 + 2.51.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index b17f78a7bf..7622bb1dca 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.51.0:2.51.0 \ No newline at end of file +google-cloud-bigquery:2.51.0:2.51.1-SNAPSHOT \ No newline at end of file From 414f61d7efcfa568c1446bd41945d7a8e2450649 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Jun 2025 19:33:29 +0200 Subject: [PATCH 2107/2268] deps: update ossf/scorecard-action action to v2.4.2 (#3810) --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 87e8e13c43..1524dc8d2c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -37,7 +37,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2 with: results_file: results.sarif results_format: sarif From fde9d671933d01cfd43493fcf917382361d8f384 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Jun 2025 19:35:56 +0200 Subject: [PATCH 2108/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.51.0 (#3797) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b7dd48f284..dee35288d4 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.50.0 + 2.51.0 From 286728fb1c6bb5d1a8afe796a1d3514704b8c6d1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Jun 2025 19:38:43 +0200 Subject: [PATCH 2109/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.53.0 (#3798) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fd844f0887..16e2df2e4e 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ com.google.cloud google-cloud-storage - 2.52.2 + 2.53.0 test From ab8499ae927101d7bf9c67130a790a31aa00ac25 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 16 Jun 2025 19:57:03 +0200 Subject: [PATCH 2110/2268] build(deps): update dependency org.codehaus.mojo:build-helper-maven-plugin to v3.6.1 (#3830) --- google-cloud-bigquery/pom.xml | 2 +- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 98d88fdbbf..4162718fbf 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -251,7 +251,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.6.0 + 3.6.1 add-source diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index dee35288d4..ec9180d6a5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -92,7 +92,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.6.0 + 3.6.1 add-snippets-source diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 5bfcf1bf0c..b8ba50d011 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -90,7 +90,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.6.0 + 3.6.1 add-snippets-source From 6f9f77d47596b00b7317c8a0d4a10c3d849ad57b Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Tue, 17 Jun 2025 11:06:50 -0400 Subject: [PATCH 2111/2268] deps: remove version declaration of open-telemetry-bom (#3855) --- pom.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pom.xml b/pom.xml index 16e2df2e4e..7e07ef3ef2 100644 --- a/pom.xml +++ b/pom.xml @@ -59,15 +59,6 @@ - - - io.opentelemetry - opentelemetry-bom - 1.51.0 - pom - import - - com.google.cloud google-cloud-shared-dependencies From eabf2a276231faa0ca413a60d33943f581b30aaa Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 17 Jun 2025 18:25:59 +0200 Subject: [PATCH 2112/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.15.2 (#3852) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e07ef3ef2..ebdc3d45bd 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.15.0 + 3.15.2 pom import From cf864df739bbb820e99999b7c1592a3635fea4ec Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 18 Jun 2025 17:49:02 +0200 Subject: [PATCH 2113/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.49.2 (#3853) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 3f29452159..8449bf074c 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.49.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.49.2 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 54d873dc1f..b6a5a9d3e0 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index b7bd7ed2f9..d0d6dea719 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 7090b33d1a..a4a1fe79ee 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 54d873dc1f..b6a5a9d3e0 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index b7bd7ed2f9..d0d6dea719 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 7090b33d1a..a4a1fe79ee 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.2" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3d31594b72..9c1967a6d5 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.49.0 + 3.49.2 diff --git a/pom.xml b/pom.xml index ebdc3d45bd..362c1f1444 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.49.0 + 3.49.2 From af9084141d615179e0f2952ccb138b9d7c90ed17 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 20 Jun 2025 16:50:58 +0200 Subject: [PATCH 2114/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.53.1 (#3856) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 362c1f1444..2cdc232f0d 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.53.0 + 2.53.1 test From 4b28c479c1bc22326c8d2501354fb86ec2ce1744 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Mon, 23 Jun 2025 14:50:27 -0700 Subject: [PATCH 2115/2268] feat(bigquery): Integrate Otel into retries, jobs, and more (#3842) * feat(bigquery): Integrate Otel into retries, jobs, and tableDataWriteChannel * Add justification for changing func signature * fix ignored-differences syntax * fix ignored-differences syntax...again * update IT tests * Remove config and algorithm from retry span * remove otel support from connection interface --- .../clirr-ignored-differences.xml | 6 + .../google/cloud/bigquery/BigQueryImpl.java | 124 +++++-- .../cloud/bigquery/BigQueryRetryHelper.java | 20 +- .../google/cloud/bigquery/ConnectionImpl.java | 24 +- .../java/com/google/cloud/bigquery/Job.java | 335 +++++++++++++----- .../cloud/bigquery/TableDataWriteChannel.java | 45 ++- .../cloud/bigquery/it/ITBigQueryTest.java | 25 ++ 7 files changed, 446 insertions(+), 133 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index 37e349413f..e048f4ce82 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -2,6 +2,12 @@ + + 7004 + com/google/cloud/bigquery/BigQueryRetryHelper + java.lang.Object runWithRetries(java.util.concurrent.Callable, com.google.api.gax.retrying.RetrySettings, com.google.api.gax.retrying.ResultRetryAlgorithm, com.google.api.core.ApiClock, com.google.cloud.bigquery.BigQueryRetryConfig) + A Tracer object is needed to use Otel and runWithRetries is only called in a few files, so it should be fine to update the signature + 7004 com/google/cloud/bigquery/spi/v2/BigQueryRpc diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 2efe8f92ae..a32a600c3f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -295,7 +295,9 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -340,7 +342,9 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -394,7 +398,9 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -488,7 +494,9 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { getOptions().getClock(), getBigQueryRetryConfig(optionsMap) != null ? getBigQueryRetryConfig(optionsMap) - : DEFAULT_RETRY_CONFIG)); + : DEFAULT_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -580,7 +588,9 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return Dataset.fromPb(this, answer); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { @@ -644,7 +654,9 @@ private static Page listDatasets( serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.x(); return new PageImpl<>( new DatasetPageFetcher(projectId, serviceOptions, cursor, optionsMap), @@ -694,7 +706,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { return false; @@ -743,7 +757,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { return false; @@ -787,7 +803,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { return false; @@ -831,7 +849,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { return false; @@ -873,7 +893,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -912,7 +934,9 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -957,7 +981,9 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -1001,7 +1027,9 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -1045,7 +1073,9 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -1097,7 +1127,9 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return Table.fromPb(this, answer); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { @@ -1154,7 +1186,9 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return Model.fromPb(this, answer); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { @@ -1211,7 +1245,9 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return Routine.fromPb(this, answer); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { @@ -1427,7 +1463,9 @@ public Tuple> cal serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.x(); Iterable
    tables = Iterables.transform( @@ -1466,7 +1504,9 @@ public Tuple> cal serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.x(); Iterable models = Iterables.transform( @@ -1505,7 +1545,9 @@ private static Page listRoutines( serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.x(); Iterable routines = Iterables.transform( @@ -1585,7 +1627,9 @@ public TableDataInsertAllResponse call() throws Exception { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -1677,7 +1721,9 @@ public TableDataList call() throws IOException { serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.getPageToken(); Map pageOptionMap = Strings.isNullOrEmpty(cursor) ? optionsMap : optionMap(TableDataListOption.startIndex(0)); @@ -1749,7 +1795,9 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return Job.fromPb(this, answer); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { @@ -1804,7 +1852,9 @@ public Tuple> call( serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); String cursor = result.x(); Iterable jobs = Iterables.transform( @@ -1857,7 +1907,9 @@ public Boolean call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { if (isRetryErrorCodeHttpNotFound(e)) { return false; @@ -1942,7 +1994,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - DEFAULT_RETRY_CONFIG); + DEFAULT_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -2117,7 +2171,9 @@ public GetQueryResultsResponse call() throws IOException { serviceOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, serviceOptions.getClock(), - DEFAULT_RETRY_CONFIG); + DEFAULT_RETRY_CONFIG, + serviceOptions.isOpenTelemetryTracingEnabled(), + serviceOptions.getOpenTelemetryTracer()); TableSchema schemaPb = results.getSchema(); @@ -2186,7 +2242,9 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -2230,7 +2288,9 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG)); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer())); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } finally { @@ -2276,7 +2336,9 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); return response.getPermissions() == null ? ImmutableList.of() : ImmutableList.copyOf(response.getPermissions()); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java index d315241a3c..9c70830465 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryHelper.java @@ -25,6 +25,9 @@ import com.google.api.gax.retrying.RetryingFuture; import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.cloud.RetryHelper; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -40,9 +43,18 @@ public static V runWithRetries( RetrySettings retrySettings, ResultRetryAlgorithm resultRetryAlgorithm, ApiClock clock, - BigQueryRetryConfig bigQueryRetryConfig) + BigQueryRetryConfig bigQueryRetryConfig, + boolean isOpenTelemetryEnabled, + Tracer openTelemetryTracer) throws RetryHelperException { - try { + Span runWithRetries = null; + if (isOpenTelemetryEnabled && openTelemetryTracer != null) { + runWithRetries = + openTelemetryTracer + .spanBuilder("com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries") + .startSpan(); + } + try (Scope runWithRetriesScope = runWithRetries != null ? runWithRetries.makeCurrent() : null) { // Suppressing should be ok as a workaraund. Current and only ResultRetryAlgorithm // implementation does not use response at all, so ignoring its type is ok. @SuppressWarnings("unchecked") @@ -59,6 +71,10 @@ public static V runWithRetries( throw new BigQueryRetryHelperException(new BigQueryException((IOException) e.getCause())); } throw new BigQueryRetryHelperException(e.getCause()); + } finally { + if (runWithRetries != null) { + runWithRetries.end(); + } } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index eb3a32db74..b12ad85564 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -476,7 +476,9 @@ private BigQueryResult queryRpc( bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - retryConfig); + retryConfig, + false, + null); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } @@ -932,7 +934,9 @@ private Job getQueryJobRpc(JobId jobId) { bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + false, + null); } catch (BigQueryRetryHelperException e) { if (e.getCause() instanceof BigQueryException) { if (((BigQueryException) e.getCause()).getCode() == HTTP_NOT_FOUND) { @@ -977,7 +981,9 @@ TableDataList tableDataListRpc(TableId destinationTable, String pageToken) { bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + false, + null); return results; } catch (BigQueryRetryHelperException e) { @@ -1208,7 +1214,9 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - retryConfig); + retryConfig, + false, + null); if (results.getErrors() != null) { List bigQueryErrors = @@ -1471,7 +1479,9 @@ com.google.api.services.bigquery.model.Job createQueryJob( bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - retryConfig); + retryConfig, + false, + null); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { logger.log(Level.WARNING, "\n Error occurred while calling createJobForQuery", e); throw BigQueryException.translateAndThrow(e); @@ -1514,7 +1524,9 @@ com.google.api.services.bigquery.model.Job createDryRunJob(String sql) { bigQueryOptions.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, bigQueryOptions.getClock(), - retryConfig); + retryConfig, + false, + null); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 00edefb9fb..88950b9fb2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -29,6 +29,9 @@ import com.google.cloud.bigquery.BigQuery.TableDataListOption; import com.google.cloud.bigquery.JobConfiguration.Type; import com.google.common.collect.ImmutableList; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.io.ObjectInputStream; import java.time.Duration; @@ -172,7 +175,21 @@ public Job build() { */ public boolean exists() { checkNotDryRun("exists"); - return bigquery.getJob(getJobId(), JobOption.fields()) != null; + Span exists = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + exists = + options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.exists") + .startSpan(); + } + try (Scope existsScope = exists != null ? exists.makeCurrent() : null) { + return bigquery.getJob(getJobId(), JobOption.fields()) != null; + } finally { + if (exists != null) { + exists.end(); + } + } } /** @@ -193,8 +210,22 @@ public boolean exists() { */ public boolean isDone() { checkNotDryRun("isDone"); - Job job = bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); - return job == null || JobStatus.State.DONE.equals(job.getStatus().getState()); + Span isDone = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + isDone = + options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.isDone") + .startSpan(); + } + try (Scope isDoneScope = isDone != null ? isDone.makeCurrent() : null) { + Job job = bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); + return job == null || JobStatus.State.DONE.equals(job.getStatus().getState()); + } finally { + if (isDone != null) { + isDone.end(); + } + } } /** See {@link #waitFor(BigQueryRetryConfig, RetryOption...)} */ @@ -275,19 +306,34 @@ public Job waitFor(BigQueryRetryConfig bigQueryRetryConfig, RetryOption... waitO private Job waitForInternal(BigQueryRetryConfig bigQueryRetryConfig, RetryOption... waitOptions) throws InterruptedException { checkNotDryRun("waitFor"); - Object completedJobResponse; - if (getConfiguration().getType() == Type.QUERY) { - completedJobResponse = - waitForQueryResults( - RetryOption.mergeToSettings(DEFAULT_JOB_WAIT_SETTINGS, waitOptions), - bigQueryRetryConfig, - DEFAULT_QUERY_WAIT_OPTIONS); - } else { - completedJobResponse = - waitForJob(RetryOption.mergeToSettings(DEFAULT_QUERY_JOB_WAIT_SETTINGS, waitOptions)); + Span waitFor = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + waitFor = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.waitFor") + .startSpan(); } + try (Scope waitForScope = waitFor != null ? waitFor.makeCurrent() : null) { + Object completedJobResponse; + if (getConfiguration().getType() == Type.QUERY) { + completedJobResponse = + waitForQueryResults( + RetryOption.mergeToSettings(DEFAULT_JOB_WAIT_SETTINGS, waitOptions), + bigQueryRetryConfig, + DEFAULT_QUERY_WAIT_OPTIONS); + } else { + completedJobResponse = + waitForJob(RetryOption.mergeToSettings(DEFAULT_QUERY_JOB_WAIT_SETTINGS, waitOptions)); + } - return completedJobResponse == null ? null : reload(); + return completedJobResponse == null ? null : reload(); + } finally { + if (waitFor != null) { + waitFor.end(); + } + } } /** @@ -304,72 +350,91 @@ private Job waitForInternal(BigQueryRetryConfig bigQueryRetryConfig, RetryOption public TableResult getQueryResults(QueryResultsOption... options) throws InterruptedException, JobException { checkNotDryRun("getQueryResults"); - if (getConfiguration().getType() != Type.QUERY) { - throw new UnsupportedOperationException( - "Getting query results is supported only for " + Type.QUERY + " jobs"); - } - - List waitOptions = - new ArrayList<>(Arrays.asList(DEFAULT_QUERY_WAIT_OPTIONS)); - List listOptions = new ArrayList<>(); - for (QueryResultsOption option : options) { - switch (option.getRpcOption()) { - case MAX_RESULTS: - listOptions.add(TableDataListOption.pageSize((Long) option.getValue())); - break; - case PAGE_TOKEN: - listOptions.add(TableDataListOption.pageToken((String) option.getValue())); - break; - case START_INDEX: - listOptions.add(TableDataListOption.startIndex((Long) option.getValue())); - break; - case TIMEOUT: - waitOptions.add(QueryResultsOption.maxWaitTime((Long) option.getValue())); - break; - } + + Span getQueryResults = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getQueryResults = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.getQueryResults") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); } + try (Scope getQueryResultsScope = + getQueryResults != null ? getQueryResults.makeCurrent() : null) { - QueryResponse response = - waitForQueryResults( - DEFAULT_JOB_WAIT_SETTINGS, - DEFAULT_RETRY_CONFIG, - waitOptions.toArray(new QueryResultsOption[0])); - - // Get the job resource to determine if it has errored. - Job job = this; - if (job.getStatus() == null || !JobStatus.State.DONE.equals(job.getStatus().getState())) { - job = reload(); - } - if (job.getStatus() != null && job.getStatus().getError() != null) { - throw new BigQueryException( - job.getStatus().getExecutionErrors() == null - ? ImmutableList.of(job.getStatus().getError()) - : ImmutableList.copyOf(job.getStatus().getExecutionErrors())); - } - - // If there are no rows in the result, this may have been a DDL query. - // Listing table data might fail, such as with CREATE VIEW queries. - // Avoid a tabledata.list API request by returning an empty TableResult. - if (response.getTotalRows() == 0) { - TableResult emptyTableResult = - TableResult.newBuilder() - .setSchema(response.getSchema()) - .setJobId(job.getJobId()) - .setTotalRows(0L) - .setPageNoSchema(new PageImpl(null, "", null)) - .build(); - return emptyTableResult; - } - - TableId table = - ((QueryJobConfiguration) getConfiguration()).getDestinationTable() == null - ? ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable() - : ((QueryJobConfiguration) getConfiguration()).getDestinationTable(); - TableResult tableResult = - bigquery.listTableData( - table, response.getSchema(), listOptions.toArray(new TableDataListOption[0])); - TableResult tableResultWithJobId = tableResult.toBuilder().setJobId(job.getJobId()).build(); - return tableResultWithJobId; + if (getConfiguration().getType() != Type.QUERY) { + throw new UnsupportedOperationException( + "Getting query results is supported only for " + Type.QUERY + " jobs"); + } + + List waitOptions = + new ArrayList<>(Arrays.asList(DEFAULT_QUERY_WAIT_OPTIONS)); + List listOptions = new ArrayList<>(); + for (QueryResultsOption option : options) { + switch (option.getRpcOption()) { + case MAX_RESULTS: + listOptions.add(TableDataListOption.pageSize((Long) option.getValue())); + break; + case PAGE_TOKEN: + listOptions.add(TableDataListOption.pageToken((String) option.getValue())); + break; + case START_INDEX: + listOptions.add(TableDataListOption.startIndex((Long) option.getValue())); + break; + case TIMEOUT: + waitOptions.add(QueryResultsOption.maxWaitTime((Long) option.getValue())); + break; + } + } + + QueryResponse response = + waitForQueryResults( + DEFAULT_JOB_WAIT_SETTINGS, + DEFAULT_RETRY_CONFIG, + waitOptions.toArray(new QueryResultsOption[0])); + + // Get the job resource to determine if it has errored. + Job job = this; + if (job.getStatus() == null || !JobStatus.State.DONE.equals(job.getStatus().getState())) { + job = reload(); + } + if (job.getStatus() != null && job.getStatus().getError() != null) { + throw new BigQueryException( + job.getStatus().getExecutionErrors() == null + ? ImmutableList.of(job.getStatus().getError()) + : ImmutableList.copyOf(job.getStatus().getExecutionErrors())); + } + + // If there are no rows in the result, this may have been a DDL query. + // Listing table data might fail, such as with CREATE VIEW queries. + // Avoid a tabledata.list API request by returning an empty TableResult. + if (response.getTotalRows() == 0) { + TableResult emptyTableResult = + TableResult.newBuilder() + .setSchema(response.getSchema()) + .setJobId(job.getJobId()) + .setTotalRows(0L) + .setPageNoSchema(new PageImpl(null, "", null)) + .build(); + return emptyTableResult; + } + + TableId table = + ((QueryJobConfiguration) getConfiguration()).getDestinationTable() == null + ? ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable() + : ((QueryJobConfiguration) getConfiguration()).getDestinationTable(); + TableResult tableResult = + bigquery.listTableData( + table, response.getSchema(), listOptions.toArray(new TableDataListOption[0])); + TableResult tableResultWithJobId = tableResult.toBuilder().setJobId(job.getJobId()).build(); + return tableResultWithJobId; + } finally { + if (getQueryResults != null) { + getQueryResults.end(); + } + } } private QueryResponse waitForQueryResults( @@ -382,7 +447,17 @@ private QueryResponse waitForQueryResults( "Waiting for query results is supported only for " + Type.QUERY + " jobs"); } - try { + Span waitForQueryResults = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + waitForQueryResults = + options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.waitForQueryResults") + .setAllAttributes(otelAttributesFromOptions(resultsOptions)) + .startSpan(); + } + try (Scope waitForQueryResultsScope = + waitForQueryResults != null ? waitForQueryResults.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -401,14 +476,43 @@ public boolean shouldRetry( } }, options.getClock(), - bigQueryRetryConfig); + bigQueryRetryConfig, + options.isOpenTelemetryTracingEnabled(), + options.getOpenTelemetryTracer()); } catch (BigQueryRetryHelper.BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (waitForQueryResults != null) { + waitForQueryResults.end(); + } } } private Job waitForJob(RetrySettings waitSettings) throws InterruptedException { - try { + Span waitForJob = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + waitForJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.waitForJob") + .setAttribute( + "bq.job.wait_settings.total_timeout", + getFieldAsString(waitSettings.getTotalTimeoutDuration())) + .setAttribute( + "bq.job.wait_settings.initial_retry_delay", + getFieldAsString(waitSettings.getInitialRetryDelayDuration())) + .setAttribute( + "bq.job.wait_settings.max_retry_delay", + getFieldAsString(waitSettings.getMaxRetryDelayDuration())) + .setAttribute( + "bq.job.wait_settings.initial_rpc_timeout", + getFieldAsString(waitSettings.getInitialRpcTimeoutDuration())) + .setAttribute( + "bq.job.wait_settings.max_rpc_timeout", + getFieldAsString(waitSettings.getMaxRpcTimeoutDuration())) + .startSpan(); + } + try (Scope waitForJobScope = waitForJob != null ? waitForJob.makeCurrent() : null) { return RetryHelper.poll( new Callable() { @Override @@ -433,6 +537,10 @@ public boolean shouldRetry(Throwable prevThrowable, Job prevResponse) { options.getClock()); } catch (ExecutionException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (waitForJob != null) { + waitForJob.end(); + } } } @@ -463,14 +571,31 @@ public boolean shouldRetry(Throwable prevThrowable, Job prevResponse) { */ public Job reload(JobOption... options) { checkNotDryRun("reload"); - Job job = bigquery.getJob(getJobId(), options); - if (job != null && job.getStatus().getError() != null) { - throw new BigQueryException( - job.getStatus().getExecutionErrors() == null - ? ImmutableList.of(job.getStatus().getError()) - : ImmutableList.copyOf(job.getStatus().getExecutionErrors())); - } - return job; + Span reload = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + reload = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.reload") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + + try (Scope reloadScope = reload != null ? reload.makeCurrent() : null) { + Job job = bigquery.getJob(getJobId(), options); + if (job != null && job.getStatus().getError() != null) { + throw new BigQueryException( + job.getStatus().getExecutionErrors() == null + ? ImmutableList.of(job.getStatus().getError()) + : ImmutableList.copyOf(job.getStatus().getExecutionErrors())); + } + return job; + } finally { + if (reload != null) { + reload.end(); + } + } } /** @@ -492,7 +617,22 @@ public Job reload(JobOption... options) { */ public boolean cancel() { checkNotDryRun("cancel"); - return bigquery.cancel(getJobId()); + Span cancel = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + cancel = + options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.Job.cancel") + .startSpan(); + } + + try (Scope cancelScope = cancel != null ? cancel.makeCurrent() : null) { + return bigquery.cancel(getJobId()); + } finally { + if (cancel != null) { + cancel.end(); + } + } } private void checkNotDryRun(String op) { @@ -556,4 +696,19 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE static Job fromPb(BigQuery bigquery, com.google.api.services.bigquery.model.Job jobPb) { return new Job(bigquery, new JobInfo.BuilderImpl(jobPb)); } + + private static Attributes otelAttributesFromOptions(Option... options) { + Attributes attributes = Attributes.builder().build(); + for (Option option : options) { + attributes = + attributes.toBuilder() + .put(option.getRpcOption().toString(), option.getValue().toString()) + .build(); + } + return attributes; + } + + private static String getFieldAsString(Object field) { + return field == null ? "null" : field.toString(); + } } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java index aabd87d471..cc64ec72f5 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java @@ -20,6 +20,8 @@ import com.google.cloud.RestorableState; import com.google.cloud.WriteChannel; import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.context.Scope; import java.io.IOException; import java.util.List; import java.util.Objects; @@ -50,7 +52,19 @@ public class TableDataWriteChannel @Override protected void flushBuffer(final int length, final boolean last) { - try { + Span flushBuffer = null; + if (getOptions().isOpenTelemetryTracingEnabled() + && getOptions().getOpenTelemetryTracer() != null) { + flushBuffer = + getOptions() + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.TableDataWriteChannel.flushBuffer") + .setAttribute("bq.table_data_write_channel.flush_buffer.length", length) + .setAttribute("bq.table_data_write_channel.flush_buffer.last", last) + .startSpan(); + } + + try (Scope flushBufferScope = flushBuffer != null ? flushBuffer.makeCurrent() : null) { com.google.api.services.bigquery.model.Job jobPb = BigQueryRetryHelper.runWithRetries( new Callable() { @@ -65,10 +79,16 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { getOptions().getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, getOptions().getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + getOptions().isOpenTelemetryTracingEnabled(), + getOptions().getOpenTelemetryTracer()); job = jobPb != null ? Job.fromPb(getOptions().getService(), jobPb) : null; } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (flushBuffer != null) { + flushBuffer.end(); + } } } @@ -81,7 +101,18 @@ private static String open( final BigQueryOptions options, final JobId jobId, final WriteChannelConfiguration writeChannelConfiguration) { - try { + Span open = null; + if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { + open = + options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.TableDataWriteChannel.open") + .setAllAttributes(jobId.getOtelAttributes()) + .setAllAttributes(writeChannelConfiguration.getDestinationTable().getOtelAttributes()) + .startSpan(); + } + + try (Scope openScope = open != null ? open.makeCurrent() : null) { return BigQueryRetryHelper.runWithRetries( new Callable() { @Override @@ -97,9 +128,15 @@ public String call() throws IOException { options.getRetrySettings(), BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, options.getClock(), - EMPTY_RETRY_CONFIG); + EMPTY_RETRY_CONFIG, + options.isOpenTelemetryTracingEnabled(), + options.getOpenTelemetryTracer()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); + } finally { + if (open != null) { + open.end(); + } } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index eceadcbca8..551e1eb40d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -6489,6 +6489,14 @@ public void testLocation() throws Exception { assertThat(location).isNotEqualTo(wrongLocation); + Tracer tracer = otel.getTracer("Test Tracer"); + bigquery = + bigquery.getOptions().toBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build() + .getService(); + Dataset dataset = bigquery.create( DatasetInfo.newBuilder("locationset_" + UUID.randomUUID().toString().replace("-", "_")) @@ -6565,6 +6573,11 @@ public void testLocation() throws Exception { bigquery.writer( JobId.newBuilder().setLocation(location).build(), writeChannelConfiguration)) { writer.write(ByteBuffer.wrap("foo".getBytes())); + assertEquals( + OTEL_ATTRIBUTES + .get("com.google.cloud.bigquery.TableDataWriteChannel.open") + .get(AttributeKey.stringKey("bq.job.location")), + location); } try { @@ -6577,6 +6590,12 @@ public void testLocation() throws Exception { } } finally { bigquery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); + bigquery = + bigquery.getOptions().toBuilder() + .setEnableOpenTelemetryTracing(false) + .setOpenTelemetryTracer(null) + .build() + .getService(); } } @@ -7661,6 +7680,7 @@ public void testOpenTelemetryTracingTables() { assertEquals( OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.updateTable"), OTEL_PARENT_SPAN_ID); + assertTrue(bigquery.delete(updatedTable.getTableId())); } @Test @@ -7680,6 +7700,9 @@ public void testOpenTelemetryTracingQuery() throws InterruptedException { assertNull(tableResult.getJobId()); assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.queryRpc")); + assertNotNull( + OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries")); + assertTrue(OTEL_ATTRIBUTES.containsKey("com.google.cloud.bigquery.BigQuery.query")); // Query job String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); @@ -7694,5 +7717,7 @@ public void testOpenTelemetryTracingQuery() throws InterruptedException { assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.getQueryResults")); assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.listTableData")); assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.createJob")); + assertTrue(OTEL_ATTRIBUTES.containsKey("com.google.cloud.bigquery.Job.getQueryResults")); + assertTrue(OTEL_ATTRIBUTES.containsKey("com.google.cloud.bigquery.Job.waitForQueryResults")); } } From d2e6b4a58ddc817ec0f7c255f5b6b15ce6b2a649 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 24 Jun 2025 15:52:35 +0200 Subject: [PATCH 2116/2268] chore(deps): update google cloud java monorepo updates (#3857) --- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 2cdc232f0d..6e992241d8 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.70.0 + 1.72.0 pom import @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.66.0 + 2.68.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index ec9180d6a5..4089821fe8 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.66.0 + 2.68.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b8ba50d011..775c14fe81 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.66.0 + 2.68.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 478359e9aa..160e38cb02 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.66.0 + 2.68.0 test From d4ca3535f54f3282aec133337103bbfa2c9a3653 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 24 Jun 2025 16:46:33 +0200 Subject: [PATCH 2117/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.68.0 (#3858) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6e992241d8..f33a3245a7 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.66.0 + 2.68.0 test From eb26deee37119389aee3962eea5ad67d63f26c70 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Jun 2025 15:59:21 +0200 Subject: [PATCH 2118/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.50.0 (#3861) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 8449bf074c..63543a40fa 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.49.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index b6a5a9d3e0..dfa34060bc 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index d0d6dea719..37dda4ab5a 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index a4a1fe79ee..a8ab977848 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index b6a5a9d3e0..dfa34060bc 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index d0d6dea719..37dda4ab5a 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index a4a1fe79ee..a8ab977848 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.49.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 9c1967a6d5..091c1d625c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.49.2 + 3.50.0 diff --git a/pom.xml b/pom.xml index f33a3245a7..c4ae2a12f4 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.49.2 + 3.50.0 From 87ff9e1632503bb2b01ab93e6b2ae6eae4471cba Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Jun 2025 16:55:34 +0200 Subject: [PATCH 2119/2268] chore(config): migrate config renovate.json (#3862) --- renovate.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/renovate.json b/renovate.json index 833ec769e8..aacfaebeb3 100644 --- a/renovate.json +++ b/renovate.json @@ -15,9 +15,9 @@ "customManagers": [ { "customType": "regex", - "fileMatch": [ - "^.kokoro/continuous/graalvm-native.*.cfg$", - "^.kokoro/presubmit/graalvm-native.*.cfg$" + "managerFilePatterns": [ + "/^.kokoro/continuous/graalvm-native.*.cfg$/", + "/^.kokoro/presubmit/graalvm-native.*.cfg$/" ], "matchStrings": [ "value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\"" @@ -27,8 +27,8 @@ }, { "customType": "regex", - "fileMatch": [ - "^.github/workflows/unmanaged_dependency_check.yaml$" + "managerFilePatterns": [ + "/^.github/workflows/unmanaged_dependency_check.yaml$/" ], "matchStrings": [ "uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n" From 2498739ce5a37f776d158394d2939dd55a9c600a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 25 Jun 2025 21:52:14 +0200 Subject: [PATCH 2120/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.15.3 (#3863) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4ae2a12f4..dc0b89ee4c 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.15.2 + 3.15.3 pom import From 13894df2d920930319660b220d13a2628ba705c6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 16:48:52 -0400 Subject: [PATCH 2121/2268] chore(main): release 2.52.0 (#3849) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 24 ++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9fe4fdd3a..71577758bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.52.0](https://github.com/googleapis/java-bigquery/compare/v2.51.0...v2.52.0) (2025-06-25) + + +### Features + +* **bigquery:** Integrate Otel in client lib ([#3747](https://github.com/googleapis/java-bigquery/issues/3747)) ([6e3e07a](https://github.com/googleapis/java-bigquery/commit/6e3e07a22b8397e1e9d5b567589e44abc55961f2)) +* **bigquery:** Integrate Otel into retries, jobs, and more ([#3842](https://github.com/googleapis/java-bigquery/issues/3842)) ([4b28c47](https://github.com/googleapis/java-bigquery/commit/4b28c479c1bc22326c8d2501354fb86ec2ce1744)) + + +### Bug Fixes + +* **bigquery:** Add MY_VIEW_DATASET_NAME_TEST_ to resource clean up sample ([#3838](https://github.com/googleapis/java-bigquery/issues/3838)) ([b1962a7](https://github.com/googleapis/java-bigquery/commit/b1962a7f0084ee4c3e248266b50406cf575cd657)) + + +### Dependencies + +* Remove version declaration of open-telemetry-bom ([#3855](https://github.com/googleapis/java-bigquery/issues/3855)) ([6f9f77d](https://github.com/googleapis/java-bigquery/commit/6f9f77d47596b00b7317c8a0d4a10c3d849ad57b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.66.0 ([#3835](https://github.com/googleapis/java-bigquery/issues/3835)) ([69be5e7](https://github.com/googleapis/java-bigquery/commit/69be5e7345fb8ca69d633d9dc99cf6c15fa5227b)) +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.68.0 ([#3858](https://github.com/googleapis/java-bigquery/issues/3858)) ([d4ca353](https://github.com/googleapis/java-bigquery/commit/d4ca3535f54f3282aec133337103bbfa2c9a3653)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.2 ([#3853](https://github.com/googleapis/java-bigquery/issues/3853)) ([cf864df](https://github.com/googleapis/java-bigquery/commit/cf864df739bbb820e99999b7c1592a3635fea4ec)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.0 ([#3861](https://github.com/googleapis/java-bigquery/issues/3861)) ([eb26dee](https://github.com/googleapis/java-bigquery/commit/eb26deee37119389aee3962eea5ad67d63f26c70)) +* Update dependency io.opentelemetry:opentelemetry-bom to v1.51.0 ([#3840](https://github.com/googleapis/java-bigquery/issues/3840)) ([51321c2](https://github.com/googleapis/java-bigquery/commit/51321c22778fd41134cc0cdfc70bdc47f05883f1)) +* Update ossf/scorecard-action action to v2.4.2 ([#3810](https://github.com/googleapis/java-bigquery/issues/3810)) ([414f61d](https://github.com/googleapis/java-bigquery/commit/414f61d7efcfa568c1446bd41945d7a8e2450649)) + ## [2.51.0](https://github.com/googleapis/java-bigquery/compare/v2.50.1...v2.51.0) (2025-06-06) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index cd645c356f..bb58ca1e1c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.51.1-SNAPSHOT + 2.52.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 091c1d625c..836073eb4c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.51.1-SNAPSHOT + 2.52.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.51.1-SNAPSHOT + 2.52.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4162718fbf..644fe0ef5b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.51.1-SNAPSHOT + 2.52.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.51.1-SNAPSHOT + 2.52.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index dc0b89ee4c..b265c66e31 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.51.1-SNAPSHOT + 2.52.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.51.1-SNAPSHOT + 2.52.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 775c14fe81..1a16552343 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.51.1-SNAPSHOT + 2.52.0 diff --git a/versions.txt b/versions.txt index 7622bb1dca..2b59228747 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.51.0:2.51.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.52.0:2.52.0 \ No newline at end of file From 6ba2126da9c80b14f32123c98247f7e2332b1ada Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 17:56:27 -0400 Subject: [PATCH 2122/2268] chore(main): release 2.52.1-SNAPSHOT (#3864) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index bb58ca1e1c..8fcf7ca00d 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 836073eb4c..1194e1b0e2 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.52.0 + 2.52.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 644fe0ef5b..6c7e1aed1b 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.52.0 + 2.52.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.52.0 + 2.52.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b265c66e31..6d9674e6f1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.52.0 + 2.52.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1a16552343..9e51363615 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.52.0 + 2.52.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 2b59228747..5e931b82a5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.52.0:2.52.0 \ No newline at end of file +google-cloud-bigquery:2.52.0:2.52.1-SNAPSHOT \ No newline at end of file From e2d23c1b15f2c48a4113f82b920f5c29c4b5dfea Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Wed, 25 Jun 2025 23:14:57 -0700 Subject: [PATCH 2123/2268] feat(bigquery): Add OpenTelemetry support to BQ rpcs (#3860) * feat(bigquery): Add OpenTelemetry support to BQ rpcs * remove oauth and access token attributes * Capture repsponse ids in attributes * Fix attribute name scoping typos --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 1062 ++++++++++++++--- .../cloud/bigquery/it/ITBigQueryTest.java | 20 + 2 files changed, 914 insertions(+), 168 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 03e1fb5866..9d89435ea9 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -69,6 +69,9 @@ import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.SpanKind; import java.io.IOException; import java.math.BigInteger; import java.util.List; @@ -155,7 +158,28 @@ public Dataset getDatasetSkipExceptionTranslation( if (options.containsKey(Option.DATASET_VIEW)) { bqGetRequest.setDatasetView(options.get(Option.DATASET_VIEW).toString()); } - return bqGetRequest.execute(); + + Span getDataset = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getDataset = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getDataset") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "DatasetService") + .setAttribute("bq.rpc.method", "GetDataset") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + + Dataset dataset = bqGetRequest.execute(); + if (getDataset != null) { + getDataset.setAttribute("bq.rpc.response.dataset.id", dataset.getId()); + getDataset.end(); + } + return dataset; } @Override @@ -171,7 +195,7 @@ public Tuple> listDatasets(String projectId, Map> listDatasetsSkipExceptionTranslation( String projectId, Map options) throws IOException { validateRPC(); - DatasetList datasetsList = + Bigquery.Datasets.List datasetsListRequest = bigquery .datasets() .list(projectId) @@ -179,9 +203,30 @@ public Tuple> listDatasetsSkipExceptionTranslation( .setAll(Option.ALL_DATASETS.getBoolean(options)) .setFilter(Option.LABEL_FILTER.getString(options)) .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); + .setPageToken(Option.PAGE_TOKEN.getString(options)); + + Span listDatasets = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listDatasets = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listDatasets") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "DatasetService") + .setAttribute("bq.rpc.method", "ListDatasets") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", datasetsListRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + + DatasetList datasetsList = datasetsListRequest.execute(); Iterable datasets = datasetsList.getDatasets(); + if (listDatasets != null) { + listDatasets.setAttribute("bq.rpc.next_page_token", datasetsList.getNextPageToken()); + listDatasets.end(); + } return Tuple.of( datasetsList.getNextPageToken(), Iterables.transform( @@ -211,7 +256,27 @@ public Dataset createSkipExceptionTranslation(Dataset dataset, Map op if (options.containsKey(Option.ACCESS_POLICY_VERSION)) { bqCreateRequest.setAccessPolicyVersion((Integer) options.get(Option.ACCESS_POLICY_VERSION)); } - return bqCreateRequest.execute(); + + Span createDataset = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + createDataset = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.createDataset") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "DatasetService") + .setAttribute("bq.rpc.method", "InsertDataset") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Dataset datasetResponse = bqCreateRequest.execute(); + if (createDataset != null) { + createDataset.setAttribute("bq.rpc.response.dataset.id", datasetResponse.getId()); + createDataset.end(); + } + return datasetResponse; } @Override @@ -230,12 +295,33 @@ public Table createSkipExceptionTranslation(Table table, Map options) // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); - return bigquery - .tables() - .insert(reference.getProjectId(), reference.getDatasetId(), table) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Tables.Insert bqCreateRequest = + bigquery + .tables() + .insert(reference.getProjectId(), reference.getDatasetId(), table) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span createTable = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + createTable = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.createTable") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableService") + .setAttribute("bq.rpc.method", "InsertTable") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Table tableResponse = bqCreateRequest.execute(); + if (createTable != null) { + createTable.setAttribute("bq.rpc.response.table.id", tableResponse.getId()); + createTable.end(); + } + return tableResponse; } @Override @@ -252,12 +338,34 @@ public Routine createSkipExceptionTranslation(Routine routine, Map op throws IOException { validateRPC(); RoutineReference reference = routine.getRoutineReference(); - return bigquery - .routines() - .insert(reference.getProjectId(), reference.getDatasetId(), routine) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Routines.Insert bqCreateRequest = + bigquery + .routines() + .insert(reference.getProjectId(), reference.getDatasetId(), routine) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span createRoutine = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + createRoutine = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.createRoutine") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "RoutineService") + .setAttribute("bq.rpc.method", "InsertRoutine") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Routine routineResponse = bqCreateRequest.execute(); + if (createRoutine != null) { + createRoutine.setAttribute( + "bq.rpc.response.routine.id", routineResponse.getRoutineReference().getRoutineId()); + createRoutine.end(); + } + return routineResponse; } @Override @@ -276,12 +384,35 @@ public Job createSkipExceptionTranslation(Job job, Map options) throw job.getJobReference() != null ? job.getJobReference().getProjectId() : this.options.getProjectId(); - return bigquery - .jobs() - .insert(projectId, job) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Jobs.Insert bqCreateRequest = + bigquery + .jobs() + .insert(projectId, job) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span createJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + createJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.createJob") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "InsertJob") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Job jobResponse = bqCreateRequest.execute(); + if (createJob != null) { + createJob.setAttribute("bq.rpc.response.job.id", jobResponse.getId()); + createJob.setAttribute( + "bq.rpc.response.job.status.state", jobResponse.getStatus().getState()); + createJob.end(); + } + return jobResponse; } @Override @@ -300,7 +431,30 @@ public Job createJobForQuerySkipExceptionTranslation(Job job) throws IOException job.getJobReference() != null ? job.getJobReference().getProjectId() : this.options.getProjectId(); - return bigquery.jobs().insert(projectId, job).setPrettyPrint(false).execute(); + Bigquery.Jobs.Insert bqCreateRequest = + bigquery.jobs().insert(projectId, job).setPrettyPrint(false); + + Span createJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + createJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.createJobForQuery") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "InsertJob") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + Job jobResponse = bqCreateRequest.execute(); + if (createJob != null) { + createJob.setAttribute("bq.rpc.response.job.id", jobResponse.getId()); + createJob.setAttribute( + "bq.rpc.response.job.status.state", jobResponse.getStatus().getState()); + createJob.end(); + } + return jobResponse; } @Override @@ -320,12 +474,31 @@ public boolean deleteDataset(String projectId, String datasetId, Map public boolean deleteDatasetSkipExceptionTranslation( String projectId, String datasetId, Map options) throws IOException { validateRPC(); - bigquery - .datasets() - .delete(projectId, datasetId) - .setPrettyPrint(false) - .setDeleteContents(Option.DELETE_CONTENTS.getBoolean(options)) - .execute(); + Bigquery.Datasets.Delete bqDeleteRequest = + bigquery + .datasets() + .delete(projectId, datasetId) + .setPrettyPrint(false) + .setDeleteContents(Option.DELETE_CONTENTS.getBoolean(options)); + + Span deleteDataset = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + deleteDataset = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.deleteDataset") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "DatasetService") + .setAttribute("bq.rpc.method", "DeleteDataset") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + bqDeleteRequest.execute(); + if (deleteDataset != null) { + deleteDataset.end(); + } return true; } @@ -355,7 +528,27 @@ public Dataset patchSkipExceptionTranslation(Dataset dataset, Map opt if (options.containsKey(Option.DATASET_UPDATE_MODE)) { bqPatchRequest.setUpdateMode(options.get(Option.DATASET_UPDATE_MODE).toString()); } - return bqPatchRequest.execute(); + + Span patchDataset = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + patchDataset = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.patchDataset") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "DatasetService") + .setAttribute("bq.rpc.method", "PatchDataset") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Dataset datasetResponse = bqPatchRequest.execute(); + if (patchDataset != null) { + patchDataset.setAttribute("bq.rpc.response.dataset.id", datasetResponse.getId()); + patchDataset.end(); + } + return datasetResponse; } @Override @@ -374,13 +567,35 @@ public Table patchSkipExceptionTranslation(Table table, Map options) // unset the type, as it is output only table.setType(null); TableReference reference = table.getTableReference(); - return bigquery - .tables() - .patch(reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)) - .execute(); + Bigquery.Tables.Patch bqPatchRequest = + bigquery + .tables() + .patch( + reference.getProjectId(), reference.getDatasetId(), reference.getTableId(), table) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)); + + Span patchTable = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + patchTable = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.patchTable") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableService") + .setAttribute("bq.rpc.method", "PatchTable") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Table tableResponse = bqPatchRequest.execute(); + if (patchTable != null) { + patchTable.setAttribute("bq.rpc.response.table.id", tableResponse.getId()); + patchTable.end(); + } + return tableResponse; } @Override @@ -402,13 +617,34 @@ public Table getTableSkipExceptionTranslation( String projectId, String datasetId, String tableId, Map options) throws IOException { validateRPC(); - return bigquery - .tables() - .get(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .setView(getTableMetadataOption(options)) - .execute(); + Bigquery.Tables.Get bqGetRequest = + bigquery + .tables() + .get(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)) + .setView(getTableMetadataOption(options)); + + Span getTable = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getTable = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getTable") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableService") + .setAttribute("bq.rpc.method", "GetTable") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Table tableResponse = bqGetRequest.execute(); + if (getTable != null) { + getTable.setAttribute("bq.rpc.response.table.id", tableResponse.getId()); + getTable.end(); + } + return tableResponse; } private String getTableMetadataOption(Map options) { @@ -432,17 +668,38 @@ public Tuple> listTables( public Tuple> listTablesSkipExceptionTranslation( String projectId, String datasetId, Map options) throws IOException { validateRPC(); - TableList tableList = + Bigquery.Tables.List tableListRequest = bigquery .tables() .list(projectId, datasetId) .setPrettyPrint(false) .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); - Iterable tables = tableList.getTables(); + .setPageToken(Option.PAGE_TOKEN.getString(options)); + + Span listTables = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listTables = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listTables") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableService") + .setAttribute("bq.rpc.method", "ListTables") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", tableListRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + TableList tableResponse = tableListRequest.execute(); + if (listTables != null) { + listTables.setAttribute("bq.rpc.next_page_token", tableResponse.getNextPageToken()); + listTables.end(); + } + + Iterable tables = tableResponse.getTables(); return Tuple.of( - tableList.getNextPageToken(), + tableResponse.getNextPageToken(), Iterables.transform( tables != null ? tables : ImmutableList.of(), new Function() { @@ -480,7 +737,26 @@ public boolean deleteTable(String projectId, String datasetId, String tableId) { public boolean deleteTableSkipExceptionTranslation( String projectId, String datasetId, String tableId) throws IOException { validateRPC(); - bigquery.tables().delete(projectId, datasetId, tableId).execute(); + Bigquery.Tables.Delete bqDeleteRequest = + bigquery.tables().delete(projectId, datasetId, tableId); + + Span deleteTable = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + deleteTable = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.deleteTable") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableService") + .setAttribute("bq.rpc.method", "DeleteTable") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + bqDeleteRequest.execute(); + if (deleteTable != null) { + deleteTable.end(); + } return true; } @@ -499,12 +775,35 @@ public Model patchSkipExceptionTranslation(Model model, Map options) validateRPC(); // unset the type, as it is output only ModelReference reference = model.getModelReference(); - return bigquery - .models() - .patch(reference.getProjectId(), reference.getDatasetId(), reference.getModelId(), model) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Models.Patch bqPatchRequest = + bigquery + .models() + .patch( + reference.getProjectId(), reference.getDatasetId(), reference.getModelId(), model) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span patchModel = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + patchModel = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.patchModel") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "ModelService") + .setAttribute("bq.rpc.method", "PatchModel") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Model modelResponse = bqPatchRequest.execute(); + if (patchModel != null) { + patchModel.setAttribute( + "bq.rpc.response.model.id", modelResponse.getModelReference().getModelId()); + patchModel.end(); + } + return modelResponse; } @Override @@ -526,12 +825,34 @@ public Model getModelSkipExceptionTranslation( String projectId, String datasetId, String modelId, Map options) throws IOException { validateRPC(); - return bigquery - .models() - .get(projectId, datasetId, modelId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Models.Get bqGetRequest = + bigquery + .models() + .get(projectId, datasetId, modelId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span getModel = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getModel = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getModel") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "ModelService") + .setAttribute("bq.rpc.method", "GetModel") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Model modelResponse = bqGetRequest.execute(); + if (getModel != null) { + getModel.setAttribute( + "bq.rpc.response.model.id", modelResponse.getModelReference().getModelId()); + getModel.end(); + } + return modelResponse; } @Override @@ -548,17 +869,38 @@ public Tuple> listModels( public Tuple> listModelsSkipExceptionTranslation( String projectId, String datasetId, Map options) throws IOException { validateRPC(); - ListModelsResponse modelList = + Bigquery.Models.List modelListRequest = bigquery .models() .list(projectId, datasetId) .setPrettyPrint(false) .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); + .setPageToken(Option.PAGE_TOKEN.getString(options)); + + Span listModels = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listModels = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listModels") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "ModelService") + .setAttribute("bq.rpc.method", "ListModels") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", modelListRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + ListModelsResponse modelResponse = modelListRequest.execute(); + if (listModels != null) { + listModels.setAttribute("bq.rpc.next_page_token", modelResponse.getNextPageToken()); + listModels.end(); + } + Iterable models = - modelList.getModels() != null ? modelList.getModels() : ImmutableList.of(); - return Tuple.of(modelList.getNextPageToken(), models); + modelResponse.getModels() != null ? modelResponse.getModels() : ImmutableList.of(); + return Tuple.of(modelResponse.getNextPageToken(), models); } @Override @@ -578,7 +920,26 @@ public boolean deleteModel(String projectId, String datasetId, String modelId) { public boolean deleteModelSkipExceptionTranslation( String projectId, String datasetId, String modelId) throws IOException { validateRPC(); - bigquery.models().delete(projectId, datasetId, modelId).execute(); + Bigquery.Models.Delete bqDeleteRequest = + bigquery.models().delete(projectId, datasetId, modelId); + + Span deleteModels = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + deleteModels = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.deleteModel") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "ModelService") + .setAttribute("bq.rpc.method", "DeleteModel") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + bqDeleteRequest.execute(); + if (deleteModels != null) { + deleteModels.end(); + } return true; } @@ -596,13 +957,38 @@ public Routine updateSkipExceptionTranslation(Routine routine, Map op throws IOException { validateRPC(); RoutineReference reference = routine.getRoutineReference(); - return bigquery - .routines() - .update( - reference.getProjectId(), reference.getDatasetId(), reference.getRoutineId(), routine) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Routines.Update bqUpdateRequest = + bigquery + .routines() + .update( + reference.getProjectId(), + reference.getDatasetId(), + reference.getRoutineId(), + routine) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span updateRoutine = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + updateRoutine = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.updateRoutine") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "RoutineService") + .setAttribute("bq.rpc.method", "UpdateRoutine") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Routine routineResponse = bqUpdateRequest.execute(); + if (updateRoutine != null) { + updateRoutine.setAttribute( + "bq.rpc.response.routine.id", routineResponse.getRoutineReference().getRoutineId()); + updateRoutine.end(); + } + return routineResponse; } @Override @@ -624,12 +1010,34 @@ public Routine getRoutineSkipExceptionTranslation( String projectId, String datasetId, String routineId, Map options) throws IOException { validateRPC(); - return bigquery - .routines() - .get(projectId, datasetId, routineId) - .setPrettyPrint(false) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Routines.Get bqGetRequest = + bigquery + .routines() + .get(projectId, datasetId, routineId) + .setPrettyPrint(false) + .setFields(Option.FIELDS.getString(options)); + + Span getRoutine = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getRoutine = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getRoutine") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "RoutineService") + .setAttribute("bq.rpc.method", "GetRoutine") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Routine routineResponse = bqGetRequest.execute(); + if (getRoutine != null) { + getRoutine.setAttribute( + "bq.rpc.response.routine.id", routineResponse.getRoutineReference().getRoutineId()); + getRoutine.end(); + } + return routineResponse; } @Override @@ -646,17 +1054,39 @@ public Tuple> listRoutines( public Tuple> listRoutinesSkipExceptionTranslation( String projectId, String datasetId, Map options) throws IOException { validateRPC(); - ListRoutinesResponse routineList = + Bigquery.Routines.List routineListRequest = bigquery .routines() .list(projectId, datasetId) .setPrettyPrint(false) .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .execute(); + .setPageToken(Option.PAGE_TOKEN.getString(options)); + + Span listRoutines = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listRoutines = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listRoutines") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "RoutineService") + .setAttribute("bq.rpc.method", "ListRoutines") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", routineListRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + ListRoutinesResponse routineResponse = routineListRequest.execute(); + if (listRoutines != null) { + listRoutines.setAttribute("bq.rpc.next_page_token", routineResponse.getNextPageToken()); + listRoutines.end(); + } Iterable routines = - routineList.getRoutines() != null ? routineList.getRoutines() : ImmutableList.of(); - return Tuple.of(routineList.getNextPageToken(), routines); + routineResponse.getRoutines() != null + ? routineResponse.getRoutines() + : ImmutableList.of(); + return Tuple.of(routineResponse.getNextPageToken(), routines); } @Override @@ -676,7 +1106,26 @@ public boolean deleteRoutine(String projectId, String datasetId, String routineI public boolean deleteRoutineSkipExceptionTranslation( String projectId, String datasetId, String routineId) throws IOException { validateRPC(); - bigquery.routines().delete(projectId, datasetId, routineId).execute(); + Bigquery.Routines.Delete bqDeleteRequest = + bigquery.routines().delete(projectId, datasetId, routineId); + + Span deleteRoutine = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + deleteRoutine = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listRoutines") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "RoutineService") + .setAttribute("bq.rpc.method", "ListRoutines") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + bqDeleteRequest.execute(); + if (deleteRoutine != null) { + deleteRoutine.end(); + } return true; } @@ -695,11 +1144,30 @@ public TableDataInsertAllResponse insertAllSkipExceptionTranslation( String projectId, String datasetId, String tableId, TableDataInsertAllRequest request) throws IOException { validateRPC(); - return bigquery - .tabledata() - .insertAll(projectId, datasetId, tableId, request) - .setPrettyPrint(false) - .execute(); + Bigquery.Tabledata.InsertAll insertAllRequest = + bigquery + .tabledata() + .insertAll(projectId, datasetId, tableId, request) + .setPrettyPrint(false); + + Span insertAll = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + insertAll = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.insertAll") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableDataService") + .setAttribute("bq.rpc.method", "InsertAll") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + TableDataInsertAllResponse insertAllResponse = insertAllRequest.execute(); + if (insertAll != null) { + insertAll.end(); + } + return insertAllResponse; } @Override @@ -717,17 +1185,38 @@ public TableDataList listTableDataSkipExceptionTranslation( String projectId, String datasetId, String tableId, Map options) throws IOException { validateRPC(); - return bigquery - .tabledata() - .list(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setStartIndex( - Option.START_INDEX.getLong(options) != null - ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) - : null) - .execute(); + Bigquery.Tabledata.List bqListRequest = + bigquery + .tabledata() + .list(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setStartIndex( + Option.START_INDEX.getLong(options) != null + ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) + : null); + + Span listTableData = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listTableData = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listTableData") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableDataService") + .setAttribute("bq.rpc.method", "List") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", bqListRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + TableDataList bqListResponse = bqListRequest.execute(); + if (listTableData != null) { + listTableData.end(); + } + return bqListResponse; } @Override @@ -754,13 +1243,33 @@ public TableDataList listTableDataWithRowLimitSkipExceptionTranslation( String pageToken) throws IOException { validateRPC(); - return bigquery - .tabledata() - .list(projectId, datasetId, tableId) - .setPrettyPrint(false) - .setMaxResults(Long.valueOf(maxResultPerPage)) - .setPageToken(pageToken) - .execute(); + Bigquery.Tabledata.List bqListRequest = + bigquery + .tabledata() + .list(projectId, datasetId, tableId) + .setPrettyPrint(false) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .setPageToken(pageToken); + + Span listTableData = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listTableData = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listTableDataWithRowLimit") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "TableDataService") + .setAttribute("bq.rpc.method", "List") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", bqListRequest.getPageToken()) + .startSpan(); + } + TableDataList bqListResponse = bqListRequest.execute(); + if (listTableData != null) { + listTableData.end(); + } + return bqListResponse; } @Override @@ -780,13 +1289,35 @@ public Job getJob(String projectId, String jobId, String location, Map options) throws IOException { validateRPC(); - return bigquery - .jobs() - .get(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setFields(Option.FIELDS.getString(options)) - .execute(); + Bigquery.Jobs.Get bqGetRequest = + bigquery + .jobs() + .get(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setFields(Option.FIELDS.getString(options)); + + Span getJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getJob") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "GetJob") + .setAttribute("bq.rpc.system", "http") + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + Job jobResponse = bqGetRequest.execute(); + if (getJob != null) { + getJob.setAttribute("bq.rpc.response.job.id", jobResponse.getId()); + getJob.setAttribute("bq.rpc.response.job.status.state", jobResponse.getStatus().getState()); + getJob.end(); + } + return jobResponse; } @Override @@ -806,12 +1337,29 @@ public Job getQueryJob(String projectId, String jobId, String location) { public Job getQueryJobSkipExceptionTranslation(String projectId, String jobId, String location) throws IOException { validateRPC(); - return bigquery - .jobs() - .get(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .execute(); + Bigquery.Jobs.Get bqGetRequest = + bigquery.jobs().get(projectId, jobId).setPrettyPrint(false).setLocation(location); + + Span getJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getQueryJob") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "GetJob") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + Job jobResponse = bqGetRequest.execute(); + if (getJob != null) { + getJob.setAttribute("bq.rpc.response.job.id", jobResponse.getId()); + getJob.setAttribute("bq.rpc.response.job.status.state", jobResponse.getStatus().getState()); + getJob.end(); + } + return jobResponse; } @Override @@ -845,7 +1393,27 @@ public Tuple> listJobsSkipExceptionTranslation( if (Option.MAX_CREATION_TIME.getLong(options) != null) { request.setMaxCreationTime(BigInteger.valueOf(Option.MAX_CREATION_TIME.getLong(options))); } + + Span listJobs = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + listJobs = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.listJobs") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "ListJobs") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", request.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } JobList jobsList = request.execute(); + if (listJobs != null) { + listJobs.setAttribute("bq.rpc.next_page_token", jobsList.getNextPageToken()); + listJobs.end(); + } Iterable jobs = jobsList.getJobs(); return Tuple.of( @@ -892,7 +1460,26 @@ public boolean cancel(String projectId, String jobId, String location) { public boolean cancelSkipExceptionTranslation(String projectId, String jobId, String location) throws IOException { validateRPC(); - bigquery.jobs().cancel(projectId, jobId).setLocation(location).setPrettyPrint(false).execute(); + Bigquery.Jobs.Cancel bqCancelRequest = + bigquery.jobs().cancel(projectId, jobId).setLocation(location).setPrettyPrint(false); + + Span cancelJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + cancelJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.cancelJob") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "CancelJob") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + bqCancelRequest.execute(); + if (cancelJob != null) { + cancelJob.end(); + } return true; } @@ -909,12 +1496,26 @@ public boolean deleteJob(String projectId, String jobName, String location) { public boolean deleteJobSkipExceptionTranslation( String projectId, String jobName, String location) throws IOException { validateRPC(); - bigquery - .jobs() - .delete(projectId, jobName) - .setLocation(location) - .setPrettyPrint(false) - .execute(); + Bigquery.Jobs.Delete bqDeleteRequest = + bigquery.jobs().delete(projectId, jobName).setLocation(location).setPrettyPrint(false); + + Span deleteJob = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + deleteJob = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.deleteJob") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "DeleteJob") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + bqDeleteRequest.execute(); + if (deleteJob != null) { + deleteJob.end(); + } return true; } @@ -932,19 +1533,41 @@ public GetQueryResultsResponse getQueryResults( public GetQueryResultsResponse getQueryResultsSkipExceptionTranslation( String projectId, String jobId, String location, Map options) throws IOException { validateRPC(); - return bigquery - .jobs() - .getQueryResults(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setMaxResults(Option.MAX_RESULTS.getLong(options)) - .setPageToken(Option.PAGE_TOKEN.getString(options)) - .setStartIndex( - Option.START_INDEX.getLong(options) != null - ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) - : null) - .setTimeoutMs(Option.TIMEOUT.getLong(options)) - .execute(); + Bigquery.Jobs.GetQueryResults queryRequest = + bigquery + .jobs() + .getQueryResults(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setMaxResults(Option.MAX_RESULTS.getLong(options)) + .setPageToken(Option.PAGE_TOKEN.getString(options)) + .setStartIndex( + Option.START_INDEX.getLong(options) != null + ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) + : null) + .setTimeoutMs(Option.TIMEOUT.getLong(options)); + + Span getQueryResults = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getQueryResults = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getQueryResults") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "GetQueryResults") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", queryRequest.getPageToken()) + .setAllAttributes(otelAttributesFromOptions(options)) + .startSpan(); + } + + GetQueryResultsResponse queryResponse = queryRequest.execute(); + if (getQueryResults != null) { + getQueryResults.end(); + } + return queryResponse; } @Override @@ -963,14 +1586,35 @@ public GetQueryResultsResponse getQueryResultsWithRowLimitSkipExceptionTranslati String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs) throws IOException { validateRPC(); - return bigquery - .jobs() - .getQueryResults(projectId, jobId) - .setPrettyPrint(false) - .setLocation(location) - .setMaxResults(Long.valueOf(maxResultPerPage)) - .setTimeoutMs(timeoutMs) - .execute(); + Bigquery.Jobs.GetQueryResults queryRequest = + bigquery + .jobs() + .getQueryResults(projectId, jobId) + .setPrettyPrint(false) + .setLocation(location) + .setMaxResults(Long.valueOf(maxResultPerPage)) + .setTimeoutMs(timeoutMs); + + Span getQueryResults = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getQueryResults = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.getQueryResultsWithRowLimit") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "GetQueryResults") + .setAttribute("bq.rpc.system", "http") + .setAttribute("bq.rpc.page_token", queryRequest.getPageToken()) + .startSpan(); + } + + GetQueryResultsResponse queryResponse = queryRequest.execute(); + if (getQueryResults != null) { + getQueryResults.end(); + } + return queryResponse; } @Override @@ -986,7 +1630,27 @@ public QueryResponse queryRpc(String projectId, QueryRequest content) { public QueryResponse queryRpcSkipExceptionTranslation(String projectId, QueryRequest content) throws IOException { validateRPC(); - return bigquery.jobs().query(projectId, content).execute(); + Bigquery.Jobs.Query queryRequest = bigquery.jobs().query(projectId, content); + + Span getQueryResults = null; + if (this.options.isOpenTelemetryTracingEnabled() + && this.options.getOpenTelemetryTracer() != null) { + getQueryResults = + this.options + .getOpenTelemetryTracer() + .spanBuilder("com.google.cloud.bigquery.BigQueryRpc.queryRpc") + .setSpanKind(SpanKind.CLIENT) + .setAttribute("bq.rpc.service", "JobService") + .setAttribute("bq.rpc.method", "Query") + .setAttribute("bq.rpc.system", "http") + .startSpan(); + } + + QueryResponse queryResponse = queryRequest.execute(); + if (getQueryResults != null) { + getQueryResults.end(); + } + return queryResponse; } @Override @@ -1098,11 +1762,29 @@ public Policy getIamPolicySkipExceptionTranslation(String resourceId, Map From e5467c917c63ac066edcbcd902cc2093a39971a3 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:27:08 -0700 Subject: [PATCH 2130/2268] feat(bigquery): Add support for custom timezones and timestamps (#3859) * feat(bigquery): Add support for custom timezones and timestamps * update ignored-diff * fix data -> date typo * Add enums for SourceColumnMatch * Change null markers test names * change enums to StringEnumValue --- .../clirr-ignored-differences.xml | 70 ++++++ .../bigquery/ExternalTableDefinition.java | 186 +++++++++++++++ .../cloud/bigquery/LoadJobConfiguration.java | 219 +++++++++++++++++- .../bigquery/ExternalTableDefinitionTest.java | 29 +++ .../bigquery/LoadJobConfigurationTest.java | 22 ++ 5 files changed, 525 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index e048f4ce82..bd455d2d4f 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -2,6 +2,76 @@ + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *TimeZone(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *DateFormat(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *DatetimeFormat(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *TimeFormat(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *TimestampFormat(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *SourceColumnMatch(*) + + + 7013 + com/google/cloud/bigquery/ExternalTableDefinition* + *NullMarkers(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *TimeZone(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *DateFormat(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *DatetimeFormat(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *TimeFormat(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *TimestampFormat(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *SourceColumnMatch(*) + + + 7013 + com/google/cloud/bigquery/LoadJobConfiguration* + *NullMarkers(*) + 7004 com/google/cloud/bigquery/BigQueryRetryHelper diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java index ea4cceeade..c1859c3f9f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExternalTableDefinition.java @@ -19,9 +19,12 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Strings.isNullOrEmpty; +import com.google.api.core.ApiFunction; import com.google.api.services.bigquery.model.ExternalDataConfiguration; import com.google.api.services.bigquery.model.Table; import com.google.auto.value.AutoValue; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import java.util.List; @@ -57,6 +60,46 @@ public ExternalDataConfiguration apply(ExternalTableDefinition tableInfo) { private static final long serialVersionUID = -5951580238459622025L; + public static final class SourceColumnMatch extends StringEnumValue { + private static final long serialVersionUID = 818920627219751207L; + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public SourceColumnMatch apply(String constant) { + return new SourceColumnMatch(constant); + } + }; + + private static final StringEnumType type = + new StringEnumType(SourceColumnMatch.class, CONSTRUCTOR); + + public static final SourceColumnMatch POSITION = type.createAndRegister("POSITION"); + + public static final SourceColumnMatch NAME = type.createAndRegister("NAME"); + + private SourceColumnMatch(String constant) { + super(constant); + } + + /** + * Get the SourceColumnMatch for the given String constant, and throw an exception if the + * constant is not recognized. + */ + public static SourceColumnMatch valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** Get the SourceColumnMatch for the given String constant, and allow unrecognized values. */ + public static SourceColumnMatch valueOf(String constant) { + return type.valueOf(constant); + } + + /** Return the known values for SourceColumnMatch. */ + public static SourceColumnMatch[] values() { + return type.values(); + } + } + @AutoValue.Builder public abstract static class Builder extends TableDefinition.Builder { @@ -215,6 +258,45 @@ public Builder setMaxStaleness(String maxStaleness) { abstract Builder setMaxStalenessInner(String maxStaleness); + /** + * Time zone used when parsing timestamp values that do not have specific time zone information + * (e.g. 2024-04-20 12:34:56). The expected format is a IANA timezone string (e.g. + * America/Los_Angeles). + */ + public abstract Builder setTimeZone(String timeZone); + + /** Format used to parse DATE values. Supports C-style and SQL-style values. */ + public abstract Builder setDateFormat(String dateFormat); + + /** Format used to parse DATETIME values. Supports C-style and SQL-style values. */ + public abstract Builder setDatetimeFormat(String datetimeFormat); + + /** Format used to parse TIME values. Supports C-style and SQL-style values. */ + public abstract Builder setTimeFormat(String timeFormat); + + /** Format used to parse TIMESTAMP values. Supports C-style and SQL-style values. */ + public abstract Builder setTimestampFormat(String timestampFormat); + + /** + * Controls the strategy used to match loaded columns to the schema. If not set, a sensible + * default is chosen based on how the schema is provided. If autodetect is used, then columns + * are matched by name. Otherwise, columns are matched by position. This is done to keep the + * behavior backward-compatible. Acceptable values are: POSITION - matches by position. This + * assumes that the columns are ordered the same way as the schema. NAME - matches by name. This + * reads the header row as column names and reorders columns to match the field names in the + * schema. + */ + public abstract Builder setSourceColumnMatch(SourceColumnMatch sourceColumnMatch); + + /** + * A list of strings represented as SQL NULL value in a CSV file. null_marker and null_markers + * can't be set at the same time. If null_marker is set, null_markers has to be not set. If + * null_markers is set, null_marker has to be not set. If both null_marker and null_markers are + * set at the same time, a user error would be thrown. Any strings listed in null_markers, + * including empty string would be interpreted as SQL NULL. This applies to all column types. + */ + public abstract Builder setNullMarkers(List nullMarkers); + /** Creates an {@code ExternalTableDefinition} object. */ @Override public abstract ExternalTableDefinition build(); @@ -373,6 +455,37 @@ public HivePartitioningOptions getHivePartitioningOptions() { return getHivePartitioningOptionsInner(); } + /** + * Returns the time zone used when parsing timestamp values that don't have specific time zone + * information. + */ + @Nullable + public abstract String getTimeZone(); + + /** Returns the format used to parse DATE values. */ + @Nullable + public abstract String getDateFormat(); + + /** Returns the format used to parse DATETIME values. */ + @Nullable + public abstract String getDatetimeFormat(); + + /** Returns the format used to parse TIME values. */ + @Nullable + public abstract String getTimeFormat(); + + /** Returns the format used to parse TIMESTAMP values. */ + @Nullable + public abstract String getTimestampFormat(); + + /** Returns the strategy used to match loaded columns to the schema, either POSITION or NAME. */ + @Nullable + public abstract SourceColumnMatch getSourceColumnMatch(); + + /** Returns a list of strings represented as SQL NULL value in a CSV file. */ + @Nullable + public abstract List getNullMarkers(); + @Nullable abstract HivePartitioningOptions getHivePartitioningOptionsInner(); @@ -454,6 +567,29 @@ com.google.api.services.bigquery.model.ExternalDataConfiguration toExternalDataC if (getMetadataCacheMode() != null) { externalConfigurationPb.setMetadataCacheMode(getMetadataCacheMode()); } + if (getTimeZone() != null) { + externalConfigurationPb.setTimeZone(getTimeZone()); + } + if (getDateFormat() != null) { + externalConfigurationPb.setDateFormat(getDateFormat()); + } + if (getDatetimeFormat() != null) { + externalConfigurationPb.setDatetimeFormat(getDatetimeFormat()); + } + if (getTimeFormat() != null) { + externalConfigurationPb.setTimeFormat(getTimeFormat()); + } + if (getTimestampFormat() != null) { + externalConfigurationPb.setTimestampFormat(getTimestampFormat()); + } + if (getSourceColumnMatch() != null) { + externalConfigurationPb + .getCsvOptions() + .setSourceColumnMatch(getSourceColumnMatch().toString()); + } + if (getNullMarkers() != null) { + externalConfigurationPb.getCsvOptions().setNullMarkers(getNullMarkers()); + } return externalConfigurationPb; } @@ -654,6 +790,31 @@ static ExternalTableDefinition fromPb(Table tablePb) { if (tablePb.getMaxStaleness() != null) { builder.setMaxStaleness(tablePb.getMaxStaleness()); } + if (externalDataConfiguration.getTimeZone() != null) { + builder.setTimeZone(externalDataConfiguration.getTimeZone()); + } + if (externalDataConfiguration.getDateFormat() != null) { + builder.setDateFormat(externalDataConfiguration.getDateFormat()); + } + if (externalDataConfiguration.getDatetimeFormat() != null) { + builder.setDatetimeFormat(externalDataConfiguration.getDatetimeFormat()); + } + if (externalDataConfiguration.getTimeFormat() != null) { + builder.setTimeFormat(externalDataConfiguration.getTimeFormat()); + } + if (externalDataConfiguration.getTimestampFormat() != null) { + builder.setTimestampFormat(externalDataConfiguration.getTimestampFormat()); + } + if (externalDataConfiguration.getCsvOptions() != null) { + if (externalDataConfiguration.getCsvOptions().getSourceColumnMatch() != null) { + builder.setSourceColumnMatch( + SourceColumnMatch.valueOf( + externalDataConfiguration.getCsvOptions().getSourceColumnMatch())); + } + if (externalDataConfiguration.getCsvOptions().getNullMarkers() != null) { + builder.setNullMarkers(externalDataConfiguration.getCsvOptions().getNullMarkers()); + } + } } return builder.build(); } @@ -724,6 +885,31 @@ static ExternalTableDefinition fromExternalDataConfiguration( if (externalDataConfiguration.getMetadataCacheMode() != null) { builder.setMetadataCacheMode(externalDataConfiguration.getMetadataCacheMode()); } + if (externalDataConfiguration.getTimeZone() != null) { + builder.setTimeZone(externalDataConfiguration.getTimeZone()); + } + if (externalDataConfiguration.getDateFormat() != null) { + builder.setDateFormat(externalDataConfiguration.getDateFormat()); + } + if (externalDataConfiguration.getDatetimeFormat() != null) { + builder.setDatetimeFormat(externalDataConfiguration.getDatetimeFormat()); + } + if (externalDataConfiguration.getTimeFormat() != null) { + builder.setTimeFormat(externalDataConfiguration.getTimeFormat()); + } + if (externalDataConfiguration.getTimestampFormat() != null) { + builder.setTimestampFormat(externalDataConfiguration.getTimeFormat()); + } + if (externalDataConfiguration.getCsvOptions() != null) { + if (externalDataConfiguration.getCsvOptions().getSourceColumnMatch() != null) { + builder.setSourceColumnMatch( + SourceColumnMatch.valueOf( + externalDataConfiguration.getCsvOptions().getSourceColumnMatch())); + } + if (externalDataConfiguration.getCsvOptions().getNullMarkers() != null) { + builder.setNullMarkers(externalDataConfiguration.getCsvOptions().getNullMarkers()); + } + } return builder.build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 5d17554597..0d1eb7245b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -18,7 +18,10 @@ import static com.google.common.base.Preconditions.checkNotNull; +import com.google.api.core.ApiFunction; import com.google.api.services.bigquery.model.JobConfigurationLoad; +import com.google.cloud.StringEnumType; +import com.google.cloud.StringEnumValue; import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; @@ -63,6 +66,55 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load private final List connectionProperties; private final Boolean createSession; private final String reservation; + private final String timeZone; + private final String dateFormat; + private final String datetimeFormat; + private final String timeFormat; + private final String timestampFormat; + private final SourceColumnMatch sourceColumnMatch; + private final List nullMarkers; + + public static final class SourceColumnMatch extends StringEnumValue { + private static final long serialVersionUID = 818920627219751207L; + private static final ApiFunction CONSTRUCTOR = + new ApiFunction() { + @Override + public SourceColumnMatch apply(String constant) { + return new SourceColumnMatch(constant); + } + }; + + private static final StringEnumType type = + new StringEnumType(SourceColumnMatch.class, CONSTRUCTOR); + + public static final SourceColumnMatch SOURCE_COLUMN_MATCH_UNSPECIFIED = + type.createAndRegister("SOURCE_COLUMN_MATCH_UNSPECIFIED"); + public static final SourceColumnMatch POSITION = type.createAndRegister("POSITION"); + + public static final SourceColumnMatch NAME = type.createAndRegister("NAME"); + + private SourceColumnMatch(String constant) { + super(constant); + } + + /** + * Get the SourceColumnMatch for the given String constant, and throw an exception if the + * constant is not recognized. + */ + public static SourceColumnMatch valueOfStrict(String constant) { + return type.valueOfStrict(constant); + } + + /** Get the SourceColumnMatch for the given String constant, and allow unrecognized values. */ + public static SourceColumnMatch valueOf(String constant) { + return type.valueOf(constant); + } + + /** Return the known values for SourceColumnMatch. */ + public static SourceColumnMatch[] values() { + return type.values(); + } + } public static final class Builder extends JobConfiguration.Builder implements LoadConfiguration.Builder { @@ -95,6 +147,13 @@ public static final class Builder extends JobConfiguration.Builder connectionProperties; private Boolean createSession; private String reservation; + private String timeZone; + private String dateFormat; + private String datetimeFormat; + private String timeFormat; + private String timestampFormat; + private SourceColumnMatch sourceColumnMatch; + private List nullMarkers; private Builder() { super(Type.LOAD); @@ -129,6 +188,13 @@ private Builder(LoadJobConfiguration loadConfiguration) { this.connectionProperties = loadConfiguration.connectionProperties; this.createSession = loadConfiguration.createSession; this.reservation = loadConfiguration.reservation; + this.timeZone = loadConfiguration.timeZone; + this.dateFormat = loadConfiguration.dateFormat; + this.datetimeFormat = loadConfiguration.datetimeFormat; + this.timeFormat = loadConfiguration.timeFormat; + this.timestampFormat = loadConfiguration.timestampFormat; + this.sourceColumnMatch = loadConfiguration.sourceColumnMatch; + this.nullMarkers = loadConfiguration.nullMarkers; } private Builder(com.google.api.services.bigquery.model.JobConfiguration configurationPb) { @@ -238,6 +304,28 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (configurationPb.getReservation() != null) { this.reservation = configurationPb.getReservation(); } + if (loadConfigurationPb.getTimeZone() != null) { + this.timeZone = loadConfigurationPb.getTimeZone(); + } + if (loadConfigurationPb.getDateFormat() != null) { + this.dateFormat = loadConfigurationPb.getDateFormat(); + } + if (loadConfigurationPb.getDatetimeFormat() != null) { + this.datetimeFormat = loadConfigurationPb.getDatetimeFormat(); + } + if (loadConfigurationPb.getTimeFormat() != null) { + this.timeFormat = loadConfigurationPb.getTimeFormat(); + } + if (loadConfigurationPb.getTimestampFormat() != null) { + this.timestampFormat = loadConfigurationPb.getTimestampFormat(); + } + if (loadConfigurationPb.getSourceColumnMatch() != null) { + this.sourceColumnMatch = + SourceColumnMatch.valueOf(loadConfigurationPb.getSourceColumnMatch()); + } + if (loadConfigurationPb.getNullMarkers() != null) { + this.nullMarkers = loadConfigurationPb.getNullMarkers(); + } } @Override @@ -449,6 +537,62 @@ public Builder setReservation(String reservation) { return this; } + /** + * [Experimental] Default time zone that will apply when parsing timestamp values that have no + * specific time zone. + */ + public Builder setTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** Date format used for parsing DATE values. */ + public Builder setDateFormat(String dateFormat) { + this.dateFormat = dateFormat; + return this; + } + + /** Date format used for parsing DATETIME values. */ + public Builder setDatetimeFormat(String datetimeFormat) { + this.datetimeFormat = datetimeFormat; + return this; + } + + /** Date format used for parsing TIME values. */ + public Builder setTimeFormat(String timeFormat) { + this.timeFormat = timeFormat; + return this; + } + + /** Date format used for parsing TIMESTAMP values. */ + public Builder setTimestampFormat(String timestampFormat) { + this.timestampFormat = timestampFormat; + return this; + } + + /** + * Controls the strategy used to match loaded columns to the schema. If not set, a sensible + * default is chosen based on how the schema is provided. If autodetect is used, then columns + * are matched by name. Otherwise, columns are matched by position. This is done to keep the + * behavior backward-compatible. + */ + public Builder setSourceColumnMatch(SourceColumnMatch sourceColumnMatch) { + this.sourceColumnMatch = sourceColumnMatch; + return this; + } + + /** + * A list of strings represented as SQL NULL value in a CSV file. null_marker and null_markers + * can't be set at the same time. If null_marker is set, null_markers has to be not set. If + * null_markers is set, null_marker has to be not set. If both null_marker and null_markers are + * set at the same time, a user error would be thrown. Any strings listed in null_markers, + * including empty string would be interpreted as SQL NULL. This applies to all column types. + */ + public Builder setNullMarkers(List nullMarkers) { + this.nullMarkers = nullMarkers; + return this; + } + @Override public LoadJobConfiguration build() { return new LoadJobConfiguration(this); @@ -483,6 +627,13 @@ private LoadJobConfiguration(Builder builder) { this.connectionProperties = builder.connectionProperties; this.createSession = builder.createSession; this.reservation = builder.reservation; + this.timeZone = builder.timeZone; + this.dateFormat = builder.dateFormat; + this.datetimeFormat = builder.datetimeFormat; + this.timeFormat = builder.timeFormat; + this.timestampFormat = builder.timestampFormat; + this.sourceColumnMatch = builder.sourceColumnMatch; + this.nullMarkers = builder.nullMarkers; } @Override @@ -634,6 +785,44 @@ public String getReservation() { return reservation; } + /** + * Returns the time zone used when parsing timestamp values that don't have specific time zone + * information. + */ + public String getTimeZone() { + return timeZone; + } + + /** Returns the format used to parse DATE values. */ + public String getDateFormat() { + return dateFormat; + } + + /** Returns the format used to parse DATETIME values. */ + public String getDatetimeFormat() { + return datetimeFormat; + } + + /** Returns the format used to parse TIME values. */ + public String getTimeFormat() { + return timeFormat; + } + + /** Returns the format used to parse TIMESTAMP values. */ + public String getTimestampFormat() { + return timestampFormat; + } + + /** Returns the strategy used to match loaded columns to the schema, either POSITION or NAME. */ + public SourceColumnMatch getSourceColumnMatch() { + return sourceColumnMatch; + } + + /** Returns a list of strings represented as SQL NULL value in a CSV file. */ + public List getNullMarkers() { + return nullMarkers; + } + @Override public Builder toBuilder() { return new Builder(this); @@ -667,7 +856,14 @@ ToStringHelper toStringHelper() { .add("referenceFileSchemaUri", referenceFileSchemaUri) .add("connectionProperties", connectionProperties) .add("createSession", createSession) - .add("reservation", reservation); + .add("reservation", reservation) + .add("timeZone", timeZone) + .add("dateFormat", dateFormat) + .add("datetimeFormat", datetimeFormat) + .add("timeFormat", timeFormat) + .add("timestampFormat", timestampFormat) + .add("sourceColumnMatch", sourceColumnMatch) + .add("nullMarkers", nullMarkers); } @Override @@ -789,6 +985,27 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { if (reservation != null) { jobConfiguration.setReservation(reservation); } + if (timeZone != null) { + loadConfigurationPb.setTimeZone(timeZone); + } + if (dateFormat != null) { + loadConfigurationPb.setDateFormat(dateFormat); + } + if (datetimeFormat != null) { + loadConfigurationPb.setDatetimeFormat(datetimeFormat); + } + if (timeFormat != null) { + loadConfigurationPb.setTimeFormat(timeFormat); + } + if (timestampFormat != null) { + loadConfigurationPb.setTimestampFormat(timestampFormat); + } + if (sourceColumnMatch != null) { + loadConfigurationPb.setSourceColumnMatch(sourceColumnMatch.toString()); + } + if (nullMarkers != null) { + loadConfigurationPb.setNullMarkers(nullMarkers); + } jobConfiguration.setLoad(loadConfigurationPb); return jobConfiguration; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index 93a4425dfd..cb7578c75a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -20,6 +20,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; +import com.google.cloud.bigquery.ExternalTableDefinition.SourceColumnMatch; import com.google.common.collect.ImmutableList; import java.util.List; import org.junit.Test; @@ -61,6 +62,13 @@ public class ExternalTableDefinitionTest { private static final String OBJECT_METADATA = "SIMPLE"; private static final String METADATA_CACHE_MODE = "AUTOMATIC"; private static final String MAX_STALENESS = "INTERVAL 15 MINUTE"; + private static final String TIME_ZONE = "America/Los_Angeles"; + private static final String DATE_FORMAT = "YYYY-MM-DD"; + private static final String DATETIME_FORMAT = "YYYY-MM-DD HH:MI:SS"; + private static final String TIME_FORMAT = "HH:MI:SS"; + private static final String TIMESTAMP_FORMAT = "YYYY-MM-DD HH:MI:SS"; + private static final SourceColumnMatch SOURCE_COLUMN_MATCH = SourceColumnMatch.POSITION; + private static final List NULL_MARKERS = ImmutableList.of("SQL NULL", "TEST_MARKER"); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION = ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, CSV_OPTIONS) .setFileSetSpecType("FILE_SET_SPEC_TYPE_FILE_SYSTEM_MATCH") @@ -74,6 +82,13 @@ public class ExternalTableDefinitionTest { .setObjectMetadata(OBJECT_METADATA) .setMetadataCacheMode(METADATA_CACHE_MODE) .setMaxStaleness(MAX_STALENESS) + .setTimeZone(TIME_ZONE) + .setDateFormat(DATE_FORMAT) + .setDatetimeFormat(DATETIME_FORMAT) + .setTimeFormat(TIME_FORMAT) + .setTimestampFormat(TIMESTAMP_FORMAT) + .setSourceColumnMatch(SOURCE_COLUMN_MATCH) + .setNullMarkers(NULL_MARKERS) .build(); private static final ExternalTableDefinition EXTERNAL_TABLE_DEFINITION_AVRO = @@ -131,6 +146,13 @@ public void testBuilder() { assertEquals(DECIMAL_TARGET_TYPES, EXTERNAL_TABLE_DEFINITION.getDecimalTargetTypes()); assertEquals(AUTODETECT, EXTERNAL_TABLE_DEFINITION.getAutodetect()); assertEquals(HIVE_PARTITIONING_OPTIONS, EXTERNAL_TABLE_DEFINITION.getHivePartitioningOptions()); + assertEquals(TIME_ZONE, EXTERNAL_TABLE_DEFINITION.getTimeZone()); + assertEquals(DATE_FORMAT, EXTERNAL_TABLE_DEFINITION.getDateFormat()); + assertEquals(DATETIME_FORMAT, EXTERNAL_TABLE_DEFINITION.getDatetimeFormat()); + assertEquals(TIME_FORMAT, EXTERNAL_TABLE_DEFINITION.getTimeFormat()); + assertEquals(TIMESTAMP_FORMAT, EXTERNAL_TABLE_DEFINITION.getTimestampFormat()); + assertEquals(SOURCE_COLUMN_MATCH, EXTERNAL_TABLE_DEFINITION.getSourceColumnMatch()); + assertEquals(NULL_MARKERS, EXTERNAL_TABLE_DEFINITION.getNullMarkers()); assertNotEquals(EXTERNAL_TABLE_DEFINITION, TableDefinition.Type.EXTERNAL); } @@ -174,5 +196,12 @@ private void compareExternalTableDefinition( assertEquals(expected.getObjectMetadata(), value.getObjectMetadata()); assertEquals(expected.getMetadataCacheMode(), value.getMetadataCacheMode()); assertEquals(expected.getMaxStaleness(), value.getMaxStaleness()); + assertEquals(expected.getTimeZone(), value.getTimeZone()); + assertEquals(expected.getDateFormat(), value.getDateFormat()); + assertEquals(expected.getDatetimeFormat(), value.getDatetimeFormat()); + assertEquals(expected.getTimeFormat(), value.getTimeFormat()); + assertEquals(expected.getTimestampFormat(), value.getTimestampFormat()); + assertEquals(expected.getSourceColumnMatch(), value.getSourceColumnMatch()); + assertEquals(expected.getNullMarkers(), value.getNullMarkers()); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index 6d181a3287..b1a2f1af89 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -21,6 +21,7 @@ import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; import com.google.cloud.bigquery.JobInfo.WriteDisposition; +import com.google.cloud.bigquery.LoadJobConfiguration.SourceColumnMatch; import com.google.cloud.bigquery.TimePartitioning.Type; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -77,6 +78,13 @@ public class LoadJobConfigurationTest { private static final String KEY = "session_id"; private static final String VALUE = "session_id_1234567890"; + private static final String TIME_ZONE = "America/Los_Angeles"; + private static final String DATE_FORMAT = "YYYY-MM-DD"; + private static final String DATETIME_FORMAT = "YYYY-MM-DD HH:MI:SS"; + private static final String TIME_FORMAT = "HH:MI:SS"; + private static final String TIMESTAMP_FORMAT = "YYYY-MM-DD HH:MI:SS"; + private static final SourceColumnMatch SOURCE_COLUMN_MATCH = SourceColumnMatch.POSITION; + private static final List NULL_MARKERS = ImmutableList.of("SQL NULL", "TEST MARKER"); private static final ConnectionProperty CONNECTION_PROPERTY = ConnectionProperty.newBuilder().setKey(KEY).setValue(VALUE).build(); private static final List CONNECTION_PROPERTIES = @@ -110,6 +118,13 @@ public class LoadJobConfigurationTest { .setConnectionProperties(CONNECTION_PROPERTIES) .setCreateSession(CREATE_SESSION) .setReservation(RESERVATION) + .setTimeZone(TIME_ZONE) + .setDateFormat(DATE_FORMAT) + .setDatetimeFormat(DATETIME_FORMAT) + .setTimeFormat(TIME_FORMAT) + .setTimestampFormat(TIMESTAMP_FORMAT) + .setSourceColumnMatch(SOURCE_COLUMN_MATCH) + .setNullMarkers(NULL_MARKERS) .build(); private static final DatastoreBackupOptions BACKUP_OPTIONS = @@ -271,5 +286,12 @@ private void compareLoadJobConfiguration( assertEquals(expected.getConnectionProperties(), value.getConnectionProperties()); assertEquals(expected.getCreateSession(), value.getCreateSession()); assertEquals(expected.getReservation(), value.getReservation()); + assertEquals(expected.getTimeZone(), value.getTimeZone()); + assertEquals(expected.getDateFormat(), value.getDateFormat()); + assertEquals(expected.getDatetimeFormat(), value.getDatetimeFormat()); + assertEquals(expected.getTimeFormat(), value.getTimeFormat()); + assertEquals(expected.getTimestampFormat(), value.getTimestampFormat()); + assertEquals(expected.getSourceColumnMatch(), value.getSourceColumnMatch()); + assertEquals(expected.getNullMarkers(), value.getNullMarkers()); } } From 8aabfa76ac8d55a6a3d49b76ac85abd011411fc6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 2 Jul 2025 15:54:42 +0200 Subject: [PATCH 2131/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.63.0 (#3874) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 8b1e77bd38..62c7f22ec7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.62.0 + 26.63.0 pom import From d2918da844cd20ca1602c6fcf9fa1df685f261fc Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Fri, 4 Jul 2025 13:16:25 -0400 Subject: [PATCH 2132/2268] docs: update maven format command (#3877) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0599033d79..5456fad053 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,7 @@ Code in this repo is formatted with [google-java-format](https://github.com/google/google-java-format). To run formatting on your project, you can run: ``` -mvn com.coveo:fmt-maven-plugin:format +mvn com.spotify.fmt:fmt-maven-plugin:format ``` [1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account From 0e971b8ace013caa31b8a02a21038e94bebae2a5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 9 Jul 2025 16:57:01 +0200 Subject: [PATCH 2133/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.50.1 (#3878) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 63543a40fa..1795d3b24a 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index dfa34060bc..13d12ce348 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 37dda4ab5a..4696d04ef0 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index a8ab977848..26d39a747e 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index dfa34060bc..13d12ce348 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 37dda4ab5a..4696d04ef0 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index a8ab977848..26d39a747e 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 1194e1b0e2..8af53ddadb 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.50.0 + 3.50.1 diff --git a/pom.xml b/pom.xml index 433cb320c5..5c10cf0197 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.50.0 + 3.50.1 From 5cfdf855fa0cf206660fd89743cbaabf3afa75a3 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:01:49 -0400 Subject: [PATCH 2134/2268] fix: load jobs preserve ascii control characters configuration (#3876) * fix: load jobs preserve ascii control characters configuration * fix lint * fix NPE * fix NPE --- .../cloud/bigquery/LoadJobConfiguration.java | 6 ++++ .../bigquery/LoadJobConfigurationTest.java | 1 + .../cloud/bigquery/it/ITBigQueryTest.java | 29 +++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index 0d1eb7245b..381942cd0b 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -219,6 +219,7 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur this.nullMarker = loadConfigurationPb.getNullMarker(); } if (loadConfigurationPb.getAllowJaggedRows() != null + || loadConfigurationPb.getPreserveAsciiControlCharacters() != null || loadConfigurationPb.getAllowQuotedNewlines() != null || loadConfigurationPb.getEncoding() != null || loadConfigurationPb.getFieldDelimiter() != null @@ -229,6 +230,10 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur .setEncoding(loadConfigurationPb.getEncoding()) .setFieldDelimiter(loadConfigurationPb.getFieldDelimiter()) .setQuote(loadConfigurationPb.getQuote()); + if (loadConfigurationPb.getPreserveAsciiControlCharacters() != null) { + builder.setPreserveAsciiControlCharacters( + loadConfigurationPb.getPreserveAsciiControlCharacters()); + } if (loadConfigurationPb.getAllowJaggedRows() != null) { builder.setAllowJaggedRows(loadConfigurationPb.getAllowJaggedRows()); } @@ -907,6 +912,7 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { .setAllowJaggedRows(csvOptions.allowJaggedRows()) .setAllowQuotedNewlines(csvOptions.allowQuotedNewLines()) .setEncoding(csvOptions.getEncoding()) + .setPreserveAsciiControlCharacters(csvOptions.getPreserveAsciiControlCharacters()) .setQuote(csvOptions.getQuote()); if (csvOptions.getSkipLeadingRows() != null) { // todo(mziccard) remove checked cast or comment when #1044 is closed diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index b1a2f1af89..d987eb28e0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -38,6 +38,7 @@ public class LoadJobConfigurationTest { .setAllowJaggedRows(true) .setAllowQuotedNewLines(false) .setEncoding(StandardCharsets.UTF_8) + .setPreserveAsciiControlCharacters(true) .build(); private static final TableId TABLE_ID = TableId.of("dataset", "table"); private static final CreateDisposition CREATE_DISPOSITION = CreateDisposition.CREATE_IF_NEEDED; diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index f188e7946e..c9f6296cc5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -613,6 +613,7 @@ public class ITBigQueryTest { private static final String LOAD_FILE_LARGE = "load_large.csv"; private static final String LOAD_FILE_FLEXIBLE_COLUMN_NAME = "load_flexible_column_name.csv"; + private static final String LOAD_FILE_NULL = "load_null.csv"; private static final String JSON_LOAD_FILE = "load.json"; private static final String JSON_LOAD_FILE_BQ_RESULTSET = "load_bq_resultset.json"; private static final String JSON_LOAD_FILE_SIMPLE = "load_simple.json"; @@ -628,6 +629,7 @@ public class ITBigQueryTest { private static final TableId TABLE_ID_FASTQUERY_BQ_RESULTSET = TableId.of(DATASET, "fastquery_testing_bq_resultset"); private static final String CSV_CONTENT = "StringValue1\nStringValue2\n"; + private static final String CSV_CONTENT_NULL = "String\0Value1\n"; private static final String CSV_CONTENT_FLEXIBLE_COLUMN = "name,&ersand\nrow_name,1"; private static final String JSON_CONTENT = @@ -1080,6 +1082,9 @@ public static void beforeClass() throws InterruptedException, IOException { storage.create( BlobInfo.newBuilder(BUCKET, LOAD_FILE).setContentType("text/plain").build(), CSV_CONTENT.getBytes(StandardCharsets.UTF_8)); + storage.create( + BlobInfo.newBuilder(BUCKET, LOAD_FILE_NULL).setContentType("text/plain").build(), + CSV_CONTENT_NULL.getBytes(StandardCharsets.UTF_8)); storage.create( BlobInfo.newBuilder(BUCKET, LOAD_FILE_FLEXIBLE_COLUMN_NAME) .setContentType("text/plain") @@ -6600,9 +6605,9 @@ public void testLocation() throws Exception { } @Test - public void testPreserveAsciiControlCharacters() + public void testWriteChannelPreserveAsciiControlCharacters() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_preserve_ascii_control_characters"; + String destinationTableName = "test_write_channel_preserve_ascii_control_characters"; TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6625,6 +6630,26 @@ public void testPreserveAsciiControlCharacters() assertTrue(bigquery.delete(tableId)); } + @Test + public void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { + String destinationTableName = "test_load_job_preserve_ascii_control_characters"; + TableId destinationTable = TableId.of(DATASET, destinationTableName); + + try { + LoadJobConfiguration configuration = + LoadJobConfiguration.newBuilder(destinationTable, "gs://" + BUCKET + "/" + LOAD_FILE_NULL) + .setFormatOptions( + CsvOptions.newBuilder().setPreserveAsciiControlCharacters(true).build()) + .setSchema(SIMPLE_SCHEMA) + .build(); + Job remoteLoadJob = bigquery.create(JobInfo.of(configuration)); + remoteLoadJob = remoteLoadJob.waitFor(); + assertNull(remoteLoadJob.getStatus().getError()); + } finally { + assertTrue(bigquery.delete(destinationTable)); + } + } + @Test public void testReferenceFileSchemaUriForAvro() { try { From c47a062136fea4de91190cafb1f11bac6abbbe3a Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Thu, 10 Jul 2025 11:38:38 -0700 Subject: [PATCH 2135/2268] feat: next release from main branch is 2.53.0 (#3879) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index 48231f76e4..d722d35a25 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -31,6 +31,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.48.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.52.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index c3a3263dd7..26f85cb166 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -132,6 +132,21 @@ branchProtectionRules: - cla/google - javadoc - unmanaged_dependency_check + - pattern: 2.52.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - javadoc + - unmanaged_dependency_check permissionRules: - team: api-bigquery permission: admin From 3a17ec2c7e0e2f2c0960d07a92bc09cac9dc8ab7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 14 Jul 2025 17:03:06 +0200 Subject: [PATCH 2136/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.16.0 (#3884) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c10cf0197..d44a03befc 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.15.3 + 3.16.0 pom import From ed331354e225d9340c6101b9e783a1b79eae2875 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 12:59:52 -0400 Subject: [PATCH 2137/2268] chore(main): release 2.53.0 (#3866) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 35 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71577758bd..9336a4195c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [2.53.0](https://github.com/googleapis/java-bigquery/compare/v2.52.0...v2.53.0) (2025-07-14) + + +### Features + +* **bigquery:** Add OpenTelemetry support to BQ rpcs ([#3860](https://github.com/googleapis/java-bigquery/issues/3860)) ([e2d23c1](https://github.com/googleapis/java-bigquery/commit/e2d23c1b15f2c48a4113f82b920f5c29c4b5dfea)) +* **bigquery:** Add support for custom timezones and timestamps ([#3859](https://github.com/googleapis/java-bigquery/issues/3859)) ([e5467c9](https://github.com/googleapis/java-bigquery/commit/e5467c917c63ac066edcbcd902cc2093a39971a3)) +* Next release from main branch is 2.53.0 ([#3879](https://github.com/googleapis/java-bigquery/issues/3879)) ([c47a062](https://github.com/googleapis/java-bigquery/commit/c47a062136fea4de91190cafb1f11bac6abbbe3a)) + + +### Bug Fixes + +* Load jobs preserve ascii control characters configuration ([#3876](https://github.com/googleapis/java-bigquery/issues/3876)) ([5cfdf85](https://github.com/googleapis/java-bigquery/commit/5cfdf855fa0cf206660fd89743cbaabf3afa75a3)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.69.0 ([#3870](https://github.com/googleapis/java-bigquery/issues/3870)) ([a7f1007](https://github.com/googleapis/java-bigquery/commit/a7f1007b5242da2c0adebbb309a908d7d4db5974)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250615-2.0.0 ([#3872](https://github.com/googleapis/java-bigquery/issues/3872)) ([f081589](https://github.com/googleapis/java-bigquery/commit/f08158955b7fec3c2ced6332b6e4d76cc13f2e90)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.1 ([#3878](https://github.com/googleapis/java-bigquery/issues/3878)) ([0e971b8](https://github.com/googleapis/java-bigquery/commit/0e971b8ace013caa31b8a02a21038e94bebae2a5)) + + +### Documentation + +* Update maven format command ([#3877](https://github.com/googleapis/java-bigquery/issues/3877)) ([d2918da](https://github.com/googleapis/java-bigquery/commit/d2918da844cd20ca1602c6fcf9fa1df685f261fc)) + ## [2.52.0](https://github.com/googleapis/java-bigquery/compare/v2.51.0...v2.52.0) (2025-06-25) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8fcf7ca00d..8674b71026 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8af53ddadb..bc3a9e0c3b 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.52.1-SNAPSHOT + 2.53.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6c7e1aed1b..ad20f607e7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.52.1-SNAPSHOT + 2.53.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.52.1-SNAPSHOT + 2.53.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d44a03befc..4bc7652ba9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.52.1-SNAPSHOT + 2.53.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index d9d52314b0..7e1bfd314d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.52.1-SNAPSHOT + 2.53.0 diff --git a/versions.txt b/versions.txt index 5e931b82a5..5245c445bf 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.52.0:2.52.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.53.0:2.53.0 \ No newline at end of file From b95f1221e2672e3c824daaed81783a6228d54fe3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 11:19:07 -0400 Subject: [PATCH 2138/2268] chore(main): release 2.53.1-SNAPSHOT (#3886) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8674b71026..9352cc46f5 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.53.0 + 2.53.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index bc3a9e0c3b..c41c4c601c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.53.0 + 2.53.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.53.0 + 2.53.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ad20f607e7..b3f4461a08 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.53.0 + 2.53.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.53.0 + 2.53.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 4bc7652ba9..bfbc88b03d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.53.0 + 2.53.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.53.0 + 2.53.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7e1bfd314d..9900dc8299 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -44,7 +44,7 @@ com.google.cloud google-cloud-bigquery - 2.53.0 + 2.53.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5245c445bf..73c78399ea 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.53.0:2.53.0 \ No newline at end of file +google-cloud-bigquery:2.53.0:2.53.1-SNAPSHOT \ No newline at end of file From a2dbafb9bc1c37ffda6e21605e98637a52b42ee3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 15 Jul 2025 17:49:48 +0200 Subject: [PATCH 2139/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquery to v2.53.0 (#3887) --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 11e13e43ec..3faa299811 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -45,7 +45,7 @@ com.google.cloud google-cloud-bigquery - 2.52.0 + 2.53.0 From 84207e297eec75bcb4f1cc1b64423d7c2ddd6c30 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 15 Jul 2025 18:54:15 +0200 Subject: [PATCH 2140/2268] deps: update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.70.0 (#3890) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bfbc88b03d..32f6636a62 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ com.google.api.grpc proto-google-cloud-bigqueryconnection-v1 - 2.69.0 + 2.70.0 test From 83278f66bbab19a5ff6131374687c65358dc392a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 17 Jul 2025 18:24:49 +0200 Subject: [PATCH 2141/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigtable to v2.62.0 (#3894) --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3faa299811..fac67658a6 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -63,7 +63,7 @@ com.google.cloud google-cloud-bigtable - 2.61.0 + 2.62.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9900dc8299..9f836d7217 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigtable - 2.61.0 + 2.62.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 62c7f22ec7..7ec8cdc108 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigtable - 2.61.0 + 2.62.0 test From 92371d9d9a4dd64f5291342aff1e4f5aae16da9e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 17 Jul 2025 19:33:10 +0200 Subject: [PATCH 2142/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.64.0 (#3895) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 7ec8cdc108..3f293ddd09 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.63.0 + 26.64.0 pom import From fce3d8f874f800a0f48e59f80c47ff53e2b7f166 Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Fri, 18 Jul 2025 13:02:17 -0700 Subject: [PATCH 2143/2268] chore: create LTS branch 2.51.x (#3896) --- .github/release-please.yml | 4 ++++ .github/sync-repo-settings.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index d722d35a25..f87ac1ecca 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -35,6 +35,10 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.52.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + branch: 2.51.x bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 26f85cb166..8a7fa3e302 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -147,6 +147,21 @@ branchProtectionRules: - cla/google - javadoc - unmanaged_dependency_check + - pattern: 2.51.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - javadoc + - unmanaged_dependency_check permissionRules: - team: api-bigquery permission: admin From 36d3e82c80a1de7b00d83b0d85c1a5ad65d84640 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 21 Jul 2025 17:55:40 +0200 Subject: [PATCH 2144/2268] chore(deps): update google cloud java monorepo updates (#3889) --- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 32f6636a62..850b288e58 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.73.0 + 1.74.0 pom import @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.69.0 + 2.70.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fac67658a6..c492b1182c 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -69,7 +69,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.69.0 + 2.70.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9f836d7217..496458c708 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -67,7 +67,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.69.0 + 2.70.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 3f293ddd09..0e32438edd 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -85,7 +85,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.69.0 + 2.70.0 test From e3d9ed92ca5d9b58b5747960d74f895ed8733ebf Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:46:24 -0700 Subject: [PATCH 2145/2268] feat(bigquery): Add OpenTelemetry Samples (#3899) * feat(bigquery): Add OpenTelemetry Samples * Add dependencies to pom files * fix style * Fix dependencies, clean up sample * Add sample without parent span * Fix copy/paste error * Remove reference to global otel object * Replace custom exporter with logging exporter * Add logging exporter dep to snapshot and without-bom * Generate random strings for ds names * feat(bigquery): Add custom console exporter to samples * fix style, remove comments --- samples/install-without-bom/pom.xml | 31 +++++ samples/snapshot/pom.xml | 42 +++++++ samples/snippets/pom.xml | 37 ++++++ .../bigquery/EnableOpenTelemetryTracing.java | 85 ++++++++++++++ ...bleOpenTelemetryTracingWithParentSpan.java | 105 +++++++++++++++++ .../EnableOpenTelemetryTracingIT.java | 105 +++++++++++++++++ ...eOpenTelemetryTracingWithParentSpanIT.java | 110 ++++++++++++++++++ 7 files changed, 515 insertions(+) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracing.java create mode 100644 samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpan.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingIT.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpanIT.java diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index c492b1182c..87a5670338 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -59,6 +59,37 @@ google-oauth-client-jetty 1.39.0 + + io.opentelemetry + opentelemetry-api + 1.48.0 + + + io.opentelemetry + opentelemetry-context + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-common + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-trace + 1.48.0 + + + io.opentelemetry + opentelemetry-exporter-logging + 1.48.0 + + com.google.cloud diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 496458c708..f2c96c00db 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -39,6 +39,18 @@ UTF-8 + + + + io.opentelemetry + opentelemetry-bom + 1.48.0 + pom + import + + + + @@ -82,6 +94,36 @@ 1.4.4 test + + io.opentelemetry + opentelemetry-api + 1.48.0 + + + io.opentelemetry + opentelemetry-context + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-common + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-trace + 1.48.0 + + + io.opentelemetry + opentelemetry-exporter-logging + 1.48.0 + diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 0e32438edd..2b5dfd4bcd 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -51,6 +51,13 @@ pom import + + io.opentelemetry + opentelemetry-bom + 1.48.0 + pom + import + @@ -59,6 +66,36 @@ com.google.cloud google-cloud-bigquery + + io.opentelemetry + opentelemetry-api + 1.48.0 + + + io.opentelemetry + opentelemetry-context + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-common + 1.48.0 + + + io.opentelemetry + opentelemetry-sdk-trace + 1.48.0 + + + io.opentelemetry + opentelemetry-exporter-logging + 1.48.0 + diff --git a/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracing.java b/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracing.java new file mode 100644 index 0000000000..57ec7eb71d --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracing.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_enable_otel_tracing] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetInfo; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.exporter.logging.LoggingSpanExporter; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import java.util.logging.ConsoleHandler; +import java.util.logging.Logger; + +public class EnableOpenTelemetryTracing { + private static final Logger log = Logger.getLogger(EnableOpenTelemetryTracing.class.getName()); + + public static void main(String[] args) { + // Set logging to System.err. + ConsoleHandler ch = new ConsoleHandler(); + log.addHandler(ch); + + // TODO(developer): Replace values before running the sample. + final String tracerName = "Sample Tracer"; + final String datasetId = "sampleDatasetId"; + + // Create TracerProvider that exports to a logger. + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.builder(LoggingSpanExporter.create()).build()) + .setSampler(Sampler.alwaysOn()) + .build(); + + // Create global OpenTelemetry instance using the TracerProvider. + OpenTelemetry otel = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build(); + + // Create Tracer instance from the OpenTelemetry object. Tracers are used to create + // Spans. There can be multiple Tracers in an OpenTelemetry instance. + Tracer tracer = otel.getTracer(tracerName); + + enableOpenTelemetry(tracer, datasetId); + } + + public static void enableOpenTelemetry(Tracer tracer, String datasetId) { + // Create BigQuery client to trace. EnableOpenTelemetryTracing and OpenTelemetryTracer must + // be set to enable tracing. + BigQueryOptions otelOptions = + BigQueryOptions.newBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build(); + BigQuery bigquery = otelOptions.getService(); + + try { + // Create dataset. + DatasetInfo info = DatasetInfo.newBuilder(datasetId).build(); + Dataset dataset = bigquery.create(info); + } catch (Exception e) { + System.out.println( + String.format("Failed to create dataset: %s: %s", e.toString(), e.getMessage())); + } finally { + bigquery.delete(datasetId); + } + } +} +// [END bigquery_enable_otel_tracing] diff --git a/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpan.java b/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpan.java new file mode 100644 index 0000000000..af69df10ba --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpan.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_enable_otel_tracing_with_parent_span] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetInfo; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Span; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.context.Scope; +import io.opentelemetry.exporter.logging.LoggingSpanExporter; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import java.time.LocalDate; +import java.util.logging.ConsoleHandler; +import java.util.logging.Logger; + +public class EnableOpenTelemetryTracingWithParentSpan { + private static final Logger log = + Logger.getLogger(EnableOpenTelemetryTracingWithParentSpan.class.getName()); + + public static void main(String[] args) { + // Set logging to System.err. + ConsoleHandler ch = new ConsoleHandler(); + log.addHandler(ch); + + // TODO(developer): Replace values before running the sample. + final String tracerName = "Sample Tracer"; + final String parentSpanName = "Sample Parent Span"; + final String datasetId = "sampleDatasetId"; + + // Create TracerProvider that exports to a logger. + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.builder(LoggingSpanExporter.create()).build()) + .setSampler(Sampler.alwaysOn()) + .build(); + + // Create OpenTelemetry instance using the TracerProvider. + OpenTelemetry otel = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build(); + + // Create Tracer instance from the global OpenTelemetry object. Tracers are used to create + // Spans. There can be multiple Tracers in a global OpenTelemetry instance. + final Tracer tracer = otel.getTracer(tracerName); + enableOpenTelemetryWithParentSpan(tracer, parentSpanName, datasetId); + } + + public static void enableOpenTelemetryWithParentSpan( + Tracer tracer, String parentSpanName, String datasetId) { + // Create BigQuery client to trace. EnableOpenTelemetryTracing and OpenTelemetryTracer must + // be set to enable tracing. + BigQueryOptions otelOptions = + BigQueryOptions.newBuilder() + .setEnableOpenTelemetryTracing(true) + .setOpenTelemetryTracer(tracer) + .build(); + BigQuery bigquery = otelOptions.getService(); + + LocalDate currentDate = LocalDate.now(); + + // Create the root parent Span. setNoParent() ensures that it is a parent Span with a Span ID + // of 0. + Span parentSpan = + tracer + .spanBuilder(parentSpanName) + .setNoParent() + .setAttribute("current_date", currentDate.toString()) + .startSpan(); + + // The Span Context is automatically passed on to any functions called within the scope of the + // try block. parentSpan.makeCurrent() sets parentSpan to be the parent of any Spans created in + // this scope, or the scope of any functions called within this scope. + try (Scope parentScope = parentSpan.makeCurrent()) { + DatasetInfo info = DatasetInfo.newBuilder(datasetId).build(); + Dataset dataset = bigquery.create(info); + } catch (Exception e) { + System.out.println( + String.format("Failed to create dataset: %s: %s", e.toString(), e.getMessage())); + } finally { + // finally block ensures that Spans are cleaned up properly. + parentSpan.end(); + bigquery.delete(datasetId); + } + } +} +// [END bigquery_enable_otel_tracing_with_parent_span] diff --git a/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingIT.java b/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingIT.java new file mode 100644 index 0000000000..0ad5651018 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingIT.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.Collection; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class EnableOpenTelemetryTracingIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static class ConsoleSpanExporter + implements io.opentelemetry.sdk.trace.export.SpanExporter { + @Override + public CompletableResultCode export(Collection collection) { + if (collection.isEmpty()) { + return CompletableResultCode.ofFailure(); + } + for (SpanData data : collection) { + System.out.println(data); + } + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode flush() { + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode shutdown() { + return CompletableResultCode.ofSuccess(); + } + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testEnableOpenTelemetryTracing() { + final String tracerName = "testSampleTracer"; + final String datasetId = RemoteBigQueryHelper.generateDatasetName(); + + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.builder(new ConsoleSpanExporter()).build()) + .setSampler(Sampler.alwaysOn()) + .build(); + + OpenTelemetry otel = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build(); + + final Tracer tracer = otel.getTracer(tracerName); + + EnableOpenTelemetryTracing.enableOpenTelemetry(tracer, datasetId); + + assertThat(bout.toString()).contains("com.google.cloud.bigquery.BigQuery.createDataset"); + assertThat(bout.toString()).contains("com.google.cloud.bigquery.BigQuery.deleteDataset"); + } +} diff --git a/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpanIT.java b/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpanIT.java new file mode 100644 index 0000000000..482915008b --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/EnableOpenTelemetryTracingWithParentSpanIT.java @@ -0,0 +1,110 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Tracer; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.trace.SdkTracerProvider; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; +import io.opentelemetry.sdk.trace.samplers.Sampler; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.time.LocalDate; +import java.util.Collection; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class EnableOpenTelemetryTracingWithParentSpanIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private ByteArrayOutputStream bout; + private PrintStream out; + private PrintStream originalPrintStream; + + private static class ConsoleSpanExporter + implements io.opentelemetry.sdk.trace.export.SpanExporter { + @Override + public CompletableResultCode export(Collection collection) { + if (collection.isEmpty()) { + return CompletableResultCode.ofFailure(); + } + for (SpanData data : collection) { + System.out.println(data); + } + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode flush() { + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode shutdown() { + return CompletableResultCode.ofSuccess(); + } + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + } + + @After + public void tearDown() { + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testEnableOpenTelemetryWithParentSpan() { + final String tracerName = "testSampleTracer"; + final String parentSpanName = "testSampleParentSpan"; + final String datasetId = RemoteBigQueryHelper.generateDatasetName(); + final LocalDate currentDate = LocalDate.now(); + + SdkTracerProvider tracerProvider = + SdkTracerProvider.builder() + .addSpanProcessor(SimpleSpanProcessor.builder(new ConsoleSpanExporter()).build()) + .setSampler(Sampler.alwaysOn()) + .build(); + + OpenTelemetry otel = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build(); + + final Tracer tracer = otel.getTracer(tracerName); + + EnableOpenTelemetryTracingWithParentSpan.enableOpenTelemetryWithParentSpan( + tracer, parentSpanName, datasetId); + + assertThat(bout.toString()).contains(parentSpanName); + assertThat(bout.toString()) + .contains(String.format("AttributesMap{data={current_date=%s}", currentDate.toString())); + } +} From aa3d10bc7f1f44f2e92ee631da8056aa762b25e3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 25 Jul 2025 03:48:02 +0200 Subject: [PATCH 2146/2268] test(deps): update dependency com.google.cloud:google-cloud-storage to v2.53.3 (#3882) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 850b288e58..e0e3aa024b 100644 --- a/pom.xml +++ b/pom.xml @@ -137,7 +137,7 @@ com.google.cloud google-cloud-storage - 2.53.2 + 2.53.3 test From 4071e4cb2547b236183fd4fbb92c73f074cf2fa0 Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Fri, 25 Jul 2025 09:06:15 -0700 Subject: [PATCH 2147/2268] feat(bigquery): Add otel metrics to request headers (#3900) --- .../bigquery/spi/v2/HttpBigQueryRpc.java | 147 +++++++++++++++++- 1 file changed, 142 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java index 9d89435ea9..16737dc4b7 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java @@ -158,6 +158,9 @@ public Dataset getDatasetSkipExceptionTranslation( if (options.containsKey(Option.DATASET_VIEW)) { bqGetRequest.setDatasetView(options.get(Option.DATASET_VIEW).toString()); } + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); Span getDataset = null; if (this.options.isOpenTelemetryTracingEnabled() @@ -205,6 +208,10 @@ public Tuple> listDatasetsSkipExceptionTranslation( .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)); + datasetsListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listDatasets = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -256,6 +263,9 @@ public Dataset createSkipExceptionTranslation(Dataset dataset, Map op if (options.containsKey(Option.ACCESS_POLICY_VERSION)) { bqCreateRequest.setAccessPolicyVersion((Integer) options.get(Option.ACCESS_POLICY_VERSION)); } + bqCreateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); Span createDataset = null; if (this.options.isOpenTelemetryTracingEnabled() @@ -302,6 +312,10 @@ public Table createSkipExceptionTranslation(Table table, Map options) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqCreateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span createTable = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -345,6 +359,10 @@ public Routine createSkipExceptionTranslation(Routine routine, Map op .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqCreateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span createRoutine = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -391,6 +409,10 @@ public Job createSkipExceptionTranslation(Job job, Map options) throw .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqCreateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span createJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -434,6 +456,10 @@ public Job createJobForQuerySkipExceptionTranslation(Job job) throws IOException Bigquery.Jobs.Insert bqCreateRequest = bigquery.jobs().insert(projectId, job).setPrettyPrint(false); + bqCreateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span createJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -481,6 +507,10 @@ public boolean deleteDatasetSkipExceptionTranslation( .setPrettyPrint(false) .setDeleteContents(Option.DELETE_CONTENTS.getBoolean(options)); + bqDeleteRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span deleteDataset = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -528,6 +558,9 @@ public Dataset patchSkipExceptionTranslation(Dataset dataset, Map opt if (options.containsKey(Option.DATASET_UPDATE_MODE)) { bqPatchRequest.setUpdateMode(options.get(Option.DATASET_UPDATE_MODE).toString()); } + bqPatchRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); Span patchDataset = null; if (this.options.isOpenTelemetryTracingEnabled() @@ -576,6 +609,10 @@ public Table patchSkipExceptionTranslation(Table table, Map options) .setFields(Option.FIELDS.getString(options)) .setAutodetectSchema(BigQueryRpc.Option.AUTODETECT_SCHEMA.getBoolean(options)); + bqPatchRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span patchTable = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -625,6 +662,10 @@ public Table getTableSkipExceptionTranslation( .setFields(Option.FIELDS.getString(options)) .setView(getTableMetadataOption(options)); + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getTable = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -676,6 +717,10 @@ public Tuple> listTablesSkipExceptionTranslation( .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)); + tableListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listTables = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -740,6 +785,10 @@ public boolean deleteTableSkipExceptionTranslation( Bigquery.Tables.Delete bqDeleteRequest = bigquery.tables().delete(projectId, datasetId, tableId); + bqDeleteRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span deleteTable = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -783,6 +832,10 @@ public Model patchSkipExceptionTranslation(Model model, Map options) .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqPatchRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span patchModel = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -832,6 +885,10 @@ public Model getModelSkipExceptionTranslation( .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getModel = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -877,6 +934,10 @@ public Tuple> listModelsSkipExceptionTranslation( .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)); + modelListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listModels = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -923,6 +984,10 @@ public boolean deleteModelSkipExceptionTranslation( Bigquery.Models.Delete bqDeleteRequest = bigquery.models().delete(projectId, datasetId, modelId); + bqDeleteRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span deleteModels = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -968,6 +1033,10 @@ public Routine updateSkipExceptionTranslation(Routine routine, Map op .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqUpdateRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span updateRoutine = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1017,6 +1086,10 @@ public Routine getRoutineSkipExceptionTranslation( .setPrettyPrint(false) .setFields(Option.FIELDS.getString(options)); + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getRoutine = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1062,6 +1135,10 @@ public Tuple> listRoutinesSkipExceptionTranslation( .setMaxResults(Option.MAX_RESULTS.getLong(options)) .setPageToken(Option.PAGE_TOKEN.getString(options)); + routineListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listRoutines = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1109,6 +1186,10 @@ public boolean deleteRoutineSkipExceptionTranslation( Bigquery.Routines.Delete bqDeleteRequest = bigquery.routines().delete(projectId, datasetId, routineId); + bqDeleteRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span deleteRoutine = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1150,6 +1231,10 @@ public TableDataInsertAllResponse insertAllSkipExceptionTranslation( .insertAll(projectId, datasetId, tableId, request) .setPrettyPrint(false); + insertAllRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span insertAll = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1197,6 +1282,10 @@ public TableDataList listTableDataSkipExceptionTranslation( ? BigInteger.valueOf(Option.START_INDEX.getLong(options)) : null); + bqListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listTableData = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1251,6 +1340,10 @@ public TableDataList listTableDataWithRowLimitSkipExceptionTranslation( .setMaxResults(Long.valueOf(maxResultPerPage)) .setPageToken(pageToken); + bqListRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span listTableData = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1297,6 +1390,10 @@ public Job getJobSkipExceptionTranslation( .setLocation(location) .setFields(Option.FIELDS.getString(options)); + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1340,6 +1437,10 @@ public Job getQueryJobSkipExceptionTranslation(String projectId, String jobId, S Bigquery.Jobs.Get bqGetRequest = bigquery.jobs().get(projectId, jobId).setPrettyPrint(false).setLocation(location); + bqGetRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1375,7 +1476,7 @@ public Tuple> listJobs(String projectId, Map op public Tuple> listJobsSkipExceptionTranslation( String projectId, Map options) throws IOException { validateRPC(); - Bigquery.Jobs.List request = + Bigquery.Jobs.List listJobsRequest = bigquery .jobs() .list(projectId) @@ -1388,11 +1489,16 @@ public Tuple> listJobsSkipExceptionTranslation( .setProjection(DEFAULT_PROJECTION) .setParentJobId(Option.PARENT_JOB_ID.getString(options)); if (Option.MIN_CREATION_TIME.getLong(options) != null) { - request.setMinCreationTime(BigInteger.valueOf(Option.MIN_CREATION_TIME.getLong(options))); + listJobsRequest.setMinCreationTime( + BigInteger.valueOf(Option.MIN_CREATION_TIME.getLong(options))); } if (Option.MAX_CREATION_TIME.getLong(options) != null) { - request.setMaxCreationTime(BigInteger.valueOf(Option.MAX_CREATION_TIME.getLong(options))); + listJobsRequest.setMaxCreationTime( + BigInteger.valueOf(Option.MAX_CREATION_TIME.getLong(options))); } + listJobsRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); Span listJobs = null; if (this.options.isOpenTelemetryTracingEnabled() @@ -1405,11 +1511,11 @@ public Tuple> listJobsSkipExceptionTranslation( .setAttribute("bq.rpc.service", "JobService") .setAttribute("bq.rpc.method", "ListJobs") .setAttribute("bq.rpc.system", "http") - .setAttribute("bq.rpc.page_token", request.getPageToken()) + .setAttribute("bq.rpc.page_token", listJobsRequest.getPageToken()) .setAllAttributes(otelAttributesFromOptions(options)) .startSpan(); } - JobList jobsList = request.execute(); + JobList jobsList = listJobsRequest.execute(); if (listJobs != null) { listJobs.setAttribute("bq.rpc.next_page_token", jobsList.getNextPageToken()); listJobs.end(); @@ -1463,6 +1569,10 @@ public boolean cancelSkipExceptionTranslation(String projectId, String jobId, St Bigquery.Jobs.Cancel bqCancelRequest = bigquery.jobs().cancel(projectId, jobId).setLocation(location).setPrettyPrint(false); + bqCancelRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span cancelJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1499,6 +1609,10 @@ public boolean deleteJobSkipExceptionTranslation( Bigquery.Jobs.Delete bqDeleteRequest = bigquery.jobs().delete(projectId, jobName).setLocation(location).setPrettyPrint(false); + bqDeleteRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span deleteJob = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1547,6 +1661,10 @@ public GetQueryResultsResponse getQueryResultsSkipExceptionTranslation( : null) .setTimeoutMs(Option.TIMEOUT.getLong(options)); + queryRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getQueryResults = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1595,6 +1713,10 @@ public GetQueryResultsResponse getQueryResultsWithRowLimitSkipExceptionTranslati .setMaxResults(Long.valueOf(maxResultPerPage)) .setTimeoutMs(timeoutMs); + queryRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); + Span getQueryResults = null; if (this.options.isOpenTelemetryTracingEnabled() && this.options.getOpenTelemetryTracer() != null) { @@ -1631,6 +1753,9 @@ public QueryResponse queryRpcSkipExceptionTranslation(String projectId, QueryReq throws IOException { validateRPC(); Bigquery.Jobs.Query queryRequest = bigquery.jobs().query(projectId, content); + queryRequest + .getRequestHeaders() + .set("x-goog-otel-enabled", this.options.isOpenTelemetryTracingEnabled()); Span getQueryResults = null; if (this.options.isOpenTelemetryTracingEnabled() @@ -1765,6 +1890,10 @@ public Policy getIamPolicySkipExceptionTranslation(String resourceId, Map From e6453bf08cb822e820ffeb9ee3bd43cfcf2d4d15 Mon Sep 17 00:00:00 2001 From: Phong Chuong <147636638+PhongChuong@users.noreply.github.com> Date: Wed, 30 Jul 2025 23:03:23 -0400 Subject: [PATCH 2153/2268] =?UTF-8?q?chore(samples):=20update=20sample=20o?= =?UTF-8?q?pen=20telemetry=20dep=20to=20reduce=20#=20of=20renov=E2=80=A6?= =?UTF-8?q?=20(#3911)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(samples): update sample open telemetry dep to reduce # of renovate-bot PRs * fix extra dep --- samples/install-without-bom/pom.xml | 13 +++++++------ samples/snapshot/pom.xml | 6 ------ samples/snippets/pom.xml | 6 ------ 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 4bc7f7a2b4..7cd683afd5 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -37,6 +37,7 @@ 1.8 1.8 UTF-8 + 1.52.0 @@ -62,32 +63,32 @@ io.opentelemetry opentelemetry-api - 1.52.0 + ${opentelemetry.version} io.opentelemetry opentelemetry-context - 1.52.0 + ${opentelemetry.version} io.opentelemetry opentelemetry-sdk - 1.48.0 + ${opentelemetry.version} io.opentelemetry opentelemetry-sdk-common - 1.48.0 + ${opentelemetry.version} io.opentelemetry opentelemetry-sdk-trace - 1.48.0 + ${opentelemetry.version} io.opentelemetry opentelemetry-exporter-logging - 1.52.0 + ${opentelemetry.version} diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 7e2a08cab2..f94d4c4c13 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -97,32 +97,26 @@ io.opentelemetry opentelemetry-api - 1.52.0 io.opentelemetry opentelemetry-context - 1.52.0 io.opentelemetry opentelemetry-sdk - 1.48.0 io.opentelemetry opentelemetry-sdk-common - 1.48.0 io.opentelemetry opentelemetry-sdk-trace - 1.48.0 io.opentelemetry opentelemetry-exporter-logging - 1.52.0 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index da5d031b5a..d6f779c24a 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -69,32 +69,26 @@ io.opentelemetry opentelemetry-api - 1.52.0 io.opentelemetry opentelemetry-context - 1.52.0 io.opentelemetry opentelemetry-sdk - 1.48.0 io.opentelemetry opentelemetry-sdk-common - 1.48.0 io.opentelemetry opentelemetry-sdk-trace - 1.48.0 io.opentelemetry opentelemetry-exporter-logging - 1.52.0 From 82056237f194a6c99ec4fb3a4315023efdedff1b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 31 Jul 2025 16:14:46 +0200 Subject: [PATCH 2154/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.50.2 (#3901) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 1795d3b24a..6d5c25a0c1 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.2 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 13d12ce348..bfe47cf7d5 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 4696d04ef0..603c54174a 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 26d39a747e..6b35d89de0 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 13d12ce348..bfe47cf7d5 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 4696d04ef0..603c54174a 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 26d39a747e..6b35d89de0 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.2" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index c41c4c601c..90111de1a3 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.50.1 + 3.50.2 diff --git a/pom.xml b/pom.xml index 79a2629d01..7304158def 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.50.1 + 3.50.2 From bb6f6dcb90b1ddf72e630c4dc64737cf2c2ebd2e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 31 Jul 2025 17:32:25 +0200 Subject: [PATCH 2155/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.16.1 (#3912) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7304158def..e0d9c55509 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.16.0 + 3.16.1 pom import From 548f5b6bbb71f949ad4d1560ab28e72708e31919 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 17:28:28 -0400 Subject: [PATCH 2156/2268] chore(main): release 2.54.0 (#3892) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 19 +++++++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9336a4195c..147b9c5893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [2.54.0](https://github.com/googleapis/java-bigquery/compare/v2.53.0...v2.54.0) (2025-07-31) + + +### Features + +* **bigquery:** Add OpenTelemetry Samples ([#3899](https://github.com/googleapis/java-bigquery/issues/3899)) ([e3d9ed9](https://github.com/googleapis/java-bigquery/commit/e3d9ed92ca5d9b58b5747960d74f895ed8733ebf)) +* **bigquery:** Add otel metrics to request headers ([#3900](https://github.com/googleapis/java-bigquery/issues/3900)) ([4071e4c](https://github.com/googleapis/java-bigquery/commit/4071e4cb2547b236183fd4fbb92c73f074cf2fa0)) + + +### Dependencies + +* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.70.0 ([#3890](https://github.com/googleapis/java-bigquery/issues/3890)) ([84207e2](https://github.com/googleapis/java-bigquery/commit/84207e297eec75bcb4f1cc1b64423d7c2ddd6c30)) +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20250706-2.0.0 ([#3910](https://github.com/googleapis/java-bigquery/issues/3910)) ([ae5c971](https://github.com/googleapis/java-bigquery/commit/ae5c97146c7076e90c000fd98b797ec8e08a9cd8)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.2 ([#3901](https://github.com/googleapis/java-bigquery/issues/3901)) ([8205623](https://github.com/googleapis/java-bigquery/commit/82056237f194a6c99ec4fb3a4315023efdedff1b)) +* Update dependency io.opentelemetry:opentelemetry-api to v1.52.0 ([#3902](https://github.com/googleapis/java-bigquery/issues/3902)) ([772407b](https://github.com/googleapis/java-bigquery/commit/772407b12f4da005f79eafc944d4c53f0eec5c27)) +* Update dependency io.opentelemetry:opentelemetry-bom to v1.52.0 ([#3903](https://github.com/googleapis/java-bigquery/issues/3903)) ([509a6fc](https://github.com/googleapis/java-bigquery/commit/509a6fc0bb7e7a101bf0d4334a3ff1adde2cab09)) +* Update dependency io.opentelemetry:opentelemetry-context to v1.52.0 ([#3904](https://github.com/googleapis/java-bigquery/issues/3904)) ([96c1bae](https://github.com/googleapis/java-bigquery/commit/96c1bae0fcdfdfc2dbb25dcae5007c5d02111a8c)) +* Update dependency io.opentelemetry:opentelemetry-exporter-logging to v1.52.0 ([#3905](https://github.com/googleapis/java-bigquery/issues/3905)) ([28ee4c9](https://github.com/googleapis/java-bigquery/commit/28ee4c941b99b1fe3803aefbe7a8ae57100d76cb)) + ## [2.53.0](https://github.com/googleapis/java-bigquery/compare/v2.52.0...v2.53.0) (2025-07-14) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9352cc46f5..5f875493df 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.53.1-SNAPSHOT + 2.54.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 90111de1a3..cefddd199b 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.53.1-SNAPSHOT + 2.54.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.53.1-SNAPSHOT + 2.54.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b3f4461a08..058a06caa4 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.53.1-SNAPSHOT + 2.54.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.53.1-SNAPSHOT + 2.54.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index e0d9c55509..534e91a49e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.53.1-SNAPSHOT + 2.54.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.53.1-SNAPSHOT + 2.54.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f94d4c4c13..1860907149 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.53.1-SNAPSHOT + 2.54.0 diff --git a/versions.txt b/versions.txt index 73c78399ea..f0fee808c1 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.53.0:2.53.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.54.0:2.54.0 \ No newline at end of file From 3f61243a18dedd7884e46430c6f3f6815e921353 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 04:36:10 -0400 Subject: [PATCH 2157/2268] chore(main): release 2.54.1-SNAPSHOT (#3919) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5f875493df..9be2fa48f0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.0 + 2.54.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index cefddd199b..c1fd66876c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.0 + 2.54.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.0 + 2.54.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 058a06caa4..6e226056ba 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.0 + 2.54.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.0 + 2.54.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 534e91a49e..06865dbbcc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.0 + 2.54.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.0 + 2.54.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1860907149..ba8100b358 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.0 + 2.54.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index f0fee808c1..38c5d02e9e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.0:2.54.0 \ No newline at end of file +google-cloud-bigquery:2.54.0:2.54.1-SNAPSHOT \ No newline at end of file From ecfabc4b70922d0e697699ec5508a7328cadacf8 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Tue, 12 Aug 2025 11:00:17 -0400 Subject: [PATCH 2158/2268] fix: adapt graalvm config to arrow update (#3928) * fix: adapt graalvm config to arrow update Fixes https://github.com/googleapis/java-bigquery/issues/3926 * fix: use right branch * chore: include pom changes from debug branch, add more configs --- google-cloud-bigquery/pom.xml | 33 +-------- .../google-cloud-bigquery/reflect-config.json | 67 ++++++++++++++++++- .../resource-config.json | 26 ++++++- 3 files changed, 90 insertions(+), 36 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6e226056ba..37acecdeb1 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -15,7 +15,6 @@ google-cloud-bigquery - 4.1.119.Final @@ -117,37 +116,6 @@ org.apache.arrow arrow-memory-netty - - - - io.netty - netty-common - - - io.netty - netty-buffer - - - runtime - - - - io.netty - netty-common - ${netty.version} - runtime - - - io.netty - netty-buffer - ${netty.version} - runtime @@ -290,6 +258,7 @@ true -J--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + -J--add-opens=java.base/java.nio=java-base,ALL-UNNAMED diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json index 8f6d928da4..921440df69 100644 --- a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/reflect-config.json @@ -29,9 +29,62 @@ "name":"java.nio.DirectByteBuffer", "methods":[{"name":"","parameterTypes":["long","int"] }] }, + + { + "name":"org.apache.arrow.memory.BaseAllocator", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.BaseAllocator$Config", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.DefaultAllocationManagerOption", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.netty.NettyAllocationManager$1", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.netty.DefaultAllocationManagerFactory", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.DefaultAllocationManagerFactory", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, + { + "name":"org.apache.arrow.memory.RootAllocator", + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true + }, { "name":"org.apache.arrow.memory.DefaultAllocationManagerFactory", - "fields":[{"name":"FACTORY"}] + "allDeclaredFields":true, + "queryAllDeclaredFields":true, + "queryAllDeclaredMethods":true, + "queryAllDeclaredConstructors":true }, { "name":"org.apache.arrow.vector.types.pojo.ArrowType", @@ -50,6 +103,18 @@ "allDeclaredFields":true, "queryAllDeclaredMethods":true }, + { + "name": "org.apache.arrow.vector.types.pojo.DictionaryEncoding", + "allDeclaredFields": true + }, + { + "name": "org.apache.arrow.vector.types.pojo.Field", + "allDeclaredFields": true + }, + { + "name": "org.apache.arrow.vector.types.pojo.Schema", + "allDeclaredFields": true + }, { "name":"io.netty.buffer.AbstractReferenceCountedByteBuf", "fields":[{"name":"refCnt"}] diff --git a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json index dfdcc58c44..c4710244e2 100644 --- a/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json +++ b/google-cloud-bigquery/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigquery/resource-config.json @@ -1,6 +1,26 @@ { "resources":{ - "includes":[{ - "pattern":"\\Qorg/apache/arrow/memory/DefaultAllocationManagerFactory.class\\E" - }]} + "includes":[ + { + "pattern":"\\Qorg/apache/arrow/memory/DefaultAllocationManagerFactory.class\\E" + }, + { + "pattern":"\\Qorg/apache/arrow/memory/netty/DefaultAllocationManagerFactory.class\\E" + }, + { + "pattern":"\\Qorg/apache/arrow/memory/unsafe/DefaultAllocationManagerFactory.class\\E" + } + ] + }, + "globs":[ + { + "glob": "org/apache/arrow/memory/DefaultAllocationManagerFactory.class" + }, + { + "glob": "org/apache/arrow/memory/netty/DefaultAllocationManagerFactory.class" + }, + { + "glob": "org/apache/arrow/memory/unsafe/DefaultAllocationManagerFactory.class" + } + ] } \ No newline at end of file From cb66be596d1bfd0a5aed75f5a0e36d80269c7f6a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Aug 2025 21:54:08 +0200 Subject: [PATCH 2159/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.51.0 (#3924) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 6d5c25a0c1..ffcf6b858c 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.50.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.51.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index bfe47cf7d5..cba960973a 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.51.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 603c54174a..7ab09090f2 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.51.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 6b35d89de0..b8251a3f45 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.51.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index bfe47cf7d5..cba960973a 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.51.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 603c54174a..7ab09090f2 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.51.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 6b35d89de0..b8251a3f45 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.50.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.51.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index c1fd66876c..f18650f6cf 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.50.2 + 3.51.0 diff --git a/pom.xml b/pom.xml index 06865dbbcc..bf4f955fd4 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.50.2 + 3.51.0 From a3bd7e62bd305a7f4a76991e9ddd9a1a6847ca83 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 13 Aug 2025 15:55:49 +0200 Subject: [PATCH 2160/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.16.2 (#3927) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bf4f955fd4..d8d122680f 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.16.1 + 3.16.2 pom import From 3fc065905a84c360ded2888ff5878e40a6c5c69c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 11:51:46 -0400 Subject: [PATCH 2161/2268] chore(main): release 2.54.1 (#3929) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 147b9c5893..c0dde06f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.54.1](https://github.com/googleapis/java-bigquery/compare/v2.54.0...v2.54.1) (2025-08-13) + + +### Bug Fixes + +* Adapt graalvm config to arrow update ([#3928](https://github.com/googleapis/java-bigquery/issues/3928)) ([ecfabc4](https://github.com/googleapis/java-bigquery/commit/ecfabc4b70922d0e697699ec5508a7328cadacf8)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.51.0 ([#3924](https://github.com/googleapis/java-bigquery/issues/3924)) ([cb66be5](https://github.com/googleapis/java-bigquery/commit/cb66be596d1bfd0a5aed75f5a0e36d80269c7f6a)) + ## [2.54.0](https://github.com/googleapis/java-bigquery/compare/v2.53.0...v2.54.0) (2025-07-31) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9be2fa48f0..fa01ad010c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.1-SNAPSHOT + 2.54.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index f18650f6cf..069d6dabd7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.1-SNAPSHOT + 2.54.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1-SNAPSHOT + 2.54.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 37acecdeb1..465840c788 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.1-SNAPSHOT + 2.54.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.1-SNAPSHOT + 2.54.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d8d122680f..254aaa6596 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.1-SNAPSHOT + 2.54.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1-SNAPSHOT + 2.54.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index ba8100b358..25cac93085 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1-SNAPSHOT + 2.54.1 diff --git a/versions.txt b/versions.txt index 38c5d02e9e..de9cc8f315 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.0:2.54.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.54.1:2.54.1 \ No newline at end of file From 794bf83e84efc0712638bebde5158777b9c89397 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Aug 2025 19:21:22 +0200 Subject: [PATCH 2162/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.52.0 (#3939) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index ffcf6b858c..47fc0ec712 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.51.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index cba960973a..c6dbbdc522 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 7ab09090f2..6c66c8d835 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index b8251a3f45..2a4f45eaef 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index cba960973a..c6dbbdc522 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 7ab09090f2..6c66c8d835 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index b8251a3f45..2a4f45eaef 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.51.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 069d6dabd7..52ae5ac82a 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.51.0 + 3.52.0 diff --git a/pom.xml b/pom.xml index 254aaa6596..aa95f5a0ff 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.51.0 + 3.52.0 From 672148a9e957ca48cd2c58f3468e1e037a7cf3f3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 13:21:37 -0400 Subject: [PATCH 2163/2268] chore(main): release 2.54.2-SNAPSHOT (#3936) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index fa01ad010c..30f7bc5d67 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.1 + 2.54.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 52ae5ac82a..484f252ab2 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.1 + 2.54.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1 + 2.54.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 465840c788..4d4b915f27 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.1 + 2.54.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.1 + 2.54.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index aa95f5a0ff..df3dcd5974 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.1 + 2.54.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1 + 2.54.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 25cac93085..2bcb0ec49f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.1 + 2.54.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index de9cc8f315..9853ed2570 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.1:2.54.1 \ No newline at end of file +google-cloud-bigquery:2.54.1:2.54.2-SNAPSHOT \ No newline at end of file From 0e3753720e5143124c03e7980f2dbd93fd83a712 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Aug 2025 15:43:42 +0200 Subject: [PATCH 2164/2268] chore(deps): update google cloud java monorepo updates (#3915) --- pom.xml | 4 ++-- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index df3dcd5974..dfeedd974c 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-datacatalog-bom - 1.74.0 + 1.78.0 pom import @@ -143,7 +143,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.70.0 + 2.74.0 test diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 7cd683afd5..cfcf9c503f 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -101,7 +101,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.70.0 + 2.74.0 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2bcb0ec49f..c6fa4062c0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -79,7 +79,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.70.0 + 2.74.0 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d6f779c24a..d6cbcca5d1 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -116,7 +116,7 @@ com.google.cloud google-cloud-bigqueryconnection - 2.70.0 + 2.74.0 test From 1a95417f769866d74ece50cbf3ac073f486d3fec Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 26 Aug 2025 22:29:03 +0200 Subject: [PATCH 2165/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.16.3 (#3943) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dfeedd974c..d7ceac18a3 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.16.2 + 3.16.3 pom import From 7fce4274490de07b440d851c94c6188b30a6dc10 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 22:10:23 -0400 Subject: [PATCH 2166/2268] chore(main): release 2.54.2 (#3940) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0dde06f85..27dae85f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.54.2](https://github.com/googleapis/java-bigquery/compare/v2.54.1...v2.54.2) (2025-08-26) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.0 ([#3939](https://github.com/googleapis/java-bigquery/issues/3939)) ([794bf83](https://github.com/googleapis/java-bigquery/commit/794bf83e84efc0712638bebde5158777b9c89397)) + ## [2.54.1](https://github.com/googleapis/java-bigquery/compare/v2.54.0...v2.54.1) (2025-08-13) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 30f7bc5d67..ac28abddf6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.2-SNAPSHOT + 2.54.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 484f252ab2..cabb84cb3f 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.2-SNAPSHOT + 2.54.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2-SNAPSHOT + 2.54.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4d4b915f27..db8db1ad71 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.2-SNAPSHOT + 2.54.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.2-SNAPSHOT + 2.54.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d7ceac18a3..06fa45550b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.2-SNAPSHOT + 2.54.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2-SNAPSHOT + 2.54.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c6fa4062c0..2290d681e5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2-SNAPSHOT + 2.54.2 diff --git a/versions.txt b/versions.txt index 9853ed2570..e5014dcc5c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.1:2.54.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.54.2:2.54.2 \ No newline at end of file From de0914ddbccf988294d50faf56a515e58ab3505d Mon Sep 17 00:00:00 2001 From: Liam Huffman <44932470+whuffman36@users.noreply.github.com> Date: Fri, 29 Aug 2025 09:40:30 -0700 Subject: [PATCH 2167/2268] feat(bigquery): Add custom ExceptionHandler to BigQueryOptions (#3937) * feat(bigquery): Add custom ExceptionHandler to BigQueryOptions * add default project id to tests * Add dummy project id to tests * Remove defaultInstance() from test * add option to specify retry algo instead of just abortOn/retryOn * fix formatting * remove custom exception handler from bq options --- .../cloud/bigquery/BigQueryBaseService.java | 2 +- .../google/cloud/bigquery/BigQueryImpl.java | 62 ++++++------- .../cloud/bigquery/BigQueryOptions.java | 17 ++++ .../google/cloud/bigquery/ConnectionImpl.java | 12 +-- .../cloud/bigquery/TableDataWriteChannel.java | 4 +- .../cloud/bigquery/BigQueryExceptionTest.java | 91 +++++++++++++++++++ 6 files changed, 148 insertions(+), 40 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java index 9760158735..bdcefb3d96 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryBaseService.java @@ -26,7 +26,7 @@ protected BigQueryBaseService(ServiceOptions options) { super(options); } - public static final ExceptionHandler BIGQUERY_EXCEPTION_HANDLER = + public static final ExceptionHandler DEFAULT_BIGQUERY_EXCEPTION_HANDLER = ExceptionHandler.newBuilder() .abortOn(RuntimeException.class) .retryOn(java.net.ConnectException.class) // retry on Connection Exception diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index a32a600c3f..088d15c09c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -293,7 +293,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -340,7 +340,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -396,7 +396,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -490,7 +490,7 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { ? RetryOption.mergeToSettings( getOptions().getRetrySettings(), getRetryOptions(optionsMap)) : getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), getBigQueryRetryConfig(optionsMap) != null ? getBigQueryRetryConfig(optionsMap) @@ -586,7 +586,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -652,7 +652,7 @@ private static Page listDatasets( } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -704,7 +704,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -755,7 +755,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -801,7 +801,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -847,7 +847,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -891,7 +891,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -932,7 +932,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -979,7 +979,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1025,7 +1025,7 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1071,7 +1071,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1125,7 +1125,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1184,7 +1184,7 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1243,7 +1243,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1461,7 +1461,7 @@ public Tuple> cal } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -1502,7 +1502,7 @@ public Tuple> cal } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -1543,7 +1543,7 @@ private static Page listRoutines( } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -1625,7 +1625,7 @@ public TableDataInsertAllResponse call() throws Exception { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1719,7 +1719,7 @@ public TableDataList call() throws IOException { } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -1793,7 +1793,7 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1850,7 +1850,7 @@ public Tuple> call( } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), EMPTY_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -1905,7 +1905,7 @@ public Boolean call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -1992,7 +1992,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), DEFAULT_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -2169,7 +2169,7 @@ public GetQueryResultsResponse call() throws IOException { } }, serviceOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + serviceOptions.getResultRetryAlgorithm(), serviceOptions.getClock(), DEFAULT_RETRY_CONFIG, serviceOptions.isOpenTelemetryTracingEnabled(), @@ -2240,7 +2240,7 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -2286,7 +2286,7 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -2334,7 +2334,7 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 36eeb20869..7adb58d3a2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import com.google.api.core.BetaApi; +import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.cloud.ServiceDefaults; import com.google.cloud.ServiceOptions; import com.google.cloud.ServiceRpc; @@ -43,6 +44,7 @@ public class BigQueryOptions extends ServiceOptions { private JobCreationMode defaultJobCreationMode = JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED; private boolean enableOpenTelemetryTracing; private Tracer openTelemetryTracer; + private ResultRetryAlgorithm resultRetryAlgorithm; public static class DefaultBigQueryFactory implements BigQueryFactory { @@ -70,6 +72,7 @@ public static class Builder extends ServiceOptions.Builder resultRetryAlgorithm; private Builder() {} @@ -118,6 +121,11 @@ public Builder setOpenTelemetryTracer(Tracer tracer) { return this; } + public Builder setResultRetryAlgorithm(ResultRetryAlgorithm resultRetryAlgorithm) { + this.resultRetryAlgorithm = resultRetryAlgorithm; + return this; + } + @Override public BigQueryOptions build() { return new BigQueryOptions(this); @@ -130,6 +138,11 @@ private BigQueryOptions(Builder builder) { this.useInt64Timestamps = builder.useInt64Timestamps; this.enableOpenTelemetryTracing = builder.enableOpenTelemetryTracing; this.openTelemetryTracer = builder.openTelemetryTracer; + if (builder.resultRetryAlgorithm != null) { + this.resultRetryAlgorithm = builder.resultRetryAlgorithm; + } else { + this.resultRetryAlgorithm = BigQueryBaseService.DEFAULT_BIGQUERY_EXCEPTION_HANDLER; + } } private static class BigQueryDefaults implements ServiceDefaults { @@ -221,6 +234,10 @@ public Tracer getOpenTelemetryTracer() { return openTelemetryTracer; } + public ResultRetryAlgorithm getResultRetryAlgorithm() { + return resultRetryAlgorithm; + } + @SuppressWarnings("unchecked") @Override public Builder toBuilder() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index b12ad85564..c3465c33a8 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -474,7 +474,7 @@ private BigQueryResult queryRpc( .getBigQueryRpcV2() .queryRpcSkipExceptionTranslation(projectId, queryRequest), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), retryConfig, false, @@ -932,7 +932,7 @@ private Job getQueryJobRpc(JobId jobId) { completeJobId.getJob(), completeJobId.getLocation()), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), EMPTY_RETRY_CONFIG, false, @@ -979,7 +979,7 @@ TableDataList tableDataListRpc(TableId destinationTable, String pageToken) { connectionSettings.getMaxResultPerPage(), pageToken), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), EMPTY_RETRY_CONFIG, false, @@ -1212,7 +1212,7 @@ GetQueryResultsResponse getQueryResultsFirstPage(JobId jobId) { connectionSettings.getMaxResultPerPage(), timeoutMs), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), retryConfig, false, @@ -1477,7 +1477,7 @@ com.google.api.services.bigquery.model.Job createQueryJob( .getBigQueryRpcV2() .createJobForQuerySkipExceptionTranslation(jobPb), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), retryConfig, false, @@ -1522,7 +1522,7 @@ com.google.api.services.bigquery.model.Job createDryRunJob(String sql) { .getBigQueryRpcV2() .createJobForQuerySkipExceptionTranslation(jobPb), bigQueryOptions.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + bigQueryOptions.getResultRetryAlgorithm(), bigQueryOptions.getClock(), retryConfig, false, diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java index cc64ec72f5..dde4c08187 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableDataWriteChannel.java @@ -77,7 +77,7 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { } }, getOptions().getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + getOptions().getResultRetryAlgorithm(), getOptions().getClock(), EMPTY_RETRY_CONFIG, getOptions().isOpenTelemetryTracingEnabled(), @@ -126,7 +126,7 @@ public String call() throws IOException { } }, options.getRetrySettings(), - BigQueryBaseService.BIGQUERY_EXCEPTION_HANDLER, + options.getResultRetryAlgorithm(), options.getClock(), EMPTY_RETRY_CONFIG, options.isOpenTelemetryTracingEnabled(), diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java index 41915e2834..8a2094b558 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java @@ -21,7 +21,10 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -29,9 +32,14 @@ import com.google.api.client.http.HttpHeaders; import com.google.api.client.http.HttpResponseException; import com.google.cloud.BaseServiceException; +import com.google.cloud.ExceptionHandler; import com.google.cloud.RetryHelper.RetryHelperException; +import com.google.cloud.bigquery.spi.v2.BigQueryRpc; +import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import java.io.IOException; import java.net.SocketTimeoutException; +import java.util.HashMap; +import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; @@ -158,4 +166,87 @@ public void testTranslateAndThrow() throws Exception { verify(exceptionMock, times(2)).getCause(); } } + + @Test + public void testDefaultExceptionHandler() throws java.io.IOException { + BigQueryOptions defaultOptions = + BigQueryOptions.newBuilder().setProjectId("project-id").build(); + DatasetInfo info = DatasetInfo.newBuilder("dataset").build(); + Dataset dataset = null; + + final com.google.api.services.bigquery.model.Dataset datasetPb = + info.setProjectId(defaultOptions.getProjectId()).toPb(); + final Map optionsMap = new HashMap<>(); + + BigQueryOptions mockOptions = spy(defaultOptions); + HttpBigQueryRpc bigQueryRpcMock = mock(HttpBigQueryRpc.class); + doReturn(bigQueryRpcMock).when(mockOptions).getBigQueryRpcV2(); + // java.net.SocketException is retry-able in the default exception handler. + doThrow(java.net.SocketException.class) + .when(bigQueryRpcMock) + .createSkipExceptionTranslation(datasetPb, optionsMap); + + BigQuery bigquery = mockOptions.getService(); + try { + dataset = bigquery.create(info); + } catch (BigQueryException e) { + assertEquals(e.getCause().getClass(), java.net.SocketException.class); + assertNull(dataset); + } finally { + verify(bigQueryRpcMock, times(6)).createSkipExceptionTranslation(datasetPb, optionsMap); + } + } + + @Test + public void testCustomExceptionHandler() throws java.io.IOException { + BigQueryOptions defaultOptions = + BigQueryOptions.newBuilder() + .setProjectId("project-id") + .setResultRetryAlgorithm( + ExceptionHandler.newBuilder() + .abortOn(RuntimeException.class) + .retryOn(java.util.EmptyStackException.class) + .addInterceptors(BigQueryBaseService.EXCEPTION_HANDLER_INTERCEPTOR) + .build()) + .build(); + DatasetInfo info = DatasetInfo.newBuilder("dataset").build(); + Dataset dataset = null; + + final com.google.api.services.bigquery.model.Dataset datasetPb = + info.setProjectId(defaultOptions.getProjectId()).toPb(); + final Map optionsMap = new HashMap<>(); + + BigQueryOptions mockOptions = spy(defaultOptions); + HttpBigQueryRpc bigQueryRpcRetryMock = mock(HttpBigQueryRpc.class); + doReturn(bigQueryRpcRetryMock).when(mockOptions).getBigQueryRpcV2(); + doThrow(java.util.EmptyStackException.class) + .when(bigQueryRpcRetryMock) + .createSkipExceptionTranslation(datasetPb, optionsMap); + + BigQuery bigquery = mockOptions.getService(); + try { + dataset = bigquery.create(info); + } catch (BigQueryException e) { + assertEquals(e.getCause().getClass(), java.util.EmptyStackException.class); + assertNull(dataset); + } finally { + verify(bigQueryRpcRetryMock, times(6)).createSkipExceptionTranslation(datasetPb, optionsMap); + } + + BigQueryOptions mockOptionsAbort = spy(defaultOptions); + HttpBigQueryRpc bigQueryRpcAbortMock = mock(HttpBigQueryRpc.class); + doReturn(bigQueryRpcAbortMock).when(mockOptionsAbort).getBigQueryRpcV2(); + doThrow(RuntimeException.class) + .when(bigQueryRpcAbortMock) + .createSkipExceptionTranslation(datasetPb, optionsMap); + bigquery = mockOptionsAbort.getService(); + try { + dataset = bigquery.create(info); + } catch (BigQueryException e) { + assertEquals(e.getCause().getClass(), RuntimeException.class); + assertNull(dataset); + } finally { + verify(bigQueryRpcAbortMock, times(1)).createSkipExceptionTranslation(datasetPb, optionsMap); + } + } } From 93bf58239f2a12438ba26c7ea9994093cd8879fc Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 09:57:44 -0400 Subject: [PATCH 2168/2268] chore(main): release 2.54.3-SNAPSHOT (#3944) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index ac28abddf6..9d6c1a3c52 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.2 + 2.54.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index cabb84cb3f..b25fdd32f7 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.2 + 2.54.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2 + 2.54.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index db8db1ad71..f9ed181959 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.2 + 2.54.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.2 + 2.54.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 06fa45550b..eaf574eb59 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.2 + 2.54.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2 + 2.54.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2290d681e5..575118ca8d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.2 + 2.54.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index e5014dcc5c..0dd584253f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.2:2.54.2 \ No newline at end of file +google-cloud-bigquery:2.54.2:2.54.3-SNAPSHOT \ No newline at end of file From 79b7557501d318fd92b90a681036fe6a1aa1bac4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 10 Sep 2025 19:14:36 +0200 Subject: [PATCH 2169/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.52.1 (#3952) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 47fc0ec712..161d8328df 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index c6dbbdc522..849d5dcf13 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 6c66c8d835..c6bb73143f 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 2a4f45eaef..62182e63f1 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index c6dbbdc522..849d5dcf13 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 6c66c8d835..c6bb73143f 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 2a4f45eaef..62182e63f1 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index b25fdd32f7..5440a711cb 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.52.0 + 3.52.1 diff --git a/pom.xml b/pom.xml index eaf574eb59..001e7d36ca 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.52.0 + 3.52.1 From e73deed9c68a45023d02b40144c304329d6b5829 Mon Sep 17 00:00:00 2001 From: Blake Li Date: Fri, 12 Sep 2025 12:43:55 -0400 Subject: [PATCH 2170/2268] deps: update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.17.0 (#3954) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 001e7d36ca..cdc4d3a020 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.16.3 + 3.17.0 pom import From 3f84e7353d3095d7830176c4d10422c08bcb2bbf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:00:26 -0400 Subject: [PATCH 2171/2268] chore(main): release 2.55.0 (#3947) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27dae85f7c..be6007f631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.55.0](https://github.com/googleapis/java-bigquery/compare/v2.54.2...v2.55.0) (2025-09-12) + + +### Features + +* **bigquery:** Add custom ExceptionHandler to BigQueryOptions ([#3937](https://github.com/googleapis/java-bigquery/issues/3937)) ([de0914d](https://github.com/googleapis/java-bigquery/commit/de0914ddbccf988294d50faf56a515e58ab3505d)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.17.0 ([#3954](https://github.com/googleapis/java-bigquery/issues/3954)) ([e73deed](https://github.com/googleapis/java-bigquery/commit/e73deed9c68a45023d02b40144c304329d6b5829)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.1 ([#3952](https://github.com/googleapis/java-bigquery/issues/3952)) ([79b7557](https://github.com/googleapis/java-bigquery/commit/79b7557501d318fd92b90a681036fe6a1aa1bac4)) + ## [2.54.2](https://github.com/googleapis/java-bigquery/compare/v2.54.1...v2.54.2) (2025-08-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9d6c1a3c52..688debd416 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.54.3-SNAPSHOT + 2.55.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 5440a711cb..be30269f71 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.54.3-SNAPSHOT + 2.55.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.54.3-SNAPSHOT + 2.55.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index f9ed181959..2cae0f6f11 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.54.3-SNAPSHOT + 2.55.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.54.3-SNAPSHOT + 2.55.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index cdc4d3a020..291ac9fd93 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.54.3-SNAPSHOT + 2.55.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.54.3-SNAPSHOT + 2.55.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 575118ca8d..c0e58826be 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.54.3-SNAPSHOT + 2.55.0 diff --git a/versions.txt b/versions.txt index 0dd584253f..73eeb870a4 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.54.2:2.54.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.55.0:2.55.0 \ No newline at end of file From a8caf960d3fcba8a8b093d69a48332ed8a1e3a08 Mon Sep 17 00:00:00 2001 From: Blake Li Date: Mon, 15 Sep 2025 17:20:26 -0400 Subject: [PATCH 2172/2268] chore: Ignore PR limites in renovate.json (#3956) --- renovate.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index aacfaebeb3..38fdb78ebd 100644 --- a/renovate.json +++ b/renovate.json @@ -111,5 +111,7 @@ "dependencyDashboard": true, "dependencyDashboardLabels": [ "type: process" - ] + ], + "prConcurrentLimit": 0, + "prHourlyLimit": 0 } From 6775fce537df9c5f4d0b1488ce28591f6aed195f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Sep 2025 02:09:25 +0200 Subject: [PATCH 2173/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.52.2 (#3964) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 161d8328df..5e6914bfe6 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.2 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 849d5dcf13..b77ccd7d98 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index c6bb73143f..b27ef2439d 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 62182e63f1..825dc4b21e 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 849d5dcf13..b77ccd7d98 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index c6bb73143f..b27ef2439d 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 62182e63f1..825dc4b21e 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.2" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index be30269f71..de70b789f5 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.52.1 + 3.52.2 diff --git a/pom.xml b/pom.xml index 291ac9fd93..3f76af9d5c 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.52.1 + 3.52.2 From c1785005efd6324231d963510c4c61382ef14aef Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 26 Sep 2025 03:36:01 +0200 Subject: [PATCH 2174/2268] Merge pull request #3967 from googleapis/java-bigquery Squash and merge --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3f76af9d5c..76cfa9cce9 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.17.0 + 3.17.1 pom import From 225bc96dd8b86793e5a073723cf0dbc998bf1fec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 25 Sep 2025 22:36:57 -0400 Subject: [PATCH 2175/2268] Merge pull request #3955 from googleapis/java-bigquery Squash and merge --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 688debd416..224335c0c1 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.0 + 2.55.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index de70b789f5..b94ef42804 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.0 + 2.55.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.0 + 2.55.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 2cae0f6f11..78b1d49197 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.0 + 2.55.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.0 + 2.55.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 76cfa9cce9..8cc13da1fd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.0 + 2.55.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.0 + 2.55.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c0e58826be..2c076dbec8 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.0 + 2.55.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 73eeb870a4..9e831ffd4b 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.0:2.55.0 \ No newline at end of file +google-cloud-bigquery:2.55.0:2.55.1-SNAPSHOT \ No newline at end of file From b72bb4b7bffb44693394cbb49cdcb4dea7773144 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 07:27:47 -0400 Subject: [PATCH 2176/2268] Merge pull request #3968 from googleapis/java-bigquery Squash and merge --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be6007f631..a89a121d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.55.1](https://github.com/googleapis/java-bigquery/compare/v2.55.0...v2.55.1) (2025-09-26) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.2 ([#3964](https://github.com/googleapis/java-bigquery/issues/3964)) ([6775fce](https://github.com/googleapis/java-bigquery/commit/6775fce537df9c5f4d0b1488ce28591f6aed195f)) + ## [2.55.0](https://github.com/googleapis/java-bigquery/compare/v2.54.2...v2.55.0) (2025-09-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 224335c0c1..5f564e3358 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.1-SNAPSHOT + 2.55.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index b94ef42804..e707100e6e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.1-SNAPSHOT + 2.55.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1-SNAPSHOT + 2.55.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 78b1d49197..193a0ab858 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.1-SNAPSHOT + 2.55.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.1-SNAPSHOT + 2.55.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 8cc13da1fd..9c194830b4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.1-SNAPSHOT + 2.55.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1-SNAPSHOT + 2.55.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 2c076dbec8..1df7e3800b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1-SNAPSHOT + 2.55.1 diff --git a/versions.txt b/versions.txt index 9e831ffd4b..37c9b2f6d5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.0:2.55.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.55.1:2.55.1 \ No newline at end of file From f8cf50833772412c4f15922bffcdf5100792948d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Oct 2025 03:08:47 +0100 Subject: [PATCH 2177/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.52.3 (#3971) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 5e6914bfe6..b0731ee44f 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.3 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index b77ccd7d98..5e895250b4 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.3" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index b27ef2439d..c8dca96a40 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.3" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 825dc4b21e..f431732875 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.3" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index b77ccd7d98..5e895250b4 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.3" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index b27ef2439d..c8dca96a40 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.3" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 825dc4b21e..f431732875 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.3" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e707100e6e..525f4094d0 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.52.2 + 3.52.3 diff --git a/pom.xml b/pom.xml index 9c194830b4..1e2a046fe3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.52.2 + 3.52.3 From 8225bd049999e0dca040009b940287f0c17893d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 08:25:22 -0400 Subject: [PATCH 2178/2268] chore(main): release 2.55.2-SNAPSHOT (#3969) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 5f564e3358..747f227a47 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.1 + 2.55.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 525f4094d0..2363d0065c 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.1 + 2.55.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1 + 2.55.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 193a0ab858..db004077fc 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.1 + 2.55.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.1 + 2.55.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 1e2a046fe3..26375de158 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.1 + 2.55.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1 + 2.55.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 1df7e3800b..b6f208a923 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.1 + 2.55.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 37c9b2f6d5..a2a425b49d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.1:2.55.1 \ No newline at end of file +google-cloud-bigquery:2.55.1:2.55.2-SNAPSHOT \ No newline at end of file From b25095d23279dab178975c33f4de84612612e175 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 8 Oct 2025 15:18:19 +0100 Subject: [PATCH 2179/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.17.2 (#3975) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 26375de158..2efc718e7f 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.17.1 + 3.17.2 pom import From 3a2cb7f07bd5255767035c2d80439b2d27352f36 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:37:13 -0400 Subject: [PATCH 2180/2268] chore(main): release 2.55.2 (#3977) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 8 ++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a89a121d5e..16a1061e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.55.2](https://github.com/googleapis/java-bigquery/compare/v2.55.1...v2.55.2) (2025-10-08) + + +### Dependencies + +* Fix update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.17.2 ([b25095d](https://github.com/googleapis/java-bigquery/commit/b25095d23279dab178975c33f4de84612612e175)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.3 ([#3971](https://github.com/googleapis/java-bigquery/issues/3971)) ([f8cf508](https://github.com/googleapis/java-bigquery/commit/f8cf50833772412c4f15922bffcdf5100792948d)) + ## [2.55.1](https://github.com/googleapis/java-bigquery/compare/v2.55.0...v2.55.1) (2025-09-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 747f227a47..1c3de27fa0 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.2-SNAPSHOT + 2.55.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 2363d0065c..d7fdd7caa9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.2-SNAPSHOT + 2.55.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2-SNAPSHOT + 2.55.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index db004077fc..9008962214 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.2-SNAPSHOT + 2.55.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.2-SNAPSHOT + 2.55.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2efc718e7f..c40c67a767 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.2-SNAPSHOT + 2.55.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2-SNAPSHOT + 2.55.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index b6f208a923..9c87c6a685 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2-SNAPSHOT + 2.55.2 diff --git a/versions.txt b/versions.txt index a2a425b49d..e3100ad155 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.1:2.55.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.55.2:2.55.2 \ No newline at end of file From 798aa962f3b2a7b4141d96ee448afad55d77b0bc Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Mon, 13 Oct 2025 14:09:39 -0400 Subject: [PATCH 2181/2268] chore: add JDK 25 to the CI (#3974) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4dd9974f26..b9b8be0c36 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [11, 17, 21] + java: [11, 17, 21, 25] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 From a961247e9546a9fce8da1609afd18975142c2379 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Oct 2025 15:03:22 +0100 Subject: [PATCH 2182/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.53.0 (#3980) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index b0731ee44f..252a223961 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.52.3 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.53.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 5e895250b4..dff3d3e36b 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.53.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index c8dca96a40..95870eaa35 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.53.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index f431732875..ca49f7431a 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.53.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 5e895250b4..dff3d3e36b 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.53.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index c8dca96a40..95870eaa35 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.53.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index f431732875..ca49f7431a 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.3" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.53.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index d7fdd7caa9..bbb6c290bd 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.52.3 + 3.53.0 diff --git a/pom.xml b/pom.xml index c40c67a767..8982a98563 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.52.3 + 3.53.0 From b57de19f2c1bf00500b628df827c6e3d2802a104 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 21 Oct 2025 18:12:24 +0100 Subject: [PATCH 2183/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.17.3 (#3983) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8982a98563..afb59975b8 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.17.2 + 3.17.3 pom import From a607b2d0b7213f1f0ad604111964300ad1a919b1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:11:47 -0400 Subject: [PATCH 2184/2268] chore(main): release 2.55.3-SNAPSHOT (#3978) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 1c3de27fa0..30715f9d42 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.2 + 2.55.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index bbb6c290bd..daf2a964bd 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.2 + 2.55.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2 + 2.55.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9008962214..efe5687a45 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.2 + 2.55.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.2 + 2.55.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index afb59975b8..b85ca32622 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.2 + 2.55.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2 + 2.55.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9c87c6a685..30946f7bcd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.2 + 2.55.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index e3100ad155..7c3350056d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.2:2.55.2 \ No newline at end of file +google-cloud-bigquery:2.55.2:2.55.3-SNAPSHOT \ No newline at end of file From 219152bb75cce7bc5b0b958f0cc8d70c0102bf41 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:11:41 -0400 Subject: [PATCH 2185/2268] chore(main): release 2.55.3 (#3984) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a1061e40..c0ca0a69ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.55.3](https://github.com/googleapis/java-bigquery/compare/v2.55.2...v2.55.3) (2025-10-21) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.53.0 ([#3980](https://github.com/googleapis/java-bigquery/issues/3980)) ([a961247](https://github.com/googleapis/java-bigquery/commit/a961247e9546a9fce8da1609afd18975142c2379)) + ## [2.55.2](https://github.com/googleapis/java-bigquery/compare/v2.55.1...v2.55.2) (2025-10-08) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 30715f9d42..065c631f0c 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.3-SNAPSHOT + 2.55.3 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index daf2a964bd..eff9f5c39a 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.3-SNAPSHOT + 2.55.3 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3-SNAPSHOT + 2.55.3 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index efe5687a45..e959667665 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.3-SNAPSHOT + 2.55.3 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.3-SNAPSHOT + 2.55.3 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index b85ca32622..6d45eec431 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.3-SNAPSHOT + 2.55.3 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3-SNAPSHOT + 2.55.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 30946f7bcd..e35b5bafc6 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3-SNAPSHOT + 2.55.3 diff --git a/versions.txt b/versions.txt index 7c3350056d..517df87586 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.2:2.55.3-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.55.3:2.55.3 \ No newline at end of file From c180ecbd6f0dfdbd4d7ad369b6320bcfce7ce99d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 21:16:33 -0400 Subject: [PATCH 2186/2268] chore(main): release 2.55.4-SNAPSHOT (#3985) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 065c631f0c..185be777c7 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.3 + 2.55.4-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index eff9f5c39a..84ccf695e8 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.3 + 2.55.4-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3 + 2.55.4-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index e959667665..cbef4c4ad6 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.3 + 2.55.4-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.3 + 2.55.4-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6d45eec431..59c5a043d1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.3 + 2.55.4-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3 + 2.55.4-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e35b5bafc6..4aa74d41dd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.3 + 2.55.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 517df87586..23bb878617 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.3:2.55.3 \ No newline at end of file +google-cloud-bigquery:2.55.3:2.55.4-SNAPSHOT \ No newline at end of file From 1d8977df3b1451378e5471cce9fd8b067f80fc9a Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 7 Nov 2025 19:42:17 +0000 Subject: [PATCH 2187/2268] deps: update dependency com.google.apis:google-api-services-bigquery to v2-rev20251012-2.0.0 (#3923) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59c5a043d1..43c1f5b1d4 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ UTF-8 github google-cloud-bigquery-parent - v2-rev20250706-2.0.0 + v2-rev20251012-2.0.0 From 9c0df5422c05696f7ce4bedf914a58306150dc21 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Wed, 12 Nov 2025 11:48:37 -0800 Subject: [PATCH 2188/2268] feat: new queryWithTimeout method for customer-side wait (#3995) * feat: new queryNoWait method * Rename method to queryWithTimeout * rename to queryWithTimeout() * lint * lint * add tests * Update clirr ignore --- .../clirr-ignored-differences.xml | 5 ++ .../com/google/cloud/bigquery/BigQuery.java | 22 ++++++ .../google/cloud/bigquery/BigQueryImpl.java | 76 ++++++++----------- .../cloud/bigquery/BigQueryImplTest.java | 23 ++++++ .../cloud/bigquery/it/ITBigQueryTest.java | 57 +++++++++++++- 5 files changed, 137 insertions(+), 46 deletions(-) diff --git a/google-cloud-bigquery/clirr-ignored-differences.xml b/google-cloud-bigquery/clirr-ignored-differences.xml index bd455d2d4f..cef0f30f73 100644 --- a/google-cloud-bigquery/clirr-ignored-differences.xml +++ b/google-cloud-bigquery/clirr-ignored-differences.xml @@ -117,6 +117,11 @@ com/google/cloud/bigquery/TableInfo* *ResourceTags(*) + + 7012 + com/google/cloud/bigquery/BigQuery + java.lang.Object queryWithTimeout(com.google.cloud.bigquery.QueryJobConfiguration, com.google.cloud.bigquery.JobId, java.lang.Long, com.google.cloud.bigquery.BigQuery$JobOption[]) + 7012 com/google/cloud/bigquery/Connection diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java index 2e0747f6be..ab16ed40f7 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQuery.java @@ -1609,6 +1609,28 @@ TableResult query(QueryJobConfiguration configuration, JobOption... options) TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... options) throws InterruptedException, JobException; + /** + * Starts the query associated with the request, using the given JobId. It returns either + * TableResult for quick queries or Job object for long-running queries. + * + *

    If the location of the job is not "US" or "EU", the {@code jobId} must specify the job + * location. + * + *

    This method cannot be used in conjunction with {@link QueryJobConfiguration#dryRun()} + * queries. Since dry-run queries are not actually executed, there's no way to retrieve results. + * + *

    See {@link #query(QueryJobConfiguration, JobOption...)} for examples on populating a {@link + * QueryJobConfiguration}. + * + * @throws BigQueryException upon failure + * @throws InterruptedException if the current thread gets interrupted while waiting for the query + * to complete + * @throws JobException if the job completes unsuccessfully + */ + Object queryWithTimeout( + QueryJobConfiguration configuration, JobId jobId, Long timeoutMs, JobOption... options) + throws InterruptedException, JobException; + /** * Returns results of the query associated with the provided job. * diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index 088d15c09c..ac8fce7082 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1925,48 +1925,10 @@ public Boolean call() throws IOException { @Override public TableResult query(QueryJobConfiguration configuration, JobOption... options) throws InterruptedException, JobException { - Job.checkNotDryRun(configuration, "query"); - - configuration = - configuration.toBuilder() - .setJobCreationMode(getOptions().getDefaultJobCreationMode()) - .build(); - - Span querySpan = null; - if (getOptions().isOpenTelemetryTracingEnabled() - && getOptions().getOpenTelemetryTracer() != null) { - querySpan = - getOptions() - .getOpenTelemetryTracer() - .spanBuilder("com.google.cloud.bigquery.BigQuery.query") - .setAllAttributes(otelAttributesFromOptions(options)) - .startSpan(); - } - try (Scope queryScope = querySpan != null ? querySpan.makeCurrent() : null) { - // If all parameters passed in configuration are supported by the query() method on the - // backend, - // put on fast path - QueryRequestInfo requestInfo = - new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); - if (requestInfo.isFastQuerySupported(null)) { - String projectId = getOptions().getProjectId(); - QueryRequest content = requestInfo.toPb(); - if (getOptions().getLocation() != null) { - content.setLocation(getOptions().getLocation()); - } - return queryRpc(projectId, content, options); - } - // Otherwise, fall back to the existing create query job logic - return create(JobInfo.of(configuration), options).getQueryResults(); - } finally { - if (querySpan != null) { - querySpan.end(); - } - } + return query(configuration, null, options); } - private TableResult queryRpc( - final String projectId, final QueryRequest content, JobOption... options) + private Object queryRpc(final String projectId, final QueryRequest content, JobOption... options) throws InterruptedException { com.google.api.services.bigquery.model.QueryResponse results; Span queryRpc = null; @@ -2030,7 +1992,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() // here, but this is left as future work. JobId jobId = JobId.fromPb(results.getJobReference()); Job job = getJob(jobId, options); - return job.getQueryResults(); + return job; } if (results.getPageToken() != null) { @@ -2070,16 +2032,35 @@ public com.google.api.services.bigquery.model.QueryResponse call() @Override public TableResult query(QueryJobConfiguration configuration, JobId jobId, JobOption... options) throws InterruptedException, JobException { + Object result = queryWithTimeout(configuration, jobId, null, options); + if (result instanceof Job) { + return ((Job) result).getQueryResults(); + } + return (TableResult) result; + } + + @Override + public Object queryWithTimeout( + QueryJobConfiguration configuration, JobId jobId, Long timeoutMs, JobOption... options) + throws InterruptedException, JobException { Job.checkNotDryRun(configuration, "query"); + // If JobCreationMode is not explicitly set, update it with default value; + if (configuration.getJobCreationMode() == null) { + configuration = + configuration.toBuilder() + .setJobCreationMode(getOptions().getDefaultJobCreationMode()) + .build(); + } + Span querySpan = null; if (getOptions().isOpenTelemetryTracingEnabled() && getOptions().getOpenTelemetryTracer() != null) { querySpan = getOptions() .getOpenTelemetryTracer() - .spanBuilder("com.google.cloud.bigquery.BigQuery.query") - .setAllAttributes(jobId.getOtelAttributes()) + .spanBuilder("com.google.cloud.bigquery.BigQuery.queryWithTimeout") + .setAllAttributes(jobId != null ? jobId.getOtelAttributes() : null) .setAllAttributes(otelAttributesFromOptions(options)) .startSpan(); } @@ -2095,18 +2076,23 @@ && getOptions().getOpenTelemetryTracer() != null) { // fail with "Access denied" if the project do not have enough permissions to run the job. String projectId = - jobId.getProject() != null ? jobId.getProject() : getOptions().getProjectId(); + jobId != null && jobId.getProject() != null + ? jobId.getProject() + : getOptions().getProjectId(); QueryRequest content = requestInfo.toPb(); // Be careful when setting the location, if a location is specified in the BigQueryOption or // JobId the job created by the query method will be in that location, even if the table to // be // queried is in a different location. This may cause the query to fail with // "BigQueryException: Not found" - if (jobId.getLocation() != null) { + if (jobId != null && jobId.getLocation() != null) { content.setLocation(jobId.getLocation()); } else if (getOptions().getLocation() != null) { content.setLocation(getOptions().getLocation()); } + if (timeoutMs != null) { + content.setTimeoutMs(timeoutMs); + } return queryRpc(projectId, content, options); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index c0367beae4..393455e364 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -2610,6 +2610,29 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) PROJECT, DATASET, TABLE, Collections.emptyMap()); } + @Test + public void testQueryWithTimeoutSetsTimeout() throws InterruptedException, IOException { + com.google.api.services.bigquery.model.QueryResponse queryResponsePb = + new com.google.api.services.bigquery.model.QueryResponse() + .setCacheHit(false) + .setJobComplete(true) + .setKind("bigquery#queryResponse") + .setPageToken(null) + .setRows(ImmutableList.of(TABLE_ROW)) + .setSchema(TABLE_SCHEMA.toPb()) + .setTotalBytesProcessed(42L) + .setTotalRows(BigInteger.valueOf(1L)); + + when(bigqueryRpcMock.queryRpcSkipExceptionTranslation(eq(PROJECT), requestPbCapture.capture())) + .thenReturn(queryResponsePb); + + bigquery = options.getService(); + Object result = bigquery.queryWithTimeout(QUERY_JOB_CONFIGURATION_FOR_QUERY, null, 1000L); + assertTrue(result instanceof TableResult); + QueryRequest requestPb = requestPbCapture.getValue(); + assertEquals((Long) 1000L, requestPb.getTimeoutMs()); + } + @Test public void testGetQueryResults() throws IOException { JobId queryJob = JobId.of(JOB); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index c9f6296cc5..ec1f7b5a09 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -7215,6 +7215,7 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { // 2. For queries that fails the requirements to be stateless, then jobId is populated and // queryId is not. // 3. For explicitly created jobs, then jobId is populated and queryId is not populated. + // 4. If QueryJobConfiguration explicitly sets Job Creation Mode to Required. // Test scenario 1. // Create local BigQuery for test scenario 1 to not contaminate global test parameters. @@ -7241,6 +7242,16 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { result = job.getQueryResults(); assertNotNull(result.getJobId()); assertNull(result.getQueryId()); + + // Test scenario 4. + configWithJob = + QueryJobConfiguration.newBuilder(query) + .setJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED) + .build(); + result = bigQuery.query(configWithJob); + result = job.getQueryResults(); + assertNotNull(result.getJobId()); + assertNull(result.getQueryId()); } @Test @@ -7294,6 +7305,50 @@ public void testStatelessQueriesWithLocation() throws Exception { } } + @Test + public void testQueryWithTimeout() throws InterruptedException { + // Validate that queryWithTimeout returns either TableResult or Job object + + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); + BigQuery bigQuery = bigqueryHelper.getOptions().getService(); + bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); + String largeQuery = + "SELECT * FROM UNNEST(GENERATE_ARRAY(1, 20000)) CROSS JOIN UNNEST(GENERATE_ARRAY(1, 20000))"; + String query = "SELECT 1 as one"; + // Test scenario 1. + // Stateless query returns TableResult + QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); + Object result = bigQuery.queryWithTimeout(config, null, null); + assertTrue(result instanceof TableResult); + assertNull(((TableResult) result).getJobId()); + assertNotNull(((TableResult) result).getQueryId()); + + // Stateful query returns Job + // Test scenario 2 to ensure job is created if JobCreationMode is set, but for a small query + // it still returns results. + config = + QueryJobConfiguration.newBuilder(query) + .setJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED) + .build(); + result = bigQuery.queryWithTimeout(config, null, null); + assertTrue(result instanceof TableResult); + assertNotNull(((TableResult) result).getJobId()); + assertNull(((TableResult) result).getQueryId()); + + // Stateful query returns Job + // Test scenario 3 to ensure job is created if Query is long running. + // Explicitly disable cache to ensure it is long-running query; + config = QueryJobConfiguration.newBuilder(largeQuery).setUseQueryCache(false).build(); + long millis = System.currentTimeMillis(); + result = bigQuery.queryWithTimeout(config, null, 1000L); + millis = System.currentTimeMillis() - millis; + assertTrue(result instanceof Job); + // Cancel the job as we don't need results. + ((Job) result).cancel(); + // Allow 2 seconds of timeout value to account for random delays + assertTrue(millis < 1_000_000 * 2); + } + @Test public void testUniverseDomainWithInvalidUniverseDomain() { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); @@ -7743,7 +7798,7 @@ public void testOpenTelemetryTracingQuery() throws InterruptedException { assertNotNull( OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries")); assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQueryRpc.queryRpc")); - assertTrue(OTEL_ATTRIBUTES.containsKey("com.google.cloud.bigquery.BigQuery.query")); + assertTrue(OTEL_ATTRIBUTES.containsKey("com.google.cloud.bigquery.BigQuery.queryWithTimeout")); // Query job String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); From c9c43517edec7072dd7745be890fd641e44809a1 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Fri, 14 Nov 2025 11:39:06 -0500 Subject: [PATCH 2189/2268] chore: grant write access to @googleapis/cloud-java-team-teamsync (#3999) * chore: grant write access to @googleapis/cloud-java-team-teamsync * Update CODEOWNERS to simplify ownership rules Removed specific ownership for handwritten Java libraries. --- .github/CODEOWNERS | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6aaf5360dd..7892b1d67b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,14 +5,10 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax # The @googleapis/api-bigquery is the default owner for changes in this repo -* @googleapis/yoshi-java @googleapis/api-bigquery - -# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner -**/*.java @googleapis/api-bigquery - +* @googleapis/cloud-java-team-teamsync @googleapis/api-bigquery # The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/java-samples-reviewers +samples/**/*.java @googleapis/cloud-java-team-teamsync @googleapis/java-samples-reviewers # Generated snippets should not be owned by samples reviewers -samples/snippets/generated/ @googleapis/yoshi-java +samples/snippets/generated/ @googleapis/cloud-java-team-teamsync @googleapis/yoshi-java From 4e09f6bc7a25904ad8f61141a0837535d39dbb4e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 14 Nov 2025 16:39:16 +0000 Subject: [PATCH 2190/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.54.1 (#3994) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 252a223961..5ba388acc0 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.53.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index dff3d3e36b..0d98de5094 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 95870eaa35..c270bff717 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index ca49f7431a..720f8bcfaf 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index dff3d3e36b..0d98de5094 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 95870eaa35..c270bff717 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index ca49f7431a..720f8bcfaf 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.53.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 84ccf695e8..f70507c5ea 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.53.0 + 3.54.1 diff --git a/pom.xml b/pom.xml index 43c1f5b1d4..3dc65348af 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.53.0 + 3.54.1 From 4ee8655f84d0d140a729ae2a9e210f47531912c7 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 15 Nov 2025 23:04:10 +0000 Subject: [PATCH 2191/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.18.0 (#3998) Co-authored-by: Diego Marquez --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3dc65348af..3d3582b422 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.17.3 + 3.18.0 pom import From 42091e09c7f59148514bb38f095859cf1dc8c20b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sun, 16 Nov 2025 22:57:17 -0500 Subject: [PATCH 2192/2268] chore(main): release 2.56.0 (#3996) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ca0a69ec..59350c03bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.56.0](https://github.com/googleapis/java-bigquery/compare/v2.55.3...v2.56.0) (2025-11-15) + + +### Features + +* New queryWithTimeout method for customer-side wait ([#3995](https://github.com/googleapis/java-bigquery/issues/3995)) ([9c0df54](https://github.com/googleapis/java-bigquery/commit/9c0df5422c05696f7ce4bedf914a58306150dc21)) + + +### Dependencies + +* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20251012-2.0.0 ([#3923](https://github.com/googleapis/java-bigquery/issues/3923)) ([1d8977d](https://github.com/googleapis/java-bigquery/commit/1d8977df3b1451378e5471cce9fd8b067f80fc9a)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.54.1 ([#3994](https://github.com/googleapis/java-bigquery/issues/3994)) ([4e09f6b](https://github.com/googleapis/java-bigquery/commit/4e09f6bc7a25904ad8f61141a0837535d39dbb4e)) + ## [2.55.3](https://github.com/googleapis/java-bigquery/compare/v2.55.2...v2.55.3) (2025-10-21) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 185be777c7..9f219179fd 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.55.4-SNAPSHOT + 2.56.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index f70507c5ea..2e6d9828bb 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.55.4-SNAPSHOT + 2.56.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.55.4-SNAPSHOT + 2.56.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index cbef4c4ad6..304230dd21 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.55.4-SNAPSHOT + 2.56.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.55.4-SNAPSHOT + 2.56.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 3d3582b422..2169463a6b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.55.4-SNAPSHOT + 2.56.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.55.4-SNAPSHOT + 2.56.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4aa74d41dd..6cabd8bbfc 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.55.4-SNAPSHOT + 2.56.0 diff --git a/versions.txt b/versions.txt index 23bb878617..46c19475b0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.55.3:2.55.4-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.56.0:2.56.0 \ No newline at end of file From c3548a2f521b19761c844c0b24fc8caab541aba7 Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Thu, 20 Nov 2025 15:59:24 -0500 Subject: [PATCH 2193/2268] feat: Relax client-side validation for BigQuery entity IDs (#4000) Removes client-side `checkArgument` and `checkNotNull` validations from the constructors of `TableId`, `DatasetId`, `RoutineId`, `ModelId`, and `ConnectionProperty`. This change makes the client library more robust by preventing crashes when the server sends a response with unexpected null or empty values in these fields. --- .../java/com/google/cloud/bigquery/ConnectionProperty.java | 6 ++---- .../src/main/java/com/google/cloud/bigquery/DatasetId.java | 4 ---- .../src/main/java/com/google/cloud/bigquery/ModelId.java | 2 -- .../src/main/java/com/google/cloud/bigquery/RoutineId.java | 2 -- .../src/main/java/com/google/cloud/bigquery/TableId.java | 2 -- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java index 7abd36b41b..30e0cf0141 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionProperty.java @@ -16,8 +16,6 @@ package com.google.cloud.bigquery; -import static com.google.common.base.Preconditions.checkNotNull; - import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.base.Objects; @@ -82,8 +80,8 @@ public ConnectionProperty build() { } private ConnectionProperty(Builder builder) { - this.key = checkNotNull(builder.key, "Required key is null or empty"); - this.value = checkNotNull(builder.value, "Required value is null or empty"); + this.key = builder.key; + this.value = builder.value; } /** Return the key of property. */ diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java index c06d257d7d..ff42d5d360 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DatasetId.java @@ -16,9 +16,6 @@ package com.google.cloud.bigquery; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Strings.isNullOrEmpty; - import com.google.api.services.bigquery.model.DatasetReference; import io.opentelemetry.api.common.Attributes; import java.io.Serializable; @@ -43,7 +40,6 @@ public String getDataset() { } private DatasetId(String project, String dataset) { - checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty"); this.project = project; this.dataset = dataset; } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java index adb497ffa0..d363ed8359 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ModelId.java @@ -62,8 +62,6 @@ public String getModel() { } private ModelId(String project, String dataset, String model) { - checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty"); - checkArgument(!isNullOrEmpty(model), "Provided model is null or empty"); this.project = project; this.dataset = dataset; this.model = model; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java index a632fc5a1f..957b885da4 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/RoutineId.java @@ -63,8 +63,6 @@ public String getRoutine() { } private RoutineId(String project, String dataset, String routine) { - checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty"); - checkArgument(!isNullOrEmpty(routine), "Provided routine is null or empty"); this.project = project; this.dataset = dataset; this.routine = routine; diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java index fcc208453a..a4177b503d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableId.java @@ -71,8 +71,6 @@ public String getIAMResourceName() { } private TableId(String project, String dataset, String table) { - checkArgument(!isNullOrEmpty(dataset), "Provided dataset is null or empty"); - checkArgument(!isNullOrEmpty(table), "Provided table is null or empty"); this.project = project; this.dataset = dataset; this.table = table; From bc422013a3462de3d42ed7001d75e7698d8276d4 Mon Sep 17 00:00:00 2001 From: Jin Seop Kim Date: Thu, 20 Nov 2025 15:59:36 -0500 Subject: [PATCH 2194/2268] chore: add flakybot.yaml and set priority to p2 (#4004) --- .github/flakybot.yaml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/flakybot.yaml diff --git a/.github/flakybot.yaml b/.github/flakybot.yaml new file mode 100644 index 0000000000..cb83375f98 --- /dev/null +++ b/.github/flakybot.yaml @@ -0,0 +1 @@ +issuePriority: p2 From a942b0755341bfbf4d2be2ea6fbdc3b85fb00285 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 4 Dec 2025 16:46:40 -0500 Subject: [PATCH 2195/2268] chore: add release-please config for protobuf-4.x (#4009) * chore: add release-please config for protobuf-4.x * Change release type from java-lts to java-yoshi --- .github/release-please.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/release-please.yml b/.github/release-please.yml index f87ac1ecca..e78d84de07 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -39,6 +39,11 @@ branches: handleGHRelease: true releaseType: java-backport branch: 2.51.x + - branch: protobuf-4.x-rc + bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + manifest: true bumpMinorPreMajor: true handleGHRelease: true releaseType: java-yoshi From 6dcc90053353422ae766e531413b3ecc65b8b155 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 8 Dec 2025 10:32:02 -0500 Subject: [PATCH 2196/2268] feat: Introduce DataFormatOptions to configure the output of BigQuery data types (#4010) * feat: Create DataFormatOptions in BigQuery * feat: Add Builder class for DataFormatOptions * fix: Update existing references of useInt64Timestamp to use DataFormatOption's variant * chore: Fix lint issues * chore: Address PR feedback * chore: Add tests for useInt64Timestamp behavior * chore: Address failing tests and GCA * chore: Remove unused fromPb method --- .../google/cloud/bigquery/BigQueryImpl.java | 18 +++-- .../cloud/bigquery/BigQueryOptions.java | 65 ++++++++++++++++- .../cloud/bigquery/DataFormatOptions.java | 73 +++++++++++++++++++ .../cloud/bigquery/QueryRequestInfo.java | 5 +- .../cloud/bigquery/BigQueryOptionsTest.java | 56 ++++++++++++++ .../cloud/bigquery/QueryRequestInfoTest.java | 22 ++++-- .../cloud/bigquery/it/ITBigQueryTest.java | 8 +- 7 files changed, 230 insertions(+), 17 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DataFormatOptions.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index ac8fce7082..c057cdaca6 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -1731,7 +1731,10 @@ public TableDataList call() throws IOException { new PageImpl<>( new TableDataPageFetcher(tableId, schema, serviceOptions, cursor, pageOptionMap), cursor, - transformTableData(result.getRows(), schema, serviceOptions.getUseInt64Timestamps())), + transformTableData( + result.getRows(), + schema, + serviceOptions.getDataFormatOptions().useInt64Timestamp())), result.getTotalRows()); } catch (BigQueryRetryHelperException e) { throw BigQueryException.translateAndThrow(e); @@ -2007,7 +2010,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() new QueryPageFetcher(jobId, schema, getOptions(), cursor, optionMap(options)), cursor, transformTableData( - results.getRows(), schema, getOptions().getUseInt64Timestamps()))) + results.getRows(), + schema, + getOptions().getDataFormatOptions().useInt64Timestamp()))) .setJobId(jobId) .setQueryId(results.getQueryId()) .build(); @@ -2021,7 +2026,9 @@ public com.google.api.services.bigquery.model.QueryResponse call() new TableDataPageFetcher(null, schema, getOptions(), null, optionMap(options)), null, transformTableData( - results.getRows(), schema, getOptions().getUseInt64Timestamps()))) + results.getRows(), + schema, + getOptions().getDataFormatOptions().useInt64Timestamp()))) // Return the JobID of the successful job .setJobId( results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) @@ -2066,10 +2073,9 @@ && getOptions().getOpenTelemetryTracer() != null) { } try (Scope queryScope = querySpan != null ? querySpan.makeCurrent() : null) { // If all parameters passed in configuration are supported by the query() method on the - // backend, - // put on fast path + // backend, put on fast path QueryRequestInfo requestInfo = - new QueryRequestInfo(configuration, getOptions().getUseInt64Timestamps()); + new QueryRequestInfo(configuration, getOptions().getDataFormatOptions()); if (requestInfo.isFastQuerySupported(jobId)) { // Be careful when setting the projectID in JobId, if a projectID is specified in the JobId, // the job created by the query method will use that project. This may cause the query to diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java index 7adb58d3a2..10ae77930c 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryOptions.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.retrying.ResultRetryAlgorithm; import com.google.cloud.ServiceDefaults; import com.google.cloud.ServiceOptions; @@ -26,6 +27,7 @@ import com.google.cloud.bigquery.spi.BigQueryRpcFactory; import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.cloud.http.HttpTransportOptions; +import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import io.opentelemetry.api.trace.Tracer; import java.util.Set; @@ -41,6 +43,7 @@ public class BigQueryOptions extends ServiceOptions { // set the option ThrowNotFound when you want to throw the exception when the value not found private boolean setThrowNotFound; private boolean useInt64Timestamps; + private DataFormatOptions dataFormatOptions; private JobCreationMode defaultJobCreationMode = JobCreationMode.JOB_CREATION_MODE_UNSPECIFIED; private boolean enableOpenTelemetryTracing; private Tracer openTelemetryTracer; @@ -70,6 +73,7 @@ public static class Builder extends ServiceOptions.Builder resultRetryAlgorithm; @@ -94,11 +98,32 @@ public Builder setLocation(String location) { return this; } + /** + * This setter is marked as Obsolete. Prefer {@link #setDataFormatOptions(DataFormatOptions)} to + * set the int64timestamp configuration instead. + * + *

    If useInt64Timestamps value is set in here and via DataFormatOptions, the + * DataFormatOptions configuration value is used. + * + *

    {@code DataFormatOptions.newBuilder().setUseInt64Timestamp(...).build()} + */ + @ObsoleteApi("Use setDataFormatOptions(DataFormatOptions) instead") public Builder setUseInt64Timestamps(boolean useInt64Timestamps) { this.useInt64Timestamps = useInt64Timestamps; return this; } + /** + * Set the format options for the BigQuery data types + * + * @param dataFormatOptions Configuration of the formatting options + */ + public Builder setDataFormatOptions(DataFormatOptions dataFormatOptions) { + Preconditions.checkNotNull(dataFormatOptions, "DataFormatOptions cannot be null"); + this.dataFormatOptions = dataFormatOptions; + return this; + } + /** * Enables OpenTelemetry tracing functionality for this BigQuery instance * @@ -143,6 +168,15 @@ private BigQueryOptions(Builder builder) { } else { this.resultRetryAlgorithm = BigQueryBaseService.DEFAULT_BIGQUERY_EXCEPTION_HANDLER; } + + // If dataFormatOptions is not set, then create a new instance and set it with the + // useInt64Timestamps configured in BigQueryOptions + if (builder.dataFormatOptions == null) { + this.dataFormatOptions = + DataFormatOptions.newBuilder().useInt64Timestamp(builder.useInt64Timestamps).build(); + } else { + this.dataFormatOptions = builder.dataFormatOptions; + } } private static class BigQueryDefaults implements ServiceDefaults { @@ -191,8 +225,23 @@ public void setThrowNotFound(boolean setThrowNotFound) { this.setThrowNotFound = setThrowNotFound; } + /** + * This setter is marked as Obsolete. Prefer {@link + * Builder#setDataFormatOptions(DataFormatOptions)} to set the int64timestamp configuration + * instead. + * + *

    If useInt64Timestamps is set via DataFormatOptions, then the value in DataFormatOptions will + * be used. Otherwise, this value will be passed to DataFormatOptions. + * + *

    Alternative: {@code DataFormatOptions.newBuilder().setUseInt64Timestamp(...).build()} + */ + @ObsoleteApi("Use Builder#setDataFormatOptions(DataFormatOptions) instead") public void setUseInt64Timestamps(boolean useInt64Timestamps) { this.useInt64Timestamps = useInt64Timestamps; + // Because this setter exists outside the Builder, DataFormatOptions needs be rebuilt to + // account for this setting. + this.dataFormatOptions = + dataFormatOptions.toBuilder().useInt64Timestamp(useInt64Timestamps).build(); } @Deprecated @@ -206,8 +255,22 @@ public boolean getThrowNotFound() { return setThrowNotFound; } + /** + * This getter is marked as Obsolete. Prefer {@link + * DataFormatOptions.Builder#useInt64Timestamp(boolean)} to set the int64timestamp configuration + * instead. + * + *

    Warning: DataFormatOptions values have precedence. Use {@link + * DataFormatOptions#useInt64Timestamp()} to get `useInt64Timestamp` value used by the BigQuery + * client. + */ + @ObsoleteApi("Use getDataFormatOptions().isUseInt64Timestamp() instead") public boolean getUseInt64Timestamps() { - return useInt64Timestamps; + return dataFormatOptions.useInt64Timestamp(); + } + + public DataFormatOptions getDataFormatOptions() { + return dataFormatOptions; } public JobCreationMode getDefaultJobCreationMode() { diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DataFormatOptions.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DataFormatOptions.java new file mode 100644 index 0000000000..beaadf32cf --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/DataFormatOptions.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import com.google.auto.value.AutoValue; +import java.io.Serializable; + +/** + * Google BigQuery DataFormatOptions. Configures the output format for data types returned from + * BigQuery. + */ +@AutoValue +public abstract class DataFormatOptions implements Serializable { + public enum TimestampFormatOptions { + TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED("TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED"), + FLOAT64("FLOAT64"), + INT64("INT64"), + ISO8601_STRING("ISO8601_STRING"); + + private final String format; + + TimestampFormatOptions(String format) { + this.format = format; + } + + @Override + public String toString() { + return format; + } + } + + public abstract boolean useInt64Timestamp(); + + public abstract TimestampFormatOptions timestampFormatOptions(); + + public static Builder newBuilder() { + return new AutoValue_DataFormatOptions.Builder() + .useInt64Timestamp(false) + .timestampFormatOptions(TimestampFormatOptions.TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED); + } + + public abstract Builder toBuilder(); + + @AutoValue.Builder + public abstract static class Builder { + public abstract Builder useInt64Timestamp(boolean useInt64Timestamp); + + public abstract Builder timestampFormatOptions(TimestampFormatOptions timestampFormatOptions); + + public abstract DataFormatOptions build(); + } + + com.google.api.services.bigquery.model.DataFormatOptions toPb() { + com.google.api.services.bigquery.model.DataFormatOptions request = + new com.google.api.services.bigquery.model.DataFormatOptions(); + request.setUseInt64Timestamp(useInt64Timestamp()); + request.setTimestampOutputFormat(timestampFormatOptions().toString()); + return request; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java index 588b7cae8c..c7033817c3 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryRequestInfo.java @@ -46,7 +46,8 @@ final class QueryRequestInfo { private final DataFormatOptions formatOptions; private final String reservation; - QueryRequestInfo(QueryJobConfiguration config, Boolean useInt64Timestamps) { + QueryRequestInfo( + QueryJobConfiguration config, com.google.cloud.bigquery.DataFormatOptions dataFormatOptions) { this.config = config; this.connectionProperties = config.getConnectionProperties(); this.defaultDataset = config.getDefaultDataset(); @@ -61,7 +62,7 @@ final class QueryRequestInfo { this.useLegacySql = config.useLegacySql(); this.useQueryCache = config.useQueryCache(); this.jobCreationMode = config.getJobCreationMode(); - this.formatOptions = new DataFormatOptions().setUseInt64Timestamp(useInt64Timestamps); + this.formatOptions = dataFormatOptions.toPb(); this.reservation = config.getReservation(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java index 4176ec24dc..e77d7936a4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java @@ -16,6 +16,11 @@ package com.google.cloud.bigquery; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import com.google.cloud.TransportOptions; import org.junit.Assert; import org.junit.Test; @@ -35,4 +40,55 @@ public void testInvalidTransport() { Assert.assertNotNull(expected.getMessage()); } } + + @Test + public void dataFormatOptions_createdByDefault() { + BigQueryOptions options = BigQueryOptions.newBuilder().setProjectId("project-id").build(); + + assertNotNull(options.getDataFormatOptions()); + assertFalse(options.getDataFormatOptions().useInt64Timestamp()); + assertEquals( + DataFormatOptions.TimestampFormatOptions.TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED, + options.getDataFormatOptions().timestampFormatOptions()); + } + + @Test + public void nonBuilderSetUseInt64Timestamp_capturedInDataFormatOptions() { + BigQueryOptions options = + BigQueryOptions.newBuilder() + .setDataFormatOptions(DataFormatOptions.newBuilder().useInt64Timestamp(false).build()) + .setProjectId("project-id") + .build(); + options.setUseInt64Timestamps(true); + + assertTrue(options.getDataFormatOptions().useInt64Timestamp()); + } + + @Test + public void nonBuilderSetUseInt64Timestamp_overridesEverything() { + BigQueryOptions options = BigQueryOptions.newBuilder().setProjectId("project-id").build(); + options.setUseInt64Timestamps(true); + + assertTrue(options.getDataFormatOptions().useInt64Timestamp()); + } + + @Test + public void noDataFormatOptions_capturesUseInt64TimestampSetInBuilder() { + BigQueryOptions options = + BigQueryOptions.newBuilder().setUseInt64Timestamps(true).setProjectId("project-id").build(); + + assertTrue(options.getDataFormatOptions().useInt64Timestamp()); + } + + @Test + public void dataFormatOptionsSetterHasPrecedence() { + BigQueryOptions options = + BigQueryOptions.newBuilder() + .setProjectId("project-id") + .setDataFormatOptions(DataFormatOptions.newBuilder().useInt64Timestamp(true).build()) + .setUseInt64Timestamps(false) + .build(); + + assertTrue(options.getDataFormatOptions().useInt64Timestamp()); + } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index ed9effe0b4..8661346776 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -140,7 +140,8 @@ public class QueryRequestInfoTest { .setJobCreationMode(jobCreationModeRequired) .setReservation(RESERVATION) .build(); - QueryRequestInfo REQUEST_INFO = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false); + QueryRequestInfo REQUEST_INFO = + new QueryRequestInfo(QUERY_JOB_CONFIGURATION, DataFormatOptions.newBuilder().build()); private static final QueryJobConfiguration QUERY_JOB_CONFIGURATION_SUPPORTED = QueryJobConfiguration.newBuilder(QUERY) .setUseQueryCache(USE_QUERY_CACHE) @@ -156,7 +157,8 @@ public class QueryRequestInfoTest { .setReservation(RESERVATION) .build(); QueryRequestInfo REQUEST_INFO_SUPPORTED = - new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED, false); + new QueryRequestInfo( + QUERY_JOB_CONFIGURATION_SUPPORTED, DataFormatOptions.newBuilder().build()); @Test public void testIsFastQuerySupported() { @@ -177,17 +179,25 @@ public void testToPb() { @Test public void equalTo() { compareQueryRequestInfo( - new QueryRequestInfo(QUERY_JOB_CONFIGURATION_SUPPORTED, false), REQUEST_INFO_SUPPORTED); - compareQueryRequestInfo(new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false), REQUEST_INFO); + new QueryRequestInfo( + QUERY_JOB_CONFIGURATION_SUPPORTED, DataFormatOptions.newBuilder().build()), + REQUEST_INFO_SUPPORTED); + compareQueryRequestInfo( + new QueryRequestInfo(QUERY_JOB_CONFIGURATION, DataFormatOptions.newBuilder().build()), + REQUEST_INFO); } @Test public void testInt64Timestamp() { - QueryRequestInfo requestInfo = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, false); + QueryRequestInfo requestInfo = + new QueryRequestInfo(QUERY_JOB_CONFIGURATION, DataFormatOptions.newBuilder().build()); QueryRequest requestPb = requestInfo.toPb(); assertFalse(requestPb.getFormatOptions().getUseInt64Timestamp()); - QueryRequestInfo requestInfoLosslessTs = new QueryRequestInfo(QUERY_JOB_CONFIGURATION, true); + QueryRequestInfo requestInfoLosslessTs = + new QueryRequestInfo( + QUERY_JOB_CONFIGURATION, + DataFormatOptions.newBuilder().useInt64Timestamp(true).build()); QueryRequest requestLosslessTsPb = requestInfoLosslessTs.toPb(); assertTrue(requestLosslessTsPb.getFormatOptions().getUseInt64Timestamp()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ec1f7b5a09..268199869e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -71,6 +71,7 @@ import com.google.cloud.bigquery.ConnectionSettings; import com.google.cloud.bigquery.CopyJobConfiguration; import com.google.cloud.bigquery.CsvOptions; +import com.google.cloud.bigquery.DataFormatOptions; import com.google.cloud.bigquery.Dataset; import com.google.cloud.bigquery.DatasetId; import com.google.cloud.bigquery.DatasetInfo; @@ -3462,8 +3463,11 @@ public void testLosslessTimestamp() throws InterruptedException { // Create new BQ object to toggle lossless timestamps without affecting // other tests. RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); - BigQuery bigqueryLossless = bigqueryHelper.getOptions().getService(); - bigqueryLossless.getOptions().setUseInt64Timestamps(true); + DataFormatOptions dataFormatOptions = + DataFormatOptions.newBuilder().useInt64Timestamp(true).build(); + BigQueryOptions options = + bigqueryHelper.getOptions().toBuilder().setDataFormatOptions(dataFormatOptions).build(); + BigQuery bigqueryLossless = options.getService(); TableResult resultLossless = bigqueryLossless.query( From 57ffe1d2ba8af3b950438c926d66ac23ca8a3093 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 8 Dec 2025 16:53:20 -0500 Subject: [PATCH 2197/2268] feat: Add timestamp_precision to Field (#4014) * feat: Add timestamp_precision to Field * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * chore: Address GCA PR feedback * chore: Fix typo * chore: Remove default value * chore: Address PR feedback --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../java/com/google/cloud/bigquery/Field.java | 44 ++++++++++++++++++- .../com/google/cloud/bigquery/FieldTest.java | 15 +++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java index 3c959a73fe..88e09c5c48 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java @@ -25,6 +25,7 @@ import com.google.api.services.bigquery.model.TableFieldSchema; import com.google.common.base.Function; import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import java.io.Serializable; import java.util.List; @@ -62,6 +63,7 @@ public TableFieldSchema apply(Field field) { private final Long maxLength; private final Long scale; private final Long precision; + private final Long timestampPrecision; private final String defaultValueExpression; private final String collation; private final FieldElementType rangeElementType; @@ -88,6 +90,7 @@ public static final class Builder { private Long maxLength; private Long scale; private Long precision; + private Long timestampPrecision; private String defaultValueExpression; private String collation; private FieldElementType rangeElementType; @@ -104,6 +107,7 @@ private Builder(Field field) { this.maxLength = field.maxLength; this.scale = field.scale; this.precision = field.precision; + this.timestampPrecision = field.timestampPrecision; this.defaultValueExpression = field.defaultValueExpression; this.collation = field.collation; this.rangeElementType = field.rangeElementType; @@ -254,6 +258,19 @@ public Builder setPrecision(Long precision) { return this; } + /** + * Specifies the precision for TIMESTAMP types. + * + *

    The default value is 6. Possible values are 6 (microsecond) or 12 (picosecond). + */ + public Builder setTimestampPrecision(Long timestampPrecision) { + Preconditions.checkArgument( + timestampPrecision == 6L || timestampPrecision == 12L, + "Timestamp Precision must be 6 (microsecond) or 12 (picosecond)"); + this.timestampPrecision = timestampPrecision; + return this; + } + /** * DefaultValueExpression is used to specify the default value of a field using a SQL * expression. It can only be set for top level fields (columns). @@ -317,6 +334,7 @@ private Field(Builder builder) { this.maxLength = builder.maxLength; this.scale = builder.scale; this.precision = builder.precision; + this.timestampPrecision = builder.timestampPrecision; this.defaultValueExpression = builder.defaultValueExpression; this.collation = builder.collation; this.rangeElementType = builder.rangeElementType; @@ -370,6 +388,11 @@ public Long getPrecision() { return precision; } + /** Returns the precision for TIMESTAMP type. */ + public Long getTimestampPrecision() { + return timestampPrecision; + } + /** Return the default value of the field. */ public String getDefaultValueExpression() { return defaultValueExpression; @@ -408,6 +431,7 @@ public String toString() { .add("maxLength", maxLength) .add("scale", scale) .add("precision", precision) + .add("timestampPrecision", timestampPrecision) .add("defaultValueExpression", defaultValueExpression) .add("collation", collation) .add("rangeElementType", rangeElementType) @@ -416,7 +440,19 @@ public String toString() { @Override public int hashCode() { - return Objects.hash(name, type, mode, description, policyTags, rangeElementType); + return Objects.hash( + name, + type, + mode, + description, + policyTags, + maxLength, + scale, + precision, + timestampPrecision, + defaultValueExpression, + collation, + rangeElementType); } @Override @@ -490,6 +526,9 @@ TableFieldSchema toPb() { if (precision != null) { fieldSchemaPb.setPrecision(precision); } + if (timestampPrecision != null) { + fieldSchemaPb.setTimestampPrecision(timestampPrecision); + } if (defaultValueExpression != null) { fieldSchemaPb.setDefaultValueExpression(defaultValueExpression); } @@ -527,6 +566,9 @@ static Field fromPb(TableFieldSchema fieldSchemaPb) { if (fieldSchemaPb.getPrecision() != null) { fieldBuilder.setPrecision(fieldSchemaPb.getPrecision()); } + if (fieldSchemaPb.getTimestampPrecision() != null) { + fieldBuilder.setTimestampPrecision(fieldSchemaPb.getTimestampPrecision()); + } if (fieldSchemaPb.getDefaultValueExpression() != null) { fieldBuilder.setDefaultValueExpression(fieldSchemaPb.getDefaultValueExpression()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java index ce431ca295..d7c5e25a2e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -213,6 +214,20 @@ public void testSubFieldWithClonedType() throws Exception { Field.of("field", clonedRecord, Field.of("subfield", LegacySQLTypeName.BOOLEAN)); } + @Test + public void setTimestampPrecisionValues() { + Field.Builder builder = Field.newBuilder(FIELD_NAME1, FIELD_TYPE1); + + // Value values: 6L or 12L + builder.setTimestampPrecision(6L); + builder.setTimestampPrecision(12L); + + assertThrows(IllegalArgumentException.class, () -> builder.setTimestampPrecision(-1L)); + assertThrows(IllegalArgumentException.class, () -> builder.setTimestampPrecision(0L)); + assertThrows(IllegalArgumentException.class, () -> builder.setTimestampPrecision(5L)); + assertThrows(IllegalArgumentException.class, () -> builder.setTimestampPrecision(13L)); + } + private void compareFieldSchemas(Field expected, Field value) { assertEquals(expected, value); assertEquals(expected.getName(), value.getName()); From 5a51a51ced49957d53a911c585bbbd69aaf8283f Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 8 Dec 2025 17:07:06 -0500 Subject: [PATCH 2198/2268] chore: Use custom timestamp validator for ISO8601 timestamps with more than nanosecond precision (#4017) * chore: Use custom timestamp validator for ISO8601 timestamps with more than nanosecond precision * chore: Rename helper method to validateTimestamp * chore: Address GCA comments * chore: Address last GCA comment * chore: Update to use assert helper method --- .../cloud/bigquery/QueryParameterValue.java | 72 ++++++++-- .../bigquery/QueryParameterValueTest.java | 131 ++++++++++-------- 2 files changed, 136 insertions(+), 67 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index 0487c3f7c3..cb4e44861d 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -26,6 +26,7 @@ import com.google.api.services.bigquery.model.RangeValue; import com.google.auto.value.AutoValue; import com.google.cloud.Timestamp; +import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -44,6 +45,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.annotation.Nullable; import org.threeten.extra.PeriodDuration; @@ -76,7 +79,7 @@ @AutoValue public abstract class QueryParameterValue implements Serializable { - private static final DateTimeFormatter timestampFormatter = + static final DateTimeFormatter TIMESTAMP_FORMATTER = new DateTimeFormatterBuilder() .parseLenient() .append(DateTimeFormatter.ISO_LOCAL_DATE) @@ -94,15 +97,21 @@ public abstract class QueryParameterValue implements Serializable { .optionalEnd() .toFormatter() .withZone(ZoneOffset.UTC); - private static final DateTimeFormatter timestampValidator = + private static final DateTimeFormatter TIMESTAMP_VALIDATOR = new DateTimeFormatterBuilder() .parseLenient() - .append(timestampFormatter) + .append(TIMESTAMP_FORMATTER) .optionalStart() .appendOffsetId() .optionalEnd() .toFormatter() .withZone(ZoneOffset.UTC); + // Regex to identify >9 digits in the fraction part (e.g. `.123456789123`) + // Matches the dot, followed by 10+ digits (fractional part), followed by non-digits (like `+00`) + // or end of string + private static final Pattern ISO8601_TIMESTAMP_HIGH_PRECISION_PATTERN = + Pattern.compile("\\.(\\d{10,})(?:\\D|$)"); + private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss.SSSSSS"); @@ -303,6 +312,9 @@ public static QueryParameterValue bytes(byte[] value) { /** * Creates a {@code QueryParameterValue} object with a type of TIMESTAMP. * + *

    This method only supports microsecond precision for timestamp. To use higher precision, + * prefer {@link #timestamp(String)} with an ISO8601 String + * * @param value Microseconds since epoch, e.g. 1733945416000000 corresponds to 2024-12-11 * 19:30:16.929Z */ @@ -311,8 +323,14 @@ public static QueryParameterValue timestamp(Long value) { } /** - * Creates a {@code QueryParameterValue} object with a type of TIMESTAMP. Must be in the format - * "yyyy-MM-dd HH:mm:ss.SSSSSSZZ", e.g. "2014-08-19 12:41:35.220000+00:00". + * Creates a {@code QueryParameterValue} object with a type of TIMESTAMP. + * + *

    This method supports up to picosecond precision (12 digits) for timestamp. Input should + * conform to ISO8601 format. + * + *

    Must be in the format "yyyy-MM-dd HH:mm:ss.SSSSSS{SSSSSSS}ZZ", e.g. "2014-08-19 + * 12:41:35.123456+00:00" for microsecond precision and "2014-08-19 12:41:35.123456789123+00:00" + * for picosecond precision */ public static QueryParameterValue timestamp(String value) { return of(value, StandardSQLTypeName.TIMESTAMP); @@ -481,12 +499,15 @@ private static String valueToStringOrNull(T value, StandardSQLTypeName type) throw new IllegalArgumentException("Cannot convert RANGE to String value"); case TIMESTAMP: if (value instanceof Long) { + // Timestamp passed as a Long only support Microsecond precision Timestamp timestamp = Timestamp.ofTimeMicroseconds((Long) value); - return timestampFormatter.format( + return TIMESTAMP_FORMATTER.format( Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos())); } else if (value instanceof String) { - // verify that the String is in the right format - checkFormat(value, timestampValidator); + // Timestamp passed as a String can support up picosecond precision, however, + // DateTimeFormatter only supports nanosecond precision. Higher than nanosecond + // requires a custom validator. + validateTimestamp((String) value); return (String) value; } break; @@ -521,9 +542,42 @@ private static String valueToStringOrNull(T value, StandardSQLTypeName type) "Type " + type + " incompatible with " + value.getClass().getCanonicalName()); } + /** + * Internal helper method to check that the timestamp follows the expected String input of ISO8601 + * string. Allows the fractional portion of the timestamp to support up to 12 digits of precision + * (up to picosecond). + * + * @throws IllegalArgumentException if timestamp is invalid or exceeds picosecond precision + */ + @VisibleForTesting + static void validateTimestamp(String timestamp) { + // Check if the string has greater than nanosecond precision (>9 digits in fractional second) + Matcher matcher = ISO8601_TIMESTAMP_HIGH_PRECISION_PATTERN.matcher(timestamp); + if (matcher.find()) { + // Group 1 is the fractional second part of the ISO8601 string + String fraction = matcher.group(1); + // Pos 10-12 of the fractional second are guaranteed to be digits. The regex only + // matches the fraction section as long as they are digits. + if (fraction.length() > 12) { + throw new IllegalArgumentException( + "Fractional second portion of ISO8601 only supports up to picosecond (12 digits) in BigQuery"); + } + + // Replace the entire fractional second portion with just the nanosecond portion. + // The new timestamp will be validated against the JDK's DateTimeFormatter + String truncatedFraction = fraction.substring(0, 9); + timestamp = + new StringBuilder(timestamp) + .replace(matcher.start(1), matcher.end(1), truncatedFraction) + .toString(); + } + + // It is valid as long as DateTimeFormatter doesn't throw an exception + checkFormat(timestamp, TIMESTAMP_VALIDATOR); + } + private static void checkFormat(Object value, DateTimeFormatter formatter) { try { - formatter.parse((String) value); } catch (DateTimeParseException e) { throw new IllegalArgumentException(e.getMessage(), e); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index 75060a4f04..25649388e9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -16,11 +16,9 @@ package com.google.cloud.bigquery; +import static com.google.cloud.bigquery.QueryParameterValue.TIMESTAMP_FORMATTER; import static com.google.common.truth.Truth.assertThat; -import static java.time.temporal.ChronoField.HOUR_OF_DAY; -import static java.time.temporal.ChronoField.MINUTE_OF_HOUR; -import static java.time.temporal.ChronoField.NANO_OF_SECOND; -import static java.time.temporal.ChronoField.SECOND_OF_MINUTE; +import static org.junit.Assert.assertThrows; import com.google.api.services.bigquery.model.QueryParameterType; import com.google.common.collect.ImmutableMap; @@ -29,9 +27,6 @@ import java.text.ParseException; import java.time.Instant; import java.time.Period; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeFormatterBuilder; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -43,25 +38,6 @@ public class QueryParameterValueTest { - private static final DateTimeFormatter TIMESTAMPFORMATTER = - new DateTimeFormatterBuilder() - .parseLenient() - .append(DateTimeFormatter.ISO_LOCAL_DATE) - .appendLiteral(' ') - .appendValue(HOUR_OF_DAY, 2) - .appendLiteral(':') - .appendValue(MINUTE_OF_HOUR, 2) - .optionalStart() - .appendLiteral(':') - .appendValue(SECOND_OF_MINUTE, 2) - .optionalStart() - .appendFraction(NANO_OF_SECOND, 6, 9, true) - .optionalStart() - .appendOffset("+HHMM", "+00:00") - .optionalEnd() - .toFormatter() - .withZone(ZoneOffset.UTC); - private static final QueryParameterValue QUERY_PARAMETER_VALUE = QueryParameterValue.newBuilder() .setType(StandardSQLTypeName.STRING) @@ -326,11 +302,9 @@ public void testStringArray() { @Test public void testTimestampFromLong() { - QueryParameterValue value = QueryParameterValue.timestamp(1408452095220000L); - assertThat(value.getValue()).isEqualTo("2014-08-19 12:41:35.220000+00:00"); - assertThat(value.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); - assertThat(value.getArrayType()).isNull(); - assertThat(value.getArrayValues()).isNull(); + // Expects output to be ISO8601 string with microsecond precision + assertTimestampValue( + QueryParameterValue.timestamp(1408452095220000L), "2014-08-19 12:41:35.220000+00:00"); } @Test @@ -340,43 +314,77 @@ public void testTimestampWithFormatter() { long secs = Math.floorDiv(timestampInMicroseconds, microseconds); int nano = (int) Math.floorMod(timestampInMicroseconds, microseconds) * 1000; Instant instant = Instant.ofEpochSecond(secs, nano); - String expected = TIMESTAMPFORMATTER.format(instant); - assertThat(expected) - .isEqualTo(QueryParameterValue.timestamp(timestampInMicroseconds).getValue()); + String expected = TIMESTAMP_FORMATTER.format(instant); + assertTimestampValue(QueryParameterValue.timestamp(timestampInMicroseconds), expected); } @Test - public void testTimestamp() { - QueryParameterValue value = QueryParameterValue.timestamp("2014-08-19 12:41:35.220000+00:00"); - assertThat(value.getValue()).isEqualTo("2014-08-19 12:41:35.220000+00:00"); - assertThat(value.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); - assertThat(value.getArrayType()).isNull(); - assertThat(value.getArrayValues()).isNull(); + public void testTimestampFromString() { + assertTimestampValue( + QueryParameterValue.timestamp("2014-08-19 12:41:35.220000+00:00"), + "2014-08-19 12:41:35.220000+00:00"); + assertTimestampValue( + QueryParameterValue.timestamp("2025-08-19 12:34:56.123456789+00:00"), + "2025-08-19 12:34:56.123456789+00:00"); + + // The following test cases test more than nanosecond precision + // 10 digits of precision (1 digit more than nanosecond) + assertTimestampValue( + QueryParameterValue.timestamp("2025-12-08 12:34:56.1234567890+00:00"), + "2025-12-08 12:34:56.1234567890+00:00"); + // 12 digits (picosecond precision) + assertTimestampValue( + QueryParameterValue.timestamp("2025-12-08 12:34:56.123456789123+00:00"), + "2025-12-08 12:34:56.123456789123+00:00"); + + // More than picosecond precision + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.timestamp("2025-12-08 12:34:56.1234567891234+00:00")); + assertThrows( + IllegalArgumentException.class, + () -> + QueryParameterValue.timestamp("2025-12-08 12:34:56.123456789123456789123456789+00:00")); } @Test public void testTimestampWithDateTimeFormatterBuilder() { - QueryParameterValue value = QueryParameterValue.timestamp("2019-02-14 12:34:45.938993Z"); - assertThat(value.getValue()).isEqualTo("2019-02-14 12:34:45.938993Z"); - assertThat(value.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); - assertThat(value.getArrayType()).isNull(); - assertThat(value.getArrayValues()).isNull(); - QueryParameterValue value1 = QueryParameterValue.timestamp("2019-02-14 12:34:45.938993+0000"); - assertThat(value1.getValue()).isEqualTo("2019-02-14 12:34:45.938993+0000"); - assertThat(value1.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); - assertThat(value1.getArrayType()).isNull(); - assertThat(value1.getArrayValues()).isNull(); - QueryParameterValue value2 = QueryParameterValue.timestamp("2019-02-14 12:34:45.102+00:00"); - assertThat(value2.getValue()).isEqualTo("2019-02-14 12:34:45.102+00:00"); - assertThat(value2.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); - assertThat(value2.getArrayType()).isNull(); - assertThat(value2.getArrayValues()).isNull(); + assertTimestampValue( + QueryParameterValue.timestamp("2019-02-14 12:34:45.938993Z"), + "2019-02-14 12:34:45.938993Z"); + assertTimestampValue( + QueryParameterValue.timestamp("2019-02-14 12:34:45.938993+0000"), + "2019-02-14 12:34:45.938993+0000"); + assertTimestampValue( + QueryParameterValue.timestamp("2019-02-14 12:34:45.102+00:00"), + "2019-02-14 12:34:45.102+00:00"); } - @Test(expected = IllegalArgumentException.class) - public void testInvalidTimestamp() { + @Test + public void testInvalidTimestampStringValues() { + assertThrows(IllegalArgumentException.class, () -> QueryParameterValue.timestamp("abc")); + // missing the time - QueryParameterValue.timestamp("2014-08-19"); + assertThrows(IllegalArgumentException.class, () -> QueryParameterValue.timestamp("2014-08-19")); + + // missing the hour + assertThrows( + IllegalArgumentException.class, () -> QueryParameterValue.timestamp("2014-08-19 12")); + + // can't have the 'T' separator + assertThrows( + IllegalArgumentException.class, () -> QueryParameterValue.timestamp("2014-08-19T12")); + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.timestamp("2014-08-19T12:34:00.123456")); + + // Fractional part has picosecond length, but fractional part is not a valid number + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.timestamp("2014-08-19 12:34:00.123456789abc+00:00")); + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.timestamp("2014-08-19 12:34:00.123456abc789+00:00")); } @Test @@ -683,4 +691,11 @@ private static void testRangeDataEquals(String start, String end, FieldElementTy assertThat(queryParameterValue.getStructValues()).isNull(); assertThat(queryParameterValue.getValue()).isNull(); } + + private void assertTimestampValue(QueryParameterValue value, String expectedStringValue) { + assertThat(value.getValue()).isEqualTo(expectedStringValue); + assertThat(value.getType()).isEqualTo(StandardSQLTypeName.TIMESTAMP); + assertThat(value.getArrayType()).isNull(); + assertThat(value.getArrayValues()).isNull(); + } } From 5ad1ce7625a8fe74cd6b8a084fb144de6c34b240 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:52:30 -0500 Subject: [PATCH 2199/2268] chore(main): release 2.56.1-SNAPSHOT (#4001) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 9f219179fd..75b4d4d8a6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.56.0 + 2.56.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 2e6d9828bb..357c509748 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.56.0 + 2.56.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.56.0 + 2.56.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 304230dd21..5994781371 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.56.0 + 2.56.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.56.0 + 2.56.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2169463a6b..06d3a7bfec 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.56.0 + 2.56.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.56.0 + 2.56.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6cabd8bbfc..923d2f6031 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.56.0 + 2.56.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 46c19475b0..7f07bf2096 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.56.0:2.56.0 \ No newline at end of file +google-cloud-bigquery:2.56.0:2.56.1-SNAPSHOT \ No newline at end of file From d2f20579fd60efc36fa4239619e0d679a914cd6d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 11 Dec 2025 19:25:27 +0000 Subject: [PATCH 2200/2268] deps: update dependency com.google.cloud:sdk-platform-java-config to v3.54.2 (#4022) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 5ba388acc0..3c07fc2027 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.2 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 0d98de5094..20c0ac4a52 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index c270bff717..3b7b14a650 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.2" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 720f8bcfaf..a41d88c092 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 0d98de5094..20c0ac4a52 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index c270bff717..3b7b14a650 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.2" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 720f8bcfaf..a41d88c092 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.2" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 357c509748..18b870c38e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.54.1 + 3.54.2 diff --git a/pom.xml b/pom.xml index 06d3a7bfec..0e5d85cd95 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.54.1 + 3.54.2 From f4a15364e294a6c379fefe965973f5e140a091e5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:55:34 -0500 Subject: [PATCH 2201/2268] chore(main): release 2.57.0 (#4021) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 14 ++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59350c03bc..f9397c65bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.57.0](https://github.com/googleapis/java-bigquery/compare/v2.56.0...v2.57.0) (2025-12-11) + + +### Features + +* Add timestamp_precision to Field ([#4014](https://github.com/googleapis/java-bigquery/issues/4014)) ([57ffe1d](https://github.com/googleapis/java-bigquery/commit/57ffe1d2ba8af3b950438c926d66ac23ca8a3093)) +* Introduce DataFormatOptions to configure the output of BigQuery data types ([#4010](https://github.com/googleapis/java-bigquery/issues/4010)) ([6dcc900](https://github.com/googleapis/java-bigquery/commit/6dcc90053353422ae766e531413b3ecc65b8b155)) +* Relax client-side validation for BigQuery entity IDs ([#4000](https://github.com/googleapis/java-bigquery/issues/4000)) ([c3548a2](https://github.com/googleapis/java-bigquery/commit/c3548a2f521b19761c844c0b24fc8caab541aba7)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.54.2 ([#4022](https://github.com/googleapis/java-bigquery/issues/4022)) ([d2f2057](https://github.com/googleapis/java-bigquery/commit/d2f20579fd60efc36fa4239619e0d679a914cd6d)) + ## [2.56.0](https://github.com/googleapis/java-bigquery/compare/v2.55.3...v2.56.0) (2025-11-15) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 75b4d4d8a6..a1ac9dc9ae 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.56.1-SNAPSHOT + 2.57.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 18b870c38e..8d2b8864aa 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.56.1-SNAPSHOT + 2.57.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.56.1-SNAPSHOT + 2.57.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5994781371..d3a1150d35 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.56.1-SNAPSHOT + 2.57.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.56.1-SNAPSHOT + 2.57.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 0e5d85cd95..b9fedf5f87 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.56.1-SNAPSHOT + 2.57.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.56.1-SNAPSHOT + 2.57.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 923d2f6031..e2e994a16b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.56.1-SNAPSHOT + 2.57.0 diff --git a/versions.txt b/versions.txt index 7f07bf2096..fe934a8fc5 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.56.0:2.56.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.57.0:2.57.0 \ No newline at end of file From 3f592a50d25852caaf4e71f64446e153d39ccc1d Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 12 Dec 2025 10:06:45 -0500 Subject: [PATCH 2202/2268] test: Clean up resources created in ITs (#4024) * chore: Cleanup initialized resources * chore: Delete created dataset * chore: Use try-with to close stream --- .../cloud/bigquery/it/ITBigQueryTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 268199869e..d565688d50 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -1099,10 +1099,12 @@ public static void beforeClass() throws InterruptedException, IOException { .setContentType("application/json") .build(), JSON_CONTENT_SIMPLE.getBytes(StandardCharsets.UTF_8)); - InputStream stream = - ITBigQueryTest.class.getClassLoader().getResourceAsStream("QueryTestData.csv"); - storage.createFrom( - BlobInfo.newBuilder(BUCKET, LOAD_FILE_LARGE).setContentType("text/plain").build(), stream); + try (InputStream stream = + ITBigQueryTest.class.getClassLoader().getResourceAsStream("QueryTestData.csv")) { + storage.createFrom( + BlobInfo.newBuilder(BUCKET, LOAD_FILE_LARGE).setContentType("text/plain").build(), + stream); + } storage.create( BlobInfo.newBuilder(BUCKET, JSON_LOAD_FILE_BQ_RESULTSET) .setContentType("application/json") @@ -1179,10 +1181,11 @@ public static void beforeClass() throws InterruptedException, IOException { } @AfterClass - public static void afterClass() throws ExecutionException, InterruptedException { + public static void afterClass() throws Exception { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, DATASET); RemoteBigQueryHelper.forceDelete(bigquery, UK_DATASET); + RemoteBigQueryHelper.forceDelete(bigquery, OTHER_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, MODEL_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); } @@ -1191,6 +1194,11 @@ public static void afterClass() throws ExecutionException, InterruptedException if (!wasDeleted && LOG.isLoggable(Level.WARNING)) { LOG.log(Level.WARNING, "Deletion of bucket {0} timed out, bucket is not empty", BUCKET); } + storage.close(); + } + + if (otel instanceof OpenTelemetrySdk) { + ((OpenTelemetrySdk) otel).close(); } } From 380e0d999a0bd79dad8f3b777ab511bdf2e657e3 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 Dec 2025 19:39:10 +0000 Subject: [PATCH 2203/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.19.0 (#4025) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b9fedf5f87..068d0cad93 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.18.0 + 3.19.0 pom import From 3b8b8ef11aefdeac9512d10e1441e6ae91c4cc1f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 14:39:26 -0500 Subject: [PATCH 2204/2268] chore(main): release 2.57.1-SNAPSHOT (#4023) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index a1ac9dc9ae..8d70e4d685 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.0 + 2.57.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8d2b8864aa..3532008034 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.0 + 2.57.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.0 + 2.57.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index d3a1150d35..9517e49198 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.0 + 2.57.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.0 + 2.57.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 068d0cad93..129c6226c6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.0 + 2.57.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.0 + 2.57.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e2e994a16b..3976d33b4e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.0 + 2.57.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index fe934a8fc5..e6d97a7042 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.0:2.57.0 \ No newline at end of file +google-cloud-bigquery:2.57.0:2.57.1-SNAPSHOT \ No newline at end of file From c161364aeac184917174b290adb0108cba3d2489 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 12 Dec 2025 15:14:45 -0500 Subject: [PATCH 2205/2268] chore: Cleanup Intellij test warnings (#4026) * chore: Cleanup initialized resources * chore: Use try-with to close stream * chore: Cleanup Intellij test warnings * chore: Allow for floating point inaccuracies * chore: Add otel delete operation --- .../cloud/bigquery/it/ITBigQueryTest.java | 273 +++++++++--------- 1 file changed, 132 insertions(+), 141 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index d565688d50..de9fef4ee5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -44,7 +44,6 @@ import com.google.cloud.bigquery.Acl.Expr; import com.google.cloud.bigquery.Acl.User; import com.google.cloud.bigquery.BigQuery; -import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption; import com.google.cloud.bigquery.BigQuery.DatasetField; import com.google.cloud.bigquery.BigQuery.DatasetListOption; import com.google.cloud.bigquery.BigQuery.DatasetOption; @@ -1434,8 +1433,8 @@ public void testUpdateDatasetWithAccessPolicyVersion() throws IOException { datasetOption, updateModeOption); assertNotNull(updatedDataset); - assertEquals(updatedDataset.getDescription(), "Updated Description"); - assertThat(updatedDataset.getLabels().isEmpty()); + assertEquals("Updated Description", updatedDataset.getDescription()); + assertTrue(updatedDataset.getLabels().isEmpty()); Acl updatedAclWithCond = null; for (Acl updatedAcl : updatedDataset.getAcl()) { @@ -1875,7 +1874,7 @@ public void testCreateDatasetWithAccessPolicyVersion() throws IOException { DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); Dataset dataset = bigquery.create(info, datasetOption); assertNotNull(dataset); - assertEquals(dataset.getDescription(), DESCRIPTION); + assertEquals(DESCRIPTION, dataset.getDescription()); Acl remoteAclWithCond = null; for (Acl remoteAcl : dataset.getAcl()) { @@ -1981,7 +1980,7 @@ public void testCreateFieldWithDefaultCollation() { Schema remoteSchema = remoteTable.getDefinition().getSchema(); // Schema should be equal because collation has been added to the fields. assertEquals(schema, remoteSchema); - assertEquals(null, remoteTable.getDefaultCollation()); + assertNull(remoteTable.getDefaultCollation()); FieldList fieldList = remoteSchema.getFields(); for (Field field : fieldList) { if (field.getName().equals("stringFieldWithoutDefaultCollation")) { @@ -2425,7 +2424,7 @@ public void testCreateExternalTable() throws InterruptedException { assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); assertEquals(integerValue, integerCell.getLongValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); integerValue = ~integerValue & 0x1; rowCount++; } @@ -2531,7 +2530,7 @@ public void testCreateViewTable() throws InterruptedException { assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); rowCount++; } assertEquals(2, rowCount); @@ -3065,13 +3064,13 @@ public void testListAllTableData() { assertEquals("stringValue", stringCell.getStringValue()); assertEquals(0, integerArrayCell.getRepeatedValue().get(0).getLongValue()); assertEquals(1, integerArrayCell.getRepeatedValue().get(1).getLongValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); assertArrayEquals(BYTES, bytesCell.getBytesValue()); assertEquals(-14182916000000L, recordCell.getRecordValue().get(0).getTimestampValue()); assertTrue(recordCell.getRecordValue().get(1).isNull()); assertEquals(1, recordCell.getRecordValue().get(2).getRepeatedValue().get(0).getLongValue()); assertEquals(0, recordCell.getRecordValue().get(2).getRepeatedValue().get(1).getLongValue()); - assertEquals(true, recordCell.getRecordValue().get(3).getBooleanValue()); + assertTrue(recordCell.getRecordValue().get(3).getBooleanValue()); assertEquals(3, integerCell.getLongValue()); assertEquals(1.2, floatCell.getDoubleValue(), 0.0001); assertEquals("POINT(-122.35022 47.649154)", geographyCell.getStringValue()); @@ -3132,21 +3131,21 @@ public void testModelLifecycle() throws InterruptedException { ModelId modelId = ModelId.of(MODEL_DATASET, modelName); Model model = bigquery.getModel(modelId); assertNotNull(model); - assertEquals(model.getModelType(), "LINEAR_REGRESSION"); + assertEquals("LINEAR_REGRESSION", model.getModelType()); // Compare the extended model metadata. - assertEquals(model.getFeatureColumns().get(0).getName(), "f1"); - assertEquals(model.getLabelColumns().get(0).getName(), "predicted_label"); + assertEquals("f1", model.getFeatureColumns().get(0).getName()); + assertEquals("predicted_label", model.getLabelColumns().get(0).getName()); assertEquals( - model.getTrainingRuns().get(0).getTrainingOptions().getLearnRateStrategy(), "CONSTANT"); + "CONSTANT", model.getTrainingRuns().get(0).getTrainingOptions().getLearnRateStrategy()); // Mutate metadata. ModelInfo info = model.toBuilder().setDescription("TEST").build(); Model afterUpdate = bigquery.update(info); - assertEquals(afterUpdate.getDescription(), "TEST"); + assertEquals("TEST", afterUpdate.getDescription()); // Ensure model is present in listModels. Page models = bigquery.listModels(MODEL_DATASET); - Boolean found = false; + boolean found = false; for (Model m : models.getValues()) { if (m.getModelId().getModel().equals(modelName)) { found = true; @@ -3167,7 +3166,7 @@ public void testEmptyListModels() { assertEquals(0, Iterables.size(models.getValues())); assertFalse(models.hasNextPage()); assertNull(models.getNextPageToken()); - assertTrue(bigquery.delete(datasetId)); + RemoteBigQueryHelper.forceDelete(bigquery, datasetId); } @Test @@ -3179,7 +3178,7 @@ public void testEmptyListRoutines() { assertEquals(0, Iterables.size(routines.getValues())); assertFalse(routines.hasNextPage()); assertNull(routines.getNextPageToken()); - assertTrue(bigquery.delete(datasetId)); + RemoteBigQueryHelper.forceDelete(bigquery, datasetId); } @Test @@ -3197,7 +3196,7 @@ public void testRoutineLifecycle() throws InterruptedException { RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); Routine routine = bigquery.getRoutine(routineId); assertNotNull(routine); - assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); + assertEquals("SCALAR_FUNCTION", routine.getRoutineType()); // Mutate metadata. RoutineInfo newInfo = @@ -3208,11 +3207,11 @@ public void testRoutineLifecycle() throws InterruptedException { .setRoutineType(routine.getRoutineType()) .build(); Routine afterUpdate = bigquery.update(newInfo); - assertEquals(afterUpdate.getBody(), "x * 4"); + assertEquals("x * 4", afterUpdate.getBody()); // Ensure routine is present in listRoutines. Page routines = bigquery.listRoutines(ROUTINE_DATASET); - Boolean found = false; + boolean found = false; for (Routine r : routines.getValues()) { if (r.getRoutineId().getRoutine().equals(routineName)) { found = true; @@ -3244,7 +3243,7 @@ public void testRoutineAPICreation() { Routine routine = bigquery.create(routineInfo); assertNotNull(routine); - assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); + assertEquals("SCALAR_FUNCTION", routine.getRoutineType()); } @Test @@ -3269,10 +3268,10 @@ public void testRoutineAPICreationJavascriptUDF() { Routine routine = bigquery.create(routineInfo); assertNotNull(routine); - assertEquals(routine.getLanguage(), "JAVASCRIPT"); - assertEquals(routine.getDeterminismLevel(), "DETERMINISTIC"); - assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); - assertEquals(routine.getReturnType(), StandardSQLDataType.newBuilder("STRING").build()); + assertEquals("JAVASCRIPT", routine.getLanguage()); + assertEquals("DETERMINISTIC", routine.getDeterminismLevel()); + assertEquals("SCALAR_FUNCTION", routine.getRoutineType()); + assertEquals(StandardSQLDataType.newBuilder("STRING").build(), routine.getReturnType()); } @Test @@ -3299,8 +3298,8 @@ public void testRoutineAPICreationTVF() { .build(); Routine routine = bigquery.create(routineInfo); assertNotNull(routine); - assertEquals(routine.getRoutineType(), "TABLE_VALUED_FUNCTION"); - assertEquals(routine.getReturnTableType(), returnTableType); + assertEquals("TABLE_VALUED_FUNCTION", routine.getRoutineType()); + assertEquals(returnTableType, routine.getReturnTableType()); } @Test @@ -3324,10 +3323,10 @@ public void testRoutineDataGovernanceType() { Routine routine = bigquery.create(routineInfo); assertNotNull(routine); - assertEquals(routine.getLanguage(), "SQL"); - assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); - assertEquals(routine.getReturnType(), StandardSQLDataType.newBuilder("INT64").build()); - assertEquals(routine.getDataGovernanceType(), "DATA_MASKING"); + assertEquals("SQL", routine.getLanguage()); + assertEquals("SCALAR_FUNCTION", routine.getRoutineType()); + assertEquals(StandardSQLDataType.newBuilder("INT64").build(), routine.getReturnType()); + assertEquals("DATA_MASKING", routine.getDataGovernanceType()); } @Test @@ -3348,7 +3347,7 @@ public void testAuthorizeRoutine() { .build(); Routine routine = bigquery.create(routineInfo); assertNotNull(routine); - assertEquals(routine.getRoutineType(), "SCALAR_FUNCTION"); + assertEquals("SCALAR_FUNCTION", routine.getRoutineType()); Dataset routineDataset = bigquery.getDataset(ROUTINE_DATASET); List routineAcl = new ArrayList<>(routineDataset.getAcl()); routineAcl.add(Acl.of(new Acl.Routine(routineId))); @@ -3370,7 +3369,7 @@ public void testAuthorizeDataset() { DatasetInfo.newBuilder(datasetId).setAcl(acl).setDescription("shared Dataset").build(); Dataset sharedDataset = bigquery.create(datasetInfo); assertNotNull(sharedDataset); - assertEquals(sharedDataset.getDescription(), "shared Dataset"); + assertEquals("shared Dataset", sharedDataset.getDescription()); // Get the current metadata for the dataset you want to share by calling the datasets.get method List sharedDatasetAcl = new ArrayList<>(sharedDataset.getAcl()); @@ -3384,7 +3383,7 @@ public void testAuthorizeDataset() { Dataset authorizedDataset = bigquery.create(authorizedDatasetInfo); assertNotNull(authorizedDataset); assertEquals( - authorizedDataset.getDescription(), "new Dataset to be authorized by the sharedDataset"); + "new Dataset to be authorized by the sharedDataset", authorizedDataset.getDescription()); // Add the new DatasetAccessEntry object to the existing sharedDatasetAcl list DatasetAclEntity datasetEntity = new DatasetAclEntity(authorizedDatasetId, targetTypes); @@ -3395,6 +3394,9 @@ public void testAuthorizeDataset() { // Verify that the authorized dataset has been added assertEquals(sharedDatasetAcl, updatedDataset.getAcl()); + + RemoteBigQueryHelper.forceDelete(bigquery, datasetName); + RemoteBigQueryHelper.forceDelete(bigquery, authorizedDatasetName); } /* TODO(prasmish): replicate the entire test case for executeSelect */ @@ -3514,7 +3516,7 @@ public void testQuery() throws InterruptedException { assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); rowCount++; } assertEquals(2, rowCount); @@ -3945,14 +3947,14 @@ public void testExecuteSelectSinglePageTableRow() throws SQLException { assertTrue(rs.next()); // first row // checking for the null or 0 column values assertNull(rs.getString("StringField")); - assertTrue(rs.getDouble("BigNumericField") == 0.0d); + assertEquals(0.0d, rs.getDouble("BigNumericField"), 1e-9); assertFalse(rs.getBoolean("BooleanField")); assertNull(rs.getBytes("BytesField")); - assertEquals(rs.getInt("IntegerField"), 0); + assertEquals(0, rs.getInt("IntegerField")); assertNull(rs.getTimestamp("TimestampField")); assertNull(rs.getDate("DateField")); - assertTrue(rs.getDouble("FloatField") == 0.0d); - assertTrue(rs.getDouble("NumericField") == 0.0d); + assertEquals(0.0d, rs.getDouble("FloatField"), 1e-9); + assertEquals(0.0d, rs.getDouble("NumericField"), 1e-9); assertNull(rs.getTime("TimeField")); assertNull(rs.getString("DateTimeField")); assertNull(rs.getString("GeographyField")); @@ -3962,14 +3964,14 @@ public void testExecuteSelectSinglePageTableRow() throws SQLException { assertTrue(rs.next()); // second row // second row is non null, comparing the values assertEquals("StringValue1", rs.getString("StringField")); - assertTrue(rs.getDouble("BigNumericField") == 0.3333333333333333d); + assertEquals(0.3333333333333333d, rs.getDouble("BigNumericField"), 1e-9); assertFalse(rs.getBoolean("BooleanField")); assertNotNull(rs.getBytes("BytesField")); assertEquals(1, rs.getInt("IntegerField")); assertEquals(1534680695123L, rs.getTimestamp("TimestampField").getTime()); assertEquals(java.sql.Date.valueOf("2018-08-19"), rs.getDate("DateField")); - assertTrue(rs.getDouble("FloatField") == 10.1d); - assertTrue(rs.getDouble("NumericField") == 100.0d); + assertEquals(10.1d, rs.getDouble("FloatField"), 1e-9); + assertEquals(100.0d, rs.getDouble("NumericField"), 1e-9); assertEquals(Time.valueOf(LocalTime.of(12, 11, 35, 123456)), rs.getTime("TimeField")); assertEquals("2018-08-19T12:11:35.123456", rs.getString("DateTimeField")); assertEquals("POINT(-122.35022 47.649154)", rs.getString("GeographyField")); @@ -4015,14 +4017,14 @@ public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException assertTrue(rs.next()); // first row // checking for the null or 0 column values assertNull(rs.getString("StringField")); - assertTrue(rs.getDouble("BigNumericField") == 0.0d); + assertEquals(0.0d, rs.getDouble("BigNumericField"), 1e-9); assertFalse(rs.getBoolean("BooleanField")); assertNull(rs.getBytes("BytesField")); - assertEquals(rs.getInt("IntegerField"), 0); + assertEquals(0, rs.getInt("IntegerField")); assertNull(rs.getTimestamp("TimestampField")); assertNull(rs.getDate("DateField")); - assertTrue(rs.getDouble("FloatField") == 0.0d); - assertTrue(rs.getDouble("NumericField") == 0.0d); + assertEquals(0.0d, rs.getDouble("FloatField"), 1e-9); + assertEquals(0.0d, rs.getDouble("NumericField"), 1e-9); assertNull(rs.getTime("TimeField")); assertNull(rs.getString("DateTimeField")); assertNull(rs.getString("GeographyField")); @@ -4032,14 +4034,14 @@ public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException assertTrue(rs.next()); // second row // second row is non null, comparing the values assertEquals("StringValue1", rs.getString("StringField")); - assertTrue(rs.getDouble("BigNumericField") == 0.3333333333333333d); + assertEquals(0.3333333333333333d, rs.getDouble("BigNumericField"), 1e-9); assertFalse(rs.getBoolean("BooleanField")); assertNotNull(rs.getBytes("BytesField")); assertEquals(1, rs.getInt("IntegerField")); assertEquals(1534680695123L, rs.getTimestamp("TimestampField").getTime()); assertEquals(java.sql.Date.valueOf("2018-08-19"), rs.getDate("DateField")); - assertTrue(rs.getDouble("FloatField") == 10.1d); - assertTrue(rs.getDouble("NumericField") == 100.0d); + assertEquals(10.1d, rs.getDouble("FloatField"), 1e-9); + assertEquals(100.0d, rs.getDouble("NumericField"), 1e-9); assertEquals( Time.valueOf(LocalTime.of(12, 11, 35, 123456)).toString(), rs.getTime("TimeField").toString()); @@ -4364,7 +4366,7 @@ public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { assertEquals(2, bigQueryResult.getTotalRows()); // Expecting 2 rows while (rs.next()) { assertEquals(rs.getString(0), rs.getString("StringField")); - assertTrue(rs.getDouble(1) == rs.getDouble("BigNumericField")); + assertEquals(rs.getDouble(1), rs.getDouble("BigNumericField"), 1e-9); assertEquals(rs.getBoolean(2), rs.getBoolean("BooleanField")); if (rs.getBytes(3) == null) { // both overloads should be null assertEquals(rs.getBytes(3), rs.getBytes("BytesField")); @@ -4376,8 +4378,8 @@ public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { assertEquals(rs.getInt(4), rs.getInt("IntegerField")); assertEquals(rs.getTimestamp(5), rs.getTimestamp("TimestampField")); assertEquals(rs.getDate(9), rs.getDate("DateField")); - assertTrue(rs.getDouble("FloatField") == rs.getDouble(6)); - assertTrue(rs.getDouble("NumericField") == rs.getDouble(7)); + assertEquals(rs.getDouble("FloatField"), rs.getDouble(6), 1e-9); + assertEquals(rs.getDouble("NumericField"), rs.getDouble(7), 1e-9); assertEquals(rs.getTime(8), rs.getTime("TimeField")); assertEquals(rs.getString(10), rs.getString("DateTimeField")); assertEquals(rs.getString(11), rs.getString("GeographyField")); @@ -4638,7 +4640,7 @@ public void testFastSQLQuery() throws InterruptedException { assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); } } @@ -4808,7 +4810,7 @@ public void testFastDDLQuery() throws InterruptedException { assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); } } @@ -5249,7 +5251,7 @@ public void testPositionalQueryParameters() throws InterruptedException { (long) Double.parseDouble("1.40845209522E9"), (long) Double.parseDouble(values.get(0).getValue().toString())); assertEquals("stringValue", values.get(1).getValue()); - assertEquals(false, values.get(2).getBooleanValue()); + assertFalse(values.get(2).getBooleanValue()); assertEquals("0.33333333333333333333333333333333333333", values.get(3).getValue()); assertEquals("0.00000000000000000000000000000000000001", values.get(4).getValue()); assertEquals("-100000000000000000000000000000000000000", values.get(5).getValue()); @@ -5579,15 +5581,15 @@ public void testStructQuery() throws InterruptedException { assertEquals(2, Iterables.size(result.getValues())); for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { - assertEquals(null, value.getRecordValue().get("StringField").getValue()); - assertEquals(true, value.getRecordValue().get("BooleanField").getBooleanValue()); + assertNull(value.getRecordValue().get("StringField").getValue()); + assertTrue(value.getRecordValue().get("BooleanField").getBooleanValue()); } } } private static void assertsFieldValue(FieldValue record) { assertEquals(FieldValue.Attribute.RECORD, record.getAttribute()); - assertEquals(true, record.getRecordValue().get("booleanField").getBooleanValue()); + assertTrue(record.getRecordValue().get("booleanField").getBooleanValue()); assertEquals(10, record.getRecordValue().get("integerField").getLongValue()); assertEquals("test-stringField", record.getRecordValue().get("stringField").getStringValue()); } @@ -5622,12 +5624,12 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { for (FieldValueList values : result.iterateAll()) { for (FieldValue value : values) { assertEquals(Attribute.RECORD, value.getAttribute()); - assertEquals(true, value.getRecordValue().get(0).getRecordValue().get(0).getBooleanValue()); + assertTrue(value.getRecordValue().get(0).getRecordValue().get(0).getBooleanValue()); assertEquals(10, value.getRecordValue().get(0).getRecordValue().get(1).getLongValue()); assertEquals( "test-stringField", value.getRecordValue().get(0).getRecordValue().get(2).getStringValue()); - assertEquals(true, value.getRecordValue().get(1).getBooleanValue()); + assertTrue(value.getRecordValue().get(1).getBooleanValue()); assertEquals("test-stringField", value.getRecordValue().get(2).getStringValue()); assertEquals(10, value.getRecordValue().get(3).getLongValue()); } @@ -5674,7 +5676,7 @@ public void testGeographyParameter() throws Exception { int rowCount = 0; for (FieldValueList row : result.getValues()) { rowCount++; - assertEquals(true, row.get(0).getBooleanValue()); + assertTrue(row.get(0).getBooleanValue()); } assertEquals(1, rowCount); } @@ -5938,7 +5940,6 @@ public void testSnapshotTableCopyJob() throws InterruptedException { assertNotNull(snapshotTable); assertEquals(snapshotTableId.getDataset(), snapshotTable.getTableId().getDataset()); assertEquals(snapshotTableName, snapshotTable.getTableId().getTable()); - System.out.println(snapshotTable.getDefinition()); assertTrue(snapshotTable.getDefinition() instanceof SnapshotTableDefinition); assertEquals(DDL_TABLE_SCHEMA, snapshotTable.getDefinition().getSchema()); assertNotNull(((SnapshotTableDefinition) snapshotTable.getDefinition()).getSnapshotTime()); @@ -6034,7 +6035,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { assertEquals(FieldValue.Attribute.PRIMITIVE, booleanCell.getAttribute()); assertEquals(1408452095220000L, timestampCell.getTimestampValue()); assertEquals("stringValue", stringCell.getStringValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); rowCount++; } assertEquals(2, rowCount); @@ -6042,12 +6043,12 @@ public void testQueryJob() throws InterruptedException, TimeoutException { Job queryJob = bigquery.getJob(remoteJob.getJobId()); JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); if (statistics.getBiEngineStats() != null) { - assertEquals(statistics.getBiEngineStats().getBiEngineMode(), "DISABLED"); + assertEquals("DISABLED", statistics.getBiEngineStats().getBiEngineMode()); assertEquals( - statistics.getBiEngineStats().getBiEngineReasons().get(0).getCode(), "OTHER_REASON"); + "OTHER_REASON", statistics.getBiEngineStats().getBiEngineReasons().get(0).getCode()); assertEquals( - statistics.getBiEngineStats().getBiEngineReasons().get(0).getMessage(), - "Only SELECT queries without a destination table can be accelerated."); + "Only SELECT queries without a destination table can be accelerated.", + statistics.getBiEngineStats().getBiEngineReasons().get(0).getMessage()); } assertNotNull(statistics.getQueryPlan()); } @@ -6115,11 +6116,11 @@ public void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws Interru assertNull(remoteJob.getStatus().getError()); JobStatistics.QueryStatistics stats = remoteJob.getStatistics(); assertNotNull(stats.getSearchStats()); - assertEquals(stats.getSearchStats().getIndexUsageMode(), "UNUSED"); + assertEquals("UNUSED", stats.getSearchStats().getIndexUsageMode()); assertNotNull(stats.getSearchStats().getIndexUnusedReasons()); - assertNotNull( - stats.getSearchStats().getIndexUnusedReasons().get(0).getCode(), - "INDEX_CONFIG_NOT_AVAILABLE"); + assertEquals( + "INDEX_CONFIG_NOT_AVAILABLE", + stats.getSearchStats().getIndexUnusedReasons().get(0).getCode()); } finally { bigquery.delete(destinationTable); } @@ -6196,8 +6197,8 @@ public void testLoadJobWithDecimalTargetTypes() throws InterruptedException { Table remoteTable = bigquery.getTable(DATASET, tableName); assertNotNull(remoteTable); assertEquals( - remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString(), - "BIGNUMERIC"); + "BIGNUMERIC", + remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString()); } finally { bigquery.delete(destinationTable); } @@ -6218,8 +6219,8 @@ public void testExternalTableWithDecimalTargetTypes() throws InterruptedExceptio Table remoteTable = bigquery.getTable(DATASET, tableName); assertNotNull(remoteTable); assertEquals( - remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString(), - "BIGNUMERIC"); + "BIGNUMERIC", + remoteTable.getDefinition().getSchema().getFields().get(0).getType().toString()); assertTrue(remoteTable.delete()); } @@ -6422,13 +6423,13 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo assertEquals("stringValue", stringCell.getStringValue()); assertEquals(0, integerArrayCell.getRepeatedValue().get(0).getLongValue()); assertEquals(1, integerArrayCell.getRepeatedValue().get(1).getLongValue()); - assertEquals(false, booleanCell.getBooleanValue()); + assertFalse(booleanCell.getBooleanValue()); assertArrayEquals(BYTES, bytesCell.getBytesValue()); assertEquals(-14182916000000L, recordCell.getRecordValue().get(0).getTimestampValue()); assertTrue(recordCell.getRecordValue().get(1).isNull()); assertEquals(1, recordCell.getRecordValue().get(2).getRepeatedValue().get(0).getLongValue()); assertEquals(0, recordCell.getRecordValue().get(2).getRepeatedValue().get(1).getLongValue()); - assertEquals(true, recordCell.getRecordValue().get(3).getBooleanValue()); + assertTrue(recordCell.getRecordValue().get(3).getBooleanValue()); assertEquals(3, integerCell.getLongValue()); assertEquals(1.2, floatCell.getDoubleValue(), 0.0001); assertEquals("POINT(-122.35022 47.649154)", geographyCell.getStringValue()); @@ -6507,23 +6508,21 @@ public void testLocation() throws Exception { assertThat(location).isNotEqualTo(wrongLocation); Tracer tracer = otel.getTracer("Test Tracer"); - bigquery = + BigQuery otelBigquery = bigquery.getOptions().toBuilder() .setEnableOpenTelemetryTracing(true) .setOpenTelemetryTracer(tracer) .build() .getService(); + String datasetName = "locationset_" + UUID.randomUUID().toString().replace("-", "_"); Dataset dataset = - bigquery.create( - DatasetInfo.newBuilder("locationset_" + UUID.randomUUID().toString().replace("-", "_")) - .setLocation(location) - .build()); + otelBigquery.create(DatasetInfo.newBuilder(datasetName).setLocation(location).build()); try { TableId tableId = TableId.of(dataset.getDatasetId().getDataset(), "sometable"); Schema schema = Schema.of(Field.of("name", LegacySQLTypeName.STRING)); TableDefinition tableDef = StandardTableDefinition.of(schema); - Table table = bigquery.create(TableInfo.newBuilder(tableId, tableDef).build()); + Table table = otelBigquery.create(TableInfo.newBuilder(tableId, tableDef).build()); String query = String.format( @@ -6535,7 +6534,7 @@ public void testLocation() throws Exception { // Test create/get { Job job = - bigquery.create( + otelBigquery.create( JobInfo.of( JobId.newBuilder().setLocation(location).build(), QueryJobConfiguration.of(query))); @@ -6548,20 +6547,20 @@ public void testLocation() throws Exception { JobId wrongId = jobId.toBuilder().setLocation(wrongLocation).build(); // Getting with location should work. - assertThat(bigquery.getJob(jobId)).isNotNull(); + assertThat(otelBigquery.getJob(jobId)).isNotNull(); // Getting with wrong location shouldn't work. - assertThat(bigquery.getJob(wrongId)).isNull(); + assertThat(otelBigquery.getJob(wrongId)).isNull(); // Cancelling with location should work. (Cancelling already finished job is fine.) - assertThat(bigquery.cancel(jobId)).isTrue(); + assertThat(otelBigquery.cancel(jobId)).isTrue(); // Cancelling with wrong location shouldn't work. - assertThat(bigquery.cancel(wrongId)).isFalse(); + assertThat(otelBigquery.cancel(wrongId)).isFalse(); } // Test query { assertThat( - bigquery + otelBigquery .query( QueryJobConfiguration.of(query), JobId.newBuilder().setLocation(location).build()) @@ -6569,7 +6568,7 @@ public void testLocation() throws Exception { .isEmpty(); try { - bigquery + otelBigquery .query( QueryJobConfiguration.of(query), JobId.newBuilder().setLocation(wrongLocation).build()) @@ -6587,7 +6586,7 @@ public void testLocation() throws Exception { .setFormatOptions(FormatOptions.csv()) .build(); try (TableDataWriteChannel writer = - bigquery.writer( + otelBigquery.writer( JobId.newBuilder().setLocation(location).build(), writeChannelConfiguration)) { writer.write(ByteBuffer.wrap("foo".getBytes())); assertEquals( @@ -6597,22 +6596,16 @@ public void testLocation() throws Exception { location); } - try { - bigquery.writer( - JobId.newBuilder().setLocation(wrongLocation).build(), writeChannelConfiguration); + try (TableDataWriteChannel ignore = + otelBigquery.writer( + JobId.newBuilder().setLocation(wrongLocation).build(), writeChannelConfiguration)) { fail("writing to a table with wrong location shouldn't work"); } catch (BigQueryException e) { // Nothing to do } } } finally { - bigquery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); - bigquery = - bigquery.getOptions().toBuilder() - .setEnableOpenTelemetryTracing(false) - .setOpenTelemetryTracer(null) - .build() - .getService(); + RemoteBigQueryHelper.forceDelete(bigquery, datasetName); } } @@ -6708,7 +6701,7 @@ public void testReferenceFileSchemaUriForAvro() { Job job = bigquery.create(JobInfo.of(loadJobConfiguration)); // Blocks until this load table job completes its execution, either failing or succeeding. job = job.waitFor(); - assertEquals(true, job.isDone()); + assertTrue(job.isDone()); LoadJobConfiguration actualLoadJobConfiguration = job.getConfiguration(); Table generatedTable = bigquery.getTable(actualLoadJobConfiguration.getDestinationTable()); @@ -6716,7 +6709,7 @@ public void testReferenceFileSchemaUriForAvro() { assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests boolean success = bigquery.delete(tableId); - assertEquals(true, success); + assertTrue(success); } catch (BigQueryException | InterruptedException e) { System.out.println("Column not added during load append \n" + e.toString()); } @@ -6768,14 +6761,14 @@ public void testReferenceFileSchemaUriForParquet() { Job job = bigquery.create(JobInfo.of(loadJobConfiguration)); // Blocks until this load table job completes its execution, either failing or succeeding. job = job.waitFor(); - assertEquals(true, job.isDone()); + assertTrue(job.isDone()); LoadJobConfiguration actualLoadJobConfiguration = job.getConfiguration(); Table generatedTable = bigquery.getTable(actualLoadJobConfiguration.getDestinationTable()); assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests boolean success = bigquery.delete(tableId); - assertEquals(true, success); + assertTrue(success); } catch (BigQueryException | InterruptedException e) { System.out.println("Column not added during load append \n" + e.toString()); } @@ -6818,7 +6811,7 @@ public void testCreateExternalTableWithReferenceFileSchemaAvro() { assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests boolean success = bigquery.delete(tableId); - assertEquals(true, success); + assertTrue(success); } @Test @@ -6859,15 +6852,14 @@ public void testCreateExternalTableWithReferenceFileSchemaParquet() { Table generatedTable = bigquery.getTable(createdTable.getTableId()); assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests - boolean success = bigquery.delete(tableId); - assertEquals(true, success); + assertTrue(bigquery.delete(tableId)); } @Test public void testCloneTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; String ddlTableName = TABLE_ID_DDL.getTable(); - String cloneTableName = String.format("test_clone_table"); + String cloneTableName = "test_clone_table"; // Create source table with some data in it String ddlQuery = String.format( @@ -7277,11 +7269,9 @@ public void testStatelessQueriesWithLocation() throws Exception { BigQuery bigQuery = bigqueryHelper.getOptions().toBuilder().setLocation(location).build().getService(); + String datasetName = "locationset_" + UUID.randomUUID().toString().replace("-", "_"); Dataset dataset = - bigQuery.create( - DatasetInfo.newBuilder("locationset_" + UUID.randomUUID().toString().replace("-", "_")) - .setLocation(location) - .build()); + bigQuery.create(DatasetInfo.newBuilder(datasetName).setLocation(location).build()); try { TableId tableId = TableId.of(dataset.getDatasetId().getDataset(), "sometable"); Schema schema = Schema.of(Field.of("name", LegacySQLTypeName.STRING)); @@ -7313,7 +7303,7 @@ public void testStatelessQueriesWithLocation() throws Exception { // Nothing to do } } finally { - bigQuery.delete(dataset.getDatasetId(), DatasetDeleteOption.deleteContents()); + RemoteBigQueryHelper.forceDelete(bigQuery, datasetName); } } @@ -7376,7 +7366,7 @@ public void testUniverseDomainWithInvalidUniverseDomain() { bigQuery.listDatasets("bigquery-public-data"); fail("RPCs to invalid universe domain should fail"); } catch (BigQueryException e) { - assertEquals(e.getCode(), HTTP_UNAUTHORIZED); + assertEquals(HTTP_UNAUTHORIZED, e.getCode()); assertNotNull(e.getMessage()); assertThat( (e.getMessage() @@ -7399,7 +7389,7 @@ public void testInvalidUniverseDomainWithMismatchCredentials() { bigQuery.listDatasets("bigquery-public-data"); fail("RPCs to invalid universe domain should fail"); } catch (BigQueryException e) { - assertEquals(e.getCode(), HTTP_UNAUTHORIZED); + assertEquals(HTTP_UNAUTHORIZED, e.getCode()); assertNotNull(e.getMessage()); assertThat( (e.getMessage() @@ -7693,49 +7683,50 @@ public void testOpenTelemetryTracingDatasets() { .build(); dataset = bigquery.update(updatedInfo, DatasetOption.accessPolicyVersion(2)); - assertEquals(dataset.getDescription(), "Updated Description"); + assertEquals("Updated Description", dataset.getDescription()); assertTrue(bigquery.delete(dataset.getDatasetId())); } finally { parentSpan.end(); Map, Object> createMap = OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.createDataset"); - assertEquals(createMap.get(AttributeKey.stringKey("bq.dataset.location")), "null"); + assertEquals("null", createMap.get(AttributeKey.stringKey("bq.dataset.location"))); assertEquals( + "DatasetService", OTEL_ATTRIBUTES .get("com.google.cloud.bigquery.BigQueryRpc.createDataset") - .get(AttributeKey.stringKey("bq.rpc.service")), - "DatasetService"); + .get(AttributeKey.stringKey("bq.rpc.service"))); Map, Object> getMap = OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.getDataset"); - assertEquals(getMap.get(AttributeKey.stringKey("bq.dataset.id")), billingModelDataset); + assertEquals(billingModelDataset, getMap.get(AttributeKey.stringKey("bq.dataset.id"))); Map, Object> updateMap = OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.updateDataset"); - assertEquals(updateMap.get(AttributeKey.stringKey("bq.option.ACCESS_POLICY_VERSION")), "2"); + assertEquals("2", updateMap.get(AttributeKey.stringKey("bq.option.ACCESS_POLICY_VERSION"))); Map, Object> deleteMap = OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.deleteDataset"); - assertEquals(deleteMap.get(AttributeKey.stringKey("bq.dataset.id")), billingModelDataset); + assertEquals(billingModelDataset, deleteMap.get(AttributeKey.stringKey("bq.dataset.id"))); // All should be children spans of parentSpan + String testParentSpanName = "Test Parent Span"; assertEquals( + testParentSpanName, OTEL_SPAN_IDS_TO_NAMES.get( - OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.getDataset")), - "Test Parent Span"); + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.getDataset"))); assertEquals( + testParentSpanName, OTEL_SPAN_IDS_TO_NAMES.get( - OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createDataset")), - "Test Parent Span"); + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createDataset"))); assertEquals( + testParentSpanName, OTEL_SPAN_IDS_TO_NAMES.get( - OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.deleteDataset")), - "Test Parent Span"); + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.deleteDataset"))); assertEquals( OTEL_SPAN_IDS_TO_NAMES.get( OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQueryRpc.createDataset")), "com.google.cloud.bigquery.BigQueryRetryHelper.runWithRetries"); - assertEquals(OTEL_PARENT_SPAN_IDS.get("Test Parent Span"), OTEL_PARENT_SPAN_ID); + assertEquals(OTEL_PARENT_SPAN_ID, OTEL_PARENT_SPAN_IDS.get(testParentSpanName)); RemoteBigQueryHelper.forceDelete(bigquery, billingModelDataset); } } @@ -7757,26 +7748,26 @@ public void testOpenTelemetryTracingTables() { .setDescription("Some Description") .build(); Table createdTable = bigquery.create(tableInfo); - assertThat(createdTable.getDescription()).isEqualTo("Some Description"); + assertEquals("Some Description", createdTable.getDescription()); assertEquals( - OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createTable"), - OTEL_PARENT_SPAN_ID); + OTEL_PARENT_SPAN_ID, + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.createTable")); assertEquals( + tableName, OTEL_ATTRIBUTES .get("com.google.cloud.bigquery.BigQuery.createTable") - .get(AttributeKey.stringKey("bq.table.id")), - tableName); + .get(AttributeKey.stringKey("bq.table.id"))); assertEquals( + "null", OTEL_ATTRIBUTES .get("com.google.cloud.bigquery.BigQuery.createTable") - .get(AttributeKey.stringKey("bq.table.creation_time")), - "null"); + .get(AttributeKey.stringKey("bq.table.creation_time"))); assertEquals( + "InsertTable", OTEL_ATTRIBUTES .get("com.google.cloud.bigquery.BigQueryRpc.createTable") - .get(AttributeKey.stringKey("bq.rpc.method")), - "InsertTable"); + .get(AttributeKey.stringKey("bq.rpc.method"))); Table updatedTable = bigquery.update(createdTable.toBuilder().setDescription("Updated Description").build()); @@ -7785,8 +7776,8 @@ public void testOpenTelemetryTracingTables() { assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.updateTable")); assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQueryRpc.patchTable")); assertEquals( - OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.updateTable"), - OTEL_PARENT_SPAN_ID); + OTEL_PARENT_SPAN_ID, + OTEL_PARENT_SPAN_IDS.get("com.google.cloud.bigquery.BigQuery.updateTable")); assertTrue(bigquery.delete(updatedTable.getTableId())); } From 5d389cf45b41a0edceb3c5ed98dd2421ba6f2234 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 12 Dec 2025 21:51:40 +0000 Subject: [PATCH 2206/2268] deps: update actions/upload-artifact action to v6 (#4027) Co-authored-by: Blake Li --- .github/workflows/scorecard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1524dc8d2c..69df4a2532 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: SARIF file path: results.sarif From 3673310c47b5836caba997d76d60d3e8233ea146 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 12 Dec 2025 17:27:07 -0500 Subject: [PATCH 2207/2268] chore: Use assertThrows in tests (#4028) * chore: Cleanup initialized resources * chore: Use try-with to close stream * chore: Cleanup Intellij test warnings * chore: Allow for floating point inaccuracies * chore: Add otel delete operation * chore: Clean up rest of the IT test file * chore: Add GCA feedback --- .../cloud/bigquery/it/ITBigQueryTest.java | 388 +++++++++--------- .../bigquery/it/ITNightlyBigQueryTest.java | 3 +- 2 files changed, 186 insertions(+), 205 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index de9fef4ee5..80605884d3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -1201,6 +1202,15 @@ public static void afterClass() throws Exception { } } + static GoogleCredentials loadCredentials(String credentialFile) { + try (InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes())) { + return GoogleCredentials.fromStream(keyStream); + } catch (IOException e) { + fail("Couldn't create fake JSON credentials."); + } + return null; + } + @Test public void testListDatasets() { Page datasets = bigquery.listDatasets("bigquery-public-data"); @@ -1227,9 +1237,10 @@ public void testListDatasetsWithFilter() { for (Dataset dataset : datasets.getValues()) { assertTrue( "failed to find label key in dataset", dataset.getLabels().containsKey("example-label1")); - assertTrue( + assertEquals( "failed to find label value in dataset", - dataset.getLabels().get("example-label1").equals("example-value1")); + "example-value1", + dataset.getLabels().get("example-label1")); count++; } assertTrue(count > 0); @@ -1573,14 +1584,14 @@ public void testJsonType() throws InterruptedException { .setUseLegacySql(false) .addPositionalParameter(badJsonParameter) .build(); - try { - bigquery.query(dmlQueryJobConfiguration2); - fail("Querying with malformed JSON shouldn't work"); - } catch (BigQueryException e) { - BigQueryError error = e.getError(); - assertNotNull(error); - assertEquals("invalidQuery", error.getReason()); - } + BigQueryException exception = + assertThrows( + "Querying with malformed JSON shouldn't work", + BigQueryException.class, + () -> bigquery.query(dmlQueryJobConfiguration2)); + BigQueryError error = exception.getError(); + assertNotNull(error); + assertEquals("invalidQuery", error.getReason()); } finally { assertTrue(bigquery.delete(tableId)); } @@ -2808,15 +2819,15 @@ public void testUpdateNonExistingTable() { TableInfo.of( TableId.of(DATASET, "test_update_non_existing_table"), StandardTableDefinition.of(SIMPLE_SCHEMA)); - try { - bigquery.update(tableInfo); - fail("BigQueryException was expected"); - } catch (BigQueryException e) { - BigQueryError error = e.getError(); - assertNotNull(error); - assertEquals("notFound", error.getReason()); - assertNotNull(error.getMessage()); - } + BigQueryException exception = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.update(tableInfo)); + BigQueryError error = exception.getError(); + assertNotNull(error); + assertEquals("notFound", error.getReason()); + assertNotNull(error.getMessage()); } @Test @@ -3404,16 +3415,16 @@ public void testAuthorizeDataset() { public void testSingleStatementsQueryException() throws InterruptedException { String invalidQuery = String.format("INSERT %s.%s VALUES('3', 10);", DATASET, TABLE_ID.getTable()); - try { - bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor(); - fail("BigQueryException was expected"); - } catch (BigQueryException ex) { - assertEquals("invalidQuery", ex.getReason()); - assertNotNull(ex.getMessage()); - BigQueryError error = ex.getError(); - assertEquals("invalidQuery", error.getReason()); - assertNotNull(error.getMessage()); - } + BigQueryException exception = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor()); + assertEquals("invalidQuery", exception.getReason()); + assertNotNull(exception.getMessage()); + BigQueryError error = exception.getError(); + assertEquals("invalidQuery", error.getReason()); + assertNotNull(error.getMessage()); } /* TODO(prasmish): replicate the entire test case for executeSelect */ @@ -3423,16 +3434,16 @@ public void testMultipleStatementsQueryException() throws InterruptedException { String.format( "INSERT %s.%s VALUES('3', 10); DELETE %s.%s where c2=3;", DATASET, TABLE_ID.getTable(), DATASET, TABLE_ID.getTable()); - try { - bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor(); - fail("BigQueryException was expected"); - } catch (BigQueryException ex) { - assertEquals("invalidQuery", ex.getReason()); - assertNotNull(ex.getMessage()); - BigQueryError error = ex.getError(); - assertEquals("invalidQuery", error.getReason()); - assertNotNull(error.getMessage()); - } + BigQueryException exception = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor()); + assertEquals("invalidQuery", exception.getReason()); + assertNotNull(exception.getMessage()); + BigQueryError error = exception.getError(); + assertEquals("invalidQuery", error.getReason()); + assertNotNull(error.getMessage()); } @Test @@ -3668,12 +3679,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { BigQuery bigQueryBadCredentials = bigQueryOptionsBadCredentials.getService(); Connection connectionBadCredentials = bigQueryBadCredentials.createConnection(connectionSettings); - try { - connectionBadCredentials.executeSelect(query); - fail(); // this line should not be reached - } catch (BigQuerySQLException e) { - assertNotNull(e); - } + assertThrows(BigQuerySQLException.class, () -> connectionBadCredentials.executeSelect(query)); } /* TODO(prasmish): replicate the entire test case for executeSelect */ @@ -4228,12 +4234,7 @@ public void testExecuteSelectAsyncCancel() }); testCloseAsync.start(); - try { - executeSelectFut.get(); - fail(); // this line should not be reached - } catch (CancellationException e) { - assertNotNull(e); - } + assertThrows(CancellationException.class, executeSelectFut::get); } @Test @@ -4855,14 +4856,14 @@ public void testFastQueryHTTPException() throws InterruptedException { QueryJobConfiguration.newBuilder(queryInvalid) .setDefaultDataset(DatasetId.of(DATASET)) .build(); - try { - bigquery.query(configInvalidQuery); - fail("\"BigQueryException was expected\""); - } catch (BigQueryException e) { - BigQueryError error = e.getError(); - assertNotNull(error.getMessage()); - assertEquals("invalidQuery", error.getReason()); - } + BigQueryException exception = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.query(configInvalidQuery)); + BigQueryError error = exception.getError(); + assertNotNull(error.getMessage()); + assertEquals("invalidQuery", error.getReason()); String queryMissingTable = "SELECT * FROM " + TableId.of(DATASET, "non_existing_table").getTable(); @@ -4870,14 +4871,15 @@ public void testFastQueryHTTPException() throws InterruptedException { QueryJobConfiguration.newBuilder(queryMissingTable) .setDefaultDataset(DatasetId.of(DATASET)) .build(); - try { - bigquery.query(configMissingTable); - fail("\"BigQueryException was expected\""); - } catch (BigQueryException e) { - BigQueryError error = e.getError(); - assertNotNull(error.getMessage()); - assertEquals("notFound", error.getReason()); - } + + BigQueryException exception1 = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.query(configMissingTable)); + BigQueryError error1 = exception1.getError(); + assertNotNull(error1.getMessage()); + assertEquals("notFound", error1.getReason()); } @Test @@ -5559,12 +5561,11 @@ public void testEmptyRepeatedRecordNamedQueryParameters() throws InterruptedExce .setUseLegacySql(false) .addNamedParameter("repeatedRecordField", repeatedRecord) .build(); - try { - bigquery.query(config); - fail("an empty array of struct query parameter shouldn't work with 'IN UNNEST'"); - } catch (BigQueryException e) { - // Nothing to do - } + + assertThrows( + "an empty array of struct query parameter shouldn't work with 'IN UNNEST'", + BigQueryException.class, + () -> bigquery.query(config)); } @Test @@ -5904,7 +5905,7 @@ public void testSnapshotTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; String ddlTableName = TABLE_ID_DDL.getTable(); // this creates a snapshot table at specified snapshotTime - String snapshotTableName = String.format("test_snapshot_table"); + String snapshotTableName = "test_snapshot_table"; // Create source table with some data in it String ddlQuery = String.format( @@ -6374,20 +6375,17 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) .setSchema(TABLE_SCHEMA) .build(); - TableDataWriteChannel channel = bigquery.writer(configuration); - try { + try (TableDataWriteChannel channel = bigquery.writer(configuration)) { // A zero byte write should not throw an exception. assertEquals(0, channel.write(ByteBuffer.wrap("".getBytes(StandardCharsets.UTF_8)))); - } finally { - // Force the channel to flush by calling `close`. - channel.close(); } - channel = bigquery.writer(configuration); + TableDataWriteChannel channel = bigquery.writer(configuration); try { channel.write(ByteBuffer.wrap(JSON_CONTENT.getBytes(StandardCharsets.UTF_8))); } finally { channel.close(); } + // Channel must close before retrieving the job Job job = channel.getJob().waitFor(); LoadStatistics statistics = job.getStatistics(); assertEquals(1L, statistics.getInputFiles().longValue()); @@ -6452,20 +6450,17 @@ public void testInsertFromFileWithLabels() .setSchema(TABLE_SCHEMA) .setLabels(LABELS) .build(); - TableDataWriteChannel channel = bigquery.writer(configuration); - try { + try (TableDataWriteChannel channel = bigquery.writer(configuration)) { // A zero byte write should not throw an exception. assertEquals(0, channel.write(ByteBuffer.wrap("".getBytes(StandardCharsets.UTF_8)))); - } finally { - // Force the channel to flush by calling `close`. - channel.close(); } - channel = bigquery.writer(configuration); + TableDataWriteChannel channel = bigquery.writer(configuration); try { channel.write(ByteBuffer.wrap(JSON_CONTENT.getBytes(StandardCharsets.UTF_8))); } finally { channel.close(); } + // Channel must close before retrieving the job Job job = channel.getJob().waitFor(); LoadJobConfiguration jobConfiguration = job.getConfiguration(); assertEquals(TABLE_SCHEMA, jobConfiguration.getSchema()); @@ -6491,6 +6486,7 @@ public void testInsertWithDecimalTargetTypes() } finally { channel.close(); } + // Channel must close before retrieving the job Job job = channel.getJob().waitFor(); LoadJobConfiguration jobConfiguration = job.getConfiguration(); assertNull(job.getStatus().getError()); @@ -6532,52 +6528,47 @@ public void testLocation() throws Exception { table.getTableId().getTable()); // Test create/get - { - Job job = - otelBigquery.create( - JobInfo.of( - JobId.newBuilder().setLocation(location).build(), - QueryJobConfiguration.of(query))); - job = job.waitFor(); - assertThat(job.getStatus().getError()).isNull(); - - assertThat(job.getJobId().getLocation()).isEqualTo(location); - - JobId jobId = job.getJobId(); - JobId wrongId = jobId.toBuilder().setLocation(wrongLocation).build(); - - // Getting with location should work. - assertThat(otelBigquery.getJob(jobId)).isNotNull(); - // Getting with wrong location shouldn't work. - assertThat(otelBigquery.getJob(wrongId)).isNull(); - - // Cancelling with location should work. (Cancelling already finished job is fine.) - assertThat(otelBigquery.cancel(jobId)).isTrue(); - // Cancelling with wrong location shouldn't work. - assertThat(otelBigquery.cancel(wrongId)).isFalse(); - } + Job job = + otelBigquery.create( + JobInfo.of( + JobId.newBuilder().setLocation(location).build(), + QueryJobConfiguration.of(query))); + job = job.waitFor(); + assertThat(job.getStatus().getError()).isNull(); + + assertThat(job.getJobId().getLocation()).isEqualTo(location); + + JobId jobId = job.getJobId(); + JobId wrongId = jobId.toBuilder().setLocation(wrongLocation).build(); + + // Getting with location should work. + assertThat(otelBigquery.getJob(jobId)).isNotNull(); + // Getting with wrong location shouldn't work. + assertThat(otelBigquery.getJob(wrongId)).isNull(); + + // Cancelling with location should work. (Cancelling already finished job is fine.) + assertThat(otelBigquery.cancel(jobId)).isTrue(); + // Cancelling with wrong location shouldn't work. + assertThat(otelBigquery.cancel(wrongId)).isFalse(); // Test query - { - assertThat( - otelBigquery - .query( - QueryJobConfiguration.of(query), - JobId.newBuilder().setLocation(location).build()) - .iterateAll()) - .isEmpty(); - - try { - otelBigquery - .query( - QueryJobConfiguration.of(query), - JobId.newBuilder().setLocation(wrongLocation).build()) - .iterateAll(); - fail("querying a table with wrong location shouldn't work"); - } catch (BigQueryException e) { - // Nothing to do - } - } + assertThat( + otelBigquery + .query( + QueryJobConfiguration.of(query), + JobId.newBuilder().setLocation(location).build()) + .iterateAll()) + .isEmpty(); + + assertThrows( + "querying a table with wrong location shouldn't work", + BigQueryException.class, + () -> + otelBigquery + .query( + QueryJobConfiguration.of(query), + JobId.newBuilder().setLocation(wrongLocation).build()) + .iterateAll()); // Test write { @@ -6596,13 +6587,15 @@ public void testLocation() throws Exception { location); } - try (TableDataWriteChannel ignore = - otelBigquery.writer( - JobId.newBuilder().setLocation(wrongLocation).build(), writeChannelConfiguration)) { - fail("writing to a table with wrong location shouldn't work"); - } catch (BigQueryException e) { - // Nothing to do - } + assertThrows( + "writing to a table with wrong location shouldn't work", + BigQueryException.class, + () -> { + try (TableDataWriteChannel ignore = + otelBigquery.writer( + JobId.newBuilder().setLocation(wrongLocation).build(), + writeChannelConfiguration)) {} + }); } } finally { RemoteBigQueryHelper.forceDelete(bigquery, datasetName); @@ -6627,6 +6620,7 @@ public void testWriteChannelPreserveAsciiControlCharacters() } finally { channel.close(); } + // Channel must close before retrieving the job Job job = channel.getJob().waitFor(); assertNull(job.getStatus().getError()); Page rows = bigquery.listTableData(tableId); @@ -6708,10 +6702,9 @@ public void testReferenceFileSchemaUriForAvro() { assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests - boolean success = bigquery.delete(tableId); - assertTrue(success); + assertTrue(bigquery.delete(tableId)); } catch (BigQueryException | InterruptedException e) { - System.out.println("Column not added during load append \n" + e.toString()); + System.out.println("Column not added during load append \n" + e); } } @@ -6767,10 +6760,9 @@ public void testReferenceFileSchemaUriForParquet() { assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests - boolean success = bigquery.delete(tableId); - assertTrue(success); + assertTrue(bigquery.delete(tableId)); } catch (BigQueryException | InterruptedException e) { - System.out.println("Column not added during load append \n" + e.toString()); + System.out.println("Column not added during load append \n" + e); } } @@ -6810,8 +6802,7 @@ public void testCreateExternalTableWithReferenceFileSchemaAvro() { Table generatedTable = bigquery.getTable(createdTable.getTableId()); assertEquals(expectedSchema, generatedTable.getDefinition().getSchema()); // clean up after test to avoid conflict with other tests - boolean success = bigquery.delete(tableId); - assertTrue(success); + assertTrue(bigquery.delete(tableId)); } @Test @@ -7208,8 +7199,7 @@ public void testStatelessQueries() throws InterruptedException { private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedException { String query = "SELECT CURRENT_TIMESTAMP() as ts"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); - TableResult result = bigQuery.query(config); - return result; + return bigQuery.query(config); } @Test @@ -7291,17 +7281,20 @@ public void testStatelessQueriesWithLocation() throws Exception { assertNull(tb.getJobId()); // Test stateless query when BigQueryOption location does not match dataset location. - try { - BigQuery bigQueryWrongLocation = - bigqueryHelper.getOptions().toBuilder().setLocation(wrongLocation).build().getService(); - bigQueryWrongLocation - .getOptions() - .setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); - bigQueryWrongLocation.query(QueryJobConfiguration.of(query)); - fail("querying a table with wrong location shouldn't work"); - } catch (BigQueryException e) { - // Nothing to do - } + assertThrows( + "querying a table with wrong location shouldn't work", + BigQueryException.class, + () -> { + BigQuery bigQueryWrongLocation = + bigqueryHelper.getOptions().toBuilder() + .setLocation(wrongLocation) + .build() + .getService(); + bigQueryWrongLocation + .getOptions() + .setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); + bigQueryWrongLocation.query(QueryJobConfiguration.of(query)); + }); } finally { RemoteBigQueryHelper.forceDelete(bigQuery, datasetName); } @@ -7361,18 +7354,17 @@ public void testUniverseDomainWithInvalidUniverseDomain() { .build(); BigQuery bigQuery = bigQueryOptions.getService(); - try { - // Use list dataset to send RPC to invalid domain. - bigQuery.listDatasets("bigquery-public-data"); - fail("RPCs to invalid universe domain should fail"); - } catch (BigQueryException e) { - assertEquals(HTTP_UNAUTHORIZED, e.getCode()); - assertNotNull(e.getMessage()); - assertThat( - (e.getMessage() - .contains("does not match the universe domain found in the credentials"))) - .isTrue(); - } + BigQueryException exception = + assertThrows( + "RPCs to invalid universe domain should fail", + BigQueryException.class, + () -> bigQuery.listDatasets("bigquery-public-data")); + assertEquals(HTTP_UNAUTHORIZED, exception.getCode()); + assertNotNull(exception.getMessage()); + assertTrue( + exception + .getMessage() + .contains("does not match the universe domain found in the credentials")); } @Test @@ -7384,18 +7376,17 @@ public void testInvalidUniverseDomainWithMismatchCredentials() { .build(); BigQuery bigQuery = bigQueryOptions.getService(); - try { - // Use list dataset to send RPC to invalid domain. - bigQuery.listDatasets("bigquery-public-data"); - fail("RPCs to invalid universe domain should fail"); - } catch (BigQueryException e) { - assertEquals(HTTP_UNAUTHORIZED, e.getCode()); - assertNotNull(e.getMessage()); - assertThat( - (e.getMessage() - .contains("does not match the universe domain found in the credentials"))) - .isTrue(); - } + BigQueryException exception = + assertThrows( + "RPCs to invalid universe domain should fail", + BigQueryException.class, + () -> bigQuery.listDatasets("bigquery-public-data")); + assertEquals(HTTP_UNAUTHORIZED, exception.getCode()); + assertNotNull(exception.getMessage()); + assertTrue( + exception + .getMessage() + .contains("does not match the universe domain found in the credentials")); } @Test @@ -7477,17 +7468,18 @@ public void testExternalMetadataCacheModeFailForNonBiglake() { .build(); TableInfo tableInfo = TableInfo.of(tableId, externalTableDefinition); - try { - bigquery.create(tableInfo); - fail("BigQueryException was expected"); - } catch (BigQueryException e) { - BigQueryError error = e.getError(); - assertNotNull(error); - assertEquals("invalid", error.getReason()); - assertThat( - e.getMessage().contains("metadataCacheMode provided for non BigLake external table")) - .isTrue(); - } + BigQueryException exception = + assertThrows( + "BigQueryException was expected", + BigQueryException.class, + () -> bigquery.create(tableInfo)); + BigQueryError error = exception.getError(); + assertNotNull(error); + assertEquals("invalid", error.getReason()); + assertTrue( + exception + .getMessage() + .contains("metadataCacheMode provided for non BigLake external table")); } @Test @@ -7533,16 +7525,6 @@ public void testObjectTable() throws InterruptedException { } } - static GoogleCredentials loadCredentials(String credentialFile) { - try { - InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); - return GoogleCredentials.fromStream(keyStream); - } catch (IOException e) { - fail("Couldn't create fake JSON credentials."); - } - return null; - } - @Test public void testQueryExportStatistics() throws InterruptedException { String query = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index 588484749c..790f35fe5c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -63,7 +63,6 @@ import java.util.Map; import java.util.TimeZone; import java.util.UUID; -import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.arrow.vector.util.JsonStringArrayList; @@ -183,7 +182,7 @@ public static void beforeClass() throws InterruptedException, IOException { } @AfterClass - public static void afterClass() throws ExecutionException, InterruptedException { + public static void afterClass() { try { if (bigquery != null) { deleteTable(DATASET, TABLE); From 00ec93962debcdee7cfed506bc33c9f75082fa33 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 22:11:32 -0500 Subject: [PATCH 2208/2268] chore(main): release 2.57.1 (#4029) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9397c65bc..469bc0b33d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.57.1](https://github.com/googleapis/java-bigquery/compare/v2.57.0...v2.57.1) (2025-12-12) + + +### Dependencies + +* Update actions/upload-artifact action to v6 ([#4027](https://github.com/googleapis/java-bigquery/issues/4027)) ([5d389cf](https://github.com/googleapis/java-bigquery/commit/5d389cf45b41a0edceb3c5ed98dd2421ba6f2234)) + ## [2.57.0](https://github.com/googleapis/java-bigquery/compare/v2.56.0...v2.57.0) (2025-12-11) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8d70e4d685..4b04479cd3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.1-SNAPSHOT + 2.57.1 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 3532008034..dc9d046e59 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.1-SNAPSHOT + 2.57.1 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1-SNAPSHOT + 2.57.1 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 9517e49198..adeb1ce480 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.1-SNAPSHOT + 2.57.1 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.1-SNAPSHOT + 2.57.1 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 129c6226c6..9c123afe21 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.1-SNAPSHOT + 2.57.1 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1-SNAPSHOT + 2.57.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3976d33b4e..901c0c5ca0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1-SNAPSHOT + 2.57.1 diff --git a/versions.txt b/versions.txt index e6d97a7042..218ca40390 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.0:2.57.1-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.57.1:2.57.1 \ No newline at end of file From c18702edc69cee76e7ae7a2bbedbc9c1a16b48dc Mon Sep 17 00:00:00 2001 From: Blake Li Date: Mon, 15 Dec 2025 10:46:26 -0500 Subject: [PATCH 2209/2268] chore: Update renovate.json (#4031) deps update from bigquerystorage was incorrectly marked as chore(deps). This would cause the upgrade not show up in the release notes and also not trigger release please. This is because the pattern /^com.google.cloud:google-cloud-bigquery is configured in renovate.json, which matches both bigquery and bigquerystorage. However, I believe the original intention is only for bigquery update in samples, not for bigquerystorage update. Fixing the pattern so that the String must ends with bigquery --- renovate.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/renovate.json b/renovate.json index 38fdb78ebd..dc6b01e796 100644 --- a/renovate.json +++ b/renovate.json @@ -44,14 +44,6 @@ "/^com.google.guava:/" ] }, - { - "semanticCommitType": "deps", - "semanticCommitScope": null, - "matchPackageNames": [ - "*", - "/^com.google.cloud:google-cloud-bigquerystorage/" - ] - }, { "semanticCommitType": "build", "semanticCommitScope": "deps", @@ -68,7 +60,7 @@ "semanticCommitType": "chore", "semanticCommitScope": "deps", "matchPackageNames": [ - "/^com.google.cloud:google-cloud-bigquery/", + "/^com.google.cloud:google-cloud-bigquery$/", "/^com.google.cloud:google-cloud-bigtable/", "/^com.google.cloud:libraries-bom/", "/^com.google.cloud.samples:shared-configuration/" From adbe2e04db7d45cc1d12368de3e0a728a6b56ab8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:35:55 -0500 Subject: [PATCH 2210/2268] chore(main): release 2.57.2-SNAPSHOT (#4032) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4b04479cd3..41e1a2fcb3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.1 + 2.57.2-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index dc9d046e59..4cfd474143 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.1 + 2.57.2-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1 + 2.57.2-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index adeb1ce480..5e86e77fd2 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.1 + 2.57.2-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.1 + 2.57.2-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9c123afe21..44548ec5c2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.1 + 2.57.2-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1 + 2.57.2-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 901c0c5ca0..e10b51dc7d 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.1 + 2.57.2-SNAPSHOT diff --git a/versions.txt b/versions.txt index 218ca40390..507619351d 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.1:2.57.1 \ No newline at end of file +google-cloud-bigquery:2.57.1:2.57.2-SNAPSHOT \ No newline at end of file From 7198340e7596089d6c69256fd9d982a7f1c17c85 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 15 Dec 2025 16:02:33 -0500 Subject: [PATCH 2211/2268] test: Add integration tests for picosecond support (#4030) * test: Add integration tests for picosecond support * chore: Add a micro -> pico exact timestamp test case * chore: Add additional test cases * chore: Fix test cases with 'Z' * chore: Test if first query has an impact * chore: Remove flaky test for now * chore: Remove testing comment --- .../cloud/bigquery/QueryParameterValue.java | 6 +- .../testing/RemoteBigQueryHelper.java | 19 +- .../bigquery/it/ITHighPrecisionTimestamp.java | 319 ++++++++++++++++++ 3 files changed, 336 insertions(+), 8 deletions(-) create mode 100644 google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java index cb4e44861d..89e7ae85bf 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/QueryParameterValue.java @@ -328,9 +328,9 @@ public static QueryParameterValue timestamp(Long value) { *

    This method supports up to picosecond precision (12 digits) for timestamp. Input should * conform to ISO8601 format. * - *

    Must be in the format "yyyy-MM-dd HH:mm:ss.SSSSSS{SSSSSSS}ZZ", e.g. "2014-08-19 - * 12:41:35.123456+00:00" for microsecond precision and "2014-08-19 12:41:35.123456789123+00:00" - * for picosecond precision + *

    Should be in the format "yyyy-MM-dd HH:mm:ss.SSSSSS{SSSSSSS}Z", e.g. "2014-08-19 + * 12:41:35.123456Z" for microsecond precision and "2014-08-19 12:41:35.123456789123Z" for + * picosecond precision */ public static QueryParameterValue timestamp(String value) { return of(value, StandardSQLTypeName.TIMESTAMP); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java index 4b1767362c..c32e1a0516 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java @@ -120,18 +120,27 @@ public static RemoteBigQueryHelper create(String projectId, InputStream keyStrea * credentials. */ public static RemoteBigQueryHelper create() { + return create(BigQueryOptions.newBuilder()); + } + + /** + * Creates a {@code RemoteBigQueryHelper} object using default project id and authentication + * credentials. + * + * @param bigqueryOptionsBuilder Custom BigqueryOptions.Builder with some pre-defined settings + */ + public static RemoteBigQueryHelper create(BigQueryOptions.Builder bigqueryOptionsBuilder) { HttpTransportOptions transportOptions = BigQueryOptions.getDefaultHttpTransportOptions(); transportOptions = transportOptions.toBuilder() .setConnectTimeout(connectTimeout) .setReadTimeout(connectTimeout) .build(); - BigQueryOptions bigqueryOptions = - BigQueryOptions.newBuilder() + BigQueryOptions.Builder builder = + bigqueryOptionsBuilder .setRetrySettings(retrySettings()) - .setTransportOptions(transportOptions) - .build(); - return new RemoteBigQueryHelper(bigqueryOptions); + .setTransportOptions(transportOptions); + return new RemoteBigQueryHelper(builder.build()); } private static RetrySettings retrySettings() { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java new file mode 100644 index 0000000000..332071a620 --- /dev/null +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java @@ -0,0 +1,319 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.DataFormatOptions; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.InsertAllRequest; +import com.google.cloud.bigquery.InsertAllResponse; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.Table; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; +import com.google.cloud.bigquery.TableResult; +import com.google.cloud.bigquery.testing.RemoteBigQueryHelper; +import com.google.protobuf.Timestamp; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ITHighPrecisionTimestamp { + + public static final String TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME = + "test_high_precision_timestamp"; + private static BigQuery bigquery; + private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); + private static TableId defaultTableId; + public static final long TIMESTAMP_PICOSECOND_PRECISION = 12L; + private static final Field TIMESTAMP_HIGH_PRECISION_FIELD_SCHEMA = + Field.newBuilder("timestampHighPrecisionField", StandardSQLTypeName.TIMESTAMP) + .setTimestampPrecision(TIMESTAMP_PICOSECOND_PRECISION) + .build(); + private static final Schema TABLE_SCHEMA = Schema.of(TIMESTAMP_HIGH_PRECISION_FIELD_SCHEMA); + + private static final String TIMESTAMP1 = "2025-01-01T12:34:56.123456789123Z"; + private static final String TIMESTAMP2 = "1970-01-01T12:34:56.123456789123Z"; + private static final String TIMESTAMP3 = "2000-01-01T12:34:56.123456789123Z"; + + @BeforeClass + public static void beforeClass() { + BigQueryOptions.Builder builder = + BigQueryOptions.newBuilder() + .setDataFormatOptions( + DataFormatOptions.newBuilder() + .timestampFormatOptions(DataFormatOptions.TimestampFormatOptions.ISO8601_STRING) + .build()); + RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(builder); + bigquery = bigqueryHelper.getOptions().getService(); + + // Create a new dataset + DatasetInfo info = DatasetInfo.newBuilder(DATASET).build(); + bigquery.create(info); + + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build(); + defaultTableId = TableId.of(DATASET, TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME); + + // Create a new table that can be re-used by the test cases + Table createdTable = bigquery.create(TableInfo.of(defaultTableId, tableDefinition)); + assertNotNull(createdTable); + + // Populate with some starter data + Map timestamp1 = + Collections.singletonMap("timestampHighPrecisionField", TIMESTAMP1); + Map timestamp2 = + Collections.singletonMap("timestampHighPrecisionField", TIMESTAMP2); + Map timestamp3 = + Collections.singletonMap("timestampHighPrecisionField", TIMESTAMP3); + InsertAllRequest request = + InsertAllRequest.newBuilder(defaultTableId) + .addRow(timestamp1) + .addRow(timestamp2) + .addRow(timestamp3) + .build(); + InsertAllResponse response = bigquery.insertAll(request); + assertFalse(response.hasErrors()); + assertEquals(0, response.getInsertErrors().size()); + } + + @AfterClass + public static void afterClass() { + if (bigquery != null) { + bigquery.delete(defaultTableId); + RemoteBigQueryHelper.forceDelete(bigquery, DATASET); + } + } + + private static String generateTempTableName() { + return String.format( + "insert_temp_%s%s", + UUID.randomUUID().toString().substring(0, 6), TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME); + } + + @Test + public void query_highPrecisionTimestamp() throws InterruptedException { + String sql = + String.format("SELECT timestampHighPrecisionField FROM %s;", defaultTableId.getTable()); + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(sql) + .setDefaultDataset(DatasetId.of(DATASET)) + .setUseLegacySql(false) + .build(); + TableResult result = bigquery.query(queryJobConfiguration); + assertNotNull(result.getJobId()); + String[] expected = new String[] {TIMESTAMP1, TIMESTAMP2, TIMESTAMP3}; + List timestamps = + StreamSupport.stream(result.getValues().spliterator(), false) + .map(x -> (String) x.get(0).getValue()) + .collect(Collectors.toList()); + assertEquals(expected.length, timestamps.size()); + for (int i = 0; i < timestamps.size(); i++) { + assertEquals(expected[i], timestamps.get(i)); + } + } + + @Test + public void insert_highPrecisionTimestamp_ISOValidFormat() { + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build(); + String tempTableName = generateTempTableName(); + TableId tableId = TableId.of(DATASET, tempTableName); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + + Map timestampISO = + Collections.singletonMap("timestampHighPrecisionField", "2025-01-01T12:34:56.123456Z"); + InsertAllRequest request = InsertAllRequest.newBuilder(tableId).addRow(timestampISO).build(); + InsertAllResponse response = bigquery.insertAll(request); + assertFalse(response.hasErrors()); + assertEquals(0, response.getInsertErrors().size()); + + bigquery.delete(tableId); + } + + @Test + public void insert_highPrecisionTimestamp_invalidFormats() { + StandardTableDefinition tableDefinition = + StandardTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build(); + String tempTable = generateTempTableName(); + TableId tableId = TableId.of(DATASET, tempTable); + Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); + assertNotNull(createdTable); + + Map timestampInMicros = + Collections.singletonMap("timestampHighPrecisionField", 123456); + Map timestampInMicrosString = + Collections.singletonMap("timestampHighPrecisionField", "123456"); + Map timestampNegative = + Collections.singletonMap("timestampHighPrecisionField", -123456); + Map timestampFloat = + Collections.singletonMap("timestampHighPrecisionField", 1000.0); + Map timestampProtobuf = + Collections.singletonMap( + "timestampHighPrecisionField", + Timestamp.newBuilder().setSeconds(123456789).setNanos(123456789).build()); + Map timestampProtobufNegative = + Collections.singletonMap( + "timestampHighPrecisionField", + Timestamp.newBuilder().setSeconds(-123456789).setNanos(-123456789).build()); + InsertAllRequest request = + InsertAllRequest.newBuilder(tableId) + .addRow(timestampInMicros) + .addRow(timestampInMicrosString) + .addRow(timestampNegative) + .addRow(timestampFloat) + .addRow(timestampProtobuf) + .addRow(timestampProtobufNegative) + .build(); + InsertAllResponse response = bigquery.insertAll(request); + assertTrue(response.hasErrors()); + assertEquals(request.getRows().size(), response.getInsertErrors().size()); + + bigquery.delete(tableId); + } + + @Test + public void queryNamedParameter_highPrecisionTimestamp() throws InterruptedException { + String query = + String.format( + "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", + DATASET, defaultTableId.getTable()); + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter( + "timestampParam", + QueryParameterValue.timestamp("2000-01-01 12:34:56.123456789123Z")) + .build(); + + TableResult result = bigquery.query(queryConfig); + assertNotNull(result); + String[] expected = new String[] {TIMESTAMP1, TIMESTAMP3}; + List timestamps = + StreamSupport.stream(result.getValues().spliterator(), false) + .map(x -> (String) x.get(0).getValue()) + .collect(Collectors.toList()); + assertEquals(expected.length, timestamps.size()); + for (int i = 0; i < timestamps.size(); i++) { + assertEquals(expected[i], timestamps.get(i)); + } + } + + @Test + public void queryNamedParameter_highPrecisionTimestamp_microsLong() throws InterruptedException { + String query = + String.format( + "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", + DATASET, defaultTableId.getTable()); + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter( + "timestampParam", + QueryParameterValue.timestamp( + 946730096123456L)) // micros for 2000-01-01 12:34:56.123456Z + .build(); + + TableResult result = bigquery.query(queryConfig); + assertNotNull(result); + // Exact timestamp for TIMESTAMP3 is `2000-01-01T12:34:56.123456789123Z` and for the micros + // is `2000-01-01T12:34:56.123456Z`. The micros value gets cast to 12 digits of precision, so + // it becomes `2000-01-01T12:34:56.123456000000Z`. We do expect it as part of the query. + String[] expected = new String[] {TIMESTAMP1, TIMESTAMP3}; + List timestamps = + StreamSupport.stream(result.getValues().spliterator(), false) + .map(x -> (String) x.get(0).getValue()) + .collect(Collectors.toList()); + assertEquals(expected.length, timestamps.size()); + for (int i = 0; i < timestamps.size(); i++) { + assertEquals(expected[i], timestamps.get(i)); + } + } + + @Test + public void queryNamedParameter_highPrecisionTimestamp_microsISOString() + throws InterruptedException { + String query = + String.format( + "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", + DATASET, defaultTableId.getTable()); + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter( + "timestampParam", QueryParameterValue.timestamp("2000-01-01 12:34:56.123456Z")) + .build(); + + TableResult result = bigquery.query(queryConfig); + assertNotNull(result); + List timestamps = + StreamSupport.stream(result.getValues().spliterator(), false) + .map(x -> (String) x.get(0).getValue()) + .collect(Collectors.toList()); + String[] expected = new String[] {TIMESTAMP1, TIMESTAMP3}; + assertEquals(expected.length, timestamps.size()); + for (int i = 0; i < timestamps.size(); i++) { + assertEquals(expected[i], timestamps.get(i)); + } + } + + @Test + public void queryNamedParameter_highPrecisionTimestamp_noExplicitCastInQuery_fails() { + String query = + String.format( + "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= @timestampParam", + DATASET, defaultTableId.getTable()); + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addNamedParameter( + "timestampParam", QueryParameterValue.timestamp("2000-01-01 12:34:56.123456789123")) + .build(); + + BigQueryException exception = + assertThrows(BigQueryException.class, () -> bigquery.query(queryConfig)); + assertEquals("Invalid argument type passed to a function", exception.getMessage()); + } +} From fa0a12e3cf171abab528c318ba3f4260b69a5274 Mon Sep 17 00:00:00 2001 From: Abgar Simonean Date: Fri, 19 Dec 2025 06:03:25 +0200 Subject: [PATCH 2212/2268] fix: Job.isDone() uses Job.Status.State if available (#4039) --- .../src/main/java/com/google/cloud/bigquery/Job.java | 9 ++++++++- .../src/test/java/com/google/cloud/bigquery/JobTest.java | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java index 88950b9fb2..c64327500f 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Job.java @@ -210,6 +210,9 @@ public boolean exists() { */ public boolean isDone() { checkNotDryRun("isDone"); + if (hasDoneState()) { + return true; + } Span isDone = null; if (options.isOpenTelemetryTracingEnabled() && options.getOpenTelemetryTracer() != null) { isDone = @@ -220,7 +223,7 @@ public boolean isDone() { } try (Scope isDoneScope = isDone != null ? isDone.makeCurrent() : null) { Job job = bigquery.getJob(getJobId(), JobOption.fields(BigQuery.JobField.STATUS)); - return job == null || JobStatus.State.DONE.equals(job.getStatus().getState()); + return job == null || job.hasDoneState(); } finally { if (isDone != null) { isDone.end(); @@ -228,6 +231,10 @@ public boolean isDone() { } } + private boolean hasDoneState() { + return getStatus() != null && JobStatus.State.DONE.equals(getStatus().getState()); + } + /** See {@link #waitFor(BigQueryRetryConfig, RetryOption...)} */ public Job waitFor(RetryOption... waitOptions) throws InterruptedException { return waitForInternal(DEFAULT_RETRY_CONFIG, waitOptions); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index f12d9fcafa..e6d249af46 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -157,11 +157,9 @@ public void testExists_False() { @Test public void testIsDone_True() { - BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; Job job = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.DONE)).build(); - when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(job); assertTrue(job.isDone()); - verify(bigquery).getJob(JOB_INFO.getJobId(), expectedOptions); + verify(bigquery, times(0)).getJob(eq(JOB_INFO.getJobId()), any()); } @Test @@ -176,8 +174,10 @@ public void testIsDone_False() { @Test public void testIsDone_NotExists() { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; + Job jobWithRunningState = + expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(null); - assertTrue(job.isDone()); + assertTrue(jobWithRunningState.isDone()); verify(bigquery).getJob(JOB_INFO.getJobId(), expectedOptions); } From d214d10e4ad216ea6e8d3405b71b1f1212f29f4a Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 23 Dec 2025 15:54:46 -0500 Subject: [PATCH 2213/2268] chore: remove build badges (#4046) b/468377909 --- README.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/README.md b/README.md index d8f6c46d87..0d2e002bd3 100644 --- a/README.md +++ b/README.md @@ -327,29 +327,10 @@ information. Apache 2.0 - See [LICENSE][license] for more information. -## CI Status - -Java Version | Status ------------- | ------ -Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] -Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] -Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] -Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] - Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/bigquery [javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigquery/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery.svg [maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery/2.42.2 From 4bb157c935a69f099189d8ee50e84d0a33b57505 Mon Sep 17 00:00:00 2001 From: Sivamurugan P <73530366+SivamuruganP@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:41:21 +0530 Subject: [PATCH 2214/2268] chore: handled race condition in stateless query integration test (#4045) * fix: handled race condition in stateless query integration test The testTableResultJobIdAndQueryId test was failing intermittently on slower networks. The test strictly asserted that Job ID must be null for stateless queries. However, the library correctly falls back to creating a Job ID if the stateless query times out. This change updates the assertion logic to accept either a valid Query ID (stateless success) or a valid Job ID (fallback success). Fixes #4008 * refactor: use XOR assertion for conciseness Applied feedback from code review to use exclusive OR operator for validating JobID/QueryID mutual exclusivity. * fix: apply race condition logic to testStatelessQueries Applied XOR assertion logic to testStatelessQueries. Test was failing on slow networks because they did not account for JOB_CREATION_OPTIONAL falling back to job creation. Fixes #4002 * docs: add comment explaining stateless query fallback behavior * docs: add comment explaining stateless query fallback behavior in testTableResultJobIdAndQueryId() --- .../cloud/bigquery/it/ITBigQueryTest.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 80605884d3..ecb5e0c63d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -7181,8 +7181,12 @@ public void testStatelessQueries() throws InterruptedException { // Stateless query should have no job id. bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); TableResult tableResult = executeSimpleQuery(bigQuery); - assertNotNull(tableResult.getQueryId()); - assertNull(tableResult.getJobId()); + // Use XOR: We accept EITHER a QueryId (fast path) OR a JobId (slow fallback), but not both. + // Ideally Stateless query will return queryId but in some cases it would return jobId instead + // of queryId based on the query complexity or other factors (job timeout configs). + assertTrue( + "Exactly one of jobId or queryId should be non-null", + (tableResult.getJobId() != null) ^ (tableResult.getQueryId() != null)); // Job creation takes over, no query id is created. bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED); @@ -7220,8 +7224,14 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { String query = "SELECT 1 as one"; QueryJobConfiguration configStateless = QueryJobConfiguration.newBuilder(query).build(); TableResult result = bigQuery.query(configStateless); - assertNull(result.getJobId()); - assertNotNull(result.getQueryId()); + // A stateless query should result in either a queryId (stateless success) or a jobId (fallback + // to a job). + // Exactly one of them should be non-null. + // Ideally Stateless query will return queryId but in some cases it would return jobId instead + // of queryId based on the query complexity or other factors (job timeout configs). + assertTrue( + "Exactly one of jobId or queryId should be non-null", + (result.getJobId() != null) ^ (result.getQueryId() != null)); // Test scenario 2 by failing stateless check by setting job timeout. QueryJobConfiguration configQueryWithJob = From cbd5d238b2a3a6abf7d2eb9f62e69680ccfc580b Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 29 Dec 2025 17:53:14 -0500 Subject: [PATCH 2215/2268] chore: Ignore unused declared junit-jupiter-engine error in dependencies check (#4048) * chore: Ingore unused junit-jupiter-engine error in dependencies check * chore: Update pom.xml Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * chore: Update comment format for junit-jupiter-engine --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 44548ec5c2..4cded9553c 100644 --- a/pom.xml +++ b/pom.xml @@ -172,6 +172,8 @@ io.netty:netty-common org.apache.arrow:arrow-memory-netty com.google.api:gax + + org.junit.jupiter:junit-jupiter-engine From 031deb00f153b47d37655b025fcef298a3db0e0b Mon Sep 17 00:00:00 2001 From: Sivamurugan P <73530366+SivamuruganP@users.noreply.github.com> Date: Tue, 30 Dec 2025 23:55:08 +0530 Subject: [PATCH 2216/2268] =?UTF-8?q?fix:=20gracefully=20handle=20thread?= =?UTF-8?q?=20interruption=20in=20ConnectionImpl=20to=20preve=E2=80=A6=20(?= =?UTF-8?q?#4047)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: gracefully handle thread interruption in ConnectionImpl to prevent CI flakes Fixes #3992 * fix: consolidate interrupt checks and handle raw InterruptedException as per review * fix: remove CancelledException check per review feedback --- .../java/com/google/cloud/bigquery/ConnectionImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java index c3465c33a8..d31a406e40 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ConnectionImpl.java @@ -1069,7 +1069,15 @@ private void processArrowStreamAsync( } } catch (Exception e) { - throw BigQueryException.translateAndThrow(e); + if (e instanceof InterruptedException || e.getCause() instanceof InterruptedException) { + // Log silently and let it fall through to 'finally' for cleanup. + // This is the "graceful shutdown". + logger.log( + Level.INFO, "Background thread interrupted (Connection Closed). Stopping."); + Thread.currentThread().interrupt(); + } else { + throw BigQueryException.translateAndThrow(e); + } } finally { // logic needed for graceful shutdown // marking end of stream try { From 2578dcbb1340a1a121cdb335b16e21fef7a0638f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 6 Jan 2026 22:21:25 +0000 Subject: [PATCH 2217/2268] chore(deps): update dependency com.google.cloud:libraries-bom to v26.73.0 (#3922) --- samples/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index d6cbcca5d1..1903381ad7 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -47,7 +47,7 @@ com.google.cloud libraries-bom - 26.64.0 + 26.73.0 pom import From fac16a8eb05a6e13e406feeb9761259cdbf8e674 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 7 Jan 2026 13:19:10 -0500 Subject: [PATCH 2218/2268] docs: Add specific samples for creating and query timestamps (#4051) * docs: Add specific samples for creating and query timestamps * chore: Fix samples checkstyle issue * chore: Address gemini suggestions * chore: Update expiration time for test --- .../cloud/bigquery/it/ITBigQueryTest.java | 8 +- .../bigquery/CreateTableTimestamp.java | 59 ++++++++++++++ .../QueryWithTimestampParameters.java | 34 +++++++- .../com/example/bigquery/CreateTableIT.java | 11 ++- .../bigquery/CreateTableTimestampIT.java | 80 +++++++++++++++++++ .../QueryWithTimestampParametersIT.java | 9 ++- 6 files changed, 187 insertions(+), 14 deletions(-) create mode 100644 samples/snippets/src/main/java/com/example/bigquery/CreateTableTimestamp.java create mode 100644 samples/snippets/src/test/java/com/example/bigquery/CreateTableTimestampIT.java diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ecb5e0c63d..ddad48d392 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5980,9 +5980,11 @@ public void testSnapshotTableCopyJob() throws InterruptedException { @Test public void testCopyJobWithLabelsAndExpTime() throws InterruptedException { - String destExpiryTime = "2025-12-31T23:59:59.999999999Z"; - String sourceTableName = "test_copy_job_source_table_label"; - String destinationTableName = "test_copy_job_destination_table_label"; + String destExpiryTime = "2099-12-31T23:59:59.999999999Z"; + String sourceTableName = + "test_copy_job_source_table_label" + UUID.randomUUID().toString().substring(0, 8); + String destinationTableName = + "test_copy_job_destination_table_label" + UUID.randomUUID().toString().substring(0, 8); Map labels = ImmutableMap.of("test_job_name", "test_copy_job"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); diff --git a/samples/snippets/src/main/java/com/example/bigquery/CreateTableTimestamp.java b/samples/snippets/src/main/java/com/example/bigquery/CreateTableTimestamp.java new file mode 100644 index 0000000000..b1336aaff4 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/bigquery/CreateTableTimestamp.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +// [START bigquery_create_table_timestamp] +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.StandardTableDefinition; +import com.google.cloud.bigquery.TableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableInfo; + +public class CreateTableTimestamp { + + public static void main(String[] args) { + // TODO(developer): Replace these variables before running the sample. + String datasetName = "MY_DATASET_NAME"; + String tableName = "MY_TABLE_NAME"; + Schema schema = + Schema.of(Field.newBuilder("timestampField", StandardSQLTypeName.TIMESTAMP).build()); + createTable(datasetName, tableName, schema); + } + + public static void createTable(String datasetName, String tableName, Schema schema) { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + TableId tableId = TableId.of(datasetName, tableName); + TableDefinition tableDefinition = StandardTableDefinition.of(schema); + TableInfo tableInfo = TableInfo.newBuilder(tableId, tableDefinition).build(); + + bigquery.create(tableInfo); + System.out.println("Table created successfully"); + } catch (BigQueryException e) { + System.out.println("Table was not created. \n" + e); + } + } +} +// [END bigquery_create_table_timestamp] diff --git a/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java b/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java index 56a3fcea91..6f20b9801d 100644 --- a/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java +++ b/samples/snippets/src/main/java/com/example/bigquery/QueryWithTimestampParameters.java @@ -30,8 +30,36 @@ // Sample to running a query with timestamp query parameters. public class QueryWithTimestampParameters { - public static void main(String[] args) { - queryWithTimestampParameters(); + public static void queryFromTableTimestampParameters() { + try { + // Initialize client that will be used to send requests. This client only needs to be created + // once, and can be reused for multiple requests. + BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService(); + + ZonedDateTime timestamp = LocalDateTime.of(2016, 12, 7, 8, 0, 0).atZone(ZoneOffset.UTC); + String query = "SELECT last_reported FROM " + + "`bigquery-public-data`.new_york_citibike.citibike_stations" + + " WHERE last_reported >= @ts_value LIMIT 5"; + // Note: Standard SQL is required to use query parameters. + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .addNamedParameter( + "ts_value", + QueryParameterValue.timestamp( + // Timestamp takes microseconds since 1970-01-01T00:00:00 UTC + timestamp.toInstant().toEpochMilli() * 1000)) + .build(); + + TableResult results = bigquery.query(queryConfig); + + results + .iterateAll() + .forEach(row -> row.forEach(val -> System.out.printf("%s\n", val.toString()))); + + System.out.println("Query with timestamp parameter performed successfully."); + } catch (BigQueryException | InterruptedException e) { + System.out.println("Query not performed \n" + e); + } } public static void queryWithTimestampParameters() { @@ -60,7 +88,7 @@ public static void queryWithTimestampParameters() { System.out.println("Query with timestamp parameter performed successfully."); } catch (BigQueryException | InterruptedException e) { - System.out.println("Query not performed \n" + e.toString()); + System.out.println("Query not performed \n" + e); } } } diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateTableIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateTableIT.java index af5104c1c6..000091a045 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/CreateTableIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateTableIT.java @@ -37,26 +37,25 @@ public class CreateTableIT { private final Logger log = Logger.getLogger(this.getClass().getName()); private String tableName; private ByteArrayOutputStream bout; - private PrintStream out; private PrintStream originalPrintStream; private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); - private static void requireEnvVar(String varName) { + private static void requireEnvVar() { assertNotNull( - "Environment variable " + varName + " is required to perform these tests.", - System.getenv(varName)); + "Environment variable BIGQUERY_DATASET_NAME is required to perform these tests.", + System.getenv("BIGQUERY_DATASET_NAME")); } @BeforeClass public static void checkRequirements() { - requireEnvVar("BIGQUERY_DATASET_NAME"); + requireEnvVar(); } @Before public void setUp() { bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); + PrintStream out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); tableName = "MY_TABLE_NAME_" + UUID.randomUUID().toString().replace("-", "_"); diff --git a/samples/snippets/src/test/java/com/example/bigquery/CreateTableTimestampIT.java b/samples/snippets/src/test/java/com/example/bigquery/CreateTableTimestampIT.java new file mode 100644 index 0000000000..b63d6eff63 --- /dev/null +++ b/samples/snippets/src/test/java/com/example/bigquery/CreateTableTimestampIT.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.bigquery; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertNotNull; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class CreateTableTimestampIT { + private final Logger log = Logger.getLogger(this.getClass().getName()); + private String tableName; + private ByteArrayOutputStream bout; + private PrintStream originalPrintStream; + + private static final String BIGQUERY_DATASET_NAME = System.getenv("BIGQUERY_DATASET_NAME"); + + private static void requireEnvVar() { + assertNotNull( + "Environment variable BIGQUERY_DATASET_NAME is required to perform these tests.", + System.getenv("BIGQUERY_DATASET_NAME")); + } + + @BeforeClass + public static void checkRequirements() { + requireEnvVar(); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + PrintStream out = new PrintStream(bout); + originalPrintStream = System.out; + System.setOut(out); + tableName = "MY_TABLE_NAME_" + UUID.randomUUID().toString().replace("-", "_"); + } + + @After + public void tearDown() { + // Clean up + DeleteTable.deleteTable(BIGQUERY_DATASET_NAME, tableName); + // restores print statements in the original method + System.out.flush(); + System.setOut(originalPrintStream); + log.log(Level.INFO, "\n" + bout.toString()); + } + + @Test + public void testCreateTable() { + Schema schema = + Schema.of(Field.of("timestampField", StandardSQLTypeName.TIMESTAMP)); + CreateTableTimestamp.createTable(BIGQUERY_DATASET_NAME, tableName, schema); + assertThat(bout.toString()).contains("Table created successfully"); + } +} diff --git a/samples/snippets/src/test/java/com/example/bigquery/QueryWithTimestampParametersIT.java b/samples/snippets/src/test/java/com/example/bigquery/QueryWithTimestampParametersIT.java index eb6f79cb7b..32d707c307 100644 --- a/samples/snippets/src/test/java/com/example/bigquery/QueryWithTimestampParametersIT.java +++ b/samples/snippets/src/test/java/com/example/bigquery/QueryWithTimestampParametersIT.java @@ -30,13 +30,12 @@ public class QueryWithTimestampParametersIT { private final Logger log = Logger.getLogger(this.getClass().getName()); private ByteArrayOutputStream bout; - private PrintStream out; private PrintStream originalPrintStream; @Before public void setUp() { bout = new ByteArrayOutputStream(); - out = new PrintStream(bout); + PrintStream out = new PrintStream(bout); originalPrintStream = System.out; System.setOut(out); } @@ -54,4 +53,10 @@ public void testQueryWithTimestampParameters() { QueryWithTimestampParameters.queryWithTimestampParameters(); assertThat(bout.toString()).contains("Query with timestamp parameter performed successfully."); } + + @Test + public void testQueryFromTableTimestampParameters() { + QueryWithTimestampParameters.queryFromTableTimestampParameters(); + assertThat(bout.toString()).contains("Query with timestamp parameter performed successfully."); + } } From 719f8fd14e384cbe0a5e26f36ed05f97c4231fc0 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 9 Jan 2026 15:19:17 -0500 Subject: [PATCH 2219/2268] chore: Migrate tests to JUnit5 (#4052) * feat: Migrate to JUnit 5 and add parallel test execution * feat: Migrate tests to JUnit5 * chore: Add surefire-junit-platform dep for ITs * chore: Fix broken tests * chore: Upgrade existing integration tests to JUnit 5 syntax and features * chore: Upgrade ITNightlyBigQueryTest to JUnit 5 features and package-private * chore: Make the tests package-private * feat: migrate tests to JUnit 5 assertThrows and static imports * chore: Remove wildcard imports * chore: revert samples to use junit4 * chore: Address code comments * chore: Close connection after test --------- Co-authored-by: AbgarSim --- google-cloud-bigquery/pom.xml | 28 +- .../src/test/java/MetadataCacheStatsTest.java | 8 +- .../com/google/cloud/bigquery/AclTest.java | 26 +- .../cloud/bigquery/AnnotationsTest.java | 26 +- .../cloud/bigquery/AvroOptionsTest.java | 10 +- .../bigquery/BigLakeConfigurationTest.java | 12 +- .../cloud/bigquery/BigQueryErrorTest.java | 8 +- .../cloud/bigquery/BigQueryExceptionTest.java | 26 +- .../cloud/bigquery/BigQueryImplTest.java | 437 +++++++------- .../cloud/bigquery/BigQueryOptionsTest.java | 43 +- .../bigquery/BigQueryResultImplTest.java | 8 +- .../cloud/bigquery/BigtableOptionsTest.java | 69 ++- .../cloud/bigquery/CloneDefinitionTest.java | 12 +- .../cloud/bigquery/ColumnReferenceTest.java | 12 +- .../cloud/bigquery/ConnectionImplTest.java | 80 +-- .../bigquery/ConnectionPropertyTest.java | 10 +- .../bigquery/ConnectionSettingsTest.java | 12 +- .../bigquery/CopyJobConfigurationTest.java | 26 +- .../google/cloud/bigquery/CsvOptionsTest.java | 12 +- .../google/cloud/bigquery/DatasetIdTest.java | 14 +- .../cloud/bigquery/DatasetInfoTest.java | 26 +- .../google/cloud/bigquery/DatasetTest.java | 78 ++- .../bigquery/DatastoreBackupOptionsTest.java | 12 +- .../google/cloud/bigquery/DmlStatsTest.java | 8 +- .../ExternalDatasetReferenceTest.java | 12 +- .../bigquery/ExternalTableDefinitionTest.java | 29 +- .../bigquery/ExtractJobConfigurationTest.java | 10 +- .../cloud/bigquery/FieldElementTypeTest.java | 4 +- .../google/cloud/bigquery/FieldListTest.java | 35 +- .../com/google/cloud/bigquery/FieldTest.java | 6 +- .../cloud/bigquery/FieldValueListTest.java | 39 +- .../google/cloud/bigquery/FieldValueTest.java | 12 +- .../google/cloud/bigquery/ForeignKeyTest.java | 14 +- .../cloud/bigquery/FormatOptionsTest.java | 4 +- .../bigquery/GoogleSheetsOptionsTest.java | 2 +- .../bigquery/HivePartitioningOptionsTest.java | 12 +- .../cloud/bigquery/InsertAllRequestTest.java | 11 +- .../cloud/bigquery/InsertAllResponseTest.java | 10 +- .../com/google/cloud/bigquery/JobIdTest.java | 14 +- .../google/cloud/bigquery/JobInfoTest.java | 10 +- .../cloud/bigquery/JobStatisticsTest.java | 4 +- .../google/cloud/bigquery/JobStatusTest.java | 10 +- .../com/google/cloud/bigquery/JobTest.java | 135 ++--- .../bigquery/LoadJobConfigurationTest.java | 20 +- .../MaterializedViewDefinitionTest.java | 6 +- .../google/cloud/bigquery/ModelIdTest.java | 14 +- .../google/cloud/bigquery/ModelInfoTest.java | 20 +- .../bigquery/ModelTableDefinitionTest.java | 37 +- .../com/google/cloud/bigquery/ModelTest.java | 50 +- .../com/google/cloud/bigquery/OptionTest.java | 17 +- .../cloud/bigquery/ParquetOptionsTest.java | 4 +- .../cloud/bigquery/PolicyHelperTest.java | 10 +- .../google/cloud/bigquery/PolicyTagsTest.java | 8 +- .../google/cloud/bigquery/PrimaryKeyTest.java | 14 +- .../bigquery/QueryJobConfigurationTest.java | 8 +- .../bigquery/QueryParameterValueTest.java | 32 +- .../cloud/bigquery/QueryRequestInfoTest.java | 10 +- .../google/cloud/bigquery/QueryStageTest.java | 18 +- .../com/google/cloud/bigquery/RangeTest.java | 6 +- .../bigquery/RemoteFunctionOptionsTest.java | 12 +- .../cloud/bigquery/RoutineArgumentTest.java | 4 +- .../google/cloud/bigquery/RoutineIdTest.java | 4 +- .../cloud/bigquery/RoutineInfoTest.java | 20 +- .../google/cloud/bigquery/RoutineTest.java | 26 +- .../com/google/cloud/bigquery/SchemaTest.java | 12 +- .../bigquery/SnapshotTableDefinitionTest.java | 14 +- .../bigquery/StandardSQLDataTypeTest.java | 12 +- .../cloud/bigquery/StandardSQLFieldTest.java | 4 +- .../bigquery/StandardSQLStructTypeTest.java | 12 +- .../bigquery/StandardSQLTableTypeTest.java | 4 +- .../bigquery/StandardTableDefinitionTest.java | 39 +- .../cloud/bigquery/TableConstraintsTest.java | 14 +- .../bigquery/TableDataWriteChannelTest.java | 70 +-- .../google/cloud/bigquery/TableIdTest.java | 14 +- .../google/cloud/bigquery/TableInfoTest.java | 22 +- .../bigquery/TableMetadataCacheUsageTest.java | 8 +- .../cloud/bigquery/TableResultTest.java | 8 +- .../com/google/cloud/bigquery/TableTest.java | 28 +- .../cloud/bigquery/TimePartitioningTest.java | 42 +- .../cloud/bigquery/TimelineSampleTest.java | 6 +- .../bigquery/UserDefinedFunctionTest.java | 4 +- .../cloud/bigquery/ViewDefinitionTest.java | 37 +- .../WriteChannelConfigurationTest.java | 6 +- .../cloud/bigquery/it/ITBigQueryTest.java | 494 ++++++++-------- .../bigquery/it/ITHighPrecisionTimestamp.java | 20 +- .../bigquery/it/ITNightlyBigQueryTest.java | 533 +++++++++--------- .../cloud/bigquery/it/ITRemoteUDFTest.java | 22 +- .../bigquery/spi/v2/HttpBigQueryRpcTest.java | 2 +- .../testing/RemoteBigQueryHelperTest.java | 12 +- pom.xml | 19 +- 90 files changed, 1576 insertions(+), 1598 deletions(-) diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 5e86e77fd2..174bb9cb36 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -162,8 +162,18 @@ test - junit - junit + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.mockito + mockito-junit-jupiter test @@ -207,6 +217,20 @@ + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.5.2 + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + org.codehaus.mojo diff --git a/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java b/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java index d1cfa86e9e..d417bfc7fa 100644 --- a/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java +++ b/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.MetadataCacheStatistics; import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; import java.util.List; import java.util.stream.Collectors; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class MetadataCacheStatsTest { +class MetadataCacheStatsTest { private static List TABLE_METADATA_CACHE_USAGE_PB_LIST = ImmutableList.of( @@ -44,7 +44,7 @@ public class MetadataCacheStatsTest { new MetadataCacheStatistics().setTableMetadataCacheUsage(TABLE_METADATA_CACHE_USAGE_PB_LIST); @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { assertEquals(METADATA_CACHE_STATISTICS_PB, METADATA_CACHE_STATS.toPb()); compareMetadataCacheStats( METADATA_CACHE_STATS, MetadataCacheStats.fromPb(METADATA_CACHE_STATISTICS_PB)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java index 0b53f32ff4..f7bed53ba1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AclTest.java @@ -16,7 +16,7 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.Dataset; import com.google.cloud.bigquery.Acl.DatasetAclEntity; @@ -31,12 +31,12 @@ import com.google.cloud.bigquery.Acl.View; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class AclTest { +class AclTest { @Test - public void testDatasetEntity() { + void testDatasetEntity() { DatasetId datasetId = DatasetId.of("dataset"); List targetTypes = ImmutableList.of("VIEWS"); DatasetAclEntity entity = new DatasetAclEntity(datasetId, targetTypes); @@ -47,7 +47,7 @@ public void testDatasetEntity() { } @Test - public void testDomainEntity() { + void testDomainEntity() { Domain entity = new Domain("d1"); assertEquals("d1", entity.getDomain()); assertEquals(Type.DOMAIN, entity.getType()); @@ -56,7 +56,7 @@ public void testDomainEntity() { } @Test - public void testGroupEntity() { + void testGroupEntity() { Group entity = new Group("g1"); assertEquals("g1", entity.getIdentifier()); assertEquals(Type.GROUP, entity.getType()); @@ -65,7 +65,7 @@ public void testGroupEntity() { } @Test - public void testSpecialGroupEntity() { + void testSpecialGroupEntity() { Group entity = Group.ofAllAuthenticatedUsers(); assertEquals("allAuthenticatedUsers", entity.getIdentifier()); Dataset.Access pb = entity.toPb(); @@ -85,7 +85,7 @@ public void testSpecialGroupEntity() { } @Test - public void testUserEntity() { + void testUserEntity() { User entity = new User("u1"); assertEquals("u1", entity.getEmail()); assertEquals(Type.USER, entity.getType()); @@ -94,7 +94,7 @@ public void testUserEntity() { } @Test - public void testViewEntity() { + void testViewEntity() { TableId viewId = TableId.of("project", "dataset", "view"); View entity = new View(viewId); assertEquals(viewId, entity.getId()); @@ -104,7 +104,7 @@ public void testViewEntity() { } @Test - public void testRoutineEntity() { + void testRoutineEntity() { RoutineId routineId = RoutineId.of("project", "dataset", "routine"); Acl.Routine entity = new Acl.Routine(routineId); assertEquals(routineId, entity.getId()); @@ -114,7 +114,7 @@ public void testRoutineEntity() { } @Test - public void testIamMemberEntity() { + void testIamMemberEntity() { IamMember entity = new IamMember("member1"); assertEquals("member1", entity.getIamMember()); Dataset.Access pb = entity.toPb(); @@ -122,7 +122,7 @@ public void testIamMemberEntity() { } @Test - public void testOf() { + void testOf() { Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER); assertEquals(Group.ofAllAuthenticatedUsers(), acl.getEntity()); assertEquals(Role.READER, acl.getRole()); @@ -139,7 +139,7 @@ public void testOf() { } @Test - public void testOfWithCondition() { + void testOfWithCondition() { Expr expr = new Expr("expression", "title", "description", "location"); Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER, expr); Dataset.Access pb = acl.toPb(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java index aa3dd9fde4..ad475c7dce 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AnnotationsTest.java @@ -17,17 +17,17 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.client.util.Data; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class AnnotationsTest { @Test - public void testFromUser() { + void testFromUser() { assertThat(Annotations.fromUser(null).userMap()).isNull(); HashMap user = new HashMap<>(); @@ -43,7 +43,7 @@ public void testFromUser() { } @Test - public void testFromToPb() { + void testFromToPb() { assertThat(Annotations.fromPb(null).toPb()).isNull(); HashMap pb = new HashMap<>(); @@ -60,17 +60,13 @@ public void testFromToPb() { } @Test - public void testNullKey() { - try { - Annotations.fromUser(Collections.singletonMap((String) null, "foo")); - fail("null key shouldn't work"); - } catch (IllegalArgumentException e) { - } + void testNullKey() { + assertThrows( + IllegalArgumentException.class, + () -> Annotations.fromUser(Collections.singletonMap((String) null, "foo"))); - try { - Annotations.fromPb(Collections.singletonMap((String) null, "foo")); - fail("null key shouldn't work"); - } catch (IllegalArgumentException e) { - } + assertThrows( + IllegalArgumentException.class, + () -> Annotations.fromPb(Collections.singletonMap((String) null, "foo"))); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java index f40660fd7b..840ae24ba8 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/AvroOptionsTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class AvroOptionsTest { @@ -27,7 +27,7 @@ public class AvroOptionsTest { AvroOptions.newBuilder().setUseAvroLogicalTypes(USE_AVRO_LOGICAL_TYPES).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareAvroOptions(AVRO_OPTIONS, AVRO_OPTIONS.toBuilder().build()); AvroOptions avroOptions = AVRO_OPTIONS.toBuilder().setUseAvroLogicalTypes(false).build(); assertEquals(false, avroOptions.useAvroLogicalTypes()); @@ -36,13 +36,13 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(FormatOptions.AVRO, AVRO_OPTIONS.getType()); assertEquals(USE_AVRO_LOGICAL_TYPES, AVRO_OPTIONS.useAvroLogicalTypes()); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareAvroOptions(AVRO_OPTIONS, AvroOptions.fromPb(AVRO_OPTIONS.toPb())); AvroOptions avroOptions = AvroOptions.newBuilder().setUseAvroLogicalTypes(USE_AVRO_LOGICAL_TYPES).build(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java index afb2b5b10a..66fcd7c6b4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigLakeConfigurationTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BigLakeConfigurationTest { +class BigLakeConfigurationTest { private static final String STORAGE_URI = "gs://storage-uri"; private static final String FILE_FORMAT = "PARQUET"; @@ -43,7 +43,7 @@ public class BigLakeConfigurationTest { .setConnectionId(CONNECTION_ID); @Test - public void testToBuilder() { + void testToBuilder() { assertEquals(STORAGE_URI, BIG_LAKE_CONFIGURATION.getStorageUri()); assertEquals(FILE_FORMAT, BIG_LAKE_CONFIGURATION.getFileFormat()); assertEquals(TABLE_FORMAT, BIG_LAKE_CONFIGURATION.getTableFormat()); @@ -51,12 +51,12 @@ public void testToBuilder() { } @Test - public void testToPb() { + void testToPb() { assertBigLakeConfiguration(BIG_LAKE_CONFIGURATION_PB, BIG_LAKE_CONFIGURATION.toPb()); } @Test - public void testFromPb() { + void testFromPb() { assertBigLakeConfiguration( BIG_LAKE_CONFIGURATION, BigLakeConfiguration.fromPb(BIG_LAKE_CONFIGURATION_PB)); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java index 7cd737cf4b..d618214e29 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryErrorTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class BigQueryErrorTest { @@ -32,7 +32,7 @@ public class BigQueryErrorTest { new BigQueryError(REASON, LOCATION, MESSAGE); @Test - public void testConstructor() { + void testConstructor() { assertEquals(REASON, ERROR.getReason()); assertEquals(LOCATION, ERROR.getLocation()); assertEquals(DEBUG_INFO, ERROR.getDebugInfo()); @@ -44,7 +44,7 @@ public void testConstructor() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareBigQueryError(ERROR, BigQueryError.fromPb(ERROR.toPb())); compareBigQueryError(ERROR_INCOMPLETE, BigQueryError.fromPb(ERROR_INCOMPLETE.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java index 8a2094b558..7254ede1bc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryExceptionTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -40,15 +40,15 @@ import java.net.SocketTimeoutException; import java.util.HashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class BigQueryExceptionTest { @Test - public void testBigQueryException() { + void testBigQueryException() { BigQueryException exception = new BigQueryException(500, "message"); assertEquals(500, exception.getCode()); assertEquals("message", exception.getMessage()); @@ -137,7 +137,7 @@ public void testBigQueryException() { } @Test - public void testTranslateAndThrow() throws Exception { + void testTranslateAndThrow() throws Exception { Exception cause = new BigQueryException(503, "message"); RetryHelperException exceptionMock = mock(RetryHelperException.class); when(exceptionMock.getCause()).thenReturn(cause); @@ -168,7 +168,7 @@ public void testTranslateAndThrow() throws Exception { } @Test - public void testDefaultExceptionHandler() throws java.io.IOException { + void testDefaultExceptionHandler() throws java.io.IOException { BigQueryOptions defaultOptions = BigQueryOptions.newBuilder().setProjectId("project-id").build(); DatasetInfo info = DatasetInfo.newBuilder("dataset").build(); @@ -198,7 +198,7 @@ public void testDefaultExceptionHandler() throws java.io.IOException { } @Test - public void testCustomExceptionHandler() throws java.io.IOException { + void testCustomExceptionHandler() throws java.io.IOException { BigQueryOptions defaultOptions = BigQueryOptions.newBuilder() .setProjectId("project-id") diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java index 393455e364..20a6ef679e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryImplTest.java @@ -20,12 +20,33 @@ import static com.google.cloud.bigquery.BigQuery.JobField.USER_EMAIL; import static com.google.cloud.bigquery.BigQueryImpl.optionMap; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.nullable; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import com.google.api.gax.paging.Page; -import com.google.api.services.bigquery.model.*; +import com.google.api.services.bigquery.model.ErrorProto; +import com.google.api.services.bigquery.model.GetQueryResultsResponse; +import com.google.api.services.bigquery.model.JobConfigurationQuery; import com.google.api.services.bigquery.model.JobStatistics; +import com.google.api.services.bigquery.model.QueryRequest; +import com.google.api.services.bigquery.model.TableCell; +import com.google.api.services.bigquery.model.TableDataInsertAllRequest; +import com.google.api.services.bigquery.model.TableDataInsertAllResponse; +import com.google.api.services.bigquery.model.TableDataList; +import com.google.api.services.bigquery.model.TableRow; import com.google.cloud.Policy; import com.google.cloud.RetryOption; import com.google.cloud.ServiceOptions; @@ -39,7 +60,11 @@ import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc; import com.google.common.base.Function; import com.google.common.base.Supplier; -import com.google.common.collect.*; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import java.io.IOException; import java.math.BigInteger; import java.net.ConnectException; @@ -47,16 +72,18 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class BigQueryImplTest { private static final String PROJECT = "project"; @@ -537,8 +564,8 @@ private BigQueryOptions createBigQueryOptionsForProjectWithLocation( .build(); } - @Before - public void setUp() { + @BeforeEach + void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); bigqueryRpcMock = mock(HttpBigQueryRpc.class); when(rpcFactoryMock.create(any(BigQueryOptions.class))).thenReturn(bigqueryRpcMock); @@ -546,13 +573,13 @@ public void setUp() { } @Test - public void testGetOptions() { + void testGetOptions() { bigquery = options.getService(); assertSame(options, bigquery.getOptions()); } @Test - public void testCreateDataset() throws IOException { + void testCreateDataset() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.createSkipExceptionTranslation(datasetInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(datasetInfo.toPb()); @@ -565,7 +592,7 @@ public void testCreateDataset() throws IOException { } @Test - public void testCreateDatasetWithSelectedFields() throws IOException { + void testCreateDatasetWithSelectedFields() throws IOException { when(bigqueryRpcMock.createSkipExceptionTranslation( eq(DATASET_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); @@ -584,7 +611,7 @@ public void testCreateDatasetWithSelectedFields() throws IOException { } @Test - public void testCreateDatasetWithAccessPolicy() throws IOException { + void testCreateDatasetWithAccessPolicy() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); DatasetOption datasetOption = DatasetOption.accessPolicyVersion(3); when(bigqueryRpcMock.createSkipExceptionTranslation( @@ -600,7 +627,7 @@ public void testCreateDatasetWithAccessPolicy() throws IOException { } @Test - public void testGetDataset() throws IOException { + void testGetDataset() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); @@ -611,7 +638,7 @@ public void testGetDataset() throws IOException { } @Test - public void testGetDatasetNotFoundWhenThrowIsDisabled() throws IOException { + void testGetDatasetNotFoundWhenThrowIsDisabled() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); options.setThrowNotFound(false); @@ -623,24 +650,22 @@ public void testGetDatasetNotFoundWhenThrowIsDisabled() throws IOException { } @Test - public void testGetDatasetNotFoundWhenThrowIsEnabled() throws IOException { + void testGetDatasetNotFoundWhenThrowIsEnabled() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Dataset not found")); options.setThrowNotFound(true); bigquery = options.getService(); - try { - bigquery.getDataset("dataset-not-found"); - Assert.fail(); - } catch (BigQueryException ex) { - Assert.assertNotNull(ex.getMessage()); - } + BigQueryException ex = + Assertions.assertThrows( + BigQueryException.class, () -> bigquery.getDataset("dataset-not-found")); + Assertions.assertNotNull(ex.getMessage()); verify(bigqueryRpcMock) .getDatasetSkipExceptionTranslation(PROJECT, "dataset-not-found", EMPTY_RPC_OPTIONS); } @Test - public void testGetDatasetFromDatasetId() throws IOException { + void testGetDatasetFromDatasetId() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); bigquery = options.getService(); @@ -651,7 +676,7 @@ public void testGetDatasetFromDatasetId() throws IOException { } @Test - public void testGetDatasetFromDatasetIdWithProject() throws IOException { + void testGetDatasetFromDatasetIdWithProject() throws IOException { DatasetInfo datasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT); DatasetId datasetId = DatasetId.of(OTHER_PROJECT, DATASET); when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( @@ -665,7 +690,7 @@ public void testGetDatasetFromDatasetIdWithProject() throws IOException { } @Test - public void testGetDatasetWithSelectedFields() throws IOException { + void testGetDatasetWithSelectedFields() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation( eq(PROJECT), eq(DATASET), capturedOptions.capture())) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); @@ -683,7 +708,7 @@ public void testGetDatasetWithSelectedFields() throws IOException { } @Test - public void testListDatasets() throws IOException { + void testListDatasets() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -701,7 +726,7 @@ public void testListDatasets() throws IOException { } @Test - public void testListDatasetsWithProjects() throws IOException { + void testListDatasetsWithProjects() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -719,7 +744,7 @@ public void testListDatasetsWithProjects() throws IOException { } @Test - public void testListEmptyDatasets() throws IOException { + void testListEmptyDatasets() throws IOException { ImmutableList datasets = ImmutableList.of(); Tuple> result = Tuple.>of(null, datasets); @@ -734,7 +759,7 @@ public void testListEmptyDatasets() throws IOException { } @Test - public void testListDatasetsWithOptions() throws IOException { + void testListDatasetsWithOptions() throws IOException { bigquery = options.getService(); ImmutableList datasetList = ImmutableList.of( @@ -753,7 +778,7 @@ public void testListDatasetsWithOptions() throws IOException { } @Test - public void testDeleteDataset() throws IOException { + void testDeleteDataset() throws IOException { when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(true); bigquery = options.getService(); @@ -763,7 +788,7 @@ public void testDeleteDataset() throws IOException { } @Test - public void testDeleteDatasetFromDatasetId() throws IOException { + void testDeleteDatasetFromDatasetId() throws IOException { when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenReturn(true); bigquery = options.getService(); @@ -773,7 +798,7 @@ public void testDeleteDatasetFromDatasetId() throws IOException { } @Test - public void testDeleteDatasetFromDatasetIdWithProject() throws IOException { + void testDeleteDatasetFromDatasetIdWithProject() throws IOException { DatasetId datasetId = DatasetId.of(OTHER_PROJECT, DATASET); when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation( OTHER_PROJECT, DATASET, EMPTY_RPC_OPTIONS)) @@ -785,7 +810,7 @@ public void testDeleteDatasetFromDatasetIdWithProject() throws IOException { } @Test - public void testDeleteDatasetWithOptions() throws IOException { + void testDeleteDatasetWithOptions() throws IOException { when(bigqueryRpcMock.deleteDatasetSkipExceptionTranslation( PROJECT, DATASET, DATASET_DELETE_OPTIONS)) .thenReturn(true); @@ -796,7 +821,7 @@ public void testDeleteDatasetWithOptions() throws IOException { } @Test - public void testUpdateDataset() throws IOException { + void testUpdateDataset() throws IOException { DatasetInfo updatedDatasetInfo = DATASET_INFO.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") @@ -812,7 +837,7 @@ public void testUpdateDataset() throws IOException { } @Test - public void testUpdateDatasetWithSelectedFields() throws IOException { + void testUpdateDatasetWithSelectedFields() throws IOException { DatasetInfo updatedDatasetInfo = DATASET_INFO.toBuilder().setDescription("newDescription").build(); DatasetInfo updatedDatasetInfoWithProject = @@ -835,7 +860,7 @@ public void testUpdateDatasetWithSelectedFields() throws IOException { } @Test - public void testCreateTable() throws IOException { + void testCreateTable() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.createSkipExceptionTranslation(tableInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(tableInfo.toPb()); @@ -848,7 +873,7 @@ public void testCreateTable() throws IOException { } @Test - public void tesCreateExternalTable() throws IOException { + void tesCreateExternalTable() throws IOException { TableInfo createTableInfo = TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) .setProjectId(OTHER_PROJECT); @@ -867,7 +892,7 @@ public void tesCreateExternalTable() throws IOException { } @Test - public void testCreateTableWithoutProject() throws IOException { + void testCreateTableWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); tableInfo.toBuilder().setTableId(tableId); @@ -881,7 +906,7 @@ public void testCreateTableWithoutProject() throws IOException { } @Test - public void testCreateTableWithSelectedFields() throws IOException { + void testCreateTableWithSelectedFields() throws IOException { when(bigqueryRpcMock.createSkipExceptionTranslation( eq(TABLE_INFO_WITH_PROJECT.toPb()), capturedOptions.capture())) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); @@ -899,7 +924,7 @@ public void testCreateTableWithSelectedFields() throws IOException { } @Test - public void testGetTable() throws IOException { + void testGetTable() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); @@ -911,7 +936,7 @@ public void testGetTable() throws IOException { } @Test - public void testGetModel() throws IOException { + void testGetModel() throws IOException { when(bigqueryRpcMock.getModelSkipExceptionTranslation( PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) .thenReturn(MODEL_INFO_WITH_PROJECT.toPb()); @@ -923,7 +948,7 @@ public void testGetModel() throws IOException { } @Test - public void testGetModelNotFoundWhenThrowIsEnabled() throws IOException { + void testGetModelNotFoundWhenThrowIsEnabled() throws IOException { String expected = "Model not found"; when(bigqueryRpcMock.getModelSkipExceptionTranslation( PROJECT, DATASET, MODEL, EMPTY_RPC_OPTIONS)) @@ -940,7 +965,7 @@ public void testGetModelNotFoundWhenThrowIsEnabled() throws IOException { } @Test - public void testListPartition() throws IOException { + void testListPartition() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, "table$__PARTITIONS_SUMMARY__", EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_PARTITIONS.toPb()); @@ -958,7 +983,7 @@ public void testListPartition() throws IOException { } @Test - public void testGetTableNotFoundWhenThrowIsDisabled() throws IOException { + void testGetTableNotFoundWhenThrowIsDisabled() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); @@ -971,7 +996,7 @@ public void testGetTableNotFoundWhenThrowIsDisabled() throws IOException { } @Test - public void testGetTableNotFoundWhenThrowIsEnabled() throws IOException { + void testGetTableNotFoundWhenThrowIsEnabled() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Table not found")); @@ -979,16 +1004,16 @@ public void testGetTableNotFoundWhenThrowIsEnabled() throws IOException { bigquery = options.getService(); try { bigquery.getTable(DATASET, "table-not-found"); - Assert.fail(); + Assertions.fail(); } catch (BigQueryException ex) { - Assert.assertNotNull(ex.getMessage()); + Assertions.assertNotNull(ex.getMessage()); } verify(bigqueryRpcMock) .getTableSkipExceptionTranslation(PROJECT, DATASET, "table-not-found", EMPTY_RPC_OPTIONS); } @Test - public void testGetTableFromTableId() throws IOException { + void testGetTableFromTableId() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); @@ -1000,7 +1025,7 @@ public void testGetTableFromTableId() throws IOException { } @Test - public void testGetTableFromTableIdWithProject() throws IOException { + void testGetTableFromTableIdWithProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT); TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.getTableSkipExceptionTranslation( @@ -1016,7 +1041,7 @@ public void testGetTableFromTableIdWithProject() throws IOException { } @Test - public void testGetTableFromTableIdWithoutProject() throws IOException { + void testGetTableFromTableIdWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); when(bigqueryRpcMock.getTableSkipExceptionTranslation( @@ -1031,7 +1056,7 @@ public void testGetTableFromTableIdWithoutProject() throws IOException { } @Test - public void testGetTableWithSelectedFields() throws IOException { + void testGetTableWithSelectedFields() throws IOException { when(bigqueryRpcMock.getTableSkipExceptionTranslation( eq(PROJECT), eq(DATASET), eq(TABLE), capturedOptions.capture())) .thenReturn(TABLE_INFO_WITH_PROJECT.toPb()); @@ -1049,7 +1074,7 @@ public void testGetTableWithSelectedFields() throws IOException { } @Test - public void testListTables() throws IOException { + void testListTables() throws IOException { bigquery = options.getService(); ImmutableList

    tableList = ImmutableList.of( @@ -1067,7 +1092,7 @@ public void testListTables() throws IOException { } @Test - public void testListTablesReturnedParameters() throws IOException { + void testListTablesReturnedParameters() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1084,7 +1109,7 @@ public void testListTablesReturnedParameters() throws IOException { } @Test - public void testListTablesReturnedParametersNullType() throws IOException { + void testListTablesReturnedParametersNullType() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1101,7 +1126,7 @@ public void testListTablesReturnedParametersNullType() throws IOException { } @Test - public void testListTablesWithRangePartitioning() throws IOException { + void testListTablesWithRangePartitioning() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1118,7 +1143,7 @@ public void testListTablesWithRangePartitioning() throws IOException { } @Test - public void testListTablesFromDatasetId() throws IOException { + void testListTablesFromDatasetId() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1135,7 +1160,7 @@ public void testListTablesFromDatasetId() throws IOException { } @Test - public void testListTablesFromDatasetIdWithProject() throws IOException { + void testListTablesFromDatasetIdWithProject() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1153,7 +1178,7 @@ public void testListTablesFromDatasetIdWithProject() throws IOException { } @Test - public void testListTablesWithLabels() throws IOException { + void testListTablesWithLabels() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1170,7 +1195,7 @@ public void testListTablesWithLabels() throws IOException { } @Test - public void testListTablesWithOptions() throws IOException { + void testListTablesWithOptions() throws IOException { bigquery = options.getService(); ImmutableList
    tableList = ImmutableList.of( @@ -1188,7 +1213,7 @@ public void testListTablesWithOptions() throws IOException { } @Test - public void testListModels() throws IOException { + void testListModels() throws IOException { bigquery = options.getService(); ImmutableList modelList = ImmutableList.of( @@ -1205,7 +1230,7 @@ public void testListModels() throws IOException { } @Test - public void testListModelsWithModelId() throws IOException { + void testListModelsWithModelId() throws IOException { bigquery = options.getService(); ImmutableList modelList = ImmutableList.of( @@ -1222,7 +1247,7 @@ public void testListModelsWithModelId() throws IOException { } @Test - public void testDeleteTable() throws IOException { + void testDeleteTable() throws IOException { when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) .thenReturn(true); bigquery = options.getService(); @@ -1231,7 +1256,7 @@ public void testDeleteTable() throws IOException { } @Test - public void testDeleteTableFromTableId() throws IOException { + void testDeleteTableFromTableId() throws IOException { when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) .thenReturn(true); bigquery = options.getService(); @@ -1240,7 +1265,7 @@ public void testDeleteTableFromTableId() throws IOException { } @Test - public void testDeleteTableFromTableIdWithProject() throws IOException { + void testDeleteTableFromTableIdWithProject() throws IOException { TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(OTHER_PROJECT, DATASET, TABLE)) .thenReturn(true); @@ -1252,7 +1277,7 @@ public void testDeleteTableFromTableIdWithProject() throws IOException { } @Test - public void testDeleteTableFromTableIdWithoutProject() throws IOException { + void testDeleteTableFromTableIdWithoutProject() throws IOException { TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); when(bigqueryRpcMock.deleteTableSkipExceptionTranslation(PROJECT, DATASET, TABLE)) .thenReturn(true); @@ -1263,7 +1288,7 @@ public void testDeleteTableFromTableIdWithoutProject() throws IOException { } @Test - public void testDeleteModel() throws IOException { + void testDeleteModel() throws IOException { when(bigqueryRpcMock.deleteModelSkipExceptionTranslation(PROJECT, DATASET, MODEL)) .thenReturn(true); bigquery = options.getService(); @@ -1272,7 +1297,7 @@ public void testDeleteModel() throws IOException { } @Test - public void testUpdateModel() throws IOException { + void testUpdateModel() throws IOException { ModelInfo updateModelInfo = MODEL_INFO_WITH_PROJECT.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") @@ -1289,7 +1314,7 @@ public void testUpdateModel() throws IOException { } @Test - public void testUpdateTable() throws IOException { + void testUpdateTable() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.setProjectId(OTHER_PROJECT).toBuilder().setDescription("newDescription").build(); when(bigqueryRpcMock.patchSkipExceptionTranslation(updatedTableInfo.toPb(), EMPTY_RPC_OPTIONS)) @@ -1304,7 +1329,7 @@ public void testUpdateTable() throws IOException { } @Test - public void testUpdateExternalTableWithNewSchema() throws IOException { + void testUpdateExternalTableWithNewSchema() throws IOException { TableInfo updatedTableInfo = TableInfo.of(TABLE_ID, ExternalTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build()) .setProjectId(OTHER_PROJECT); @@ -1323,7 +1348,7 @@ public void testUpdateExternalTableWithNewSchema() throws IOException { } @Test - public void testUpdateTableWithoutProject() throws IOException { + void testUpdateTableWithoutProject() throws IOException { TableInfo tableInfo = TABLE_INFO.setProjectId(PROJECT); TableId tableId = TableId.of("", TABLE_ID.getDataset(), TABLE_ID.getTable()); tableInfo.toBuilder().setTableId(tableId); @@ -1337,7 +1362,7 @@ public void testUpdateTableWithoutProject() throws IOException { } @Test - public void testUpdateTableWithSelectedFields() throws IOException { + void testUpdateTableWithSelectedFields() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.toBuilder().setDescription("newDescription").build(); TableInfo updatedTableInfoWithProject = TABLE_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); @@ -1359,7 +1384,7 @@ public void testUpdateTableWithSelectedFields() throws IOException { } @Test - public void testUpdateTableWithAutoDetectSchema() throws IOException { + void testUpdateTableWithAutoDetectSchema() throws IOException { TableInfo updatedTableInfo = TABLE_INFO.toBuilder().setDescription("newDescription").build(); TableInfo updatedTableInfoWithProject = TABLE_INFO_WITH_PROJECT.toBuilder().setDescription("newDescription").build(); @@ -1379,7 +1404,7 @@ public void testUpdateTableWithAutoDetectSchema() throws IOException { } @Test - public void testInsertAllWithRowIdShouldRetry() throws IOException { + void testInsertAllWithRowIdShouldRetry() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1432,7 +1457,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { } @Test - public void testInsertAllWithoutRowIdShouldNotRetry() { + void testInsertAllWithoutRowIdShouldNotRetry() { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = ImmutableList.of(RowToInsert.of(row1), RowToInsert.of(row2)); @@ -1468,15 +1493,15 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { .getService(); try { bigquery.insertAll(request); - Assert.fail(); + Assertions.fail(); } catch (BigQueryException ex) { - Assert.assertNotNull(ex.getMessage()); + Assertions.assertNotNull(ex.getMessage()); } verify(bigqueryRpcMock).insertAll(PROJECT, DATASET, TABLE, requestPb); } @Test - public void testInsertAllWithProject() throws IOException { + void testInsertAllWithProject() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1528,7 +1553,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { } @Test - public void testInsertAllWithProjectInTable() throws IOException { + void testInsertAllWithProjectInTable() throws IOException { Map row1 = ImmutableMap.of("field", "value1"); Map row2 = ImmutableMap.of("field", "value2"); List rows = @@ -1581,7 +1606,7 @@ public TableDataInsertAllRequest.Rows apply(RowToInsert rowToInsert) { } @Test - public void testListTableData() throws IOException { + void testListTableData() throws IOException { when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_PB); @@ -1594,7 +1619,7 @@ public void testListTableData() throws IOException { } @Test - public void testListTableDataFromTableId() throws IOException { + void testListTableDataFromTableId() throws IOException { when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) .thenReturn(TABLE_DATA_PB); @@ -1607,7 +1632,7 @@ public void testListTableDataFromTableId() throws IOException { } @Test - public void testListTableDataFromTableIdWithProject() throws IOException { + void testListTableDataFromTableIdWithProject() throws IOException { TableId tableId = TABLE_ID.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( OTHER_PROJECT, DATASET, TABLE, EMPTY_RPC_OPTIONS)) @@ -1622,7 +1647,7 @@ public void testListTableDataFromTableIdWithProject() throws IOException { } @Test - public void testListTableDataWithOptions() throws IOException { + void testListTableDataWithOptions() throws IOException { when(bigqueryRpcMock.listTableDataSkipExceptionTranslation( PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS)) .thenReturn(TABLE_DATA_PB); @@ -1641,7 +1666,7 @@ public void testListTableDataWithOptions() throws IOException { } @Test - public void testListTableDataWithNextPage() throws IOException { + void testListTableDataWithNextPage() throws IOException { doReturn(TABLE_DATA_PB) .when(bigqueryRpcMock) .listTableDataSkipExceptionTranslation(PROJECT, DATASET, TABLE, TABLE_DATA_LIST_OPTIONS); @@ -1687,7 +1712,7 @@ private static com.google.api.services.bigquery.model.Job newJobPb() { } @Test - public void testCreateJobSuccess() throws IOException { + void testCreateJobSuccess() throws IOException { String id = "testCreateJobSuccess-id"; JobId jobId = JobId.of(id); String query = "SELECT * in FOO"; @@ -1704,7 +1729,7 @@ public void testCreateJobSuccess() throws IOException { } @Test - public void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws IOException { + void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws IOException { when(bigqueryRpcMock.createSkipExceptionTranslation( jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow(new UnknownHostException()) @@ -1724,7 +1749,7 @@ public void testCreateJobFailureShouldRetryExceptionHandlerExceptions() throws I } @Test - public void testCreateJobFailureShouldRetry() throws IOException { + void testCreateJobFailureShouldRetry() throws IOException { when(bigqueryRpcMock.createSkipExceptionTranslation( jobCapture.capture(), eq(EMPTY_RPC_OPTIONS))) .thenThrow(new BigQueryException(500, "InternalError")) @@ -1749,7 +1774,7 @@ public void testCreateJobFailureShouldRetry() throws IOException { } @Test - public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() throws IOException { + void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() throws IOException { // Validate create job with BigQueryRetryConfig that retries on rate limit error message. JobOption bigQueryRetryConfigOption = JobOption.bigQueryRetryConfig( @@ -1782,7 +1807,7 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldRetry() throws IOEx } @Test - public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws IOException { + void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws IOException { // Validate create job with BigQueryRetryConfig that does not retry on rate limit error message. JobOption bigQueryRetryConfigOption = JobOption.bigQueryRetryConfig(BigQueryRetryConfig.newBuilder().build()); @@ -1795,7 +1820,7 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws I // Job create will attempt to retrieve the job even in the case when the job is created in a // returned failure. when(bigqueryRpcMock.getJobSkipExceptionTranslation( - nullable(String.class), nullable(String.class), nullable(String.class), Mockito.any())) + nullable(String.class), nullable(String.class), nullable(String.class), any())) .thenThrow(new BigQueryException(500, "InternalError")); bigquery = options.getService(); @@ -1805,13 +1830,15 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws I .build() .getService(); - try { - ((BigQueryImpl) bigquery) - .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), bigQueryRetryConfigOption); - fail("JobException expected"); - } catch (BigQueryException e) { - assertNotNull(e.getMessage()); - } + BigQueryException e = + Assertions.assertThrows( + BigQueryException.class, + () -> + ((BigQueryImpl) bigquery) + .create( + JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), + bigQueryRetryConfigOption)); + assertNotNull(e.getMessage()); // Verify that getQueryResults is attempted only once and not retried since the error message // does not match. verify(bigqueryRpcMock, times(1)) @@ -1819,7 +1846,7 @@ public void testCreateJobWithBigQueryRetryConfigFailureShouldNotRetry() throws I } @Test - public void testCreateJobWithRetryOptionsFailureShouldRetry() throws IOException { + void testCreateJobWithRetryOptionsFailureShouldRetry() throws IOException { // Validate create job with RetryOptions. JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(4)); Map bigQueryRpcOptions = optionMap(retryOptions); @@ -1844,7 +1871,7 @@ public void testCreateJobWithRetryOptionsFailureShouldRetry() throws IOException } @Test - public void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOException { + void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOException { // Validate create job with RetryOptions that only attempts once (no retry). JobOption retryOptions = JobOption.retryOptions(RetryOption.maxAttempts(1)); Map bigQueryRpcOptions = optionMap(retryOptions); @@ -1856,7 +1883,7 @@ public void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOExcept // Job create will attempt to retrieve the job even in the case when the job is created in a // returned failure. when(bigqueryRpcMock.getJobSkipExceptionTranslation( - nullable(String.class), nullable(String.class), nullable(String.class), Mockito.any())) + nullable(String.class), nullable(String.class), nullable(String.class), any())) .thenThrow(new BigQueryException(500, "InternalError")); bigquery = options.getService(); @@ -1866,19 +1893,19 @@ public void testCreateJobWithRetryOptionsFailureShouldNotRetry() throws IOExcept .build() .getService(); - try { - ((BigQueryImpl) bigquery) - .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), retryOptions); - fail("JobException expected"); - } catch (BigQueryException e) { - assertNotNull(e.getMessage()); - } + BigQueryException e = + Assertions.assertThrows( + BigQueryException.class, + () -> + ((BigQueryImpl) bigquery) + .create(JobInfo.of(QUERY_JOB_CONFIGURATION_FOR_DMLQUERY), retryOptions)); + assertNotNull(e.getMessage()); verify(bigqueryRpcMock, times(1)) .createSkipExceptionTranslation(jobCapture.capture(), eq(bigQueryRpcOptions)); } @Test - public void testCreateJobWithSelectedFields() throws IOException { + void testCreateJobWithSelectedFields() throws IOException { when(bigqueryRpcMock.createSkipExceptionTranslation( any(com.google.api.services.bigquery.model.Job.class), capturedOptions.capture())) .thenReturn(newJobPb()); @@ -1899,7 +1926,7 @@ public void testCreateJobWithSelectedFields() throws IOException { } @Test - public void testCreateJobNoGet() throws IOException { + void testCreateJobNoGet() throws IOException { String id = "testCreateJobNoGet-id"; JobId jobId = JobId.of(id); String query = "SELECT * in FOO"; @@ -1909,18 +1936,17 @@ public void testCreateJobNoGet() throws IOException { .thenThrow(new BigQueryException(409, "already exists, for some reason")); bigquery = options.getService(); - try { - bigquery.create(JobInfo.of(jobId, QueryJobConfiguration.of(query))); - fail("should throw"); - } catch (BigQueryException e) { - assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); - } + BigQueryException e = + Assertions.assertThrows( + BigQueryException.class, + () -> bigquery.create(JobInfo.of(jobId, QueryJobConfiguration.of(query)))); + assertThat(jobCapture.getValue().getJobReference().getJobId()).isEqualTo(id); verify(bigqueryRpcMock) .createSkipExceptionTranslation(jobCapture.capture(), eq(EMPTY_RPC_OPTIONS)); } @Test - public void testCreateJobTryGet() throws IOException { + void testCreateJobTryGet() throws IOException { final String id = "testCreateJobTryGet-id"; String query = "SELECT * in FOO"; Supplier idProvider = @@ -1949,7 +1975,7 @@ public JobId get() { } @Test - public void testCreateJobTryGetNotRandom() throws IOException { + void testCreateJobTryGetNotRandom() throws IOException { Map withStatisticOption = optionMap(JobOption.fields(STATISTICS)); final String id = "testCreateJobTryGet-id"; String query = "SELECT * in FOO"; @@ -1981,7 +2007,7 @@ public void testCreateJobTryGetNotRandom() throws IOException { } @Test - public void testCreateJobWithProjectId() throws IOException { + void testCreateJobWithProjectId() throws IOException { JobInfo jobInfo = JobInfo.newBuilder(QUERY_JOB_CONFIGURATION.setProjectId(OTHER_PROJECT)) .setJobId(JobId.of(OTHER_PROJECT, JOB)) @@ -2004,7 +2030,7 @@ public void testCreateJobWithProjectId() throws IOException { } @Test - public void testDeleteJob() throws IOException { + void testDeleteJob() throws IOException { JobId jobId = JobId.newBuilder().setJob(JOB).setProject(PROJECT).setLocation(LOCATION).build(); when(bigqueryRpcMock.deleteJobSkipExceptionTranslation(PROJECT, JOB, LOCATION)) .thenReturn(true); @@ -2014,7 +2040,7 @@ public void testDeleteJob() throws IOException { } @Test - public void testGetJob() throws IOException { + void testGetJob() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); bigquery = options.getService(); @@ -2024,7 +2050,7 @@ public void testGetJob() throws IOException { } @Test - public void testGetJobWithLocation() throws IOException { + void testGetJobWithLocation() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); @@ -2036,7 +2062,7 @@ public void testGetJobWithLocation() throws IOException { } @Test - public void testGetJobNotFoundWhenThrowIsDisabled() throws IOException { + void testGetJobNotFoundWhenThrowIsDisabled() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); options.setThrowNotFound(false); @@ -2047,24 +2073,21 @@ public void testGetJobNotFoundWhenThrowIsDisabled() throws IOException { } @Test - public void testGetJobNotFoundWhenThrowIsEnabled() throws IOException { + void testGetJobNotFoundWhenThrowIsEnabled() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation( PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS)) .thenThrow(new IOException("Job not found")); options.setThrowNotFound(true); bigquery = options.getService(); - try { - bigquery.getJob("job-not-found"); - Assert.fail(); - } catch (BigQueryException ex) { - Assert.assertNotNull(ex.getMessage()); - } + BigQueryException ex = + Assertions.assertThrows(BigQueryException.class, () -> bigquery.getJob("job-not-found")); + Assertions.assertNotNull(ex.getMessage()); verify(bigqueryRpcMock) .getJobSkipExceptionTranslation(PROJECT, "job-not-found", null, EMPTY_RPC_OPTIONS); } @Test - public void testGetJobFromJobId() throws IOException { + void testGetJobFromJobId() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, null, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); bigquery = options.getService(); @@ -2074,7 +2097,7 @@ public void testGetJobFromJobId() throws IOException { } @Test - public void testGetJobFromJobIdWithLocation() throws IOException { + void testGetJobFromJobIdWithLocation() throws IOException { when(bigqueryRpcMock.getJobSkipExceptionTranslation(PROJECT, JOB, LOCATION, EMPTY_RPC_OPTIONS)) .thenReturn(COMPLETE_COPY_JOB.toPb()); BigQueryOptions options = createBigQueryOptionsForProjectWithLocation(PROJECT, rpcFactoryMock); @@ -2086,7 +2109,7 @@ public void testGetJobFromJobIdWithLocation() throws IOException { } @Test - public void testGetJobFromJobIdWithProject() throws IOException { + void testGetJobFromJobIdWithProject() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); JobInfo jobInfo = COPY_JOB.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.getJobSkipExceptionTranslation( @@ -2100,7 +2123,7 @@ public void testGetJobFromJobIdWithProject() throws IOException { } @Test - public void testGetJobFromJobIdWithProjectWithLocation() throws IOException { + void testGetJobFromJobIdWithProjectWithLocation() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); JobInfo jobInfo = COPY_JOB.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.getJobSkipExceptionTranslation( @@ -2115,7 +2138,7 @@ public void testGetJobFromJobIdWithProjectWithLocation() throws IOException { } @Test - public void testListJobs() throws IOException { + void testListJobs() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -2141,7 +2164,7 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { } @Test - public void testListJobsWithOptions() throws IOException { + void testListJobsWithOptions() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -2169,7 +2192,7 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { } @Test - public void testListJobsWithSelectedFields() throws IOException { + void testListJobsWithSelectedFields() throws IOException { bigquery = options.getService(); ImmutableList jobList = ImmutableList.of( @@ -2205,7 +2228,7 @@ public com.google.api.services.bigquery.model.Job apply(Job job) { } @Test - public void testCancelJob() throws IOException { + void testCancelJob() throws IOException { when(bigqueryRpcMock.cancelSkipExceptionTranslation(PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.cancel(JOB)); @@ -2213,7 +2236,7 @@ public void testCancelJob() throws IOException { } @Test - public void testCancelJobFromJobId() throws IOException { + void testCancelJobFromJobId() throws IOException { when(bigqueryRpcMock.cancelSkipExceptionTranslation(PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); assertTrue(bigquery.cancel(JobId.of(PROJECT, JOB))); @@ -2221,7 +2244,7 @@ public void testCancelJobFromJobId() throws IOException { } @Test - public void testCancelJobFromJobIdWithProject() throws IOException { + void testCancelJobFromJobIdWithProject() throws IOException { JobId jobId = JobId.of(OTHER_PROJECT, JOB); when(bigqueryRpcMock.cancelSkipExceptionTranslation(OTHER_PROJECT, JOB, null)).thenReturn(true); bigquery = options.getService(); @@ -2230,7 +2253,7 @@ public void testCancelJobFromJobIdWithProject() throws IOException { } @Test - public void testQueryRequestCompleted() throws InterruptedException, IOException { + void testQueryRequestCompleted() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb = new com.google.api.services.bigquery.model.Job() @@ -2285,7 +2308,7 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) } @Test - public void testFastQueryRequestCompleted() throws InterruptedException, IOException { + void testFastQueryRequestCompleted() throws InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse queryResponsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2325,7 +2348,7 @@ public void testFastQueryRequestCompleted() throws InterruptedException, IOExcep } @Test - public void testFastQueryRequestCompletedWithLocation() throws InterruptedException, IOException { + void testFastQueryRequestCompletedWithLocation() throws InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse queryResponsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2366,7 +2389,7 @@ public void testFastQueryRequestCompletedWithLocation() throws InterruptedExcept } @Test - public void testFastQueryMultiplePages() throws InterruptedException, IOException { + void testFastQueryMultiplePages() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job responseJob = new com.google.api.services.bigquery.model.Job() @@ -2422,7 +2445,7 @@ PROJECT, DATASET, TABLE, optionMap(BigQuery.TableDataListOption.pageToken(CURSOR } @Test - public void testFastQuerySlowDdl() throws InterruptedException, IOException { + void testFastQuerySlowDdl() throws InterruptedException, IOException { // mock new fast query path response when running a query that takes more than 10s JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.QueryResponse queryResponsePb = @@ -2488,7 +2511,7 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) } @Test - public void testQueryRequestCompletedOptions() throws InterruptedException, IOException { + void testQueryRequestCompletedOptions() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb = new com.google.api.services.bigquery.model.Job() @@ -2546,7 +2569,7 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) } @Test - public void testQueryRequestCompletedOnSecondAttempt() throws InterruptedException, IOException { + void testQueryRequestCompletedOnSecondAttempt() throws InterruptedException, IOException { JobId queryJob = JobId.of(PROJECT, JOB); com.google.api.services.bigquery.model.Job jobResponsePb1 = new com.google.api.services.bigquery.model.Job() @@ -2611,7 +2634,7 @@ PROJECT, JOB, null, optionMap(Job.DEFAULT_QUERY_WAIT_OPTIONS))) } @Test - public void testQueryWithTimeoutSetsTimeout() throws InterruptedException, IOException { + void testQueryWithTimeoutSetsTimeout() throws InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse queryResponsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2634,7 +2657,7 @@ public void testQueryWithTimeoutSetsTimeout() throws InterruptedException, IOExc } @Test - public void testGetQueryResults() throws IOException { + void testGetQueryResults() throws IOException { JobId queryJob = JobId.of(JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2658,7 +2681,7 @@ public void testGetQueryResults() throws IOException { } @Test - public void testGetQueryResultsRetry() throws IOException { + void testGetQueryResultsRetry() throws IOException { JobId queryJob = JobId.of(JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2702,7 +2725,7 @@ public void testGetQueryResultsRetry() throws IOException { } @Test - public void testGetQueryResultsWithProject() throws IOException { + void testGetQueryResultsWithProject() throws IOException { JobId queryJob = JobId.of(OTHER_PROJECT, JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2726,7 +2749,7 @@ public void testGetQueryResultsWithProject() throws IOException { } @Test - public void testGetQueryResultsWithOptions() throws IOException { + void testGetQueryResultsWithOptions() throws IOException { JobId queryJob = JobId.of(PROJECT, JOB); GetQueryResultsResponse responsePb = new GetQueryResultsResponse() @@ -2755,7 +2778,7 @@ public void testGetQueryResultsWithOptions() throws IOException { } @Test - public void testGetDatasetRetryableException() throws IOException { + void testGetDatasetRetryableException() throws IOException { when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(500, "InternalError")) .thenReturn(DATASET_INFO_WITH_PROJECT.toPb()); @@ -2772,7 +2795,7 @@ public void testGetDatasetRetryableException() throws IOException { } @Test - public void testNonRetryableException() throws IOException { + void testNonRetryableException() throws IOException { String exceptionMessage = "Not Implemented"; when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(501, exceptionMessage)); @@ -2781,17 +2804,15 @@ public void testNonRetryableException() throws IOException { .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); - try { - bigquery.getDataset(DatasetId.of(DATASET)); - Assert.fail(); - } catch (BigQueryException ex) { - Assert.assertEquals(exceptionMessage, ex.getMessage()); - } + BigQueryException ex = + Assertions.assertThrows( + BigQueryException.class, () -> bigquery.getDataset(DatasetId.of(DATASET))); + assertEquals(exceptionMessage, ex.getMessage()); verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testRuntimeException() throws IOException { + void testRuntimeException() throws IOException { String exceptionMessage = "Artificial runtime exception"; when(bigqueryRpcMock.getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS)) .thenThrow(new RuntimeException(exceptionMessage)); @@ -2800,32 +2821,29 @@ public void testRuntimeException() throws IOException { .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) .build() .getService(); - try { - bigquery.getDataset(DATASET); - Assert.fail(); - } catch (BigQueryException ex) { - Assert.assertTrue(ex.getMessage().endsWith(exceptionMessage)); - } + BigQueryException ex = + Assertions.assertThrows(BigQueryException.class, () -> bigquery.getDataset(DATASET)); + assertTrue(ex.getMessage().endsWith(exceptionMessage)); verify(bigqueryRpcMock).getDatasetSkipExceptionTranslation(PROJECT, DATASET, EMPTY_RPC_OPTIONS); } @Test - public void testQueryDryRun() throws Exception { + void testQueryDryRun() throws Exception { // https://github.com/googleapis/google-cloud-java/issues/2479 - try { - options.toBuilder() - .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) - .build() - .getService() - .query(QueryJobConfiguration.newBuilder("foo").setDryRun(true).build()); - Assert.fail(); - } catch (UnsupportedOperationException ex) { - Assert.assertNotNull(ex.getMessage()); - } + UnsupportedOperationException ex = + Assertions.assertThrows( + UnsupportedOperationException.class, + () -> + options.toBuilder() + .setRetrySettings(ServiceOptions.getDefaultRetrySettings()) + .build() + .getService() + .query(QueryJobConfiguration.newBuilder("foo").setDryRun(true).build())); + Assertions.assertNotNull(ex.getMessage()); } @Test - public void testFastQuerySQLShouldRetry() throws Exception { + void testFastQuerySQLShouldRetry() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2866,7 +2884,7 @@ public void testFastQuerySQLShouldRetry() throws Exception { } @Test - public void testFastQueryDMLShouldRetry() throws Exception { + void testFastQueryDMLShouldRetry() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2907,7 +2925,7 @@ public void testFastQueryDMLShouldRetry() throws Exception { } @Test - public void testFastQueryRateLimitIdempotency() throws Exception { + void testFastQueryRateLimitIdempotency() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -2955,7 +2973,7 @@ public void testFastQueryRateLimitIdempotency() throws Exception { } @Test - public void testRateLimitRegEx() throws Exception { + void testRateLimitRegEx() throws Exception { String msg2 = "Job eceeded rate limits: Your table exceeded quota for table update operations. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas"; String msg3 = "exceeded rate exceeded quota for table update"; @@ -2979,7 +2997,7 @@ public void testRateLimitRegEx() throws Exception { } @Test - public void testFastQueryDDLShouldRetry() throws Exception { + void testFastQueryDDLShouldRetry() throws Exception { com.google.api.services.bigquery.model.QueryResponse responsePb = new com.google.api.services.bigquery.model.QueryResponse() .setCacheHit(false) @@ -3019,7 +3037,7 @@ public void testFastQueryDDLShouldRetry() throws Exception { } @Test - public void testFastQueryBigQueryException() throws InterruptedException, IOException { + void testFastQueryBigQueryException() throws InterruptedException, IOException { List errorProtoList = ImmutableList.of( new ErrorProto() @@ -3040,12 +3058,10 @@ public void testFastQueryBigQueryException() throws InterruptedException, IOExce .thenReturn(responsePb); bigquery = options.getService(); - try { - bigquery.query(QUERY_JOB_CONFIGURATION_FOR_QUERY); - fail("BigQueryException expected"); - } catch (BigQueryException ex) { - assertEquals(Lists.transform(errorProtoList, BigQueryError.FROM_PB_FUNCTION), ex.getErrors()); - } + BigQueryException ex = + Assertions.assertThrows( + BigQueryException.class, () -> bigquery.query(QUERY_JOB_CONFIGURATION_FOR_QUERY)); + assertEquals(Lists.transform(errorProtoList, BigQueryError.FROM_PB_FUNCTION), ex.getErrors()); QueryRequest requestPb = requestPbCapture.getValue(); assertEquals(QUERY_JOB_CONFIGURATION_FOR_QUERY.getQuery(), requestPb.getQuery()); @@ -3058,7 +3074,7 @@ public void testFastQueryBigQueryException() throws InterruptedException, IOExce } @Test - public void testCreateRoutine() throws IOException { + void testCreateRoutine() throws IOException { RoutineInfo routineInfo = ROUTINE_INFO.setProjectId(OTHER_PROJECT); when(bigqueryRpcMock.createSkipExceptionTranslation(routineInfo.toPb(), EMPTY_RPC_OPTIONS)) .thenReturn(routineInfo.toPb()); @@ -3071,7 +3087,7 @@ public void testCreateRoutine() throws IOException { } @Test - public void testGetRoutine() throws IOException { + void testGetRoutine() throws IOException { when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenReturn(ROUTINE_INFO.toPb()); @@ -3083,7 +3099,7 @@ public void testGetRoutine() throws IOException { } @Test - public void testGetRoutineWithRountineId() throws IOException { + void testGetRoutineWithRountineId() throws IOException { when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenReturn(ROUTINE_INFO.toPb()); @@ -3095,24 +3111,21 @@ public void testGetRoutineWithRountineId() throws IOException { } @Test - public void testGetRoutineWithEnabledThrowNotFoundException() throws IOException { + void testGetRoutineWithEnabledThrowNotFoundException() throws IOException { when(bigqueryRpcMock.getRoutineSkipExceptionTranslation( PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS)) .thenThrow(new BigQueryException(404, "Routine not found")); options.setThrowNotFound(true); bigquery = options.getService(); - try { - bigquery.getRoutine(ROUTINE_ID); - fail(); - } catch (BigQueryException ex) { - assertEquals("Routine not found", ex.getMessage()); - } + BigQueryException ex = + Assertions.assertThrows(BigQueryException.class, () -> bigquery.getRoutine(ROUTINE_ID)); + assertEquals("Routine not found", ex.getMessage()); verify(bigqueryRpcMock) .getRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE, EMPTY_RPC_OPTIONS); } @Test - public void testUpdateRoutine() throws IOException { + void testUpdateRoutine() throws IOException { RoutineInfo updatedRoutineInfo = ROUTINE_INFO.setProjectId(OTHER_PROJECT).toBuilder() .setDescription("newDescription") @@ -3130,7 +3143,7 @@ public void testUpdateRoutine() throws IOException { } @Test - public void testListRoutines() throws IOException { + void testListRoutines() throws IOException { bigquery = options.getService(); ImmutableList routineList = ImmutableList.of(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO))); @@ -3146,7 +3159,7 @@ public void testListRoutines() throws IOException { } @Test - public void testListRoutinesWithDatasetId() throws IOException { + void testListRoutinesWithDatasetId() throws IOException { bigquery = options.getService(); ImmutableList routineList = ImmutableList.of(new Routine(bigquery, new RoutineInfo.BuilderImpl(ROUTINE_INFO))); @@ -3162,7 +3175,7 @@ public void testListRoutinesWithDatasetId() throws IOException { } @Test - public void testDeleteRoutine() throws IOException { + void testDeleteRoutine() throws IOException { when(bigqueryRpcMock.deleteRoutineSkipExceptionTranslation(PROJECT, DATASET, ROUTINE)) .thenReturn(true); bigquery = options.getService(); @@ -3171,7 +3184,7 @@ public void testDeleteRoutine() throws IOException { } @Test - public void testWriteWithJob() throws IOException { + void testWriteWithJob() throws IOException { bigquery = options.getService(); Job job = new Job(bigquery, new JobInfo.BuilderImpl(JOB_INFO)); when(bigqueryRpcMock.openSkipExceptionTranslation( @@ -3197,7 +3210,7 @@ public void testWriteWithJob() throws IOException { } @Test - public void testWriteChannel() throws IOException { + void testWriteChannel() throws IOException { bigquery = options.getService(); Job job = new Job(bigquery, new JobInfo.BuilderImpl(JOB_INFO)); when(bigqueryRpcMock.openSkipExceptionTranslation( @@ -3223,7 +3236,7 @@ public void testWriteChannel() throws IOException { } @Test - public void testGetIamPolicy() throws IOException { + void testGetIamPolicy() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final com.google.api.services.bigquery.model.Policy apiPolicy = @@ -3237,7 +3250,7 @@ public void testGetIamPolicy() throws IOException { } @Test - public void testSetIamPolicy() throws IOException { + void testSetIamPolicy() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final com.google.api.services.bigquery.model.Policy apiPolicy = @@ -3253,7 +3266,7 @@ public void testSetIamPolicy() throws IOException { } @Test - public void testTestIamPermissions() throws IOException { + void testTestIamPermissions() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final List checkedPermissions = ImmutableList.of("foo", "bar", "baz"); @@ -3273,7 +3286,7 @@ public void testTestIamPermissions() throws IOException { } @Test - public void testTestIamPermissionsWhenNoPermissionsGranted() throws IOException { + void testTestIamPermissionsWhenNoPermissionsGranted() throws IOException { final String resourceId = String.format("projects/%s/datasets/%s/tables/%s", PROJECT, DATASET, TABLE); final List checkedPermissions = ImmutableList.of("foo", "bar", "baz"); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java index e77d7936a4..050deba4af 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryOptionsTest.java @@ -16,33 +16,34 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.TransportOptions; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class BigQueryOptionsTest { @Test - public void testInvalidTransport() { - try { - BigQueryOptions.newBuilder().setTransportOptions(Mockito.mock(TransportOptions.class)); - Assert.fail(); - } catch (IllegalArgumentException expected) { - Assert.assertNotNull(expected.getMessage()); - } + void testInvalidTransport() { + IllegalArgumentException expected = + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryOptions.newBuilder() + .setTransportOptions(Mockito.mock(TransportOptions.class))); + assertNotNull(expected.getMessage()); } @Test - public void dataFormatOptions_createdByDefault() { + void dataFormatOptions_createdByDefault() { BigQueryOptions options = BigQueryOptions.newBuilder().setProjectId("project-id").build(); assertNotNull(options.getDataFormatOptions()); @@ -53,7 +54,7 @@ public void dataFormatOptions_createdByDefault() { } @Test - public void nonBuilderSetUseInt64Timestamp_capturedInDataFormatOptions() { + void nonBuilderSetUseInt64Timestamp_capturedInDataFormatOptions() { BigQueryOptions options = BigQueryOptions.newBuilder() .setDataFormatOptions(DataFormatOptions.newBuilder().useInt64Timestamp(false).build()) @@ -65,7 +66,7 @@ public void nonBuilderSetUseInt64Timestamp_capturedInDataFormatOptions() { } @Test - public void nonBuilderSetUseInt64Timestamp_overridesEverything() { + void nonBuilderSetUseInt64Timestamp_overridesEverything() { BigQueryOptions options = BigQueryOptions.newBuilder().setProjectId("project-id").build(); options.setUseInt64Timestamps(true); @@ -73,7 +74,7 @@ public void nonBuilderSetUseInt64Timestamp_overridesEverything() { } @Test - public void noDataFormatOptions_capturesUseInt64TimestampSetInBuilder() { + void noDataFormatOptions_capturesUseInt64TimestampSetInBuilder() { BigQueryOptions options = BigQueryOptions.newBuilder().setUseInt64Timestamps(true).setProjectId("project-id").build(); @@ -81,7 +82,7 @@ public void noDataFormatOptions_capturesUseInt64TimestampSetInBuilder() { } @Test - public void dataFormatOptionsSetterHasPrecedence() { + void dataFormatOptionsSetterHasPrecedence() { BigQueryOptions options = BigQueryOptions.newBuilder() .setProjectId("project-id") diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java index ca150eb1ba..54d0b8e4e4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigQueryResultImplTest.java @@ -37,9 +37,9 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingDeque; import org.apache.arrow.vector.util.Text; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class BigQueryResultImplTest { +class BigQueryResultImplTest { private static final Schema SCHEMA = Schema.of( @@ -97,7 +97,7 @@ public class BigQueryResultImplTest { private static final int BUFFER_SIZE = 10; @Test - public void testResultSetFieldValueList() throws InterruptedException, SQLException { + void testResultSetFieldValueList() throws InterruptedException, SQLException { BlockingQueue> buffer = new LinkedBlockingDeque<>(BUFFER_SIZE); FieldValueList fieldValues = FieldValueList.of( @@ -199,7 +199,7 @@ public void testResultSetFieldValueList() throws InterruptedException, SQLExcept } @Test - public void testResultSetReadApi() throws InterruptedException, SQLException { + void testResultSetReadApi() throws InterruptedException, SQLException { BlockingQueue buffer = new LinkedBlockingDeque<>(BUFFER_SIZE); Map rowValues = new HashMap<>(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigtableOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigtableOptionsTest.java index 88fa1595e3..a11d9b923b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigtableOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/BigtableOptionsTest.java @@ -18,8 +18,8 @@ import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class BigtableOptionsTest { @@ -55,7 +55,7 @@ public class BigtableOptionsTest { .build(); @Test - public void testConstructors() { + void testConstructors() { // column assertThat(COL1.getQualifierEncoded()).isEqualTo("aaa"); assertThat(COL1.getFieldName()).isEqualTo("field1"); @@ -80,41 +80,36 @@ public void testConstructors() { } @Test - public void testNullPointerException() { - try { - BigtableColumnFamily.newBuilder().setFamilyID(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isNotNull(); - } - try { - BigtableColumnFamily.newBuilder().setColumns(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isNotNull(); - } - try { - BigtableColumnFamily.newBuilder().setEncoding(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isNotNull(); - } - try { - BigtableColumnFamily.newBuilder().setOnlyReadLatest(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isNotNull(); - } - try { - BigtableColumnFamily.newBuilder().setType(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex.getMessage()).isNotNull(); - } + void testNullPointerException() { + NullPointerException ex = + Assertions.assertThrows( + NullPointerException.class, + () -> BigtableColumnFamily.newBuilder().setFamilyID(null).build()); + assertThat(ex.getMessage()).isNotNull(); + ex = + Assertions.assertThrows( + NullPointerException.class, + () -> BigtableColumnFamily.newBuilder().setColumns(null).build()); + assertThat(ex.getMessage()).isNotNull(); + ex = + Assertions.assertThrows( + NullPointerException.class, + () -> BigtableColumnFamily.newBuilder().setEncoding(null).build()); + assertThat(ex.getMessage()).isNotNull(); + ex = + Assertions.assertThrows( + NullPointerException.class, + () -> BigtableColumnFamily.newBuilder().setOnlyReadLatest(null).build()); + assertThat(ex.getMessage()).isNotNull(); + ex = + Assertions.assertThrows( + NullPointerException.class, + () -> BigtableColumnFamily.newBuilder().setType(null).build()); + assertThat(ex.getMessage()).isNotNull(); } @Test - public void testIllegalStateException() { + void testIllegalStateException() { try { BigtableColumnFamily.newBuilder().build(); } catch (IllegalStateException ex) { @@ -123,14 +118,14 @@ public void testIllegalStateException() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareBigtableColumn(COL1, BigtableColumn.fromPb(COL1.toPb())); compareBigtableColumnFamily(TESTFAMILY, BigtableColumnFamily.fromPb(TESTFAMILY.toPb())); compareBigtableOptions(OPTIONS, BigtableOptions.fromPb(OPTIONS.toPb())); } @Test - public void testEquals() { + void testEquals() { compareBigtableColumn(COL1, COL1); compareBigtableColumnFamily(TESTFAMILY, TESTFAMILY); assertThat(TESTFAMILY.equals(TESTFAMILY)).isTrue(); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java index 33bcf5f405..1a319c947c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CloneDefinitionTest.java @@ -16,10 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CloneDefinitionTest { private static final TableId BASE_TABLE_ID = TableId.of("DATASET_NAME", "BASE_TABLE_NAME"); @@ -28,7 +28,7 @@ public class CloneDefinitionTest { CloneDefinition.newBuilder().setBaseTableId(BASE_TABLE_ID).setCloneTime(CLONE_TIME).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareCloneTableDefinition(CLONETABLE_DEFINITION, CLONETABLE_DEFINITION.toBuilder().build()); CloneDefinition cloneTableDefinition = CLONETABLE_DEFINITION.toBuilder().setCloneTime("2021-05-20T11:32:26.553Z").build(); @@ -36,7 +36,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(BASE_TABLE_ID, CLONETABLE_DEFINITION.getBaseTableId()); assertEquals(CLONE_TIME, CLONETABLE_DEFINITION.getCloneTime()); CloneDefinition cloneDefinition = @@ -45,7 +45,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { CloneDefinition cloneDefinition = CLONETABLE_DEFINITION.toBuilder().build(); assertTrue(CloneDefinition.fromPb(cloneDefinition.toPb()) instanceof CloneDefinition); compareCloneTableDefinition(cloneDefinition, CloneDefinition.fromPb(cloneDefinition.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java index 0cc680dddf..0c7c75306c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ColumnReferenceTest.java @@ -16,10 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ColumnReferenceTest { private static final ColumnReference COLUMN_REFERENCE = @@ -29,7 +29,7 @@ public class ColumnReferenceTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareColumnReferenceDefinition(COLUMN_REFERENCE, COLUMN_REFERENCE.toBuilder().build()); ColumnReference columnReference = COLUMN_REFERENCE.toBuilder() @@ -41,7 +41,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals("column1", COLUMN_REFERENCE.getReferencingColumn()); assertEquals("column2", COLUMN_REFERENCE.getReferencedColumn()); ColumnReference columnReference = @@ -54,7 +54,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { ColumnReference columnReference = COLUMN_REFERENCE.toBuilder().build(); assertTrue(ColumnReference.fromPb(columnReference.toPb()) instanceof ColumnReference); compareColumnReferenceDefinition( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java index 4edc6f05d1..54f9b7a33a 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionImplTest.java @@ -16,14 +16,26 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.*; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; -import com.google.api.services.bigquery.model.*; +import com.google.api.services.bigquery.model.GetQueryResultsResponse; +import com.google.api.services.bigquery.model.QueryParameter; +import com.google.api.services.bigquery.model.QueryParameterType; +import com.google.api.services.bigquery.model.QueryRequest; import com.google.api.services.bigquery.model.QueryResponse; +import com.google.api.services.bigquery.model.TableCell; +import com.google.api.services.bigquery.model.TableDataList; +import com.google.api.services.bigquery.model.TableRow; +import com.google.api.services.bigquery.model.TableSchema; import com.google.cloud.ServiceOptions; import com.google.cloud.Tuple; import com.google.cloud.bigquery.spi.BigQueryRpcFactory; @@ -41,14 +53,14 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; import java.util.concurrent.LinkedBlockingDeque; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class ConnectionImplTest { +@ExtendWith(MockitoExtension.class) +class ConnectionImplTest { private BigQueryOptions options; private BigQueryRpcFactory rpcFactoryMock; private HttpBigQueryRpc bigqueryRpcMock; @@ -140,8 +152,8 @@ private BigQueryOptions createBigQueryOptionsForProject( .build(); } - @Before - public void setUp() { + @BeforeEach + void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); bigqueryRpcMock = mock(HttpBigQueryRpc.class); connectionMock = mock(Connection.class); @@ -164,7 +176,7 @@ public void setUp() { } @Test - public void testFastQuerySinglePage() throws BigQuerySQLException, IOException { + void testFastQuerySinglePage() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); when(bigqueryRpcMock.queryRpcSkipExceptionTranslation( @@ -186,7 +198,7 @@ public void testFastQuerySinglePage() throws BigQuerySQLException, IOException { @Test // NOTE: This doesn't truly paginates. Returns a response while mocking // processQueryResponseResults - public void testFastQueryMultiplePages() throws BigQuerySQLException, IOException { + void testFastQueryMultiplePages() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse() .setSchema(FAST_QUERY_TABLESCHEMA) @@ -211,13 +223,13 @@ public void testFastQueryMultiplePages() throws BigQuerySQLException, IOExceptio } @Test - public void testClose() throws BigQuerySQLException { + void testClose() throws BigQuerySQLException { boolean cancelled = connection.close(); assertTrue(cancelled); } @Test - public void testQueryDryRun() throws BigQuerySQLException, IOException { + void testQueryDryRun() throws BigQuerySQLException, IOException { List queryParametersMock = ImmutableList.of( new QueryParameter().setParameterType(new QueryParameterType().setType("STRING"))); @@ -251,7 +263,7 @@ public void testQueryDryRun() throws BigQuerySQLException, IOException { } @Test - public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException, IOException { + void testQueryDryRunNoQueryParameters() throws BigQuerySQLException, IOException { com.google.api.services.bigquery.model.JobStatistics2 queryMock = new com.google.api.services.bigquery.model.JobStatistics2() .setSchema(FAST_QUERY_TABLESCHEMA); @@ -281,7 +293,7 @@ public void testQueryDryRunNoQueryParameters() throws BigQuerySQLException, IOEx } @Test - public void testParseDataTask() throws InterruptedException { + void testParseDataTask() throws InterruptedException { BlockingQueue, Boolean>> pageCache = new LinkedBlockingDeque<>(2); BlockingQueue> rpcResponseQueue = new LinkedBlockingDeque<>(2); @@ -306,7 +318,7 @@ public void testParseDataTask() throws InterruptedException { } @Test - public void testPopulateBuffer() throws InterruptedException { + void testPopulateBuffer() throws InterruptedException { BlockingQueue, Boolean>> pageCache = new LinkedBlockingDeque<>(2); @@ -341,7 +353,7 @@ public void testPopulateBuffer() throws InterruptedException { } @Test - public void testNextPageTask() throws InterruptedException { + void testNextPageTask() throws InterruptedException { BlockingQueue> rpcResponseQueue = new LinkedBlockingDeque<>(2); TableDataList mockTabledataList = new TableDataList() @@ -364,7 +376,7 @@ public void testNextPageTask() throws InterruptedException { } @Test - public void testGetQueryResultsFirstPage() throws IOException { + void testGetQueryResultsFirstPage() throws IOException { when(bigqueryRpcMock.getQueryResultsWithRowLimitSkipExceptionTranslation( any(String.class), any(String.class), @@ -386,7 +398,7 @@ public void testGetQueryResultsFirstPage() throws IOException { // calls executeSelect with a nonFast query and exercises createQueryJob @Test - public void testLegacyQuerySinglePage() throws BigQuerySQLException, IOException { + void testLegacyQuerySinglePage() throws BigQuerySQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() @@ -419,7 +431,7 @@ public void testLegacyQuerySinglePage() throws BigQuerySQLException, IOException // calls executeSelect with a nonFast query where the query returns an empty result. @Test - public void testLegacyQuerySinglePageEmptyResults() throws SQLException, IOException { + void testLegacyQuerySinglePageEmptyResults() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.Job jobResponseMock = new com.google.api.services.bigquery.model.Job() @@ -448,7 +460,7 @@ public void testLegacyQuerySinglePageEmptyResults() throws SQLException, IOExcep // exercises getSubsequentQueryResultsWithJob for fast running queries @Test - public void testFastQueryLongRunning() throws SQLException, IOException { + void testFastQueryLongRunning() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); // emulating a fast query doReturn(true).when(connectionSpy).isFastQuerySupported(); @@ -479,7 +491,7 @@ public void testFastQueryLongRunning() throws SQLException, IOException { } @Test - public void testFastQueryLongRunningAsync() + void testFastQueryLongRunningAsync() throws SQLException, ExecutionException, InterruptedException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); // emulating a fast query @@ -515,7 +527,7 @@ public void testFastQueryLongRunningAsync() } @Test - public void testFastQuerySinglePageAsync() + void testFastQuerySinglePageAsync() throws BigQuerySQLException, ExecutionException, InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse().setSchema(FAST_QUERY_TABLESCHEMA).setJobComplete(true); @@ -540,7 +552,7 @@ public void testFastQuerySinglePageAsync() } @Test - public void testExecuteSelectSlowWithParamsAsync() + void testExecuteSelectSlowWithParamsAsync() throws BigQuerySQLException, ExecutionException, InterruptedException { ConnectionImpl connectionSpy = Mockito.spy(connection); List parameters = new ArrayList<>(); @@ -584,7 +596,7 @@ public void testExecuteSelectSlowWithParamsAsync() } @Test - public void testFastQueryMultiplePagesAsync() + void testFastQueryMultiplePagesAsync() throws BigQuerySQLException, ExecutionException, InterruptedException, IOException { com.google.api.services.bigquery.model.QueryResponse mockQueryRes = new QueryResponse() @@ -616,7 +628,7 @@ public void testFastQueryMultiplePagesAsync() @Test // Emulates first page response using getQueryResultsFirstPage(jobId) and then subsequent pages // using getQueryResultsFirstPage(jobId) getSubsequentQueryResultsWithJob( - public void testLegacyQueryMultiplePages() throws SQLException, IOException { + void testLegacyQueryMultiplePages() throws SQLException, IOException { ConnectionImpl connectionSpy = Mockito.spy(connection); com.google.api.services.bigquery.model.JobStatistics jobStatistics = new com.google.api.services.bigquery.model.JobStatistics(); @@ -649,7 +661,7 @@ public void testLegacyQueryMultiplePages() throws SQLException, IOException { } @Test - public void testExecuteSelectSlow() throws BigQuerySQLException { + void testExecuteSelectSlow() throws BigQuerySQLException { ConnectionImpl connectionSpy = Mockito.spy(connection); doReturn(false).when(connectionSpy).isFastQuerySupported(); com.google.api.services.bigquery.model.JobStatistics jobStatistics = @@ -686,7 +698,7 @@ public void testExecuteSelectSlow() throws BigQuerySQLException { } @Test - public void testExecuteSelectSlowWithParams() throws BigQuerySQLException { + void testExecuteSelectSlowWithParams() throws BigQuerySQLException { ConnectionImpl connectionSpy = Mockito.spy(connection); List parameters = new ArrayList<>(); Map labels = new HashMap<>(); @@ -725,7 +737,7 @@ public void testExecuteSelectSlowWithParams() throws BigQuerySQLException { } @Test - public void testGetSubsequentQueryResultsWithJob() { + void testGetSubsequentQueryResultsWithJob() { ConnectionImpl connectionSpy = Mockito.spy(connection); JobId jobId = mock(JobId.class); BigQueryResultStats bqRsStats = mock(BigQueryResultStats.class); @@ -749,7 +761,7 @@ public void testGetSubsequentQueryResultsWithJob() { } @Test - public void testUseReadApi() { + void testUseReadApi() { ConnectionSettings connectionSettingsSpy = Mockito.spy(ConnectionSettings.class); doReturn(true).when(connectionSettingsSpy).getUseReadAPI(); doReturn(2).when(connectionSettingsSpy).getTotalToPageRowCountRatio(); @@ -775,7 +787,7 @@ public void testUseReadApi() { } @Test - public void testGetPageCacheSize() { + void testGetPageCacheSize() { ConnectionImpl connectionSpy = Mockito.spy(connection); // number of cached pages should be within a range assertTrue(connectionSpy.getPageCacheSize(10000, QUERY_SCHEMA) >= 3); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionPropertyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionPropertyTest.java index 9177720e8f..bc5def560b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionPropertyTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionPropertyTest.java @@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ConnectionPropertyTest { @@ -28,7 +28,7 @@ public class ConnectionPropertyTest { ConnectionProperty.newBuilder().setKey(KEY).setValue(VALUE).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareConnectionProperty(CONNECTION_PROPERTY, CONNECTION_PROPERTY.toBuilder().build()); ConnectionProperty property = CONNECTION_PROPERTY.toBuilder().setKey("time-zone").build(); assertThat(property.getKey()).isEqualTo("time-zone"); @@ -37,19 +37,19 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { ConnectionProperty connectionProperty = ConnectionProperty.of(KEY, VALUE); compareConnectionProperty(connectionProperty, connectionProperty.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertThat(CONNECTION_PROPERTY.getKey()).isEqualTo(KEY); assertThat(CONNECTION_PROPERTY.getValue()).isEqualTo(VALUE); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareConnectionProperty( CONNECTION_PROPERTY, ConnectionProperty.fromPb(CONNECTION_PROPERTY.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java index 8523825bca..29c29ed55c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ConnectionSettingsTest.java @@ -16,7 +16,7 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; @@ -26,9 +26,9 @@ import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ConnectionSettingsTest { +class ConnectionSettingsTest { private static final String TEST_PROJECT_ID = "test-project-id"; private static final DatasetId DATASET_ID = DatasetId.of("dataset"); private static final TableId TABLE_ID = TableId.of("dataset", "table"); @@ -116,19 +116,19 @@ public class ConnectionSettingsTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareConnectionSettings(CONNECTION_SETTINGS, CONNECTION_SETTINGS.toBuilder().build()); } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { ConnectionSettings connectionSettings = ConnectionSettings.newBuilder().setDefaultDataset(DATASET_ID).build(); compareConnectionSettings(connectionSettings, connectionSettings.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(REQUEST_TIMEOUT, CONNECTION_SETTINGS.getRequestTimeout()); assertEquals(NUM_BUFFERED_ROWS, CONNECTION_SETTINGS.getNumBufferedRows()); assertEquals(MAX_RESULTS, CONNECTION_SETTINGS.getMaxResults()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java index 3f21bf1c05..97538f2991 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CopyJobConfigurationTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.WriteDisposition; @@ -28,9 +28,9 @@ import com.google.common.collect.Lists; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class CopyJobConfigurationTest { +class CopyJobConfigurationTest { private static final String TEST_PROJECT_ID = "test-project-id"; private static final TableId SOURCE_TABLE = TableId.of("dataset", "sourceTable"); @@ -64,7 +64,7 @@ public class CopyJobConfigurationTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareCopyJobConfiguration(COPY_JOB_CONFIGURATION, COPY_JOB_CONFIGURATION.toBuilder().build()); compareCopyJobConfiguration( COPY_JOB_CONFIGURATION_MULTIPLE_TABLES, @@ -79,7 +79,7 @@ public void testToBuilder() { } @Test - public void testOf() { + void testOf() { CopyJobConfiguration job = CopyJobConfiguration.of(DESTINATION_TABLE, SOURCE_TABLES); assertEquals(DESTINATION_TABLE, job.getDestinationTable()); assertEquals(SOURCE_TABLES, job.getSourceTables()); @@ -89,14 +89,14 @@ public void testOf() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { CopyJobConfiguration jobConfiguration = CopyJobConfiguration.of(DESTINATION_TABLE, SOURCE_TABLES); compareCopyJobConfiguration(jobConfiguration, jobConfiguration.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(DESTINATION_TABLE, COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.getDestinationTable()); assertEquals(SOURCE_TABLES, COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.getSourceTables()); assertEquals(CREATE_DISPOSITION, COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.getCreateDisposition()); @@ -110,7 +110,7 @@ public void testBuilder() { } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { assertNotNull(COPY_JOB_CONFIGURATION.toPb().getCopy()); assertNull(COPY_JOB_CONFIGURATION.toPb().getExtract()); assertNull(COPY_JOB_CONFIGURATION.toPb().getLoad()); @@ -133,7 +133,7 @@ public void testToPbAndFromPb() { } @Test - public void testSetProjectId() { + void testSetProjectId() { CopyJobConfiguration configuration = COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.setProjectId(TEST_PROJECT_ID); assertEquals(TEST_PROJECT_ID, configuration.getDestinationTable().getProject()); @@ -143,7 +143,7 @@ public void testSetProjectId() { } @Test - public void testSetProjectIdDoNotOverride() { + void testSetProjectIdDoNotOverride() { CopyJobConfiguration configuration = COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.toBuilder() .setSourceTables( @@ -165,7 +165,7 @@ public TableId apply(TableId tableId) { } @Test - public void testGetType() { + void testGetType() { assertEquals(JobConfiguration.Type.COPY, COPY_JOB_CONFIGURATION.getType()); assertEquals(JobConfiguration.Type.COPY, COPY_JOB_CONFIGURATION_MULTIPLE_TABLES.getType()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java index fb0293a97a..1c31540fc0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/CsvOptionsTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CsvOptionsTest { @@ -46,7 +46,7 @@ public class CsvOptionsTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareCsvOptions(CSV_OPTIONS, CSV_OPTIONS.toBuilder().build()); CsvOptions csvOptions = CSV_OPTIONS.toBuilder().setFieldDelimiter(";").build(); assertEquals(";", csvOptions.getFieldDelimiter()); @@ -55,13 +55,13 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { CsvOptions csvOptions = CsvOptions.newBuilder().setFieldDelimiter("|").build(); assertEquals(csvOptions, csvOptions.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(FormatOptions.CSV, CSV_OPTIONS.getType()); assertEquals(ALLOW_JAGGED_ROWS, CSV_OPTIONS.allowJaggedRows()); assertEquals(ALLOW_QUOTED_NEWLINE, CSV_OPTIONS.allowQuotedNewLines()); @@ -75,7 +75,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareCsvOptions(CSV_OPTIONS, CsvOptions.fromPb(CSV_OPTIONS.toPb())); CsvOptions csvOptions = CsvOptions.newBuilder().setAllowJaggedRows(ALLOW_JAGGED_ROWS).build(); compareCsvOptions(csvOptions, CsvOptions.fromPb(csvOptions.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java index bacf7b2b0e..dc2ba28998 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetIdTest.java @@ -16,17 +16,17 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class DatasetIdTest { +class DatasetIdTest { private static final DatasetId DATASET = DatasetId.of("dataset"); private static final DatasetId DATASET_COMPLETE = DatasetId.of("project", "dataset"); @Test - public void testOf() { + void testOf() { assertEquals(null, DATASET.getProject()); assertEquals("dataset", DATASET.getDataset()); assertEquals("project", DATASET_COMPLETE.getProject()); @@ -34,19 +34,19 @@ public void testOf() { } @Test - public void testEquals() { + void testEquals() { compareDatasetIds(DATASET, DatasetId.of("dataset")); compareDatasetIds(DATASET_COMPLETE, DatasetId.of("project", "dataset")); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareDatasetIds(DATASET, DatasetId.fromPb(DATASET.toPb())); compareDatasetIds(DATASET_COMPLETE, DatasetId.fromPb(DATASET_COMPLETE.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals(DATASET_COMPLETE, DATASET.setProjectId("project")); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java index 1b75195cec..cb9768de4d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetInfoTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DatasetInfoTest { @@ -104,7 +104,7 @@ public class DatasetInfoTest { DATASET_INFO.toBuilder().setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS_5_DAYS).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareDatasets(DATASET_INFO, DATASET_INFO.toBuilder().build()); compareDatasets( DATASET_INFO_COMPLETE_WITH_IAM_MEMBER, @@ -122,13 +122,13 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { DatasetInfo datasetInfo = DatasetInfo.newBuilder(DATASET_ID).build(); assertEquals(datasetInfo, datasetInfo.toBuilder().build()); } @Test - public void testToBuilderWithExternalDatasetReference() { + void testToBuilderWithExternalDatasetReference() { compareDatasets( DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE, DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE.toBuilder().build()); @@ -149,7 +149,7 @@ public void testToBuilderWithExternalDatasetReference() { } @Test - public void testBuilder() { + void testBuilder() { assertNull(DATASET_INFO.getDatasetId().getProject()); assertEquals(DATASET_ID, DATASET_INFO.getDatasetId()); assertEquals(ACCESS_RULES, DATASET_INFO.getAcl()); @@ -189,7 +189,7 @@ public void testBuilder() { } @Test - public void testOf() { + void testOf() { DatasetInfo datasetInfo = DatasetInfo.of(DATASET_ID.getDataset()); assertEquals(DATASET_ID, datasetInfo.getDatasetId()); assertNull(datasetInfo.getAcl()); @@ -230,7 +230,7 @@ public void testOf() { } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareDatasets(DATASET_INFO_COMPLETE, DatasetInfo.fromPb(DATASET_INFO_COMPLETE.toPb())); compareDatasets( DATASET_INFO_COMPLETE_WITH_EXTERNAL_DATASET_REFERENCE, @@ -240,12 +240,12 @@ public void testToPbAndFromPb() { } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals(DATASET_INFO_COMPLETE, DATASET_INFO.setProjectId("project")); } @Test - public void testSetMaxTimeTravelHours() { + void testSetMaxTimeTravelHours() { assertNotEquals( DATASET_INFO_WITH_MAX_TIME_TRAVEL_5_DAYS.getMaxTimeTravelHours(), DATASET_INFO.getMaxTimeTravelHours()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java index d138e3cb51..5e19e8c825 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatasetTest.java @@ -16,13 +16,13 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -35,15 +35,13 @@ import com.google.common.collect.Iterables; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.MockitoRule; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class DatasetTest { +@ExtendWith(MockitoExtension.class) +class DatasetTest { private static final DatasetId DATASET_ID = DatasetId.of("dataset"); private static final List ACCESS_RULES = @@ -95,15 +93,13 @@ public class DatasetTest { .setConnection("connection") .build(); - @Rule public MockitoRule rule; - private BigQuery bigquery; private BigQueryOptions mockOptions; private Dataset expectedDataset; private Dataset dataset; - @Before - public void setUp() { + @BeforeEach + void setUp() { bigquery = mock(BigQuery.class); mockOptions = mock(BigQueryOptions.class); when(bigquery.getOptions()).thenReturn(mockOptions); @@ -112,7 +108,7 @@ public void setUp() { } @Test - public void testBuilder() { + void testBuilder() { Dataset builtDataset = new Dataset.Builder(bigquery, DATASET_ID) .setAcl(ACCESS_RULES) @@ -148,12 +144,12 @@ public void testBuilder() { } @Test - public void testToBuilder() { + void testToBuilder() { compareDataset(expectedDataset, expectedDataset.toBuilder().build()); } @Test - public void testExists_True() { + void testExists_True() { BigQuery.DatasetOption[] expectedOptions = {BigQuery.DatasetOption.fields()}; when(bigquery.getDataset(DATASET_INFO.getDatasetId(), expectedOptions)) .thenReturn(expectedDataset); @@ -162,7 +158,7 @@ public void testExists_True() { } @Test - public void testExists_False() { + void testExists_False() { BigQuery.DatasetOption[] expectedOptions = {BigQuery.DatasetOption.fields()}; when(bigquery.getDataset(DATASET_INFO.getDatasetId(), expectedOptions)).thenReturn(null); assertFalse(dataset.exists()); @@ -170,7 +166,7 @@ public void testExists_False() { } @Test - public void testReload() { + void testReload() { DatasetInfo updatedInfo = DATASET_INFO.toBuilder().setDescription("Description").build(); Dataset expectedDataset = new Dataset(bigquery, new DatasetInfo.BuilderImpl(updatedInfo)); when(bigquery.getDataset(DATASET_INFO.getDatasetId().getDataset())).thenReturn(expectedDataset); @@ -180,14 +176,14 @@ public void testReload() { } @Test - public void testReloadNull() { + void testReloadNull() { when(bigquery.getDataset(DATASET_INFO.getDatasetId().getDataset())).thenReturn(null); assertNull(dataset.reload()); verify(bigquery).getDataset(DATASET_INFO.getDatasetId().getDataset()); } @Test - public void testReloadWithOptions() { + void testReloadWithOptions() { DatasetInfo updatedInfo = DATASET_INFO.toBuilder().setDescription("Description").build(); Dataset expectedDataset = new Dataset(bigquery, new DatasetInfo.BuilderImpl(updatedInfo)); when(bigquery.getDataset( @@ -200,7 +196,7 @@ public void testReloadWithOptions() { } @Test - public void testUpdate() { + void testUpdate() { Dataset expectedUpdatedDataset = expectedDataset.toBuilder().setDescription("Description").build(); when(bigquery.update(eq(expectedDataset))).thenReturn(expectedUpdatedDataset); @@ -210,7 +206,7 @@ public void testUpdate() { } @Test - public void testUpdateWithOptions() { + void testUpdateWithOptions() { Dataset expectedUpdatedDataset = expectedDataset.toBuilder().setDescription("Description").build(); when(bigquery.update(eq(expectedDataset), eq(BigQuery.DatasetOption.fields()))) @@ -221,21 +217,21 @@ public void testUpdateWithOptions() { } @Test - public void testDeleteTrue() { + void testDeleteTrue() { when(bigquery.delete(DATASET_INFO.getDatasetId())).thenReturn(true); assertTrue(dataset.delete()); verify(bigquery).delete(DATASET_INFO.getDatasetId()); } @Test - public void testDeleteFalse() { + void testDeleteFalse() { when(bigquery.delete(DATASET_INFO.getDatasetId())).thenReturn(false); assertFalse(dataset.delete()); verify(bigquery).delete(DATASET_INFO.getDatasetId()); } @Test - public void testList() { + void testList() { List
    tableResults = ImmutableList.of( new Table(bigquery, new Table.BuilderImpl(TABLE_INFO1)), @@ -251,7 +247,7 @@ public void testList() { } @Test - public void testListWithOptions() { + void testListWithOptions() { List
    tableResults = ImmutableList.of( new Table(bigquery, new Table.BuilderImpl(TABLE_INFO1)), @@ -269,7 +265,7 @@ public void testListWithOptions() { } @Test - public void testGet() { + void testGet() { Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO1)); when(bigquery.getTable(TABLE_INFO1.getTableId())).thenReturn(expectedTable); Table table = dataset.get(TABLE_INFO1.getTableId().getTable()); @@ -279,7 +275,7 @@ public void testGet() { } @Test - public void testGetTableWithNewProjectId() { + void testGetTableWithNewProjectId() { Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO4)); when(bigquery.getTable(TABLE_ID1, null)).thenReturn(expectedTable); Table table = bigquery.getTable(TABLE_ID1, null); @@ -289,14 +285,14 @@ public void testGetTableWithNewProjectId() { } @Test - public void testGetNull() { + void testGetNull() { when(bigquery.getTable(TABLE_INFO1.getTableId())).thenReturn(null); assertNull(dataset.get(TABLE_INFO1.getTableId().getTable())); verify(bigquery).getTable(TABLE_INFO1.getTableId()); } @Test - public void testGetWithOptions() { + void testGetWithOptions() { Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO1)); when(bigquery.getTable(TABLE_INFO1.getTableId(), BigQuery.TableOption.fields())) .thenReturn(expectedTable); @@ -307,7 +303,7 @@ public void testGetWithOptions() { } @Test - public void testCreateTable() { + void testCreateTable() { Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO1)); when(bigquery.create(TABLE_INFO1)).thenReturn(expectedTable); Table table = dataset.create(TABLE_INFO1.getTableId().getTable(), TABLE_DEFINITION); @@ -316,7 +312,7 @@ public void testCreateTable() { } @Test - public void testCreateTableWithOptions() { + void testCreateTableWithOptions() { Table expectedTable = new Table(bigquery, new TableInfo.BuilderImpl(TABLE_INFO1)); when(bigquery.create(TABLE_INFO1, BigQuery.TableOption.fields())).thenReturn(expectedTable); Table table = @@ -327,17 +323,17 @@ public void testCreateTableWithOptions() { } @Test - public void testBigQuery() { + void testBigQuery() { assertSame(bigquery, expectedDataset.getBigQuery()); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareDataset(expectedDataset, Dataset.fromPb(bigquery, expectedDataset.toPb())); } @Test - public void testExternalDatasetReference() { + void testExternalDatasetReference() { Dataset datasetWithExternalDatasetReference = new Dataset.Builder(bigquery, DATASET_ID) .setAcl(ACCESS_RULES) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatastoreBackupOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatastoreBackupOptionsTest.java index af14108032..0102781190 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatastoreBackupOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DatastoreBackupOptionsTest.java @@ -16,20 +16,20 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class DatastoreBackupOptionsTest { +class DatastoreBackupOptionsTest { private static final List PROJECTION_FIELDS = ImmutableList.of("field1", "field2"); private static final DatastoreBackupOptions BACKUP_OPTIONS = DatastoreBackupOptions.newBuilder().setProjectionFields(PROJECTION_FIELDS).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareDatastoreBackupOptions(BACKUP_OPTIONS, BACKUP_OPTIONS.toBuilder().build()); List fields = ImmutableList.of("field1", "field2"); DatastoreBackupOptions backupOptions = @@ -40,14 +40,14 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { DatastoreBackupOptions backupOptions = DatastoreBackupOptions.newBuilder().setProjectionFields(PROJECTION_FIELDS).build(); assertEquals(backupOptions, backupOptions.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(FormatOptions.DATASTORE_BACKUP, BACKUP_OPTIONS.getType()); assertEquals(PROJECTION_FIELDS, BACKUP_OPTIONS.getProjectionFields()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java index 48950831a4..f165b60e39 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/DmlStatsTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DmlStatsTest { @@ -33,14 +33,14 @@ public class DmlStatsTest { .build(); @Test - public void testBuilder() { + void testBuilder() { assertEquals(DELETED_ROW_COUNT, DML_STATS.getDeletedRowCount()); assertEquals(UPDATED_ROW_COUNT, DML_STATS.getUpdatedRowCount()); assertEquals(INSERTED_ROW_COUNT, DML_STATS.getInsertedRowCount()); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareDmlStats(DML_STATS, DmlStats.fromPb(DML_STATS.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java index 6d241948b8..26dfcd5dcc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalDatasetReferenceTest.java @@ -16,10 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ExternalDatasetReferenceTest { private static final String EXTERNAL_SOURCE = "test_source"; @@ -31,7 +31,7 @@ public class ExternalDatasetReferenceTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareExternalDatasetReference( EXTERNAL_DATASET_REFERENCE, EXTERNAL_DATASET_REFERENCE.toBuilder().build()); ExternalDatasetReference externalDatasetReference = @@ -40,7 +40,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(EXTERNAL_SOURCE, EXTERNAL_DATASET_REFERENCE.getExternalSource()); assertEquals(CONNECTION, EXTERNAL_DATASET_REFERENCE.getConnection()); ExternalDatasetReference externalDatasetReference = @@ -52,7 +52,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { ExternalDatasetReference externalDatasetReference = EXTERNAL_DATASET_REFERENCE.toBuilder().build(); assertTrue( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java index cb7578c75a..480b8a4972 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExternalTableDefinitionTest.java @@ -16,16 +16,15 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import com.google.cloud.bigquery.ExternalTableDefinition.SourceColumnMatch; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ExternalTableDefinitionTest { +class ExternalTableDefinitionTest { private static final List SOURCE_URIS = ImmutableList.of("uri1", "uri2"); private static final List DECIMAL_TARGET_TYPES = @@ -98,7 +97,7 @@ public class ExternalTableDefinitionTest { ExternalTableDefinition.newBuilder(SOURCE_URIS, TABLE_SCHEMA, PARQUET_OPTIONS).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareExternalTableDefinition( EXTERNAL_TABLE_DEFINITION, EXTERNAL_TABLE_DEFINITION.toBuilder().build()); ExternalTableDefinition externalTableDefinition = @@ -117,23 +116,21 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.of(SOURCE_URIS, TABLE_SCHEMA, FormatOptions.json()); assertEquals(externalTableDefinition, externalTableDefinition.toBuilder().build()); } @Test - public void testTypeNullPointerException() { - try { - EXTERNAL_TABLE_DEFINITION.toBuilder().setType(null).build(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + void testTypeNullPointerException() { + org.junit.jupiter.api.Assertions.assertThrows( + NullPointerException.class, + () -> EXTERNAL_TABLE_DEFINITION.toBuilder().setType(null).build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(TableDefinition.Type.EXTERNAL, EXTERNAL_TABLE_DEFINITION.getType()); assertEquals(COMPRESSION, EXTERNAL_TABLE_DEFINITION.getCompression()); assertEquals(CONNECTION_ID, EXTERNAL_TABLE_DEFINITION.getConnectionId()); @@ -157,7 +154,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareExternalTableDefinition( EXTERNAL_TABLE_DEFINITION, ExternalTableDefinition.fromPb(EXTERNAL_TABLE_DEFINITION.toPb())); @@ -168,7 +165,7 @@ public void testToAndFromPb() { } @Test - public void testToAndFromPbParquet() { + void testToAndFromPbParquet() { compareExternalTableDefinition( EXTERNAL_TABLE_DEFINITION_PARQUET, ExternalTableDefinition.fromPb(EXTERNAL_TABLE_DEFINITION_PARQUET.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java index 2bf1e80a23..d7ce318f1b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ExtractJobConfigurationTest.java @@ -16,15 +16,15 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ExtractJobConfigurationTest { @@ -88,7 +88,7 @@ public class ExtractJobConfigurationTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareExtractJobConfiguration( EXTRACT_CONFIGURATION, EXTRACT_CONFIGURATION.toBuilder().build()); ExtractJobConfiguration job = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java index cf217b25c7..7821b93219 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldElementTypeTest.java @@ -15,10 +15,10 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.QueryParameterType; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FieldElementTypeTest { private static final FieldElementType FIELD_ELEMENT_TYPE = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldListTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldListTest.java index 999bbf1b02..9f63716427 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldListTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldListTest.java @@ -16,13 +16,14 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class FieldListTest { +class FieldListTest { private static final String FIELD_NAME1 = "StringField"; private static final String FIELD_NAME2 = "IntegerField"; private static final String FIELD_NAME3 = "RecordField"; @@ -63,7 +64,7 @@ public class FieldListTest { private final FieldList fieldsSchema = FieldList.of(fieldSchema1, fieldSchema2, fieldSchema3); @Test - public void testGetByName() { + void testGetByName() { assertEquals(fieldSchema1, fieldsSchema.get(FIELD_NAME1)); assertEquals(fieldSchema2, fieldsSchema.get(FIELD_NAME2)); assertEquals(fieldSchema3, fieldsSchema.get(FIELD_NAME3)); @@ -76,34 +77,26 @@ public void testGetByName() { assertEquals(3, fieldsSchema.size()); - IllegalArgumentException exception = null; - try { - fieldsSchema.get(FIELD_NAME4); - } catch (IllegalArgumentException e) { - exception = e; - } + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, () -> fieldsSchema.get(FIELD_NAME4)); assertNotNull(exception); } @Test - public void testGetByIndex() { + void testGetByIndex() { assertEquals(fieldSchema1, fieldsSchema.get(0)); assertEquals(fieldSchema2, fieldsSchema.get(1)); assertEquals(fieldSchema3, fieldsSchema.get(2)); assertEquals(3, fieldsSchema.size()); - IndexOutOfBoundsException exception = null; - try { - fieldsSchema.get(4); - } catch (IndexOutOfBoundsException e) { - exception = e; - } + IndexOutOfBoundsException exception = + assertThrows(IndexOutOfBoundsException.class, () -> fieldsSchema.get(4)); assertNotNull(exception); } @Test - public void testGetRecordSchema() { + void testGetRecordSchema() { assertEquals(2, fieldSchema3.getSubFields().size()); assertEquals(fieldSchema1, fieldSchema3.getSubFields().get(FIELD_NAME1)); assertEquals(fieldSchema2, fieldSchema3.getSubFields().get(FIELD_NAME2)); @@ -122,7 +115,7 @@ public void testGetRecordSchema() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { assertEquals(fieldsSchema, FieldList.of(fieldSchema1, fieldSchema2, fieldSchema3)); assertNotEquals(fieldsSchema, FieldList.of(fieldSchema1, fieldSchema3)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java index d7c5e25a2e..72f8bb3e82 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldTest.java @@ -16,15 +16,15 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FieldTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java index 5ade7c2298..dd5092b1c1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueListTest.java @@ -16,9 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.client.util.Data; import com.google.api.services.bigquery.model.TableCell; @@ -28,9 +29,9 @@ import com.google.common.io.BaseEncoding; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class FieldValueListTest { +class FieldValueListTest { private static final byte[] BYTES = {0xD, 0xE, 0xA, 0xD}; private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); private static final TableCell booleanPb = new TableCell().setV("false"); @@ -138,7 +139,7 @@ public class FieldValueListTest { schemaLosslessTimestamp); @Test - public void testFromPb() { + void testFromPb() { assertEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, schema)); // Schema does not influence values equality assertEquals(fieldValues, FieldValueList.fromPb(fieldValuesPb, null)); @@ -151,7 +152,7 @@ public void testFromPb() { } @Test - public void testGetByIndex() { + void testGetByIndex() { assertEquals(11, fieldValues.size()); assertEquals(booleanFv, fieldValues.get(0)); assertEquals(integerFv, fieldValues.get(1)); @@ -173,7 +174,7 @@ public void testGetByIndex() { } @Test - public void testGetByName() { + void testGetByName() { assertEquals(11, fieldValues.size()); assertEquals(booleanFv, fieldValues.get("first")); assertEquals(integerFv, fieldValues.get("second")); @@ -195,7 +196,7 @@ public void testGetByName() { } @Test - public void testNullSchema() { + void testNullSchema() { FieldValueList fieldValuesNoSchema = FieldValueList.of( ImmutableList.of( @@ -213,25 +214,15 @@ public void testNullSchema() { assertEquals(fieldValues, fieldValuesNoSchema); - UnsupportedOperationException exception = null; - try { - fieldValuesNoSchema.get("first"); - } catch (UnsupportedOperationException e) { - exception = e; - } - + UnsupportedOperationException exception = + assertThrows(UnsupportedOperationException.class, () -> fieldValuesNoSchema.get("first")); assertNotNull(exception); } @Test - public void testGetNonExistentField() { - IllegalArgumentException exception = null; - try { - fieldValues.get("nonexistent"); - } catch (IllegalArgumentException e) { - exception = e; - } - + void testGetNonExistentField() { + IllegalArgumentException exception = + assertThrows(IllegalArgumentException.class, () -> fieldValues.get("nonexistent")); assertNotNull(exception); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java index 4ec527f7ce..958e206598 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FieldValueTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.client.util.Data; import com.google.api.services.bigquery.model.TableCell; @@ -33,7 +33,7 @@ import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; public class FieldValueTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java index 1ebd93ef42..2dfacda542 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ForeignKeyTest.java @@ -16,14 +16,14 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ForeignKeyTest { +class ForeignKeyTest { private static final TableId TABLE_ID = TableId.of("project", "dataset", "table"); private static final ColumnReference COLUMN_REFERENCE = @@ -39,7 +39,7 @@ public class ForeignKeyTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareForeignKeyDefinition(FOREIGN_KEY, FOREIGN_KEY.toBuilder().build()); TableId referencedTable = TableId.of("project1", "dataset1", "table1"); ArrayList columnReferences = new ArrayList<>(); @@ -65,7 +65,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals("foreign_key", FOREIGN_KEY.getName()); assertEquals(TABLE_ID, FOREIGN_KEY.getReferencedTable()); assertEquals(Collections.singletonList(COLUMN_REFERENCE), FOREIGN_KEY.getColumnReferences()); @@ -80,7 +80,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { ForeignKey foreignKey = FOREIGN_KEY.toBuilder().build(); assertTrue(ForeignKey.fromPb(foreignKey.toPb()) instanceof ForeignKey); compareForeignKeyDefinition(foreignKey, ForeignKey.fromPb(foreignKey.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java index d3cfb6e330..e8642e86e2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FormatOptionsTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java index efbee79b69..7aae673d3d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/GoogleSheetsOptionsTest.java @@ -18,7 +18,7 @@ import static com.google.common.truth.Truth.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class GoogleSheetsOptionsTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java index 51baf918b8..401ab07b72 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/HivePartitioningOptionsTest.java @@ -20,9 +20,9 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class HivePartitioningOptionsTest { +class HivePartitioningOptionsTest { private static final String MODE = "STRING"; private static final String SOURCE_URI_PREFIX = "gs://bucket/path_to_table"; @@ -37,7 +37,7 @@ public class HivePartitioningOptionsTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareHivePartitioningOptions( HIVE_PARTITIONING_OPTIONS, HIVE_PARTITIONING_OPTIONS.toBuilder().build()); HivePartitioningOptions options = HIVE_PARTITIONING_OPTIONS.toBuilder().setMode("AUTO").build(); @@ -47,13 +47,13 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { HivePartitioningOptions options = HivePartitioningOptions.newBuilder().build(); compareHivePartitioningOptions(options, options.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertThat(HIVE_PARTITIONING_OPTIONS.getMode()).isEqualTo(MODE); assertThat(HIVE_PARTITIONING_OPTIONS.getRequirePartitionFilter()) .isEqualTo(REQUIRE_PARTITION_FILTER); @@ -61,7 +61,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareHivePartitioningOptions( HIVE_PARTITIONING_OPTIONS, HivePartitioningOptions.fromPb(HIVE_PARTITIONING_OPTIONS.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java index 4ee1ca13f3..d687e75b34 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllRequestTest.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -24,7 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class InsertAllRequestTest { @@ -214,11 +215,11 @@ public void testEquals() { compareInsertAllRequest(INSERT_ALL_REQUEST11, INSERT_ALL_REQUEST11); } - @Test(expected = UnsupportedOperationException.class) + @Test public void testImmutable() { - InsertAllRequest.RowToInsert row = - InsertAllRequest.RowToInsert.of(new HashMap()); - row.getContent().put("zip", "zap"); + InsertAllRequest.RowToInsert row = InsertAllRequest.RowToInsert.of(new HashMap<>()); + + assertThrows(UnsupportedOperationException.class, () -> row.getContent().put("zip", "zap")); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java index b39066a6a2..9b30e25860 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/InsertAllResponseTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class InsertAllResponseTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java index 05ae7cefe4..7934ad1204 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobIdTest.java @@ -16,17 +16,17 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JobIdTest { +class JobIdTest { private static final JobId JOB = JobId.of("job"); private static final JobId JOB_COMPLETE = JobId.of("project", "job"); @Test - public void testOf() { + void testOf() { assertEquals(null, JOB.getProject()); assertEquals("job", JOB.getJob()); assertEquals("project", JOB_COMPLETE.getProject()); @@ -34,19 +34,19 @@ public void testOf() { } @Test - public void testEquals() { + void testEquals() { compareJobs(JOB, JobId.of("job")); compareJobs(JOB_COMPLETE, JobId.of("project", "job")); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareJobs(JOB, JobId.fromPb(JOB.toPb())); compareJobs(JOB_COMPLETE, JobId.fromPb(JOB_COMPLETE.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals(JOB_COMPLETE, JOB.setProjectId("project")); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java index 71825f0a54..6c7f9b245c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobInfoTest.java @@ -16,10 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; @@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class JobInfoTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java index 2a1353f5d8..289548113b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatisticsTest.java @@ -17,7 +17,7 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.cloud.bigquery.JobStatistics.CopyStatistics; import com.google.cloud.bigquery.JobStatistics.ExtractStatistics; @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableList; import java.util.List; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class JobStatisticsTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java index bb463d1cec..1c20b72404 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobStatusTest.java @@ -16,13 +16,13 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class JobStatusTest { +class JobStatusTest { private static final JobStatus.State STATE = JobStatus.State.DONE; private static final BigQueryError ERROR = @@ -36,7 +36,7 @@ public class JobStatusTest { private static final JobStatus JOB_STATUS_INCOMPLETE2 = new JobStatus(STATE, null, null); @Test - public void testConstructor() { + void testConstructor() { assertEquals(STATE, JOB_STATUS.getState()); assertEquals(ERROR, JOB_STATUS.getError()); assertEquals(ALL_ERRORS, JOB_STATUS.getExecutionErrors()); @@ -51,7 +51,7 @@ public void testConstructor() { } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareStatus(JOB_STATUS, JobStatus.fromPb(JOB_STATUS.toPb())); compareStatus(JOB_STATUS_INCOMPLETE1, JobStatus.fromPb(JOB_STATUS_INCOMPLETE1.toPb())); compareStatus(JOB_STATUS_INCOMPLETE2, JobStatus.fromPb(JOB_STATUS_INCOMPLETE2.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java index e6d249af46..f85c2f76c4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/JobTest.java @@ -18,14 +18,14 @@ import static com.google.common.collect.ObjectArrays.concat; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; @@ -42,16 +42,13 @@ import com.google.cloud.bigquery.JobStatus.State; import com.google.common.collect.ImmutableList; import java.time.Duration; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.MockitoRule; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class JobTest { +@ExtendWith(MockitoExtension.class) +class JobTest { private static final JobId JOB_ID = JobId.of("project", "job"); private static final TableId TABLE_ID1 = TableId.of("dataset", "table1"); @@ -94,15 +91,13 @@ public class JobTest { .retryOnMessage(BigQueryErrorMessages.RATE_LIMIT_EXCEEDED_MSG) .build(); - @Rule public MockitoRule rule; - private BigQuery bigquery; private BigQueryOptions mockOptions; private Job expectedJob; private Job job; - @Before - public void setUp() { + @BeforeEach + void setUp() { bigquery = mock(BigQuery.class); mockOptions = mock(BigQueryOptions.class); when(bigquery.getOptions()).thenReturn(mockOptions); @@ -111,7 +106,7 @@ public void setUp() { } @Test - public void testBuilder() { + void testBuilder() { Job builtJob = new Job.Builder(bigquery, COPY_CONFIGURATION) .setJobId(JOB_ID) @@ -135,12 +130,12 @@ public void testBuilder() { } @Test - public void testToBuilder() { + void testToBuilder() { compareJob(expectedJob, expectedJob.toBuilder().build()); } @Test - public void testExists_True() { + void testExists_True() { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields()}; when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(expectedJob); assertTrue(job.exists()); @@ -148,7 +143,7 @@ public void testExists_True() { } @Test - public void testExists_False() { + void testExists_False() { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields()}; when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(null); assertFalse(job.exists()); @@ -156,14 +151,14 @@ public void testExists_False() { } @Test - public void testIsDone_True() { + void testIsDone_True() { Job job = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.DONE)).build(); assertTrue(job.isDone()); verify(bigquery, times(0)).getJob(eq(JOB_INFO.getJobId()), any()); } @Test - public void testIsDone_False() { + void testIsDone_False() { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; Job job = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(job); @@ -172,7 +167,7 @@ public void testIsDone_False() { } @Test - public void testIsDone_NotExists() { + void testIsDone_NotExists() { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; Job jobWithRunningState = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); @@ -182,7 +177,7 @@ public void testIsDone_NotExists() { } @Test - public void testWaitFor() throws InterruptedException { + void testWaitFor() throws InterruptedException { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; JobStatus status = mock(JobStatus.class); when(status.getState()).thenReturn(JobStatus.State.DONE); @@ -199,7 +194,7 @@ public void testWaitFor() throws InterruptedException { } @Test - public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { + void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -243,7 +238,7 @@ public void testWaitForAndGetQueryResultsEmpty() throws InterruptedException { } @Test - public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedException { + void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -288,7 +283,7 @@ public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedExc } @Test - public void testWaitForAndGetQueryResults() throws InterruptedException { + void testWaitForAndGetQueryResults() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -340,17 +335,14 @@ public void testWaitForAndGetQueryResults() throws InterruptedException { } @Test - public void testWaitForAndGetQueryResults_Unsupported() throws InterruptedException { - try { - job.getQueryResults(); - Assert.fail(); - } catch (UnsupportedOperationException expected) { - Assert.assertNotNull(expected.getMessage()); - } + void testWaitForAndGetQueryResults_Unsupported() throws InterruptedException { + UnsupportedOperationException expected = + assertThrows(UnsupportedOperationException.class, () -> job.getQueryResults()); + assertNotNull(expected.getMessage()); } @Test - public void testWaitFor_Null() throws InterruptedException { + void testWaitFor_Null() throws InterruptedException { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(null); @@ -359,7 +351,7 @@ public void testWaitFor_Null() throws InterruptedException { } @Test - public void testWaitForWithCheckingPeriod() throws InterruptedException { + void testWaitForWithCheckingPeriod() throws InterruptedException { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; JobStatus status = mock(JobStatus.class); when(status.getState()).thenReturn(JobStatus.State.RUNNING); @@ -381,7 +373,7 @@ public void testWaitForWithCheckingPeriod() throws InterruptedException { } @Test - public void testWaitForWithCheckingPeriod_Null() throws InterruptedException { + void testWaitForWithCheckingPeriod_Null() throws InterruptedException { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); Job runningJob = @@ -394,24 +386,26 @@ public void testWaitForWithCheckingPeriod_Null() throws InterruptedException { } @Test - public void testWaitForWithTimeout() throws InterruptedException { + void testWaitForWithTimeout() throws InterruptedException { BigQuery.JobOption[] expectedOptions = {BigQuery.JobOption.fields(BigQuery.JobField.STATUS)}; when(mockOptions.getClock()).thenReturn(CurrentMillisClock.getDefaultClock()); Job runningJob = expectedJob.toBuilder().setStatus(new JobStatus(JobStatus.State.RUNNING)).build(); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(runningJob); when(bigquery.getJob(JOB_INFO.getJobId(), expectedOptions)).thenReturn(runningJob); - try { - job.waitFor( - concat(TEST_RETRY_OPTIONS, RetryOption.totalTimeoutDuration(Duration.ofMillis(3)))); - Assert.fail(); - } catch (BigQueryException expected) { - Assert.assertNotNull(expected.getMessage()); - } + BigQueryException expected = + assertThrows( + BigQueryException.class, + () -> + job.waitFor( + concat( + TEST_RETRY_OPTIONS, + RetryOption.totalTimeoutDuration(Duration.ofMillis(3))))); + assertNotNull(expected.getMessage()); } @Test - public void testWaitForWithBigQueryRetryConfig() throws InterruptedException { + void testWaitForWithBigQueryRetryConfig() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -453,7 +447,7 @@ public void testWaitForWithBigQueryRetryConfig() throws InterruptedException { } @Test - public void testWaitForWithBigQueryRetryConfigShouldRetry() throws InterruptedException { + void testWaitForWithBigQueryRetryConfigShouldRetry() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -504,7 +498,7 @@ public void testWaitForWithBigQueryRetryConfigShouldRetry() throws InterruptedEx } @Test - public void testWaitForWithBigQueryRetryConfigErrorShouldNotRetry() throws InterruptedException { + void testWaitForWithBigQueryRetryConfigErrorShouldNotRetry() throws InterruptedException { QueryStatistics jobStatistics = QueryStatistics.newBuilder() .setCreationTimestamp(1L) @@ -542,19 +536,18 @@ public void testWaitForWithBigQueryRetryConfigErrorShouldNotRetry() throws Inter .thenThrow(bigQueryException) .thenReturn(completedQuery); job = this.job.toBuilder().setConfiguration(DRL_QUERY_CONFIGURATION).build(); - try { - job.waitFor(TEST_BIGQUERY_RETRY_CONFIG, TEST_RETRY_OPTIONS); - fail("JobException expected"); - } catch (BigQueryException e) { - assertNotNull(e.getErrors()); - } + BigQueryException e = + assertThrows( + BigQueryException.class, + () -> job.waitFor(TEST_BIGQUERY_RETRY_CONFIG, TEST_RETRY_OPTIONS)); + assertNotNull(e.getErrors()); // Verify that getQueryResults is attempted only once and not retried since the error message // does not match. verify(bigquery, times(1)).getQueryResults(jobInfo.getJobId(), Job.DEFAULT_QUERY_WAIT_OPTIONS); } @Test - public void testReload() { + void testReload() { JobInfo updatedInfo = JOB_INFO.toBuilder().setEtag("etag").build(); Job expectedJob = new Job(bigquery, new JobInfo.BuilderImpl(updatedInfo)); when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(expectedJob); @@ -564,7 +557,7 @@ public void testReload() { } @Test - public void testReloadJobException() { + void testReloadJobException() { JobInfo updatedInfo = JOB_INFO.toBuilder().setEtag("etag").build(); Job expectedJob = new Job(bigquery, new JobInfo.BuilderImpl(updatedInfo)); BigQueryError bigQueryError = new BigQueryError("invalidQuery", "US", "invalidQuery"); @@ -573,23 +566,19 @@ public void testReloadJobException() { ImmutableList bigQueryErrorList = ImmutableList.of(bigQueryError); BigQueryException bigQueryException = new BigQueryException(bigQueryErrorList); when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(expectedJob).thenThrow(bigQueryException); - try { - job.reload(); - fail("JobException expected"); - } catch (BigQueryException e) { - assertNotNull(e.getErrors()); - } + BigQueryException e = assertThrows(BigQueryException.class, () -> job.reload()); + assertNotNull(e.getErrors()); } @Test - public void testReloadNull() { + void testReloadNull() { when(bigquery.getJob(JOB_INFO.getJobId())).thenReturn(null); assertNull(job.reload()); verify(bigquery).getJob(JOB_INFO.getJobId()); } @Test - public void testReloadWithOptions() { + void testReloadWithOptions() { JobInfo updatedInfo = JOB_INFO.toBuilder().setEtag("etag").build(); Job expectedJob = new Job(bigquery, new JobInfo.BuilderImpl(updatedInfo)); when(bigquery.getJob(JOB_INFO.getJobId(), BigQuery.JobOption.fields())).thenReturn(expectedJob); @@ -599,24 +588,24 @@ public void testReloadWithOptions() { } @Test - public void testCancel() { + void testCancel() { when(bigquery.cancel(JOB_INFO.getJobId())).thenReturn(true); assertTrue(job.cancel()); verify(bigquery).cancel(JOB_INFO.getJobId()); } @Test - public void testBigQuery() { + void testBigQuery() { assertSame(bigquery, expectedJob.getBigQuery()); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareJob(expectedJob, Job.fromPb(bigquery, expectedJob.toPb())); } @Test - public void testToAndFromPbWithoutConfiguration() { + void testToAndFromPbWithoutConfiguration() { assertNotEquals(expectedJob, bigquery); compareJob(expectedJob, Job.fromPb(bigquery, expectedJob.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java index d987eb28e0..1a9db29951 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/LoadJobConfigurationTest.java @@ -16,7 +16,7 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; @@ -28,9 +28,9 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class LoadJobConfigurationTest { +class LoadJobConfigurationTest { private static final String TEST_PROJECT_ID = "test-project-id"; private static final CsvOptions CSV_OPTIONS = @@ -168,7 +168,7 @@ public class LoadJobConfigurationTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareLoadJobConfiguration(LOAD_CONFIGURATION_CSV, LOAD_CONFIGURATION_CSV.toBuilder().build()); LoadJobConfiguration configurationCSV = LOAD_CONFIGURATION_CSV.toBuilder() @@ -200,7 +200,7 @@ public void testToBuilder() { } @Test - public void testOf() { + void testOf() { LoadJobConfiguration configuration = LoadJobConfiguration.of(TABLE_ID, SOURCE_URIS); assertEquals(TABLE_ID, configuration.getDestinationTable()); assertEquals(SOURCE_URIS, configuration.getSourceUris()); @@ -220,13 +220,13 @@ public void testOf() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { LoadJobConfiguration configuration = LoadJobConfiguration.of(TABLE_ID, SOURCE_URIS); compareLoadJobConfiguration(configuration, configuration.toBuilder().build()); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareLoadJobConfiguration( LOAD_CONFIGURATION_CSV, LoadJobConfiguration.fromPb(LOAD_CONFIGURATION_CSV.toPb())); LoadJobConfiguration configuration = LoadJobConfiguration.of(TABLE_ID, SOURCE_URIS); @@ -234,13 +234,13 @@ public void testToPbAndFromPb() { } @Test - public void testSetProjectId() { + void testSetProjectId() { LoadConfiguration configuration = LOAD_CONFIGURATION_CSV.setProjectId(TEST_PROJECT_ID); assertEquals(TEST_PROJECT_ID, configuration.getDestinationTable().getProject()); } @Test - public void testSetProjectIdDoNotOverride() { + void testSetProjectIdDoNotOverride() { LoadConfiguration configuration = LOAD_CONFIGURATION_CSV.toBuilder() .setDestinationTable(TABLE_ID.setProjectId(TEST_PROJECT_ID)) @@ -250,7 +250,7 @@ public void testSetProjectIdDoNotOverride() { } @Test - public void testGetType() { + void testGetType() { assertEquals(JobConfiguration.Type.LOAD, LOAD_CONFIGURATION_CSV.getType()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java index eef4324a0e..00ac64937f 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MaterializedViewDefinitionTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableList; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class MaterializedViewDefinitionTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelIdTest.java index 266a754c44..98df2d5f26 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelIdTest.java @@ -16,17 +16,17 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ModelIdTest { +class ModelIdTest { public static final ModelId MODEL = ModelId.of("dataset", "model"); public static final ModelId MODEL_COMPLETE = ModelId.of("project", "dataset", "model"); @Test - public void testOf() { + void testOf() { assertEquals(null, MODEL.getProject()); assertEquals("dataset", MODEL.getDataset()); assertEquals("model", MODEL.getModel()); @@ -37,19 +37,19 @@ public void testOf() { } @Test - public void testEquals() { + void testEquals() { compareModelIds(MODEL, ModelId.of("dataset", "model")); compareModelIds(MODEL_COMPLETE, ModelId.of("project", "dataset", "model")); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareModelIds(MODEL, ModelId.fromPb(MODEL.toPb())); compareModelIds(MODEL_COMPLETE, ModelId.fromPb(MODEL_COMPLETE.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { ModelId differentProjectTable = ModelId.of("differentProject", "dataset", "model"); assertEquals(differentProjectTable, MODEL.setProjectId("differentProject")); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelInfoTest.java index 87fa8bbf56..be0e1ff233 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelInfoTest.java @@ -15,16 +15,16 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.api.services.bigquery.model.TrainingOptions; import com.google.api.services.bigquery.model.TrainingRun; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ModelInfoTest { +class ModelInfoTest { private static final ModelId MODEL_ID = ModelId.of("dataset", "model"); private static final String ETAG = "etag"; @@ -57,18 +57,18 @@ public class ModelInfoTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareModelInfo(MODEL_INFO, MODEL_INFO.toBuilder().build()); } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { ModelInfo modelInfo = ModelInfo.of(MODEL_ID); assertEquals(modelInfo, modelInfo.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(ETAG, MODEL_INFO.getEtag()); assertEquals(CREATION_TIME, MODEL_INFO.getCreationTime()); assertEquals(LAST_MODIFIED_TIME, MODEL_INFO.getLastModifiedTime()); @@ -81,7 +81,7 @@ public void testBuilder() { } @Test - public void testOf() { + void testOf() { ModelInfo modelInfo = ModelInfo.of(MODEL_ID); assertEquals(MODEL_ID, modelInfo.getModelId()); assertNull(modelInfo.getEtag()); @@ -98,12 +98,12 @@ public void testOf() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareModelInfo(MODEL_INFO, ModelInfo.fromPb(MODEL_INFO.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals("project", MODEL_INFO.setProjectId("project").getModelId().getProject()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTableDefinitionTest.java index 62b2cfe7d8..444d47c093 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTableDefinitionTest.java @@ -16,14 +16,14 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -public class ModelTableDefinitionTest { +class ModelTableDefinitionTest { private static final String LOCATION = "US"; private static final Long NUM_BYTES = 14L; @@ -52,34 +52,33 @@ public class ModelTableDefinitionTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareModelTableDefinition(MODEL_TABLE_DEFINITION, MODEL_TABLE_DEFINITION.toBuilder().build()); } @Test - public void testTypeNullPointerException() { - try { - MODEL_TABLE_DEFINITION.toBuilder().setType(null).build(); - fail(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + void testTypeNullPointerException() { + NullPointerException ex = + Assertions.assertThrows( + NullPointerException.class, + () -> MODEL_TABLE_DEFINITION.toBuilder().setType(null).build()); + assertNotNull(ex.getMessage()); } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { ModelTableDefinition modelTableDefinition = ModelTableDefinition.newBuilder().build(); assertEquals(modelTableDefinition, modelTableDefinition.toBuilder().build()); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { assertEquals( MODEL_TABLE_DEFINITION, ModelTableDefinition.fromPb(MODEL_TABLE_DEFINITION.toPb())); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(MODEL_TABLE_DEFINITION.getSchema(), TABLE_SCHEMA); assertEquals(MODEL_TABLE_DEFINITION.getType(), TableDefinition.Type.MODEL); assertEquals(MODEL_TABLE_DEFINITION.getLocation(), LOCATION); @@ -87,12 +86,12 @@ public void testBuilder() { } @Test - public void testEquals() { + void testEquals() { assertEquals(MODEL_TABLE_DEFINITION, MODEL_TABLE_DEFINITION); } @Test - public void testNotEquals() { + void testNotEquals() { assertNotEquals(MODEL_TABLE_DEFINITION, LOCATION); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTest.java index 756277adc3..acdbdfbfe5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ModelTest.java @@ -16,25 +16,23 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.MockitoRule; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) -public class ModelTest { +@ExtendWith(MockitoExtension.class) +class ModelTest { private static final ModelId MODEL_ID = ModelId.of("dataset", "model"); private static final String ETAG = "etag"; @@ -54,15 +52,13 @@ public class ModelTest { .setFriendlyName(FRIENDLY_NAME) .build(); - @Rule public MockitoRule rule; - private BigQuery bigquery; private BigQueryOptions mockOptions; private Model expectedModel; private Model model; - @Before - public void setUp() { + @BeforeEach + void setUp() { bigquery = mock(BigQuery.class); mockOptions = mock(BigQueryOptions.class); when(bigquery.getOptions()).thenReturn(mockOptions); @@ -71,7 +67,7 @@ public void setUp() { } @Test - public void testBuilder() { + void testBuilder() { Model builtModel = new Model.Builder(bigquery, MODEL_ID) .setEtag(ETAG) @@ -86,12 +82,12 @@ public void testBuilder() { } @Test - public void testToBuilder() { + void testToBuilder() { compareModelInfo(expectedModel, expectedModel.toBuilder().build()); } @Test - public void testExists_True() { + void testExists_True() { BigQuery.ModelOption[] expectedOptions = {BigQuery.ModelOption.fields()}; when(bigquery.getModel(MODEL_INFO.getModelId(), expectedOptions)).thenReturn(expectedModel); assertTrue(model.exists()); @@ -99,7 +95,7 @@ public void testExists_True() { } @Test - public void testExists_False() { + void testExists_False() { BigQuery.ModelOption[] expectedOptions = {BigQuery.ModelOption.fields()}; when(bigquery.getModel(MODEL_INFO.getModelId(), expectedOptions)).thenReturn(null); assertFalse(model.exists()); @@ -107,7 +103,7 @@ public void testExists_False() { } @Test - public void testReload() { + void testReload() { ModelInfo updatedInfo = MODEL_INFO.toBuilder().setDescription("Description").build(); Model expectedModel = new Model(bigquery, new ModelInfo.BuilderImpl(updatedInfo)); when(bigquery.getModel(MODEL_INFO.getModelId())).thenReturn(expectedModel); @@ -117,14 +113,14 @@ public void testReload() { } @Test - public void testReloadNull() { + void testReloadNull() { when(bigquery.getModel(MODEL_INFO.getModelId())).thenReturn(null); assertNull(model.reload()); verify(bigquery).getModel(MODEL_INFO.getModelId()); } @Test - public void testUpdate() { + void testUpdate() { Model expectedUpdatedModel = expectedModel.toBuilder().setDescription("Description").build(); when(bigquery.update(eq(expectedModel))).thenReturn(expectedUpdatedModel); Model actualUpdatedModel = model.update(); @@ -133,7 +129,7 @@ public void testUpdate() { } @Test - public void testUpdateWithOptions() { + void testUpdateWithOptions() { Model expectedUpdatedModel = expectedModel.toBuilder().setDescription("Description").build(); when(bigquery.update(eq(expectedModel), eq(BigQuery.ModelOption.fields()))) .thenReturn(expectedUpdatedModel); @@ -143,14 +139,14 @@ public void testUpdateWithOptions() { } @Test - public void testDeleteTrue() { + void testDeleteTrue() { when(bigquery.delete(MODEL_INFO.getModelId())).thenReturn(true); assertTrue(model.delete()); verify(bigquery).delete(MODEL_INFO.getModelId()); } @Test - public void testDeleteFalse() { + void testDeleteFalse() { when(bigquery.delete(MODEL_INFO.getModelId())).thenReturn(false); assertFalse(model.delete()); verify(bigquery).delete(MODEL_INFO.getModelId()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/OptionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/OptionTest.java index 58f3148667..b25f067064 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/OptionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/OptionTest.java @@ -16,13 +16,13 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.cloud.bigquery.spi.v2.BigQueryRpc; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class OptionTest { @@ -54,11 +54,6 @@ public void testConstructor() { Option option = new Option(RPC_OPTION, null) {}; assertEquals(RPC_OPTION, option.getRpcOption()); assertNull(option.getValue()); - try { - new Option(null, VALUE) {}; - Assert.fail(); - } catch (NullPointerException expected) { - - } + Assertions.assertThrows(NullPointerException.class, () -> new Option(null, VALUE) {}); } } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java index c70ac3355e..b5ace223f1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ParquetOptionsTest.java @@ -17,9 +17,9 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ParquetOptionsTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyHelperTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyHelperTest.java index 291df79fde..ac05a2c1ff 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyHelperTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyHelperTest.java @@ -15,16 +15,16 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.Binding; import com.google.cloud.Identity; import com.google.cloud.Policy; import com.google.cloud.Role; import com.google.common.collect.ImmutableList; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PolicyHelperTest { +class PolicyHelperTest { public static final String ETAG = "etag"; public static final String ROLE1 = "roles/bigquery.admin"; @@ -58,7 +58,7 @@ public class PolicyHelperTest { Policy.newBuilder().setEtag(ETAG).setVersion(1).build(); @Test - public void testConversionWithBindings() { + void testConversionWithBindings() { assertEquals(IAM_POLICY, PolicyHelper.convertFromApiPolicy(API_POLICY)); assertEquals(API_POLICY, PolicyHelper.convertToApiPolicy(IAM_POLICY)); assertEquals( @@ -68,7 +68,7 @@ public void testConversionWithBindings() { } @Test - public void testConversionNoBindings() { + void testConversionNoBindings() { assertEquals(IAM_POLICY_NO_BINDINGS, PolicyHelper.convertFromApiPolicy(API_POLICY_NO_BINDINGS)); assertEquals(API_POLICY_NO_BINDINGS, PolicyHelper.convertToApiPolicy(IAM_POLICY_NO_BINDINGS)); assertEquals( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyTagsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyTagsTest.java index f23cb36c2d..a94e4324be 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyTagsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PolicyTagsTest.java @@ -16,13 +16,13 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PolicyTagsTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java index 2de87a0258..702ca5cb48 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/PrimaryKeyTest.java @@ -16,19 +16,19 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class PrimaryKeyTest { +class PrimaryKeyTest { private static final List COLUMNS = Arrays.asList("column1", "column2"); private static final PrimaryKey PRIMARY_KEY = PrimaryKey.newBuilder().setColumns(COLUMNS).build(); @Test - public void testToBuilder() { + void testToBuilder() { comparePrimaryKeyDefinition(PRIMARY_KEY, PRIMARY_KEY.toBuilder().build()); PrimaryKey primaryKey = PRIMARY_KEY.toBuilder().setColumns(Arrays.asList("col1", "col2", "col3")).build(); @@ -36,14 +36,14 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(COLUMNS, PRIMARY_KEY.getColumns()); PrimaryKey primaryKey = PRIMARY_KEY.newBuilder().setColumns(COLUMNS).build(); assertEquals(PRIMARY_KEY, primaryKey); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { PrimaryKey primaryKey = PRIMARY_KEY.toBuilder().build(); assertTrue(PrimaryKey.fromPb(primaryKey.toPb()) instanceof PrimaryKey); comparePrimaryKeyDefinition(primaryKey, PrimaryKey.fromPb(primaryKey.toPb())); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java index f25aa47eda..7fe41daa06 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryJobConfigurationTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.SchemaUpdateOption; @@ -31,7 +31,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class QueryJobConfigurationTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java index 25649388e9..276234246e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryParameterValueTest.java @@ -18,7 +18,7 @@ import static com.google.cloud.bigquery.QueryParameterValue.TIMESTAMP_FORMATTER; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.api.services.bigquery.model.QueryParameterType; import com.google.common.collect.ImmutableMap; @@ -32,8 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.threeten.extra.PeriodDuration; public class QueryParameterValueTest { @@ -58,12 +57,11 @@ public void testBuilder() { @Test public void testTypeNullPointerException() { - try { - QUERY_PARAMETER_VALUE.toBuilder().setType(null).build(); - Assert.fail(); - } catch (NullPointerException ex) { - assertThat(ex).isNotNull(); - } + NullPointerException ex = + assertThrows( + NullPointerException.class, + () -> QUERY_PARAMETER_VALUE.toBuilder().setType(null).build()); + assertThat(ex).isNotNull(); } @Test @@ -407,10 +405,12 @@ public void testStandardDate() throws ParseException { assertThat(value.getArrayValues()).isNull(); } - @Test(expected = IllegalArgumentException.class) + @Test public void testInvalidDate() { // not supposed to have the time - QueryParameterValue.date("2014-08-19 12:41:35.220000"); + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.date("2014-08-19 12:41:35.220000")); } @Test @@ -422,10 +422,12 @@ public void testTime() { assertThat(value.getArrayValues()).isNull(); } - @Test(expected = IllegalArgumentException.class) + @Test public void testInvalidTime() { // not supposed to have the date - QueryParameterValue.time("2014-08-19 12:41:35.220000"); + assertThrows( + IllegalArgumentException.class, + () -> QueryParameterValue.time("2014-08-19 12:41:35.220000")); } @Test @@ -437,10 +439,10 @@ public void testDateTime() { assertThat(value.getArrayValues()).isNull(); } - @Test(expected = IllegalArgumentException.class) + @Test public void testInvalidDateTime() { // missing the time - QueryParameterValue.dateTime("2014-08-19"); + assertThrows(IllegalArgumentException.class, () -> QueryParameterValue.dateTime("2014-08-19")); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java index 8661346776..be1f0e1982 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryRequestInfoTest.java @@ -16,10 +16,10 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.services.bigquery.model.QueryRequest; import com.google.cloud.bigquery.JobInfo.CreateDisposition; @@ -31,7 +31,7 @@ import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class QueryRequestInfoTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java index bc7d6083be..30eeb90ad4 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/QueryStageTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import com.google.api.services.bigquery.model.ExplainQueryStep; import com.google.cloud.bigquery.QueryStage.QueryStep; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class QueryStageTest { +class QueryStageTest { private static final List SUBSTEPS1 = ImmutableList.of("substep1", "substep2"); private static final List SUBSTEPS2 = ImmutableList.of("substep3", "substep4"); @@ -96,7 +96,7 @@ public class QueryStageTest { .build(); @Test - public void testQueryStepConstructor() { + void testQueryStepConstructor() { assertEquals("KIND", QUERY_STEP1.getName()); assertEquals("KIND", QUERY_STEP2.getName()); assertEquals(SUBSTEPS1, QUERY_STEP1.getSubsteps()); @@ -104,7 +104,7 @@ public void testQueryStepConstructor() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(COMPLETED_PARALLEL_INPUTS, QUERY_STAGE.getCompletedParallelInputs()); assertEquals(COMPUTE_MS_AVG, QUERY_STAGE.getComputeMsAvg()); assertEquals(COMPUTE_MS_MAX, QUERY_STAGE.getComputeMsMax()); @@ -138,7 +138,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareQueryStep(QUERY_STEP1, QueryStep.fromPb(QUERY_STEP1.toPb())); compareQueryStep(QUERY_STEP2, QueryStep.fromPb(QUERY_STEP2.toPb())); compareQueryStage(QUERY_STAGE, QueryStage.fromPb(QUERY_STAGE.toPb())); @@ -149,14 +149,14 @@ public void testToAndFromPb() { } @Test - public void testEquals() { + void testEquals() { compareQueryStep(QUERY_STEP1, QUERY_STEP1); compareQueryStep(QUERY_STEP2, QUERY_STEP2); compareQueryStage(QUERY_STAGE, QUERY_STAGE); } @Test - public void testNotEquals() { + void testNotEquals() { assertNotEquals(QUERY_STAGE, QUERY_STEP1); assertNotEquals(QUERY_STEP1, QUERY_STAGE); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java index 2d98376b36..b72b4b70c2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RangeTest.java @@ -15,11 +15,11 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class RangeTest { private static final Range RANGE_DATE = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java index 8ee0e4564f..a3559f5cfc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RemoteFunctionOptionsTest.java @@ -15,13 +15,13 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RemoteFunctionOptionsTest { +class RemoteFunctionOptionsTest { private static final String endpoint = "https://aaabbbccc-uc.a.run.app"; private static final String connection = "projects/{projectId}/locations/{locationId}/connections/{connectionId}"; @@ -43,13 +43,13 @@ public class RemoteFunctionOptionsTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareRemoteFunctionOptions( REMOTE_FUNCTION_OPTIONS, REMOTE_FUNCTION_OPTIONS.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(endpoint, REMOTE_FUNCTION_OPTIONS.getEndpoint()); assertEquals(connection, REMOTE_FUNCTION_OPTIONS.getConnection()); assertEquals(userDefinedContext, REMOTE_FUNCTION_OPTIONS.getUserDefinedContext()); @@ -57,7 +57,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareRemoteFunctionOptions( REMOTE_FUNCTION_OPTIONS, RemoteFunctionOptions.fromPb(REMOTE_FUNCTION_OPTIONS.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineArgumentTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineArgumentTest.java index 909d5981d7..31a2c56de9 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineArgumentTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineArgumentTest.java @@ -15,9 +15,9 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class RoutineArgumentTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineIdTest.java index 94a19fbfd5..2800f3caa6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineIdTest.java @@ -15,9 +15,9 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class RoutineIdTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java index 145dc8914c..f191cbedd0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineInfoTest.java @@ -15,14 +15,14 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class RoutineInfoTest { +class RoutineInfoTest { private static final RoutineId ROUTINE_ID = RoutineId.of("dataset", "routine"); private static final String ETAG = "etag"; @@ -68,18 +68,18 @@ public class RoutineInfoTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareRoutineInfo(ROUTINE_INFO, ROUTINE_INFO.toBuilder().build()); } @Test - public void testBuilderIncomplete() { + void testBuilderIncomplete() { RoutineInfo routineInfo = RoutineInfo.of(ROUTINE_ID); assertEquals(routineInfo, routineInfo.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(ROUTINE_ID, ROUTINE_INFO.getRoutineId()); assertEquals(ETAG, ROUTINE_INFO.getEtag()); assertEquals(ROUTINE_TYPE, ROUTINE_INFO.getRoutineType()); @@ -96,7 +96,7 @@ public void testBuilder() { } @Test - public void testOf() { + void testOf() { RoutineInfo routineInfo = RoutineInfo.of(ROUTINE_ID); assertEquals(ROUTINE_ID, ROUTINE_INFO.getRoutineId()); assertNull(routineInfo.getEtag()); @@ -114,12 +114,12 @@ public void testOf() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareRoutineInfo(ROUTINE_INFO, RoutineInfo.fromPb(ROUTINE_INFO.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals("project", ROUTINE_INFO.setProjectId("project").getRoutineId().getProject()); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java index eaf1420120..839bfe5e66 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/RoutineTest.java @@ -15,11 +15,11 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -29,14 +29,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.MockitoRule; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class RoutineTest { private static final RoutineId ROUTINE_ID = RoutineId.of("dataset", "routine"); @@ -116,15 +114,13 @@ public class RoutineTest { .setReturnTableType(RETURN_TABLE_TYPE) .build(); - @Rule public MockitoRule rule; - private BigQuery bigquery; private BigQueryOptions mockOptions; private Routine expectedRoutine; private Routine expectedRoutineTvf; private Routine routine; - @Before + @BeforeEach public void setUp() { bigquery = mock(BigQuery.class); mockOptions = mock(BigQueryOptions.class); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java index 7f53680e62..9750fd7bd3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SchemaTest.java @@ -16,14 +16,14 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.TableSchema; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SchemaTest { +class SchemaTest { private static PolicyTags POLICY_TAGS = PolicyTags.newBuilder().setNames(ImmutableList.of("someTag")).build(); @@ -53,12 +53,12 @@ public class SchemaTest { private static final Schema TABLE_SCHEMA = Schema.of(FIELDS); @Test - public void testOf() { + void testOf() { compareTableSchema(TABLE_SCHEMA, Schema.of(FIELDS)); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareTableSchema(TABLE_SCHEMA, Schema.fromPb(TABLE_SCHEMA.toPb())); } @@ -68,7 +68,7 @@ private void compareTableSchema(Schema expected, Schema value) { } @Test - public void testEmptySchema() { + void testEmptySchema() { TableSchema tableSchema = new TableSchema(); Schema schema = Schema.fromPb(tableSchema); assertEquals(0, schema.getFields().size()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java index c739bcf5a5..defcd9cb39 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/SnapshotTableDefinitionTest.java @@ -16,12 +16,12 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class SnapshotTableDefinitionTest { +class SnapshotTableDefinitionTest { private static final TableId BASE_TABLE_ID = TableId.of("DATASET_NAME", "BASE_TABLE_NAME"); private static final String SNAPSHOT_TIME = "2021-05-19T11:32:26.553Z"; @@ -32,7 +32,7 @@ public class SnapshotTableDefinitionTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareSnapshotTableDefinition( SNAPSHOTTABLE_DEFINITION, SNAPSHOTTABLE_DEFINITION.toBuilder().build()); SnapshotTableDefinition snapshotTableDefinition = @@ -41,7 +41,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(TableDefinition.Type.SNAPSHOT, SNAPSHOTTABLE_DEFINITION.getType()); assertEquals(BASE_TABLE_ID, SNAPSHOTTABLE_DEFINITION.getBaseTableId()); assertEquals(SNAPSHOT_TIME, SNAPSHOTTABLE_DEFINITION.getSnapshotTime()); @@ -54,7 +54,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { SnapshotTableDefinition snapshotTableDefinition = SNAPSHOTTABLE_DEFINITION.toBuilder().build(); assertTrue( TableDefinition.fromPb(snapshotTableDefinition.toPb()) instanceof SnapshotTableDefinition); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLDataTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLDataTypeTest.java index 635a75612b..ffc6311184 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLDataTypeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLDataTypeTest.java @@ -15,13 +15,13 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class StandardSQLDataTypeTest { +class StandardSQLDataTypeTest { private static final String STRING_TYPEKIND = "STRING"; private static final String ARRAY_TYPEKIND = "ARRAY"; private static final String STRUCT_TYPEKIND = "STRUCT"; @@ -42,7 +42,7 @@ public class StandardSQLDataTypeTest { StandardSQLDataType.newBuilder(STRUCT_TYPEKIND).setStructType(STRUCT_TYPE).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareStandardSQLDataType(STRING_DATA_TYPE, STRING_DATA_TYPE.toBuilder().build()); compareStandardSQLDataType( ARRAY_OF_STRING_DATA_TYPE, ARRAY_OF_STRING_DATA_TYPE.toBuilder().build()); @@ -50,7 +50,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(STRING_TYPEKIND, STRING_DATA_TYPE.getTypeKind()); assertEquals(ARRAY_TYPEKIND, ARRAY_OF_STRING_DATA_TYPE.getTypeKind()); assertEquals(STRING_DATA_TYPE, ARRAY_OF_STRING_DATA_TYPE.getArrayElementType()); @@ -58,7 +58,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareStandardSQLDataType( ARRAY_OF_STRING_DATA_TYPE, StandardSQLDataType.fromPb(ARRAY_OF_STRING_DATA_TYPE.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLFieldTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLFieldTest.java index 904ed80280..5e3af997d7 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLFieldTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLFieldTest.java @@ -15,9 +15,9 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class StandardSQLFieldTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLStructTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLStructTypeTest.java index d4fa86950f..ab88de3f0e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLStructTypeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLStructTypeTest.java @@ -15,13 +15,13 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class StandardSQLStructTypeTest { +class StandardSQLStructTypeTest { private static final StandardSQLField FIELD_1 = StandardSQLField.newBuilder("FIELD_1", StandardSQLDataType.newBuilder("STRING").build()) @@ -35,18 +35,18 @@ public class StandardSQLStructTypeTest { StandardSQLStructType.newBuilder(FIELD_LIST).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareStandardSQLStructType(STRUCT_TYPE, STRUCT_TYPE.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(FIELD_1, STRUCT_TYPE.getFields().get(0)); assertEquals(FIELD_2, STRUCT_TYPE.getFields().get(1)); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareStandardSQLStructType(STRUCT_TYPE, StandardSQLStructType.fromPb(STRUCT_TYPE.toPb())); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java index 2ed6e35354..ce5a4992cd 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardSQLTableTypeTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class StandardSQLTableTypeTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java index 8fbe3cefe7..6ff0a366d1 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/StandardTableDefinitionTest.java @@ -16,12 +16,12 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.api.services.bigquery.model.Streamingbuffer; import com.google.api.services.bigquery.model.Table; @@ -29,7 +29,7 @@ import com.google.cloud.bigquery.StandardTableDefinition.StreamingBuffer; import com.google.common.collect.ImmutableList; import com.google.common.truth.Truth; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class StandardTableDefinitionTest { @@ -131,12 +131,10 @@ public void testBuilder() { @Test public void testTypeNullPointerException() { - try { - TABLE_DEFINITION.toBuilder().setType(null).build(); - fail(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + NullPointerException ex = + assertThrows( + NullPointerException.class, () -> TABLE_DEFINITION.toBuilder().setType(null).build()); + assertNotNull(ex.getMessage()); } @Test @@ -183,15 +181,12 @@ public void testFromPbWithUnexpectedTimePartitioningTypeRaisesInvalidArgumentExc .setTableId("ILLEGAL_ARG_TEST_TABLE")) .setTimePartitioning( new com.google.api.services.bigquery.model.TimePartitioning().setType("GHURRY")); - try { - StandardTableDefinition.fromPb(invalidTable); - } catch (IllegalArgumentException ie) { - Truth.assertThat(ie.getMessage()) - .contains( - "Illegal Argument - Got unexpected time partitioning GHURRY in project ILLEGAL_ARG_TEST_PROJECT in dataset ILLEGAL_ARG_TEST_DATASET in table ILLEGAL_ARG_TEST_TABLE"); - return; - } - fail("testFromPb illegal argument exception did not throw!"); + IllegalArgumentException ie = + assertThrows( + IllegalArgumentException.class, () -> StandardTableDefinition.fromPb(invalidTable)); + Truth.assertThat(ie.getMessage()) + .contains( + "Illegal Argument - Got unexpected time partitioning GHURRY in project ILLEGAL_ARG_TEST_PROJECT in dataset ILLEGAL_ARG_TEST_DATASET in table ILLEGAL_ARG_TEST_TABLE"); } @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java index 7d0f57ef76..b074b2f22c 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableConstraintsTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TableConstraintsTest { +class TableConstraintsTest { private static final List COLUMNS_PK = Arrays.asList("column1", "column2"); private static final PrimaryKey PRIMARY_KEY = PrimaryKey.newBuilder().setColumns(COLUMNS_PK).build(); @@ -50,7 +50,7 @@ public class TableConstraintsTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareTableConstraintsDefinition(TABLE_CONSTRAINTS, TABLE_CONSTRAINTS.toBuilder().build()); List columnsPk = Arrays.asList("col1", "col2", "col3"); PrimaryKey primaryKey = PrimaryKey.newBuilder().setColumns(columnsPk).build(); @@ -90,7 +90,7 @@ public void testToBuilder() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(Collections.singletonList(FOREIGN_KEY), TABLE_CONSTRAINTS.getForeignKeys()); assertEquals(PRIMARY_KEY, TABLE_CONSTRAINTS.getPrimaryKey()); TableConstraints tableConstraints = @@ -103,7 +103,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { TableConstraints tableConstraints = TABLE_CONSTRAINTS.toBuilder().build(); assertTrue(TableConstraints.fromPb(tableConstraints.toPb()) instanceof TableConstraints); compareTableConstraintsDefinition( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java index a90b5c4d72..8752b27086 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableDataWriteChannelTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; @@ -39,15 +39,17 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Random; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) public class TableDataWriteChannelTest { private static final String UPLOAD_ID = "uploadid"; @@ -80,7 +82,7 @@ public class TableDataWriteChannelTest { private TableDataWriteChannel writer; - @Before + @BeforeEach public void setUp() { rpcFactoryMock = mock(BigQueryRpcFactory.class); bigqueryRpcMock = mock(HttpBigQueryRpc.class); @@ -142,12 +144,14 @@ public void testCreateNonRetryableError() throws IOException { .setJobReference(JOB_INFO.getJobId().toPb()) .setConfiguration(LOAD_CONFIGURATION.toPb()))) .thenThrow(new RuntimeException("expected")); - try (TableDataWriteChannel channel = - new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION)) { - Assert.fail(); - } catch (RuntimeException expected) { - Assert.assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); - } + RuntimeException expected = + assertThrows( + RuntimeException.class, + () -> { + try (TableDataWriteChannel channel = + new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION)) {} + }); + assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); verify(bigqueryRpcMock) .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() @@ -269,17 +273,18 @@ public void testWritesAndFlushNonRetryableError() throws IOException { eq(DEFAULT_CHUNK_SIZE), eq(false))) .thenThrow(new RuntimeException("expected")); - try { - writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); - ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; - for (int i = 0; i < buffers.length; i++) { - buffers[i] = randomBuffer(MIN_CHUNK_SIZE); - assertEquals(MIN_CHUNK_SIZE, writer.write(buffers[i])); - } - Assert.fail(); - } catch (RuntimeException expected) { - Assert.assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); - } + RuntimeException expected = + assertThrows( + RuntimeException.class, + () -> { + writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); + ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE]; + for (int i = 0; i < buffers.length; i++) { + buffers[i] = randomBuffer(MIN_CHUNK_SIZE); + assertEquals(MIN_CHUNK_SIZE, writer.write(buffers[i])); + } + }); + assertEquals("java.lang.RuntimeException: expected", expected.getMessage()); verify(bigqueryRpcMock) .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() @@ -363,12 +368,7 @@ public void testWriteClosed() throws IOException { writer = new TableDataWriteChannel(options, JOB_INFO.getJobId(), LOAD_CONFIGURATION); writer.close(); assertEquals(job, writer.getJob()); - try { - writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE)); - fail("Expected TableDataWriteChannel write to throw IOException"); - } catch (IOException ex) { - // expected - } + assertThrows(IOException.class, () -> writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE))); verify(bigqueryRpcMock) .openSkipExceptionTranslation( new com.google.api.services.bigquery.model.Job() diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java index dc28ff8610..02154db0ca 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableIdTest.java @@ -16,11 +16,11 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TableIdTest { +class TableIdTest { private static final TableId TABLE = TableId.of("dataset", "table"); private static final TableId TABLE_COMPLETE = TableId.of("project", "dataset", "table"); @@ -28,7 +28,7 @@ public class TableIdTest { "projects/project/datasets/dataset/tables/table"; @Test - public void testOf() { + void testOf() { assertEquals(null, TABLE.getProject()); assertEquals("dataset", TABLE.getDataset()); assertEquals("table", TABLE.getTable()); @@ -39,19 +39,19 @@ public void testOf() { } @Test - public void testEquals() { + void testEquals() { compareTableIds(TABLE, TableId.of("dataset", "table")); compareTableIds(TABLE_COMPLETE, TableId.of("project", "dataset", "table")); } @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { compareTableIds(TABLE, TableId.fromPb(TABLE.toPb())); compareTableIds(TABLE_COMPLETE, TableId.fromPb(TABLE_COMPLETE.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { TableId differentProjectTable = TableId.of("differentProject", "dataset", "table"); assertEquals(differentProjectTable, TABLE.setProjectId("differentProject")); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java index a4ce6fbb47..4dd488a680 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableInfoTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.common.collect.ImmutableList; import java.math.BigInteger; import java.util.Collections; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TableInfoTest { +class TableInfoTest { private static final String ETAG = "etag"; private static final String GENERATED_ID = "project:dataset:table"; @@ -153,7 +153,7 @@ public class TableInfoTest { .build(); @Test - public void testToBuilder() { + void testToBuilder() { compareTableInfo(TABLE_INFO, TABLE_INFO.toBuilder().build()); compareTableInfo(VIEW_INFO, VIEW_INFO.toBuilder().build()); compareTableInfo(EXTERNAL_TABLE_INFO, EXTERNAL_TABLE_INFO.toBuilder().build()); @@ -164,7 +164,7 @@ public void testToBuilder() { } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { TableInfo tableInfo = TableInfo.of(TABLE_ID, TABLE_DEFINITION); assertEquals(tableInfo, tableInfo.toBuilder().build()); tableInfo = TableInfo.of(TABLE_ID, VIEW_DEFINITION); @@ -174,7 +174,7 @@ public void testToBuilderIncomplete() { } @Test - public void testBuilder() { + void testBuilder() { assertEquals(TABLE_ID, TABLE_INFO.getTableId()); assertEquals(CREATION_TIME, TABLE_INFO.getCreationTime()); assertEquals(DESCRIPTION, TABLE_INFO.getDescription()); @@ -223,7 +223,7 @@ public void testBuilder() { } @Test - public void testOf() { + void testOf() { TableInfo tableInfo = TableInfo.of(TABLE_ID, TABLE_DEFINITION); assertEquals(TABLE_ID, tableInfo.getTableId()); assertNull(tableInfo.getCreationTime()); @@ -266,21 +266,21 @@ public void testOf() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareTableInfo(TABLE_INFO, TableInfo.fromPb(TABLE_INFO.toPb())); compareTableInfo(VIEW_INFO, TableInfo.fromPb(VIEW_INFO.toPb())); compareTableInfo(EXTERNAL_TABLE_INFO, TableInfo.fromPb(EXTERNAL_TABLE_INFO.toPb())); } @Test - public void testSetProjectId() { + void testSetProjectId() { assertEquals("project", TABLE_INFO.setProjectId("project").getTableId().getProject()); assertEquals("project", EXTERNAL_TABLE_INFO.setProjectId("project").getTableId().getProject()); assertEquals("project", VIEW_INFO.setProjectId("project").getTableId().getProject()); } @Test - public void testSetProjectIdDoNotOverride() { + void testSetProjectIdDoNotOverride() { TableInfo tableInfo = TableInfo.of(TABLE_ID, TABLE_DEFINITION).setProjectId("project"); tableInfo.setProjectId("not-override-project").toBuilder(); assertEquals("project", tableInfo.getTableId().getProject()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java index 8f141fa596..dc996693cc 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableMetadataCacheUsageTest.java @@ -16,13 +16,13 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import com.google.api.services.bigquery.model.TableReference; import com.google.cloud.bigquery.TableMetadataCacheUsage.UnusedReason; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TableMetadataCacheUsageTest { +class TableMetadataCacheUsageTest { private static final String EXPLANATION = "test explanation"; @@ -51,7 +51,7 @@ public class TableMetadataCacheUsageTest { .setUnusedReason(UNUSED_REASON.toString()); @Test - public void testToPbAndFromPb() { + void testToPbAndFromPb() { assertEquals(TABLE_METADATA_CACHE_USAGE_PB, TABLE_METADATA_CACHE_USAGE.toPb()); compareTableMetadataCacheUsage( TABLE_METADATA_CACHE_USAGE, TableMetadataCacheUsage.fromPb(TABLE_METADATA_CACHE_USAGE_PB)); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java index 71f9e35da5..5bdb14cf49 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableResultTest.java @@ -22,9 +22,9 @@ import com.google.api.gax.paging.Page; import com.google.cloud.PageImpl; import com.google.common.collect.ImmutableList; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TableResultTest { +class TableResultTest { private static final Page INNER_PAGE_0 = new PageImpl<>( new PageImpl.NextPageFetcher() { @@ -52,7 +52,7 @@ private static FieldValueList newFieldValueList(String s) { } @Test - public void testNullSchema() { + void testNullSchema() { TableResult result = TableResult.newBuilder().setTotalRows(3L).setPageNoSchema(INNER_PAGE_0).build(); assertThat(result.getSchema()).isNull(); @@ -75,7 +75,7 @@ public void testNullSchema() { } @Test - public void testSchema() { + void testSchema() { TableResult result = TableResult.newBuilder() .setSchema(SCHEMA) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java index 6e99b701c1..6ad7822d9b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TableTest.java @@ -17,11 +17,11 @@ package com.google.cloud.bigquery; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -34,14 +34,12 @@ import com.google.common.collect.ImmutableMap; import java.math.BigInteger; import java.util.List; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; -import org.mockito.junit.MockitoRule; - -@RunWith(MockitoJUnitRunner.class) +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +@ExtendWith(MockitoExtension.class) public class TableTest { private static final String ETAG = "etag"; @@ -97,14 +95,12 @@ public class TableTest { FieldValueList.of(ImmutableList.of(FIELD_VALUE1)).withSchema(SCHEMA.getFields()), FieldValueList.of(ImmutableList.of(FIELD_VALUE2)).withSchema(SCHEMA.getFields())); - @Rule public MockitoRule rule; - private BigQuery bigquery; private BigQueryOptions mockOptions; private Table expectedTable; private Table table; - @Before + @BeforeEach public void setUp() { bigquery = mock(BigQuery.class); mockOptions = mock(BigQueryOptions.class); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java index 1e48c817ed..ec947381b0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimePartitioningTest.java @@ -16,16 +16,16 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.cloud.bigquery.TimePartitioning.Type; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class TimePartitioningTest { +class TimePartitioningTest { private static final Type TYPE_DAY = Type.DAY; private static final Type TYPE_HOUR = Type.HOUR; @@ -60,7 +60,7 @@ public class TimePartitioningTest { .build(); @Test - public void testOf() { + void testOf() { assertEquals(TYPE_DAY, TIME_PARTITIONING_DAY.getType()); assertEquals(TYPE_HOUR, TIME_PARTITIONING_HOUR.getType()); assertEquals(TYPE_MONTH, TIME_PARTITIONING_MONTH.getType()); @@ -74,7 +74,7 @@ public void testOf() { } @Test - public void testBuilder() { + void testBuilder() { TimePartitioning partitioning = TimePartitioning.newBuilder(TYPE_DAY).build(); assertEquals(TYPE_DAY, partitioning.getType()); assertNull(partitioning.getExpirationMs()); @@ -90,27 +90,21 @@ public void testBuilder() { } @Test - public void testTypeOf_Npe() { - try { - TimePartitioning.of(null); - Assert.fail(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + void testTypeOf_Npe() { + NullPointerException ex = + assertThrows(NullPointerException.class, () -> TimePartitioning.of(null)); + assertNotNull(ex.getMessage()); } @Test - public void testTypeAndExpirationOf_Npe() { - try { - TimePartitioning.of(null, EXPIRATION_MS); - Assert.fail(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + void testTypeAndExpirationOf_Npe() { + NullPointerException ex = + assertThrows(NullPointerException.class, () -> TimePartitioning.of(null, EXPIRATION_MS)); + assertNotNull(ex.getMessage()); } @Test - public void testToAndFromPb() { + void testToAndFromPb() { compareTimePartitioning( TIME_PARTITIONING_DAY, TimePartitioning.fromPb(TIME_PARTITIONING_DAY.toPb())); TimePartitioning partitioning = TimePartitioning.of(TYPE_DAY); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimelineSampleTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimelineSampleTest.java index 1d888f00df..22f419593d 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimelineSampleTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/TimelineSampleTest.java @@ -15,10 +15,10 @@ */ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TimelineSampleTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java index 93657b44c1..81622527a3 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/UserDefinedFunctionTest.java @@ -16,9 +16,9 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UserDefinedFunctionTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java index d60c7be2bc..60eeea7668 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/ViewDefinitionTest.java @@ -16,19 +16,18 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.ImmutableList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; -public class ViewDefinitionTest { +class ViewDefinitionTest { private static final String VIEW_QUERY = "VIEW QUERY"; private static final List USER_DEFINED_FUNCTIONS = @@ -37,7 +36,7 @@ public class ViewDefinitionTest { ViewDefinition.newBuilder(VIEW_QUERY, USER_DEFINED_FUNCTIONS).setSchema(Schema.of()).build(); @Test - public void testToBuilder() { + void testToBuilder() { compareViewDefinition(VIEW_DEFINITION, VIEW_DEFINITION.toBuilder().build()); ViewDefinition viewDefinition = VIEW_DEFINITION.toBuilder().setQuery("NEW QUERY").build(); assertEquals("NEW QUERY", viewDefinition.getQuery()); @@ -50,23 +49,21 @@ public void testToBuilder() { } @Test - public void testTypeNullPointerException() { - try { - VIEW_DEFINITION.toBuilder().setType(null).build(); - fail(); - } catch (NullPointerException ex) { - assertNotNull(ex.getMessage()); - } + void testTypeNullPointerException() { + NullPointerException ex = + org.junit.jupiter.api.Assertions.assertThrows( + NullPointerException.class, () -> VIEW_DEFINITION.toBuilder().setType(null).build()); + assertNotNull(ex.getMessage()); } @Test - public void testToBuilderIncomplete() { + void testToBuilderIncomplete() { TableDefinition viewDefinition = ViewDefinition.of(VIEW_QUERY); assertEquals(viewDefinition, viewDefinition.toBuilder().build()); } @Test - public void testBuilder() { + void testBuilder() { assertEquals(VIEW_QUERY, VIEW_DEFINITION.getQuery()); assertEquals(TableDefinition.Type.VIEW, VIEW_DEFINITION.getType()); assertEquals(USER_DEFINED_FUNCTIONS, VIEW_DEFINITION.getUserDefinedFunctions()); @@ -106,7 +103,7 @@ public void testBuilder() { } @Test - public void testToAndFromPb() { + void testToAndFromPb() { ViewDefinition viewDefinition = VIEW_DEFINITION.toBuilder().setUseLegacySql(false).build(); assertTrue(TableDefinition.fromPb(viewDefinition.toPb()) instanceof ViewDefinition); compareViewDefinition( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java index 240f12185c..35745235e5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/WriteChannelConfigurationTest.java @@ -16,8 +16,8 @@ package com.google.cloud.bigquery; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import com.google.cloud.bigquery.JobInfo.CreateDisposition; import com.google.cloud.bigquery.JobInfo.WriteDisposition; @@ -27,7 +27,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class WriteChannelConfigurationTest { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index ddad48d392..fec7e55e05 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -20,15 +20,15 @@ import static com.google.common.truth.Truth.assertThat; import static java.lang.System.currentTimeMillis; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.api.client.util.IOUtils; import com.google.api.gax.paging.Page; @@ -208,14 +208,14 @@ import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.threeten.extra.PeriodDuration; -public class ITBigQueryTest { +@Timeout(value = 300) +class ITBigQueryTest { private static final byte[] BYTES = {0xD, 0xE, 0xA, 0xD}; private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); @@ -1063,10 +1063,8 @@ public CompletableResultCode shutdown() { } } - @Rule public Timeout globalTimeout = Timeout.seconds(300); - - @BeforeClass - public static void beforeClass() throws InterruptedException, IOException { + @BeforeAll + static void beforeClass() throws InterruptedException, IOException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); RemoteStorageHelper storageHelper = RemoteStorageHelper.create(); Map labels = ImmutableMap.of("test-job-name", "test-load-job"); @@ -1180,8 +1178,8 @@ public static void beforeClass() throws InterruptedException, IOException { assertNull(jobLargeTable.getStatus().getError()); } - @AfterClass - public static void afterClass() throws Exception { + @AfterAll + static void afterClass() throws Exception { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, DATASET); RemoteBigQueryHelper.forceDelete(bigquery, UK_DATASET); @@ -1206,13 +1204,12 @@ static GoogleCredentials loadCredentials(String credentialFile) { try (InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes())) { return GoogleCredentials.fromStream(keyStream); } catch (IOException e) { - fail("Couldn't create fake JSON credentials."); + throw new RuntimeException("Couldn't create fake JSON credentials.", e); } - return null; } @Test - public void testListDatasets() { + void testListDatasets() { Page datasets = bigquery.listDatasets("bigquery-public-data"); Iterator iterator = datasets.iterateAll().iterator(); Set datasetNames = new HashSet<>(); @@ -1230,24 +1227,24 @@ public void testListDatasets() { } @Test - public void testListDatasetsWithFilter() { + void testListDatasetsWithFilter() { String labelFilter = "labels.example-label1:example-value1"; Page datasets = bigquery.listDatasets(DatasetListOption.labelFilter(labelFilter)); int count = 0; for (Dataset dataset : datasets.getValues()) { assertTrue( - "failed to find label key in dataset", dataset.getLabels().containsKey("example-label1")); + dataset.getLabels().containsKey("example-label1"), "failed to find label key in dataset"); assertEquals( - "failed to find label value in dataset", "example-value1", - dataset.getLabels().get("example-label1")); + dataset.getLabels().get("example-label1"), + "failed to find label value in dataset"); count++; } assertTrue(count > 0); } @Test - public void testGetDataset() { + void testGetDataset() { Dataset dataset = bigquery.getDataset(DATASET); assertEquals(bigquery.getOptions().getProjectId(), dataset.getDatasetId().getProject()); assertEquals(DATASET, dataset.getDatasetId().getDataset()); @@ -1261,7 +1258,7 @@ public void testGetDataset() { } @Test - public void testDatasetUpdateAccess() throws IOException { + void testDatasetUpdateAccess() throws IOException { Dataset dataset = bigquery.getDataset(DATASET); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1276,7 +1273,7 @@ public void testDatasetUpdateAccess() throws IOException { } @Test - public void testGetDatasetWithSelectedFields() { + void testGetDatasetWithSelectedFields() { Dataset dataset = bigquery.getDataset( DATASET, DatasetOption.fields(DatasetField.CREATION_TIME, DatasetField.LABELS)); @@ -1298,7 +1295,7 @@ public void testGetDatasetWithSelectedFields() { } @Test - public void testGetDatasetWithAccessPolicyVersion() throws IOException { + void testGetDatasetWithAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1342,7 +1339,7 @@ public void testGetDatasetWithAccessPolicyVersion() throws IOException { } @Test - public void testUpdateDataset() { + void testUpdateDataset() { Dataset dataset = bigquery.create( DatasetInfo.newBuilder(OTHER_DATASET) @@ -1379,7 +1376,7 @@ public void testUpdateDataset() { } @Test - public void testUpdateDatasetWithSelectedFields() { + void testUpdateDatasetWithSelectedFields() { Dataset dataset = bigquery.create( DatasetInfo.newBuilder(OTHER_DATASET).setDescription("Some Description").build()); @@ -1407,7 +1404,7 @@ public void testUpdateDatasetWithSelectedFields() { } @Test - public void testUpdateDatasetWithAccessPolicyVersion() throws IOException { + void testUpdateDatasetWithAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1460,12 +1457,12 @@ public void testUpdateDatasetWithAccessPolicyVersion() throws IOException { } @Test - public void testGetNonExistingTable() { + void testGetNonExistingTable() { assertNull(bigquery.getTable(DATASET, "test_get_non_existing_table")); } @Test - public void testCreateTableWithRangePartitioning() { + void testCreateTableWithRangePartitioning() { String tableName = "test_create_table_rangepartitioning"; TableId tableId = TableId.of(DATASET, tableName); try { @@ -1490,7 +1487,7 @@ public void testCreateTableWithRangePartitioning() { /* TODO(prasmish): replicate this test case for executeSelect on the relevant part */ @Test - public void testJsonType() throws InterruptedException { + void testJsonType() throws InterruptedException { String tableName = "test_create_table_jsontype"; TableId tableId = TableId.of(DATASET, tableName); Schema schema = Schema.of(Field.of("jsonField", StandardSQLTypeName.JSON)); @@ -1586,9 +1583,9 @@ public void testJsonType() throws InterruptedException { .build(); BigQueryException exception = assertThrows( - "Querying with malformed JSON shouldn't work", BigQueryException.class, - () -> bigquery.query(dmlQueryJobConfiguration2)); + () -> bigquery.query(dmlQueryJobConfiguration2), + "Querying with malformed JSON shouldn't work"); BigQueryError error = exception.getError(); assertNotNull(error); assertEquals("invalidQuery", error.getReason()); @@ -1599,7 +1596,7 @@ public void testJsonType() throws InterruptedException { /* TODO(prasmish): replicate this test case for executeSelect on the relevant part */ @Test - public void testIntervalType() throws InterruptedException { + void testIntervalType() throws InterruptedException { String tableName = "test_create_table_intervaltype"; TableId tableId = TableId.of(DATASET, tableName); Schema schema = Schema.of(Field.of("intervalField", StandardSQLTypeName.INTERVAL)); @@ -1674,7 +1671,7 @@ public void testIntervalType() throws InterruptedException { } @Test - public void testRangeType() throws InterruptedException { + void testRangeType() throws InterruptedException { String tableName = "test_range_type_table"; TableId tableId = TableId.of(DATASET, tableName); @@ -1751,7 +1748,7 @@ public void testRangeType() throws InterruptedException { } @Test - public void testCreateTableWithConstraints() { + void testCreateTableWithConstraints() { String tableName = "test_create_table_with_constraints"; TableId tableId = TableId.of(DATASET, tableName); Field stringFieldWithConstraint = @@ -1795,7 +1792,7 @@ public void testCreateTableWithConstraints() { } @Test - public void testCreateDatasetWithSpecifiedStorageBillingModel() { + void testCreateDatasetWithSpecifiedStorageBillingModel() { String billingModelDataset = RemoteBigQueryHelper.generateDatasetName(); DatasetInfo info = DatasetInfo.newBuilder(billingModelDataset) @@ -1812,7 +1809,7 @@ public void testCreateDatasetWithSpecifiedStorageBillingModel() { } @Test - public void testCreateDatasetWithSpecificMaxTimeTravelHours() { + void testCreateDatasetWithSpecificMaxTimeTravelHours() { String timeTravelDataset = RemoteBigQueryHelper.generateDatasetName(); DatasetInfo info = DatasetInfo.newBuilder(timeTravelDataset) @@ -1829,7 +1826,7 @@ public void testCreateDatasetWithSpecificMaxTimeTravelHours() { } @Test - public void testCreateDatasetWithDefaultMaxTimeTravelHours() { + void testCreateDatasetWithDefaultMaxTimeTravelHours() { String timeTravelDataset = RemoteBigQueryHelper.generateDatasetName(); DatasetInfo info = DatasetInfo.newBuilder(timeTravelDataset) @@ -1846,7 +1843,7 @@ public void testCreateDatasetWithDefaultMaxTimeTravelHours() { } @Test - public void testCreateDatasetWithDefaultCollation() { + void testCreateDatasetWithDefaultCollation() { String collationDataset = RemoteBigQueryHelper.generateDatasetName(); DatasetInfo info = DatasetInfo.newBuilder(collationDataset) @@ -1863,7 +1860,7 @@ public void testCreateDatasetWithDefaultCollation() { } @Test - public void testCreateDatasetWithAccessPolicyVersion() throws IOException { + void testCreateDatasetWithAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1899,8 +1896,8 @@ public void testCreateDatasetWithAccessPolicyVersion() throws IOException { RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); } - @Test(expected = BigQueryException.class) - public void testCreateDatasetWithInvalidAccessPolicyVersion() throws IOException { + @Test + void testCreateDatasetWithInvalidAccessPolicyVersion() throws IOException { String accessPolicyDataset = RemoteBigQueryHelper.generateDatasetName(); ServiceAccountCredentials credentials = (ServiceAccountCredentials) GoogleCredentials.getApplicationDefault(); @@ -1920,14 +1917,13 @@ public void testCreateDatasetWithInvalidAccessPolicyVersion() throws IOException .setAcl(ImmutableList.of(acl)) .build(); DatasetOption datasetOption = DatasetOption.accessPolicyVersion(4); - Dataset dataset = bigquery.create(info, datasetOption); - assertNotNull(dataset); + assertThrows(BigQueryException.class, () -> bigquery.create(info, datasetOption)); RemoteBigQueryHelper.forceDelete(bigquery, accessPolicyDataset); } @Test - public void testCreateTableWithDefaultCollation() { + void testCreateTableWithDefaultCollation() { String tableName = "test_create_table_with_default_collation"; TableId tableId = TableId.of(DATASET, tableName); Field stringFieldWithoutCollation = @@ -1965,7 +1961,7 @@ public void testCreateTableWithDefaultCollation() { } @Test - public void testCreateFieldWithDefaultCollation() { + void testCreateFieldWithDefaultCollation() { String tableName = "test_create_field_with_default_collation"; TableId tableId = TableId.of(DATASET, tableName); Field stringFieldWithCollation = @@ -2002,7 +1998,7 @@ public void testCreateFieldWithDefaultCollation() { } @Test - public void testCreateTableWithDefaultValueExpression() { + void testCreateTableWithDefaultValueExpression() { String tableName = "test_create_table_with_default_value_expression"; TableId tableId = TableId.of(DATASET, tableName); Field stringFieldWithDefaultValueExpression = @@ -2064,7 +2060,7 @@ public void testCreateTableWithDefaultValueExpression() { } @Test - public void testCreateAndUpdateTableWithPolicyTags() throws IOException { + void testCreateAndUpdateTableWithPolicyTags() throws IOException { // Set up policy tags in the datacatalog service try (PolicyTagManagerClient policyTagManagerClient = PolicyTagManagerClient.create()) { CreateTaxonomyRequest createTaxonomyRequest = @@ -2146,7 +2142,7 @@ public void testCreateAndUpdateTableWithPolicyTags() throws IOException { } @Test - public void testCreateAndGetTable() { + void testCreateAndGetTable() { String tableName = "test_create_and_get_table"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2184,7 +2180,7 @@ public void testCreateAndGetTable() { } @Test - public void testCreateAndListTable() { + void testCreateAndListTable() { String tableName = "test_create_and_list_table"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2219,7 +2215,7 @@ public void testCreateAndListTable() { } @Test - public void testCreateAndGetTableWithBasicTableMetadataView() { + void testCreateAndGetTableWithBasicTableMetadataView() { String tableName = "test_create_and_get_table_with_basic_metadata_view"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2251,7 +2247,7 @@ public void testCreateAndGetTableWithBasicTableMetadataView() { } @Test - public void testCreateAndGetTableWithFullTableMetadataView() { + void testCreateAndGetTableWithFullTableMetadataView() { String tableName = "test_create_and_get_table_with_full_metadata_view"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2282,7 +2278,7 @@ public void testCreateAndGetTableWithFullTableMetadataView() { } @Test - public void testCreateAndGetTableWithStorageStatsTableMetadataView() { + void testCreateAndGetTableWithStorageStatsTableMetadataView() { String tableName = "test_create_and_get_table_with_storage_stats_metadata_view"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2314,7 +2310,7 @@ public void testCreateAndGetTableWithStorageStatsTableMetadataView() { } @Test - public void testCreateAndGetTableWithUnspecifiedTableMetadataView() { + void testCreateAndGetTableWithUnspecifiedTableMetadataView() { String tableName = "test_create_and_get_table_with_unspecified_metadata_view"; TableId tableId = TableId.of(DATASET, tableName); TimePartitioning partitioning = TimePartitioning.of(Type.DAY); @@ -2346,7 +2342,7 @@ public void testCreateAndGetTableWithUnspecifiedTableMetadataView() { } @Test - public void testCreateAndGetTableWithSelectedField() { + void testCreateAndGetTableWithSelectedField() { String tableName = "test_create_and_get_selected_fields_table"; TableId tableId = TableId.of(DATASET, tableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); @@ -2386,7 +2382,7 @@ public void testCreateAndGetTableWithSelectedField() { } @Test - public void testCreateExternalTable() throws InterruptedException { + void testCreateExternalTable() throws InterruptedException { String tableName = "test_create_external_table"; TableId tableId = TableId.of(DATASET, tableName); @@ -2444,7 +2440,7 @@ public void testCreateExternalTable() throws InterruptedException { } @Test - public void testSetPermExternalTableSchema() { + void testSetPermExternalTableSchema() { String tableName = "test_create_external_table_perm"; TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = @@ -2466,7 +2462,7 @@ public void testSetPermExternalTableSchema() { } @Test - public void testUpdatePermExternableTableWithAutodetectSchemaUpdatesSchema() { + void testUpdatePermExternableTableWithAutodetectSchemaUpdatesSchema() { String tableName = "test_create_external_table_perm_with_auto_detect"; TableId tableId = TableId.of(DATASET, tableName); Schema setSchema = Schema.of(TIMESTAMP_FIELD_SCHEMA, STRING_FIELD_SCHEMA); @@ -2501,7 +2497,7 @@ public void testUpdatePermExternableTableWithAutodetectSchemaUpdatesSchema() { } @Test - public void testCreateViewTable() throws InterruptedException { + void testCreateViewTable() throws InterruptedException { String tableName = "test_create_view_table"; TableId tableId = TableId.of(DATASET, tableName); ViewDefinition viewDefinition = @@ -2549,7 +2545,7 @@ public void testCreateViewTable() throws InterruptedException { } @Test - public void testCreateMaterializedViewTable() { + void testCreateMaterializedViewTable() { String tableName = "test_materialized_view_table"; TableId tableId = TableId.of(DATASET, tableName); MaterializedViewDefinition viewDefinition = @@ -2573,7 +2569,7 @@ public void testCreateMaterializedViewTable() { } @Test - public void testTableIAM() { + void testTableIAM() { String tableName = "test_iam_table"; TableId tableId = TableId.of(DATASET, tableName); StandardTableDefinition tableDefinition = @@ -2602,7 +2598,7 @@ public void testTableIAM() { } @Test - public void testListTables() { + void testListTables() { String tableName = "test_list_tables"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); @@ -2621,7 +2617,7 @@ public void testListTables() { } @Test - public void testListTablesWithPartitioning() { + void testListTablesWithPartitioning() { String tableName = "test_list_tables_partitioning"; TimePartitioning timePartitioning = TimePartitioning.of(Type.DAY, EXPIRATION_MS); StandardTableDefinition tableDefinition = @@ -2654,7 +2650,7 @@ public void testListTablesWithPartitioning() { } @Test - public void testListTablesWithRangePartitioning() { + void testListTablesWithRangePartitioning() { String tableName = "test_list_tables_range_partitioning"; StandardTableDefinition tableDefinition = StandardTableDefinition.newBuilder() @@ -2684,7 +2680,7 @@ public void testListTablesWithRangePartitioning() { } @Test - public void testListPartitions() throws InterruptedException { + void testListPartitions() throws InterruptedException { String tableName = "test_table_partitions_" + UUID.randomUUID().toString().substring(0, 8); Date date = Date.fromJavaUtilDate(new java.util.Date()); String partitionDate = date.toString().replaceAll("-", ""); @@ -2710,7 +2706,7 @@ public void testListPartitions() throws InterruptedException { } @Test - public void testUpdateTable() { + void testUpdateTable() { String tableName = "test_update_table"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = @@ -2740,7 +2736,7 @@ public void testUpdateTable() { } @Test - public void testUpdateTimePartitioning() { + void testUpdateTimePartitioning() { String tableName = "testUpdateTimePartitioning"; TableId tableId = TableId.of(DATASET, tableName); StandardTableDefinition tableDefinition = @@ -2782,8 +2778,7 @@ public void testUpdateTimePartitioning() { table.delete(); } - @Test - public void testUpdateTableWithSelectedFields() { + void testUpdateTableWithSelectedFields() { String tableName = "test_update_with_selected_fields_table"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); @@ -2814,16 +2809,16 @@ public void testUpdateTableWithSelectedFields() { } @Test - public void testUpdateNonExistingTable() { + void testUpdateNonExistingTable() { TableInfo tableInfo = TableInfo.of( TableId.of(DATASET, "test_update_non_existing_table"), StandardTableDefinition.of(SIMPLE_SCHEMA)); BigQueryException exception = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.update(tableInfo)); + () -> bigquery.update(tableInfo), + "BigQueryException was expected"); BigQueryError error = exception.getError(); assertNotNull(error); assertEquals("notFound", error.getReason()); @@ -2831,12 +2826,12 @@ public void testUpdateNonExistingTable() { } @Test - public void testDeleteNonExistingTable() { + void testDeleteNonExistingTable() { assertFalse(bigquery.delete("test_delete_non_existing_table")); } @Test - public void testDeleteJob() { + void testDeleteJob() { String query = "SELECT 17 as foo"; QueryJobConfiguration config = QueryJobConfiguration.of(query); String jobName = "jobId_" + UUID.randomUUID().toString(); @@ -2850,7 +2845,7 @@ public void testDeleteJob() { } @Test - public void testInsertAll() throws IOException { + void testInsertAll() throws IOException { String tableName = "test_insert_all_table"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); @@ -2909,7 +2904,7 @@ public void testInsertAll() throws IOException { } @Test - public void testInsertAllWithSuffix() throws InterruptedException { + void testInsertAllWithSuffix() throws InterruptedException { String tableName = "test_insert_all_with_suffix_table"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); @@ -2977,7 +2972,7 @@ public void testInsertAllWithSuffix() throws InterruptedException { } @Test - public void testInsertAllWithErrors() { + void testInsertAllWithErrors() { String tableName = "test_insert_all_with_errors_table"; StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); @@ -3047,7 +3042,7 @@ public void testInsertAllWithErrors() { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testListAllTableData() { + void testListAllTableData() { Page rows = bigquery.listTableData(TABLE_ID); int rowCount = 0; for (FieldValueList row : rows.getValues()) { @@ -3092,7 +3087,7 @@ public void testListAllTableData() { } @Test - public void testListPageWithStartIndex() { + void testListPageWithStartIndex() { String tableName = "midyear_population_agespecific"; TableId tableId = TableId.of(PUBLIC_PROJECT, PUBLIC_DATASET, tableName); Table table = bigquery.getTable(tableId); @@ -3111,7 +3106,7 @@ public void testListPageWithStartIndex() { } @Test - public void testModelLifecycle() throws InterruptedException { + void testModelLifecycle() throws InterruptedException { String modelName = RemoteBigQueryHelper.generateModelName(); @@ -3170,7 +3165,7 @@ public void testModelLifecycle() throws InterruptedException { } @Test - public void testEmptyListModels() { + void testEmptyListModels() { String datasetId = "test_empty_dataset_list_models_" + RANDOM_ID; assertNotNull(bigquery.create(DatasetInfo.of(datasetId))); Page models = bigquery.listModels(datasetId, BigQuery.ModelListOption.pageSize(100)); @@ -3181,7 +3176,7 @@ public void testEmptyListModels() { } @Test - public void testEmptyListRoutines() { + void testEmptyListRoutines() { String datasetId = "test_empty_dataset_list_routines_" + RANDOM_ID; assertNotNull(bigquery.create(DatasetInfo.of(datasetId))); Page routines = @@ -3193,7 +3188,7 @@ public void testEmptyListRoutines() { } @Test - public void testRoutineLifecycle() throws InterruptedException { + void testRoutineLifecycle() throws InterruptedException { String routineName = RemoteBigQueryHelper.generateRoutineName(); // Create a routine using SQL. String sql = @@ -3236,7 +3231,7 @@ public void testRoutineLifecycle() throws InterruptedException { } @Test - public void testRoutineAPICreation() { + void testRoutineAPICreation() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); RoutineInfo routineInfo = @@ -3258,7 +3253,7 @@ public void testRoutineAPICreation() { } @Test - public void testRoutineAPICreationJavascriptUDF() { + void testRoutineAPICreationJavascriptUDF() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); RoutineInfo routineInfo = @@ -3286,7 +3281,7 @@ public void testRoutineAPICreationJavascriptUDF() { } @Test - public void testRoutineAPICreationTVF() { + void testRoutineAPICreationTVF() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); List columns = @@ -3314,7 +3309,7 @@ public void testRoutineAPICreationTVF() { } @Test - public void testRoutineDataGovernanceType() { + void testRoutineDataGovernanceType() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); RoutineInfo routineInfo = @@ -3341,7 +3336,7 @@ public void testRoutineDataGovernanceType() { } @Test - public void testAuthorizeRoutine() { + void testAuthorizeRoutine() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(PROJECT_ID, ROUTINE_DATASET, routineName); RoutineInfo routineInfo = @@ -3367,7 +3362,7 @@ public void testAuthorizeRoutine() { } @Test - public void testAuthorizeDataset() { + void testAuthorizeDataset() { String datasetName = RemoteBigQueryHelper.generateDatasetName(); DatasetId datasetId = DatasetId.of(PROJECT_ID, datasetName); List targetTypes = ImmutableList.of("VIEWS"); @@ -3412,14 +3407,14 @@ public void testAuthorizeDataset() { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testSingleStatementsQueryException() throws InterruptedException { + void testSingleStatementsQueryException() throws InterruptedException { String invalidQuery = String.format("INSERT %s.%s VALUES('3', 10);", DATASET, TABLE_ID.getTable()); BigQueryException exception = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor()); + () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor(), + "BigQueryException was expected"); assertEquals("invalidQuery", exception.getReason()); assertNotNull(exception.getMessage()); BigQueryError error = exception.getError(); @@ -3429,16 +3424,16 @@ public void testSingleStatementsQueryException() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testMultipleStatementsQueryException() throws InterruptedException { + void testMultipleStatementsQueryException() throws InterruptedException { String invalidQuery = String.format( "INSERT %s.%s VALUES('3', 10); DELETE %s.%s where c2=3;", DATASET, TABLE_ID.getTable(), DATASET, TABLE_ID.getTable()); BigQueryException exception = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor()); + () -> bigquery.create(JobInfo.of(QueryJobConfiguration.of(invalidQuery))).waitFor(), + "BigQueryException was expected"); assertEquals("invalidQuery", exception.getReason()); assertNotNull(exception.getMessage()); BigQueryError error = exception.getError(); @@ -3447,7 +3442,7 @@ public void testMultipleStatementsQueryException() throws InterruptedException { } @Test - public void testTimestamp() throws InterruptedException { + void testTimestamp() throws InterruptedException { String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; String timestampStringValueExpected = "2022-01-24T23:54:25.095574Z"; @@ -3465,7 +3460,7 @@ public void testTimestamp() throws InterruptedException { } @Test - public void testLosslessTimestamp() throws InterruptedException { + void testLosslessTimestamp() throws InterruptedException { String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; long expectedTimestamp = 1643068465095574L; @@ -3505,7 +3500,7 @@ public void testLosslessTimestamp() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQuery() throws InterruptedException { + void testQuery() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); @@ -3538,7 +3533,7 @@ public void testQuery() throws InterruptedException { } @Test - public void testQueryStatistics() throws InterruptedException { + void testQueryStatistics() throws InterruptedException { // Use CURRENT_TIMESTAMP to avoid potential caching. String query = "SELECT CURRENT_TIMESTAMP() AS ts"; QueryJobConfiguration config = @@ -3555,7 +3550,7 @@ public void testQueryStatistics() throws InterruptedException { } @Test - public void testExecuteSelectDefaultConnectionSettings() throws SQLException { + void testExecuteSelectDefaultConnectionSettings() throws SQLException { // Use the default connection settings Connection connection = bigquery.createConnection(); String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;"; @@ -3565,7 +3560,7 @@ public void testExecuteSelectDefaultConnectionSettings() throws SQLException { } @Test - public void testExecuteSelectWithReadApi() throws SQLException { + void testExecuteSelectWithReadApi() throws SQLException { final int rowLimit = 5000; final String QUERY = "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; @@ -3595,7 +3590,7 @@ public void testExecuteSelectWithReadApi() throws SQLException { } @Test - public void testExecuteSelectWithFastQueryReadApi() throws SQLException { + void testExecuteSelectWithFastQueryReadApi() throws SQLException { final int rowLimit = 5000; final String QUERY = "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 LIMIT %s"; @@ -3622,7 +3617,7 @@ public void testExecuteSelectWithFastQueryReadApi() throws SQLException { } @Test - public void testExecuteSelectReadApiEmptyResultSet() throws SQLException { + void testExecuteSelectReadApiEmptyResultSet() throws SQLException { ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() .setJobTimeoutMs( @@ -3640,7 +3635,7 @@ public void testExecuteSelectReadApiEmptyResultSet() throws SQLException { } @Test - public void testExecuteSelectWithCredentials() throws SQLException { + void testExecuteSelectWithCredentials() throws SQLException { // This test validate that executeSelect uses the same credential provided by the BigQuery // object used to create the Connection client. // This is done the following scenarios: @@ -3684,7 +3679,7 @@ public void testExecuteSelectWithCredentials() throws SQLException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQueryTimeStamp() throws InterruptedException { + void testQueryTimeStamp() throws InterruptedException { String query = "SELECT TIMESTAMP '2022-01-24T23:54:25.095574Z'"; Instant beforeQueryInstant = Instant.parse("2022-01-24T23:54:25.095574Z"); long microsBeforeQuery = @@ -3721,7 +3716,7 @@ public void testQueryTimeStamp() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedException { + void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); @@ -3751,7 +3746,7 @@ public void testQueryCaseInsensitiveSchemaFieldByGetName() throws InterruptedExc /* TODO(prasmish): replicate bigquery.query part of the test case for executeSelect - modify this test case */ @Test - public void testQueryExternalHivePartitioningOptionAutoLayout() throws InterruptedException { + void testQueryExternalHivePartitioningOptionAutoLayout() throws InterruptedException { String tableName = "test_queryexternalhivepartition_autolayout_table"; String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/hive-partitioning-samples/autolayout/*"; @@ -3787,7 +3782,7 @@ public void testQueryExternalHivePartitioningOptionAutoLayout() throws Interrupt /* TODO(prasmish): replicate bigquery.query part of the test case for executeSelect - modify this test case */ @Test - public void testQueryExternalHivePartitioningOptionCustomLayout() throws InterruptedException { + void testQueryExternalHivePartitioningOptionCustomLayout() throws InterruptedException { String tableName = "test_queryexternalhivepartition_customlayout_table"; String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/hive-partitioning-samples/customlayout/*"; @@ -3823,7 +3818,7 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru } @Test - public void testConnectionImplDryRun() throws SQLException { + void testConnectionImplDryRun() throws SQLException { String query = String.format( "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from %s where StringField = ? order by TimestampField", @@ -3848,7 +3843,7 @@ public void testConnectionImplDryRun() throws SQLException { } @Test - public void testConnectionImplDryRunNoQueryParameters() throws SQLException { + void testConnectionImplDryRunNoQueryParameters() throws SQLException { String query = String.format( "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, " @@ -3878,7 +3873,7 @@ public void testConnectionImplDryRunNoQueryParameters() throws SQLException { @Test // This test case test the order of the records, making sure that the result is not jumbled up due // to the multithreaded BigQueryResult implementation - public void testBQResultSetMultiThreadedOrder() throws SQLException { + void testBQResultSetMultiThreadedOrder() throws SQLException { String query = "SELECT date FROM " + TABLE_ID_LARGE.getTable() @@ -3905,7 +3900,7 @@ public void testBQResultSetMultiThreadedOrder() throws SQLException { } @Test - public void testBQResultSetPaginationSlowQuery() throws SQLException { + void testBQResultSetPaginationSlowQuery() throws SQLException { String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " + TABLE_ID_LARGE.getTable() @@ -3934,7 +3929,7 @@ public void testBQResultSetPaginationSlowQuery() throws SQLException { } @Test - public void testExecuteSelectSinglePageTableRow() throws SQLException { + void testExecuteSelectSinglePageTableRow() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " @@ -3998,7 +3993,7 @@ public void testExecuteSelectSinglePageTableRow() throws SQLException { } @Test - public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException { + void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " @@ -4063,7 +4058,7 @@ public void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException } @Test - public void testConnectionClose() throws SQLException { + void testConnectionClose() throws SQLException { String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " + TABLE_ID_LARGE.getTable() @@ -4089,7 +4084,7 @@ public void testConnectionClose() throws SQLException { } @Test - public void testBQResultSetPagination() throws SQLException { + void testBQResultSetPagination() throws SQLException { String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " + TABLE_ID_LARGE.getTable() @@ -4115,7 +4110,7 @@ public void testBQResultSetPagination() throws SQLException { } @Test - public void testReadAPIIterationAndOrder() + void testReadAPIIterationAndOrder() throws SQLException { // use read API to read 300K records and check the order String query = "SELECT date, county, state_name, confirmed_cases, deaths FROM " @@ -4152,7 +4147,7 @@ public void testReadAPIIterationAndOrder() } @Test - public void testReadAPIIterationAndOrderAsync() + void testReadAPIIterationAndOrderAsync() throws SQLException, ExecutionException, InterruptedException { // use read API to read 300K records and check the order @@ -4200,7 +4195,7 @@ public void testReadAPIIterationAndOrderAsync() // TODO(prasmish): Remove this test case if it turns out to be flaky, as expecting the process to // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the // specified amount of time - public void testExecuteSelectAsyncCancel() + void testExecuteSelectAsyncCancel() throws SQLException, ExecutionException, InterruptedException { // use read API to read 300K records and check the order @@ -4242,7 +4237,7 @@ public void testExecuteSelectAsyncCancel() // TODO(prasmish): Remove this test case if it turns out to be flaky, as expecting the process to // be uncompleted in 1000ms is nondeterministic! Though very likely it won't be complete in the // specified amount of time - public void testExecuteSelectAsyncTimeout() + void testExecuteSelectAsyncTimeout() throws SQLException, ExecutionException, InterruptedException { // use read API to read 300K records and check the order @@ -4272,7 +4267,7 @@ public void testExecuteSelectAsyncTimeout() } @Test - public void testExecuteSelectWithNamedQueryParametersAsync() + void testExecuteSelectWithNamedQueryParametersAsync() throws BigQuerySQLException, ExecutionException, InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " @@ -4302,14 +4297,14 @@ public void testExecuteSelectWithNamedQueryParametersAsync() // Ref: https://github.com/googleapis/java-bigquery/issues/2070. Adding a pre-submit test to see // if bigquery.createConnection() returns null @Test - public void testCreateDefaultConnection() throws BigQuerySQLException { + void testCreateDefaultConnection() throws BigQuerySQLException { Connection connection = bigquery.createConnection(); - assertNotNull("bigquery.createConnection() returned null", connection); + assertNotNull(connection, "bigquery.createConnection() returned null"); assertTrue(connection.close()); } @Test - public void testReadAPIConnectionMultiClose() + void testReadAPIConnectionMultiClose() throws SQLException { // use read API to read 300K records, then closes the connection. This test // repeats it multiple times and assets if the connection was closed @@ -4345,7 +4340,7 @@ public void testReadAPIConnectionMultiClose() } @Test - public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { + void testExecuteSelectSinglePageTableRowColInd() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " @@ -4424,7 +4419,7 @@ public void testExecuteSelectSinglePageTableRowColInd() throws SQLException { } @Test - public void testExecuteSelectStruct() throws SQLException { + void testExecuteSelectStruct() throws SQLException { String query = "select (STRUCT(\"Vancouver\" as city, 5 as years)) as address"; ConnectionSettings connectionSettings = ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); @@ -4457,7 +4452,7 @@ public void testExecuteSelectStruct() throws SQLException { } @Test - public void testExecuteSelectStructSubField() throws SQLException { + void testExecuteSelectStructSubField() throws SQLException { String query = "select address.city from (select (STRUCT(\"Vancouver\" as city, 5 as years)) as address)"; ConnectionSettings connectionSettings = @@ -4483,7 +4478,7 @@ public void testExecuteSelectStructSubField() throws SQLException { } @Test - public void testExecuteSelectArray() throws SQLException { + void testExecuteSelectArray() throws SQLException { String query = "SELECT [1,2,3]"; ConnectionSettings connectionSettings = ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); @@ -4506,7 +4501,7 @@ public void testExecuteSelectArray() throws SQLException { } @Test - public void testExecuteSelectArrayOfStruct() throws SQLException { + void testExecuteSelectArrayOfStruct() throws SQLException { String query = "SELECT [STRUCT(\"Vancouver\" as city, 5 as years), STRUCT(\"Boston\" as city, 10 as years)]"; ConnectionSettings connectionSettings = @@ -4546,7 +4541,7 @@ public void testExecuteSelectArrayOfStruct() throws SQLException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testFastQueryMultipleRuns() throws InterruptedException { + void testFastQueryMultipleRuns() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); QueryJobConfiguration config = @@ -4583,7 +4578,7 @@ public void testFastQueryMultipleRuns() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedException { + void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); QueryJobConfiguration config = @@ -4616,7 +4611,7 @@ public void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedExcep /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testFastSQLQuery() throws InterruptedException { + void testFastSQLQuery() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); QueryJobConfiguration config = @@ -4646,7 +4641,7 @@ public void testFastSQLQuery() throws InterruptedException { } @Test - public void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { + void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { String random_project_id = "RANDOM_PROJECT_" + UUID.randomUUID().toString().replace('-', '_'); System.out.println(random_project_id); String query = @@ -4667,7 +4662,7 @@ public void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { } @Test - public void testLocationFastSQLQueryWithJobId() throws InterruptedException { + void testLocationFastSQLQueryWithJobId() throws InterruptedException { DatasetInfo infoUK = DatasetInfo.newBuilder(UK_DATASET) .setDescription(DESCRIPTION) @@ -4728,7 +4723,7 @@ public void testLocationFastSQLQueryWithJobId() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testFastSQLQueryMultiPage() throws InterruptedException { + void testFastSQLQueryMultiPage() throws InterruptedException { String query = "SELECT date, county, state_name, county_fips_code, confirmed_cases, deaths FROM " + TABLE_ID_LARGE.getTable(); @@ -4761,7 +4756,7 @@ public void testFastSQLQueryMultiPage() throws InterruptedException { } @Test - public void testFastDMLQuery() throws InterruptedException { + void testFastDMLQuery() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); String dmlQuery = String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); @@ -4777,7 +4772,7 @@ public void testFastDMLQuery() throws InterruptedException { } @Test - public void testFastDDLQuery() throws InterruptedException { + void testFastDDLQuery() throws InterruptedException { String tableName = "test_table_fast_query_ddl"; String tableNameFastQuery = TABLE_ID_DDL.getTable(); String ddlQuery = @@ -4816,7 +4811,7 @@ public void testFastDDLQuery() throws InterruptedException { } @Test - public void testFastQuerySlowDDL() throws InterruptedException { + void testFastQuerySlowDDL() throws InterruptedException { String tableName = "test_table_fast_query_ddl_slow_" + UUID.randomUUID().toString().substring(0, 8); // This query take more than 10s to run and should fall back on the old query path @@ -4849,7 +4844,7 @@ public void testFastQuerySlowDDL() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testFastQueryHTTPException() throws InterruptedException { + void testFastQueryHTTPException() throws InterruptedException { String queryInvalid = "CREATE OR REPLACE SELECT * FROM UPDATE TABLE SET " + TABLE_ID_FASTQUERY.getTable(); QueryJobConfiguration configInvalidQuery = @@ -4858,9 +4853,9 @@ public void testFastQueryHTTPException() throws InterruptedException { .build(); BigQueryException exception = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.query(configInvalidQuery)); + () -> bigquery.query(configInvalidQuery), + "BigQueryException was expected"); BigQueryError error = exception.getError(); assertNotNull(error.getMessage()); assertEquals("invalidQuery", error.getReason()); @@ -4874,16 +4869,16 @@ public void testFastQueryHTTPException() throws InterruptedException { BigQueryException exception1 = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.query(configMissingTable)); + () -> bigquery.query(configMissingTable), + "BigQueryException was expected"); BigQueryError error1 = exception1.getError(); assertNotNull(error1.getMessage()); assertEquals("notFound", error1.getReason()); } @Test - public void testQuerySessionSupport() throws InterruptedException { + void testQuerySessionSupport() throws InterruptedException { String query = "CREATE TEMPORARY TABLE temptable AS SELECT 17 as foo"; QueryJobConfiguration queryJobConfiguration = QueryJobConfiguration.newBuilder(query) @@ -4916,7 +4911,7 @@ public void testQuerySessionSupport() throws InterruptedException { } @Test - public void testLoadSessionSupportWriteChannelConfiguration() throws InterruptedException { + void testLoadSessionSupportWriteChannelConfiguration() throws InterruptedException { TableId sessionTableId = TableId.of("_SESSION", "test_temp_destination_table_from_file"); WriteChannelConfiguration configuration = @@ -4990,7 +4985,7 @@ public void testLoadSessionSupportWriteChannelConfiguration() throws Interrupted } @Test - public void testLoadSessionSupport() throws InterruptedException { + void testLoadSessionSupport() throws InterruptedException { // Start the session TableId sessionTableId = TableId.of("_SESSION", "test_temp_destination_table"); LoadJobConfiguration configuration = @@ -5053,7 +5048,7 @@ public void testLoadSessionSupport() throws InterruptedException { // } @Test - public void testExecuteSelectSessionSupport() throws BigQuerySQLException { + void testExecuteSelectSessionSupport() throws BigQuerySQLException { String query = "SELECT 17 as foo"; ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() @@ -5067,7 +5062,7 @@ public void testExecuteSelectSessionSupport() throws BigQuerySQLException { } @Test - public void testDmlStatistics() throws InterruptedException { + void testDmlStatistics() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); // Run a DML statement to UPDATE 2 rows of data String dmlQuery = @@ -5089,7 +5084,7 @@ public void testDmlStatistics() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testTransactionInfo() throws InterruptedException { + void testTransactionInfo() throws InterruptedException { String tableName = TABLE_ID_FASTQUERY.getTable(); String transaction = String.format( @@ -5111,7 +5106,7 @@ public void testTransactionInfo() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testScriptStatistics() throws InterruptedException { + void testScriptStatistics() throws InterruptedException { String script = "-- Declare a variable to hold names as an array.\n" + "DECLARE top_names ARRAY;\n" @@ -5164,7 +5159,7 @@ public void testScriptStatistics() throws InterruptedException { } @Test - public void testQueryParameterModeWithDryRun() { + void testQueryParameterModeWithDryRun() { String query = "SELECT TimestampField, StringField, BooleanField, BigNumericField, BigNumericField1, BigNumericField2, BigNumericField3, BigNumericField4 FROM " + TABLE_ID.getTable() @@ -5191,7 +5186,7 @@ public void testQueryParameterModeWithDryRun() { } @Test - public void testPositionalQueryParameters() throws InterruptedException { + void testPositionalQueryParameters() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField, BigNumericField, BigNumericField1, BigNumericField2, BigNumericField3, BigNumericField4 FROM " + TABLE_ID.getTable() @@ -5268,7 +5263,7 @@ public void testPositionalQueryParameters() throws InterruptedException { /* TODO(prasmish): expand below test case with all the fields shown in the above test case */ @Test - public void testExecuteSelectWithPositionalQueryParameters() throws BigQuerySQLException { + void testExecuteSelectWithPositionalQueryParameters() throws BigQuerySQLException { String query = "SELECT TimestampField, StringField FROM " + TABLE_ID.getTable() @@ -5288,7 +5283,7 @@ public void testExecuteSelectWithPositionalQueryParameters() throws BigQuerySQLE } @Test - public void testNamedQueryParameters() throws InterruptedException { + void testNamedQueryParameters() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable() @@ -5311,7 +5306,7 @@ public void testNamedQueryParameters() throws InterruptedException { } @Test - public void testExecuteSelectWithNamedQueryParameters() throws BigQuerySQLException { + void testExecuteSelectWithNamedQueryParameters() throws BigQuerySQLException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable() @@ -5335,7 +5330,7 @@ public void testExecuteSelectWithNamedQueryParameters() throws BigQuerySQLExcept /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test - public void testStructNamedQueryParameters() throws InterruptedException { + void testStructNamedQueryParameters() throws InterruptedException { QueryParameterValue booleanValue = QueryParameterValue.bool(true); QueryParameterValue stringValue = QueryParameterValue.string("test-stringField"); QueryParameterValue integerValue = QueryParameterValue.int64(10); @@ -5362,7 +5357,7 @@ public void testStructNamedQueryParameters() throws InterruptedException { } @Test - public void testRepeatedRecordNamedQueryParameters() throws InterruptedException { + void testRepeatedRecordNamedQueryParameters() throws InterruptedException { String[] stringValues = new String[] {"test-stringField", "test-stringField2"}; List tuples = new ArrayList<>(); for (int i = 0; i < 2; i++) { @@ -5403,7 +5398,7 @@ public void testRepeatedRecordNamedQueryParameters() throws InterruptedException } @Test - public void testUnnestRepeatedRecordNamedQueryParameter() throws InterruptedException { + void testUnnestRepeatedRecordNamedQueryParameter() throws InterruptedException { Boolean[] boolValues = new Boolean[] {true, false}; List tuples = new ArrayList<>(); for (int i = 0; i < 2; i++) { @@ -5442,7 +5437,7 @@ public void testUnnestRepeatedRecordNamedQueryParameter() throws InterruptedExce } @Test - public void testUnnestRepeatedRecordNamedQueryParameterFromDataset() throws InterruptedException { + void testUnnestRepeatedRecordNamedQueryParameterFromDataset() throws InterruptedException { TableId tableId = TableId.of(DATASET, "test_repeated_record_table"); setUpRepeatedRecordTable(tableId); @@ -5548,7 +5543,7 @@ private void setUpRepeatedRecordTable(TableId tableId) { } @Test - public void testEmptyRepeatedRecordNamedQueryParameters() throws InterruptedException { + void testEmptyRepeatedRecordNamedQueryParameters() throws InterruptedException { QueryParameterValue[] tuples = {}; QueryParameterValue repeatedRecord = @@ -5563,13 +5558,13 @@ public void testEmptyRepeatedRecordNamedQueryParameters() throws InterruptedExce .build(); assertThrows( - "an empty array of struct query parameter shouldn't work with 'IN UNNEST'", BigQueryException.class, - () -> bigquery.query(config)); + () -> bigquery.query(config), + "an empty array of struct query parameter shouldn't work with 'IN UNNEST'"); } @Test - public void testStructQuery() throws InterruptedException { + void testStructQuery() throws InterruptedException { // query into a table String query = String.format("SELECT RecordField FROM %s.%s", DATASET, TABLE_ID.getTable()); QueryJobConfiguration config = @@ -5597,7 +5592,7 @@ private static void assertsFieldValue(FieldValue record) { /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test - public void testNestedStructNamedQueryParameters() throws InterruptedException { + void testNestedStructNamedQueryParameters() throws InterruptedException { QueryParameterValue booleanValue = QueryParameterValue.bool(true); QueryParameterValue stringValue = QueryParameterValue.string("test-stringField"); QueryParameterValue integerValue = QueryParameterValue.int64(10); @@ -5639,7 +5634,7 @@ public void testNestedStructNamedQueryParameters() throws InterruptedException { /* TODO(prasmish): replicate relevant parts of the test case for executeSelect */ @Test - public void testBytesParameter() throws Exception { + void testBytesParameter() throws Exception { String query = "SELECT BYTE_LENGTH(@p) AS length"; QueryParameterValue bytesParameter = QueryParameterValue.bytes(new byte[] {1, 3}); QueryJobConfiguration config = @@ -5660,7 +5655,7 @@ public void testBytesParameter() throws Exception { } @Test - public void testGeographyParameter() throws Exception { + void testGeographyParameter() throws Exception { // Issues a simple ST_DISTANCE using two geopoints, one being a named geography parameter. String query = "SELECT ST_DISTANCE(ST_GEOGFROMTEXT(\"POINT(-122.335503 47.625536)\"), @geo) < 3000 as within3k"; @@ -5683,7 +5678,7 @@ public void testGeographyParameter() throws Exception { } @Test - public void testListJobs() { + void testListJobs() { Page jobs = bigquery.listJobs(); for (Job job : jobs.getValues()) { assertNotNull(job.getJobId()); @@ -5695,7 +5690,7 @@ public void testListJobs() { } @Test - public void testListJobsWithSelectedFields() { + void testListJobsWithSelectedFields() { Page jobs = bigquery.listJobs(JobListOption.fields(JobField.USER_EMAIL)); for (Job job : jobs.getValues()) { assertNotNull(job.getJobId()); @@ -5707,7 +5702,7 @@ public void testListJobsWithSelectedFields() { } @Test - public void testListJobsWithCreationBounding() { + void testListJobsWithCreationBounding() { long currentMillis = currentTimeMillis(); long lowerBound = currentMillis - 3600 * 1000; long upperBound = currentMillis; @@ -5723,14 +5718,14 @@ public void testListJobsWithCreationBounding() { foundMax = Math.max(job.getStatistics().getCreationTime(), foundMax); } assertTrue( - "Found min job time " + foundMin + " earlier than " + lowerBound, foundMin >= lowerBound); + foundMin >= lowerBound, "Found min job time " + foundMin + " earlier than " + lowerBound); assertTrue( - "Found max job time " + foundMax + " later than " + upperBound, foundMax <= upperBound); - assertTrue("no jobs listed", jobCount > 0); + foundMax <= upperBound, "Found max job time " + foundMax + " later than " + upperBound); + assertTrue(jobCount > 0, "no jobs listed"); } @Test - public void testCreateAndGetJob() throws InterruptedException, TimeoutException { + void testCreateAndGetJob() throws InterruptedException, TimeoutException { String sourceTableName = "test_create_and_get_job_source_table"; String destinationTableName = "test_create_and_get_job_destination_table"; TableId sourceTable = TableId.of(DATASET, sourceTableName); @@ -5769,8 +5764,7 @@ public void testCreateAndGetJob() throws InterruptedException, TimeoutException } @Test - public void testCreateJobAndWaitForWithRetryOptions() - throws InterruptedException, TimeoutException { + void testCreateJobAndWaitForWithRetryOptions() throws InterruptedException, TimeoutException { // Note: This only tests the non failure/retry case. For retry cases, see unit tests with mocked // RPC calls. QueryJobConfiguration config = @@ -5789,8 +5783,7 @@ public void testCreateJobAndWaitForWithRetryOptions() } @Test - public void testCreateAndGetJobWithSelectedFields() - throws InterruptedException, TimeoutException { + void testCreateAndGetJobWithSelectedFields() throws InterruptedException, TimeoutException { String sourceTableName = "test_create_and_get_job_with_selected_fields_source_table"; String destinationTableName = "test_create_and_get_job_with_selected_fields_destination_table"; TableId sourceTable = TableId.of(DATASET, sourceTableName); @@ -5838,7 +5831,7 @@ public void testCreateAndGetJobWithSelectedFields() } @Test - public void testCopyJob() throws InterruptedException, TimeoutException { + void testCopyJob() throws InterruptedException, TimeoutException { String sourceTableName = "test_copy_job_source_table"; String destinationTableName = "test_copy_job_destination_table"; TableId sourceTable = TableId.of(DATASET, sourceTableName); @@ -5870,7 +5863,7 @@ public void testCopyJob() throws InterruptedException, TimeoutException { } @Test - public void testCopyJobStatistics() throws InterruptedException, TimeoutException { + void testCopyJobStatistics() throws InterruptedException, TimeoutException { String sourceTableName = "test_copy_job_statistics_source_table"; String destinationTableName = "test_copy_job_statistics_destination_table"; @@ -5901,7 +5894,7 @@ public void testCopyJobStatistics() throws InterruptedException, TimeoutExceptio } @Test - public void testSnapshotTableCopyJob() throws InterruptedException { + void testSnapshotTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; String ddlTableName = TABLE_ID_DDL.getTable(); // this creates a snapshot table at specified snapshotTime @@ -5979,7 +5972,7 @@ public void testSnapshotTableCopyJob() throws InterruptedException { } @Test - public void testCopyJobWithLabelsAndExpTime() throws InterruptedException { + void testCopyJobWithLabelsAndExpTime() throws InterruptedException { String destExpiryTime = "2099-12-31T23:59:59.999999999Z"; String sourceTableName = "test_copy_job_source_table_label" + UUID.randomUUID().toString().substring(0, 8); @@ -6058,7 +6051,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQueryJobWithConnectionProperties() throws InterruptedException { + void testQueryJobWithConnectionProperties() throws InterruptedException { String tableName = "test_query_job_table_connection_properties"; String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); @@ -6078,7 +6071,7 @@ public void testQueryJobWithConnectionProperties() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQueryJobWithLabels() throws InterruptedException, TimeoutException { + void testQueryJobWithLabels() throws InterruptedException, TimeoutException { String tableName = "test_query_job_table"; String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); Map labels = ImmutableMap.of("test-job-name", "test-query-job"); @@ -6101,7 +6094,7 @@ public void testQueryJobWithLabels() throws InterruptedException, TimeoutExcepti } @Test - public void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException { + void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException { String tableName = "test_query_job_table"; String query = "SELECT * FROM " @@ -6131,7 +6124,7 @@ public void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws Interru /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test - public void testQueryJobWithRangePartitioning() throws InterruptedException { + void testQueryJobWithRangePartitioning() throws InterruptedException { String tableName = "test_query_job_table_rangepartitioning"; String query = "SELECT IntegerField, TimestampField, StringField, BooleanField FROM " @@ -6156,7 +6149,7 @@ public void testQueryJobWithRangePartitioning() throws InterruptedException { } @Test - public void testLoadJobWithRangePartitioning() throws InterruptedException { + void testLoadJobWithRangePartitioning() throws InterruptedException { String tableName = "test_load_job_table_rangepartitioning"; TableId destinationTable = TableId.of(DATASET, tableName); try { @@ -6180,7 +6173,7 @@ public void testLoadJobWithRangePartitioning() throws InterruptedException { } @Test - public void testLoadJobWithDecimalTargetTypes() throws InterruptedException { + void testLoadJobWithDecimalTargetTypes() throws InterruptedException { String tableName = "test_load_job_table_parquet_decimalTargetTypes"; TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; @@ -6208,7 +6201,7 @@ public void testLoadJobWithDecimalTargetTypes() throws InterruptedException { } @Test - public void testExternalTableWithDecimalTargetTypes() throws InterruptedException { + void testExternalTableWithDecimalTargetTypes() throws InterruptedException { String tableName = "test_create_external_table_parquet_decimalTargetTypes"; TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; @@ -6228,7 +6221,7 @@ public void testExternalTableWithDecimalTargetTypes() throws InterruptedExceptio } @Test - public void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { + void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { String tableName = "test_query_job_table"; String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); @@ -6246,7 +6239,7 @@ public void testQueryJobWithDryRun() throws InterruptedException, TimeoutExcepti } @Test - public void testExtractJob() throws InterruptedException, TimeoutException { + void testExtractJob() throws InterruptedException, TimeoutException { String tableName = "test_export_job_table"; TableId destinationTable = TableId.of(DATASET, tableName); Map labels = ImmutableMap.of("test-job-name", "test-load-extract-job"); @@ -6286,7 +6279,7 @@ public void testExtractJob() throws InterruptedException, TimeoutException { } @Test - public void testExtractJobWithModel() throws InterruptedException { + void testExtractJobWithModel() throws InterruptedException { String modelName = RemoteBigQueryHelper.generateModelName(); String sql = "CREATE MODEL `" @@ -6323,7 +6316,7 @@ public void testExtractJobWithModel() throws InterruptedException { } @Test - public void testExtractJobWithLabels() throws InterruptedException, TimeoutException { + void testExtractJobWithLabels() throws InterruptedException, TimeoutException { String tableName = "test_export_job_table_label"; Map labels = ImmutableMap.of("test_job_name", "test_export_job"); TableId destinationTable = TableId.of(DATASET, tableName); @@ -6349,7 +6342,7 @@ public void testExtractJobWithLabels() throws InterruptedException, TimeoutExcep } @Test - public void testCancelJob() throws InterruptedException, TimeoutException { + void testCancelJob() throws InterruptedException, TimeoutException { String destinationTableName = "test_cancel_query_job_table"; String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, destinationTableName); @@ -6363,12 +6356,12 @@ public void testCancelJob() throws InterruptedException, TimeoutException { } @Test - public void testCancelNonExistingJob() { + void testCancelNonExistingJob() { assertFalse(bigquery.cancel("test_cancel_non_existing_job")); } @Test - public void testInsertFromFile() throws InterruptedException, IOException, TimeoutException { + void testInsertFromFile() throws InterruptedException, IOException, TimeoutException { String destinationTableName = "test_insert_from_file_table"; TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = @@ -6441,8 +6434,7 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo } @Test - public void testInsertFromFileWithLabels() - throws InterruptedException, IOException, TimeoutException { + void testInsertFromFileWithLabels() throws InterruptedException, IOException, TimeoutException { String destinationTableName = "test_insert_from_file_table_with_labels"; TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = @@ -6472,7 +6464,7 @@ public void testInsertFromFileWithLabels() } @Test - public void testInsertWithDecimalTargetTypes() + void testInsertWithDecimalTargetTypes() throws InterruptedException, IOException, TimeoutException { String destinationTableName = "test_insert_from_file_table_with_decimal_target_type"; TableId tableId = TableId.of(DATASET, destinationTableName); @@ -6499,7 +6491,7 @@ public void testInsertWithDecimalTargetTypes() } @Test - public void testLocation() throws Exception { + void testLocation() throws Exception { String location = "EU"; String wrongLocation = "US"; @@ -6563,14 +6555,14 @@ public void testLocation() throws Exception { .isEmpty(); assertThrows( - "querying a table with wrong location shouldn't work", BigQueryException.class, () -> otelBigquery .query( QueryJobConfiguration.of(query), JobId.newBuilder().setLocation(wrongLocation).build()) - .iterateAll()); + .iterateAll(), + "querying a table with wrong location shouldn't work"); // Test write { @@ -6590,14 +6582,14 @@ public void testLocation() throws Exception { } assertThrows( - "writing to a table with wrong location shouldn't work", BigQueryException.class, () -> { try (TableDataWriteChannel ignore = otelBigquery.writer( JobId.newBuilder().setLocation(wrongLocation).build(), writeChannelConfiguration)) {} - }); + }, + "writing to a table with wrong location shouldn't work"); } } finally { RemoteBigQueryHelper.forceDelete(bigquery, datasetName); @@ -6605,7 +6597,7 @@ public void testLocation() throws Exception { } @Test - public void testWriteChannelPreserveAsciiControlCharacters() + void testWriteChannelPreserveAsciiControlCharacters() throws InterruptedException, IOException, TimeoutException { String destinationTableName = "test_write_channel_preserve_ascii_control_characters"; TableId tableId = TableId.of(DATASET, destinationTableName); @@ -6632,7 +6624,7 @@ public void testWriteChannelPreserveAsciiControlCharacters() } @Test - public void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { + void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { String destinationTableName = "test_load_job_preserve_ascii_control_characters"; TableId destinationTable = TableId.of(DATASET, destinationTableName); @@ -6652,7 +6644,7 @@ public void testLoadJobPreserveAsciiControlCharacters() throws InterruptedExcept } @Test - public void testReferenceFileSchemaUriForAvro() { + void testReferenceFileSchemaUriForAvro() { try { String destinationTableName = "test_reference_file_schema_avro"; TableId tableId = TableId.of(DATASET, destinationTableName); @@ -6711,7 +6703,7 @@ public void testReferenceFileSchemaUriForAvro() { } @Test - public void testReferenceFileSchemaUriForParquet() { + void testReferenceFileSchemaUriForParquet() { try { String destinationTableName = "test_reference_file_schema_parquet"; TableId tableId = TableId.of(DATASET, destinationTableName); @@ -6769,7 +6761,7 @@ public void testReferenceFileSchemaUriForParquet() { } @Test - public void testCreateExternalTableWithReferenceFileSchemaAvro() { + void testCreateExternalTableWithReferenceFileSchemaAvro() { String destinationTableName = "test_create_external_table_reference_file_schema_avro"; TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = @@ -6808,7 +6800,7 @@ public void testCreateExternalTableWithReferenceFileSchemaAvro() { } @Test - public void testCreateExternalTableWithReferenceFileSchemaParquet() { + void testCreateExternalTableWithReferenceFileSchemaParquet() { String destinationTableName = "test_create_external_table_reference_file_schema_parquet"; TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = @@ -6849,7 +6841,7 @@ public void testCreateExternalTableWithReferenceFileSchemaParquet() { } @Test - public void testCloneTableCopyJob() throws InterruptedException { + void testCloneTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; String ddlTableName = TABLE_ID_DDL.getTable(); String cloneTableName = "test_clone_table"; @@ -6902,15 +6894,15 @@ public void testCloneTableCopyJob() throws InterruptedException { } @Test - public void testHivePartitioningOptionsFieldsFieldExistence() throws InterruptedException { + void testHivePartitioningOptionsFieldsFieldExistence() throws InterruptedException { String tableName = "hive_partitioned_external_table"; // Create data on GCS String sourceDirectory = "bigquery/hive-partitioning-table/example"; BlobInfo blobInfo = BlobInfo.newBuilder(BUCKET, sourceDirectory + "/key=foo/data.json").build(); assertNotNull( - "Failed to upload JSON to GCS", - storage.create(blobInfo, "{\"name\":\"bar\"}".getBytes(StandardCharsets.UTF_8))); + storage.create(blobInfo, "{\"name\":\"bar\"}".getBytes(StandardCharsets.UTF_8)), + "Failed to upload JSON to GCS"); String sourceUri = "gs://" + BUCKET + "/" + sourceDirectory + "/*"; String sourceUriPrefix = "gs://" + BUCKET + "/" + sourceDirectory + "/"; @@ -6946,7 +6938,7 @@ public void testHivePartitioningOptionsFieldsFieldExistence() throws Interrupted } @Test - public void testPrimaryKey() { + void testPrimaryKey() { String tableName = "test_primary_key"; TableId tableId = TableId.of(DATASET, tableName); PrimaryKey primaryKey = PrimaryKey.newBuilder().setColumns(Arrays.asList("ID")).build(); @@ -6971,7 +6963,7 @@ public void testPrimaryKey() { } @Test - public void testPrimaryKeyUpdate() { + void testPrimaryKeyUpdate() { String tableName = "test_primary_key_update"; TableId tableId = TableId.of(DATASET, tableName); PrimaryKey primaryKey = @@ -7000,7 +6992,7 @@ public void testPrimaryKeyUpdate() { } @Test - public void testForeignKeys() { + void testForeignKeys() { String tableNamePk = "test_foreign_key"; String tableNameFk = "test_foreign_key2"; // TableIds referenced by foreign keys need project id to be specified @@ -7050,7 +7042,7 @@ public void testForeignKeys() { } @Test - public void testForeignKeysUpdate() { + void testForeignKeysUpdate() { String tableNameFk = "test_foreign_key"; String tableNamePk1 = "test_foreign_key2"; String tableNamePk2 = "test_foreign_key3"; @@ -7148,7 +7140,7 @@ public void testForeignKeysUpdate() { } @Test - public void testAlreadyExistJobExceptionHandling() throws InterruptedException { + void testAlreadyExistJobExceptionHandling() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + DATASET @@ -7175,7 +7167,7 @@ public void testAlreadyExistJobExceptionHandling() throws InterruptedException { } @Test - public void testStatelessQueries() throws InterruptedException { + void testStatelessQueries() throws InterruptedException { // Create local BigQuery to not contaminate global test parameters. RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQuery bigQuery = bigqueryHelper.getOptions().getService(); @@ -7187,8 +7179,8 @@ public void testStatelessQueries() throws InterruptedException { // Ideally Stateless query will return queryId but in some cases it would return jobId instead // of queryId based on the query complexity or other factors (job timeout configs). assertTrue( - "Exactly one of jobId or queryId should be non-null", - (tableResult.getJobId() != null) ^ (tableResult.getQueryId() != null)); + (tableResult.getJobId() != null) ^ (tableResult.getQueryId() != null), + "Exactly one of jobId or queryId should be non-null"); // Job creation takes over, no query id is created. bigQuery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_REQUIRED); @@ -7209,7 +7201,7 @@ private TableResult executeSimpleQuery(BigQuery bigQuery) throws InterruptedExce } @Test - public void testTableResultJobIdAndQueryId() throws InterruptedException { + void testTableResultJobIdAndQueryId() throws InterruptedException { // For stateless queries, jobId and queryId are populated based on the following criteria: // 1. For stateless queries, then queryId is populated. // 2. For queries that fails the requirements to be stateless, then jobId is populated and @@ -7232,8 +7224,8 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { // Ideally Stateless query will return queryId but in some cases it would return jobId instead // of queryId based on the query complexity or other factors (job timeout configs). assertTrue( - "Exactly one of jobId or queryId should be non-null", - (result.getJobId() != null) ^ (result.getQueryId() != null)); + (result.getJobId() != null) ^ (result.getQueryId() != null), + "Exactly one of jobId or queryId should be non-null"); // Test scenario 2 by failing stateless check by setting job timeout. QueryJobConfiguration configQueryWithJob = @@ -7261,7 +7253,7 @@ public void testTableResultJobIdAndQueryId() throws InterruptedException { } @Test - public void testStatelessQueriesWithLocation() throws Exception { + void testStatelessQueriesWithLocation() throws Exception { // This test validates BigQueryOption location is used for stateless query by verifying that the // stateless query fails when the BigQueryOption location does not match the dataset location. String location = "EU"; @@ -7294,7 +7286,6 @@ public void testStatelessQueriesWithLocation() throws Exception { // Test stateless query when BigQueryOption location does not match dataset location. assertThrows( - "querying a table with wrong location shouldn't work", BigQueryException.class, () -> { BigQuery bigQueryWrongLocation = @@ -7306,14 +7297,15 @@ public void testStatelessQueriesWithLocation() throws Exception { .getOptions() .setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL); bigQueryWrongLocation.query(QueryJobConfiguration.of(query)); - }); + }, + "querying a table with wrong location shouldn't work"); } finally { RemoteBigQueryHelper.forceDelete(bigQuery, datasetName); } } @Test - public void testQueryWithTimeout() throws InterruptedException { + void testQueryWithTimeout() throws InterruptedException { // Validate that queryWithTimeout returns either TableResult or Job object RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); @@ -7357,7 +7349,7 @@ public void testQueryWithTimeout() throws InterruptedException { } @Test - public void testUniverseDomainWithInvalidUniverseDomain() { + void testUniverseDomainWithInvalidUniverseDomain() { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = bigqueryHelper.getOptions().toBuilder() @@ -7368,9 +7360,9 @@ public void testUniverseDomainWithInvalidUniverseDomain() { BigQueryException exception = assertThrows( - "RPCs to invalid universe domain should fail", BigQueryException.class, - () -> bigQuery.listDatasets("bigquery-public-data")); + () -> bigQuery.listDatasets("bigquery-public-data"), + "RPCs to invalid universe domain should fail"); assertEquals(HTTP_UNAUTHORIZED, exception.getCode()); assertNotNull(exception.getMessage()); assertTrue( @@ -7380,7 +7372,7 @@ public void testUniverseDomainWithInvalidUniverseDomain() { } @Test - public void testInvalidUniverseDomainWithMismatchCredentials() { + void testInvalidUniverseDomainWithMismatchCredentials() { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = bigqueryHelper.getOptions().toBuilder() @@ -7390,9 +7382,9 @@ public void testInvalidUniverseDomainWithMismatchCredentials() { BigQueryException exception = assertThrows( - "RPCs to invalid universe domain should fail", BigQueryException.class, - () -> bigQuery.listDatasets("bigquery-public-data")); + () -> bigQuery.listDatasets("bigquery-public-data"), + "RPCs to invalid universe domain should fail"); assertEquals(HTTP_UNAUTHORIZED, exception.getCode()); assertNotNull(exception.getMessage()); assertTrue( @@ -7402,7 +7394,7 @@ public void testInvalidUniverseDomainWithMismatchCredentials() { } @Test - public void testUniverseDomainWithMatchingDomain() { + void testUniverseDomainWithMatchingDomain() { // Test a valid domain using the default credentials and Google default universe domain. RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); BigQueryOptions bigQueryOptions = @@ -7427,7 +7419,7 @@ public void testUniverseDomainWithMatchingDomain() { } @Test - public void testExternalTableMetadataCachingNotEnable() throws InterruptedException { + void testExternalTableMetadataCachingNotEnable() throws InterruptedException { String tableName = "test_metadata_cache_not_enable"; TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = @@ -7468,7 +7460,7 @@ public void testExternalTableMetadataCachingNotEnable() throws InterruptedExcept } @Test - public void testExternalMetadataCacheModeFailForNonBiglake() { + void testExternalMetadataCacheModeFailForNonBiglake() { // Validate that MetadataCacheMode is passed to the backend. // TODO: Enhance this test after BigLake testing infrastructure is inplace. String tableName = "test_metadata_cache_mode_fail_for_non_biglake"; @@ -7482,9 +7474,9 @@ public void testExternalMetadataCacheModeFailForNonBiglake() { BigQueryException exception = assertThrows( - "BigQueryException was expected", BigQueryException.class, - () -> bigquery.create(tableInfo)); + () -> bigquery.create(tableInfo), + "BigQueryException was expected"); BigQueryError error = exception.getError(); assertNotNull(error); assertEquals("invalid", error.getReason()); @@ -7495,7 +7487,7 @@ public void testExternalMetadataCacheModeFailForNonBiglake() { } @Test - public void testObjectTable() throws InterruptedException { + void testObjectTable() throws InterruptedException { String tableName = "test_object_table"; TableId tableId = TableId.of(DATASET, tableName); @@ -7538,7 +7530,7 @@ public void testObjectTable() throws InterruptedException { } @Test - public void testQueryExportStatistics() throws InterruptedException { + void testQueryExportStatistics() throws InterruptedException { String query = String.format( "EXPORT DATA OPTIONS(\n" @@ -7562,7 +7554,7 @@ public void testQueryExportStatistics() throws InterruptedException { } @Test - public void testLoadConfigurationFlexibleColumnName() throws InterruptedException { + void testLoadConfigurationFlexibleColumnName() throws InterruptedException { // See https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#columnnamecharactermap for // mapping. @@ -7618,7 +7610,7 @@ public void testLoadConfigurationFlexibleColumnName() throws InterruptedExceptio } @Test - public void testStatementType() throws InterruptedException { + void testStatementType() throws InterruptedException { String tableName = "test_materialized_view_table_statemnt_type"; String createQuery = String.format( diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java index 332071a620..4942c30083 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java @@ -15,11 +15,11 @@ */ package com.google.cloud.bigquery.it; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryException; @@ -47,9 +47,9 @@ import java.util.UUID; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class ITHighPrecisionTimestamp { @@ -69,7 +69,7 @@ public class ITHighPrecisionTimestamp { private static final String TIMESTAMP2 = "1970-01-01T12:34:56.123456789123Z"; private static final String TIMESTAMP3 = "2000-01-01T12:34:56.123456789123Z"; - @BeforeClass + @BeforeAll public static void beforeClass() { BigQueryOptions.Builder builder = BigQueryOptions.newBuilder() @@ -110,7 +110,7 @@ public static void beforeClass() { assertEquals(0, response.getInsertErrors().size()); } - @AfterClass + @AfterAll public static void afterClass() { if (bigquery != null) { bigquery.delete(defaultTableId); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index 790f35fe5c..84e355f9e6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -16,12 +16,13 @@ package com.google.cloud.bigquery.it; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.BigQuery; @@ -53,6 +54,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; +import java.sql.Date; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Time; @@ -66,12 +68,12 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.apache.arrow.vector.util.JsonStringArrayList; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.Timeout; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +@Timeout(value = 1800) // 30 min timeout public class ITNightlyBigQueryTest { private static final Logger logger = Logger.getLogger(ITNightlyBigQueryTest.class.getName()); private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); @@ -170,9 +172,7 @@ public class ITNightlyBigQueryTest { .setDescription("IntervalFieldDescription") .build()); - @Rule public Timeout globalTimeout = Timeout.seconds(1800); // setting 30 mins as the timeout - - @BeforeClass + @BeforeAll public static void beforeClass() throws InterruptedException, IOException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); bigquery = bigqueryHelper.getOptions().getService(); @@ -181,17 +181,15 @@ public static void beforeClass() throws InterruptedException, IOException { populateTestRecords(DATASET, TABLE); } - @AfterClass + @AfterAll public static void afterClass() { try { if (bigquery != null) { deleteTable(DATASET, TABLE); RemoteBigQueryHelper.forceDelete(bigquery, DATASET); - } else { - fail("Error clearing the test dataset"); } } catch (BigQueryException e) { - fail("Error clearing the test dataset " + e); + throw new RuntimeException("Error clearing the test dataset " + e); } } @@ -199,9 +197,8 @@ public static void afterClass() { public void testInvalidQuery() throws BigQuerySQLException { Connection connection = getConnection(); try { - BigQueryResult bigQueryResult = connection.executeSelect(INVALID_QUERY); - fail("BigQuerySQLException was expected"); - } catch (BigQuerySQLException ex) { + BigQuerySQLException ex = + assertThrows(BigQuerySQLException.class, () -> connection.executeSelect(INVALID_QUERY)); assertNotNull(ex.getMessage()); assertTrue(ex.getMessage().toLowerCase().contains("unexpected keyword into")); } finally { @@ -215,282 +212,300 @@ public void testInvalidQuery() throws BigQuerySQLException { @Test public void testIterateAndOrder() throws SQLException { Connection connection = getConnection(); - BigQueryResult bigQueryResult = connection.executeSelect(QUERY); - logger.log(Level.INFO, "Query used: {0}", QUERY); - ResultSet rs = bigQueryResult.getResultSet(); - int cnt = 0; - - int prevIntegerFieldVal = 0; - while (rs.next()) { - if (cnt == 0) { // first row is supposed to be null - assertNull(rs.getString("StringField")); - assertNull(rs.getString("GeographyField")); - Object intAryField = rs.getObject("IntegerArrayField"); - if (intAryField instanceof JsonStringArrayList) { - assertEquals( - new JsonStringArrayList(), - ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + try { + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + assertNotNull(rs.getString("StringField")); + assertNotNull(rs.getString("GeographyField")); + assertNotNull(rs.getObject("IntegerArrayField")); + assertTrue(rs.getBoolean("BooleanField")); + assertTrue(0.0d < rs.getDouble("BigNumericField")); + assertTrue(0 < rs.getInt("IntegerField")); + assertTrue(0L < rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row } - assertFalse(rs.getBoolean("BooleanField")); - assertTrue(0.0d == rs.getDouble("BigNumericField")); - assertTrue(0 == rs.getInt("IntegerField")); - assertTrue(0L == rs.getLong("NumericField")); - assertNull(rs.getBytes("BytesField")); - assertNull(rs.getTimestamp("TimestampField")); - assertNull(rs.getTime("TimeField")); - assertNull(rs.getDate("DateField")); - assertNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNull(rs.getString("StringField_1")); - assertNull(rs.getString("hello")); // equivalent of testJsonType - assertEquals(0, rs.getInt("id")); - - } else { // remaining rows are supposed to be non null - assertNotNull(rs.getString("StringField")); - assertNotNull(rs.getString("GeographyField")); - assertNotNull(rs.getObject("IntegerArrayField")); - assertTrue(rs.getBoolean("BooleanField")); - assertTrue(0.0d < rs.getDouble("BigNumericField")); - assertTrue(0 < rs.getInt("IntegerField")); - assertTrue(0L < rs.getLong("NumericField")); - assertNotNull(rs.getBytes("BytesField")); - assertNotNull(rs.getTimestamp("TimestampField")); - assertNotNull(rs.getTime("TimeField")); - assertNotNull(rs.getDate("DateField")); - assertNotNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNotNull(rs.getString("StringField_1")); - - // check the order of the records - assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); - prevIntegerFieldVal = rs.getInt("IntegerField"); - - testForAllDataTypeValues(rs, cnt); // asserts the value of each row + ++cnt; } - ++cnt; + assertEquals(LIMIT_RECS, cnt); // all the records were retrieved + } finally { + connection.close(); } - assertEquals(LIMIT_RECS, cnt); // all the records were retrieved - connection.close(); } /* This tests for the order of the records using default connection settings as well as the value of the records using testForAllDataTypeValues */ @Test - public void testIterateAndOrderDefaultConnSettings() throws SQLException { + void testIterateAndOrderDefaultConnSettings() throws SQLException { Connection connection = bigquery.createConnection(); - BigQueryResult bigQueryResult = connection.executeSelect(QUERY); - logger.log(Level.INFO, "Query used: {0}", QUERY); - ResultSet rs = bigQueryResult.getResultSet(); - int cnt = 0; - - int prevIntegerFieldVal = 0; - while (rs.next()) { - if (cnt == 0) { // first row is supposed to be null - assertNull(rs.getString("StringField")); - assertNull(rs.getString("GeographyField")); - Object intAryField = rs.getObject("IntegerArrayField"); - if (intAryField instanceof JsonStringArrayList) { - assertEquals( - new JsonStringArrayList(), - ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + try { + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + assertNotNull(rs.getString("StringField")); + assertNotNull(rs.getString("GeographyField")); + assertNotNull(rs.getObject("IntegerArrayField")); + assertTrue(rs.getBoolean("BooleanField")); + assertTrue(0.0d < rs.getDouble("BigNumericField")); + assertTrue(0 < rs.getInt("IntegerField")); + assertTrue(0L < rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row } - assertFalse(rs.getBoolean("BooleanField")); - assertTrue(0.0d == rs.getDouble("BigNumericField")); - assertTrue(0 == rs.getInt("IntegerField")); - assertTrue(0L == rs.getLong("NumericField")); - assertNull(rs.getBytes("BytesField")); - assertNull(rs.getTimestamp("TimestampField")); - assertNull(rs.getTime("TimeField")); - assertNull(rs.getDate("DateField")); - assertNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNull(rs.getString("StringField_1")); - assertNull(rs.getString("hello")); // equivalent of testJsonType - assertEquals(0, rs.getInt("id")); - - } else { // remaining rows are supposed to be non null - assertNotNull(rs.getString("StringField")); - assertNotNull(rs.getString("GeographyField")); - assertNotNull(rs.getObject("IntegerArrayField")); - assertTrue(rs.getBoolean("BooleanField")); - assertTrue(0.0d < rs.getDouble("BigNumericField")); - assertTrue(0 < rs.getInt("IntegerField")); - assertTrue(0L < rs.getLong("NumericField")); - assertNotNull(rs.getBytes("BytesField")); - assertNotNull(rs.getTimestamp("TimestampField")); - assertNotNull(rs.getTime("TimeField")); - assertNotNull(rs.getDate("DateField")); - assertNotNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNotNull(rs.getString("StringField_1")); - - // check the order of the records - assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); - prevIntegerFieldVal = rs.getInt("IntegerField"); - - testForAllDataTypeValues(rs, cnt); // asserts the value of each row + ++cnt; } - ++cnt; + assertEquals(LIMIT_RECS, cnt); // all the records were retrieved + } finally { + connection.close(); } - assertEquals(LIMIT_RECS, cnt); // all the records were retrieved - assertTrue(connection.close()); } /* This tests interrupts the execution in between and checks if it has been interrupted successfully while using ReadAPI */ @Test - public void testConnectionClose() throws SQLException { + void testConnectionClose() throws SQLException { Connection connection = bigquery.createConnection(); - assertNotNull("bigquery.createConnection() returned null", connection); - BigQueryResult bigQueryResult = connection.executeSelect(QUERY); - logger.log(Level.INFO, "Query used: {0}", QUERY); - ResultSet rs = bigQueryResult.getResultSet(); - int cnt = 0; - while (rs.next()) { - ++cnt; - if (cnt == 50000) { // interrupt at 50K - assertTrue(connection.close()); + try { + assertNotNull(connection, "bigquery.createConnection() returned null"); + BigQueryResult bigQueryResult = connection.executeSelect(QUERY); + logger.log(Level.INFO, "Query used: {0}", QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { + ++cnt; + if (cnt == 50000) { // interrupt at 50K + assertTrue(connection.close()); + } } + assertTrue(LIMIT_RECS > cnt); + // we stopped at 50K but still we can expect additional records (typically ~100) + // to be retrieved + // as a number of records should have been already buffered. less than + // LIMIT_RECS should be retrieved + } finally { + connection.close(); } - assertTrue( - LIMIT_RECS - > cnt); // we stopped at 50K but still we can expect additional records (typically ~100) - // to be retrieved - // as a number of records should have been already buffered. less than - // LIMIT_RECS should be retrieved } @Test - public void testMultipleRuns() throws SQLException { - - Connection connection = getConnection(); - BigQueryResult bigQueryResult = connection.executeSelect(MULTI_QUERY); - logger.log(Level.INFO, "Query used: {0}", MULTI_QUERY); - ResultSet rs = bigQueryResult.getResultSet(); - int cnt = 0; + void testMultipleRuns() throws SQLException { int totalCnt = 0; - - int prevIntegerFieldVal = 0; - while (rs.next()) { - if (cnt == 0) { // first row is supposed to be null - assertNull(rs.getString("StringField")); - assertNull(rs.getString("GeographyField")); - Object intAryField = rs.getObject("IntegerArrayField"); - if (intAryField instanceof JsonStringArrayList) { - assertEquals( - new JsonStringArrayList(), - ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + Connection connection = getConnection(); + try { + BigQueryResult bigQueryResult = connection.executeSelect(MULTI_QUERY); + logger.log(Level.INFO, "Query used: {0}", MULTI_QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row } - assertFalse(rs.getBoolean("BooleanField")); - assertTrue(0.0d == rs.getDouble("BigNumericField")); - assertTrue(0 == rs.getInt("IntegerField")); - assertTrue(0L == rs.getLong("NumericField")); - assertNull(rs.getBytes("BytesField")); - assertNull(rs.getTimestamp("TimestampField")); - assertNull(rs.getTime("TimeField")); - assertNull(rs.getDate("DateField")); - assertNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNull(rs.getString("StringField_1")); - assertNull(rs.getString("hello")); // equivalent of testJsonType - assertEquals(0, rs.getInt("id")); - - } else { // remaining rows are supposed to be non null - // check the order of the records - assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); - prevIntegerFieldVal = rs.getInt("IntegerField"); - - testForAllDataTypeValues(rs, cnt); // asserts the value of each row + ++cnt; } - ++cnt; + totalCnt += cnt; + } finally { + connection.close(); } - connection.close(); - totalCnt += cnt; + // Repeat the same run - connection = getConnection(); - bigQueryResult = connection.executeSelect(MULTI_QUERY); - rs = bigQueryResult.getResultSet(); - cnt = 0; - prevIntegerFieldVal = 0; - while (rs.next()) { - if (cnt == 0) { // first row is supposed to be null - assertNull(rs.getString("StringField")); - assertNull(rs.getString("GeographyField")); - Object intAryField = rs.getObject("IntegerArrayField"); - if (intAryField instanceof JsonStringArrayList) { - assertEquals( - new JsonStringArrayList(), - ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + Connection connection1 = getConnection(); + try { + BigQueryResult bigQueryResult = connection1.executeSelect(MULTI_QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + int prevIntegerFieldVal = 0; + while (rs.next()) { + if (cnt == 0) { // first row is supposed to be null + assertNull(rs.getString("StringField")); + assertNull(rs.getString("GeographyField")); + Object intAryField = rs.getObject("IntegerArrayField"); + if (intAryField instanceof JsonStringArrayList) { + assertEquals( + new JsonStringArrayList(), + ((JsonStringArrayList) intAryField)); // null array is returned as an empty array + } + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d == rs.getDouble("BigNumericField")); + assertTrue(0 == rs.getInt("IntegerField")); + assertTrue(0L == rs.getLong("NumericField")); + assertNull(rs.getBytes("BytesField")); + assertNull(rs.getTimestamp("TimestampField")); + assertNull(rs.getTime("TimeField")); + assertNull(rs.getDate("DateField")); + assertNull(rs.getString("JSONField")); + assertFalse(rs.getBoolean("BooleanField_1")); + assertNull(rs.getString("StringField_1")); + assertNull(rs.getString("hello")); // equivalent of testJsonType + assertEquals(0, rs.getInt("id")); + + } else { // remaining rows are supposed to be non null + // check the order of the records + assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); + prevIntegerFieldVal = rs.getInt("IntegerField"); + + testForAllDataTypeValues(rs, cnt); // asserts the value of each row } - assertFalse(rs.getBoolean("BooleanField")); - assertTrue(0.0d == rs.getDouble("BigNumericField")); - assertTrue(0 == rs.getInt("IntegerField")); - assertTrue(0L == rs.getLong("NumericField")); - assertNull(rs.getBytes("BytesField")); - assertNull(rs.getTimestamp("TimestampField")); - assertNull(rs.getTime("TimeField")); - assertNull(rs.getDate("DateField")); - assertNull(rs.getString("JSONField")); - assertFalse(rs.getBoolean("BooleanField_1")); - assertNull(rs.getString("StringField_1")); - assertNull(rs.getString("hello")); // equivalent of testJsonType - assertEquals(0, rs.getInt("id")); - - } else { // remaining rows are supposed to be non null - // check the order of the records - assertTrue(prevIntegerFieldVal < rs.getInt("IntegerField")); - prevIntegerFieldVal = rs.getInt("IntegerField"); - - testForAllDataTypeValues(rs, cnt); // asserts the value of each row + ++cnt; } - ++cnt; + totalCnt += cnt; + } finally { + connection1.close(); } - connection.close(); - totalCnt += cnt; assertEquals(MULTI_LIMIT_RECS * 2, totalCnt); } @Test - public void testPositionalParams() + void testPositionalParams() throws SQLException { // Bypasses Read API as it doesnt support Positional Params Connection connection = getConnection(); - Parameter dateParam = - Parameter.newBuilder().setValue(QueryParameterValue.date("2022-01-01")).build(); - Parameter boolParam = Parameter.newBuilder().setValue(QueryParameterValue.bool(true)).build(); - Parameter intParam = Parameter.newBuilder().setValue(QueryParameterValue.int64(1)).build(); - Parameter numericParam = - Parameter.newBuilder().setValue(QueryParameterValue.numeric(new BigDecimal(100))).build(); - List parameters = ImmutableList.of(dateParam, boolParam, intParam, numericParam); - - BigQueryResult bigQueryResult = connection.executeSelect(POSITIONAL_QUERY, parameters); - logger.log(Level.INFO, "Query used: {0}", POSITIONAL_QUERY); - ResultSet rs = bigQueryResult.getResultSet(); - int cnt = 0; - while (rs.next()) { - assertFalse(rs.getBoolean("BooleanField")); - assertTrue(0.0d <= rs.getDouble("BigNumericField")); - assertTrue(0 <= rs.getInt("IntegerField")); - assertTrue(0L <= rs.getLong("NumericField")); - assertNotNull(rs.getBytes("BytesField")); - assertNotNull(rs.getTimestamp("TimestampField")); - assertNotNull(rs.getTime("TimeField")); - assertNotNull(rs.getDate("DateField")); - assertNotNull(rs.getString("JSONField")); - assertTrue(rs.getBoolean("BooleanField_1")); - assertNotNull(rs.getString("StringField_1")); - ++cnt; + try { + Parameter dateParam = + Parameter.newBuilder().setValue(QueryParameterValue.date("2022-01-01")).build(); + Parameter boolParam = Parameter.newBuilder().setValue(QueryParameterValue.bool(true)).build(); + Parameter intParam = Parameter.newBuilder().setValue(QueryParameterValue.int64(1)).build(); + Parameter numericParam = + Parameter.newBuilder().setValue(QueryParameterValue.numeric(new BigDecimal(100))).build(); + List parameters = ImmutableList.of(dateParam, boolParam, intParam, numericParam); + + BigQueryResult bigQueryResult = connection.executeSelect(POSITIONAL_QUERY, parameters); + logger.log(Level.INFO, "Query used: {0}", POSITIONAL_QUERY); + ResultSet rs = bigQueryResult.getResultSet(); + int cnt = 0; + while (rs.next()) { + assertFalse(rs.getBoolean("BooleanField")); + assertTrue(0.0d <= rs.getDouble("BigNumericField")); + assertTrue(0 <= rs.getInt("IntegerField")); + assertTrue(0L <= rs.getLong("NumericField")); + assertNotNull(rs.getBytes("BytesField")); + assertNotNull(rs.getTimestamp("TimestampField")); + assertNotNull(rs.getTime("TimeField")); + assertNotNull(rs.getDate("DateField")); + assertNotNull(rs.getString("JSONField")); + assertTrue(rs.getBoolean("BooleanField_1")); + assertNotNull(rs.getString("StringField_1")); + ++cnt; + } + assertEquals(MULTI_LIMIT_RECS, cnt); + } finally { + connection.close(); } - connection.close(); - assertEquals(MULTI_LIMIT_RECS, cnt); } @Test // This testcase reads rows in bulk for a public table to make sure we do not get // table-not-found exception. Ref: b/241134681 . This exception has been seen while reading data // in bulk - public void testForTableNotFound() throws SQLException { + void testForTableNotFound() throws SQLException { int recordCnt = 50000000; // 5Mil String query = String.format( @@ -578,8 +593,7 @@ private static void testForAllDataTypeValues(ResultSet rs, int cnt) throws SQLEx // Timestamp, Time, DateTime and Date fields assertEquals(1649064795000L, rs.getTimestamp("TimestampField").getTime()); - assertEquals( - java.sql.Date.valueOf("2022-01-01").toString(), rs.getDate("DateField").toString()); + assertEquals(Date.valueOf("2022-01-01").toString(), rs.getDate("DateField").toString()); // Time is represented independent of a specific date and timezone. For example a 12:11:35 (GMT) // is returned as // 17:11:35 (GMT+5:30) . So we need to adjust the offset @@ -615,15 +629,15 @@ private static void addBatchRecords(TableId tableId) { for (Map.Entry> entry : response.getInsertErrors().entrySet()) { logger.log(Level.WARNING, "Exception while adding records {0}", entry.getValue()); } - fail("Response has errors"); + throw new BigQueryException(0, "Response has errors"); } } catch (BigQueryException e) { logger.log(Level.WARNING, "Exception while adding records {0}", e); - fail("Error in addBatchRecords"); + throw new BigQueryException(0, "Error in addBatchRecords", e); } } - private static void createTable(String datasetName, String tableName, Schema schema) { + static void createTable(String datasetName, String tableName, Schema schema) { try { TableId tableId = TableId.of(datasetName, tableName); TableDefinition tableDefinition = StandardTableDefinition.of(schema); @@ -635,7 +649,7 @@ private static void createTable(String datasetName, String tableName, Schema sch } } - public static void deleteTable(String datasetName, String tableName) { + static void deleteTable(String datasetName, String tableName) { try { assertTrue(bigquery.delete(TableId.of(datasetName, tableName))); } catch (BigQueryException e) { @@ -643,7 +657,7 @@ public static void deleteTable(String datasetName, String tableName) { } } - public static void createDataset(String datasetName) { + static void createDataset(String datasetName) { try { DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); Dataset newDataset = bigquery.create(datasetInfo); @@ -653,7 +667,7 @@ public static void createDataset(String datasetName) { } } - public static void deleteDataset(String datasetName) { + static void deleteDataset(String datasetName) { try { DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName).build(); assertTrue(bigquery.delete(datasetInfo.getDatasetId())); @@ -663,7 +677,6 @@ public static void deleteDataset(String datasetName) { } private Connection getConnection() { - ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() .setDefaultDataset(DatasetId.of(DATASET)) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java index 7a3194e525..6598d08357 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java @@ -15,8 +15,8 @@ */ package com.google.cloud.bigquery.it; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import com.google.cloud.ServiceOptions; import com.google.cloud.bigquery.BigQuery; @@ -39,11 +39,11 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class ITRemoteUDFTest { +class ITRemoteUDFTest { private static final String ID = UUID.randomUUID().toString().substring(0, 8); private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); @@ -56,8 +56,8 @@ public class ITRemoteUDFTest { private static Connection connection; private static BigQuery bigquery; - @Before - public void setUp() throws IOException { + @BeforeEach + void setUp() throws IOException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); bigquery = bigqueryHelper.getOptions().getService(); client = ConnectionServiceClient.create(); @@ -76,8 +76,8 @@ public void setUp() throws IOException { connection = client.createConnection(request); } - @AfterClass - public static void afterClass() { + @AfterAll + static void afterClass() { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); } @@ -89,7 +89,7 @@ public static void afterClass() { } @Test - public void testRoutineRemoteUDF() { + void testRoutineRemoteUDF() { String routineName = RemoteBigQueryHelper.generateRoutineName(); RoutineId routineId = RoutineId.of(ROUTINE_DATASET, routineName); Map userDefinedContext = diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java index eec39f633f..3968cd05e2 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/spi/v2/HttpBigQueryRpcTest.java @@ -21,7 +21,7 @@ import com.google.api.services.bigquery.model.DatasetList; import com.google.api.services.bigquery.model.DatasetReference; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class HttpBigQueryRpcTest { @Test diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java index 5aadd11e33..589f7ccda0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java @@ -16,8 +16,8 @@ package com.google.cloud.bigquery.testing; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQuery.DatasetDeleteOption; @@ -27,12 +27,12 @@ import java.io.InputStream; import java.time.Duration; import java.util.concurrent.ExecutionException; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class RemoteBigQueryHelperTest { private static final String DATASET_NAME = "dataset-name"; diff --git a/pom.xml b/pom.xml index 4cded9553c..f99bb3f907 100644 --- a/pom.xml +++ b/pom.xml @@ -110,12 +110,6 @@ - - junit - junit - 4.13.2 - test - com.google.truth truth @@ -128,12 +122,6 @@ - - org.mockito - mockito-core - 4.11.0 - test - com.google.cloud google-cloud-storage @@ -152,6 +140,13 @@ 2.70.0 test + + org.mockito + mockito-bom + 4.11.0 + pom + import + From ffb0fdfbbb8ed08c8e221e68544f3076e90c0039 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 9 Jan 2026 13:24:25 -0800 Subject: [PATCH 2220/2268] chore: move Google JDBC driver code (#4050) --- google-cloud-bigquery-jdbc/pom.xml | 329 + .../BigQueryConversionException.java | 29 + .../BigQueryJdbcCoercionException.java | 36 + ...BigQueryJdbcCoercionNotFoundException.java | 40 + .../exception/BigQueryJdbcException.java | 76 + .../BigQueryJdbcRuntimeException.java | 48 + ...ryJdbcSqlFeatureNotSupportedException.java | 40 + .../BigQueryJdbcSqlSyntaxErrorException.java | 36 + .../bigquery/jdbc/BigQueryArrowArray.java | 105 + .../jdbc/BigQueryArrowBatchWrapper.java | 68 + .../bigquery/jdbc/BigQueryArrowResultSet.java | 492 ++ .../bigquery/jdbc/BigQueryArrowStruct.java | 87 + .../bigquery/jdbc/BigQueryBaseArray.java | 172 + .../bigquery/jdbc/BigQueryBaseResultSet.java | 618 ++ .../bigquery/jdbc/BigQueryBaseStruct.java | 97 + .../jdbc/BigQueryCallableStatement.java | 1341 +++++ .../cloud/bigquery/jdbc/BigQueryCoercion.java | 44 + .../bigquery/jdbc/BigQueryConnection.java | 1160 ++++ .../jdbc/BigQueryConnectionProperty.java | 117 + .../jdbc/BigQueryDaemonPollingTask.java | 122 + .../jdbc/BigQueryDatabaseMetaData.java | 5346 +++++++++++++++++ .../jdbc/BigQueryDefaultCoercions.java | 102 + .../cloud/bigquery/jdbc/BigQueryDriver.java | 249 + .../bigquery/jdbc/BigQueryErrorMessage.java | 29 + .../jdbc/BigQueryFieldValueListWrapper.java | 81 + .../jdbc/BigQueryJdbcBulkInsertWriter.java | 130 + .../jdbc/BigQueryJdbcCustomLogger.java | 32 + .../jdbc/BigQueryJdbcOAuthUtility.java | 759 +++ .../bigquery/jdbc/BigQueryJdbcParameter.java | 117 + .../jdbc/BigQueryJdbcProxyUtility.java | 291 + .../bigquery/jdbc/BigQueryJdbcRootLogger.java | 193 + .../jdbc/BigQueryJdbcTypeMappings.java | 159 + .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 920 +++ .../bigquery/jdbc/BigQueryJsonArray.java | 105 + .../bigquery/jdbc/BigQueryJsonResultSet.java | 317 + .../bigquery/jdbc/BigQueryJsonStruct.java | 80 + .../jdbc/BigQueryNoOpsConnection.java | 191 + .../bigquery/jdbc/BigQueryNoOpsResultSet.java | 693 +++ .../bigquery/jdbc/BigQueryNoOpsStatement.java | 90 + .../jdbc/BigQueryParameterHandler.java | 281 + .../jdbc/BigQueryPooledConnection.java | 497 ++ .../jdbc/BigQueryPreparedStatement.java | 611 ++ .../bigquery/jdbc/BigQueryResultSet.java | 46 + .../jdbc/BigQueryResultSetFinalizers.java | 73 + .../jdbc/BigQueryResultSetMetadata.java | 213 + .../cloud/bigquery/jdbc/BigQuerySettings.java | 857 +++ .../jdbc/BigQuerySqlTypeConverter.java | 81 + .../bigquery/jdbc/BigQueryStatement.java | 1522 +++++ .../bigquery/jdbc/BigQueryThreadFactory.java | 44 + .../bigquery/jdbc/BigQueryTypeCoercer.java | 149 + .../jdbc/BigQueryTypeCoercerBuilder.java | 79 + .../jdbc/BigQueryTypeCoercionUtility.java | 409 ++ .../cloud/bigquery/jdbc/DataSource.java | 664 ++ .../jdbc/PooledConnectionDataSource.java | 68 + .../jdbc/PooledConnectionListener.java | 145 + .../META-INF/services/java.sql.Driver | 1 + .../DatabaseMetaData_GetCrossReference.sql | 72 + .../jdbc/DatabaseMetaData_GetExportedKeys.sql | 71 + .../jdbc/DatabaseMetaData_GetImportedKeys.sql | 71 + .../jdbc/DatabaseMetaData_GetPrimaryKeys.sql | 30 + .../bigquery/jdbc/dependencies.properties | 4 + ...FormatTypeBigQueryCoercionUtilityTest.java | 234 + .../BigQueryArrowArrayOfPrimitivesTest.java | 367 ++ .../jdbc/BigQueryArrowArrayOfStructTest.java | 205 + .../jdbc/BigQueryArrowResultSetTest.java | 358 ++ .../jdbc/BigQueryArrowStructTest.java | 245 + .../jdbc/BigQueryBaseResultSetTest.java | 104 + ...igQueryBigQueryTypeCoercerBuilderTest.java | 43 + .../jdbc/BigQueryCallableStatementTest.java | 1118 ++++ .../bigquery/jdbc/BigQueryConnectionTest.java | 343 ++ .../jdbc/BigQueryDaemonPollingTaskTest.java | 63 + .../jdbc/BigQueryDatabaseMetaDataTest.java | 3209 ++++++++++ .../jdbc/BigQueryDefaultCoercionsTest.java | 221 + .../bigquery/jdbc/BigQueryDriverTest.java | 97 + .../bigquery/jdbc/BigQueryJdbcBaseTest.java | 82 + .../jdbc/BigQueryJdbcOAuthUtilityTest.java | 505 ++ .../jdbc/BigQueryJdbcParameterTest.java | 75 + .../jdbc/BigQueryJdbcProxyUtilityTest.java | 293 + .../jdbc/BigQueryJdbcUrlUtilityTest.java | 803 +++ .../BigQueryJsonArrayOfPrimitivesTest.java | 342 ++ .../jdbc/BigQueryJsonArrayOfStructTest.java | 204 + .../jdbc/BigQueryJsonResultSetTest.java | 476 ++ .../bigquery/jdbc/BigQueryJsonStructTest.java | 264 + .../jdbc/BigQueryParameterHandlerTest.java | 142 + .../jdbc/BigQueryPooledConnectionTest.java | 174 + .../jdbc/BigQueryResultSetFinalizersTest.java | 67 + .../jdbc/BigQueryResultSetMetadataTest.java | 277 + .../bigquery/jdbc/BigQueryStatementTest.java | 483 ++ .../jdbc/BigQueryThreadFactoryTest.java | 41 + .../jdbc/BigQueryTypeCoercerTest.java | 100 + ...dValueTypeBigQueryCoercionUtilityTest.java | 378 ++ .../cloud/bigquery/jdbc/NullHandlingTest.java | 44 + .../jdbc/PooledConnectionDataSourceTest.java | 80 + .../jdbc/PooledConnectionListenerTest.java | 172 + .../google/cloud/bigquery/jdbc/TestType.java | 31 + .../google/cloud/bigquery/jdbc/it/ITBase.java | 21 + .../bigquery/jdbc/it/ITBigQueryJDBCTest.java | 4439 ++++++++++++++ .../jdbc/it/ITNightlyBigQueryTest.java | 1713 ++++++ .../bigquery/jdbc/it/ITPSCBigQueryTest.java | 300 + .../bigquery/jdbc/it/ITProxyBigQueryTest.java | 234 + .../bigquery/jdbc/it/ITTPCBigQueryTest.java | 220 + .../bigquery/jdbc/rules/TimeZoneRule.java | 57 + .../bigquery/jdbc/utils/ArrowUtilities.java | 54 + .../bigquery/jdbc/utils/TestUtilities.java | 143 + .../cloud/bigquery/jdbc/utils/URIBuilder.java | 34 + .../src/test/resources/fake.p12 | Bin 0 -> 5223 bytes .../test/resources/test_truststore_nopass.jks | Bin 0 -> 32 bytes .../resources/test_truststore_withpass.jks | Bin 0 -> 1187 bytes 108 files changed, 39784 insertions(+) create mode 100644 google-cloud-bigquery-jdbc/pom.xml create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArray.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStruct.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseArray.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseStruct.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCoercion.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercions.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryErrorMessage.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBulkInsertWriter.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameter.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcTypeMappings.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArray.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStruct.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsConnection.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsResultSet.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsStatement.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSet.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadata.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySettings.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySqlTypeConverter.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerBuilder.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercionUtility.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java create mode 100644 google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/META-INF/services/java.sql.Driver create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetCrossReference.sql create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetExportedKeys.sql create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetImportedKeys.sql create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetPrimaryKeys.sql create mode 100644 google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/dependencies.properties create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/ArrowFormatTypeBigQueryCoercionUtilityTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfPrimitivesTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfStructTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStructTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSetTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBigQueryTypeCoercerBuilderTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatementTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercionsTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameterTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfPrimitivesTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfStructTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSetTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStructTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandlerTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizersTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadataTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactoryTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/FieldValueTypeBigQueryCoercionUtilityTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/NullHandlingTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/TestType.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBase.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITPSCBigQueryTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITProxyBigQueryTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITTPCBigQueryTest.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/rules/TimeZoneRule.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/ArrowUtilities.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/TestUtilities.java create mode 100644 google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/URIBuilder.java create mode 100644 google-cloud-bigquery-jdbc/src/test/resources/fake.p12 create mode 100644 google-cloud-bigquery-jdbc/src/test/resources/test_truststore_nopass.jks create mode 100644 google-cloud-bigquery-jdbc/src/test/resources/test_truststore_withpass.jks diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml new file mode 100644 index 0000000000..a697ba1017 --- /dev/null +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -0,0 +1,329 @@ + + + + 4.0.0 + com.google.cloud + google-cloud-bigquery-jdbc + 0.1.0 + jar + BigQuery JDBC + https://github.com/googleapis/java-bigquery-jdbc + JDBC for BigQuery + + + UTF-8 + UTF-8 + github + google-cloud-bigquery-jdbc + + + + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + ${skipSurefire} + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + + + + com.google.cloud + google-cloud-bigquery-jdbc-parent + 0.1.0 + + + + com.google.cloud + google-cloud-bigquery + + + com.google.cloud + google-cloud-bigquerystorage + + + com.google.api + api-common + + + org.apache.arrow + arrow-vector + + + com.google.guava + guava + + + com.google.cloud + google-cloud-core + + + com.google.api + gax + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.auth + google-auth-library-credentials + + + + + org.apache.arrow + arrow-memory-core + + + org.apache.arrow + arrow-memory-netty + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + + + com.google.code.gson + gson + + + com.google.code.findbugs + jsr305 + + + org.apache.httpcomponents.core5 + httpcore5 + + + org.apache.httpcomponents.client5 + httpclient5 + + + com.google.http-client + google-http-client + + + com.google.http-client + google-http-client-apache-v5 + + + org.apache.httpcomponents + httpcore + + + org.apache.httpcomponents + httpclient + + + + + com.google.cloud + google-cloud-core-http + + + com.google.api + gax-grpc + + + io.grpc + grpc-api + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-core + + + + com.google.truth + truth + 1.1.3 + test + + + junit + junit + 4.13.2 + test + + + org.mockito + mockito-core + 4.11.0 + test + + + + + + java17 + + [17,) + + + !jvm + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED + + + + + + + + + release-all-dependencies-shaded + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.2 + + + + + + com + shaded.bqjdbc.com + + com.google.cloud.bigquery.jdbc.* + + + + org + shaded.bqjdbc.org + + org.conscrypt.* + + + + io + shaded.bqjdbc.io + + + + + + + + + + + + release-all-dependencies + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.2 + + + package + + shade + + + false + + + java.base/java.nio=ALL-UNNAMED + + + + + + + META-INF/io.netty.versions.properties + + + + + *:* + + META-INF/LICENSE* + META-INF/NOTICE* + META-INF/DEPENDENCIES + META-INF/proguard/*.pro + META-INF/maven/** + META-INF/*.MF + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + arrow-git.properties + + + + + + + + + + + + + + docker + + + env.JDBC_DOCKER_ENV + + + + + /mvn/test-target + + + + \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java new file mode 100644 index 0000000000..90e758b05e --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java @@ -0,0 +1,29 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import java.sql.SQLException; + +/** + * Exception for errors that occur when the driver cannot convert a value from one type to another. + */ +public class BigQueryConversionException extends SQLException { + + public BigQueryConversionException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java new file mode 100644 index 0000000000..185ef54bb1 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import com.google.api.core.InternalApi; + +/** + * Thrown to indicate that the coercion was attempted but couldn't be performed successfully because + * of some error. + */ +@InternalApi +public class BigQueryJdbcCoercionException extends RuntimeException { + + /** + * Construct a new exception with the specified cause. + * + * @param cause the actual cause which was thrown while performing the coercion. + */ + public BigQueryJdbcCoercionException(Exception cause) { + super("Coercion error", cause); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java new file mode 100644 index 0000000000..b4eafb2ee5 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import com.google.api.core.InternalApi; + +/** + * Thrown to indicate that the current TypeCoercer can not perform the coercion as the Coercion + * implementation is not registered for the mentioned source and target type. + */ +@InternalApi +public class BigQueryJdbcCoercionNotFoundException extends RuntimeException { + + /** + * Construct a new exception. + * + * @param source the source type. + * @param target the target type. + */ + public BigQueryJdbcCoercionNotFoundException(Class source, Class target) { + super( + String.format( + "Coercion not found for [%s -> %s] conversion", + source.getCanonicalName(), target.getCanonicalName())); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java new file mode 100644 index 0000000000..72a22aba61 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java @@ -0,0 +1,76 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import com.google.cloud.bigquery.BigQueryException; +import java.sql.SQLException; + +public class BigQueryJdbcException extends SQLException { + private BigQueryException bigQueryException = null; + + /** + * Constructs a new BigQueryJdbcException with the given message. + * + * @param message The detail message. + */ + public BigQueryJdbcException(String message) { + super(message); + } + + /** + * Constructs a new BigQueryJdbcException from InterruptedException + * + * @param ex The InterruptedException to be thrown. + */ + public BigQueryJdbcException(InterruptedException ex) { + super(ex); + } + + /** + * Constructs a new BigQueryJdbcException from BigQueryException + * + * @param ex The BigQueryException to be thrown. + */ + public BigQueryJdbcException(BigQueryException ex) { + super(ex); + this.bigQueryException = ex; + } + + /** + * Construct a new BigQueryJdbcException with the cause. + * + * @param message Specific message that is being added to the Exception. + * @param cause Throwable that is being converted. + */ + public BigQueryJdbcException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructs a new BigQueryJdbcException with the specified cause and a detail message of + * (cause==null ? null : cause.toString()) + * + * @param cause Throwable that is being converted. + */ + public BigQueryJdbcException(Throwable cause) { + super(cause); + } + + public BigQueryException getBigQueryException() { + return bigQueryException; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java new file mode 100644 index 0000000000..38e5171be4 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +public class BigQueryJdbcRuntimeException extends RuntimeException { + + /** + * Constructs a new BigQueryJdbcRuntimeException with the given message. + * + * @param message The detail message. + */ + public BigQueryJdbcRuntimeException(String message) { + super(message); + } + + /** + * Constructs a new BigQueryJdbcRuntimeException from a Throwable exception. + * + * @param ex Throwable to be thrown. + */ + public BigQueryJdbcRuntimeException(Throwable ex) { + super(ex); + } + + /** + * Constructs a new BigQueryJdbcRuntimeException from a Throwable exception and a message. + * + * @param message The detail message. + * @param ex Throwable to be thrown. + */ + public BigQueryJdbcRuntimeException(String message, InterruptedException ex) { + super(message, ex); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java new file mode 100644 index 0000000000..8c93d8764b --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java @@ -0,0 +1,40 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import com.google.cloud.bigquery.BigQueryException; +import java.sql.SQLFeatureNotSupportedException; + +public class BigQueryJdbcSqlFeatureNotSupportedException extends SQLFeatureNotSupportedException { + /** + * Constructs a new BigQueryJdbcSqlFeatureNotSupportedException with the given message. + * + * @param message The detail message. + */ + public BigQueryJdbcSqlFeatureNotSupportedException(String message) { + super(message); + } + + /** + * Constructs a new BigQueryJdbcSqlFeatureNotSupportedException from BigQueryException + * + * @param ex The BigQueryException to be thrown. + */ + public BigQueryJdbcSqlFeatureNotSupportedException(BigQueryException ex) { + super(ex); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java new file mode 100644 index 0000000000..99edcd0c54 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.exception; + +import com.google.cloud.bigquery.BigQueryException; +import java.sql.SQLSyntaxErrorException; + +/** + * Specific {@link SQLSyntaxErrorException} thrown when the SQLState class value is '42', or under + * vendor-specified conditions. This indicates that the in-progress query has violated SQL syntax + * rules. + */ +public class BigQueryJdbcSqlSyntaxErrorException extends SQLSyntaxErrorException { + /** + * Constructs a new BigQueryJdbcSqlSyntaxErrorException from BigQueryException + * + * @param ex The BigQueryException to be thrown. + */ + public BigQueryJdbcSqlSyntaxErrorException(BigQueryException ex) { + super(ex.getMessage(), "Incorrect SQL syntax."); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArray.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArray.java new file mode 100644 index 0000000000..49bd565df7 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArray.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import java.sql.ResultSet; +import java.sql.SQLException; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; + +/** + * An implementation of {@link BigQueryBaseArray} used to represent Array values from Arrow data. + */ +class BigQueryArrowArray extends BigQueryBaseArray { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryArrowArray.class.getName()); + private static final BigQueryTypeCoercer BIGQUERY_TYPE_COERCER = + BigQueryTypeCoercionUtility.INSTANCE; + private JsonStringArrayList values; + + public BigQueryArrowArray(Field schema, JsonStringArrayList values) { + super(schema); + this.values = values; + } + + @Override + public Object getArray() { + LOG.finest("++enter++"); + ensureValid(); + if (values == null) { + return null; + } + return getArrayInternal(0, values.size()); + } + + @Override + public Object getArray(long index, int count) { + LOG.finest("++enter++"); + ensureValid(); + if (values == null) { + return null; + } + Tuple range = createRange(index, count, this.values.size()); + return getArrayInternal(range.x(), range.y()); + } + + @Override + public ResultSet getResultSet() throws SQLException { + LOG.finest("++enter++"); + ensureValid(); + if (values == null) { + return new BigQueryArrowResultSet(); + } + BigQueryArrowBatchWrapper arrowBatchWrapper = + BigQueryArrowBatchWrapper.getNestedFieldValueListWrapper(values); + return BigQueryArrowResultSet.getNestedResultSet( + Schema.of(singleElementSchema()), arrowBatchWrapper, 0, this.values.size()); + } + + @Override + public ResultSet getResultSet(long index, int count) throws SQLException { + LOG.finest("++enter++"); + ensureValid(); + if (values == null) { + return new BigQueryArrowResultSet(); + } + Tuple range = createRange(index, count, this.values.size()); + BigQueryArrowBatchWrapper arrowBatchWrapper = + BigQueryArrowBatchWrapper.getNestedFieldValueListWrapper(values); + return BigQueryArrowResultSet.getNestedResultSet( + Schema.of(singleElementSchema()), arrowBatchWrapper, range.x(), range.y()); + } + + @Override + public void free() { + LOG.finest("++enter++"); + this.values = null; + markInvalid(); + } + + @Override + Object getCoercedValue(int index) { + LOG.finest("++enter++"); + Object value = this.values.get(index); + return this.arrayOfStruct + ? new BigQueryArrowStruct(schema.getSubFields(), (JsonStringHashMap) value) + : BIGQUERY_TYPE_COERCER.coerceTo(getTargetClass(), value); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java new file mode 100644 index 0000000000..4d322ad977 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java @@ -0,0 +1,68 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; +import org.apache.arrow.vector.util.JsonStringArrayList; + +/** This class acts as a facade layer and wraps Arrow's VectorSchemaRoot & JsonStringArrayList */ +class BigQueryArrowBatchWrapper { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryArrowBatchWrapper.class.getName()); + // Reference to the current arrowBatch + private final ArrowRecordBatch currentArrowBatch; + // Reference to the nested Records, set as null otherwise (Arrays) + private final JsonStringArrayList nestedRecords; + + // Marks the end of the stream for the ResultSet + private final boolean isLast; + + private BigQueryArrowBatchWrapper( + ArrowRecordBatch currentArrowBatch, JsonStringArrayList nestedRecords, boolean isLast) { + this.currentArrowBatch = currentArrowBatch; + this.nestedRecords = nestedRecords; + this.isLast = isLast; + } + + static BigQueryArrowBatchWrapper of(ArrowRecordBatch currentArrowBatch, boolean... isLast) { + LOG.finest("++enter++"); + boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; + return new BigQueryArrowBatchWrapper(currentArrowBatch, null, isLastFlag); + } + + static BigQueryArrowBatchWrapper getNestedFieldValueListWrapper( + JsonStringArrayList nestedRecords, boolean... isLast) { + LOG.finest("++enter++"); + boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; + return new BigQueryArrowBatchWrapper(null, nestedRecords, isLastFlag); + } + + ArrowRecordBatch getCurrentArrowBatch() { + LOG.finest("++enter++"); + return this.currentArrowBatch; + } + + JsonStringArrayList getNestedRecords() { + LOG.finest("++enter++"); + return this.nestedRecords; + } + + boolean isLast() { + LOG.finest("++enter++"); + return this.isLast; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java new file mode 100644 index 0000000000..004dfb02b4 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java @@ -0,0 +1,492 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryBaseArray.isArray; +import static com.google.cloud.bigquery.jdbc.BigQueryBaseStruct.isStruct; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; +import com.google.cloud.bigquery.storage.v1.ArrowSchema; +import java.io.IOException; +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import org.apache.arrow.memory.BufferAllocator; +import org.apache.arrow.memory.RootAllocator; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.VectorLoader; +import org.apache.arrow.vector.VectorSchemaRoot; +import org.apache.arrow.vector.ipc.ReadChannel; +import org.apache.arrow.vector.ipc.message.MessageSerializer; +import org.apache.arrow.vector.util.ByteArrayReadableSeekableByteChannel; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; + +/** {@link ResultSet} Implementation for Arrow datasource (Using Storage Read APIs) */ +class BigQueryArrowResultSet extends BigQueryBaseResultSet { + private final long totalRows; + // count of rows read by the current instance of ResultSet + private long rowCount = 0; + // IMP: This is a buffer of Arrow batches, the max size should be kept at min as + // possible to avoid holding too much memory + private final BlockingQueue buffer; + + // TODO(neenu): See if it makes sense to have the nested batch represented by + // 'JsonStringArrayList' directly + // points to the nested batch of arrow record + private final BigQueryArrowBatchWrapper currentNestedBatch; + private final int fromIndex; + private final int toIndexExclusive; + + // Acts as a cursor, resets to -1 when the `currentBatch` is processed. points to a + // logical row in the columnar BigQueryBigQueryArrowBatchWrapper currentBatch + private int currentBatchRowIndex = -1; + private boolean hasReachedEnd = false; + + // Tracks the index of the nested element under process + private int nestedRowIndex; + + private boolean afterLast = false; + + private ArrowDeserializer arrowDeserializer; + BufferAllocator allocator = new RootAllocator(Long.MAX_VALUE); + // Decoder object will be reused to avoid re-allocation and too much garbage collection. + private VectorSchemaRoot vectorSchemaRoot; + private VectorLoader vectorLoader; + // producer thread's reference + private final Thread ownedThread; + + private BigQueryArrowResultSet( + Schema schema, + ArrowSchema arrowSchema, + long totalRows, + BigQueryStatement statement, + BlockingQueue buffer, + BigQueryArrowBatchWrapper currentNestedBatch, + boolean isNested, + int fromIndex, + int toIndexExclusive, + Thread ownedThread, + BigQuery bigQuery) + throws SQLException { + super(bigQuery, statement, schema, isNested); + LOG.finest("++enter++"); + this.totalRows = totalRows; + this.buffer = buffer; + this.currentNestedBatch = currentNestedBatch; + this.fromIndex = fromIndex; + this.toIndexExclusive = toIndexExclusive; + this.nestedRowIndex = fromIndex - 1; + this.ownedThread = ownedThread; + if (!isNested && arrowSchema != null) { + try { + this.arrowDeserializer = new ArrowDeserializer(arrowSchema); + } catch (IOException ex) { + throw new BigQueryJdbcException(ex); + } + } + } + + /** + * This method returns an instance of BigQueryArrowResultSet after adding it in the list of + * ArrowResultSetFinalizer + * + * @return BigQueryArrowResultSet + */ + static BigQueryArrowResultSet of( + Schema schema, + ArrowSchema arrowSchema, + long totalRows, + BigQueryStatement statement, + BlockingQueue buffer, + Thread ownedThread, + BigQuery bigQuery) + throws SQLException { + return new BigQueryArrowResultSet( + schema, + arrowSchema, + totalRows, + statement, + buffer, + null, + false, + -1, + -1, + ownedThread, + bigQuery); + } + + BigQueryArrowResultSet() throws SQLException { + super(null, null, null, false); + this.totalRows = 0; + this.buffer = null; + this.currentNestedBatch = null; + this.fromIndex = 0; + this.toIndexExclusive = 0; + this.ownedThread = null; + this.arrowDeserializer = null; + this.vectorSchemaRoot = null; + this.vectorLoader = null; + } + + static BigQueryArrowResultSet getNestedResultSet( + Schema schema, BigQueryArrowBatchWrapper nestedBatch, int fromIndex, int toIndexExclusive) + throws SQLException { + return new BigQueryArrowResultSet( + schema, null, -1, null, null, nestedBatch, true, fromIndex, toIndexExclusive, null, null); + } + + private class ArrowDeserializer implements AutoCloseable { + + /* Decoder object will be reused to avoid re-allocation and too much garbage collection. */ + private ArrowDeserializer(ArrowSchema arrowSchema) throws IOException { + org.apache.arrow.vector.types.pojo.Schema schema = + MessageSerializer.deserializeSchema( + new org.apache.arrow.vector.ipc.ReadChannel( + new ByteArrayReadableSeekableByteChannel( + arrowSchema.getSerializedSchema().toByteArray()))); + List vectors = new ArrayList<>(); + List fields = schema.getFields(); + for (org.apache.arrow.vector.types.pojo.Field field : fields) { + vectors.add(field.createVector(allocator)); + } + vectorSchemaRoot = new VectorSchemaRoot(vectors); + vectorLoader = new VectorLoader(vectorSchemaRoot); + } + + private void deserializeArrowBatch(ArrowRecordBatch batch) throws SQLException { + LOG.finest("++enter++"); + try { + if (vectorSchemaRoot != null) { + // Clear vectorSchemaRoot before populating a new batch + vectorSchemaRoot.clear(); + } + org.apache.arrow.vector.ipc.message.ArrowRecordBatch deserializedBatch = + MessageSerializer.deserializeRecordBatch( + new ReadChannel( + new ByteArrayReadableSeekableByteChannel( + batch.getSerializedRecordBatch().toByteArray())), + allocator); + + vectorLoader.load(deserializedBatch); + // Release buffers from batch (they are still held in the vectors in root). + deserializedBatch.close(); + } catch (RuntimeException | IOException ex) { + throw new BigQueryJdbcException(ex); + } + } + + @Override + public void close() { + LOG.finest("++enter++"); + vectorSchemaRoot.close(); + allocator.close(); + } + } + + @Override + public boolean next() throws SQLException { + checkClosed(); + if (this.isNested) { + if (this.currentNestedBatch == null || this.currentNestedBatch.getNestedRecords() == null) { + throw new IllegalStateException( + "currentNestedBatch/JsonStringArrayList can not be null working with the nested record"); + } + if (this.nestedRowIndex < (this.toIndexExclusive - 1)) { + /* Check if there's a next record in the array which can be read */ + this.nestedRowIndex++; + return true; + } + this.afterLast = true; + return false; + } else { + /* Non nested */ + if (this.hasReachedEnd || this.isLast()) { + this.afterLast = true; + return false; + } + try { + if (this.currentBatchRowIndex == -1 + || this.currentBatchRowIndex == (this.vectorSchemaRoot.getRowCount() - 1)) { + /* Start of iteration or we have exhausted the current batch */ + // Advance the cursor. Potentially blocking operation. + BigQueryArrowBatchWrapper batchWrapper = this.buffer.take(); + if (batchWrapper.isLast()) { + /* Marks the end of the records */ + if (this.vectorSchemaRoot != null) { + // IMP: To avoid memory leak: clear vectorSchemaRoot as it still holds + // the last batch + this.vectorSchemaRoot.clear(); + } + this.hasReachedEnd = true; + this.rowCount++; + return false; + } + // Valid batch, process it + ArrowRecordBatch arrowBatch = batchWrapper.getCurrentArrowBatch(); + // Populates vectorSchemaRoot + this.arrowDeserializer.deserializeArrowBatch(arrowBatch); + // Pointing to the first row in this fresh batch + this.currentBatchRowIndex = 0; + this.rowCount++; + return true; + } + // There are rows left in the current batch. + else if (this.currentBatchRowIndex < this.vectorSchemaRoot.getRowCount()) { + this.currentBatchRowIndex++; + this.rowCount++; + return true; + } + } catch (InterruptedException | SQLException ex) { + throw new BigQueryJdbcException( + "Error occurred while advancing the cursor. This could happen when connection is closed while the next method is being called.", + ex); + } + } + return false; + } + + private Object getObjectInternal(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + Object value; + if (this.isNested) { + // BigQuery doesn't support multidimensional arrays, so + // just the default row num column (1) and the actual column (2) is supposed to be read + if (!(columnIndex == 1 || columnIndex == 2)) { + + throw new IllegalArgumentException( + "Column index is required to be 1 or 2 for nested arrays"); + } + if (this.currentNestedBatch.getNestedRecords() == null) { + throw new IllegalStateException("JsonStringArrayList cannot be null for nested records."); + } + // For Arrays the first column is Index, ref: + // https://docs.oracle.com/javase/7/docs/api/java/sql/Array.html#getResultSet() + if (columnIndex == 1) { + return this.nestedRowIndex + 1; + } + // columnIndex = 2, return the data against the current nestedRowIndex + else { + value = this.currentNestedBatch.getNestedRecords().get(this.nestedRowIndex); + } + } else { + // get the current column + // SQL index to Java Index + FieldVector currentColumn = this.vectorSchemaRoot.getVector(columnIndex - 1); + // get the current row + value = currentColumn.getObject(this.currentBatchRowIndex); + } + setWasNull(value); + return value; + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + + // columnIndex is SQL index starting at 1 + LOG.finest("++enter++"); + checkClosed(); + Object value = getObjectInternal(columnIndex); + if (value == null) { + return null; + } + + if (this.isNested && columnIndex == 1) { + return this.bigQueryTypeCoercer.coerceTo(Integer.class, value); + } + + if (this.isNested && columnIndex == 2) { + Field arrayField = this.schema.getFields().get(0); + if (isStruct(arrayField)) { + return new BigQueryArrowStruct(arrayField.getSubFields(), (JsonStringHashMap) value); + } + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + arrayField.getType().getStandardType()); + return this.bigQueryTypeCoercer.coerceTo(targetClass, value); + } + + int fieldIndex = this.isNested ? 0 : columnIndex - 1; + Field fieldSchema = this.schemaFieldList.get(fieldIndex); + if (isArray(fieldSchema)) { + JsonStringArrayList originalList = (JsonStringArrayList) value; + StandardSQLTypeName elementTypeName = fieldSchema.getType().getStandardType(); + if (elementTypeName == StandardSQLTypeName.NUMERIC + || elementTypeName == StandardSQLTypeName.BIGNUMERIC) { + JsonStringArrayList newList = new JsonStringArrayList<>(); + for (Object item : originalList) { + if (item != null) { + newList.add(((BigDecimal) item).stripTrailingZeros()); + } else { + newList.add(null); + } + } + return new BigQueryArrowArray(fieldSchema, newList); + } else if (elementTypeName == StandardSQLTypeName.RANGE) { + JsonStringArrayList newList = new JsonStringArrayList<>(); + for (Object item : originalList) { + if (item != null) { + JsonStringHashMap rangeMap = (JsonStringHashMap) item; + Object start = rangeMap.get("start"); + Object end = rangeMap.get("end"); + + Object representativeElement = (start != null) ? start : end; + StandardSQLTypeName rangeElementType = getElementTypeFromValue(representativeElement); + + String formattedStart = formatRangeElement(start, rangeElementType); + String formattedEnd = formatRangeElement(end, rangeElementType); + + newList.add(String.format("[%s, %s)", formattedStart, formattedEnd)); + } else { + newList.add(null); + } + } + return new BigQueryArrowArray(fieldSchema, newList); + } + return new BigQueryArrowArray(fieldSchema, originalList); + } else if (isStruct(fieldSchema)) { + return new BigQueryArrowStruct(fieldSchema.getSubFields(), (JsonStringHashMap) value); + } else if (fieldSchema.getType().getStandardType() == StandardSQLTypeName.RANGE) { + JsonStringHashMap rangeMap = (JsonStringHashMap) value; + Object start = rangeMap.get("start"); + Object end = rangeMap.get("end"); + + Object representativeElement = (start != null) ? start : end; + StandardSQLTypeName elementType = getElementTypeFromValue(representativeElement); + + String formattedStart = formatRangeElement(start, elementType); + String formattedEnd = formatRangeElement(end, elementType); + + return String.format("[%s, %s)", formattedStart, formattedEnd); + } else { + if ((fieldSchema.getType().getStandardType() == StandardSQLTypeName.NUMERIC + || fieldSchema.getType().getStandardType() == StandardSQLTypeName.BIGNUMERIC) + && value instanceof BigDecimal) { + // The Arrow DecimalVector may return a BigDecimal with a larger scale than necessary. + // Strip trailing zeros to match JSON API and CLI output + return ((BigDecimal) value).stripTrailingZeros(); + } + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + fieldSchema.getType().getStandardType()); + return this.bigQueryTypeCoercer.coerceTo(targetClass, value); + } + } + + private StandardSQLTypeName getElementTypeFromValue(Object element) { + if (element == null) { + return StandardSQLTypeName.STRING; + } + if (element instanceof Integer) { + return StandardSQLTypeName.DATE; + } + if (element instanceof Long) { + return StandardSQLTypeName.TIMESTAMP; + } + if (element instanceof LocalDateTime) { + return StandardSQLTypeName.DATETIME; + } + return StandardSQLTypeName.STRING; + } + + private String formatRangeElement(Object element, StandardSQLTypeName elementType) { + if (element == null) { + return "UNBOUNDED"; + } + switch (elementType) { + case DATE: + // Arrow gives DATE as an Integer (days since epoch) + Date date = this.bigQueryTypeCoercer.coerceTo(Date.class, (Integer) element); + return date.toString(); + case DATETIME: + // Arrow gives DATETIME as a LocalDateTime + Timestamp dtTs = + this.bigQueryTypeCoercer.coerceTo(Timestamp.class, (LocalDateTime) element); + return this.bigQueryTypeCoercer.coerceTo(String.class, dtTs); + case TIMESTAMP: + // Arrow gives TIMESTAMP as a Long (microseconds since epoch) + Timestamp ts = this.bigQueryTypeCoercer.coerceTo(Timestamp.class, (Long) element); + return this.bigQueryTypeCoercer.coerceTo(String.class, ts); + default: + // Fallback for any other unexpected type + return element.toString(); + } + } + + @Override + public void close() { + LOG.fine(String.format("Closing BigqueryArrowResultSet %s.", this)); + this.isClosed = true; + if (ownedThread != null && !ownedThread.isInterrupted()) { + // interrupt the producer thread when result set is closed + ownedThread.interrupt(); + } + super.close(); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (this.isNested) { + return this.nestedRowIndex < this.fromIndex; + } else { + return this.rowCount == 0; + } + } + + @Override + public boolean isAfterLast() throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + return this.afterLast; + } + + @Override + public boolean isFirst() throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (this.isNested) { + return this.nestedRowIndex == this.fromIndex; + } else { + return this.rowCount == 1; + } + } + + @Override + public boolean isLast() throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (this.isNested) { + return this.nestedRowIndex == this.toIndexExclusive - 1; + } else { + return this.rowCount == this.totalRows; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStruct.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStruct.java new file mode 100644 index 0000000000..33befe902b --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStruct.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryBaseArray.isArray; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.List; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; + +/** + * An implementation of {@link BigQueryBaseStruct} used to represent Struct values from Arrow data. + */ +class BigQueryArrowStruct extends BigQueryBaseStruct { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryArrowStruct.class.getName()); + + private static final BigQueryTypeCoercer BIGQUERY_TYPE_COERCER = + BigQueryTypeCoercionUtility.INSTANCE; + + private final FieldList schema; + + private final JsonStringHashMap values; + + BigQueryArrowStruct(FieldList schema, JsonStringHashMap values) { + this.schema = schema; + this.values = values; + } + + @Override + FieldList getSchema() { + return this.schema; + } + + @Override + public Object[] getAttributes() { + LOG.finest("++enter++"); + int size = this.schema.size(); + Object[] attributes = (Object[]) Array.newInstance(Object.class, size); + + if (this.values == null) { + return attributes; + } + List structValues = new ArrayList<>(this.values.values()); + + for (int index = 0; index < size; index++) { + Field currentSchema = this.schema.get(index); + Object currentValue = structValues.get(index); + Object coercedValue = getValue(currentSchema, currentValue); + Array.set(attributes, index, coercedValue); + } + return attributes; + } + + private Object getValue(Field currentSchema, Object currentValue) { + LOG.finest("++enter++"); + if (isArray(currentSchema)) { + return new BigQueryArrowArray(currentSchema, (JsonStringArrayList) currentValue); + } else if (isStruct(currentSchema)) { + return new BigQueryArrowStruct( + currentSchema.getSubFields(), (JsonStringHashMap) currentValue); + } else { + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + currentSchema.getType().getStandardType()); + return BIGQUERY_TYPE_COERCER.coerceTo(targetClass, currentValue); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseArray.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseArray.java new file mode 100644 index 0000000000..5fc2c15bbe --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseArray.java @@ -0,0 +1,172 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.Field.Mode.REPEATED; +import static com.google.cloud.bigquery.jdbc.BigQueryBaseStruct.isStruct; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.INVALID_ARRAY; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.lang.reflect.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Struct; +import java.util.Arrays; +import java.util.Base64; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * An abstract implementation of {@link java.sql.Array} used as a base class for {@link + * BigQueryArrowArray} and {@link BigQueryJsonArray}. An Array value is a transaction-duration + * reference to an SQL ARRAY value. + */ +abstract class BigQueryBaseArray implements java.sql.Array { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryBaseArray.class.getName()); + + protected final boolean arrayOfStruct; + private boolean valid; + protected Field schema; + + BigQueryBaseArray(Field schema) { + this.schema = schema; + this.arrayOfStruct = isStruct(schema); + this.valid = true; + } + + @Override + public final String getBaseTypeName() { + LOG.finest("++enter++"); + ensureValid(); + return this.schema.getType().getStandardType().name(); + } + + @Override + public final int getBaseType() { + LOG.finest("++enter++"); + ensureValid(); + return BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.get( + schema.getType().getStandardType()); + } + + @Override + public final Object getArray(Map> map) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Override + public final Object getArray(long index, int count, Map> map) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Override + public final ResultSet getResultSet(Map> map) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Override + public final ResultSet getResultSet(long index, int count, Map> map) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + protected Object getArrayInternal(int fromIndex, int toIndexExclusive) { + LOG.finest("++enter++"); + Class targetClass = getTargetClass(); + int size = toIndexExclusive - fromIndex; + Object javaArray = Array.newInstance(targetClass, size); + + for (int index = 0; index < size; index++) { + Array.set(javaArray, index, getCoercedValue(fromIndex + index)); + } + return javaArray; + } + + protected void ensureValid() throws IllegalStateException { + LOG.finest("++enter++"); + if (!this.valid) { + throw new IllegalStateException(INVALID_ARRAY); + } + } + + protected void markInvalid() { + LOG.finest("++enter++"); + this.schema = null; + this.valid = false; + } + + protected Field singleElementSchema() { + LOG.finest("++enter++"); + return this.schema.toBuilder().setMode(Mode.REQUIRED).build(); + } + + protected Tuple createRange(long index, int count, int size) + throws IllegalStateException { + LOG.finest("++enter++"); + // jdbc array follows 1 based array indexing + long normalisedFromIndex = index - 1; + if (normalisedFromIndex + count > size) { + throw new IllegalArgumentException( + String.format( + "The array index is out of range: %d, number of elements: %d.", index + count, size)); + } + long toIndex = normalisedFromIndex + count; + return Tuple.of((int) normalisedFromIndex, (int) toIndex); + } + + protected Class getTargetClass() { + LOG.finest("++enter++"); + return this.arrayOfStruct + ? Struct.class + : BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + this.schema.getType().getStandardType()); + } + + abstract Object getCoercedValue(int index); + + static boolean isArray(Field currentSchema) { + LOG.finest("++enter++"); + return currentSchema.getMode() == REPEATED; + } + + @Override + public String toString() { + try { + Object[] array = (Object[]) getArray(); + if (array == null) { + return "null"; + } + if (this.schema.getType().getStandardType() == StandardSQLTypeName.BYTES) { + return Arrays.stream(array) + .map( + element -> + element == null ? "null" : Base64.getEncoder().encodeToString((byte[]) element)) + .collect(Collectors.joining(", ", "[", "]")); + } + return Arrays.deepToString(array); + } catch (SQLException e) { + return "[Error converting array to string: " + e.getMessage() + "]"; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java new file mode 100644 index 0000000000..7367a81536 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java @@ -0,0 +1,618 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryConversionException; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionException; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionNotFoundException; +import java.io.InputStream; +import java.io.Reader; +import java.io.StringReader; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Calendar; + +public abstract class BigQueryBaseResultSet extends BigQueryNoOpsResultSet + implements BigQueryResultSet { + protected final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private BigQuery bigQuery; + private JobId jobId; + private String queryId; + private QueryStatistics queryStatistics; + protected final BigQueryStatement statement; + protected final Schema schema; + protected final FieldList schemaFieldList; + protected final boolean isNested; + protected boolean isClosed = false; + protected boolean wasNull = false; + protected final BigQueryTypeCoercer bigQueryTypeCoercer = BigQueryTypeCoercionUtility.INSTANCE; + + protected BigQueryBaseResultSet( + BigQuery bigQuery, BigQueryStatement statement, Schema schema, boolean isNested) { + this.bigQuery = bigQuery; + this.statement = statement; + this.schema = schema; + this.schemaFieldList = schema != null ? schema.getFields() : null; + this.isNested = isNested; + } + + public QueryStatistics getQueryStatistics() { + if (queryStatistics != null) { + return queryStatistics; + } + if (jobId == null || bigQuery == null) { + return null; + } + Job job = bigQuery.getJob(jobId); + queryStatistics = job != null ? job.getStatistics() : null; + return queryStatistics; + } + + public void setJobId(JobId jobId) { + this.jobId = jobId; + } + + public JobId getJobId() { + return jobId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public String getQueryId() { + return queryId; + } + + @Override + public void close() { + try { + if (statement != null && statement.isCloseOnCompletion() && !statement.hasMoreResults()) { + statement.close(); + } + } catch (SQLException ex) { + LOG.warning( + String.format("Exception during ResultState.close() operation: %s", ex.getMessage())); + } + } + + protected SQLException createCoercionException( + int columnIndex, Class targetClass, Exception cause) throws SQLException { + checkClosed(); + StandardSQLTypeName type; + String typeName; + + if (isNested) { + if (columnIndex == 1) { + return new BigQueryConversionException( + String.format("Cannot convert index column to type %s.", targetClass.getSimpleName()), + cause); + } else if (columnIndex == 2) { + Field arrayField = this.schema.getFields().get(0); + type = arrayField.getType().getStandardType(); + typeName = type.name(); + } else { + throw new SQLException( + "For a nested ResultSet from an Array, columnIndex must be 1 or 2.", cause); + } + } else { + Field field = this.schemaFieldList.get(columnIndex - 1); + type = field.getType().getStandardType(); + typeName = type.name(); + } + return new BigQueryConversionException( + String.format( + "Cannot convert value of type %s to type %s.", typeName, targetClass.getSimpleName()), + cause); + } + + private StandardSQLTypeName getStandardSQLTypeName(int columnIndex) throws SQLException { + checkClosed(); + if (isNested) { + if (columnIndex == 1) { + return StandardSQLTypeName.INT64; + } else if (columnIndex == 2) { + if (this.schema == null || this.schema.getFields().isEmpty()) { + throw new SQLException("Schema not available for nested result set."); + } + Field arrayField = this.schema.getFields().get(0); + return arrayField.getType().getStandardType(); + } else { + throw new SQLException("For a nested ResultSet from an Array, columnIndex must be 1 or 2."); + } + } else { + if (this.schemaFieldList == null + || columnIndex > this.schemaFieldList.size() + || columnIndex < 1) { + throw new SQLException("Invalid column index: " + columnIndex); + } + Field field = this.schemaFieldList.get(columnIndex - 1); + return field.getType().getStandardType(); + } + } + + protected void setWasNull(Object val) { + this.wasNull = val == null; + } + + @Override + public boolean wasNull() throws SQLException { + checkClosed(); + return this.wasNull; + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + checkClosed(); + if (this.isNested) { + return BigQueryResultSetMetadata.of(this.schemaFieldList, this.statement); + } else { + return BigQueryResultSetMetadata.of(this.schema.getFields(), this.statement); + } + } + + @Override + public int getType() throws SQLException { + checkClosed(); + return ResultSet.TYPE_FORWARD_ONLY; + } + + @Override + public int getConcurrency() throws SQLException { + checkClosed(); + return ResultSet.CONCUR_READ_ONLY; + } + + @Override + public Statement getStatement() throws SQLException { + checkClosed(); + return this.statement; + } + + @Override + public int getHoldability() throws SQLException { + checkClosed(); + return ResultSet.HOLD_CURSORS_OVER_COMMIT; + } + + @Override + public boolean isClosed() { + return this.isClosed; + } + + public abstract Object getObject(int columnIndex) throws SQLException; + + protected int getColumnIndex(String columnLabel) throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (columnLabel == null) { + throw new SQLException("Column label cannot be null"); + } + // use schema to get the column index, add 1 for SQL index + return this.schemaFieldList.getIndex(columnLabel) + 1; + } + + @Override + public String getString(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(String.class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, String.class, e); + } + } + + @Override + public boolean getBoolean(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + + StandardSQLTypeName type = getStandardSQLTypeName(columnIndex); + if (type == StandardSQLTypeName.GEOGRAPHY + || type == StandardSQLTypeName.RANGE + || type == StandardSQLTypeName.JSON) { + throw createCoercionException(columnIndex, Boolean.class, null); + } + + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Boolean.class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, Boolean.class, e); + } + } + + @Override + public byte getByte(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Byte.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Byte.class, e); + } + } + + @Override + public short getShort(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Short.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Short.class, e); + } + } + + @Override + public int getInt(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Integer.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Integer.class, e); + } + } + + @Override + public long getLong(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Long.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Long.class, e); + } + } + + @Override + public float getFloat(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Float.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Float.class, e); + } + } + + @Override + public double getDouble(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(Double.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, Double.class, e); + } + } + + @Override + public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(BigDecimal.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, BigDecimal.class, e); + } + } + + @Override + public byte[] getBytes(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(byte[].class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, byte[].class, e); + } + } + + @Override + public Date getDate(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(java.sql.Date.class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, java.sql.Date.class, e); + } + } + + @Override + public Time getTime(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + StandardSQLTypeName type = getStandardSQLTypeName(columnIndex); + if (type == StandardSQLTypeName.INT64) { + throw createCoercionException(columnIndex, java.sql.Time.class, null); + } + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(java.sql.Time.class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, java.sql.Time.class, e); + } + } + + @Override + public Timestamp getTimestamp(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + StandardSQLTypeName type = getStandardSQLTypeName(columnIndex); + if (type == StandardSQLTypeName.INT64) { + throw createCoercionException(columnIndex, java.sql.Timestamp.class, null); + } + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(java.sql.Timestamp.class, value); + } catch (BigQueryJdbcCoercionNotFoundException e) { + throw createCoercionException(columnIndex, java.sql.Timestamp.class, e); + } + } + + @Override + public BigDecimal getBigDecimal(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + Object value = getObject(columnIndex); + return this.bigQueryTypeCoercer.coerceTo(BigDecimal.class, value); + } catch (BigQueryJdbcCoercionNotFoundException | BigQueryJdbcCoercionException e) { + throw createCoercionException(columnIndex, BigDecimal.class, e); + } + } + + @Override + public Array getArray(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + try { + return (Array) getObject(columnIndex); + } catch (ClassCastException e) { + throw createCoercionException(columnIndex, Array.class, e); + } + } + + @Override + public Blob getBlob(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + byte[] value = getBytes(columnIndex); + return new javax.sql.rowset.serial.SerialBlob(value); + } + + @Override + public Clob getClob(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + String value = getString(columnIndex); + return new javax.sql.rowset.serial.SerialClob(value.toCharArray()); + } + + @Override + public Reader getCharacterStream(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + String value = getString(columnIndex); + return value == null ? null : new StringReader(value); + } + + private InputStream getInputStream(String value, java.nio.charset.Charset charset) { + LOG.finest("++enter++"); + if (value == null) { + return null; + } + return new java.io.ByteArrayInputStream(value.getBytes(charset)); + } + + @Override + public InputStream getAsciiStream(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + return getInputStream(getString(columnIndex), StandardCharsets.US_ASCII); + } + + @Override + public InputStream getUnicodeStream(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + return getInputStream(getString(columnIndex), StandardCharsets.UTF_16LE); + } + + @Override + public InputStream getBinaryStream(int columnIndex) throws SQLException { + LOG.finest("++enter++"); + byte[] bytes = getBytes(columnIndex); + return bytes == null ? null : new java.io.ByteArrayInputStream(bytes); + } + + @Override + public Date getDate(int columnIndex, Calendar cal) throws SQLException { + LOG.finest("++enter++"); + Date date = getDate(columnIndex); + if (date == null || cal == null) { + return null; + } + cal.setTimeInMillis(date.getTime()); + return new java.sql.Date(cal.getTimeInMillis()); + } + + @Override + public Time getTime(int columnIndex, Calendar cal) throws SQLException { + LOG.finest("++enter++"); + Time time = getTime(columnIndex); + if (time == null || cal == null) { + return null; + } + cal.setTimeInMillis(time.getTime()); + return new java.sql.Time(cal.getTimeInMillis()); + } + + @Override + public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { + LOG.finest("++enter++"); + Timestamp timeStamp = getTimestamp(columnIndex); + if (timeStamp == null || cal == null) { + return null; + } + cal.setTimeInMillis(timeStamp.getTime()); + return new java.sql.Timestamp(cal.getTimeInMillis()); + } + + @Override + public int findColumn(String columnLabel) throws SQLException { + LOG.finest("++enter++"); + return getColumnIndex(columnLabel); + } + + @Override + public Object getObject(String columnLabel) throws SQLException { + return getObject(getColumnIndex(columnLabel)); + } + + @Override + public String getString(String columnLabel) throws SQLException { + return getString(getColumnIndex(columnLabel)); + } + + @Override + public boolean getBoolean(String columnLabel) throws SQLException { + return getBoolean(getColumnIndex(columnLabel)); + } + + @Override + public byte getByte(String columnLabel) throws SQLException { + return getByte(getColumnIndex(columnLabel)); + } + + @Override + public short getShort(String columnLabel) throws SQLException { + return getShort(getColumnIndex(columnLabel)); + } + + @Override + public int getInt(String columnLabel) throws SQLException { + return getInt(getColumnIndex(columnLabel)); + } + + @Override + public long getLong(String columnLabel) throws SQLException { + return getLong(getColumnIndex(columnLabel)); + } + + @Override + public float getFloat(String columnLabel) throws SQLException { + return getFloat(getColumnIndex(columnLabel)); + } + + @Override + public double getDouble(String columnLabel) throws SQLException { + return getDouble(getColumnIndex(columnLabel)); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException { + return getBigDecimal(getColumnIndex(columnLabel), scale); + } + + @Override + public byte[] getBytes(String columnLabel) throws SQLException { + return getBytes(getColumnIndex(columnLabel)); + } + + @Override + public Date getDate(String columnLabel) throws SQLException { + return getDate(getColumnIndex(columnLabel)); + } + + @Override + public Time getTime(String columnLabel) throws SQLException { + return getTime(getColumnIndex(columnLabel)); + } + + @Override + public Timestamp getTimestamp(String columnLabel) throws SQLException { + return getTimestamp(getColumnIndex(columnLabel)); + } + + @Override + public InputStream getAsciiStream(String columnLabel) throws SQLException { + return getAsciiStream(getColumnIndex(columnLabel)); + } + + @Override + public InputStream getUnicodeStream(String columnLabel) throws SQLException { + return getUnicodeStream(getColumnIndex(columnLabel)); + } + + @Override + public InputStream getBinaryStream(String columnLabel) throws SQLException { + return getBinaryStream(getColumnIndex(columnLabel)); + } + + @Override + public BigDecimal getBigDecimal(String columnLabel) throws SQLException { + return getBigDecimal(getColumnIndex(columnLabel)); + } + + @Override + public Blob getBlob(String columnLabel) throws SQLException { + return getBlob(getColumnIndex(columnLabel)); + } + + @Override + public Clob getClob(String columnLabel) throws SQLException { + return getClob(getColumnIndex(columnLabel)); + } + + @Override + public Array getArray(String columnLabel) throws SQLException { + return getArray(getColumnIndex(columnLabel)); + } + + @Override + public Reader getCharacterStream(String columnLabel) throws SQLException { + return getCharacterStream(getColumnIndex(columnLabel)); + } + + @Override + public Date getDate(String columnLabel, Calendar cal) throws SQLException { + return getDate(getColumnIndex(columnLabel), cal); + } + + @Override + public Time getTime(String columnLabel, Calendar cal) throws SQLException { + return getTime(getColumnIndex(columnLabel), cal); + } + + @Override + public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { + return getTimestamp(getColumnIndex(columnLabel), cal); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseStruct.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseStruct.java new file mode 100644 index 0000000000..ab9cf61cb8 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseStruct.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.StandardSQLTypeName.STRUCT; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.sql.Date; +import java.sql.SQLException; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Base64; +import java.util.Map; + +/** + * An abstract implementation of {@link java.sql.Struct} used as a base class for {@link + * BigQueryArrowStruct} and {@link BigQueryJsonStruct}. A Struct object contains a value for each + * attribute of the SQL structured type that it represents. + */ +abstract class BigQueryBaseStruct implements java.sql.Struct { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryBaseStruct.class.getName()); + + abstract FieldList getSchema(); + + @Override + public final String getSQLTypeName() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Override + public final Object[] getAttributes(Map> map) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + static boolean isStruct(Field currentSchema) { + LOG.finest("++enter++"); + return currentSchema.getType().getStandardType() == STRUCT; + } + + @Override + public String toString() { + try { + FieldList schema = getSchema(); + Object[] attributes = getAttributes(); + + if (schema == null || attributes == null || schema.size() != attributes.length) { + return "{}"; + } + + StringBuilder sb = new StringBuilder("{"); + for (int i = 0; i < attributes.length; i++) { + if (i > 0) { + sb.append(","); + } + String fieldName = schema.get(i).getName(); + Object value = attributes[i]; + + sb.append("\"").append(fieldName.replace("\"", "\\\"")).append("\":"); + + if (value == null) { + sb.append("null"); + } else if (value instanceof String || value instanceof org.apache.arrow.vector.util.Text) { + String stringValue = value.toString().replace("\"", "\\\""); + sb.append("\"").append(stringValue).append("\""); + } else if (value instanceof Timestamp || value instanceof Date || value instanceof Time) { + sb.append("\"").append(value.toString()).append("\""); + } else if (value instanceof byte[]) { + sb.append("\"").append(Base64.getEncoder().encodeToString((byte[]) value)).append("\""); + } else { + sb.append(value.toString()); + } + } + sb.append("}"); + return sb.toString(); + } catch (SQLException e) { + return "{ \"error\": \"Error converting struct to string: " + e.getMessage() + "\" }"; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java new file mode 100644 index 0000000000..041505c623 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java @@ -0,0 +1,1341 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.jdbc.BigQueryParameterHandler.BigQueryStatementParameterType; +import com.google.common.annotations.VisibleForTesting; +import java.io.BufferedReader; +import java.io.CharArrayReader; +import java.io.FilterReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PipedReader; +import java.io.Reader; +import java.io.StringReader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLXML; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.util.Calendar; +import java.util.Map; + +class BigQueryCallableStatement extends BigQueryPreparedStatement implements CallableStatement { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + + BigQueryCallableStatement(BigQueryConnection connection, String callableStmtSql) + throws SQLException { + super(connection, callableStmtSql); + } + + @VisibleForTesting + protected String getCallableStatementSql() { + return this.currentQuery; + } + + @VisibleForTesting + protected BigQueryParameterHandler getParameterHandler() { + return this.parameterHandler; + } + + @Override + public Array getArray(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Array) { + return (Array) param; + } + if (param.getClass().isAssignableFrom(Array.class)) { + return getObject(arg0, Array.class); + } + return null; + } + + @Override + public Array getArray(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Array) { + return (Array) param; + } + if (param.getClass().isAssignableFrom(Array.class)) { + return getObject(arg0, Array.class); + } + return null; + } + + @Override + public BigDecimal getBigDecimal(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof BigDecimal) { + return (BigDecimal) param; + } + if (param.getClass().isAssignableFrom(BigDecimal.class)) { + return getObject(arg0, BigDecimal.class); + } + return null; + } + + @Override + public BigDecimal getBigDecimal(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof BigDecimal) { + return (BigDecimal) param; + } + if (param.getClass().isAssignableFrom(BigDecimal.class)) { + return getObject(arg0, BigDecimal.class); + } + return null; + } + + @Override + public BigDecimal getBigDecimal(int arg0, int arg1) throws SQLException { + LOG.finest("++enter++"); + return getBigDecimal(arg0); + } + + @Override + public Blob getBlob(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Blob) { + return (Blob) param; + } + if (param.getClass().isAssignableFrom(Blob.class)) { + return getObject(arg0, Blob.class); + } + return null; + } + + @Override + public Blob getBlob(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Blob) { + return (Blob) param; + } + if (param.getClass().isAssignableFrom(Blob.class)) { + return getObject(arg0, Blob.class); + } + return null; + } + + @Override + public boolean getBoolean(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Boolean) { + return (Boolean) param; + } + if (param.getClass().isAssignableFrom(Boolean.class)) { + return getObject(arg0, Boolean.class); + } + return false; + } + + @Override + public boolean getBoolean(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Boolean) { + return (Boolean) param; + } + if (param.getClass().isAssignableFrom(Boolean.class)) { + return getObject(arg0, Boolean.class); + } + return false; + } + + @Override + public byte getByte(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Byte) { + return (Byte) param; + } + if (param.getClass().isAssignableFrom(Byte.class)) { + return getObject(arg0, Byte.class); + } + return -1; + } + + @Override + public byte getByte(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Byte) { + return (Byte) param; + } + if (param.getClass().isAssignableFrom(Byte.class)) { + return getObject(arg0, Byte.class); + } + return -1; + } + + @Override + public byte[] getBytes(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof byte[] || param.getClass().isAssignableFrom(byte[].class)) { + return (byte[]) param; + } + if (param instanceof String) { + return param.toString().getBytes(); + } + return null; + } + + @Override + public byte[] getBytes(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof byte[] || param.getClass().isAssignableFrom(byte[].class)) { + return (byte[]) param; + } + if (param instanceof String) { + return param.toString().getBytes(); + } + return null; + } + + // FilterReader, InputStreamReader, PipedReader, StringReader + @Override + public Reader getCharacterStream(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String || param.getClass().isAssignableFrom(String.class)) { + return new StringReader(param.toString()); + } + + if (param instanceof BufferedReader) { + return (BufferedReader) param; + } + if (param.getClass().isAssignableFrom(BufferedReader.class)) { + return getObject(arg0, BufferedReader.class); + } + + if (param instanceof CharArrayReader) { + return (CharArrayReader) param; + } + if (param.getClass().isAssignableFrom(CharArrayReader.class)) { + return getObject(arg0, CharArrayReader.class); + } + + if (param instanceof FilterReader) { + return (FilterReader) param; + } + if (param.getClass().isAssignableFrom(FilterReader.class)) { + return getObject(arg0, FilterReader.class); + } + + if (param instanceof InputStreamReader) { + return (InputStreamReader) param; + } + if (param.getClass().isAssignableFrom(InputStreamReader.class)) { + return getObject(arg0, InputStreamReader.class); + } + + if (param instanceof PipedReader) { + return (PipedReader) param; + } + if (param.getClass().isAssignableFrom(PipedReader.class)) { + return getObject(arg0, PipedReader.class); + } + + if (param instanceof StringReader) { + return (StringReader) param; + } + if (param.getClass().isAssignableFrom(StringReader.class)) { + return getObject(arg0, StringReader.class); + } + return null; + } + + @Override + public Reader getCharacterStream(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String || param.getClass().isAssignableFrom(String.class)) { + return new StringReader(param.toString()); + } + + if (param instanceof BufferedReader) { + return (BufferedReader) param; + } + if (param.getClass().isAssignableFrom(BufferedReader.class)) { + return getObject(arg0, BufferedReader.class); + } + + if (param instanceof CharArrayReader) { + return (CharArrayReader) param; + } + if (param.getClass().isAssignableFrom(CharArrayReader.class)) { + return getObject(arg0, CharArrayReader.class); + } + + if (param instanceof FilterReader) { + return (FilterReader) param; + } + if (param.getClass().isAssignableFrom(FilterReader.class)) { + return getObject(arg0, FilterReader.class); + } + + if (param instanceof InputStreamReader) { + return (InputStreamReader) param; + } + if (param.getClass().isAssignableFrom(InputStreamReader.class)) { + return getObject(arg0, InputStreamReader.class); + } + + if (param instanceof PipedReader) { + return (PipedReader) param; + } + if (param.getClass().isAssignableFrom(PipedReader.class)) { + return getObject(arg0, PipedReader.class); + } + + if (param instanceof StringReader) { + return (StringReader) param; + } + if (param.getClass().isAssignableFrom(StringReader.class)) { + return getObject(arg0, StringReader.class); + } + return null; + } + + @Override + public Clob getClob(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Clob) { + return (Clob) param; + } + if (param.getClass().isAssignableFrom(Clob.class)) { + return getObject(arg0, Clob.class); + } + return null; + } + + @Override + public Clob getClob(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Clob) { + return (Clob) param; + } + if (param.getClass().isAssignableFrom(Clob.class)) { + return getObject(arg0, Clob.class); + } + return null; + } + + @Override + public Date getDate(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Date) { + return (Date) param; + } + if (param.getClass().isAssignableFrom(Date.class)) { + return getObject(arg0, Date.class); + } + return null; + } + + @Override + public Date getDate(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Date) { + return (Date) param; + } + if (param.getClass().isAssignableFrom(Date.class)) { + return getObject(arg0, Date.class); + } + return null; + } + + @Override + public Date getDate(int arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Date) { + Date dateParam = (Date) param; + if (arg1 != null) { + arg1.setTime(dateParam); + return new Date(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Date.class)) { + Date dateObj = getObject(arg0, Date.class); + if (arg1 != null) { + arg1.setTime(dateObj); + return new Date(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public Date getDate(String arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Date) { + Date dateParam = (Date) param; + if (arg1 != null) { + arg1.setTime(dateParam); + return new Date(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Date.class)) { + Date dateObj = getObject(arg0, Date.class); + if (arg1 != null) { + arg1.setTime(dateObj); + return new Date(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public double getDouble(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Double) { + return (Double) param; + } + if (param.getClass().isAssignableFrom(Double.class)) { + return getObject(arg0, Double.class); + } + return 0; + } + + @Override + public double getDouble(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Double) { + return (Double) param; + } + if (param.getClass().isAssignableFrom(Double.class)) { + return getObject(arg0, Double.class); + } + return 0; + } + + @Override + public float getFloat(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Float) { + return (Float) param; + } + if (param.getClass().isAssignableFrom(Float.class)) { + return getObject(arg0, Float.class); + } + return 0; + } + + @Override + public float getFloat(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Float) { + return (Float) param; + } + if (param.getClass().isAssignableFrom(Float.class)) { + return getObject(arg0, Float.class); + } + return 0; + } + + @Override + public int getInt(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Integer) { + return (Integer) param; + } + if (param.getClass().isAssignableFrom(Integer.class)) { + return getObject(arg0, Integer.class); + } + return 0; + } + + @Override + public int getInt(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Integer) { + return (Integer) param; + } + if (param.getClass().isAssignableFrom(Integer.class)) { + return getObject(arg0, Integer.class); + } + return 0; + } + + @Override + public long getLong(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Long) { + return (Long) param; + } + if (param.getClass().isAssignableFrom(Long.class)) { + return getObject(arg0, Long.class); + } + if (param instanceof Integer) { + return (Long) param; + } + if (param.getClass().isAssignableFrom(Integer.class)) { + return getObject(arg0, Integer.class); + } + return 0; + } + + @Override + public long getLong(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Long) { + return (Long) param; + } + if (param.getClass().isAssignableFrom(Long.class)) { + return getObject(arg0, Long.class); + } + if (param instanceof Integer) { + return (Long) param; + } + if (param.getClass().isAssignableFrom(Integer.class)) { + return getObject(arg0, Integer.class); + } + return 0; + } + + @Override + public Reader getNCharacterStream(int arg0) throws SQLException { + LOG.finest("++enter++"); + return getCharacterStream(arg0); + } + + @Override + public Reader getNCharacterStream(String arg0) throws SQLException { + LOG.finest("++enter++"); + return getCharacterStream(arg0); + } + + @Override + public NClob getNClob(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof NClob) {} + if (param.getClass().isAssignableFrom(NClob.class)) { + return getObject(arg0, NClob.class); + } + return null; + } + + @Override + public NClob getNClob(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof NClob) { + return (NClob) param; + } + if (param.getClass().isAssignableFrom(NClob.class)) { + return getObject(arg0, NClob.class); + } + return null; + } + + @Override + public String getNString(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String) { + return param.toString(); + } + if (param.getClass().isAssignableFrom(String.class)) { + return getObject(arg0, String.class); + } + return null; + } + + @Override + public String getNString(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String) { + return param.toString(); + } + if (param.getClass().isAssignableFrom(String.class)) { + return getObject(arg0, String.class); + } + return null; + } + + @Override + public Object getObject(int arg0) throws SQLException { + LOG.finest("++enter++"); + return this.parameterHandler.getParameter(arg0); + } + + @Override + public Object getObject(String arg0) throws SQLException { + LOG.finest("++enter++"); + return this.parameterHandler.getParameter(arg0); + } + + @Override + public Object getObject(int arg0, Map> arg1) throws SQLException { + LOG.finest("++enter++"); + String paramKey = this.parameterHandler.getSqlType(arg0).name(); + if (arg1.containsKey(paramKey)) { + Class argJavaType = arg1.get(paramKey); + Class paramJavaType = this.parameterHandler.getType(arg0); + if (paramJavaType.isAssignableFrom(argJavaType)) { + return this.parameterHandler.getParameter(arg0); + } + } + return null; + } + + @Override + public Object getObject(String arg0, Map> arg1) throws SQLException { + LOG.finest("++enter++"); + String paramKey = this.parameterHandler.getSqlType(arg0).name(); + if (arg1.containsKey(paramKey)) { + Class argJavaType = arg1.get(paramKey); + Class paramJavaType = this.parameterHandler.getType(arg0); + if (paramJavaType.isAssignableFrom(argJavaType)) { + return this.parameterHandler.getParameter(arg0); + } + } + return null; + } + + @Override + public T getObject(int arg0, Class arg1) throws SQLException { + LOG.finest("++enter++"); + Class javaType = this.parameterHandler.getType(arg0); + if (javaType.isAssignableFrom(arg1)) { + return (T) this.parameterHandler.getParameter(arg0); + } + return null; + } + + @Override + public T getObject(String arg0, Class arg1) throws SQLException { + LOG.finest("++enter++"); + Class javaType = this.parameterHandler.getType(arg0); + if (javaType.isAssignableFrom(arg1)) { + return (T) this.parameterHandler.getParameter(arg0); + } + return null; + } + + @Override + public Ref getRef(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Ref getRef(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public RowId getRowId(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof RowId) { + return (RowId) param; + } + if (param.getClass().isAssignableFrom(RowId.class)) { + return getObject(arg0, RowId.class); + } + return null; + } + + @Override + public RowId getRowId(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof RowId) { + return (RowId) param; + } + if (param.getClass().isAssignableFrom(RowId.class)) { + return getObject(arg0, RowId.class); + } + return null; + } + + @Override + public SQLXML getSQLXML(int arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public SQLXML getSQLXML(String arg0) throws SQLException { + // TODO Auto-generated method stub + return null; + } + + @Override + public short getShort(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Short) { + return (Short) param; + } + if (param.getClass().isAssignableFrom(Short.class)) { + return getObject(arg0, Short.class); + } + return 0; + } + + @Override + public short getShort(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Short) { + return (Short) param; + } + if (param.getClass().isAssignableFrom(Short.class)) { + return getObject(arg0, Short.class); + } + return 0; + } + + @Override + public String getString(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String) { + return param.toString(); + } + if (param.getClass().isAssignableFrom(String.class)) { + return getObject(arg0, String.class); + } + return null; + } + + @Override + public String getString(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof String) { + return param.toString(); + } + if (param.getClass().isAssignableFrom(String.class)) { + return getObject(arg0, String.class); + } + return null; + } + + @Override + public Time getTime(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Time) { + return (Time) param; + } + if (param.getClass().isAssignableFrom(Time.class)) { + return getObject(arg0, Time.class); + } + return null; + } + + @Override + public Time getTime(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Time) { + return (Time) param; + } + if (param.getClass().isAssignableFrom(Time.class)) { + return getObject(arg0, Time.class); + } + return null; + } + + @Override + public Time getTime(int arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Time) { + Time timeParam = (Time) param; + if (arg1 != null) { + arg1.setTimeInMillis(timeParam.getTime()); + return new Time(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Time.class)) { + Time timeObj = getObject(arg0, Time.class); + if (arg1 != null) { + arg1.setTimeInMillis(timeObj.getTime()); + return new Time(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public Time getTime(String arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Time) { + Time timeParam = (Time) param; + if (arg1 != null) { + arg1.setTimeInMillis(timeParam.getTime()); + return new Time(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Time.class)) { + Time timeObj = getObject(arg0, Time.class); + if (arg1 != null) { + arg1.setTimeInMillis(timeObj.getTime()); + return new Time(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public Timestamp getTimestamp(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Timestamp) { + return (Timestamp) param; + } + if (param.getClass().isAssignableFrom(Timestamp.class)) { + return getObject(arg0, Timestamp.class); + } + return null; + } + + @Override + public Timestamp getTimestamp(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Timestamp) { + return (Timestamp) param; + } + if (param.getClass().isAssignableFrom(Timestamp.class)) { + return getObject(arg0, Timestamp.class); + } + return null; + } + + @Override + public Timestamp getTimestamp(int arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Timestamp) { + Timestamp timestampParam = (Timestamp) param; + if (arg1 != null) { + arg1.setTimeInMillis(timestampParam.getTime()); + return new Timestamp(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Timestamp.class)) { + Timestamp timestampObj = getObject(arg0, Timestamp.class); + if (arg1 != null) { + arg1.setTimeInMillis(timestampObj.getTime()); + return new Timestamp(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public Timestamp getTimestamp(String arg0, Calendar arg1) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof Timestamp) { + Timestamp timestampParam = (Timestamp) param; + if (arg1 != null) { + arg1.setTimeInMillis(timestampParam.getTime()); + return new Timestamp(arg1.getTimeInMillis()); + } + } + if (param.getClass().isAssignableFrom(Timestamp.class)) { + Timestamp timestampObj = getObject(arg0, Timestamp.class); + if (arg1 != null) { + arg1.setTimeInMillis(timestampObj.getTime()); + return new Timestamp(arg1.getTimeInMillis()); + } + } + return null; + } + + @Override + public URL getURL(int arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof URL) { + return (URL) param; + } + if (param.getClass().isAssignableFrom(URL.class)) { + return getObject(arg0, URL.class); + } + return null; + } + + @Override + public URL getURL(String arg0) throws SQLException { + LOG.finest("++enter++"); + Object param = this.parameterHandler.getParameter(arg0); + if (param instanceof URL) { + return (URL) param; + } + if (param.getClass().isAssignableFrom(URL.class)) { + return getObject(arg0, URL.class); + } + return null; + } + + @Override + public void registerOutParameter(int paramIndex, int sqlType) throws SQLException { + LOG.finest("++enter++"); + LOG.finest( + String.format("registerOutParameter: paramIndex %s, sqlType %s", paramIndex, sqlType)); + checkClosed(); + try { + this.parameterHandler.setParameter( + paramIndex, + null, + BigQueryJdbcTypeMappings.getJavaType(sqlType), + BigQueryParameterHandler.BigQueryStatementParameterType.OUT, + -1); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public void registerOutParameter(String paramName, int sqlType) throws SQLException { + LOG.finest("++enter++"); + LOG.finest(String.format("registerOutParameter: paramName %s, sqlType %s", paramName, sqlType)); + checkClosed(); + try { + this.parameterHandler.setParameter( + paramName, + null, + BigQueryJdbcTypeMappings.getJavaType(sqlType), + BigQueryParameterHandler.BigQueryStatementParameterType.OUT, + -1); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public void registerOutParameter(int paramIndex, int sqlType, int scale) throws SQLException { + LOG.finest("++enter++"); + LOG.finest( + String.format( + "registerOutParameter: paramIndex %s, sqlType %s, scale %s", + paramIndex, sqlType, scale)); + checkClosed(); + if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { + throw new IllegalArgumentException( + String.format("registerOutParameter: Invalid sqlType passed in %s", sqlType)); + } + try { + this.parameterHandler.setParameter( + paramIndex, + null, + BigQueryJdbcTypeMappings.getJavaType(sqlType), + BigQueryParameterHandler.BigQueryStatementParameterType.OUT, + scale); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public void registerOutParameter(int paramIndex, int sqlType, String typeName) + throws SQLException { + LOG.finest("++enter++"); + LOG.finest( + String.format( + "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", + paramIndex, sqlType, typeName)); + // fully qualified sql typeName is not supported by the driver and hence ignored. + registerOutParameter(paramIndex, sqlType); + } + + @Override + public void registerOutParameter(String paramName, int sqlType, int scale) throws SQLException { + LOG.finest("++enter++"); + LOG.finest( + String.format( + "registerOutParameter: paramIndex %s, sqlType %s, scale %s", + paramName, sqlType, scale)); + checkClosed(); + if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { + throw new IllegalArgumentException( + String.format("registerOutParameter: Invalid sqlType passed in %s", sqlType)); + } + try { + this.parameterHandler.setParameter( + paramName, + null, + BigQueryJdbcTypeMappings.getJavaType(sqlType), + BigQueryParameterHandler.BigQueryStatementParameterType.OUT, + scale); + } catch (Exception e) { + throw new SQLException(e); + } + } + + @Override + public void registerOutParameter(String paramName, int sqlType, String typeName) + throws SQLException { + LOG.finest("++enter++"); + LOG.finest( + String.format( + "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", + paramName, sqlType, typeName)); + // fully qualified sql typeName is not supported by the driver and hence ignored. + registerOutParameter(paramName, sqlType); + } + + @Override + public void setAsciiStream(String arg0, InputStream arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setAsciiStream(String arg0, InputStream arg1, int arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setAsciiStream(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setBigDecimal(String arg0, BigDecimal arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setBinaryStream(String arg0, InputStream arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setBinaryStream(String arg0, InputStream arg1, int arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setBinaryStream(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setBlob(String arg0, Blob arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setBlob(String arg0, InputStream arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setBlob(String arg0, InputStream arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setBoolean(String arg0, boolean arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Boolean.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setByte(String arg0, byte arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Byte.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setBytes(String arg0, byte[] arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, byte[].class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setCharacterStream(String arg0, Reader arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setCharacterStream(String arg0, Reader arg1, int arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setCharacterStream(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setClob(String arg0, Clob arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setClob(String arg0, Reader arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setClob(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setDate(String arg0, Date arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setDate(String arg0, Date arg1, Calendar arg2) throws SQLException { + arg2.setTimeInMillis(arg1.getTime()); + this.parameterHandler.setParameter( + arg0, + new Date(arg2.getTimeInMillis()), + arg1.getClass(), + BigQueryStatementParameterType.IN, + 0); + } + + @Override + public void setDouble(String arg0, double arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Double.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setFloat(String arg0, float arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Float.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setInt(String arg0, int arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Integer.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setLong(String arg0, long arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Long.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setNCharacterStream(String arg0, Reader arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setNCharacterStream(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + } + + @Override + public void setNClob(String arg0, NClob arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setNClob(String arg0, Reader arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setNClob(String arg0, Reader arg1, long arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setNString(String arg0, String arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setNull(String arg0, int arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setNull(String arg0, int arg1, String arg2) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setObject(String arg0, Object arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setObject(String arg0, Object arg1, int arg2) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + StandardSQLTypeName sqlType = this.parameterHandler.getSqlType(arg0); + if (BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.containsKey(sqlType)) { + int javaSqlType = BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.get(sqlType); + if (javaSqlType != arg2) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + String.format("Unsupported sql type:%s ", arg2)); + } + } else { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + String.format("parameter sql type not supported: %s", sqlType)); + } + } + + @Override + public void setObject(String arg0, Object arg1, int arg2, int arg3) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, arg3); + StandardSQLTypeName sqlType = this.parameterHandler.getSqlType(arg0); + if (BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.containsKey(sqlType)) { + int javaSqlType = BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.get(sqlType); + if (javaSqlType != arg2) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + String.format("Unsupported sql type:%s ", arg2)); + } + } else { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + String.format("parameter sql type not supported: %s", sqlType)); + } + } + + @Override + public void setRowId(String arg0, RowId arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setSQLXML(String arg0, SQLXML arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public void setShort(String arg0, short arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, Short.class, BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setString(String arg0, String arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setTime(String arg0, Time arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setTime(String arg0, Time arg1, Calendar arg2) throws SQLException { + arg2.setTimeInMillis(arg1.getTime()); + this.parameterHandler.setParameter( + arg0, + new Time(arg2.getTimeInMillis()), + arg1.getClass(), + BigQueryStatementParameterType.IN, + 0); + } + + @Override + public void setTimestamp(String arg0, Timestamp arg1) throws SQLException { + this.parameterHandler.setParameter( + arg0, arg1, arg1.getClass(), BigQueryStatementParameterType.IN, 0); + } + + @Override + public void setTimestamp(String arg0, Timestamp arg1, Calendar arg2) throws SQLException { + arg2.setTimeInMillis(arg1.getTime()); + this.parameterHandler.setParameter( + arg0, + new Timestamp(arg2.getTimeInMillis()), + arg1.getClass(), + BigQueryStatementParameterType.IN, + 0); + } + + @Override + public void setURL(String arg0, URL arg1) throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + + } + + @Override + public boolean wasNull() throws SQLException { + // TODO: NOT IMPLEMENTED (data type not supported) + return false; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCoercion.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCoercion.java new file mode 100644 index 0000000000..6265af0dec --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCoercion.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import java.util.function.Function; + +/** + * A {@link BigQueryCoercion} is responsible for coercing one type to another. An implementation of + * {@link BigQueryCoercion} is used to extend the behaviour of {@link BigQueryTypeCoercer} for the + * coercion of one user defined type to another. + * + * @param represents the source type + * @param represents the target type + */ +@InternalApi +interface BigQueryCoercion extends Function { + /** + * Coerce the provided value to the desired type. + * + * @param value the input value. + * @return the output value after coercion. + */ + OUTPUT coerce(INPUT value); + + @Override + default OUTPUT apply(INPUT input) { + return coerce(input); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java new file mode 100644 index 0000000000..e93938f258 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.Credentials; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.ConnectionProperty; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; +import com.google.cloud.bigquery.storage.v1.BigQueryReadSettings; +import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; +import com.google.cloud.bigquery.storage.v1.BigQueryWriteSettings; +import com.google.cloud.http.HttpTransportOptions; +import java.io.IOException; +import java.io.InputStream; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.Statement; +import java.time.Duration; +import java.util.ArrayList; +import java.util.ConcurrentModificationException; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; + +/** + * An implementation of {@link java.sql.Connection} for establishing a connection with BigQuery and + * executing SQL statements + * + * @see BigQueryStatement + */ +public class BigQueryConnection extends BigQueryNoOpsConnection { + + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + String connectionClassName = this.toString(); + private static final String DEFAULT_JDBC_TOKEN_VALUE = "Google-BigQuery-JDBC-Driver"; + private static final String DEFAULT_VERSION = "0.0.0"; + private static HeaderProvider HEADER_PROVIDER; + BigQueryReadClient bigQueryReadClient = null; + BigQueryWriteClient bigQueryWriteClient = null; + BigQuery bigQuery; + String connectionUrl; + Set openStatements; + boolean autoCommit; + int transactionIsolation; + List sqlWarnings; + String catalog; + int holdability; + long retryTimeoutInSeconds; + Duration retryTimeoutDuration; + long retryInitialDelayInSeconds; + Duration retryInitialDelayDuration; + long retryMaxDelayInSeconds; + Duration retryMaxDelayDuration; + // transactionStarted is false by default. + // when autocommit is false transaction starts and session is initialized. + boolean transactionStarted; + ConnectionProperty sessionInfoConnectionProperty; + boolean isClosed; + DatasetId defaultDataset; + String location; + boolean enableHighThroughputAPI; + int highThroughputMinTableSize; + int highThroughputActivationRatio; + boolean enableSession; + boolean unsupportedHTAPIFallback; + boolean useQueryCache; + String queryDialect; + int metadataFetchThreadCount; + boolean allowLargeResults; + String destinationTable; + String destinationDataset; + long destinationDatasetExpirationTime; + String kmsKeyName; + String universeDomain; + List queryProperties; + Map authProperties; + Map overrideProperties; + Credentials credentials; + boolean useStatelessQueryMode; + int numBufferedRows; + HttpTransportOptions httpTransportOptions; + TransportChannelProvider transportChannelProvider; + long maxResults; + long jobTimeoutInSeconds; + boolean enableWriteAPI; + int writeAPIActivationRowCount; + int writeAPIAppendRowCount; + int requestGoogleDriveScope; + List additionalProjects; + boolean filterTablesOnDefaultDataset; + String sslTrustStorePath; + String sslTrustStorePassword; + long maxBytesBilled; + Map labels; + + BigQueryConnection(String url) throws IOException { + this.connectionUrl = url; + this.openStatements = ConcurrentHashMap.newKeySet(); + this.autoCommit = true; + this.sqlWarnings = new ArrayList<>(); + this.transactionStarted = false; + this.isClosed = false; + this.labels = BigQueryJdbcUrlUtility.parseLabels(url, connectionClassName); + this.maxBytesBilled = + BigQueryJdbcUrlUtility.parseMaximumBytesBilled(url, this.connectionClassName); + this.retryTimeoutInSeconds = + BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(url, this.connectionClassName); + this.retryTimeoutDuration = Duration.ofMillis(retryTimeoutInSeconds * 1000L); + this.retryInitialDelayInSeconds = + BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(url, this.connectionClassName); + this.retryInitialDelayDuration = Duration.ofMillis(retryInitialDelayInSeconds * 1000L); + this.retryMaxDelayInSeconds = + BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(url, this.connectionClassName); + this.retryMaxDelayDuration = Duration.ofMillis(retryMaxDelayInSeconds * 1000L); + this.jobTimeoutInSeconds = + BigQueryJdbcUrlUtility.parseJobTimeout(url, this.connectionClassName); + this.authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.connectionClassName); + this.catalog = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.PROJECT_ID_PROPERTY_NAME, + BigQueryOptions.getDefaultProjectId(), + this.connectionClassName); + this.universeDomain = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_UNIVERSE_DOMAIN_VALUE, + this.connectionClassName); + this.overrideProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(url, this.connectionClassName); + if (universeDomain != null) { + this.overrideProperties.put( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, universeDomain); + } + this.credentials = + BigQueryJdbcOAuthUtility.getCredentials( + authProperties, overrideProperties, this.connectionClassName); + String defaultDatasetString = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.DEFAULT_DATASET_PROPERTY_NAME, + null, + this.connectionClassName); + if (defaultDatasetString == null || defaultDatasetString.trim().isEmpty()) { + this.defaultDataset = null; + } else { + String[] parts = defaultDatasetString.split("\\."); + if (parts.length == 2) { + this.defaultDataset = DatasetId.of(parts[0], parts[1]); + } else if (parts.length == 1) { + this.defaultDataset = DatasetId.of(parts[0]); + } else { + throw new IllegalArgumentException( + "DefaultDataset format is invalid. Supported options are datasetId or" + + " projectId.datasetId"); + } + } + this.location = + BigQueryJdbcUrlUtility.parseStringProperty( + url, BigQueryJdbcUrlUtility.LOCATION_PROPERTY_NAME, null, this.connectionClassName); + this.enableHighThroughputAPI = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.ENABLE_HTAPI_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_ENABLE_HTAPI_VALUE, + this.connectionClassName); + this.highThroughputMinTableSize = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE, + this.connectionClassName); + this.highThroughputActivationRatio = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.HTAPI_ACTIVATION_RATIO_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE, + this.connectionClassName); + this.useQueryCache = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.USE_QUERY_CACHE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_USE_QUERY_CACHE, + this.connectionClassName); + this.useStatelessQueryMode = + BigQueryJdbcUrlUtility.parseJobCreationMode(url, this.connectionClassName); + this.queryDialect = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.QUERY_DIALECT_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_QUERY_DIALECT_VALUE, + this.connectionClassName); + this.allowLargeResults = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.ALLOW_LARGE_RESULTS_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_ALLOW_LARGE_RESULTS, + this.connectionClassName); + this.destinationTable = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.LARGE_RESULTS_TABLE_PROPERTY_NAME, + null, + this.connectionClassName); + this.destinationDataset = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.LARGE_RESULTS_DATASET_PROPERTY_NAME, + null, + this.connectionClassName); + this.destinationDatasetExpirationTime = + BigQueryJdbcUrlUtility.parseLongProperty( + url, + BigQueryJdbcUrlUtility.DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_DESTINATION_DATASET_EXPIRATION_TIME_VALUE, + this.connectionClassName); + this.kmsKeyName = + BigQueryJdbcUrlUtility.parseStringProperty( + url, BigQueryJdbcUrlUtility.KMS_KEY_NAME_PROPERTY_NAME, null, this.connectionClassName); + Map proxyProperties = + BigQueryJdbcProxyUtility.parseProxyProperties(url, this.connectionClassName); + this.sslTrustStorePath = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROPERTY_NAME, + null, + this.connectionClassName); + this.sslTrustStorePassword = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, + null, + this.connectionClassName); + this.httpTransportOptions = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + proxyProperties, + this.sslTrustStorePath, + this.sslTrustStorePassword, + this.connectionClassName); + this.transportChannelProvider = + BigQueryJdbcProxyUtility.getTransportChannelProvider( + proxyProperties, + this.sslTrustStorePath, + this.sslTrustStorePassword, + this.connectionClassName); + this.enableSession = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.ENABLE_SESSION_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_ENABLE_SESSION_VALUE, + this.connectionClassName); + this.unsupportedHTAPIFallback = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_UNSUPPORTED_HTAPI_FALLBACK_VALUE, + this.connectionClassName); + this.maxResults = + BigQueryJdbcUrlUtility.parseLongProperty( + url, + BigQueryJdbcUrlUtility.MAX_RESULTS_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_MAX_RESULTS_VALUE, + this.connectionClassName); + Map queryPropertiesMap = + BigQueryJdbcUrlUtility.parseQueryProperties(url, this.connectionClassName); + this.sessionInfoConnectionProperty = getSessionPropertyFromQueryProperties(queryPropertiesMap); + this.queryProperties = convertMapToConnectionPropertiesList(queryPropertiesMap); + this.enableWriteAPI = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.ENABLE_WRITE_API_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_ENABLE_WRITE_API_VALUE, + this.connectionClassName); + this.writeAPIActivationRowCount = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_SWA_ACTIVATION_ROW_COUNT_VALUE, + this.connectionClassName); + this.writeAPIAppendRowCount = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.SWA_APPEND_ROW_COUNT_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_SWA_APPEND_ROW_COUNT_VALUE, + this.connectionClassName); + this.additionalProjects = + BigQueryJdbcUrlUtility.parseStringListProperty( + url, + BigQueryJdbcUrlUtility.ADDITIONAL_PROJECTS_PROPERTY_NAME, + this.connectionClassName); + this.filterTablesOnDefaultDataset = + BigQueryJdbcUrlUtility.parseBooleanProperty( + url, + BigQueryJdbcUrlUtility.FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_FILTER_TABLES_ON_DEFAULT_DATASET_VALUE, + this.connectionClassName); + this.requestGoogleDriveScope = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, + this.connectionClassName); + this.metadataFetchThreadCount = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE, + this.connectionClassName); + + HEADER_PROVIDER = createHeaderProvider(); + this.bigQuery = getBigQueryConnection(); + } + + String getLibraryVersion(Class libraryClass) { + LOG.finest("++enter++"); + String version = null; + try (InputStream in = + libraryClass.getResourceAsStream( + "/com/google/cloud/bigquery/jdbc/dependencies.properties")) { + if (in != null) { + Properties props = new Properties(); + props.load(in); + version = props.getProperty("version.jdbc"); + } + } catch (IOException e) { + return DEFAULT_VERSION; + } + + return version != null ? version : DEFAULT_VERSION; + } + + private String buildPartnerToken(String url) { + String partnerTokenString = + BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, this.connectionClassName); + if (partnerTokenString == null || partnerTokenString.isEmpty()) { + return ""; + } + return partnerTokenString; + } + + HeaderProvider createHeaderProvider() { + String partnerToken = buildPartnerToken(this.connectionUrl); + String headerToken = + DEFAULT_JDBC_TOKEN_VALUE + "/" + getLibraryVersion(this.getClass()) + partnerToken; + return FixedHeaderProvider.create("user-agent", headerToken); + } + + protected void addOpenStatements(Statement statement) { + LOG.finest(String.format("Statement %s added to Connection %s.", statement, this)); + this.openStatements.add(statement); + } + + BigQueryReadClient getBigQueryReadClient() { + try { + if (this.bigQueryReadClient == null) { + this.bigQueryReadClient = getBigQueryReadClientConnection(); + } + } catch (IOException e) { + throw new BigQueryJdbcRuntimeException(e); + } + return this.bigQueryReadClient; + } + + BigQueryWriteClient getBigQueryWriteClient() { + try { + if (this.bigQueryWriteClient == null) { + this.bigQueryWriteClient = getBigQueryWriteClientConnection(); + } + } catch (IOException e) { + throw new BigQueryJdbcRuntimeException(e); + } + return this.bigQueryWriteClient; + } + + BigQuery getBigQuery() { + return this.bigQuery; + } + + String getConnectionUrl() { + return connectionUrl; + } + + /** + * Creates and returns a new {@code Statement} object for executing BigQuery SQL queries + * + * @return a new {@code Statement} object + * @see Connection#createStatement() + */ + @Override + public Statement createStatement() throws SQLException { + checkClosed(); + BigQueryStatement currentStatement = new BigQueryStatement(this); + LOG.fine(String.format("Statement %s created.", currentStatement)); + addOpenStatements(currentStatement); + return currentStatement; + } + + /** + * Creates and returns a new {@code Statement} object for executing BigQuery SQL queries. This + * method is similar to {@link BigQueryConnection#createStatement()}, but it overrides the type + * and concurrency of the generated {@code ResultSet}. + * + * @throws SQLException if a BigQuery connection error occurs, if this method is called on a + * closed connection, or the given parameters are not {@code ResultSet} constants indicating + * type and concurrency. + * @throws BigQueryJdbcSqlFeatureNotSupportedException if this method is not supported for the + * specified result set type and result set concurrency. + * @see Connection#createStatement(int, int) + * @see ResultSet + */ + @Override + public Statement createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException { + checkClosed(); + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("Unsupported createStatement feature."); + } + return createStatement(); + } + + /** + * Creates and returns a new {@code Statement} object for executing BigQuery SQL queries. This + * method is similar to {@link BigQueryConnection#createStatement()}, but it overrides the type, + * concurrency, and holdability of the generated {@code ResultSet}. + * + * @throws SQLException if a BigQuery connection error occurs, if this method is called on a + * closed connection, or the given parameters are not {@code ResultSet} constants indicating + * type, concurrency, and holdability. + * @throws BigQueryJdbcSqlFeatureNotSupportedException if this method is not supported for the + * specified result set type, result set holdability and result set concurrency. + * @see Connection#createStatement(int, int, int) + * @see ResultSet + */ + @Override + public Statement createStatement( + int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY + || resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("Unsupported createStatement feature"); + } + return createStatement(); + } + + @Override + public PreparedStatement prepareStatement(String sql) throws SQLException { + checkClosed(); + PreparedStatement currentStatement = new BigQueryPreparedStatement(this, sql); + LOG.fine(String.format("Prepared Statement %s created.", currentStatement)); + addOpenStatements(currentStatement); + return currentStatement; + } + + @Override + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { + if (autoGeneratedKeys != Statement.NO_GENERATED_KEYS) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("autoGeneratedKeys is not supported"); + } + return prepareStatement(sql); + } + + @Override + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException("autoGeneratedKeys is not supported"); + } + + @Override + public PreparedStatement prepareStatement( + String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY + || resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("Unsupported prepareStatement feature"); + } + return prepareStatement(sql); + } + + @Override + public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException { + LOG.finest("++enter++"); + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("Unsupported prepareStatement feature"); + } + return prepareStatement(sql); + } + + public DatasetId getDefaultDataset() { + checkClosed(); + return this.defaultDataset; + } + + String getDestinationDataset() { + return this.destinationDataset; + } + + String getDestinationTable() { + return this.destinationTable; + } + + long getDestinationDatasetExpirationTime() { + return this.destinationDatasetExpirationTime; + } + + String getKmsKeyName() { + return this.kmsKeyName; + } + + List getQueryProperties() { + return this.queryProperties; + } + + public String getLocation() { + checkClosed(); + return this.location; + } + + public Map getAuthProperties() { + checkClosed(); + return this.authProperties; + } + + long getMaxResults() { + return maxResults; + } + + long getRetryTimeoutInSeconds() { + return this.retryTimeoutInSeconds; + } + + Duration getRetryTimeoutDuration() { + return this.retryTimeoutDuration; + } + + long getRetryInitialDelayInSeconds() { + return this.retryInitialDelayInSeconds; + } + + Duration getRetryInitialDelayDuration() { + return this.retryInitialDelayDuration; + } + + long getRetryMaxDelayInSeconds() { + return this.retryMaxDelayInSeconds; + } + + Duration getRetryMaxDelayDuration() { + return this.retryMaxDelayDuration; + } + + long getJobTimeoutInSeconds() { + return this.jobTimeoutInSeconds; + } + + long getMaxBytesBilled() { + return this.maxBytesBilled; + } + + Map getLabels() { + return this.labels; + } + + /** + * Begins a transaction.
    + * The transaction ends when a {@link BigQueryConnection#commit()} or {@link + * BigQueryConnection#rollback()} is made.
    + * For more information about transactions in BigQuery, see Multi-statement transactions. + */ + private void beginTransaction() { + LOG.finest("++enter++"); + QueryJobConfiguration.Builder transactionBeginJobConfig = + QueryJobConfiguration.newBuilder("BEGIN TRANSACTION;"); + try { + if (this.sessionInfoConnectionProperty != null) { + transactionBeginJobConfig.setConnectionProperties(this.queryProperties); + } else { + transactionBeginJobConfig.setCreateSession(true); + } + Job job = this.bigQuery.create(JobInfo.of(transactionBeginJobConfig.build())); + job = job.waitFor(); + Job transactionBeginJob = this.bigQuery.getJob(job.getJobId()); + if (this.sessionInfoConnectionProperty == null) { + this.sessionInfoConnectionProperty = + ConnectionProperty.newBuilder() + .setKey("session_id") + .setValue(transactionBeginJob.getStatistics().getSessionInfo().getSessionId()) + .build(); + this.queryProperties.add(this.sessionInfoConnectionProperty); + } + this.transactionStarted = true; + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } + + public boolean isTransactionStarted() { + return this.transactionStarted; + } + + boolean isSessionEnabled() { + return this.enableSession; + } + + boolean isUnsupportedHTAPIFallback() { + return this.unsupportedHTAPIFallback; + } + + ConnectionProperty getSessionInfoConnectionProperty() { + return this.sessionInfoConnectionProperty; + } + + boolean isEnableHighThroughputAPI() { + return this.enableHighThroughputAPI; + } + + boolean isUseQueryCache() { + return useQueryCache; + } + + boolean getUseStatelessQueryMode() { + return useStatelessQueryMode; + } + + boolean isAllowLargeResults() { + return allowLargeResults; + } + + String getQueryDialect() { + return queryDialect; + } + + Integer getNumBufferedRows() { + return numBufferedRows; + } + + int getHighThroughputMinTableSize() { + return highThroughputMinTableSize; + } + + List getAdditionalProjects() { + return this.additionalProjects; + } + + int getHighThroughputActivationRatio() { + return highThroughputActivationRatio; + } + + boolean isFilterTablesOnDefaultDataset() { + return this.filterTablesOnDefaultDataset; + } + + int isRequestGoogleDriveScope() { + return requestGoogleDriveScope; + } + + int getMetadataFetchThreadCount() { + return this.metadataFetchThreadCount; + } + + boolean isEnableWriteAPI() { + return enableWriteAPI; + } + + int getWriteAPIActivationRowCount() { + return writeAPIActivationRowCount; + } + + int getWriteAPIAppendRowCount() { + return writeAPIAppendRowCount; + } + + String getSSLTrustStorePath() { + return sslTrustStorePath; + } + + String getSSLTrustStorePassword() { + return sslTrustStorePassword; + } + + @Override + public boolean isValid(int timeout) throws SQLException { + if (timeout < 0) { + throw new BigQueryJdbcException("timeout must be >= 0"); + } + if (!isClosed()) { + try (Statement statement = createStatement(); + ResultSet rs = statement.executeQuery("SELECT 1")) { + LOG.finest("Running validation query"); + // TODO(obada): set query timeout when it's implemented + // TODO(obada): use dry run + if (rs.next()) { + if (rs.getInt(1) == 1) { + return true; + } + } + } catch (SQLException ex) { + // Ignore + } + } + return false; + } + + @Override + public void abort(Executor executor) throws SQLException { + LOG.finest("++enter++"); + close(); + } + + // TODO: Throw exception translation of BigQueryJdbcSqlClientInfoException when implementing below + @Override + public void setClientInfo(String name, String value) {} + + @Override + public String getClientInfo(String name) { + return null; + } + + @Override + public String getCatalog() { + return this.catalog; + } + + @Override + public Properties getClientInfo() { + return null; + } + + @Override + public void setClientInfo(Properties properties) {} + + @Override + public SQLWarning getWarnings() { + return this.sqlWarnings.isEmpty() ? null : this.sqlWarnings.get(0); + } + + @Override + public void clearWarnings() { + this.sqlWarnings.clear(); + } + + @Override + public boolean getAutoCommit() { + checkClosed(); + return this.autoCommit; + } + + /** + * Sets this connection's auto-commit mode to the given state.
    + * If this method is called during a transaction and the auto-commit mode is changed, the + * transaction is committed. If setAutoCommit is called and the auto-commit mode is not changed, + * the call is a no-op. + * + * @param autoCommit {@code true} to enable auto-commit mode; {@code false} to disable it + * @see Connection#setAutoCommit(boolean) + */ + @Override + public void setAutoCommit(boolean autoCommit) throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + checkIfEnabledSession("setAutoCommit"); + if (this.autoCommit == autoCommit) { + return; + } + + if (isTransactionStarted()) { + commitTransaction(); + } + + this.autoCommit = autoCommit; + if (!this.autoCommit) { + beginTransaction(); + } + } + + @Override + public void commit() { + LOG.finest("++enter++"); + checkClosed(); + checkIfEnabledSession("commit"); + if (!isTransactionStarted()) { + throw new IllegalStateException( + "Cannot commit without an active transaction. Please set setAutoCommit to false to start" + + " a transaction."); + } + commitTransaction(); + if (!getAutoCommit()) { + beginTransaction(); + } + } + + @Override + public void rollback() throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + checkIfEnabledSession("rollback"); + if (!isTransactionStarted()) { + throw new IllegalStateException( + "Cannot rollback without an active transaction. Please set setAutoCommit to false to" + + " start a transaction."); + } + try { + QueryJobConfiguration transactionRollbackJobConfig = + QueryJobConfiguration.newBuilder("ROLLBACK TRANSACTION;") + .setConnectionProperties(this.queryProperties) + .build(); + Job rollbackJob = this.bigQuery.create(JobInfo.of(transactionRollbackJobConfig)); + rollbackJob.waitFor(); + this.transactionStarted = false; + if (!getAutoCommit()) { + beginTransaction(); + } + } catch (InterruptedException | BigQueryException ex) { + throw new BigQueryJdbcException(ex); + } + } + + @Override + public DatabaseMetaData getMetaData() throws SQLException { + return new BigQueryDatabaseMetaData(this); + } + + @Override + public int getTransactionIsolation() { + // only supports Connection.TRANSACTION_SERIALIZABLE + return Connection.TRANSACTION_SERIALIZABLE; + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + if (level != Connection.TRANSACTION_SERIALIZABLE) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Transaction serializable not supported"); + } + this.transactionIsolation = level; + } + + @Override + public int getHoldability() { + return this.holdability; + } + + @Override + public void setHoldability(int holdability) throws SQLException { + if (holdability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "CLOSE_CURSORS_AT_COMMIT not supported"); + } + this.holdability = holdability; + } + + /** + * Releases this {@code BigQueryConnection} object's BigQuery resources immediately instead of + * waiting for them to be automatically released. + * + * @throws SQLException if a BigQuery access error occurs + * @see Connection#close() + */ + @Override + public void close() throws SQLException { + LOG.fine("Closing Connection " + this); + // TODO(neenu-postMVP): Release all connection state objects + // check for and close all existing transactions + + if (isClosed()) { + return; + } + try { + if (this.bigQueryReadClient != null) { + this.bigQueryReadClient.shutdown(); + this.bigQueryReadClient.awaitTermination(1, TimeUnit.MINUTES); + this.bigQueryReadClient.close(); + } + + if (this.bigQueryWriteClient != null) { + this.bigQueryWriteClient.shutdown(); + this.bigQueryWriteClient.awaitTermination(1, TimeUnit.MINUTES); + this.bigQueryWriteClient.close(); + } + + for (Statement statement : this.openStatements) { + statement.close(); + } + this.openStatements.clear(); + } catch (ConcurrentModificationException ex) { + throw new BigQueryJdbcException(ex); + } catch (InterruptedException e) { + throw new BigQueryJdbcRuntimeException(e); + } + this.isClosed = true; + } + + @Override + public boolean isClosed() { + return this.isClosed; + } + + private void checkClosed() { + if (isClosed()) { + throw new IllegalStateException("This " + getClass().getName() + " has been closed"); + } + } + + private void checkIfEnabledSession(String methodName) { + if (!this.enableSession) { + throw new IllegalStateException( + String.format("Session needs to be enabled to use %s method.", methodName)); + } + } + + private ConnectionProperty getSessionPropertyFromQueryProperties( + Map queryPropertiesMap) { + LOG.finest("++enter++"); + if (queryPropertiesMap != null) { + if (queryPropertiesMap.containsKey("session_id")) { + return ConnectionProperty.newBuilder() + .setKey("session_id") + .setValue(queryPropertiesMap.get("session_id")) + .build(); + } + } + return null; + } + + private List convertMapToConnectionPropertiesList( + Map queryPropertiesMap) { + LOG.finest("++enter++"); + List connectionProperties = new ArrayList(); + if (queryPropertiesMap != null) { + for (Map.Entry entry : queryPropertiesMap.entrySet()) { + connectionProperties.add( + ConnectionProperty.newBuilder() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build()); + } + } + return connectionProperties; + } + + void removeStatement(Statement statement) { + this.openStatements.remove(statement); + } + + private BigQuery getBigQueryConnection() { + // 404 Not Found - check if the project exists + // 403 Forbidden - execute a dryRun to check if the user has bigquery.jobs.create permissions + BigQueryOptions.Builder bigQueryOptions = BigQueryOptions.newBuilder(); + if (this.retryTimeoutInSeconds > 0L + || (this.retryInitialDelayInSeconds > 0L && this.retryMaxDelayInSeconds > 0L)) { + RetrySettings.Builder retry_settings_builder = RetrySettings.newBuilder(); + if (this.retryTimeoutInSeconds > 0L) { + retry_settings_builder.setTotalTimeoutDuration(this.retryTimeoutDuration); + } + if (this.retryInitialDelayInSeconds > 0L && this.retryMaxDelayInSeconds > 0L) { + retry_settings_builder.setInitialRetryDelayDuration(retryInitialDelayDuration); + retry_settings_builder.setMaxRetryDelayDuration(retryMaxDelayDuration); + } + bigQueryOptions.setRetrySettings(retry_settings_builder.build()); + } + + if (this.catalog != null) { + bigQueryOptions.setProjectId(this.catalog); + } + if (this.credentials != null) { + bigQueryOptions.setCredentials(this.credentials); + } + if (this.location != null) { + bigQueryOptions.setLocation(this.location); + } + if (this.overrideProperties.containsKey( + BigQueryJdbcUrlUtility.BIGQUERY_ENDPOINT_OVERRIDE_PROPERTY_NAME)) { + bigQueryOptions.setHost( + this.overrideProperties.get( + BigQueryJdbcUrlUtility.BIGQUERY_ENDPOINT_OVERRIDE_PROPERTY_NAME)); + } + if (this.universeDomain != null) { + bigQueryOptions.setUniverseDomain(this.universeDomain); + } + if (this.httpTransportOptions != null) { + bigQueryOptions.setTransportOptions(this.httpTransportOptions); + } + + BigQueryOptions options = bigQueryOptions.setHeaderProvider(HEADER_PROVIDER).build(); + options.setQueryPreviewEnabled(String.valueOf(this.useStatelessQueryMode)); + return options.getService(); + } + + private BigQueryReadClient getBigQueryReadClientConnection() throws IOException { + BigQueryReadSettings.Builder bigQueryReadSettings = + BigQueryReadSettings.newBuilder().setHeaderProvider(HEADER_PROVIDER); + if (getRetrySettings() != null) { + bigQueryReadSettings.createReadSessionSettings().setRetrySettings(getRetrySettings()); + } + if (this.catalog != null) { + bigQueryReadSettings.setQuotaProjectId(this.catalog); + } + if (this.credentials != null) { + CredentialsProvider fixedProvider = FixedCredentialsProvider.create(credentials); + bigQueryReadSettings.setCredentialsProvider(fixedProvider); + } + if (this.overrideProperties.containsKey( + BigQueryJdbcUrlUtility.HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME)) { + bigQueryReadSettings.setEndpoint( + this.overrideProperties.get( + BigQueryJdbcUrlUtility.HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME)); + } + if (this.universeDomain != null) { + bigQueryReadSettings.setUniverseDomain(this.universeDomain); + } + if (this.transportChannelProvider != null) { + bigQueryReadSettings.setTransportChannelProvider(this.transportChannelProvider); + } + + return BigQueryReadClient.create(bigQueryReadSettings.build()); + } + + private BigQueryWriteClient getBigQueryWriteClientConnection() throws IOException { + BigQueryWriteSettings.Builder bigQueryWriteSettings = + BigQueryWriteSettings.newBuilder().setHeaderProvider(HEADER_PROVIDER); + if (getRetrySettings() != null) { + bigQueryWriteSettings.createWriteStreamSettings().setRetrySettings(getRetrySettings()); + } + if (this.catalog != null) { + bigQueryWriteSettings.setQuotaProjectId(this.catalog); + } + if (this.credentials != null) { + CredentialsProvider fixedProvider = FixedCredentialsProvider.create(credentials); + bigQueryWriteSettings.setCredentialsProvider(fixedProvider); + } + // Same endpoint as READ API + if (this.overrideProperties.containsKey( + BigQueryJdbcUrlUtility.HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME)) { + bigQueryWriteSettings.setEndpoint( + this.overrideProperties.get( + BigQueryJdbcUrlUtility.HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME)); + } + if (this.universeDomain != null) { + bigQueryWriteSettings.setUniverseDomain(this.universeDomain); + } + if (this.transportChannelProvider != null) { + bigQueryWriteSettings.setTransportChannelProvider(this.transportChannelProvider); + } + + return BigQueryWriteClient.create(bigQueryWriteSettings.build()); + } + + RetrySettings getRetrySettings() { + RetrySettings.Builder retrySettingsBuilder = null; + + if (this.retryTimeoutInSeconds > 0L + || (this.retryInitialDelayInSeconds > 0L && this.retryMaxDelayInSeconds > 0L)) { + retrySettingsBuilder = RetrySettings.newBuilder(); + if (this.retryTimeoutInSeconds > 0L) { + retrySettingsBuilder.setTotalTimeoutDuration(this.retryTimeoutDuration); + } + if (this.retryInitialDelayInSeconds > 0L && this.retryMaxDelayInSeconds > 0L) { + retrySettingsBuilder.setInitialRetryDelayDuration(retryInitialDelayDuration); + retrySettingsBuilder.setMaxRetryDelayDuration(retryMaxDelayDuration); + } + } + return retrySettingsBuilder == null ? null : retrySettingsBuilder.build(); + } + + private void commitTransaction() { + try { + QueryJobConfiguration transactionCommitJobConfig = + QueryJobConfiguration.newBuilder("COMMIT TRANSACTION;") + .setConnectionProperties(this.queryProperties) + .build(); + Job commitJob = this.bigQuery.create(JobInfo.of(transactionCommitJobConfig)); + commitJob.waitFor(); + this.transactionStarted = false; + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } + + @Override + public CallableStatement prepareCall(String sql) throws SQLException { + checkClosed(); + CallableStatement currentStatement = new BigQueryCallableStatement(this, sql); + LOG.fine(String.format("Callable Statement %s created.", currentStatement)); + addOpenStatements(currentStatement); + return currentStatement; + } + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Unsupported CallableStatement feature"); + } + return prepareCall(sql); + } + + @Override + public CallableStatement prepareCall( + String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (resultSetType != ResultSet.TYPE_FORWARD_ONLY + || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY + || resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Unsupported CallableStatement feature"); + } + return prepareCall(sql); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java new file mode 100644 index 0000000000..17be15d866 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java @@ -0,0 +1,117 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import java.util.List; + +class BigQueryConnectionProperty { + + private final String name; + private final String description; + private final String defaultValue; + private final List validValues; + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getDefaultValue() { + return defaultValue; + } + + public List getValidValues() { + return validValues; + } + + BigQueryConnectionProperty(Builder builder) { + this.name = builder.name; + this.defaultValue = builder.defaultValue; + this.description = builder.description; + this.validValues = builder.validValues; + } + + /** Returns a builder for a BigQueryConnectionProperty object. */ + static BigQueryConnectionProperty.Builder newBuilder() { + return new BigQueryConnectionProperty.Builder(); + } + + BigQueryConnectionProperty.Builder toBuilder() { + return new BigQueryConnectionProperty.Builder(this); + } + + @Override + public String toString() { + return "BigQueryConnectionProperty{" + + "name='" + + name + + '\'' + + ", description='" + + description + + '\'' + + ", defaultValue='" + + defaultValue + + '\'' + + ", validValues=" + + validValues + + '}'; + } + + static final class Builder { + + private String name; + private String description; + private String defaultValue; + private List validValues; + + private Builder(BigQueryConnectionProperty bigQueryConnectionProperty) { + this.name = bigQueryConnectionProperty.name; + this.description = bigQueryConnectionProperty.description; + this.defaultValue = bigQueryConnectionProperty.defaultValue; + this.validValues = bigQueryConnectionProperty.validValues; + } + + private Builder() {} + + Builder setName(String name) { + this.name = name; + return this; + } + + Builder setDescription(String description) { + this.description = description; + return this; + } + + Builder setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + Builder setValidValues(List validValues) { + this.validValues = validValues; + return this; + } + + BigQueryConnectionProperty build() { + return new BigQueryConnectionProperty(this); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java new file mode 100644 index 0000000000..386785660a --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTask.java @@ -0,0 +1,122 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.util.List; + +/** + * This class is used to add polling threads required for polling the reference queues associated + * with the two ResultSets + */ +@InternalApi +class BigQueryDaemonPollingTask extends Thread { + + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryDaemonPollingTask.class.getName()); + + static ReferenceQueue referenceQueueArrowRs; + static ReferenceQueue referenceQueueJsonRs; + static List arrowRsFinalizers; + static List jsonRsFinalizers; + + private static BigQueryDaemonPollingTask arrowDaemon; + private static BigQueryDaemonPollingTask jsonDaemon; + + private static final Object LOCK = new Object(); + + private BigQueryDaemonPollingTask( + List arrowRsFinalizers, + ReferenceQueue referenceQueueArrowRs) { + BigQueryDaemonPollingTask.referenceQueueArrowRs = referenceQueueArrowRs; + BigQueryDaemonPollingTask.arrowRsFinalizers = arrowRsFinalizers; + setDaemon(true); + } + + private BigQueryDaemonPollingTask( + ReferenceQueue referenceQueueJsonRs, + List jsonRsFinalizers) { + BigQueryDaemonPollingTask.referenceQueueJsonRs = referenceQueueJsonRs; + BigQueryDaemonPollingTask.jsonRsFinalizers = jsonRsFinalizers; + setDaemon(true); + } + + /** + * ThreadSafe method which creates two instances of polling task, one each for each type of + * ResultSet + * + * @param referenceQueueArrowRs ReferenceQueue for ArrowResultSet + * @param referenceQueueJsonRs ReferenceQueue for JsonResultSet + * @param arrowRsFinalizers Finalizer for ArrowResultSet + * @param jsonRsFinalizers Finalizer for JsonResultSet + * @return true if the tasks were created + */ + public static boolean startGcDaemonTask( + ReferenceQueue referenceQueueArrowRs, + ReferenceQueue referenceQueueJsonRs, + List arrowRsFinalizers, + List jsonRsFinalizers) { + LOG.finest("++enter++"); + synchronized (LOCK) { + // 2 Background threads will be required to monitor the respective queues + if (arrowDaemon == null && jsonDaemon == null) { + arrowDaemon = new BigQueryDaemonPollingTask(arrowRsFinalizers, referenceQueueArrowRs); + arrowDaemon.start(); + + jsonDaemon = new BigQueryDaemonPollingTask(referenceQueueJsonRs, jsonRsFinalizers); + jsonDaemon.start(); + + return true; + } + } + // Task(s) are already initialised + return false; + } + + @Override + public void run() { + + Reference reference; + try { + LOG.finest("++enter++"); + // poll for Arrow ResultSets + if (referenceQueueArrowRs != null) { + + while ((reference = referenceQueueArrowRs.remove()) != null) { + LOG.fine("Clearing Arrow ResultSet reference " + referenceQueueArrowRs); + ((BigQueryResultSetFinalizers.ArrowResultSetFinalizer) reference).finalizeResources(); + reference.clear(); + } + } + // poll for JSON ResultSets + else if (referenceQueueJsonRs != null) { + while ((reference = referenceQueueJsonRs.remove()) != null) { + LOG.fine("Clearing Json ResultSet reference " + referenceQueueJsonRs); + ((BigQueryResultSetFinalizers.JsonResultSetFinalizer) reference).finalizeResources(); + reference.clear(); + } + } else { + throw new BigQueryJdbcRuntimeException("Null Reference Queue"); + } + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java new file mode 100644 index 0000000000..66917ea889 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java @@ -0,0 +1,5346 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.gax.paging.Page; +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQuery.DatasetListOption; +import com.google.cloud.bigquery.BigQuery.RoutineListOption; +import com.google.cloud.bigquery.BigQuery.TableListOption; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.Routine; +import com.google.cloud.bigquery.RoutineArgument; +import com.google.cloud.bigquery.RoutineId; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLDataType; +import com.google.cloud.bigquery.StandardSQLField; +import com.google.cloud.bigquery.StandardSQLTableType; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.Table; +import com.google.cloud.bigquery.TableDefinition; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.RowIdLifetime; +import java.sql.SQLException; +import java.sql.Types; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Scanner; +import java.util.Set; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.regex.Pattern; +import javax.annotation.Nullable; + +/** + * An implementation of {@link java.sql.DatabaseMetaData}. This interface is implemented by driver + * vendors to let users know the capabilities of a Database Management System (DBMS) in combination + * with the driver based on JDBC™ technology ("JDBC driver") that is used with it. + * + * @see BigQueryStatement + */ +// TODO(neenu): test and verify after post MVP implementation. +class BigQueryDatabaseMetaData implements DatabaseMetaData { + final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final String DATABASE_PRODUCT_NAME = "Google BigQuery"; + private static final String DATABASE_PRODUCT_VERSION = "2.0"; + private static final String DRIVER_NAME = "GoogleJDBCDriverForGoogleBigQuery"; + private static final String DRIVER_DEFAULT_VERSION = "0.0.0"; + private static final String SCHEMA_TERM = "Dataset"; + private static final String CATALOG_TERM = "Project"; + private static final String PROCEDURE_TERM = "Procedure"; + private static final String GET_PRIMARY_KEYS_SQL = "DatabaseMetaData_GetPrimaryKeys.sql"; + private static final String GET_IMPORTED_KEYS_SQL = "DatabaseMetaData_GetImportedKeys.sql"; + private static final String GET_EXPORTED_KEYS_SQL = "DatabaseMetaData_GetExportedKeys.sql"; + private static final String GET_CROSS_REFERENCE_SQL = "DatabaseMetaData_GetCrossReference.sql"; + private static final int API_EXECUTOR_POOL_SIZE = 50; + private static final int DEFAULT_PAGE_SIZE = 500; + private static final int DEFAULT_QUEUE_CAPACITY = 5000; + // Declared package-private for testing. + static final String GOOGLE_SQL_QUOTED_IDENTIFIER = "`"; + // Does not include SQL:2003 Keywords as per JDBC spec. + // https://en.wikipedia.org/wiki/List_of_SQL_reserved_words + static final String GOOGLE_SQL_RESERVED_KEYWORDS = + "ASC,ASSERT_ROWS_MODIFIED,DESC,ENUM,EXCLUDE,FOLLOWING,HASH,IF," + + "IGNORE,LIMIT,LOOKUP,NULLS,PRECEDING,PROTO,QUALIFY,RESPECT,STRUCT,UNBOUNDED"; + static final String GOOGLE_SQL_NUMERIC_FNS = + "ABS,ACOS,ACOSH,ASIN,ASINH,ATAN,ATAN2,ATANH,CBRT,CEIL,CEILING,COS" + + ",COSH,COSINE_DISTANCE,COT,COTH,CSC,CSCH,DIV,EXP,EUCLIDEAN_DISTANCE,FLOOR" + + ",GREATEST,IS_INF,LEAST,LN,LOG,LOG10,MOD,POW,RAND,RANGE_BUCKET,ROUND," + + ",SAFE_ADD,SAFE_DIVIDE,SAFE_MULTIPLY,SAFE_NEGATE,SAFE_SUBTRACT,SEC,SECH," + + "SIGN,SIN,SINH,SQRT,TAN,TANH,TRUNC"; + static final String GOOGLE_SQL_STRING_FNS = + "ASCII,BYTE_LENGTH,CHAR_LENGTH,CHARACTER_LENGTH,CHR,CODE_POINTS_TO_BYTES," + + "CODE_POINTS_TO_STRING,COLLATE,CONCAT,CONTAINS_SUBSTR,EDIT_DISTANCE,ENDS_WITH," + + "FORMAT,FROM_BASE32,FROM_BASE64,FROM_HEX,INITCAP,INSTR,LEFT,LENGTH,LOWER," + + "LPAD,LTRIM,NORMALIZ,NORMALIZE_AND_CASEFOLD,OCTET_LENGTH,REGEXP_CONTAINS," + + "REGEXP_EXTRACT,REGEXP_EXTRACT_ALL,REGEXP_INSTR,REGEXP_REPLACE,REGEXP_SUBSTR," + + "REPEAT,REPLACE,REVERSE,RIGHT,RPAD,RTRIM,SAFE_CONVERT_BYTES_TO_STRING,SOUNDEX," + + "SPLIT,STARTS_WITH,STRPOS,SUBSTR,SUBSTRING,TO_BASE32,TO_BASE64,TO_CODE_POINTS," + + "TO_HEX,TRANSLATE,TRIMunicode,UNICODE,UPPER"; + static final String GOOGLE_SQL_TIME_DATE_FNS = + "DATE,DATE_ADD,DATE_BUCKET,DATE_DIFF,DATE_FROM_UNIX_DATE," + + "DATE_SUB,DATE_TRUNC,DATETIME,DATETIME_ADD.,DATETIME_BUCKET," + + "DATETIME_DIFF,DATETIME_SUB,DATETIME_TRUNC,CURRENT_DATE,CURRENT_DATETIME," + + "CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_TIME,EXTRACT,FORMAT_TIME,PARSE_TIME," + + "TIME,TIME_ADD,TIME_DIFF,TIME_SUB,TIME_TRUNC,CURRENT_TIMESTAMP,EXTRACT," + + "FORMAT_TIMESTAMP,GENERATE_TIMESTAMP_ARRAY,PARSE_TIMESTAMP,TIMESTAMP," + + "TIMESTAMP_ADD,TIMESTAMP_DIFF,TIMESTAMP_MICROS,TIMESTAMP_MILLIS,TIMESTAMP_SECONDS," + + "TIMESTAMP_SUB,TIMESTAMP_TRUNC,UNIX_MICROS,UNIX_MILLIS,UNIX_SECONDS"; + static final String GOOGLE_SQL_ESCAPE = "\\"; + static final String GOOGLE_SQL_CATALOG_SEPARATOR = "."; + static final int GOOGLE_SQL_MAX_COL_NAME_LEN = 300; + static final int GOOGLE_SQL_MAX_COLS_PER_TABLE = 10000; + + String URL; + BigQueryConnection connection; + private final BigQueryStatement statement; + private final BigQuery bigquery; + private final int metadataFetchThreadCount; + private static final AtomicReference parsedDriverVersion = new AtomicReference<>(null); + private static final AtomicReference parsedDriverMajorVersion = + new AtomicReference<>(null); + private static final AtomicReference parsedDriverMinorVersion = + new AtomicReference<>(null); + + BigQueryDatabaseMetaData(BigQueryConnection connection) throws SQLException { + this.URL = connection.getConnectionUrl(); + this.connection = connection; + this.statement = connection.createStatement().unwrap(BigQueryStatement.class); + this.bigquery = connection.getBigQuery(); + this.metadataFetchThreadCount = connection.getMetadataFetchThreadCount(); + loadDriverVersionProperties(); + } + + @Override + public boolean allProceduresAreCallable() { + // Returns false because BigQuery's IAM permissions can allow a user + // to discover a procedure's existence without having rights to execute it. + return false; + } + + @Override + public boolean allTablesAreSelectable() { + // Returns true to ensure maximum compatibility with client applications + // that expect a positive response to discover and list all available tables. + return true; + } + + @Override + public String getURL() { + return this.URL; + } + + @Override + public String getUserName() { + return null; + } + + @Override + public boolean isReadOnly() { + return false; + } + + @Override + public boolean nullsAreSortedHigh() { + return false; + } + + @Override + public boolean nullsAreSortedLow() { + return false; + } + + @Override + public boolean nullsAreSortedAtStart() { + return false; + } + + @Override + public boolean nullsAreSortedAtEnd() { + return false; + } + + @Override + public String getDatabaseProductName() { + return DATABASE_PRODUCT_NAME; + } + + @Override + public String getDatabaseProductVersion() { + return DATABASE_PRODUCT_VERSION; + } + + @Override + public String getDriverName() { + return DRIVER_NAME; + } + + @Override + public String getDriverVersion() { + return parsedDriverVersion.get() != null ? parsedDriverVersion.get() : DRIVER_DEFAULT_VERSION; + } + + @Override + public int getDriverMajorVersion() { + return parsedDriverMajorVersion.get() != null ? parsedDriverMajorVersion.get() : 0; + } + + @Override + public int getDriverMinorVersion() { + return parsedDriverMinorVersion.get() != null ? parsedDriverMinorVersion.get() : 0; + } + + @Override + public boolean usesLocalFiles() { + return false; + } + + @Override + public boolean usesLocalFilePerTable() { + return false; + } + + @Override + public boolean supportsMixedCaseIdentifiers() { + return false; + } + + @Override + public boolean storesUpperCaseIdentifiers() { + return false; + } + + @Override + public boolean storesLowerCaseIdentifiers() { + return false; + } + + @Override + public boolean storesMixedCaseIdentifiers() { + return false; + } + + @Override + public boolean supportsMixedCaseQuotedIdentifiers() { + return false; + } + + @Override + public boolean storesUpperCaseQuotedIdentifiers() { + return false; + } + + @Override + public boolean storesLowerCaseQuotedIdentifiers() { + return false; + } + + @Override + public boolean storesMixedCaseQuotedIdentifiers() { + return false; + } + + @Override + public String getIdentifierQuoteString() { + return GOOGLE_SQL_QUOTED_IDENTIFIER; + } + + @Override + public String getSQLKeywords() { + return GOOGLE_SQL_RESERVED_KEYWORDS; + } + + @Override + public String getNumericFunctions() { + return GOOGLE_SQL_NUMERIC_FNS; + } + + @Override + public String getStringFunctions() { + return GOOGLE_SQL_STRING_FNS; + } + + @Override + // GoogleSQL has UDF (user defined functions). + // System functions like DATABASE(), USER() are not supported. + public String getSystemFunctions() { + return null; + } + + @Override + public String getTimeDateFunctions() { + return GOOGLE_SQL_TIME_DATE_FNS; + } + + @Override + public String getSearchStringEscape() { + return GOOGLE_SQL_ESCAPE; + } + + @Override + // No extra characters beyond a-z, A-Z, 0-9 and _ + public String getExtraNameCharacters() { + return null; + } + + @Override + public boolean supportsAlterTableWithAddColumn() { + return true; + } + + @Override + public boolean supportsAlterTableWithDropColumn() { + return true; + } + + @Override + public boolean supportsColumnAliasing() { + return true; + } + + @Override + public boolean nullPlusNonNullIsNull() { + return true; + } + + @Override + public boolean supportsConvert() { + return false; + } + + @Override + public boolean supportsConvert(int fromType, int toType) { + return false; + } + + @Override + public boolean supportsTableCorrelationNames() { + return true; + } + + @Override + public boolean supportsDifferentTableCorrelationNames() { + return false; + } + + @Override + public boolean supportsExpressionsInOrderBy() { + return true; + } + + @Override + public boolean supportsOrderByUnrelated() { + return true; + } + + @Override + public boolean supportsGroupBy() { + return true; + } + + @Override + public boolean supportsGroupByUnrelated() { + return true; + } + + @Override + public boolean supportsGroupByBeyondSelect() { + return true; + } + + @Override + public boolean supportsLikeEscapeClause() { + return false; + } + + @Override + public boolean supportsMultipleResultSets() { + return false; + } + + @Override + public boolean supportsMultipleTransactions() { + return false; + } + + @Override + public boolean supportsNonNullableColumns() { + return false; + } + + @Override + public boolean supportsMinimumSQLGrammar() { + return false; + } + + @Override + public boolean supportsCoreSQLGrammar() { + return false; + } + + @Override + public boolean supportsExtendedSQLGrammar() { + return false; + } + + @Override + public boolean supportsANSI92EntryLevelSQL() { + return false; + } + + @Override + public boolean supportsANSI92IntermediateSQL() { + return false; + } + + @Override + public boolean supportsANSI92FullSQL() { + return false; + } + + @Override + public boolean supportsIntegrityEnhancementFacility() { + return false; + } + + @Override + public boolean supportsOuterJoins() { + return false; + } + + @Override + public boolean supportsFullOuterJoins() { + return false; + } + + @Override + public boolean supportsLimitedOuterJoins() { + return false; + } + + @Override + public String getSchemaTerm() { + return SCHEMA_TERM; + } + + @Override + public String getProcedureTerm() { + return PROCEDURE_TERM; + } + + @Override + public String getCatalogTerm() { + return CATALOG_TERM; + } + + @Override + public boolean isCatalogAtStart() { + return true; + } + + @Override + public String getCatalogSeparator() { + return GOOGLE_SQL_CATALOG_SEPARATOR; + } + + @Override + public boolean supportsSchemasInDataManipulation() { + return false; + } + + @Override + public boolean supportsSchemasInProcedureCalls() { + return false; + } + + @Override + public boolean supportsSchemasInTableDefinitions() { + return false; + } + + @Override + public boolean supportsSchemasInIndexDefinitions() { + return false; + } + + @Override + public boolean supportsSchemasInPrivilegeDefinitions() { + return false; + } + + @Override + public boolean supportsCatalogsInDataManipulation() { + return false; + } + + @Override + public boolean supportsCatalogsInProcedureCalls() { + return false; + } + + @Override + public boolean supportsCatalogsInTableDefinitions() { + return false; + } + + @Override + public boolean supportsCatalogsInIndexDefinitions() { + return false; + } + + @Override + public boolean supportsCatalogsInPrivilegeDefinitions() { + return false; + } + + @Override + public boolean supportsPositionedDelete() { + return false; + } + + @Override + public boolean supportsPositionedUpdate() { + return false; + } + + @Override + public boolean supportsSelectForUpdate() { + return false; + } + + @Override + public boolean supportsStoredProcedures() { + return false; + } + + @Override + public boolean supportsSubqueriesInComparisons() { + return false; + } + + @Override + public boolean supportsSubqueriesInExists() { + return false; + } + + @Override + public boolean supportsSubqueriesInIns() { + return false; + } + + @Override + public boolean supportsSubqueriesInQuantifieds() { + return false; + } + + @Override + public boolean supportsCorrelatedSubqueries() { + return false; + } + + @Override + public boolean supportsUnion() { + return true; + } + + @Override + public boolean supportsUnionAll() { + return true; + } + + @Override + public boolean supportsOpenCursorsAcrossCommit() { + return false; + } + + @Override + public boolean supportsOpenCursorsAcrossRollback() { + return false; + } + + @Override + public boolean supportsOpenStatementsAcrossCommit() { + return false; + } + + @Override + public boolean supportsOpenStatementsAcrossRollback() { + return false; + } + + @Override + // No limit + public int getMaxBinaryLiteralLength() { + return 0; + } + + @Override + // No Limit + public int getMaxCharLiteralLength() { + return 0; + } + + @Override + // GoogleSQL documentation says 300. + // https://cloud.google.com/bigquery/quotas#all_tables + public int getMaxColumnNameLength() { + return GOOGLE_SQL_MAX_COL_NAME_LEN; + } + + @Override + // No specific limits for group by. + public int getMaxColumnsInGroupBy() { + return 0; + } + + @Override + // No specific limits for index. + public int getMaxColumnsInIndex() { + return 0; + } + + @Override + // No specific limit for Order By. + public int getMaxColumnsInOrderBy() { + return 0; + } + + @Override + // All columns can be selected. No specific limits. + public int getMaxColumnsInSelect() { + return 0; + } + + @Override + public int getMaxColumnsInTable() { + return GOOGLE_SQL_MAX_COLS_PER_TABLE; + } + + @Override + public int getMaxConnections() { + // Per JDBC spec, returns 0 as there is no connection limit or is unknown. + return 0; + } + + @Override + public int getMaxCursorNameLength() { + // BigQuery does not support named cursors or positioned updates/deletes. + return 0; + } + + @Override + public int getMaxIndexLength() { + // Per the JDBC spec, 0 indicates this feature is not supported. + return 0; + } + + @Override + public int getMaxSchemaNameLength() { + // Dataset IDs can be up to 1024 characters long. + // See: https://cloud.google.com/bigquery/docs/datasets#dataset-naming + return 1024; + } + + @Override + public int getMaxProcedureNameLength() { + // Routine IDs can be up to 256 characters long. + // See: + // https://cloud.google.com/bigquery/docs/reference/rest/v2/routines#RoutineReference.FIELDS.routine_id + return 256; + } + + @Override + public int getMaxCatalogNameLength() { + // Corresponds to the BigQuery Project ID, which can be a maximum of 30 characters. + // See: + // https://cloud.google.com/resource-manager/docs/creating-managing-projects#before_you_begin + return 30; + } + + @Override + public int getMaxRowSize() { + // Per JDBC spec, returns 0 as there is no fixed limit or is unknown. + return 0; + } + + @Override + public boolean doesMaxRowSizeIncludeBlobs() { + return false; + } + + @Override + public int getMaxStatementLength() { + // Per JDBC spec, returns 0 as there is no fixed limit or is unknown. + // See: https://cloud.google.com/bigquery/quotas#query_jobs + return 0; + } + + @Override + public int getMaxStatements() { + // Per JDBC spec, returns 0 as there is no fixed limit or is unknown. + return 0; + } + + @Override + public int getMaxTableNameLength() { + // Table IDs can be up to 1024 characters long. + // See: https://cloud.google.com/bigquery/docs/tables#table-naming + return 1024; + } + + @Override + public int getMaxTablesInSelect() { + // BigQuery allows up to 1,000 tables to be referenced per query. + // See: https://cloud.google.com/bigquery/quotas#query_jobs + return 1000; + } + + @Override + public int getMaxUserNameLength() { + return 0; + } + + @Override + public int getDefaultTransactionIsolation() { + return Connection.TRANSACTION_SERIALIZABLE; + } + + @Override + public boolean supportsTransactions() { + return true; + } + + @Override + public boolean supportsTransactionIsolationLevel(int level) { + return level == Connection.TRANSACTION_SERIALIZABLE; + } + + @Override + public boolean supportsDataDefinitionAndDataManipulationTransactions() { + return false; + } + + @Override + public boolean supportsDataManipulationTransactionsOnly() { + return false; + } + + @Override + public boolean dataDefinitionCausesTransactionCommit() { + return false; + } + + @Override + public boolean dataDefinitionIgnoredInTransactions() { + return false; + } + + @Override + public ResultSet getProcedures( + String catalog, String schemaPattern, String procedureNamePattern) { + if ((catalog == null || catalog.isEmpty()) + || (schemaPattern != null && schemaPattern.isEmpty()) + || (procedureNamePattern != null && procedureNamePattern.isEmpty())) { + LOG.warning("Returning empty ResultSet as catalog is null/empty or a pattern is empty."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getProcedures called for catalog: %s, schemaPattern: %s, procedureNamePattern: %s", + catalog, schemaPattern, procedureNamePattern)); + + final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); + final Pattern procedureNameRegex = compileSqlLikePattern(procedureNamePattern); + final Schema resultSchema = defineGetProceduresSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final List> processingTaskFutures = new ArrayList<>(); + final String catalogParam = catalog; + + Runnable procedureFetcher = + () -> { + ExecutorService apiExecutor = null; + ExecutorService routineProcessorExecutor = null; + final FieldList localResultSchemaFields = resultSchemaFields; + final List>> apiFutures = new ArrayList<>(); + + try { + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaPattern, + schemaRegex, + LOG); + + if (datasetsToScan.isEmpty()) { + LOG.info("Fetcher thread found no matching datasets. Finishing."); + return; + } + + apiExecutor = Executors.newFixedThreadPool(API_EXECUTOR_POOL_SIZE); + routineProcessorExecutor = Executors.newFixedThreadPool(this.metadataFetchThreadCount); + + LOG.fine("Submitting parallel findMatchingRoutines tasks..."); + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Fetcher interrupted during dataset iteration submission."); + break; + } + + final DatasetId currentDatasetId = dataset.getDatasetId(); + Callable> apiCallable = + () -> + findMatchingBigQueryObjects( + "Routine", + () -> + bigquery.listRoutines( + currentDatasetId, RoutineListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getRoutine( + RoutineId.of( + currentDatasetId.getProject(), + currentDatasetId.getDataset(), + name)), + (rt) -> rt.getRoutineId().getRoutine(), + procedureNamePattern, + procedureNameRegex, + LOG); + Future> apiFuture = apiExecutor.submit(apiCallable); + apiFutures.add(apiFuture); + } + LOG.fine("Finished submitting " + apiFutures.size() + " findMatchingRoutines tasks."); + apiExecutor.shutdown(); + + LOG.fine("Processing results from findMatchingRoutines tasks..."); + for (Future> apiFuture : apiFutures) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Fetcher interrupted while processing API futures."); + break; + } + try { + List routinesResult = apiFuture.get(); + if (routinesResult != null) { + for (Routine routine : routinesResult) { + if (Thread.currentThread().isInterrupted()) break; + + if ("PROCEDURE".equalsIgnoreCase(routine.getRoutineType())) { + LOG.fine( + "Submitting processing task for procedure: " + routine.getRoutineId()); + final Routine finalRoutine = routine; + Future processFuture = + routineProcessorExecutor.submit( + () -> + processProcedureInfo( + finalRoutine, collectedResults, localResultSchemaFields)); + processingTaskFutures.add(processFuture); + } else { + LOG.finer("Skipping non-procedure routine: " + routine.getRoutineId()); + } + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning("Fetcher thread interrupted while waiting for API future result."); + break; + } catch (ExecutionException e) { + LOG.warning( + "Error executing findMatchingRoutines task: " + + e.getMessage() + + ". Cause: " + + e.getCause()); + } catch (CancellationException e) { + LOG.warning("A findMatchingRoutines task was cancelled."); + } + } + + LOG.fine( + "Finished submitting " + + processingTaskFutures.size() + + " processProcedureInfo tasks."); + + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Fetcher interrupted before waiting for processing tasks; cancelling remaining."); + processingTaskFutures.forEach(f -> f.cancel(true)); + } else { + LOG.fine("Waiting for processProcedureInfo tasks to complete..."); + waitForTasksCompletion(processingTaskFutures); + LOG.fine("All processProcedureInfo tasks completed or handled."); + } + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetProceduresComparator(localResultSchemaFields); + sortResults(collectedResults, comparator, "getProcedures", LOG); + } + + if (!Thread.currentThread().isInterrupted()) { + populateQueue(collectedResults, queue, localResultSchemaFields); + } + + } catch (Throwable t) { + LOG.severe("Unexpected error in procedure fetcher runnable: " + t.getMessage()); + apiFutures.forEach(f -> f.cancel(true)); + processingTaskFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, localResultSchemaFields); + shutdownExecutor(apiExecutor); + shutdownExecutor(routineProcessorExecutor); + LOG.info("Procedure fetcher thread finished."); + } + }; + + Thread fetcherThread = new Thread(procedureFetcher, "getProcedures-fetcher-" + catalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getProcedures"); + return resultSet; + } + + Schema defineGetProceduresSchema() { + List fields = new ArrayList<>(9); + fields.add( + Field.newBuilder("PROCEDURE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PROCEDURE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PROCEDURE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("reserved1", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("reserved2", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("reserved3", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PROCEDURE_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("SPECIFIC_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + void processProcedureInfo( + Routine routine, List collectedResults, FieldList resultSchemaFields) { + + RoutineId routineId = routine.getRoutineId(); + LOG.fine("Processing procedure info for: " + routineId); + + try { + if (!"PROCEDURE".equalsIgnoreCase(routine.getRoutineType())) { + LOG.warning( + "processProcedureInfo called with non-procedure type: " + + routine.getRoutineType() + + " for " + + routineId); + return; + } + + String catalogName = routineId.getProject(); + String schemaName = routineId.getDataset(); + String procedureName = routineId.getRoutine(); + String remarks = routine.getDescription(); + + List values = new ArrayList<>(resultSchemaFields.size()); + + values.add(createStringFieldValue(catalogName)); // 1. PROCEDURE_CAT + values.add(createStringFieldValue(schemaName)); // 2. PROCEDURE_SCHEM + values.add(createStringFieldValue(procedureName)); // 3. PROCEDURE_NAME + values.add(createNullFieldValue()); // 4. reserved1 + values.add(createNullFieldValue()); // 5. reserved2 + values.add(createNullFieldValue()); // 6. reserved3 + values.add(createStringFieldValue(remarks)); // 7. REMARKS + values.add( + createLongFieldValue( + (long) DatabaseMetaData.procedureResultUnknown)); // 8. PROCEDURE_TYPE + values.add(createStringFieldValue(procedureName)); // 9. SPECIFIC_NAME + + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + + LOG.fine("Processed and added procedure info row for: " + routineId); + + } catch (Exception e) { + LOG.warning( + String.format( + "Error processing procedure info for %s: %s. Skipping this procedure.", + routineId, e.getMessage())); + } + } + + Comparator defineGetProceduresComparator(FieldList resultSchemaFields) { + final int PROC_CAT_IDX = resultSchemaFields.getIndex("PROCEDURE_CAT"); + final int PROC_SCHEM_IDX = resultSchemaFields.getIndex("PROCEDURE_SCHEM"); + final int PROC_NAME_IDX = resultSchemaFields.getIndex("PROCEDURE_NAME"); + final int SPEC_NAME_IDX = resultSchemaFields.getIndex("SPECIFIC_NAME"); + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_CAT_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_SCHEM_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_NAME_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, SPEC_NAME_IDX), + Comparator.nullsFirst(String::compareTo)); + } + + @Override + public ResultSet getProcedureColumns( + String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) { + + if (catalog == null || catalog.isEmpty()) { + LOG.warning("Returning empty ResultSet because catalog (project) is null or empty."); + return new BigQueryJsonResultSet(); + } + if ((schemaPattern != null && schemaPattern.isEmpty()) + || (procedureNamePattern != null && procedureNamePattern.isEmpty()) + || (columnNamePattern != null && columnNamePattern.isEmpty())) { + LOG.warning("Returning empty ResultSet because an explicit empty pattern was provided."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getProcedureColumns called for catalog: %s, schemaPattern: %s, procedureNamePattern:" + + " %s, columnNamePattern: %s", + catalog, schemaPattern, procedureNamePattern, columnNamePattern)); + + final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); + final Pattern procedureNameRegex = compileSqlLikePattern(procedureNamePattern); + final Pattern columnNameRegex = compileSqlLikePattern(columnNamePattern); + + final Schema resultSchema = defineGetProcedureColumnsSchema(); + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final List> processingTaskFutures = new ArrayList<>(); + final String catalogParam = catalog; + + Runnable procedureColumnFetcher = + () -> { + ExecutorService listRoutinesExecutor = null; + ExecutorService getRoutineDetailsExecutor = null; + ExecutorService processArgsExecutor = null; + + final String fetcherThreadNameSuffix = + "-" + catalogParam.substring(0, Math.min(10, catalogParam.length())); + + try { + List datasetsToScan = + fetchMatchingDatasetsForProcedureColumns(catalogParam, schemaPattern, schemaRegex); + if (datasetsToScan.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info( + "Fetcher: No matching datasets or interrupted early. Catalog: " + catalogParam); + return; + } + + listRoutinesExecutor = + Executors.newFixedThreadPool( + API_EXECUTOR_POOL_SIZE, + runnable -> new Thread(runnable, "pcol-list-rout" + fetcherThreadNameSuffix)); + List procedureIdsToGet = + listMatchingProcedureIdsFromDatasets( + datasetsToScan, + procedureNamePattern, + procedureNameRegex, + listRoutinesExecutor, + catalogParam, + LOG); + shutdownExecutor(listRoutinesExecutor); + listRoutinesExecutor = null; + + if (procedureIdsToGet.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info("Fetcher: No procedure IDs found or interrupted. Catalog: " + catalogParam); + return; + } + + getRoutineDetailsExecutor = + Executors.newFixedThreadPool( + 100, + runnable -> new Thread(runnable, "pcol-get-details" + fetcherThreadNameSuffix)); + List fullRoutines = + fetchFullRoutineDetailsForIds(procedureIdsToGet, getRoutineDetailsExecutor, LOG); + shutdownExecutor(getRoutineDetailsExecutor); + getRoutineDetailsExecutor = null; + + if (fullRoutines.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info( + "Fetcher: No full routines fetched or interrupted. Catalog: " + catalogParam); + return; + } + + processArgsExecutor = + Executors.newFixedThreadPool( + this.metadataFetchThreadCount, + runnable -> new Thread(runnable, "pcol-proc-args" + fetcherThreadNameSuffix)); + submitProcedureArgumentProcessingJobs( + fullRoutines, + columnNameRegex, + collectedResults, + resultSchema.getFields(), + processArgsExecutor, + processingTaskFutures, + LOG); + + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Fetcher: Interrupted before waiting for argument processing. Catalog: " + + catalogParam); + processingTaskFutures.forEach(f -> f.cancel(true)); + } else { + LOG.fine( + "Fetcher: Waiting for " + + processingTaskFutures.size() + + " argument processing tasks. Catalog: " + + catalogParam); + waitForTasksCompletion(processingTaskFutures); + LOG.fine( + "Fetcher: All argument processing tasks completed or handled. Catalog: " + + catalogParam); + } + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetProcedureColumnsComparator(resultSchema.getFields()); + sortResults(collectedResults, comparator, "getProcedureColumns", LOG); + populateQueue(collectedResults, queue, resultSchema.getFields()); + } + + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning( + "Fetcher: Interrupted in main try block for catalog " + + catalogParam + + ". Error: " + + e.getMessage()); + processingTaskFutures.forEach(f -> f.cancel(true)); + } catch (Throwable t) { + LOG.severe( + "Fetcher: Unexpected error in main try block for catalog " + + catalogParam + + ". Error: " + + t.getMessage()); + processingTaskFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, resultSchema.getFields()); + if (listRoutinesExecutor != null) shutdownExecutor(listRoutinesExecutor); + if (getRoutineDetailsExecutor != null) shutdownExecutor(getRoutineDetailsExecutor); + if (processArgsExecutor != null) shutdownExecutor(processArgsExecutor); + LOG.info("Procedure column fetcher thread finished for catalog: " + catalogParam); + } + }; + + Thread fetcherThread = + new Thread(procedureColumnFetcher, "getProcedureColumns-fetcher-" + catalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getProcedureColumns for catalog: " + catalog); + return resultSet; + } + + private List fetchMatchingDatasetsForProcedureColumns( + String catalogParam, String schemaPattern, Pattern schemaRegex) throws InterruptedException { + LOG.fine( + String.format( + "Fetching matching datasets for catalog '%s', schemaPattern '%s'", + catalogParam, schemaPattern)); + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets(catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaPattern, + schemaRegex, + LOG); + LOG.info( + String.format( + "Found %d datasets to scan for procedures in catalog '%s'.", + datasetsToScan.size(), catalogParam)); + return datasetsToScan; + } + + List listMatchingProcedureIdsFromDatasets( + List datasetsToScan, + String procedureNamePattern, + Pattern procedureNameRegex, + ExecutorService listRoutinesExecutor, + String catalogParam, + BigQueryJdbcCustomLogger logger) + throws InterruptedException { + + logger.fine( + String.format( + "Listing matching procedure IDs from %d datasets for catalog '%s'.", + datasetsToScan.size(), catalogParam)); + final List>> listRoutineFutures = new ArrayList<>(); + final List procedureIdsToGet = Collections.synchronizedList(new ArrayList<>()); + + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + logger.warning( + "Interrupted during submission of routine listing tasks for catalog: " + catalogParam); + throw new InterruptedException("Interrupted while listing routines"); + } + final DatasetId currentDatasetId = dataset.getDatasetId(); + Callable> listCallable = + () -> + findMatchingBigQueryObjects( + "Routine", + () -> + bigquery.listRoutines( + currentDatasetId, RoutineListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getRoutine( + RoutineId.of( + currentDatasetId.getProject(), currentDatasetId.getDataset(), name)), + (rt) -> rt.getRoutineId().getRoutine(), + procedureNamePattern, + procedureNameRegex, + logger); + listRoutineFutures.add(listRoutinesExecutor.submit(listCallable)); + } + logger.fine( + "Submitted " + + listRoutineFutures.size() + + " routine list tasks for catalog: " + + catalogParam); + + for (Future> listFuture : listRoutineFutures) { + if (Thread.currentThread().isInterrupted()) { + logger.warning( + "Interrupted while collecting routine list results for catalog: " + catalogParam); + listRoutineFutures.forEach(f -> f.cancel(true)); + throw new InterruptedException("Interrupted while collecting routine lists"); + } + try { + List listedRoutines = listFuture.get(); + if (listedRoutines != null) { + for (Routine listedRoutine : listedRoutines) { + if (listedRoutine != null + && "PROCEDURE".equalsIgnoreCase(listedRoutine.getRoutineType())) { + if (listedRoutine.getRoutineId() != null) { + procedureIdsToGet.add(listedRoutine.getRoutineId()); + } else { + logger.warning( + "Found a procedure type routine with a null ID during listing phase for" + + " catalog: " + + catalogParam); + } + } + } + } + } catch (ExecutionException e) { + logger.warning( + "Error getting routine list result for catalog " + catalogParam + ": " + e.getCause()); + } catch (CancellationException e) { + logger.warning("Routine list task cancelled for catalog: " + catalogParam); + } + } + logger.info( + String.format( + "Found %d procedure IDs to fetch details for in catalog '%s'.", + procedureIdsToGet.size(), catalogParam)); + return procedureIdsToGet; + } + + List fetchFullRoutineDetailsForIds( + List procedureIdsToGet, + ExecutorService getRoutineDetailsExecutor, + BigQueryJdbcCustomLogger logger) + throws InterruptedException { + logger.fine( + String.format("Fetching full details for %d procedure IDs.", procedureIdsToGet.size())); + final List> getRoutineFutures = new ArrayList<>(); + final List fullRoutines = Collections.synchronizedList(new ArrayList<>()); + + for (RoutineId procId : procedureIdsToGet) { + if (Thread.currentThread().isInterrupted()) { + logger.warning("Interrupted during submission of getRoutine detail tasks."); + throw new InterruptedException("Interrupted while submitting getRoutine tasks"); + } + final RoutineId currentProcId = procId; + Callable getCallable = + () -> { + try { + return bigquery.getRoutine(currentProcId); + } catch (Exception e) { + logger.warning( + "Failed to get full details for routine " + + currentProcId + + ": " + + e.getMessage()); + return null; + } + }; + getRoutineFutures.add(getRoutineDetailsExecutor.submit(getCallable)); + } + logger.fine("Submitted " + getRoutineFutures.size() + " getRoutine detail tasks."); + + for (Future getFuture : getRoutineFutures) { + if (Thread.currentThread().isInterrupted()) { + logger.warning("Interrupted while collecting getRoutine detail results."); + getRoutineFutures.forEach(f -> f.cancel(true)); // Cancel remaining + throw new InterruptedException("Interrupted while collecting Routine details"); + } + try { + Routine fullRoutine = getFuture.get(); + if (fullRoutine != null) { + fullRoutines.add(fullRoutine); + } + } catch (ExecutionException e) { + logger.warning("Error processing getRoutine future result: " + e.getCause()); + } catch (CancellationException e) { + logger.warning("getRoutine detail task cancelled."); + } + } + logger.info( + String.format("Successfully fetched full details for %d routines.", fullRoutines.size())); + return fullRoutines; + } + + void submitProcedureArgumentProcessingJobs( + List fullRoutines, + Pattern columnNameRegex, + List collectedResults, + FieldList resultSchemaFields, + ExecutorService processArgsExecutor, + List> outArgumentProcessingFutures, + BigQueryJdbcCustomLogger logger) + throws InterruptedException { + logger.fine( + String.format("Submitting argument processing jobs for %d routines.", fullRoutines.size())); + + for (Routine fullRoutine : fullRoutines) { + if (Thread.currentThread().isInterrupted()) { + logger.warning("Interrupted during submission of argument processing tasks."); + throw new InterruptedException("Interrupted while submitting argument processing jobs"); + } + if (fullRoutine != null) { + if ("PROCEDURE".equalsIgnoreCase(fullRoutine.getRoutineType())) { + final Routine finalFullRoutine = fullRoutine; + Future processFuture = + processArgsExecutor.submit( + () -> + processProcedureArguments( + finalFullRoutine, columnNameRegex, collectedResults, resultSchemaFields)); + outArgumentProcessingFutures.add(processFuture); + } else { + logger.warning( + "Routine " + + (fullRoutine.getRoutineId() != null + ? fullRoutine.getRoutineId().toString() + : "UNKNOWN_ID") + + " fetched via getRoutine was not of type PROCEDURE (Type: " + + fullRoutine.getRoutineType() + + "). Skipping argument processing."); + } + } + } + logger.fine( + "Finished submitting " + + outArgumentProcessingFutures.size() + + " processProcedureArguments tasks."); + } + + Schema defineGetProcedureColumnsSchema() { + List fields = new ArrayList<>(20); + fields.add( + Field.newBuilder("PROCEDURE_CAT", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PROCEDURE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PROCEDURE_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("COLUMN_TYPE", StandardSQLTypeName.INT64).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("PRECISION", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("LENGTH", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + fields.add(Field.newBuilder("SCALE", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + fields.add(Field.newBuilder("RADIX", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("NULLABLE", StandardSQLTypeName.INT64).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("COLUMN_DEF", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("SQL_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SQL_DATETIME_SUB", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("CHAR_OCTET_LENGTH", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("ORDINAL_POSITION", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("IS_NULLABLE", StandardSQLTypeName.STRING).setMode(Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("SPECIFIC_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + void processProcedureArguments( + Routine routine, + Pattern columnNameRegex, + List collectedResults, + FieldList resultSchemaFields) { + + RoutineId routineId = routine.getRoutineId(); + List arguments; + try { + arguments = routine.getArguments(); + } catch (Exception e) { + LOG.warning( + String.format( + "Could not retrieve arguments list for procedure %s: %s. No arguments will be" + + " processed.", + routineId, e.getMessage())); + return; + } + + if (arguments == null || arguments.isEmpty()) { + LOG.fine("Procedure " + routineId + " has no arguments."); + return; + } + + String catalogName = routineId.getProject(); + String schemaName = routineId.getDataset(); + String procedureName = routineId.getRoutine(); + String specificName = procedureName; + + for (int i = 0; i < arguments.size(); i++) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Argument processing task interrupted for " + routineId); + break; + } + + int ordinalPosition = i + 1; + RoutineArgument arg; + String argName; + + try { + arg = arguments.get(i); + argName = arg.getName(); + } catch (Exception listAccessException) { + LOG.warning( + String.format( + "Exception during arguments.get(%d) for Proc: %s. Ordinal: %d. Message: %s." + + " Generating fallback row.", + i, routineId, ordinalPosition, listAccessException.getMessage())); + argName = "arg_retrieval_err_" + ordinalPosition; + arg = null; + } + + // Filter by columnNamePattern, but not by generated fallback name + if (columnNameRegex != null) { + assert argName != null; + if (!argName.startsWith("arg_")) { + if (!columnNameRegex.matcher(argName).matches()) { + continue; + } + } + } + + List values = + createProcedureColumnRow( + catalogName, schemaName, procedureName, specificName, arg, ordinalPosition, argName); + + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + } + } + + List createProcedureColumnRow( + String catalog, + String schemaName, + String procedureName, + String specificName, + @Nullable RoutineArgument argument, + int ordinalPosition, + String columnName) { + + List values = new ArrayList<>(20); + ColumnTypeInfo typeInfo; + + if (argument == null) { + LOG.warning( + String.format( + "Proc: %s, Arg: %s (Pos %d) - RoutineArgument object is null. Defaulting type to" + + " VARCHAR.", + procedureName, columnName, ordinalPosition)); + typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); + } else { + try { + StandardSQLDataType argumentDataType = argument.getDataType(); + if (argumentDataType == null) { + LOG.warning( + String.format( + "Proc: %s, Arg: %s (Pos %d) - argument.getDataType() returned null. Defaulting" + + " type to VARCHAR.", + procedureName, columnName, ordinalPosition)); + typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); + } else { + typeInfo = + determineTypeInfoFromDataType( + argumentDataType, procedureName, columnName, ordinalPosition); + } + } catch (Exception e) { + LOG.warning( + String.format( + "Proc: %s, Arg: %s (Pos %d) - Unexpected Exception during type processing." + + " Defaulting type to VARCHAR. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage())); + typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); + } + } + + String argumentModeStr = null; + if (argument != null) { + try { + argumentModeStr = argument.getMode(); + } catch (Exception e) { + LOG.warning( + String.format( + "Proc: %s, Arg: %s (Pos %d) - Could not get argument mode. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage())); + } + } + + values.add(createStringFieldValue(catalog)); // 1. PROCEDURE_CAT + values.add(createStringFieldValue(schemaName)); // 2. PROCEDURE_SCHEM + values.add(createStringFieldValue(procedureName)); // 3. PROCEDURE_NAME + values.add(createStringFieldValue(columnName)); // 4. COLUMN_NAME + long columnTypeJdbc = DatabaseMetaData.procedureColumnUnknown; + if ("IN".equalsIgnoreCase(argumentModeStr)) { + columnTypeJdbc = DatabaseMetaData.procedureColumnIn; + } else if ("OUT".equalsIgnoreCase(argumentModeStr)) { + columnTypeJdbc = DatabaseMetaData.procedureColumnOut; + } else if ("INOUT".equalsIgnoreCase(argumentModeStr)) { + columnTypeJdbc = DatabaseMetaData.procedureColumnInOut; + } + values.add(createLongFieldValue(columnTypeJdbc)); // 5. COLUMN_TYPE + values.add(createLongFieldValue((long) typeInfo.jdbcType)); // 6. DATA_TYPE (java.sql.Types) + values.add(createStringFieldValue(typeInfo.typeName)); // 7. TYPE_NAME (DB type name) + values.add( + createLongFieldValue( + typeInfo.columnSize == null ? null : typeInfo.columnSize.longValue())); // 8. PRECISION + values.add( + createNullFieldValue()); // 9. LENGTH (length in bytes - often null for procedure params) + values.add( + createLongFieldValue( + typeInfo.decimalDigits == null + ? null + : typeInfo.decimalDigits.longValue())); // 10. SCALE + values.add( + createLongFieldValue( + typeInfo.numPrecRadix == null ? null : typeInfo.numPrecRadix.longValue())); // 11. RADIX + values.add(createLongFieldValue((long) DatabaseMetaData.procedureNullable)); // 12. NULLABLE + values.add( + createNullFieldValue()); // 13. REMARKS (Can be argument.getDescription() if available and + // needed) + values.add(createNullFieldValue()); // 14. COLUMN_DEF (Default value - typically null) + values.add(createNullFieldValue()); // 15. SQL_DATA_TYPE (reserved) + values.add(createNullFieldValue()); // 16. SQL_DATETIME_SUB (reserved) + values.add(createNullFieldValue()); // 17. CHAR_OCTET_LENGTH (null for non-char/binary) + values.add(createLongFieldValue((long) ordinalPosition)); // 18. ORDINAL_POSITION + values.add(createStringFieldValue("YES")); // 19. IS_NULLABLE (Default to "YES") + values.add(createStringFieldValue(specificName)); // 20. SPECIFIC_NAME + + return values; + } + + ColumnTypeInfo determineTypeInfoFromDataType( + StandardSQLDataType argumentDataType, + String procedureName, + String columnName, + int ordinalPosition) { + + ColumnTypeInfo defaultVarcharTypeInfo = + new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); + try { + String typeKind = argumentDataType.getTypeKind(); + if (typeKind != null && !typeKind.isEmpty()) { + if ("ARRAY".equalsIgnoreCase(typeKind)) { + return new ColumnTypeInfo(Types.ARRAY, "ARRAY", null, null, null); + } + StandardSQLTypeName determinedType = StandardSQLTypeName.valueOf(typeKind.toUpperCase()); + return getColumnTypeInfoForSqlType(determinedType); + } + } catch (Exception e) { + LOG.warning( + String.format( + "Proc: %s, Arg: %s (Pos %d) - Caught an unexpected Exception during type" + + " determination. Defaulting type to VARCHAR. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage())); + } + return defaultVarcharTypeInfo; + } + + Comparator defineGetProcedureColumnsComparator(FieldList resultSchemaFields) { + final int PROC_CAT_IDX = resultSchemaFields.getIndex("PROCEDURE_CAT"); + final int PROC_SCHEM_IDX = resultSchemaFields.getIndex("PROCEDURE_SCHEM"); + final int PROC_NAME_IDX = resultSchemaFields.getIndex("PROCEDURE_NAME"); + final int SPEC_NAME_IDX = resultSchemaFields.getIndex("SPECIFIC_NAME"); + final int COL_NAME_IDX = resultSchemaFields.getIndex("COLUMN_NAME"); + + if (PROC_CAT_IDX < 0 + || PROC_SCHEM_IDX < 0 + || PROC_NAME_IDX < 0 + || SPEC_NAME_IDX < 0 + || COL_NAME_IDX < 0) { + LOG.severe( + "Could not find required columns (PROCEDURE_CAT, SCHEM, NAME, SPECIFIC_NAME, COLUMN_NAME)" + + " in getProcedureColumns schema for sorting. Returning null comparator."); + return null; + } + + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_CAT_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_SCHEM_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, PROC_NAME_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, SPEC_NAME_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, COL_NAME_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)); + } + + @Override + public ResultSet getTables( + String catalog, String schemaPattern, String tableNamePattern, String[] types) { + + Tuple effectiveIdentifiers = + determineEffectiveCatalogAndSchema(catalog, schemaPattern); + String effectiveCatalog = effectiveIdentifiers.x(); + String effectiveSchemaPattern = effectiveIdentifiers.y(); + + if ((effectiveCatalog == null || effectiveCatalog.isEmpty()) + || (effectiveSchemaPattern != null && effectiveSchemaPattern.isEmpty()) + || (tableNamePattern != null && tableNamePattern.isEmpty())) { + LOG.warning( + "Returning empty ResultSet as one or more patterns are empty or catalog is null."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s, types: %s", + effectiveCatalog, effectiveSchemaPattern, tableNamePattern, Arrays.toString(types))); + + final Pattern schemaRegex = compileSqlLikePattern(effectiveSchemaPattern); + final Pattern tableNameRegex = compileSqlLikePattern(tableNamePattern); + final Set requestedTypes = + (types == null || types.length == 0) ? null : new HashSet<>(Arrays.asList(types)); + + final Schema resultSchema = defineGetTablesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final String catalogParam = effectiveCatalog; + final String schemaParam = effectiveSchemaPattern; + + Runnable tableFetcher = + () -> { + ExecutorService apiExecutor = null; + ExecutorService tableProcessorExecutor = null; + final FieldList localResultSchemaFields = resultSchemaFields; + final List>> apiFutures = new ArrayList<>(); + final List> processingFutures = new ArrayList<>(); + + try { + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaParam, + schemaRegex, + LOG); + + if (datasetsToScan.isEmpty()) { + LOG.info("Fetcher thread found no matching datasets. Returning empty resultset."); + return; + } + + apiExecutor = Executors.newFixedThreadPool(API_EXECUTOR_POOL_SIZE); + tableProcessorExecutor = Executors.newFixedThreadPool(this.metadataFetchThreadCount); + + LOG.fine("Submitting parallel findMatchingTables tasks..."); + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Table fetcher interrupted during dataset iteration."); + break; + } + + final DatasetId currentDatasetId = dataset.getDatasetId(); + Callable> apiCallable = + () -> + findMatchingBigQueryObjects( + "Table", + () -> + bigquery.listTables( + currentDatasetId, TableListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getTable( + TableId.of( + currentDatasetId.getProject(), + currentDatasetId.getDataset(), + name)), + (tbl) -> tbl.getTableId().getTable(), + tableNamePattern, + tableNameRegex, + LOG); + Future> apiFuture = apiExecutor.submit(apiCallable); + apiFutures.add(apiFuture); + } + LOG.fine("Finished submitting " + apiFutures.size() + " findMatchingTables tasks."); + apiExecutor.shutdown(); + + LOG.fine("Processing results from findMatchingTables tasks..."); + for (Future> apiFuture : apiFutures) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Table fetcher interrupted while processing API futures."); + break; + } + try { + List
    tablesResult = apiFuture.get(); + if (tablesResult != null) { + for (Table table : tablesResult) { + if (Thread.currentThread().isInterrupted()) break; + + final Table currentTable = table; + Future processFuture = + tableProcessorExecutor.submit( + () -> + processTableInfo( + currentTable, + requestedTypes, + collectedResults, + localResultSchemaFields)); + processingFutures.add(processFuture); + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning("Fetcher thread interrupted while waiting for API future result."); + break; + } catch (ExecutionException e) { + LOG.warning( + "Error executing findMatchingTables task: " + + e.getMessage() + + ". Cause: " + + e.getCause()); + } catch (CancellationException e) { + LOG.warning("A findMatchingTables task was cancelled."); + } + } + + LOG.fine( + "Finished submitting " + processingFutures.size() + " processTableInfo tasks."); + + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Fetcher interrupted before waiting for processing tasks; cancelling remaining."); + processingFutures.forEach(f -> f.cancel(true)); + } else { + LOG.fine("Waiting for processTableInfo tasks to complete..."); + waitForTasksCompletion(processingFutures); + LOG.fine("All processTableInfo tasks completed."); + } + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetTablesComparator(localResultSchemaFields); + sortResults(collectedResults, comparator, "getTables", LOG); + } + + if (!Thread.currentThread().isInterrupted()) { + populateQueue(collectedResults, queue, localResultSchemaFields); + } + + } catch (Throwable t) { + LOG.severe("Unexpected error in table fetcher runnable: " + t.getMessage()); + apiFutures.forEach(f -> f.cancel(true)); + processingFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, localResultSchemaFields); + shutdownExecutor(apiExecutor); + shutdownExecutor(tableProcessorExecutor); + LOG.info("Table fetcher thread finished."); + } + }; + + Thread fetcherThread = new Thread(tableFetcher, "getTables-fetcher-" + effectiveCatalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getTables"); + return resultSet; + } + + Schema defineGetTablesSchema() { + List fields = new ArrayList<>(10); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("TABLE_TYPE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SELF_REFERENCING_COL_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("REF_GENERATION", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + return Schema.of(fields); + } + + void processTableInfo( + Table table, + Set requestedTypes, + List collectedResults, + FieldList resultSchemaFields) { + + TableId tableId = table.getTableId(); + LOG.fine("Processing table info for: " + tableId); + + try { + String catalogName = tableId.getProject(); + String schemaName = tableId.getDataset(); + String tableName = tableId.getTable(); + TableDefinition definition = table.getDefinition(); + String bqTableType = definition.getType().toString(); + String remarks = table.getDescription(); + + if (requestedTypes != null && !requestedTypes.contains(bqTableType)) { + LOG.finer( + String.format( + "Skipping table %s as its type '%s' is not in the requested types %s", + tableId, bqTableType, requestedTypes)); + return; + } + + List values = new ArrayList<>(resultSchemaFields.size()); + values.add(createStringFieldValue(catalogName)); // 1. TABLE_CAT + values.add(createStringFieldValue(schemaName)); // 2. TABLE_SCHEM + values.add(createStringFieldValue(tableName)); // 3. TABLE_NAME + values.add(createStringFieldValue(bqTableType)); // 4. TABLE_TYPE + values.add(createStringFieldValue(remarks)); // 5. REMARKS + values.add(createNullFieldValue()); // 6. TYPE_CAT (always null) + values.add(createNullFieldValue()); // 7. TYPE_SCHEM (always null) + values.add(createNullFieldValue()); // 8. TYPE_NAME (always null) + values.add(createNullFieldValue()); // 9. SELF_REFERENCING_COL_NAME (always null) + values.add(createNullFieldValue()); // 10. REF_GENERATION (always null) + + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + + LOG.fine("Processed and added table info row for: " + tableId); + } catch (Exception e) { + LOG.warning( + String.format( + "Error processing table info for %s: %s. Skipping this table.", + tableId, e.getMessage())); + } + } + + Comparator defineGetTablesComparator(FieldList resultSchemaFields) { + final int TABLE_TYPE_IDX = resultSchemaFields.getIndex("TABLE_TYPE"); + final int TABLE_CAT_IDX = resultSchemaFields.getIndex("TABLE_CAT"); + final int TABLE_SCHEM_IDX = resultSchemaFields.getIndex("TABLE_SCHEM"); + final int TABLE_NAME_IDX = resultSchemaFields.getIndex("TABLE_NAME"); + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_TYPE_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_CAT_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_SCHEM_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_NAME_IDX), + Comparator.nullsFirst(String::compareTo)); + } + + @Override + public ResultSet getSchemas() { + LOG.info("getSchemas() called"); + + return getSchemas(null, null); + } + + @Override + public ResultSet getCatalogs() { + LOG.info("getCatalogs() called"); + + final List accessibleCatalogs = getAccessibleCatalogNames(); + final Schema catalogsSchema = defineGetCatalogsSchema(); + final FieldList schemaFields = catalogsSchema.getFields(); + final List catalogRows = + prepareGetCatalogsRows(schemaFields, accessibleCatalogs); + + final BlockingQueue queue = + new LinkedBlockingQueue<>(catalogRows.isEmpty() ? 1 : catalogRows.size() + 1); + + populateQueue(catalogRows, queue, schemaFields); + signalEndOfData(queue, schemaFields); + + return BigQueryJsonResultSet.of( + catalogsSchema, catalogRows.size(), queue, this.statement, new Thread[0]); + } + + Schema defineGetCatalogsSchema() { + return Schema.of( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING).setMode(Mode.REQUIRED).build()); + } + + List prepareGetCatalogsRows( + FieldList schemaFields, List accessibleCatalogs) { + List catalogRows = new ArrayList<>(); + for (String catalogName : accessibleCatalogs) { + FieldValue fieldValue = FieldValue.of(FieldValue.Attribute.PRIMITIVE, catalogName); + catalogRows.add(FieldValueList.of(Collections.singletonList(fieldValue), schemaFields)); + } + return catalogRows; + } + + @Override + public ResultSet getTableTypes() { + LOG.info("getTableTypes() called"); + + final Schema tableTypesSchema = defineGetTableTypesSchema(); + final List tableTypeRows = prepareGetTableTypesRows(tableTypesSchema); + + BlockingQueue queue = + new LinkedBlockingQueue<>(tableTypeRows.size() + 1); + + populateQueue(tableTypeRows, queue, tableTypesSchema.getFields()); + signalEndOfData(queue, tableTypesSchema.getFields()); + + return BigQueryJsonResultSet.of( + tableTypesSchema, tableTypeRows.size(), queue, this.statement, new Thread[0]); + } + + static Schema defineGetTableTypesSchema() { + return Schema.of( + Field.newBuilder("TABLE_TYPE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + } + + static List prepareGetTableTypesRows(Schema schema) { + final String[] tableTypes = {"EXTERNAL", "MATERIALIZED VIEW", "SNAPSHOT", "TABLE", "VIEW"}; + List rows = new ArrayList<>(tableTypes.length); + FieldList schemaFields = schema.getFields(); + + for (String typeName : tableTypes) { + FieldValue fieldValue = FieldValue.of(FieldValue.Attribute.PRIMITIVE, typeName); + rows.add(FieldValueList.of(Collections.singletonList(fieldValue), schemaFields)); + } + return rows; + } + + @Override + public ResultSet getColumns( + String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) { + + Tuple effectiveIdentifiers = + determineEffectiveCatalogAndSchema(catalog, schemaPattern); + String effectiveCatalog = effectiveIdentifiers.x(); + String effectiveSchemaPattern = effectiveIdentifiers.y(); + + if ((effectiveCatalog == null || effectiveCatalog.isEmpty()) + || (effectiveSchemaPattern != null && effectiveSchemaPattern.isEmpty()) + || (tableNamePattern != null && tableNamePattern.isEmpty()) + || (columnNamePattern != null && columnNamePattern.isEmpty())) { + LOG.warning( + "Returning empty ResultSet as one or more patterns are empty or catalog is null."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," + + " columnNamePattern: %s", + effectiveCatalog, effectiveSchemaPattern, tableNamePattern, columnNamePattern)); + + Pattern schemaRegex = compileSqlLikePattern(effectiveSchemaPattern); + Pattern tableNameRegex = compileSqlLikePattern(tableNamePattern); + Pattern columnNameRegex = compileSqlLikePattern(columnNamePattern); + + final Schema resultSchema = defineGetColumnsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final String catalogParam = effectiveCatalog; + final String schemaParam = effectiveSchemaPattern; + + Runnable columnFetcher = + () -> { + ExecutorService columnExecutor = null; + final List> taskFutures = new ArrayList<>(); + final FieldList localResultSchemaFields = resultSchemaFields; + + try { + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaParam, + schemaRegex, + LOG); + + if (datasetsToScan.isEmpty()) { + LOG.info("Fetcher thread found no matching datasets. Returning empty resultset."); + return; + } + + columnExecutor = Executors.newFixedThreadPool(this.metadataFetchThreadCount); + + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Fetcher interrupted during dataset iteration."); + break; + } + + DatasetId datasetId = dataset.getDatasetId(); + LOG.info("Processing dataset: " + datasetId.getDataset()); + + List
    tablesToScan = + findMatchingBigQueryObjects( + "Table", + () -> + bigquery.listTables( + datasetId, TableListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getTable( + TableId.of(datasetId.getProject(), datasetId.getDataset(), name)), + (tbl) -> tbl.getTableId().getTable(), + tableNamePattern, + tableNameRegex, + LOG); + + for (Table table : tablesToScan) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Fetcher interrupted during table iteration for dataset " + + datasetId.getDataset()); + break; + } + + TableId tableId = table.getTableId(); + LOG.fine("Submitting task for table: " + tableId); + final Table finalTable = table; + Future future = + columnExecutor.submit( + () -> + processTableColumns( + finalTable, + columnNameRegex, + collectedResults, + localResultSchemaFields)); + taskFutures.add(future); + } + if (Thread.currentThread().isInterrupted()) break; + } + + waitForTasksCompletion(taskFutures); + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetColumnsComparator(localResultSchemaFields); + sortResults(collectedResults, comparator, "getColumns", LOG); + } + + if (!Thread.currentThread().isInterrupted()) { + populateQueue(collectedResults, queue, localResultSchemaFields); + } + + } catch (Throwable t) { + LOG.severe("Unexpected error in column fetcher runnable: " + t.getMessage()); + taskFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, localResultSchemaFields); + shutdownExecutor(columnExecutor); + LOG.info("Column fetcher thread finished."); + } + }; + + Thread fetcherThread = new Thread(columnFetcher, "getColumns-fetcher-" + effectiveCatalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of(resultSchema, -1, queue, null, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getColumns"); + return resultSet; + } + + private void processTableColumns( + Table table, + Pattern columnNameRegex, + List collectedResults, + FieldList resultSchemaFields) { + TableId tableId = table.getTableId(); + LOG.fine("Processing columns for table: " + tableId); + TableDefinition definition = table.getDefinition(); + Schema tableSchema = (definition != null) ? definition.getSchema() : null; + + try { + if (tableSchema == null) { + LOG.fine( + "Schema not included in table object for " + + tableId + + ", fetching full table details..."); + Table fullTable = bigquery.getTable(tableId); + if (fullTable != null) { + definition = fullTable.getDefinition(); + tableSchema = (definition != null) ? definition.getSchema() : null; + } else { + LOG.warning( + "Table " + tableId + " not found when fetching full details for columns. Skipping."); + return; + } + } + + if (tableSchema == null + || tableSchema.getFields() == null + || tableSchema.getFields().isEmpty()) { + LOG.warning( + String.format( + "Schema not found or fields are null for table %s (Type: %s). Skipping columns.", + tableId, definition.getType())); + return; + } + + FieldList fields = tableSchema.getFields(); + String catalogName = tableId.getProject(); + String schemaName = tableId.getDataset(); + String tableName = tableId.getTable(); + + for (int i = 0; i < fields.size(); i++) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Task for table " + tableId + " interrupted during column iteration."); + break; + } + Field field = fields.get(i); + String currentColumnName = field.getName(); + if (columnNameRegex != null && !columnNameRegex.matcher(currentColumnName).matches()) + continue; + List values = createColumnRow(catalogName, schemaName, tableName, field, i + 1); + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + } + LOG.fine("Finished processing columns for table: " + tableId); + } catch (BigQueryException e) { + LOG.warning( + String.format( + "BigQueryException processing table %s: %s (Code: %d)", + tableId, e.getMessage(), e.getCode())); + } catch (Exception e) { + LOG.severe( + String.format("Unexpected error processing table %s: %s", tableId, e.getMessage())); + } + } + + private Schema defineGetColumnsSchema() { + List fields = new ArrayList<>(24); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 1 + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 2 + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 3 + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 4 + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); // 5 + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 6 + fields.add( + Field.newBuilder("COLUMN_SIZE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 7 + fields.add( + Field.newBuilder("BUFFER_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 8 + fields.add( + Field.newBuilder("DECIMAL_DIGITS", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 9 + fields.add( + Field.newBuilder("NUM_PREC_RADIX", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 10 + fields.add( + Field.newBuilder("NULLABLE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); // 11 + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 12 + fields.add( + Field.newBuilder("COLUMN_DEF", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 13 + fields.add( + Field.newBuilder("SQL_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 14 + fields.add( + Field.newBuilder("SQL_DATETIME_SUB", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 15 + fields.add( + Field.newBuilder("CHAR_OCTET_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 16 + fields.add( + Field.newBuilder("ORDINAL_POSITION", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); // 17 + fields.add( + Field.newBuilder("IS_NULLABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 18 + fields.add( + Field.newBuilder("SCOPE_CATALOG", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 19 + fields.add( + Field.newBuilder("SCOPE_SCHEMA", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 20 + fields.add( + Field.newBuilder("SCOPE_TABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 21 + fields.add( + Field.newBuilder("SOURCE_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 22 + fields.add( + Field.newBuilder("IS_AUTOINCREMENT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 23 + fields.add( + Field.newBuilder("IS_GENERATEDCOLUMN", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 24 + return Schema.of(fields); + } + + List createColumnRow( + String catalog, String schemaName, String tableName, Field field, int ordinalPosition) { + List values = new ArrayList<>(24); + Field.Mode mode = (field.getMode() == null) ? Field.Mode.NULLABLE : field.getMode(); + ColumnTypeInfo typeInfo = mapBigQueryTypeToJdbc(field); + + values.add(createStringFieldValue(catalog)); // 1. TABLE_CAT + values.add(createStringFieldValue(schemaName)); // 2. TABLE_SCHEM + values.add(createStringFieldValue(tableName)); // 3. TABLE_NAME + values.add(createStringFieldValue(field.getName())); // 4. COLUMN_NAME + values.add(createLongFieldValue((long) typeInfo.jdbcType)); // 5. DATA_TYPE + values.add(createStringFieldValue(typeInfo.typeName)); // 6. TYPE_NAME + values.add( + createLongFieldValue( + typeInfo.columnSize == null + ? null + : typeInfo.columnSize.longValue())); // 7. COLUMN_SIZE + values.add(createNullFieldValue()); // 8. BUFFER_LENGTH + values.add( + createLongFieldValue( + typeInfo.decimalDigits == null + ? null + : typeInfo.decimalDigits.longValue())); // 9. DECIMAL_DIGITS + values.add( + createLongFieldValue( + typeInfo.numPrecRadix == null + ? null + : typeInfo.numPrecRadix.longValue())); // 10. NUM_PREC_RADIX + int nullable = + (mode == Field.Mode.REQUIRED) + ? DatabaseMetaData.columnNoNulls + : DatabaseMetaData.columnNullable; + values.add(createLongFieldValue((long) nullable)); // 11. NULLABLE + values.add(createStringFieldValue(field.getDescription())); // 12. REMARKS + values.add(createNullFieldValue()); // 13. COLUMN_DEF + values.add(createNullFieldValue()); // 14. SQL_DATA_TYPE + values.add(createNullFieldValue()); // 15. SQL_DATETIME_SUB + values.add(createNullFieldValue()); // 16. CHAR_OCTET_LENGTH + values.add(createLongFieldValue((long) ordinalPosition)); // 17. ORDINAL_POSITION + String isNullable = ""; + switch (mode) { + case REQUIRED: + isNullable = "NO"; + break; + case NULLABLE: + case REPEATED: + isNullable = "YES"; + break; + } + values.add(createStringFieldValue(isNullable)); // 18. IS_NULLABLE + values.add(createNullFieldValue()); // 19. SCOPE_CATALOG + values.add(createNullFieldValue()); // 20. SCOPE_SCHEMA + values.add(createNullFieldValue()); // 21. SCOPE_TABLE + values.add(createNullFieldValue()); // 22. SOURCE_DATA_TYPE + values.add(createStringFieldValue("NO")); // 23. IS_AUTOINCREMENT + values.add(createStringFieldValue("NO")); // 24. IS_GENERATEDCOLUMN + + return values; + } + + static class ColumnTypeInfo { + final int jdbcType; + final String typeName; + final Integer columnSize; + final Integer decimalDigits; + final Integer numPrecRadix; + + ColumnTypeInfo( + int jdbcType, + String typeName, + Integer columnSize, + Integer decimalDigits, + Integer numPrecRadix) { + this.jdbcType = jdbcType; + this.typeName = typeName; + this.columnSize = columnSize; + this.decimalDigits = decimalDigits; + this.numPrecRadix = numPrecRadix; + } + } + + ColumnTypeInfo mapBigQueryTypeToJdbc(Field field) { + Mode mode = (field.getMode() == null) ? Mode.NULLABLE : field.getMode(); + if (mode == Mode.REPEATED) { + return new ColumnTypeInfo(Types.ARRAY, "ARRAY", null, null, null); + } + + StandardSQLTypeName bqType = null; + if (field.getType() != null && field.getType().getStandardType() != null) { + bqType = field.getType().getStandardType(); + } + return getColumnTypeInfoForSqlType(bqType); + } + + private Comparator defineGetColumnsComparator(FieldList resultSchemaFields) { + final int TABLE_CAT_IDX = resultSchemaFields.getIndex("TABLE_CAT"); + final int TABLE_SCHEM_IDX = resultSchemaFields.getIndex("TABLE_SCHEM"); + final int TABLE_NAME_IDX = resultSchemaFields.getIndex("TABLE_NAME"); + final int ORDINAL_POS_IDX = resultSchemaFields.getIndex("ORDINAL_POSITION"); + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_CAT_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_SCHEM_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_NAME_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getLongValueOrNull(fvl, ORDINAL_POS_IDX), + Comparator.nullsFirst(Long::compareTo)); + } + + @Override + public ResultSet getColumnPrivileges( + String catalog, String schema, String table, String columnNamePattern) { + LOG.info( + String.format( + "getColumnPrivileges called for catalog: %s, schema: %s, table: %s, columnNamePattern:" + + " %s. BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", + catalog, schema, table, columnNamePattern)); + + final Schema resultSchema = defineGetColumnPrivilegesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetColumnPrivilegesSchema() { + List fields = defineBasePrivilegeFields(); + + Field columnNameField = + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build(); + fields.add(3, columnNameField); + + return Schema.of(fields); + } + + @Override + public ResultSet getTablePrivileges( + String catalog, String schemaPattern, String tableNamePattern) { + LOG.info( + String.format( + "getTablePrivileges called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " + + "BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", + catalog, schemaPattern, tableNamePattern)); + + final Schema resultSchema = defineGetTablePrivilegesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetTablePrivilegesSchema() { + List fields = defineBasePrivilegeFields(); + return Schema.of(fields); + } + + @Override + public ResultSet getBestRowIdentifier( + String catalog, String schema, String table, int scope, boolean nullable) { + LOG.info( + String.format( + "getBestRowIdentifier called for catalog: %s, schema: %s, table: %s, scope: %d," + + " nullable: %s. BigQuery does not support best row identifiers; returning empty" + + " ResultSet.", + catalog, schema, table, scope, nullable)); + + final Schema resultSchema = defineGetBestRowIdentifierSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetBestRowIdentifierSchema() { + List fields = new ArrayList<>(8); + fields.add( + Field.newBuilder("SCOPE", StandardSQLTypeName.INT64).setMode(Field.Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_SIZE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("BUFFER_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("DECIMAL_DIGITS", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PSEUDO_COLUMN", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + @Override + public ResultSet getVersionColumns(String catalog, String schema, String table) { + LOG.info( + String.format( + "getVersionColumns called for catalog: %s, schema: %s, table: %s. " + + "Automatic version columns not supported by BigQuery; returning empty ResultSet.", + catalog, schema, table)); + + final Schema resultSchema = defineGetVersionColumnsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetVersionColumnsSchema() { + List fields = new ArrayList<>(8); + fields.add( + Field.newBuilder("SCOPE", StandardSQLTypeName.INT64).setMode(Field.Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_SIZE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("BUFFER_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DECIMAL_DIGITS", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PSEUDO_COLUMN", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + @Override + public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException { + String sql = readSqlFromFile(GET_PRIMARY_KEYS_SQL); + try { + String formattedSql = replaceSqlParameters(sql, catalog, schema, table); + return this.statement.executeQuery(formattedSql); + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Override + public ResultSet getImportedKeys(String catalog, String schema, String table) + throws SQLException { + String sql = readSqlFromFile(GET_IMPORTED_KEYS_SQL); + try { + String formattedSql = replaceSqlParameters(sql, catalog, schema, table); + return this.statement.executeQuery(formattedSql); + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Override + public ResultSet getExportedKeys(String catalog, String schema, String table) + throws SQLException { + String sql = readSqlFromFile(GET_EXPORTED_KEYS_SQL); + try { + String formattedSql = replaceSqlParameters(sql, catalog, schema, table); + return this.statement.executeQuery(formattedSql); + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Override + public ResultSet getCrossReference( + String parentCatalog, + String parentSchema, + String parentTable, + String foreignCatalog, + String foreignSchema, + String foreignTable) + throws SQLException { + String sql = readSqlFromFile(GET_CROSS_REFERENCE_SQL); + try { + String formattedSql = + replaceSqlParameters( + sql, + parentCatalog, + parentSchema, + parentTable, + foreignCatalog, + foreignSchema, + foreignTable); + return this.statement.executeQuery(formattedSql); + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Override + public ResultSet getTypeInfo() { + LOG.info("getTypeInfo() called"); + + final Schema typeInfoSchema = defineGetTypeInfoSchema(); + final FieldList schemaFields = typeInfoSchema.getFields(); + final List typeInfoRows = prepareGetTypeInfoRows(schemaFields); + + final Comparator comparator = defineGetTypeInfoComparator(schemaFields); + sortResults(typeInfoRows, comparator, "getTypeInfo", LOG); + final BlockingQueue queue = + new LinkedBlockingQueue<>(typeInfoRows.size() + 1); + + populateQueue(typeInfoRows, queue, schemaFields); + signalEndOfData(queue, schemaFields); + return BigQueryJsonResultSet.of( + typeInfoSchema, typeInfoRows.size(), queue, this.statement, new Thread[0]); + } + + Schema defineGetTypeInfoSchema() { + List fields = new ArrayList<>(18); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 1 + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 2 + fields.add( + Field.newBuilder("PRECISION", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 3 + fields.add( + Field.newBuilder("LITERAL_PREFIX", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 4 + fields.add( + Field.newBuilder("LITERAL_SUFFIX", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 5 + fields.add( + Field.newBuilder("CREATE_PARAMS", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 6 + fields.add( + Field.newBuilder("NULLABLE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 7 + fields.add( + Field.newBuilder("CASE_SENSITIVE", StandardSQLTypeName.BOOL) + .setMode(Mode.REQUIRED) + .build()); // 8 + fields.add( + Field.newBuilder("SEARCHABLE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 9 + fields.add( + Field.newBuilder("UNSIGNED_ATTRIBUTE", StandardSQLTypeName.BOOL) + .setMode(Mode.NULLABLE) + .build()); // 10 + fields.add( + Field.newBuilder("FIXED_PREC_SCALE", StandardSQLTypeName.BOOL) + .setMode(Mode.REQUIRED) + .build()); // 11 + fields.add( + Field.newBuilder("AUTO_INCREMENT", StandardSQLTypeName.BOOL) + .setMode(Mode.REQUIRED) + .build()); // 12 + fields.add( + Field.newBuilder("LOCAL_TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 13 + fields.add( + Field.newBuilder("MINIMUM_SCALE", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 14 + fields.add( + Field.newBuilder("MAXIMUM_SCALE", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 15 + fields.add( + Field.newBuilder("SQL_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 16 + fields.add( + Field.newBuilder("SQL_DATETIME_SUB", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 17 + fields.add( + Field.newBuilder("NUM_PREC_RADIX", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 18 + return Schema.of(fields); + } + + List prepareGetTypeInfoRows(FieldList schemaFields) { + List rows = new ArrayList<>(); + + Function createRow = + (data) -> { + List values = new ArrayList<>(18); + values.add(createStringFieldValue(data.typeName)); // 1. TYPE_NAME + values.add(createLongFieldValue((long) data.jdbcType)); // 2. DATA_TYPE + values.add(createLongFieldValue(data.precision)); // 3. PRECISION + values.add(createStringFieldValue(data.literalPrefix)); // 4. LITERAL_PREFIX + values.add(createStringFieldValue(data.literalSuffix)); // 5. LITERAL_SUFFIX + values.add(createStringFieldValue(data.createParams)); // 6. CREATE_PARAMS + values.add(createLongFieldValue((long) data.nullable)); // 7. NULLABLE + values.add(createBooleanFieldValue(data.caseSensitive)); // 8. CASE_SENSITIVE + values.add(createLongFieldValue((long) data.searchable)); // 9. SEARCHABLE + values.add(createBooleanFieldValue(data.unsignedAttribute)); // 10. UNSIGNED_ATTRIBUTE + values.add(createBooleanFieldValue(data.fixedPrecScale)); // 11. FIXED_PREC_SCALE + values.add(createBooleanFieldValue(data.autoIncrement)); // 12. AUTO_INCREMENT + values.add(createStringFieldValue(data.localTypeName)); // 13. LOCAL_TYPE_NAME + values.add(createLongFieldValue(data.minimumScale)); // 14. MINIMUM_SCALE + values.add(createLongFieldValue(data.maximumScale)); // 15. MAXIMUM_SCALE + values.add(createNullFieldValue()); // 16. SQL_DATA_TYPE + values.add(createNullFieldValue()); // 17. SQL_DATETIME_SUB + values.add(createLongFieldValue(data.numPrecRadix)); // 18. NUM_PREC_RADIX + return FieldValueList.of(values, schemaFields); + }; + + rows.add( + createRow.apply( + new TypeInfoRowData( + "INT64", + Types.BIGINT, + 19L, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "INT64", + 0L, + 0L, + 10L))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "BOOL", + Types.BOOLEAN, + 1L, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typePredBasic, + false, + false, + false, + "BOOL", + 0L, + 0L, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "FLOAT64", + Types.DOUBLE, + 15L, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "FLOAT64", + null, + null, + 2L))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "NUMERIC", + Types.NUMERIC, + 38L, + null, + null, + "PRECISION,SCALE", + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + true, + false, + "NUMERIC", + 9L, + 9L, + 10L))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "BIGNUMERIC", + Types.NUMERIC, + 77L, + null, + null, + "PRECISION,SCALE", + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + true, + false, + "BIGNUMERIC", + 38L, + 38L, + 10L))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "STRING", + Types.NVARCHAR, + null, + "'", + "'", + "LENGTH", + DatabaseMetaData.typeNullable, + true, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "STRING", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "TIMESTAMP", + Types.TIMESTAMP, + 29L, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "TIMESTAMP", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "DATE", + Types.DATE, + 10L, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "DATE", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "TIME", + Types.TIME, + 15L, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "TIME", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "DATETIME", + Types.TIMESTAMP, + 29L, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "DATETIME", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "GEOGRAPHY", + Types.OTHER, + null, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "GEOGRAPHY", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "JSON", + Types.OTHER, + null, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "JSON", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "INTERVAL", + Types.OTHER, + null, + "'", + "'", + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "INTERVAL", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "BYTES", + Types.VARBINARY, + null, + "0x", + null, + "LENGTH", + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "BYTES", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "STRUCT", + Types.STRUCT, + null, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typePredNone, + false, + false, + false, + "STRUCT", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "ARRAY", + Types.ARRAY, + null, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typePredNone, + false, + false, + false, + "ARRAY", + null, + null, + null))); + rows.add( + createRow.apply( + new TypeInfoRowData( + "RANGE", + Types.OTHER, + null, + null, + null, + null, + DatabaseMetaData.typeNullable, + false, + DatabaseMetaData.typeSearchable, + false, + false, + false, + "RANGE", + null, + null, + null))); + + return rows; + } + + Comparator defineGetTypeInfoComparator(FieldList schemaFields) { + final int DATA_TYPE_IDX = schemaFields.getIndex("DATA_TYPE"); + if (DATA_TYPE_IDX < 0) { + LOG.severe( + "Could not find DATA_TYPE column in getTypeInfo schema for sorting. Returning null" + + " comparator."); + return null; + } + Comparator comparator = + Comparator.comparing( + (FieldValueList fvl) -> getLongValueOrNull(fvl, DATA_TYPE_IDX), + Comparator.nullsFirst(Long::compareTo)); + return comparator; + } + + @Override + public ResultSet getIndexInfo( + String catalog, String schema, String table, boolean unique, boolean approximate) { + LOG.info( + String.format( + "getIndexInfo called for catalog: %s, schema: %s, table: %s, unique: %s, approximate:" + + " %s. Traditional indexes not supported by BigQuery; returning empty ResultSet.", + catalog, schema, table, unique, approximate)); + + final Schema resultSchema = defineGetIndexInfoSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetIndexInfoSchema() { + List fields = new ArrayList<>(13); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("NON_UNIQUE", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("INDEX_QUALIFIER", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("INDEX_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE", StandardSQLTypeName.INT64).setMode(Field.Mode.REQUIRED).build()); + fields.add( + Field.newBuilder("ORDINAL_POSITION", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("ASC_OR_DESC", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("CARDINALITY", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("PAGES", StandardSQLTypeName.INT64).setMode(Field.Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("FILTER_CONDITION", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + return Schema.of(fields); + } + + @Override + public boolean supportsResultSetType(int type) { + // BigQuery primarily supports forward-only result sets. + return type == ResultSet.TYPE_FORWARD_ONLY; + } + + @Override + public boolean supportsResultSetConcurrency(int type, int concurrency) { + // BigQuery primarily supports forward-only, read-only result sets. + return type == ResultSet.TYPE_FORWARD_ONLY && concurrency == ResultSet.CONCUR_READ_ONLY; + } + + @Override + public boolean ownUpdatesAreVisible(int type) { + return false; + } + + @Override + public boolean ownDeletesAreVisible(int type) { + return false; + } + + @Override + public boolean ownInsertsAreVisible(int type) { + return false; + } + + @Override + public boolean othersUpdatesAreVisible(int type) { + return false; + } + + @Override + public boolean othersDeletesAreVisible(int type) { + return false; + } + + @Override + public boolean othersInsertsAreVisible(int type) { + return false; + } + + @Override + public boolean updatesAreDetected(int type) { + return false; + } + + @Override + public boolean deletesAreDetected(int type) { + return false; + } + + @Override + public boolean insertsAreDetected(int type) { + return false; + } + + @Override + public boolean supportsBatchUpdates() { + return false; + } + + @Override + public ResultSet getUDTs( + String catalog, String schemaPattern, String typeNamePattern, int[] types) { + LOG.info( + String.format( + "getUDTs called for catalog: %s, schemaPattern: %s, typeNamePattern: %s, types: %s. " + + "Feature not supported by BigQuery; returning empty ResultSet.", + catalog, + schemaPattern, + typeNamePattern, + (types == null ? "null" : Arrays.toString(types)))); + + final Schema resultSchema = defineGetUDTsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetUDTsSchema() { + List fields = new ArrayList<>(7); + fields.add( + Field.newBuilder("TYPE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("CLASS_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("BASE_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + return Schema.of(fields); + } + + @Override + public Connection getConnection() { + return connection; + } + + @Override + public boolean supportsSavepoints() { + return false; + } + + @Override + public boolean supportsNamedParameters() { + return false; + } + + @Override + public boolean supportsMultipleOpenResults() { + return false; + } + + @Override + public boolean supportsGetGeneratedKeys() { + return false; + } + + @Override + public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) { + LOG.info( + String.format( + "getSuperTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " + + "BigQuery does not support super tables; returning empty ResultSet.", + catalog, schemaPattern, tableNamePattern)); + + final Schema resultSchema = defineGetSuperTablesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetSuperTablesSchema() { + List fields = new ArrayList<>(4); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 1. TABLE_CAT + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 2. TABLE_SCHEM + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 3. TABLE_NAME + fields.add( + Field.newBuilder("SUPERTABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 4. SUPERTABLE_NAME + return Schema.of(fields); + } + + @Override + public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) { + LOG.info( + String.format( + "getSuperTypes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s. BigQuery" + + " does not support user-defined type hierarchies; returning empty ResultSet.", + catalog, schemaPattern, typeNamePattern)); + + final Schema resultSchema = defineGetSuperTypesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetSuperTypesSchema() { + List fields = new ArrayList<>(6); + fields.add( + Field.newBuilder("TYPE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 1. TYPE_CAT + fields.add( + Field.newBuilder("TYPE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 2. TYPE_SCHEM + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 3. TYPE_NAME + fields.add( + Field.newBuilder("SUPERTYPE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 4. SUPERTYPE_CAT + fields.add( + Field.newBuilder("SUPERTYPE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 5. SUPERTYPE_SCHEM + fields.add( + Field.newBuilder("SUPERTYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 6. SUPERTYPE_NAME + return Schema.of(fields); + } + + @Override + public ResultSet getAttributes( + String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) { + LOG.info( + String.format( + "getAttributes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s," + + " attributeNamePattern: %s. Feature not supported by BigQuery; returning empty" + + " ResultSet.", + catalog, schemaPattern, typeNamePattern, attributeNamePattern)); + + final Schema resultSchema = defineGetAttributesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetAttributesSchema() { + List fields = new ArrayList<>(21); + fields.add( + Field.newBuilder("TYPE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("ATTR_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("ATTR_TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("ATTR_SIZE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("DECIMAL_DIGITS", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("NUM_PREC_RADIX", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("NULLABLE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("ATTR_DEF", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SQL_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SQL_DATETIME_SUB", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("CHAR_OCTET_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("ORDINAL_POSITION", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("IS_NULLABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("SCOPE_CATALOG", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SCOPE_SCHEMA", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SCOPE_TABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("SOURCE_DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + return Schema.of(fields); + } + + @Override + public boolean supportsResultSetHoldability(int holdability) { + if (holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT) { + return true; + } + return false; + } + + @Override + public int getResultSetHoldability() { + return ResultSet.CLOSE_CURSORS_AT_COMMIT; + } + + @Override + // Obtained from java libraries pom + // https://github.com/googleapis/java-bigquery/blob/main/pom.xml + public int getDatabaseMajorVersion() { + return 2; + } + + @Override + public int getDatabaseMinorVersion() { + return 0; + } + + @Override + public int getJDBCMajorVersion() { + return 4; + } + + @Override + public int getJDBCMinorVersion() { + return 2; + } + + @Override + public int getSQLStateType() { + return DatabaseMetaData.sqlStateSQL; + } + + @Override + public boolean locatorsUpdateCopy() { + return false; + } + + @Override + public boolean supportsStatementPooling() { + return false; + } + + @Override + public RowIdLifetime getRowIdLifetime() { + return null; + } + + @Override + public ResultSet getSchemas(String catalog, String schemaPattern) { + if ((catalog != null && catalog.isEmpty()) + || (schemaPattern != null && schemaPattern.isEmpty())) { + LOG.warning("Returning empty ResultSet as catalog or schemaPattern is an empty string."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getSchemas called for catalog: %s, schemaPattern: %s", catalog, schemaPattern)); + + final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); + final Schema resultSchema = defineGetSchemasSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final String catalogParam = catalog; + + Runnable schemaFetcher = + () -> { + final FieldList localResultSchemaFields = resultSchemaFields; + List projectsToScanList = new ArrayList<>(); + + if (catalogParam != null) { + projectsToScanList.add(catalogParam); + } else { + projectsToScanList.addAll(getAccessibleCatalogNames()); + } + + if (projectsToScanList.isEmpty()) { + LOG.info( + "No valid projects to scan (primary, specified, or additional). Returning empty" + + " resultset."); + return; + } + + try { + for (String currentProjectToScan : projectsToScanList) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Schema fetcher interrupted during project iteration for project: " + + currentProjectToScan); + break; + } + LOG.info("Fetching schemas for project: " + currentProjectToScan); + List datasetsInProject = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + currentProjectToScan, + BigQuery.DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(currentProjectToScan, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaPattern, + schemaRegex, + LOG); + + if (datasetsInProject.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info( + "Fetcher thread found no matching datasets in project: " + + currentProjectToScan); + continue; + } + + LOG.fine("Processing found datasets for project: " + currentProjectToScan); + for (Dataset dataset : datasetsInProject) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Schema fetcher interrupted during dataset iteration for project: " + + currentProjectToScan); + break; + } + processSchemaInfo(dataset, collectedResults, localResultSchemaFields); + } + } + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetSchemasComparator(localResultSchemaFields); + sortResults(collectedResults, comparator, "getSchemas", LOG); + } + + if (!Thread.currentThread().isInterrupted()) { + populateQueue(collectedResults, queue, localResultSchemaFields); + } + + } catch (Throwable t) { + LOG.severe("Unexpected error in schema fetcher runnable: " + t.getMessage()); + } finally { + signalEndOfData(queue, localResultSchemaFields); + LOG.info("Schema fetcher thread finished."); + } + }; + + Thread fetcherThread = new Thread(schemaFetcher, "getSchemas-fetcher-" + catalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getSchemas"); + return resultSet; + } + + Schema defineGetSchemasSchema() { + List fields = new ArrayList<>(2); + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("TABLE_CATALOG", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + return Schema.of(fields); + } + + void processSchemaInfo( + Dataset dataset, List collectedResults, FieldList resultSchemaFields) { + DatasetId datasetId = dataset.getDatasetId(); + LOG.finer("Processing schema info for dataset: " + datasetId); + try { + String schemaName = datasetId.getDataset(); + String catalogName = datasetId.getProject(); + List values = new ArrayList<>(resultSchemaFields.size()); + values.add(createStringFieldValue(schemaName)); + values.add(createStringFieldValue(catalogName)); + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + LOG.finer("Processed and added schema info row for: " + datasetId); + } catch (Exception e) { + LOG.warning( + String.format( + "Error processing schema info for dataset %s: %s. Skipping this schema.", + datasetId, e.getMessage())); + } + } + + Comparator defineGetSchemasComparator(FieldList resultSchemaFields) { + final int TABLE_CATALOG_IDX = resultSchemaFields.getIndex("TABLE_CATALOG"); + final int TABLE_SCHEM_IDX = resultSchemaFields.getIndex("TABLE_SCHEM"); + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_CATALOG_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, TABLE_SCHEM_IDX), + Comparator.nullsFirst(String::compareTo)); + } + + @Override + public boolean supportsStoredFunctionsUsingCallSyntax() { + return false; + } + + @Override + public boolean autoCommitFailureClosesAllResultSets() { + return false; + } + + @Override + public ResultSet getClientInfoProperties() { + LOG.info("getClientInfoProperties() called."); + + final Schema resultSchema = defineGetClientInfoPropertiesSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(4); + final List collectedResults = new ArrayList<>(3); + + try { + collectedResults.add( + FieldValueList.of( + Arrays.asList( + createStringFieldValue("ApplicationName"), + createLongFieldValue(25L), + createNullFieldValue(), + createStringFieldValue( + "The name of the application currently utilizing the connection.")), + resultSchemaFields)); + + collectedResults.add( + FieldValueList.of( + Arrays.asList( + createStringFieldValue("ClientHostname"), + createLongFieldValue(25L), + createNullFieldValue(), + createStringFieldValue( + "The hostname of the computer the application using the connection is running" + + " on.")), + resultSchemaFields)); + + collectedResults.add( + FieldValueList.of( + Arrays.asList( + createStringFieldValue("ClientUser"), + createLongFieldValue(25L), + createNullFieldValue(), + createStringFieldValue( + "The name of the user that the application using the connection is performing" + + " work for.")), + resultSchemaFields)); + + Comparator comparator = + Comparator.comparing( + (FieldValueList fvl) -> + getStringValueOrNull(fvl, resultSchemaFields.getIndex("NAME")), + Comparator.nullsFirst(String::compareToIgnoreCase)); + sortResults(collectedResults, comparator, "getClientInfoProperties", LOG); + populateQueue(collectedResults, queue, resultSchemaFields); + + } catch (Exception e) { + LOG.warning("Unexpected error processing client info properties: " + e.getMessage()); + collectedResults.clear(); + queue.clear(); + } finally { + signalEndOfData(queue, resultSchemaFields); + } + return BigQueryJsonResultSet.of( + resultSchema, collectedResults.size(), queue, this.statement, new Thread[0]); + } + + Schema defineGetClientInfoPropertiesSchema() { + List fields = new ArrayList<>(4); + fields.add( + Field.newBuilder("NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); // 1 + fields.add( + Field.newBuilder("MAX_LEN", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); // 2 + fields.add( + Field.newBuilder("DEFAULT_VALUE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 3 + fields.add( + Field.newBuilder("DESCRIPTION", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); // 4 + return Schema.of(fields); + } + + @Override + public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) { + if ((catalog == null || catalog.isEmpty()) + || (schemaPattern != null && schemaPattern.isEmpty()) + || (functionNamePattern != null && functionNamePattern.isEmpty())) { + LOG.warning( + "Returning empty ResultSet as catalog is null/empty or a pattern is empty for" + + " getFunctions."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getFunctions called for catalog: %s, schemaPattern: %s, functionNamePattern: %s", + catalog, schemaPattern, functionNamePattern)); + + final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); + final Pattern functionNameRegex = compileSqlLikePattern(functionNamePattern); + final Schema resultSchema = defineGetFunctionsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final List> processingTaskFutures = new ArrayList<>(); + final String catalogParam = catalog; + + Runnable functionFetcher = + () -> { + ExecutorService apiExecutor = null; + ExecutorService routineProcessorExecutor = null; + final FieldList localResultSchemaFields = resultSchemaFields; + final List>> apiFutures = new ArrayList<>(); + + try { + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaPattern, + schemaRegex, + LOG); + + if (datasetsToScan.isEmpty()) { + LOG.info("Fetcher thread found no matching datasets. Returning empty resultset."); + return; + } + + apiExecutor = Executors.newFixedThreadPool(API_EXECUTOR_POOL_SIZE); + routineProcessorExecutor = Executors.newFixedThreadPool(this.metadataFetchThreadCount); + + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Function fetcher interrupted during dataset iteration submission."); + break; + } + + final DatasetId currentDatasetId = dataset.getDatasetId(); + + Callable> apiCallable = + () -> { + LOG.fine( + String.format( + "Fetching all routines for dataset: %s, pattern: %s", + currentDatasetId.getDataset(), functionNamePattern)); + return findMatchingBigQueryObjects( + "Routine", + () -> + bigquery.listRoutines( + currentDatasetId, RoutineListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getRoutine( + RoutineId.of( + currentDatasetId.getProject(), + currentDatasetId.getDataset(), + name)), + (rt) -> rt.getRoutineId().getRoutine(), + functionNamePattern, + functionNameRegex, + LOG); + }; + Future> apiFuture = apiExecutor.submit(apiCallable); + apiFutures.add(apiFuture); + } + LOG.fine( + "Finished submitting " + + apiFutures.size() + + " findMatchingRoutines (for functions) tasks."); + apiExecutor.shutdown(); + + for (Future> apiFuture : apiFutures) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Function fetcher interrupted while processing API futures."); + break; + } + try { + List routinesResult = apiFuture.get(); + if (routinesResult != null) { + for (Routine routine : routinesResult) { + if (Thread.currentThread().isInterrupted()) { + break; + } + String routineType = routine.getRoutineType(); + if ("SCALAR_FUNCTION".equalsIgnoreCase(routineType) + || "TABLE_FUNCTION".equalsIgnoreCase(routineType)) { + LOG.fine( + "Submitting processing task for function: " + + routine.getRoutineId() + + " of type " + + routineType); + final Routine finalRoutine = routine; + Future processFuture = + routineProcessorExecutor.submit( + () -> + processFunctionInfo( + finalRoutine, collectedResults, localResultSchemaFields)); + processingTaskFutures.add(processFuture); + } + } + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning( + "Function fetcher thread interrupted while waiting for API future result."); + break; + } catch (ExecutionException | CancellationException e) { + LOG.warning( + "Error or cancellation in findMatchingRoutines (for functions) task: " + + e.getMessage()); + } + } + waitForTasksCompletion(processingTaskFutures); + Comparator comparator = + defineGetFunctionsComparator(localResultSchemaFields); + sortResults(collectedResults, comparator, "getFunctions", LOG); + populateQueue(collectedResults, queue, localResultSchemaFields); + } catch (Throwable t) { + LOG.severe("Unexpected error in function fetcher runnable: " + t.getMessage()); + apiFutures.forEach(f -> f.cancel(true)); + processingTaskFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, localResultSchemaFields); + shutdownExecutor(apiExecutor); + shutdownExecutor(routineProcessorExecutor); + LOG.info("Function fetcher thread finished."); + } + }; + + Thread fetcherThread = new Thread(functionFetcher, "getFunctions-fetcher-" + catalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getFunctions"); + return resultSet; + } + + Schema defineGetFunctionsSchema() { + List fields = new ArrayList<>(6); + fields.add( + Field.newBuilder("FUNCTION_CAT", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("FUNCTION_SCHEM", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("FUNCTION_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING).setMode(Mode.NULLABLE).build()); + fields.add( + Field.newBuilder("FUNCTION_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("SPECIFIC_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + void processFunctionInfo( + Routine routine, List collectedResults, FieldList resultSchemaFields) { + RoutineId routineId = routine.getRoutineId(); + LOG.fine("Processing function info for: " + routineId); + + try { + String catalogName = routineId.getProject(); + String schemaName = routineId.getDataset(); + String functionName = routineId.getRoutine(); + String remarks = routine.getDescription(); + String specificName = functionName; + + short functionType; + String bqRoutineType = routine.getRoutineType(); + if ("SCALAR_FUNCTION".equalsIgnoreCase(bqRoutineType)) { + functionType = DatabaseMetaData.functionResultUnknown; + } else if ("TABLE_FUNCTION".equalsIgnoreCase(bqRoutineType)) { + functionType = DatabaseMetaData.functionReturnsTable; + } else { + functionType = DatabaseMetaData.functionResultUnknown; + } + + List values = new ArrayList<>(resultSchemaFields.size()); + values.add(createStringFieldValue(catalogName)); // 1. FUNCTION_CAT + values.add(createStringFieldValue(schemaName)); // 2. FUNCTION_SCHEM + values.add(createStringFieldValue(functionName)); // 3. FUNCTION_NAME + values.add(createStringFieldValue(remarks)); // 4. REMARKS + values.add(createLongFieldValue((long) functionType)); // 5. FUNCTION_TYPE + values.add(createStringFieldValue(specificName)); // 6. SPECIFIC_NAME + + FieldValueList rowFvl = FieldValueList.of(values, resultSchemaFields); + collectedResults.add(rowFvl); + LOG.fine("Processed and added function info row for: " + routineId); + + } catch (Exception e) { + LOG.warning( + String.format( + "Error processing function info for %s: %s. Skipping this function.", + routineId, e.getMessage())); + } + } + + Comparator defineGetFunctionsComparator(FieldList resultSchemaFields) { + final int FUNC_CAT_IDX = resultSchemaFields.getIndex("FUNCTION_CAT"); + final int FUNC_SCHEM_IDX = resultSchemaFields.getIndex("FUNCTION_SCHEM"); + final int FUNC_NAME_IDX = resultSchemaFields.getIndex("FUNCTION_NAME"); + final int SPEC_NAME_IDX = resultSchemaFields.getIndex("SPECIFIC_NAME"); + + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_CAT_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_SCHEM_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_NAME_IDX), + Comparator.nullsFirst(String::compareTo)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, SPEC_NAME_IDX), + Comparator.nullsFirst(String::compareTo)); + } + + @Override + public ResultSet getFunctionColumns( + String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) { + if (catalog == null || catalog.isEmpty()) { + LOG.warning("Returning empty ResultSet catalog (project) is null or empty."); + return new BigQueryJsonResultSet(); + } + if ((schemaPattern != null && schemaPattern.isEmpty()) + || (functionNamePattern != null && functionNamePattern.isEmpty()) + || (columnNamePattern != null && columnNamePattern.isEmpty())) { + LOG.warning("Returning empty ResultSet because an explicit empty pattern was provided."); + return new BigQueryJsonResultSet(); + } + + LOG.info( + String.format( + "getFunctionColumns called for catalog: %s, schemaPattern: %s, functionNamePattern: %s," + + " columnNamePattern: %s", + catalog, schemaPattern, functionNamePattern, columnNamePattern)); + + final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); + final Pattern functionNameRegex = compileSqlLikePattern(functionNamePattern); + final Pattern columnNameRegex = compileSqlLikePattern(columnNamePattern); + + final Schema resultSchema = defineGetFunctionColumnsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = + new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY); + final List collectedResults = Collections.synchronizedList(new ArrayList<>()); + final List> processingTaskFutures = new ArrayList<>(); + final String catalogParam = catalog; + + Runnable functionColumnFetcher = + () -> { + ExecutorService listRoutinesExecutor = null; + ExecutorService getRoutineDetailsExecutor = null; + ExecutorService processParamsExecutor = null; + final String fetcherThreadNameSuffix = + "-" + catalogParam.substring(0, Math.min(10, catalogParam.length())); + + try { + List datasetsToScan = + findMatchingBigQueryObjects( + "Dataset", + () -> + bigquery.listDatasets( + catalogParam, DatasetListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> bigquery.getDataset(DatasetId.of(catalogParam, name)), + (ds) -> ds.getDatasetId().getDataset(), + schemaPattern, + schemaRegex, + LOG); + + if (datasetsToScan.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info( + "Fetcher: No matching datasets or interrupted early. Catalog: " + catalogParam); + return; + } + + listRoutinesExecutor = + Executors.newFixedThreadPool( + API_EXECUTOR_POOL_SIZE, + runnable -> new Thread(runnable, "funcol-list-rout" + fetcherThreadNameSuffix)); + List functionIdsToGet = + listMatchingFunctionIdsFromDatasets( + datasetsToScan, + functionNamePattern, + functionNameRegex, + listRoutinesExecutor, + catalogParam, + LOG); + shutdownExecutor(listRoutinesExecutor); + listRoutinesExecutor = null; + + if (functionIdsToGet.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info("Fetcher: No function IDs found or interrupted. Catalog: " + catalogParam); + return; + } + + getRoutineDetailsExecutor = + Executors.newFixedThreadPool( + this.metadataFetchThreadCount, + runnable -> + new Thread(runnable, "funcol-get-details" + fetcherThreadNameSuffix)); + List fullFunctions = + fetchFullRoutineDetailsForIds(functionIdsToGet, getRoutineDetailsExecutor, LOG); + shutdownExecutor(getRoutineDetailsExecutor); + getRoutineDetailsExecutor = null; + + if (fullFunctions.isEmpty() || Thread.currentThread().isInterrupted()) { + LOG.info( + "Fetcher: No full functions fetched or interrupted. Catalog: " + catalogParam); + return; + } + + processParamsExecutor = + Executors.newFixedThreadPool( + this.metadataFetchThreadCount, + runnable -> + new Thread(runnable, "funcol-proc-params" + fetcherThreadNameSuffix)); + submitFunctionParameterProcessingJobs( + fullFunctions, + columnNameRegex, + collectedResults, + resultSchemaFields, + processParamsExecutor, + processingTaskFutures, + LOG); + + if (Thread.currentThread().isInterrupted()) { + LOG.warning( + "Fetcher: Interrupted before waiting for parameter processing. Catalog: " + + catalogParam); + processingTaskFutures.forEach(f -> f.cancel(true)); + } else { + LOG.fine( + "Fetcher: Waiting for " + + processingTaskFutures.size() + + " parameter processing tasks. Catalog: " + + catalogParam); + waitForTasksCompletion(processingTaskFutures); + LOG.fine( + "Fetcher: All parameter processing tasks completed or handled. Catalog: " + + catalogParam); + } + + if (!Thread.currentThread().isInterrupted()) { + Comparator comparator = + defineGetFunctionColumnsComparator(resultSchemaFields); + sortResults(collectedResults, comparator, "getFunctionColumns", LOG); + populateQueue(collectedResults, queue, resultSchemaFields); + } + + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning( + "Fetcher: Interrupted in main try block for catalog " + + catalogParam + + ". Error: " + + e.getMessage()); + processingTaskFutures.forEach(f -> f.cancel(true)); + } catch (Throwable t) { + LOG.severe( + "Fetcher: Unexpected error in main try block for catalog " + + catalogParam + + ". Error: " + + t.getMessage()); + processingTaskFutures.forEach(f -> f.cancel(true)); + } finally { + signalEndOfData(queue, resultSchemaFields); + if (listRoutinesExecutor != null) shutdownExecutor(listRoutinesExecutor); + if (getRoutineDetailsExecutor != null) shutdownExecutor(getRoutineDetailsExecutor); + if (processParamsExecutor != null) shutdownExecutor(processParamsExecutor); + LOG.info("Function column fetcher thread finished for catalog: " + catalogParam); + } + }; + + Thread fetcherThread = + new Thread(functionColumnFetcher, "getFunctionColumns-fetcher-" + catalog); + BigQueryJsonResultSet resultSet = + BigQueryJsonResultSet.of( + resultSchema, -1, queue, this.statement, new Thread[] {fetcherThread}); + + fetcherThread.start(); + LOG.info("Started background thread for getFunctionColumns for catalog: " + catalog); + return resultSet; + } + + Schema defineGetFunctionColumnsSchema() { + List fields = new ArrayList<>(17); + fields.add( + Field.newBuilder("FUNCTION_CAT", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 1 + fields.add( + Field.newBuilder("FUNCTION_SCHEM", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 2 + fields.add( + Field.newBuilder("FUNCTION_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 3 + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 4 + fields.add( + Field.newBuilder("COLUMN_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 5 + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 6 + fields.add( + Field.newBuilder("TYPE_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 7 + fields.add( + Field.newBuilder("PRECISION", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 8 + fields.add( + Field.newBuilder("LENGTH", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); // 9 + fields.add( + Field.newBuilder("SCALE", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); // 10 + fields.add( + Field.newBuilder("RADIX", StandardSQLTypeName.INT64).setMode(Mode.NULLABLE).build()); // 11 + fields.add( + Field.newBuilder("NULLABLE", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 12 + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Mode.NULLABLE) + .build()); // 13 + fields.add( + Field.newBuilder("CHAR_OCTET_LENGTH", StandardSQLTypeName.INT64) + .setMode(Mode.NULLABLE) + .build()); // 14 + fields.add( + Field.newBuilder("ORDINAL_POSITION", StandardSQLTypeName.INT64) + .setMode(Mode.REQUIRED) + .build()); // 15 + fields.add( + Field.newBuilder("IS_NULLABLE", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 16 + fields.add( + Field.newBuilder("SPECIFIC_NAME", StandardSQLTypeName.STRING) + .setMode(Mode.REQUIRED) + .build()); // 17 + return Schema.of(fields); + } + + List listMatchingFunctionIdsFromDatasets( + List datasetsToScan, + String functionNamePattern, + Pattern functionNameRegex, + ExecutorService listRoutinesExecutor, + String catalogParam, + BigQueryJdbcCustomLogger logger) + throws InterruptedException { + + logger.fine( + String.format( + "Listing matching function IDs from %d datasets for catalog '%s'.", + datasetsToScan.size(), catalogParam)); + final List>> listRoutineFutures = new ArrayList<>(); + final List functionIdsToGet = Collections.synchronizedList(new ArrayList<>()); + + for (Dataset dataset : datasetsToScan) { + if (Thread.currentThread().isInterrupted()) { + logger.warning( + "Interrupted during submission of routine (function) listing tasks for catalog: " + + catalogParam); + throw new InterruptedException("Interrupted while listing functions"); + } + final DatasetId currentDatasetId = dataset.getDatasetId(); + Callable> listCallable = + () -> + findMatchingBigQueryObjects( + "Routine", + () -> + bigquery.listRoutines( + currentDatasetId, RoutineListOption.pageSize(DEFAULT_PAGE_SIZE)), + (name) -> + bigquery.getRoutine( + RoutineId.of( + currentDatasetId.getProject(), currentDatasetId.getDataset(), name)), + (rt) -> rt.getRoutineId().getRoutine(), + functionNamePattern, + functionNameRegex, + logger); + listRoutineFutures.add(listRoutinesExecutor.submit(listCallable)); + } + logger.fine( + "Submitted " + + listRoutineFutures.size() + + " routine (function) list tasks for catalog: " + + catalogParam); + + for (Future> listFuture : listRoutineFutures) { + if (Thread.currentThread().isInterrupted()) { + logger.warning( + "Interrupted while collecting routine (function) list results for catalog: " + + catalogParam); + listRoutineFutures.forEach(f -> f.cancel(true)); + throw new InterruptedException("Interrupted while collecting function lists"); + } + try { + List listedRoutines = listFuture.get(); + if (listedRoutines != null) { + for (Routine listedRoutine : listedRoutines) { + if (listedRoutine != null + && ("SCALAR_FUNCTION".equalsIgnoreCase(listedRoutine.getRoutineType()) + || "TABLE_FUNCTION".equalsIgnoreCase(listedRoutine.getRoutineType()))) { + if (listedRoutine.getRoutineId() != null) { + functionIdsToGet.add(listedRoutine.getRoutineId()); + } else { + logger.warning( + "Found a function type routine with a null ID during listing phase for catalog:" + + " " + + catalogParam); + } + } + } + } + } catch (ExecutionException e) { + logger.warning( + "Error getting routine (function) list result for catalog " + + catalogParam + + ": " + + e.getCause()); + } catch (CancellationException e) { + logger.warning("Routine (function) list task cancelled for catalog: " + catalogParam); + } + } + logger.info( + String.format( + "Found %d function IDs to fetch details for in catalog '%s'.", + functionIdsToGet.size(), catalogParam)); + return functionIdsToGet; + } + + void submitFunctionParameterProcessingJobs( + List fullFunctions, + Pattern columnNameRegex, + List collectedResults, + FieldList resultSchemaFields, + ExecutorService processParamsExecutor, + List> outParameterProcessingFutures, + BigQueryJdbcCustomLogger logger) + throws InterruptedException { + logger.fine( + String.format( + "Submitting parameter processing jobs for %d functions.", fullFunctions.size())); + + for (Routine fullFunction : fullFunctions) { + if (Thread.currentThread().isInterrupted()) { + logger.warning("Interrupted during submission of function parameter processing tasks."); + throw new InterruptedException( + "Interrupted while submitting function parameter processing jobs"); + } + if (fullFunction != null) { + String routineType = fullFunction.getRoutineType(); + if ("SCALAR_FUNCTION".equalsIgnoreCase(routineType) + || "TABLE_FUNCTION".equalsIgnoreCase(routineType)) { + final Routine finalFullFunction = fullFunction; + Future processFuture = + processParamsExecutor.submit( + () -> + processFunctionParametersAndReturnValue( + finalFullFunction, + columnNameRegex, + collectedResults, + resultSchemaFields)); + outParameterProcessingFutures.add(processFuture); + } else { + logger.warning( + "Routine " + + (fullFunction.getRoutineId() != null + ? fullFunction.getRoutineId().toString() + : "UNKNOWN_ID") + + " fetched for getFunctionColumns was not of a function type (Type: " + + routineType + + "). Skipping parameter processing."); + } + } + } + logger.fine( + "Finished submitting " + + outParameterProcessingFutures.size() + + " processFunctionParametersAndReturnValue tasks."); + } + + void processFunctionParametersAndReturnValue( + Routine routine, + Pattern columnNameRegex, + List collectedResults, + FieldList resultSchemaFields) { + RoutineId routineId = routine.getRoutineId(); + if (routineId == null) { + LOG.warning("Processing a routine with a null ID. Skipping."); + return; + } + LOG.finer("Processing function parameters and return value for: " + routineId); + + String functionCatalog = routineId.getProject(); + String functionSchema = routineId.getDataset(); + String functionName = routineId.getRoutine(); + String specificName = functionName; + + if (routine.getReturnTableType() != null) { + StandardSQLTableType returnTableType = routine.getReturnTableType(); + if (returnTableType != null && returnTableType.getColumns() != null) { + List tableColumns = returnTableType.getColumns(); + for (int i = 0; i < tableColumns.size(); i++) { + StandardSQLField tableColumn = tableColumns.get(i); + String columnName = tableColumn.getName(); + if (columnNameRegex != null + && (columnName == null || !columnNameRegex.matcher(columnName).matches())) { + continue; + } + List rowValues = + createFunctionColumnRow( + functionCatalog, + functionSchema, + functionName, + specificName, + columnName, + DatabaseMetaData.functionColumnResult, + tableColumn.getDataType(), + i + 1); + collectedResults.add(FieldValueList.of(rowValues, resultSchemaFields)); + } + } + } + + List arguments = routine.getArguments(); + if (arguments != null) { + for (int i = 0; i < arguments.size(); i++) { + RoutineArgument arg = arguments.get(i); + String argName = arg.getName(); + + if (columnNameRegex != null + && (argName == null || !columnNameRegex.matcher(argName).matches())) { + continue; + } + + short columnType; + String originalMode = arg.getMode(); + + if ("IN".equalsIgnoreCase(originalMode)) { + columnType = DatabaseMetaData.functionColumnIn; + } else if ("OUT".equalsIgnoreCase(originalMode)) { + columnType = DatabaseMetaData.functionColumnOut; + } else if ("INOUT".equalsIgnoreCase(originalMode)) { + columnType = DatabaseMetaData.functionColumnInOut; + } else { + columnType = DatabaseMetaData.functionColumnUnknown; + } + + List rowValues = + createFunctionColumnRow( + functionCatalog, + functionSchema, + functionName, + specificName, + argName, + columnType, + arg.getDataType(), + i + 1); + collectedResults.add(FieldValueList.of(rowValues, resultSchemaFields)); + } + } + } + + List createFunctionColumnRow( + String functionCatalog, + String functionSchema, + String functionName, + String specificName, + String columnName, + int columnType, + StandardSQLDataType dataType, + int ordinalPosition) { + + List values = new ArrayList<>(17); + ColumnTypeInfo typeInfo = + determineTypeInfoFromDataType(dataType, functionName, columnName, ordinalPosition); + + values.add(createStringFieldValue(functionCatalog)); // 1. FUNCTION_CAT + values.add(createStringFieldValue(functionSchema)); // 2. FUNCTION_SCHEM + values.add(createStringFieldValue(functionName)); // 3. FUNCTION_NAME + values.add(createStringFieldValue(columnName)); // 4. COLUMN_NAME + values.add(createLongFieldValue((long) columnType)); // 5. COLUMN_TYPE + + values.add(createLongFieldValue((long) typeInfo.jdbcType)); // 6. DATA_TYPE + values.add(createStringFieldValue(typeInfo.typeName)); // 7. TYPE_NAME + values.add( + createLongFieldValue( + typeInfo.columnSize == null ? null : typeInfo.columnSize.longValue())); // 8. PRECISION + if (typeInfo.typeName != null + && (typeInfo.typeName.equalsIgnoreCase("STRING") + || typeInfo.typeName.equalsIgnoreCase("NVARCHAR") + || typeInfo.typeName.equalsIgnoreCase("BYTES") + || typeInfo.typeName.equalsIgnoreCase("VARBINARY"))) { + values.add( + createLongFieldValue( + typeInfo.columnSize == null ? null : typeInfo.columnSize.longValue())); // 9. LENGTH + values.add( + createLongFieldValue( + typeInfo.decimalDigits == null + ? null + : typeInfo.decimalDigits.longValue())); // 10. SCALE + values.add( + createLongFieldValue( + typeInfo.numPrecRadix == null + ? null + : typeInfo.numPrecRadix.longValue())); // 11. RADIX + values.add( + createLongFieldValue((long) DatabaseMetaData.functionNullableUnknown)); // 12. NULLABLE + values.add(createStringFieldValue(null)); // 13. REMARKS + values.add( + createLongFieldValue( + typeInfo.columnSize == null + ? null + : typeInfo.columnSize.longValue())); // 14. CHAR_OCTET_LENGTH + } else { + values.add(createNullFieldValue()); // 9. LENGTH + values.add( + createLongFieldValue( + typeInfo.decimalDigits == null + ? null + : typeInfo.decimalDigits.longValue())); // 10. SCALE + values.add( + createLongFieldValue( + typeInfo.numPrecRadix == null + ? null + : typeInfo.numPrecRadix.longValue())); // 11. RADIX + values.add( + createLongFieldValue((long) DatabaseMetaData.functionNullableUnknown)); // 12. NULLABLE + values.add(createStringFieldValue(null)); // 13. REMARKS + values.add(createNullFieldValue()); // 14. CHAR_OCTET_LENGTH + } + + values.add(createLongFieldValue((long) ordinalPosition)); // 15. ORDINAL_POSITION + values.add(createStringFieldValue("")); // 16. IS_NULLABLE + values.add(createStringFieldValue(specificName)); // 17. SPECIFIC_NAME + + return values; + } + + Comparator defineGetFunctionColumnsComparator(FieldList resultSchemaFields) { + final int FUNC_CAT_IDX = resultSchemaFields.getIndex("FUNCTION_CAT"); + final int FUNC_SCHEM_IDX = resultSchemaFields.getIndex("FUNCTION_SCHEM"); + final int FUNC_NAME_IDX = resultSchemaFields.getIndex("FUNCTION_NAME"); + final int SPEC_NAME_IDX = resultSchemaFields.getIndex("SPECIFIC_NAME"); + final int ORDINAL_POS_IDX = resultSchemaFields.getIndex("ORDINAL_POSITION"); + + return Comparator.comparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_CAT_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_SCHEM_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, FUNC_NAME_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getStringValueOrNull(fvl, SPEC_NAME_IDX), + Comparator.nullsFirst(String::compareToIgnoreCase)) + .thenComparing( + (FieldValueList fvl) -> getLongValueOrNull(fvl, ORDINAL_POS_IDX), + Comparator.nullsFirst(Long::compareTo)); + } + + @Override + public ResultSet getPseudoColumns( + String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) { + LOG.info( + String.format( + "getPseudoColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," + + " columnNamePattern: %s. Pseudo columns not supported by BigQuery; returning" + + " empty ResultSet.", + catalog, schemaPattern, tableNamePattern, columnNamePattern)); + + final Schema resultSchema = defineGetPseudoColumnsSchema(); + final FieldList resultSchemaFields = resultSchema.getFields(); + final BlockingQueue queue = new LinkedBlockingQueue<>(1); + signalEndOfData(queue, resultSchemaFields); + + return BigQueryJsonResultSet.of(resultSchema, 0, queue, this.statement, null); + } + + Schema defineGetPseudoColumnsSchema() { + List fields = new ArrayList<>(12); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DATA_TYPE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("COLUMN_SIZE", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("DECIMAL_DIGITS", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("NUM_PREC_RADIX", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("COLUMN_USAGE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("REMARKS", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("CHAR_OCTET_LENGTH", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("IS_NULLABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + return Schema.of(fields); + } + + @Override + public boolean generatedKeyAlwaysReturned() { + return false; + } + + @Override + public T unwrap(Class iface) { + return null; + } + + @Override + public boolean isWrapperFor(Class iface) { + return false; + } + + // --- Helper Methods --- + + /** + * Determines the effective catalog and schema pattern to use for metadata retrieval. + * + *

    This method applies the logic for the {@code FilterTablesOnDefaultDataset} connection + * property. If this property is enabled and the provided {@code catalog} or {@code schemaPattern} + * are null, empty, or wildcard ('%'), they may be overridden by the default catalog (project) and + * default dataset (schema) configured in the {@link BigQueryConnection}. + * + * @param catalog The catalog name provided by the user; may be {@code null}. + * @param schemaPattern The schema name pattern provided by the user; may be {@code null}. + * @return A {@link Tuple} where {@code Tuple.x()} is the effective catalog string and {@code + * Tuple.y()} is the effective schema pattern string. These are the values that should be used + * for querying BigQuery's metadata. + * @see BigQueryConnection#isFilterTablesOnDefaultDataset() + */ + private Tuple determineEffectiveCatalogAndSchema( + String catalog, String schemaPattern) { + String effectiveCatalog = catalog; + String effectiveSchemaPattern = schemaPattern; + + if (this.connection.isFilterTablesOnDefaultDataset() + && this.connection.getDefaultDataset() != null + && this.connection.getDefaultDataset().getDataset() != null + && !this.connection.getDefaultDataset().getDataset().isEmpty()) { + + String defaultProjectFromConnection = this.connection.getCatalog(); + // We only use the dataset part of the DefaultDataset for schema filtering + String defaultSchemaFromConnection = this.connection.getDefaultDataset().getDataset(); + + boolean catalogIsNullOrEmptyOrWildcard = + (catalog == null || catalog.isEmpty() || catalog.equals("%")); + boolean schemaPatternIsNullOrEmptyOrWildcard = + (schemaPattern == null || schemaPattern.isEmpty() || schemaPattern.equals("%")); + + final String logPrefix = "FilterTablesOnDefaultDatasetTrue: "; + if (catalogIsNullOrEmptyOrWildcard && schemaPatternIsNullOrEmptyOrWildcard) { + effectiveCatalog = defaultProjectFromConnection; + effectiveSchemaPattern = defaultSchemaFromConnection; + LOG.info( + String.format( + logPrefix + "Using default catalog '%s' and default dataset '%s'.", + effectiveCatalog, + effectiveSchemaPattern)); + } else if (catalogIsNullOrEmptyOrWildcard) { + effectiveCatalog = defaultProjectFromConnection; + LOG.info( + String.format( + logPrefix + + "Using default catalog '%s' with user dataset '%s'. Default dataset '%s' ignored.", + effectiveCatalog, + effectiveSchemaPattern, + defaultSchemaFromConnection)); + } else if (schemaPatternIsNullOrEmptyOrWildcard) { + effectiveSchemaPattern = defaultSchemaFromConnection; + LOG.info( + String.format( + logPrefix + "Using user catalog '%s' and default dataset '%s'.", + effectiveCatalog, + effectiveSchemaPattern)); + } else { + LOG.info( + String.format( + logPrefix + + "Using user catalog '%s' and schema '%s'. Default dataset '%s' ignored.", + effectiveCatalog, + effectiveSchemaPattern, + defaultSchemaFromConnection)); + } + } + return Tuple.of(effectiveCatalog, effectiveSchemaPattern); + } + + private ColumnTypeInfo getColumnTypeInfoForSqlType(StandardSQLTypeName bqType) { + if (bqType == null) { + LOG.warning("Null BigQuery type encountered: " + bqType.name() + ". Mapping to VARCHAR."); + return new ColumnTypeInfo(Types.VARCHAR, bqType.name(), null, null, null); + } + + switch (bqType) { + case INT64: + return new ColumnTypeInfo(Types.BIGINT, "BIGINT", 19, 0, 10); + case BOOL: + return new ColumnTypeInfo(Types.BOOLEAN, "BOOLEAN", 1, null, null); + case FLOAT64: + return new ColumnTypeInfo(Types.DOUBLE, "DOUBLE", 15, null, 10); + case NUMERIC: + return new ColumnTypeInfo(Types.NUMERIC, "NUMERIC", 38, 9, 10); + case BIGNUMERIC: + return new ColumnTypeInfo(Types.NUMERIC, "NUMERIC", 77, 38, 10); + case STRING: + return new ColumnTypeInfo(Types.NVARCHAR, "NVARCHAR", null, null, null); + case TIMESTAMP: + case DATETIME: + return new ColumnTypeInfo(Types.TIMESTAMP, "TIMESTAMP", 29, null, null); + case DATE: + return new ColumnTypeInfo(Types.DATE, "DATE", 10, null, null); + case TIME: + return new ColumnTypeInfo(Types.TIME, "TIME", 15, null, null); + case GEOGRAPHY: + case JSON: + case INTERVAL: + return new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); + case BYTES: + return new ColumnTypeInfo(Types.VARBINARY, "VARBINARY", null, null, null); + case STRUCT: + return new ColumnTypeInfo(Types.STRUCT, "STRUCT", null, null, null); + default: + LOG.warning( + "Unknown BigQuery type encountered: " + bqType.name() + ". Mapping to VARCHAR."); + return new ColumnTypeInfo(Types.VARCHAR, bqType.name(), null, null, null); + } + } + + List findMatchingBigQueryObjects( + String objectTypeName, + Supplier> listAllOperation, + Function getSpecificOperation, + Function nameExtractor, + String pattern, + Pattern regex, + BigQueryJdbcCustomLogger logger) { + + boolean needsList = needsListing(pattern); + List resultList = new ArrayList<>(); + + try { + Iterable objects; + if (needsList) { + logger.info( + String.format( + "Listing all %ss (pattern: %s)...", + objectTypeName, pattern == null ? "" : pattern)); + Page firstPage = listAllOperation.get(); + objects = firstPage.iterateAll(); + logger.fine( + String.format( + "Retrieved initial %s list, iterating & filtering if needed...", objectTypeName)); + + } else { + logger.info(String.format("Getting specific %s: '%s'", objectTypeName, pattern)); + T specificObject = getSpecificOperation.apply(pattern); + objects = + (specificObject == null) + ? Collections.emptyList() + : Collections.singletonList(specificObject); + if (specificObject == null) { + logger.info(String.format("Specific %s not found: '%s'", objectTypeName, pattern)); + } + } + + boolean wasListing = needsList; + for (T obj : objects) { + if (Thread.currentThread().isInterrupted()) { + logger.warning("Thread interrupted during " + objectTypeName + " processing loop."); + throw new InterruptedException( + "Interrupted during " + objectTypeName + " processing loop"); + } + if (obj != null) { + if (wasListing && regex != null) { + String name = nameExtractor.apply(obj); + if (name != null && regex.matcher(name).matches()) { + resultList.add(obj); + } + } else { + resultList.add(obj); + } + } + } + + } catch (BigQueryException e) { + if (!needsList && e.getCode() == 404) { + logger.info(String.format("%s '%s' not found (API error 404).", objectTypeName, pattern)); + } else { + logger.warning( + String.format( + "BigQueryException finding %ss for pattern '%s': %s (Code: %d)", + objectTypeName, pattern, e.getMessage(), e.getCode())); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + logger.warning("Interrupted while finding " + objectTypeName + "s."); + } catch (Exception e) { + logger.severe( + String.format( + "Unexpected exception finding %ss for pattern '%s': %s", + objectTypeName, pattern, e.getMessage())); + } + return resultList; + } + + private static class TypeInfoRowData { + String typeName; + int jdbcType; + Long precision; + String literalPrefix; + String literalSuffix; + String createParams; + int nullable; + boolean caseSensitive; + int searchable; + boolean unsignedAttribute; + boolean fixedPrecScale; + boolean autoIncrement; + String localTypeName; + Long minimumScale; + Long maximumScale; + Long numPrecRadix; + + TypeInfoRowData( + String typeName, + int jdbcType, + Long precision, + String literalPrefix, + String literalSuffix, + String createParams, + int nullable, + boolean caseSensitive, + int searchable, + boolean unsignedAttribute, + boolean fixedPrecScale, + boolean autoIncrement, + String localTypeName, + Long minimumScale, + Long maximumScale, + Long numPrecRadix) { + this.typeName = typeName; + this.jdbcType = jdbcType; + this.precision = precision; + this.literalPrefix = literalPrefix; + this.literalSuffix = literalSuffix; + this.createParams = createParams; + this.nullable = nullable; + this.caseSensitive = caseSensitive; + this.searchable = searchable; + this.unsignedAttribute = unsignedAttribute; + this.fixedPrecScale = fixedPrecScale; + this.autoIncrement = autoIncrement; + this.localTypeName = localTypeName; + this.minimumScale = minimumScale; + this.maximumScale = maximumScale; + this.numPrecRadix = numPrecRadix; + } + } + + void sortResults( + List collectedResults, + Comparator comparator, + String operationName, + BigQueryJdbcCustomLogger logger) { + + if (collectedResults == null || collectedResults.isEmpty()) { + logger.info(String.format("No results collected for %s, skipping sort.", operationName)); + return; + } + if (comparator == null) { + logger.info(String.format("No comparator provided for %s, skipping sort.", operationName)); + return; + } + + logger.info( + String.format( + "Sorting %d collected %s results...", collectedResults.size(), operationName)); + try { + collectedResults.sort(comparator); + logger.info(String.format("%s result sorting completed.", operationName)); + } catch (Exception e) { + logger.severe( + String.format("Error during sorting %s results: %s", operationName, e.getMessage())); + } + } + + private List defineBasePrivilegeFields() { + List fields = new ArrayList<>(7); + fields.add( + Field.newBuilder("TABLE_CAT", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_SCHEM", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("TABLE_NAME", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("GRANTOR", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + fields.add( + Field.newBuilder("GRANTEE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("PRIVILEGE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REQUIRED) + .build()); + fields.add( + Field.newBuilder("IS_GRANTABLE", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build()); + return fields; + } + + Pattern compileSqlLikePattern(String sqlLikePattern) { + if (sqlLikePattern == null) { + return null; + } + if (sqlLikePattern.isEmpty()) { + return Pattern.compile("(?!)"); + } + StringBuilder regex = new StringBuilder(sqlLikePattern.length() * 2); + regex.append('^'); + for (int i = 0; i < sqlLikePattern.length(); i++) { + char c = sqlLikePattern.charAt(i); + switch (c) { + case '%': + regex.append(".*"); + break; + case '_': + regex.append('.'); + break; + case '\\': + case '.': + case '[': + case ']': + case '(': + case ')': + case '{': + case '}': + case '*': + case '+': + case '?': + case '^': + case '$': + case '|': + regex.append('\\').append(c); + break; + default: + regex.append(c); + break; + } + } + regex.append('$'); + return Pattern.compile(regex.toString(), Pattern.CASE_INSENSITIVE); + } + + boolean needsListing(String pattern) { + return pattern == null || pattern.contains("%") || pattern.contains("_"); + } + + FieldValue createStringFieldValue(String value) { + return FieldValue.of(FieldValue.Attribute.PRIMITIVE, value); + } + + FieldValue createLongFieldValue(Long value) { + return (value == null) + ? FieldValue.of(FieldValue.Attribute.PRIMITIVE, null) + : FieldValue.of(FieldValue.Attribute.PRIMITIVE, String.valueOf(value)); + } + + FieldValue createNullFieldValue() { + return FieldValue.of(FieldValue.Attribute.PRIMITIVE, null); + } + + FieldValue createBooleanFieldValue(Boolean value) { + return (value == null) + ? FieldValue.of(FieldValue.Attribute.PRIMITIVE, null) + : FieldValue.of(FieldValue.Attribute.PRIMITIVE, value ? "1" : "0"); + } + + private String getStringValueOrNull(FieldValueList fvl, int index) { + if (fvl == null || index < 0 || index >= fvl.size()) return null; + FieldValue fv = fvl.get(index); + return (fv == null || fv.isNull()) ? null : fv.getStringValue(); + } + + private Long getLongValueOrNull(FieldValueList fvl, int index) { + if (fvl == null || index < 0 || index >= fvl.size()) return null; + FieldValue fv = fvl.get(index); + try { + return (fv == null || fv.isNull()) ? null : fv.getLongValue(); + } catch (NumberFormatException e) { + LOG.warning("Could not parse Long value for index " + index); + return null; + } + } + + private void waitForTasksCompletion(List> taskFutures) { + LOG.info(String.format("Waiting for %d submitted tasks to complete...", taskFutures.size())); + for (Future future : taskFutures) { + try { + if (!future.isCancelled()) { + future.get(); + } + } catch (CancellationException e) { + LOG.warning("A table processing task was cancelled."); + } catch (ExecutionException e) { + LOG.severe( + String.format( + "Error executing table processing task: %s", + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()))); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning( + "Fetcher thread interrupted while waiting for tasks. Attempting to cancel remaining" + + " tasks."); + taskFutures.forEach(f -> f.cancel(true)); + break; + } + } + LOG.info("Finished waiting for tasks."); + } + + private void populateQueue( + List collectedResults, + BlockingQueue queue, + FieldList resultSchemaFields) { + LOG.info(String.format("Populating queue with %d results...", collectedResults.size())); + try { + for (FieldValueList sortedRow : collectedResults) { + if (Thread.currentThread().isInterrupted()) { + LOG.warning("Interrupted during queue population."); + break; + } + queue.put(BigQueryFieldValueListWrapper.of(resultSchemaFields, sortedRow)); + } + LOG.info("Finished populating queue."); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning("Interrupted while putting row onto queue."); + } catch (Exception e) { + LOG.severe("Unexpected error populating queue: " + e.getMessage()); + } + } + + private void signalEndOfData( + BlockingQueue queue, FieldList resultSchemaFields) { + try { + LOG.info("Adding end signal to queue."); + queue.put(BigQueryFieldValueListWrapper.of(resultSchemaFields, null, true)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warning("Interrupted while sending end signal to queue."); + } catch (Exception e) { + LOG.severe("Exception while sending end signal to queue: " + e.getMessage()); + } + } + + private void shutdownExecutor(ExecutorService executor) { + if (executor == null || executor.isShutdown()) { + return; + } + LOG.info("Shutting down column executor service..."); + executor.shutdown(); + try { + if (!executor.awaitTermination(10, TimeUnit.SECONDS)) { + LOG.warning("Executor did not terminate gracefully after 10s, forcing shutdownNow()."); + List droppedTasks = executor.shutdownNow(); + LOG.warning( + "Executor shutdownNow() initiated. Dropped tasks count: " + droppedTasks.size()); + if (!executor.awaitTermination(10, TimeUnit.SECONDS)) { + LOG.severe("Executor did not terminate even after shutdownNow()."); + } + } + LOG.info("Executor shutdown complete."); + } catch (InterruptedException ie) { + LOG.warning( + "Interrupted while waiting for executor termination. Forcing shutdownNow() again."); + executor.shutdownNow(); + Thread.currentThread().interrupt(); + } + } + + private String getCurrentCatalogName() { + return this.connection.getCatalog(); + } + + private List getAccessibleCatalogNames() { + Set accessibleCatalogs = new HashSet<>(); + String primaryCatalog = getCurrentCatalogName(); + if (primaryCatalog != null && !primaryCatalog.isEmpty()) { + accessibleCatalogs.add(primaryCatalog); + } + + List additionalProjects = this.connection.getAdditionalProjects(); + if (additionalProjects != null) { + for (String project : additionalProjects) { + if (project != null && !project.isEmpty()) { + accessibleCatalogs.add(project); + } + } + } + + List sortedCatalogs = new ArrayList<>(accessibleCatalogs); + Collections.sort(sortedCatalogs); + return sortedCatalogs; + } + + static String readSqlFromFile(String filename) { + InputStream in; + in = BigQueryDatabaseMetaData.class.getResourceAsStream(filename); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + StringBuilder builder = new StringBuilder(); + try (Scanner scanner = new Scanner(reader)) { + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + builder.append(line).append("\n"); + } + } + return builder.toString(); + } + + String replaceSqlParameters(String sql, String... params) throws SQLException { + return String.format(sql, (Object[]) params); + } + + private void loadDriverVersionProperties() { + if (parsedDriverVersion.get() != null) { + return; + } + Properties props = new Properties(); + try (InputStream input = + getClass().getResourceAsStream("/com/google/cloud/bigquery/jdbc/dependencies.properties")) { + if (input == null) { + String errorMessage = + "Could not find dependencies.properties. Driver version information is unavailable."; + LOG.severe(errorMessage); + throw new IllegalStateException(errorMessage); + } + props.load(input); + String versionString = props.getProperty("version.jdbc"); + if (versionString == null || versionString.trim().isEmpty()) { + String errorMessage = + "The property version.jdbc not found or empty in dependencies.properties."; + LOG.severe(errorMessage); + throw new IllegalStateException(errorMessage); + } + parsedDriverVersion.compareAndSet(null, versionString.trim()); + String[] parts = versionString.split("\\."); + if (parts.length < 2) { + return; + } + parsedDriverMajorVersion.compareAndSet(null, Integer.parseInt(parts[0])); + String minorPart = parts[1]; + String numericMinor = minorPart.replaceAll("[^0-9].*", ""); + if (!numericMinor.isEmpty()) { + parsedDriverMinorVersion.compareAndSet(null, Integer.parseInt(numericMinor)); + } + } catch (IOException | NumberFormatException e) { + String errorMessage = + "Error reading dependencies.properties. Driver version information is" + + " unavailable. Error: " + + e.getMessage(); + LOG.severe(errorMessage); + throw new IllegalStateException(errorMessage, e); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercions.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercions.java new file mode 100644 index 0000000000..324888982a --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercions.java @@ -0,0 +1,102 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.math.RoundingMode; + +/** A registry of all the inbuilt {@link BigQueryCoercion}s that framework offers by default. */ +@InternalApi +class BigQueryDefaultCoercions { + + /** + * Creates a {@link BigQueryTypeCoercerBuilder} with all the inbuilt {@link BigQueryCoercion}s. + *

  • {@link BigQueryTypeCoercer#INSTANCE} uses this builder to populate itself with all the + * default {@link BigQueryCoercion}s. + *
  • A {@link BigQueryTypeCoercerBuilder} created through {@link BigQueryTypeCoercer#builder()} + * method also contains all these default {@link BigQueryCoercion}s + */ + static BigQueryTypeCoercerBuilder builder() { + BigQueryTypeCoercerBuilder builder = new BigQueryTypeCoercerBuilder(); + + // TODO: can we figure out the class parameters from coercion itself? + builder.registerTypeCoercion( + (String s) -> s != null && ("1".equals(s.trim()) || Boolean.parseBoolean(s)), + String.class, + Boolean.class); + builder.registerTypeCoercion(Integer::parseInt, String.class, Integer.class); + builder.registerTypeCoercion(BigInteger::new, String.class, BigInteger.class); + builder.registerTypeCoercion(Long::valueOf, String.class, Long.class); + builder.registerTypeCoercion(Double::valueOf, String.class, Double.class); + builder.registerTypeCoercion(BigDecimal::new, String.class, BigDecimal.class); + + builder.registerTypeCoercion((b) -> b ? 1 : 0, Boolean.class, Integer.class); + + builder.registerTypeCoercion(Integer::intValue, Integer.class, Integer.class); + builder.registerTypeCoercion(Integer::shortValue, Integer.class, Short.class); + builder.registerTypeCoercion(Integer::byteValue, Integer.class, Byte.class); + builder.registerTypeCoercion(Integer::doubleValue, Integer.class, Double.class); + builder.registerTypeCoercion(Integer::floatValue, Integer.class, Float.class); + + builder.registerTypeCoercion(Long::intValue, Long.class, Integer.class); + builder.registerTypeCoercion(Long::shortValue, Long.class, Short.class); + builder.registerTypeCoercion(Long::byteValue, Long.class, Byte.class); + builder.registerTypeCoercion(Long::doubleValue, Long.class, Double.class); + builder.registerTypeCoercion(Long::floatValue, Long.class, Float.class); + + builder.registerTypeCoercion(Double::floatValue, Double.class, Float.class); + builder.registerTypeCoercion(Double::longValue, Double.class, Long.class); + builder.registerTypeCoercion(Double::intValue, Double.class, Integer.class); + builder.registerTypeCoercion(Double::shortValue, Double.class, Short.class); + builder.registerTypeCoercion(Double::byteValue, Double.class, Byte.class); + builder.registerTypeCoercion(BigDecimal::valueOf, Double.class, BigDecimal.class); + + builder.registerTypeCoercion(Float::intValue, Float.class, Integer.class); + builder.registerTypeCoercion(Float::byteValue, Float.class, Byte.class); + builder.registerTypeCoercion(Float::shortValue, Float.class, Short.class); + builder.registerTypeCoercion(Float::doubleValue, Float.class, Double.class); + + builder.registerTypeCoercion(BigInteger::longValue, BigInteger.class, Long.class); + builder.registerTypeCoercion(BigDecimal::new, BigInteger.class, BigDecimal.class); + + builder.registerTypeCoercion(BigDecimal::doubleValue, BigDecimal.class, Double.class); + builder.registerTypeCoercion(BigDecimal::toBigInteger, BigDecimal.class, BigInteger.class); + builder.registerTypeCoercion( + bigDecimal -> bigDecimal.setScale(0, RoundingMode.DOWN).intValueExact(), + BigDecimal.class, + Integer.class); + builder.registerTypeCoercion( + bigDecimal -> bigDecimal.setScale(0, RoundingMode.DOWN).longValueExact(), + BigDecimal.class, + Long.class); + builder.registerTypeCoercion( + bigDecimal -> bigDecimal.setScale(0, RoundingMode.DOWN).shortValueExact(), + BigDecimal.class, + Short.class); + builder.registerTypeCoercion( + bigDecimal -> bigDecimal.setScale(0, RoundingMode.DOWN).byteValueExact(), + BigDecimal.class, + Byte.class); + builder.registerTypeCoercion(BigDecimal::floatValue, BigDecimal.class, Float.class); + + builder.registerTypeCoercion(unused -> false, Void.class, Boolean.class); + + return builder; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java new file mode 100644 index 0000000000..2c7eba16cd --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -0,0 +1,249 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import io.grpc.LoadBalancerRegistry; +import io.grpc.internal.PickFirstLoadBalancerProvider; +import java.io.IOException; +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.DriverPropertyInfo; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * JDBC {@link Driver} implementation for BigQuery. + * + *

    Usage: + * + *

    + *  String CONNECTION_URL = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443"
    + *            + "ProjectId=test;OAuthType=3""
    + *  Connection connection = DriverManager.getConnection(CONNECTION_URL);
    + * 
    + * + *

    Valid URLs take the form: + * + *

    + *  jdbc:bigquery://{host}:{port};ProjectId={projectId};OAuthType={oAuthType};
    + *  {property1}={value1};{property2}={value2};...
    + * 
    + */ +public class BigQueryDriver implements Driver { + + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryDriver.class.getName()); + // TODO: update this when JDBC goes GA + private static final int JDBC_MAJOR_VERSION = 0; + private static final int JDBC_MINOR_VERSION = 1; + static BigQueryDriver registeredBigqueryJdbcDriver; + + static { + try { + register(); + } catch (SQLException e) { + throw new ExceptionInInitializerError("Registering driver failed: " + e.getMessage()); + } + LoadBalancerRegistry.getDefaultRegistry().register(new PickFirstLoadBalancerProvider()); + } + + public BigQueryDriver() {} + + static void register() throws SQLException { + LOG.finest("++enter++"); + if (isRegistered()) { + LOG.warning("Driver is already registered. It can only be registered once."); + } + + DriverManager.registerDriver(LazyHolder.INSTANCE); + BigQueryDriver.registeredBigqueryJdbcDriver = LazyHolder.INSTANCE; + } + + static boolean isRegistered() { + LOG.finest("++enter++"); + return registeredBigqueryJdbcDriver != null; + } + + /** + * @return the registered JDBC driver for BigQuery. + * @throws IllegalStateException if the driver has not been registered. + */ + public static BigQueryDriver getRegisteredDriver() throws IllegalStateException { + LOG.finest("++enter++"); + if (isRegistered()) { + return registeredBigqueryJdbcDriver; + } + throw new IllegalStateException( + "Driver is not registered (or it has not been registered using Driver.register() method)"); + } + + /** + * Attempts to establish a BigQuery connection to the given URL, using the provided connection + * Properties. + * + *

    Valid URLs take the form: + * + *

    +   *  jdbc:bigquery://{host}:{port};ProjectId={projectId};OAuthType={oAuthType};
    +   *  {property1}={value1};{property2}={value2};...
    +   * 
    + * + * @param url the BigQuery URL to connect to + * @param info a list of arbitrary string tag/value pairs as connection arguments. + * @return A connection to the URL if it was established successfully, otherwise {@code null} + * @throws SQLException if driver fails to connect to clients. + * @see Driver#connect(String, Properties) + */ + @Override + public Connection connect(String url, Properties info) throws SQLException { + LOG.finest("++enter++"); + try { + if (acceptsURL(url)) { + // strip 'jdbc:' from the URL, add any extra properties + String connectionUri = + BigQueryJdbcUrlUtility.appendPropertiesToURL(url.substring(5), this.toString(), info); + + // LogLevel + String logLevelStr = + BigQueryJdbcUrlUtility.parseUriProperty( + connectionUri, BigQueryJdbcUrlUtility.LOG_LEVEL_PROPERTY_NAME); + if (logLevelStr == null) { + logLevelStr = System.getenv(BigQueryJdbcUrlUtility.LOG_LEVEL_ENV_VAR); + } + Level logLevel = BigQueryJdbcUrlUtility.parseLogLevel(logLevelStr); + + // LogPath + String logPath = + BigQueryJdbcUrlUtility.parseUriProperty( + connectionUri, BigQueryJdbcUrlUtility.LOG_PATH_PROPERTY_NAME); + if (logPath == null) { + logPath = System.getenv(BigQueryJdbcUrlUtility.LOG_PATH_ENV_VAR); + } + if (logPath == null) { + logPath = BigQueryJdbcUrlUtility.DEFAULT_LOG_PATH; + } + + BigQueryJdbcRootLogger.setLevel(logLevel, logPath); + // Logging starts from here. + BigQueryConnection connection = new BigQueryConnection(connectionUri); + LOG.info( + String.format( + "Driver info : { {Database Product Name : %s}, " + + "{Database Product Version : %s}, " + + "{Driver Name : %s}, " + + "{Driver Version : %s}, " + + "{LogLevel : %s}, " + + "{LogPath : %s}, " + + "{Driver Instance : %s} }", + connection.getMetaData().getDatabaseProductName(), + connection.getMetaData().getDatabaseProductVersion(), + connection.getMetaData().getDriverName(), + connection.getMetaData().getDriverVersion(), + logLevel, + logPath, + this.toString())); + return connection; + } else { + throw new IllegalArgumentException( + "Invalid URL provided, must start with \"jdbc:bigquery:\""); + } + } catch (IOException e) { + LOG.warning("Getting a warning: " + e.getMessage()); + } + return null; + } + + /** + * @param url a JDBC connection URL + * @return True if the URL is non-empty and starts with "jdbc:bigquery" + * @see Driver#acceptsURL(String) + */ + @Override + public boolean acceptsURL(String url) throws SQLException { + LOG.finest("++enter++"); + if (url == null || url.isEmpty()) { + throw new BigQueryJdbcException("Connection URL is null."); + } + return url.startsWith("jdbc:bigquery:"); + } + + /** + * Gets information about the possible BigQuery JDBC Connection Properties. + * + * @param url the BigQuery connection URL + * @param info a proposed list BigQuery connection properties + * @return an array of {@code DriverPropertyInfo} objects describing possible properties. + * @see Driver#getPropertyInfo(String, Properties) + */ + @Override + public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) { + LOG.finest("++enter++"); + String connectionUri = + BigQueryJdbcUrlUtility.appendPropertiesToURL(url.substring(5), this.toString(), info); + List propertyInfoList = new ArrayList<>(); + + for (BigQueryConnectionProperty prop : BigQueryJdbcUrlUtility.VALID_PROPERTIES) { + DriverPropertyInfo driverProperty = + new DriverPropertyInfo( + prop.getName(), + BigQueryJdbcUrlUtility.parseUriProperty(connectionUri, prop.getName())); + driverProperty.description = prop.getDescription(); + propertyInfoList.add(driverProperty); + } + Map oAuthProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.toString()); + for (Map.Entry authProperty : oAuthProperties.entrySet()) { + propertyInfoList.add(new DriverPropertyInfo(authProperty.getKey(), authProperty.getValue())); + } + return propertyInfoList.toArray(new DriverPropertyInfo[0]); + } + + @Override + public int getMajorVersion() { + LOG.finest("++enter++"); + return JDBC_MAJOR_VERSION; + } + + @Override + public int getMinorVersion() { + LOG.finest("++enter++"); + return JDBC_MINOR_VERSION; + } + + @Override + public boolean jdbcCompliant() { + LOG.finest("++enter++"); + return false; + } + + @Override + public Logger getParentLogger() { + LOG.finest("++enter++"); + return BigQueryJdbcRootLogger.getRootLogger(); + } + + private static class LazyHolder { + static final BigQueryDriver INSTANCE = new BigQueryDriver(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryErrorMessage.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryErrorMessage.java new file mode 100644 index 0000000000..9afa074522 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryErrorMessage.java @@ -0,0 +1,29 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; + +@InternalApi +class BigQueryErrorMessage { + + static final String CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED = + "Customized Types are not supported yet."; + static final String INVALID_ARRAY = "Invalid java.sql.Array instance."; + static final String METHOD_NOT_IMPLEMENTED = "This method is not implemented."; + static final String OAUTH_TYPE_ERROR_MESSAGE = "Invalid Auth type specified"; +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java new file mode 100644 index 0000000000..9d8b1b2f77 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValueList; +import java.util.List; + +/** + * Package-private, This class acts as a facade layer and wraps the FieldList(schema) and + * FieldValueList + */ +class BigQueryFieldValueListWrapper { + + // This is a reference schema to the schema + private final FieldList fieldList; + + // POJO representation of the JSON response + private final FieldValueList fieldValueList; + + // This is very similar to the FieldValueList above, except we get the + // reference as a List in case of an Array + private final List arrayFieldValueList; + + // This flag marks the end of the stream for the ResultSet + private boolean isLast = false; + + static BigQueryFieldValueListWrapper of( + FieldList fieldList, FieldValueList fieldValueList, boolean... isLast) { + boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; + return new BigQueryFieldValueListWrapper(fieldList, fieldValueList, null, isLastFlag); + } + + static BigQueryFieldValueListWrapper getNestedFieldValueListWrapper( + FieldList fieldList, List arrayFieldValueList, boolean... isLast) { + boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; + return new BigQueryFieldValueListWrapper(fieldList, null, arrayFieldValueList, isLastFlag); + } + + private BigQueryFieldValueListWrapper( + FieldList fieldList, + FieldValueList fieldValueList, + List arrayFieldValueList, + boolean isLast) { + this.fieldList = fieldList; + this.fieldValueList = fieldValueList; + this.arrayFieldValueList = arrayFieldValueList; + this.isLast = isLast; + } + + public FieldList getFieldList() { + return this.fieldList; + } + + public FieldValueList getFieldValueList() { + return this.fieldValueList; + } + + public List getArrayFieldValueList() { + return this.arrayFieldValueList; + } + + public boolean isLast() { + return this.isLast; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBulkInsertWriter.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBulkInsertWriter.java new file mode 100644 index 0000000000..d4e9702621 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBulkInsertWriter.java @@ -0,0 +1,130 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.gax.retrying.RetrySettings; +import com.google.cloud.bigquery.storage.v1.AppendRowsResponse; +import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; +import com.google.cloud.bigquery.storage.v1.CreateWriteStreamRequest; +import com.google.cloud.bigquery.storage.v1.Exceptions; +import com.google.cloud.bigquery.storage.v1.Exceptions.StorageException; +import com.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse; +import com.google.cloud.bigquery.storage.v1.JsonStreamWriter; +import com.google.cloud.bigquery.storage.v1.TableName; +import com.google.cloud.bigquery.storage.v1.WriteStream; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.gson.JsonArray; +import com.google.protobuf.Descriptors.DescriptorValidationException; +import java.io.IOException; +import java.util.concurrent.Phaser; +import javax.annotation.concurrent.GuardedBy; + +class BigQueryJdbcBulkInsertWriter { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private JsonStreamWriter jsonStreamWriter; + private final Phaser openRequestCount = new Phaser(1); + private final Object streamLock = new Object(); + + @GuardedBy("lock") + private RuntimeException error = null; + + void initialize(TableName parentTable, BigQueryWriteClient client, RetrySettings retrySettings) + throws IOException, DescriptorValidationException, InterruptedException { + WriteStream stream = WriteStream.newBuilder().setType(WriteStream.Type.PENDING).build(); + + CreateWriteStreamRequest createWriteStreamRequest = + CreateWriteStreamRequest.newBuilder() + .setParent(parentTable.toString()) + .setWriteStream(stream) + .build(); + WriteStream writeStream = client.createWriteStream(createWriteStreamRequest); + + JsonStreamWriter.Builder jsonStreamWriterBuilder = + JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema()); + + if (retrySettings != null) { + jsonStreamWriterBuilder.setRetrySettings(retrySettings); + } + + this.jsonStreamWriter = jsonStreamWriterBuilder.build(); + } + + void append(JsonArray data, long offset) throws DescriptorValidationException, IOException { + synchronized (this.streamLock) { + if (this.error != null) { + throw this.error; + } + } + + ApiFuture future = jsonStreamWriter.append(data, offset); + ApiFutures.addCallback( + future, new AppendCompleteCallback(this), MoreExecutors.directExecutor()); + openRequestCount.register(); + } + + long cleanup(BigQueryWriteClient client) { + openRequestCount.arriveAndAwaitAdvance(); + jsonStreamWriter.close(); + + synchronized (this.streamLock) { + if (this.error != null) { + throw this.error; + } + } + + // Finalize the stream. + FinalizeWriteStreamResponse finalizeResponse = + client.finalizeWriteStream(jsonStreamWriter.getStreamName()); + LOG.finest("Rows written: " + finalizeResponse.getRowCount()); + return finalizeResponse.getRowCount(); + } + + String getStreamName() { + return jsonStreamWriter.getStreamName(); + } + + static class AppendCompleteCallback implements ApiFutureCallback { + + private final BigQueryJdbcBulkInsertWriter parent; + + AppendCompleteCallback(BigQueryJdbcBulkInsertWriter parent) { + this.parent = parent; + } + + public void onSuccess(AppendRowsResponse response) { + done(); + } + + public void onFailure(Throwable throwable) { + synchronized (this.parent.streamLock) { + if (this.parent.error == null) { + StorageException storageException = Exceptions.toStorageException(throwable); + this.parent.error = + (storageException != null) ? storageException : new RuntimeException(throwable); + } + } + done(); + } + + private void done() { + this.parent.openRequestCount.arriveAndDeregister(); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java new file mode 100644 index 0000000000..611b200ff6 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java @@ -0,0 +1,32 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import java.util.logging.Logger; + +class BigQueryJdbcCustomLogger extends Logger { + + protected BigQueryJdbcCustomLogger(String name, String resourceBundleName) { + super(name, resourceBundleName); + this.setParent(BigQueryJdbcRootLogger.getRootLogger()); + } + + BigQueryJdbcCustomLogger(String name) { + this(name, null); + this.setParent(BigQueryJdbcRootLogger.getRootLogger()); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java new file mode 100644 index 0000000000..5f486f1e58 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java @@ -0,0 +1,759 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.api.client.util.PemReader.readFirstSectionAndClose; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.OAUTH_TYPE_ERROR_MESSAGE; + +import com.google.api.client.util.PemReader; +import com.google.api.client.util.SecurityUtils; +import com.google.auth.oauth2.AccessToken; +import com.google.auth.oauth2.ClientId; +import com.google.auth.oauth2.ExternalAccountCredentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ImpersonatedCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; +import com.google.auth.oauth2.UserAuthorizer; +import com.google.auth.oauth2.UserCredentials; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.Strictness; +import com.google.gson.stream.JsonReader; +import java.awt.Desktop; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.StringReader; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +final class BigQueryJdbcOAuthUtility { + + private static final String USER_AUTH_SUCCESS_HTTP_RESPONSE = + "HTTP/1.1 200 OK\n" + + "Content-Length: 300\n" + + "Connection: close\n" + + "Content-Type: text/html; charset=utf-8\n" + + "\n" + + "\n" + + "Thank you for using JDBC Driver for Google BigQuery!\n" + + "You may now close the window."; + + private static final int USER_AUTH_TIMEOUT_MS = 120000; + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryJdbcOAuthUtility.class.getName()); + + private static final Map BYOID_NAME_MAP = + new HashMap() { + { + put(BigQueryJdbcUrlUtility.BYOID_AUDIENCE_URI_PROPERTY_NAME, "audience"); + put(BigQueryJdbcUrlUtility.BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME, "credential_source"); + put(BigQueryJdbcUrlUtility.BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME, "subject_token_type"); + put(BigQueryJdbcUrlUtility.BYOID_TOKEN_URI_PROPERTY_NAME, "token_url"); + put( + BigQueryJdbcUrlUtility.BYOID_POOL_USER_PROJECT_PROPERTY_NAME, + "workforce_pool_user_project"); + put( + BigQueryJdbcUrlUtility.BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME, + "service_account_impersonation_url"); + } + }; + + /** + * Parses the OAuth properties from the given URL. + * + * @param url The URL to parse. + * @return A map of OAuth properties. + */ + static Map parseOAuthProperties(String url, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + Map oauthProperties = new HashMap<>(); + + AuthType authType; + try { + authType = + AuthType.fromValue( + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_TYPE_VALUE, + callerClassName)); + } catch (NumberFormatException exception) { + throw new IllegalArgumentException(OAUTH_TYPE_ERROR_MESSAGE); + } + oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, String.valueOf(authType)); + switch (authType) { + case GOOGLE_SERVICE_ACCOUNT: + // For using a Google Service Account (OAuth Type 0) + // need: project id, OAuthServiceAcctEmail and OAuthPvtKey or OAuthPvtKeyPath that can be + // .p12 or json. + // TODO: validation if .p12 or json file can be in getPropertyInfo can be handy for user + String serviceAccountEmail = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME); + String serviceAccountPK = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME); + String serviceAccountPrivateKeyPath = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); + String p12Password = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_P12_PASSWORD_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_P12_PASSWORD_VALUE, + callerClassName); + + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME, serviceAccountEmail); + oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_P12_PASSWORD_PROPERTY_NAME, p12Password); + if (serviceAccountEmail != null && serviceAccountPK != null) { + oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, serviceAccountPK); + } else { + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, + serviceAccountPrivateKeyPath); + } + break; + case GOOGLE_USER_ACCOUNT: + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + int reqGoogleDriveScope = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, + callerClassName); + oauthProperties.put( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + String.valueOf(reqGoogleDriveScope)); + LOG.fine("RequestGoogleDriveScope parsed."); + break; + case PRE_GENERATED_TOKEN: + String refreshToken = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME); + if (refreshToken != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME, refreshToken); + LOG.fine("OAuthRefreshToken provided."); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); + LOG.fine("OAuthClientId provided."); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + LOG.fine("OAuthClientSecret provided."); + break; + } + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME)); + LOG.fine("OAuthAccessToken provided."); + break; + case APPLICATION_DEFAULT_CREDENTIALS: + // For Application Default Credentials (OAuth Type 3) + // need: project id + break; + case EXTERNAL_ACCOUNT_AUTH: + // For External account authentication (OAuth Type 4) + // need: project id, OAuthPvtKey or OAuthPvtKeyPath or BYOID_PROPERTIES + String pvtKey = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME); + String pvtKeyPath = + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); + if (pvtKey != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME)); + LOG.fine("OAuthPvtKey provided."); + } else if (pvtKeyPath != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseUriProperty( + url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME)); + LOG.fine("OAuthPvtKeyPath provided."); + } else { + for (String property : BigQueryJdbcUrlUtility.BYOID_PROPERTIES) { + String value = + BigQueryJdbcUrlUtility.parseBYOIDProperty(url, property, callerClassName); + if (value != null) { + oauthProperties.put(property, value); + LOG.fine(property + " provided."); + } + } + String universeDomainProp = BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME; + String universeDomain = BigQueryJdbcUrlUtility.parseUriProperty(url, universeDomainProp); + if (universeDomain != null) { + oauthProperties.put(universeDomainProp, universeDomain); + LOG.fine(universeDomainProp + " provided. Caller : " + callerClassName); + } + } + break; + } + + if (authType == AuthType.GOOGLE_SERVICE_ACCOUNT + || authType == AuthType.GOOGLE_USER_ACCOUNT + || authType == AuthType.PRE_GENERATED_TOKEN) { + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_EMAIL_VALUE, + callerClassName)); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_CHAIN_VALUE, + callerClassName)); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE, + callerClassName)); + oauthProperties.put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE, + callerClassName)); + } + return oauthProperties; + } + + /** + * Gets the credentials for the given Auth properties. + * + * @param authProperties A map of Auth properties. + * @return A GoogleCredentials object. + */ + static GoogleCredentials getCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + + AuthType authType = + AuthType.valueOf(authProperties.get(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME)); + + GoogleCredentials credentials; + switch (authType) { + case GOOGLE_SERVICE_ACCOUNT: + credentials = + getGoogleServiceAccountCredentials(authProperties, overrideProperties, callerClassName); + break; + case GOOGLE_USER_ACCOUNT: + credentials = + getGoogleUserAccountCredentials(authProperties, overrideProperties, callerClassName); + break; + case PRE_GENERATED_TOKEN: + credentials = + getPreGeneratedTokensCredentials(authProperties, overrideProperties, callerClassName); + break; + case APPLICATION_DEFAULT_CREDENTIALS: + // This auth method doesn't support service account impersonation + return getApplicationDefaultCredentials(callerClassName); + case EXTERNAL_ACCOUNT_AUTH: + // This auth method doesn't support service account impersonation + return getExternalAccountAuthCredentials(authProperties, callerClassName); + default: + throw new IllegalStateException(OAUTH_TYPE_ERROR_MESSAGE); + } + + return getServiceAccountImpersonatedCredentials(credentials, authProperties); + } + + private static boolean isFileExists(String filename) { + try { + return filename != null && !filename.isEmpty() && Files.exists(Paths.get(filename)); + } catch (Exception e) { + // Filename is invalid + return false; + } + } + + private static boolean isJson(String value) { + try { + // This is done this way to ensure strict Json parsing + // https://github.com/google/gson/issues/1208#issuecomment-2120764686 + InputStream stream = new ByteArrayInputStream(value.getBytes()); + InputStreamReader reader = new InputStreamReader(stream); + JsonReader jsonReader = new JsonReader(reader); + jsonReader.setStrictness(Strictness.STRICT); + JsonElement json = JsonParser.parseReader(jsonReader); + return json != null; + } catch (Exception e) { + // Unable to parse json string + return false; + } + } + + private static GoogleCredentials getGoogleServiceAccountCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + + ServiceAccountCredentials.Builder builder; + try { + final String pvtKeyPath = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); + final String pvtKey = authProperties.get(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME); + final String pvtEmail = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME); + final String p12Password = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_P12_PASSWORD_PROPERTY_NAME); + + final String keyPath = pvtKeyPath != null ? pvtKeyPath : pvtKey; + PrivateKey key = null; + InputStream stream = null; + + if (isFileExists(keyPath)) { + key = privateKeyFromP12File(keyPath, p12Password); + if (key == null) { + stream = Files.newInputStream(Paths.get(keyPath)); + } + } else if (isJson(pvtKey)) { + stream = new ByteArrayInputStream(pvtKey.getBytes()); + } else if (pvtKey != null) { + key = privateKeyFromPkcs8(pvtKey); + } + + if (stream != null) { + builder = ServiceAccountCredentials.fromStream(stream).toBuilder(); + } else if (pvtEmail != null && key != null) { + builder = + ServiceAccountCredentials.newBuilder().setClientEmail(pvtEmail).setPrivateKey(key); + } else { + LOG.severe("No valid Service Account credentials provided."); + throw new BigQueryJdbcRuntimeException("No valid credentials provided."); + } + + if (overrideProperties.containsKey(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME)) { + builder.setTokenServerUri( + new URI(overrideProperties.get(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME))); + } + if (overrideProperties.containsKey( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)) { + builder.setUniverseDomain( + overrideProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); + } + } catch (URISyntaxException | IOException e) { + LOG.severe("Validation failure for Service Account credentials."); + throw new BigQueryJdbcRuntimeException(e); + } + LOG.info("GoogleCredentials instantiated. Auth Method: Service Account."); + return builder.build(); + } + + static UserAuthorizer getUserAuthorizer( + Map authProperties, + Map overrideProperties, + int port, + String callerClassName) + throws URISyntaxException { + LOG.finest("++enter++\t" + callerClassName); + List scopes = new ArrayList<>(); + scopes.add("https://www.googleapis.com/auth/bigquery"); + + // Add Google Drive scope conditionally + if (authProperties.containsKey( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)) { + try { + int driveScopeValue = + Integer.parseInt( + authProperties.get( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); + if (driveScopeValue == 1) { + scopes.add("https://www.googleapis.com/auth/drive.readonly"); + LOG.fine("Added Google Drive read-only scope. Caller: " + callerClassName); + } + } catch (NumberFormatException e) { + LOG.severe( + "Invalid value for RequestGoogleDriveScope, defaulting to not request Drive scope. Caller: " + + callerClassName); + } + } + + List responseTypes = new ArrayList<>(); + responseTypes.add("code"); + + ClientId clientId = + ClientId.of( + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME), + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + UserAuthorizer.Builder userAuthorizerBuilder = + UserAuthorizer.newBuilder() + .setClientId(clientId) + .setScopes(scopes) + .setCallbackUri(URI.create("http://localhost:" + port)); + + if (overrideProperties.containsKey(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME)) { + userAuthorizerBuilder.setTokenServerUri( + new URI(overrideProperties.get(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME))); + } + + return userAuthorizerBuilder.build(); + } + + static UserCredentials getCredentialsFromCode( + UserAuthorizer userAuthorizer, String code, String callerClassName) throws IOException { + LOG.finest("++enter++\t" + callerClassName); + return userAuthorizer.getCredentialsFromCode(code, URI.create("")); + } + + private static GoogleCredentials getGoogleUserAccountCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + try { + ServerSocket serverSocket = new ServerSocket(0); + serverSocket.setSoTimeout(USER_AUTH_TIMEOUT_MS); + int port = serverSocket.getLocalPort(); + UserAuthorizer userAuthorizer = + getUserAuthorizer(authProperties, overrideProperties, port, callerClassName); + + URL authURL = userAuthorizer.getAuthorizationUrl("user", "", URI.create("")); + String code; + + if (Desktop.isDesktopSupported()) { + Desktop.getDesktop().browse(authURL.toURI()); + + Socket socket = serverSocket.accept(); + + OutputStream outputStream = socket.getOutputStream(); + PrintWriter printWriter = new PrintWriter(outputStream); + + BufferedReader bufferedReader = + new BufferedReader(new InputStreamReader(socket.getInputStream())); + String response = bufferedReader.readLine(); + + Pattern p = Pattern.compile("(?<=code=).*?(?=&|$)"); + Matcher m = p.matcher(response); + + if (!m.find()) { + throw new BigQueryJdbcRuntimeException("Could not retrieve the code for user auth"); + } + code = m.group(); + + printWriter.println(USER_AUTH_SUCCESS_HTTP_RESPONSE); + printWriter.flush(); + socket.close(); + serverSocket.close(); + } else { + throw new BigQueryJdbcRuntimeException("User auth only supported in desktop environments"); + } + + return getCredentialsFromCode(userAuthorizer, code, callerClassName); + } catch (IOException | URISyntaxException ex) { + LOG.severe( + String.format( + "Failed to establish connection using User Account authentication: %s", + ex.getMessage())); + throw new BigQueryJdbcRuntimeException(ex); + } + } + + private static GoogleCredentials getPreGeneratedAccessTokenCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + GoogleCredentials.Builder builder = GoogleCredentials.newBuilder(); + if (overrideProperties.containsKey( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)) { + builder.setUniverseDomain( + overrideProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); + } + LOG.info("Connection established. Auth Method: Pre-generated Access Token."); + return builder + .setAccessToken( + AccessToken.newBuilder() + .setTokenValue( + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME)) + .build()) + .build(); + } + + static GoogleCredentials getPreGeneratedTokensCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + if (authProperties.containsKey(BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME)) { + try { + return getPreGeneratedRefreshTokenCredentials( + authProperties, overrideProperties, callerClassName); + } catch (URISyntaxException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } else { + return getPreGeneratedAccessTokenCredentials( + authProperties, overrideProperties, callerClassName); + } + } + + static UserCredentials getPreGeneratedRefreshTokenCredentials( + Map authProperties, + Map overrideProperties, + String callerClassName) + throws URISyntaxException { + LOG.finest("++enter++\t" + callerClassName); + + UserCredentials.Builder userCredentialsBuilder = + UserCredentials.newBuilder() + .setRefreshToken( + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME)) + .setClientId(authProperties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)) + .setClientSecret( + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + + if (overrideProperties.containsKey(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME)) { + userCredentialsBuilder.setTokenServerUri( + new URI(overrideProperties.get(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME))); + } + if (overrideProperties.containsKey( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)) { + userCredentialsBuilder.setUniverseDomain( + overrideProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); + } + LOG.info("Connection established. Auth Method: Pre-generated Refresh Token."); + return userCredentialsBuilder.build(); + } + + private static GoogleCredentials getApplicationDefaultCredentials(String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + try { + GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); + String principal = "unknown"; + if (credentials instanceof ServiceAccountCredentials) { + principal = ((ServiceAccountCredentials) credentials).getClientEmail(); + } else if (credentials instanceof UserCredentials) { + principal = "user credentials"; + } else if (credentials instanceof ExternalAccountCredentials) { + principal = "external account"; + } + LOG.info( + String.format( + "Connection established. Auth Method: Application Default Credentials, Principal: %s.", + principal)); + return credentials; + } catch (IOException exception) { + // TODO throw exception + throw new BigQueryJdbcRuntimeException("Application default credentials not found."); + } + } + + private static GoogleCredentials getExternalAccountAuthCredentials( + Map authProperties, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + try { + JsonObject jsonObject = null; + String credentialsPath = null; + if (authProperties.containsKey(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME)) { + String pvtKeyPath = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME).trim(); + if (pvtKeyPath.startsWith("{")) { + jsonObject = JsonParser.parseString(pvtKeyPath).getAsJsonObject(); + } else { + credentialsPath = pvtKeyPath; + } + } else if (authProperties.containsKey( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME)) { + credentialsPath = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); + } else { + jsonObject = new JsonObject(); + for (String property : BigQueryJdbcUrlUtility.BYOID_PROPERTIES) { + if (Objects.equals( + property, BigQueryJdbcUrlUtility.BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME)) { + jsonObject.add( + BYOID_NAME_MAP.get(property), + JsonParser.parseString(authProperties.get(property)).getAsJsonObject()); + } else if (authProperties.containsKey(property)) { + jsonObject.addProperty(BYOID_NAME_MAP.get(property), authProperties.get(property)); + } + } + if (authProperties.containsKey( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)) { + jsonObject.addProperty( + "universe_domain", + authProperties.get(BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME)); + } + } + + if (credentialsPath != null) { + return ExternalAccountCredentials.fromStream( + Files.newInputStream(Paths.get(credentialsPath))); + } else if (jsonObject != null) { + return ExternalAccountCredentials.fromStream( + new ByteArrayInputStream(jsonObject.toString().getBytes())); + } else { + throw new IllegalArgumentException( + "Insufficient info provided for external authentication"); + } + } catch (IOException e) { + throw new BigQueryJdbcRuntimeException(e); + } + } + + // This function checks if connection string contains configuration for + // credentials impersonation. If not, it returns regular credentials object. + // If impersonated service account is provided, returns Credentials object + // accomodating this information. + private static GoogleCredentials getServiceAccountImpersonatedCredentials( + GoogleCredentials credentials, Map authProperties) { + + String impersonationEmail = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME); + if (impersonationEmail == null || impersonationEmail.isEmpty()) { + return credentials; + } + + String impersonationChainString = + authProperties.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME); + List impersonationChain = null; + if (impersonationChainString != null && !impersonationChainString.isEmpty()) { + impersonationChain = Arrays.asList(impersonationChainString.split(",")); + } + + // Scopes has a default value, so it should never be null + List impersonationScopes = + Arrays.asList( + authProperties + .get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME) + .split(",")); + + // Token lifetime has a default value, so it should never be null + String impersonationLifetime = + authProperties.get( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME); + int impersonationLifetimeInt = 0; + try { + impersonationLifetimeInt = Integer.parseInt(impersonationLifetime); + } catch (NumberFormatException e) { + LOG.severe("Invalid value for ServiceAccountImpersonationTokenLifetime."); + throw new IllegalArgumentException( + "Invalid value for ServiceAccountImpersonationTokenLifetime: must be a positive integer.", + e); + } + + return ImpersonatedCredentials.create( + credentials, + impersonationEmail, + impersonationChain, + impersonationScopes, + impersonationLifetimeInt); + } + + static PrivateKey privateKeyFromP12File(String privateKeyFile, String password) { + try { + InputStream stream = Files.newInputStream(Paths.get(privateKeyFile)); + return SecurityUtils.loadPrivateKeyFromKeyStore( + SecurityUtils.getPkcs12KeyStore(), stream, "notasecret", "privatekey", password); + } catch (IOException | GeneralSecurityException e) { + LOG.warning("Unable to parse p12 file: " + e.getMessage()); + return null; + } + } + + static PrivateKey privateKeyFromPkcs8(String privateKeyPkcs8) { + try { + Reader reader = new StringReader(privateKeyPkcs8); + PemReader.Section section = readFirstSectionAndClose(reader, "PRIVATE KEY"); + if (section == null) { + throw new IOException("Invalid PKCS#8 data."); + } + byte[] bytes = section.getBase64DecodedBytes(); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes); + KeyFactory keyFactory = SecurityUtils.getRsaKeyFactory(); + return keyFactory.generatePrivate(keySpec); + } catch (NoSuchAlgorithmException | InvalidKeySpecException | IOException e) { + LOG.warning("Unable to parse pkcs8 secret: " + e.getMessage()); + return null; + } + } + + enum AuthType { + GOOGLE_SERVICE_ACCOUNT(0), + GOOGLE_USER_ACCOUNT(1), + PRE_GENERATED_TOKEN(2), + APPLICATION_DEFAULT_CREDENTIALS(3), + EXTERNAL_ACCOUNT_AUTH(4); + + private final int value; + + AuthType(int value) { + this.value = value; + } + + static AuthType fromValue(int value) { + for (AuthType authType : values()) { + if (authType.value == value) { + return authType; + } + } + throw new IllegalStateException(OAUTH_TYPE_ERROR_MESSAGE + ": " + value); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameter.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameter.java new file mode 100644 index 0000000000..cb11d14e46 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameter.java @@ -0,0 +1,117 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.BigQueryParameterHandler.BigQueryStatementParameterType; + +class BigQueryJdbcParameter { + private int index; + private Object value; + private Class type; + private StandardSQLTypeName sqlType; + // Additional parameters needed for CallableStatement. + private String paramName; + private BigQueryStatementParameterType paramType; + private int scale; + + BigQueryJdbcParameter() {} + + BigQueryJdbcParameter(BigQueryJdbcParameter parameter) { + this.index = parameter.index; + this.value = parameter.value; + this.type = parameter.type; + this.sqlType = parameter.sqlType; + } + + int getIndex() { + return index; + } + + void setIndex(int index) { + this.index = index; + } + + Object getValue() { + return value; + } + + void setValue(Object value) { + this.value = value; + } + + Class getType() { + return type; + } + + public void setType(Class type) { + this.type = type; + } + + StandardSQLTypeName getSqlType() { + return sqlType; + } + + void setSqlType(StandardSQLTypeName sqlType) { + this.sqlType = sqlType; + } + + String getParamName() { + return paramName; + } + + void setParamName(String paramName) { + this.paramName = paramName; + } + + BigQueryStatementParameterType getParamType() { + return paramType; + } + + void setParamType(BigQueryStatementParameterType paramType) { + this.paramType = paramType; + } + + int getScale() { + return scale; + } + + void setScale(int scale) { + this.scale = scale; + } + + @Override + public String toString() { + return "BigQueryJdbcParameter{" + + "index=" + + index + + ", value=" + + value + + ", type=" + + type + + ", sqlType=" + + sqlType + + ", paramName='" + + paramName + + '\'' + + ", paramType=" + + paramType.name() + + ", scale=" + + scale + + '}'; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java new file mode 100644 index 0000000000..ebc5450b62 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java @@ -0,0 +1,291 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.storage.v1.stub.BigQueryReadStubSettings.defaultGrpcTransportProviderBuilder; + +import com.google.api.client.http.HttpTransport; +import com.google.api.client.http.apache.v5.Apache5HttpTransport; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.http.HttpTransportFactory; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.http.HttpTransportOptions; +import io.grpc.HttpConnectProxiedSocketAddress; +import io.grpc.ProxiedSocketAddress; +import io.grpc.ProxyDetector; +import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts; +import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; +import org.apache.hc.client5.http.auth.AuthScope; +import org.apache.hc.client5.http.auth.UsernamePasswordCredentials; +import org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy; +import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider; +import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; +import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder; +import org.apache.hc.client5.http.impl.routing.DefaultProxyRoutePlanner; +import org.apache.hc.client5.http.routing.HttpRoutePlanner; +import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; +import org.apache.hc.core5.http.HttpHost; + +final class BigQueryJdbcProxyUtility { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryJdbcProxyUtility.class.getName()); + static final String validPortRegex = + "^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"; + + private BigQueryJdbcProxyUtility() {} + + static Map parseProxyProperties(String URL, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + Map proxyProperties = new HashMap<>(); + String proxyHost = + BigQueryJdbcUrlUtility.parseUriProperty( + URL, BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME); + if (proxyHost != null) { + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, proxyHost); + } + String proxyPort = + BigQueryJdbcUrlUtility.parseUriProperty( + URL, BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME); + if (proxyPort != null) { + if (!Pattern.compile(validPortRegex).matcher(proxyPort).find()) { + throw new IllegalArgumentException( + "Illegal port number provided %s. Please provide a valid port number."); + } + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, proxyPort); + } + String proxyUid = + BigQueryJdbcUrlUtility.parseUriProperty( + URL, BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME); + if (proxyUid != null) { + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME, proxyUid); + } + String proxyPwd = + BigQueryJdbcUrlUtility.parseUriProperty( + URL, BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME); + if (proxyPwd != null) { + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME, proxyPwd); + } + + boolean isMissingProxyHostOrPortWhenProxySet = + (proxyHost == null && proxyPort != null) || (proxyHost != null && proxyPort == null); + if (isMissingProxyHostOrPortWhenProxySet) { + throw new IllegalArgumentException( + "Both ProxyHost and ProxyPort parameters need to be specified. No defaulting behavior occurs."); + } + boolean isMissingProxyUidOrPwdWhenAuthSet = + (proxyUid == null && proxyPwd != null) || (proxyUid != null && proxyPwd == null); + if (isMissingProxyUidOrPwdWhenAuthSet) { + throw new IllegalArgumentException( + "Both ProxyUid and ProxyPwd parameters need to be specified for authentication."); + } + boolean isProxyAuthSetWithoutProxySettings = proxyUid != null && proxyHost == null; + if (isProxyAuthSetWithoutProxySettings) { + throw new IllegalArgumentException( + "Proxy authentication provided via connection string with no proxy host or port set."); + } + return proxyProperties; + } + + static HttpTransportOptions getHttpTransportOptions( + Map proxyProperties, + String sslTrustStorePath, + String sslTrustStorePassword, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + + if (!proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME) + && sslTrustStorePath == null) { + return null; + } + return HttpTransportOptions.newBuilder() + .setHttpTransportFactory( + getHttpTransportFactory( + proxyProperties, sslTrustStorePath, sslTrustStorePassword, callerClassName)) + .build(); + } + + private static HttpTransportFactory getHttpTransportFactory( + Map proxyProperties, + String sslTrustStorePath, + String sslTrustStorePassword, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + HttpClientBuilder httpClientBuilder = HttpClients.custom(); + boolean explicitProxySet = + proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME); + + if (explicitProxySet) { + HttpHost proxyHostDetails = + new HttpHost( + proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME), + Integer.parseInt( + proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME))); + HttpRoutePlanner httpRoutePlanner = new DefaultProxyRoutePlanner(proxyHostDetails); + httpClientBuilder.setRoutePlanner(httpRoutePlanner); + addAuthToProxyIfPresent(proxyProperties, httpClientBuilder, callerClassName); + } else { + httpClientBuilder.useSystemProperties(); + } + + if (sslTrustStorePath != null) { + try (FileInputStream trustStoreStream = new FileInputStream(sslTrustStorePath)) { + KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); + char[] trustStorePasswordChars = + sslTrustStorePassword != null ? sslTrustStorePassword.toCharArray() : null; + trustStore.load(trustStoreStream, trustStorePasswordChars); + + TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(trustStore); + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustManagerFactory.getTrustManagers(), null); + + SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory(sslContext); + httpClientBuilder.setConnectionManager( + PoolingHttpClientConnectionManagerBuilder.create() + .setSSLSocketFactory(sslSocketFactory) + .build()); + } catch (IOException | GeneralSecurityException e) { + throw new BigQueryJdbcRuntimeException(e); + } + } + addAuthToProxyIfPresent(proxyProperties, httpClientBuilder, callerClassName); + + CloseableHttpClient httpClient = httpClientBuilder.build(); + final HttpTransport httpTransport = new Apache5HttpTransport(httpClient); + return () -> httpTransport; + } + + private static void addAuthToProxyIfPresent( + Map proxyProperties, + HttpClientBuilder closeableHttpClientBuilder, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + if (proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME) + && proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME)) { + + AuthScope authScope = + new AuthScope( + proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME), + Integer.parseInt( + proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME))); + UsernamePasswordCredentials usernamePasswordCredentials = + new UsernamePasswordCredentials( + proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME), + proxyProperties + .get(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME) + .toCharArray()); + + BasicCredentialsProvider proxyCredentialsProvider = new BasicCredentialsProvider(); + proxyCredentialsProvider.setCredentials(authScope, usernamePasswordCredentials); + closeableHttpClientBuilder.setDefaultCredentialsProvider(proxyCredentialsProvider); + closeableHttpClientBuilder.setProxyAuthenticationStrategy( + DefaultAuthenticationStrategy.INSTANCE); // order of challenge? so it will show up + } + } + + static TransportChannelProvider getTransportChannelProvider( + Map proxyProperties, + String sslTrustStorePath, + String sslTrustStorePassword, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + boolean hasProxy = proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME); + boolean hasSsl = sslTrustStorePath != null; + + if (!hasProxy && !hasSsl) { + return null; + } + + TransportChannelProvider transportChannelProvider = + defaultGrpcTransportProviderBuilder() + .setChannelConfigurator( + managedChannelBuilder -> { + if (hasProxy) { + managedChannelBuilder.proxyDetector( + new ProxyDetector() { + @Override + public ProxiedSocketAddress proxyFor(SocketAddress socketAddress) { + return getHttpConnectProxiedSocketAddress( + (InetSocketAddress) socketAddress, proxyProperties); + } + }); + } + if (hasSsl + && managedChannelBuilder + instanceof io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder) { + try (FileInputStream trustStoreStream = + new FileInputStream(sslTrustStorePath)) { + KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); + char[] trustStorePasswordChars = + sslTrustStorePassword != null + ? sslTrustStorePassword.toCharArray() + : null; + trustStore.load(trustStoreStream, trustStorePasswordChars); + + TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance( + TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(trustStore); + + SslContext grpcSslContext = + GrpcSslContexts.forClient().trustManager(trustManagerFactory).build(); + ((io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder) + managedChannelBuilder) + .sslContext(grpcSslContext); + + } catch (IOException | GeneralSecurityException e) { + throw new BigQueryJdbcRuntimeException(e); + } + } + return managedChannelBuilder; + }) + .build(); + return transportChannelProvider; + } + + private static HttpConnectProxiedSocketAddress getHttpConnectProxiedSocketAddress( + InetSocketAddress socketAddress, Map proxyProperties) { + String proxyHost = proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME); + int proxyPort = + Integer.parseInt(proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME)); + HttpConnectProxiedSocketAddress.Builder builder = + HttpConnectProxiedSocketAddress.newBuilder() + .setProxyAddress(new InetSocketAddress(proxyHost, proxyPort)) + .setTargetAddress(socketAddress); + if (proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME) + && proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME)) { + builder.setUsername(proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME)); + builder.setPassword(proxyProperties.get(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME)); + } + return builder.build(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java new file mode 100644 index 0000000000..ef963d87d3 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java @@ -0,0 +1,193 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import java.io.IOException; +import java.lang.management.ManagementFactory; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Optional; +import java.util.logging.ConsoleHandler; +import java.util.logging.FileHandler; +import java.util.logging.Formatter; +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +/** This class is used to log messages from the BigQuery JDBC Driver. */ +class BigQueryJdbcRootLogger { + + /** + * Note: Each connection will have its own file handler with the level and logPath specified in + * the connection properties. But the logs will be driver logs and not connection specific. + */ + private static final Logger logger = Logger.getLogger("com.google.cloud.bigquery"); + + private static final Logger storageLogger = Logger.getLogger("com.google.cloud.bigquery.storage"); + + private static Handler fileHandler = null; + private static Path currentLogPath = null; + private static int fileCounter = 0; + + static { + logger.setUseParentHandlers(false); + storageLogger.setUseParentHandlers(true); + } + + public static Formatter getFormatter() { + return new Formatter() { + private static final String PATTERN = "yyyy-MM-dd HH:mm:ss.SSS"; + private static final String FORMAT = + "%1$s %2$5s %3$d --- [%4$-7.15s] %5$-50s %6$-20s: %7$s%8$s"; + private static final int MAX_THREAD_NAME_LENGTH = 15; + + /** + * Returns the thread for the given thread id. + * + * @param threadId ID for the thread being logged. + * @return returns the thread + */ + Optional getThread(long threadId) { + return Thread.getAllStackTraces().keySet().stream() + .filter(thread -> thread.getId() == threadId) + .findFirst(); + } + + @Override + public String format(LogRecord record) { + String date = new SimpleDateFormat(PATTERN).format(new Date(record.getMillis())); + String threadName = + getThread(record.getThreadID()) + .map(Thread::getName) + .map( + name -> + name.length() > MAX_THREAD_NAME_LENGTH + ? name.substring(name.length() - MAX_THREAD_NAME_LENGTH) + : name) + .orElse(""); + long processId = + Long.parseLong(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]); + String sourceClassName = record.getLoggerName(); + String sourceMethodName = record.getSourceMethodName(); + return String.format( + FORMAT, + date, + record.getLevel().getName(), + processId, + threadName, + sourceClassName, + sourceMethodName, + record.getMessage(), + System.lineSeparator()); + } + }; + } + + public static Logger getRootLogger() { + return logger; + } + + private static void setHandler() throws IOException { + // If Console handler exists, remove it. + // If File handler exists, use it. Else create new one. + for (Handler h : logger.getHandlers()) { + if (h instanceof ConsoleHandler) { + h.close(); + logger.removeHandler(h); + break; + } + if (h instanceof FileHandler) { + fileHandler = h; + break; + } + } + + if (fileHandler == null) { + String fileName = String.format("BigQueryJdbc%d", fileCounter); + fileCounter++; + + currentLogPath = Files.createTempFile(fileName, ".log"); + currentLogPath.toFile().deleteOnExit(); + + fileHandler = new FileHandler(currentLogPath.toString(), 0, 1, true); + logger.addHandler(fileHandler); + } + } + + public static void setLevel(Level level, String logPath) throws IOException { + if (level != Level.OFF) { + setPath(logPath); + if (logger.getHandlers().length == 0) { + setHandler(); + fileHandler.setFormatter(getFormatter()); + logger.setUseParentHandlers(false); + } + fileHandler.setLevel(level); + logger.setLevel(level); + } else { + for (Handler h : logger.getHandlers()) { + h.close(); + logger.removeHandler(h); + } + fileHandler = null; + currentLogPath = null; + } + } + + static void setPath(String logPath) { + try { + if (!logPath.isEmpty() && !logPath.endsWith("/")) { + logPath = logPath + "/"; + } + Path dir = Paths.get(logPath); + if (!Files.exists(dir)) { + Files.createDirectory(dir); + } + + String fileName = String.format("BigQueryJdbc%d.log", fileCounter); + fileCounter++; + Path destination = Paths.get(logPath + fileName).toAbsolutePath(); + + if (currentLogPath != null && !currentLogPath.equals(destination)) { + Path source = Paths.get(currentLogPath.toUri()); + Files.move(source, destination, StandardCopyOption.REPLACE_EXISTING); + } + + currentLogPath = destination; + fileHandler = new FileHandler(currentLogPath.toString(), 0, 1, true); + fileHandler.setFormatter(getFormatter()); + + for (Handler h : logger.getHandlers()) { + if (h instanceof FileHandler) { + h.close(); + logger.removeHandler(h); + break; + } + } + + logger.addHandler(fileHandler); + + } catch (IOException ex) { + logger.warning("Log File warning : " + ex); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcTypeMappings.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcTypeMappings.java new file mode 100644 index 0000000000..b95ac02302 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcTypeMappings.java @@ -0,0 +1,159 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.common.collect.ImmutableMap; +import com.google.gson.JsonObject; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.util.AbstractMap.SimpleEntry; +import java.util.Map; + +@InternalApi +class BigQueryJdbcTypeMappings { + + static final Map> standardSQLToJavaTypeMapping = + ImmutableMap.ofEntries( + entry(StandardSQLTypeName.INT64, Long.class), + entry(StandardSQLTypeName.BOOL, Boolean.class), + entry(StandardSQLTypeName.FLOAT64, Double.class), + entry(StandardSQLTypeName.NUMERIC, BigDecimal.class), + entry(StandardSQLTypeName.BIGNUMERIC, BigDecimal.class), + entry(StandardSQLTypeName.STRING, String.class), + entry(StandardSQLTypeName.TIMESTAMP, Timestamp.class), + entry(StandardSQLTypeName.DATE, Date.class), + entry(StandardSQLTypeName.TIME, Time.class), + entry(StandardSQLTypeName.DATETIME, Timestamp.class), + entry(StandardSQLTypeName.GEOGRAPHY, String.class), + entry(StandardSQLTypeName.JSON, String.class), + entry(StandardSQLTypeName.INTERVAL, String.class), + entry(StandardSQLTypeName.RANGE, String.class), + entry(StandardSQLTypeName.BYTES, byte[].class), + entry(StandardSQLTypeName.STRUCT, Struct.class), + entry(StandardSQLTypeName.ARRAY, Array.class)); + + static final Map standardSQLToJavaSqlTypesMapping = + ImmutableMap.ofEntries( + entry(StandardSQLTypeName.INT64, Types.BIGINT), + entry(StandardSQLTypeName.BOOL, Types.BOOLEAN), + entry(StandardSQLTypeName.FLOAT64, Types.DOUBLE), + entry(StandardSQLTypeName.NUMERIC, Types.NUMERIC), + entry(StandardSQLTypeName.BIGNUMERIC, Types.NUMERIC), + entry(StandardSQLTypeName.STRING, Types.NVARCHAR), + entry(StandardSQLTypeName.TIMESTAMP, Types.TIMESTAMP), + entry(StandardSQLTypeName.DATE, Types.DATE), + entry(StandardSQLTypeName.TIME, Types.TIME), + entry(StandardSQLTypeName.DATETIME, Types.TIMESTAMP), + entry(StandardSQLTypeName.GEOGRAPHY, Types.OTHER), + entry(StandardSQLTypeName.JSON, Types.OTHER), + entry(StandardSQLTypeName.INTERVAL, Types.OTHER), + entry(StandardSQLTypeName.RANGE, Types.OTHER), + entry(StandardSQLTypeName.BYTES, Types.VARBINARY), + entry(StandardSQLTypeName.STRUCT, Types.STRUCT), + entry(StandardSQLTypeName.ARRAY, Types.ARRAY)); + + static final Map> javaSQLToJavaTypeMapping = + ImmutableMap.ofEntries( + entry(Types.BIGINT, Long.class), + entry(Types.INTEGER, Integer.class), + entry(Types.BOOLEAN, Boolean.class), + entry(Types.DOUBLE, Double.class), + entry(Types.FLOAT, Float.class), + entry(Types.NUMERIC, BigDecimal.class), + entry(Types.VARCHAR, String.class), + entry(Types.NVARCHAR, String.class), + entry(Types.TIMESTAMP, Timestamp.class), + entry(Types.DATE, Date.class), + entry(Types.TIME, Time.class), + entry(Types.OTHER, String.class), + entry(Types.BINARY, byte[].class), + entry(Types.VARBINARY, byte[].class), + entry(Types.STRUCT, Struct.class), + entry(Types.BIT, Boolean.class), + entry(Types.ARRAY, Array.class)); + + static StandardSQLTypeName classToType(Class type) + throws BigQueryJdbcSqlFeatureNotSupportedException { + if (Boolean.class.isAssignableFrom(type)) { + return StandardSQLTypeName.BOOL; + } else if (String.class.isAssignableFrom(type)) { + return StandardSQLTypeName.STRING; + } else if (String.class.isAssignableFrom(type)) { + return StandardSQLTypeName.GEOGRAPHY; + } else if (String.class.isAssignableFrom(type)) { + return StandardSQLTypeName.DATETIME; + } else if (Integer.class.isAssignableFrom(type)) { + return StandardSQLTypeName.INT64; + } else if (Long.class.isAssignableFrom(type)) { + return StandardSQLTypeName.INT64; + } else if (Double.class.isAssignableFrom(type)) { + return StandardSQLTypeName.FLOAT64; + } else if (Float.class.isAssignableFrom(type)) { + return StandardSQLTypeName.FLOAT64; + } else if (BigDecimal.class.isAssignableFrom(type)) { + return StandardSQLTypeName.NUMERIC; + } else if (BigDecimal.class.isAssignableFrom(type)) { + return StandardSQLTypeName.BIGNUMERIC; + } else if (Date.class.isAssignableFrom(type)) { + return StandardSQLTypeName.DATE; + } else if (Timestamp.class.isAssignableFrom(type)) { + return StandardSQLTypeName.TIMESTAMP; + } else if (Time.class.isAssignableFrom(type)) { + return StandardSQLTypeName.TIME; + } else if (String.class.isAssignableFrom(type)) { + return StandardSQLTypeName.JSON; + } else if (JsonObject.class.isAssignableFrom(type)) { + return StandardSQLTypeName.JSON; + } else if (Byte.class.isAssignableFrom(type)) { + return StandardSQLTypeName.BYTES; + } else if (Array.class.isAssignableFrom(type)) { + return StandardSQLTypeName.ARRAY; + } else if (Struct.class.isAssignableFrom(type)) { + return StandardSQLTypeName.STRUCT; + } else if (byte[].class.isAssignableFrom(type)) { + return StandardSQLTypeName.BYTES; + } + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Unsupported object type for QueryParameter: " + type); + } + + static Class getJavaType(int javaSQLType) throws BigQueryJdbcSqlFeatureNotSupportedException { + if (!javaSQLToJavaTypeMapping.containsKey(javaSQLType)) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Unsupported Java type for SQL type: " + javaSQLType); + } + Class javaType = javaSQLToJavaTypeMapping.get(javaSQLType); + if (javaType == null) { + // This should never happen unless the map was initialized with null values. + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "Unsupported Java type for SQL type: " + javaSQLType); + } + return javaType; + } + + private static SimpleEntry entry(K key, V value) { + return new SimpleEntry<>(key, value); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java new file mode 100644 index 0000000000..3b26f7be54 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -0,0 +1,920 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.client.util.escape.CharEscapers; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.Set; +import java.util.logging.Level; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +/** + * This class implements all the methods that parse Connection property values from the Connection + * String. + */ +final class BigQueryJdbcUrlUtility { + + // TODO: Add all Connection options + static final String ALLOW_LARGE_RESULTS_PROPERTY_NAME = "AllowLargeResults"; + static final String LARGE_RESULTS_TABLE_PROPERTY_NAME = "LargeResultTable"; + static final String LARGE_RESULTS_DATASET_PROPERTY_NAME = "LargeResultDataset"; + static final String UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME = "UnsupportedHTAPIFallback"; + static final boolean DEFAULT_UNSUPPORTED_HTAPI_FALLBACK_VALUE = true; + static final String DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME = + "LargeResultsDatasetExpirationTime"; + static final long DEFAULT_DESTINATION_DATASET_EXPIRATION_TIME_VALUE = 3600000L; + static final boolean DEFAULT_ALLOW_LARGE_RESULTS = true; + static final String QUERY_DIALECT_PROPERTY_NAME = "QueryDialect"; + static final String DEFAULT_QUERY_DIALECT_VALUE = "SQL"; + static final String UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME = "universeDomain"; + static final String DEFAULT_UNIVERSE_DOMAIN_VALUE = "googleapis.com"; + static final String PROJECT_ID_PROPERTY_NAME = "ProjectId"; + static final String DEFAULT_DATASET_PROPERTY_NAME = "DefaultDataset"; + static final String OAUTH_TYPE_PROPERTY_NAME = "OAuthType"; + static final String HTAPI_ACTIVATION_RATIO_PROPERTY_NAME = "HighThroughputActivationRatio"; + static final String KMS_KEY_NAME_PROPERTY_NAME = "KMSKeyName"; + static final String QUERY_PROPERTIES_NAME = "QueryProperties"; + static final int DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE = + 2; // TODO: to adjust this value before private preview based on performance testing. + static final String HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME = "HighThroughputMinTableSize"; + static final int DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE = 100; + static final int DEFAULT_OAUTH_TYPE_VALUE = -1; + static final String LOCATION_PROPERTY_NAME = "Location"; + static final String ENDPOINT_OVERRIDES_PROPERTY_NAME = "EndpointOverrides"; + static final String PRIVATE_SERVICE_CONNECT_PROPERTY_NAME = "PrivateServiceConnectUris"; + static final String OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME = + "ServiceAccountImpersonationEmail"; + static final String DEFAULT_OAUTH_SA_IMPERSONATION_EMAIL_VALUE = null; + static final String OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME = + "ServiceAccountImpersonationChain"; + static final String DEFAULT_OAUTH_SA_IMPERSONATION_CHAIN_VALUE = null; + static final String OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME = + "ServiceAccountImpersonationScopes"; + static final String DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE = + "https://www.googleapis.com/auth/bigquery"; + static final String OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME = + "ServiceAccountImpersonationTokenLifetime"; + static final String DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE = "3600"; + static final String OAUTH_SA_EMAIL_PROPERTY_NAME = "OAuthServiceAcctEmail"; + static final String OAUTH_PVT_KEY_PATH_PROPERTY_NAME = "OAuthPvtKeyPath"; + static final String OAUTH_P12_PASSWORD_PROPERTY_NAME = "OAuthP12Password"; + static final String DEFAULT_OAUTH_P12_PASSWORD_VALUE = "notasecret"; + static final String OAUTH_PVT_KEY_PROPERTY_NAME = "OAuthPvtKey"; + static final String OAUTH2_TOKEN_URI_PROPERTY_NAME = "OAUTH2"; + static final String HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME = "READ_API"; + static final String BIGQUERY_ENDPOINT_OVERRIDE_PROPERTY_NAME = "BIGQUERY"; + static final String STS_ENDPOINT_OVERRIDE_PROPERTY_NAME = "STS"; + static final String OAUTH_ACCESS_TOKEN_PROPERTY_NAME = "OAuthAccessToken"; + static final String OAUTH_REFRESH_TOKEN_PROPERTY_NAME = "OAuthRefreshToken"; + static final String OAUTH_CLIENT_ID_PROPERTY_NAME = "OAuthClientId"; + static final String OAUTH_CLIENT_SECRET_PROPERTY_NAME = "OAuthClientSecret"; + static final String ENABLE_HTAPI_PROPERTY_NAME = "EnableHighThroughputAPI"; + static final String PROXY_HOST_PROPERTY_NAME = "ProxyHost"; + static final String PROXY_PORT_PROPERTY_NAME = "ProxyPort"; + static final String PROXY_USER_ID_PROPERTY_NAME = "ProxyUid"; + static final String PROXY_PASSWORD_PROPERTY_NAME = "ProxyPwd"; + static final boolean DEFAULT_ENABLE_HTAPI_VALUE = false; + static final boolean DEFAULT_ENABLE_SESSION_VALUE = false; + static final int DEFAULT_LOG_LEVEL = 0; + static final String LOG_LEVEL_PROPERTY_NAME = "LogLevel"; + static final String LOG_PATH_PROPERTY_NAME = "LogPath"; + static final String LOG_LEVEL_ENV_VAR = "BIGQUERY_JDBC_LOG_LEVEL"; + static final String LOG_PATH_ENV_VAR = "BIGQUERY_JDBC_LOG_PATH"; + static final String ENABLE_SESSION_PROPERTY_NAME = "EnableSession"; + static final String DEFAULT_LOG_PATH = ""; + static final String USE_QUERY_CACHE_PROPERTY_NAME = "UseQueryCache"; + static final boolean DEFAULT_USE_QUERY_CACHE = true; + static final String JOB_CREATION_MODE_PROPERTY_NAME = "JobCreationMode"; + static final int DEFAULT_JOB_CREATION_MODE = 2; + static final String MAX_RESULTS_PROPERTY_NAME = "MaxResults"; + static final long DEFAULT_MAX_RESULTS_VALUE = 10000; + static final String BYOID_AUDIENCE_URI_PROPERTY_NAME = "BYOID_AudienceUri"; + static final String BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME = "BYOID_CredentialSource"; + static final String BYOID_POOL_USER_PROJECT_PROPERTY_NAME = "BYOID_PoolUserProject"; + static final String BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME = "BYOID_SA_Impersonation_Uri"; + static final String BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME = "BYOID_SubjectTokenType"; + static final String BYOID_TOKEN_URI_PROPERTY_NAME = "BYOID_TokenUri"; + static final String PARTNER_TOKEN_PROPERTY_NAME = "PartnerToken"; + static final String METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME = "MetaDataFetchThreadCount"; + static final int DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE = 32; + static final String RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME = "Timeout"; + static final long DEFAULT_RETRY_TIMEOUT_IN_SECS_VALUE = 0L; + static final String JOB_TIMEOUT_PROPERTY_NAME = "JobTimeout"; + static final long DEFAULT_JOB_TIMEOUT_VALUE = 0L; + static final String RETRY_INITIAL_DELAY_PROPERTY_NAME = "RetryInitialDelay"; + static final long DEFAULT_RETRY_INITIAL_DELAY_VALUE = 0L; + static final String RETRY_MAX_DELAY_PROPERTY_NAME = "RetryMaxDelay"; + static final long DEFAULT_RETRY_MAX_DELAY_VALUE = 0L; + static final String ADDITIONAL_PROJECTS_PROPERTY_NAME = "AdditionalProjects"; + // Applicable only for connection pooling. + static final String CONNECTION_POOL_SIZE_PROPERTY_NAME = "ConnectionPoolSize"; + static final long DEFAULT_CONNECTION_POOL_SIZE_VALUE = 10L; + static final String LISTENER_POOL_SIZE_PROPERTY_NAME = "ListenerPoolSize"; + static final long DEFAULT_LISTENER_POOL_SIZE_VALUE = 10L; + static final String ENABLE_WRITE_API_PROPERTY_NAME = "EnableWriteAPI"; + static final boolean DEFAULT_ENABLE_WRITE_API_VALUE = false; + static final String SWA_APPEND_ROW_COUNT_PROPERTY_NAME = "SWA_AppendRowCount"; + static final int DEFAULT_SWA_APPEND_ROW_COUNT_VALUE = 1000; + static final String SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME = "SWA_ActivationRowCount"; + static final int DEFAULT_SWA_ACTIVATION_ROW_COUNT_VALUE = 3; + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryJdbcUrlUtility.class.getName()); + static final String FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME = + "FilterTablesOnDefaultDataset"; + static final boolean DEFAULT_FILTER_TABLES_ON_DEFAULT_DATASET_VALUE = false; + static final String REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME = "RequestGoogleDriveScope"; + static final String SSL_TRUST_STORE_PROPERTY_NAME = "SSLTrustStore"; + static final String SSL_TRUST_STORE_PWD_PROPERTY_NAME = "SSLTrustStorePwd"; + static final int DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE = 0; + static final String MAX_BYTES_BILLED_PROPERTY_NAME = "MaximumBytesBilled"; + static final Long DEFAULT_MAX_BYTES_BILLED_VALUE = 0L; + static final String LABELS_PROPERTY_NAME = "Labels"; + static final List OVERRIDE_PROPERTIES = + Arrays.asList( + BIGQUERY_ENDPOINT_OVERRIDE_PROPERTY_NAME, + OAUTH2_TOKEN_URI_PROPERTY_NAME, + HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME, + STS_ENDPOINT_OVERRIDE_PROPERTY_NAME); + static final List BYOID_PROPERTIES = + Arrays.asList( + BYOID_AUDIENCE_URI_PROPERTY_NAME, + BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME, + BYOID_POOL_USER_PROJECT_PROPERTY_NAME, + BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME, + BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME, + BYOID_TOKEN_URI_PROPERTY_NAME); + + static Set PROXY_PROPERTIES = + Collections.unmodifiableSet( + new HashSet<>( + Arrays.asList( + BigQueryConnectionProperty.newBuilder() + .setName(PROXY_HOST_PROPERTY_NAME) + .setDescription("The host name of the proxy server.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(PROXY_PORT_PROPERTY_NAME) + .setDescription( + "The port number of the proxy server to connect to. No defaulting" + + " behavior happens.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(PROXY_USER_ID_PROPERTY_NAME) + .setDescription("The user name for an authenticated proxy server.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(PROXY_PASSWORD_PROPERTY_NAME) + .setDescription("The password for an authenticated proxy server.") + .build()))); + + static Set AUTH_PROPERTIES = + Collections.unmodifiableSet( + new HashSet<>( + Arrays.asList( + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_TYPE_PROPERTY_NAME) + .setDescription( + "This option specifies how the connector obtains or provides the" + + " credentials for OAuth\n" + + "2.0 authentication") + .setDefaultValue(String.valueOf(DEFAULT_OAUTH_TYPE_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_SA_EMAIL_PROPERTY_NAME) + .setDescription( + "The Service Account email use for Service Account Authentication.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_PVT_KEY_PATH_PROPERTY_NAME) + .setDescription( + "The location of the credentials file used for this connection.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_PVT_KEY_PROPERTY_NAME) + .setDescription("The OAuth private key used for this connection.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_REFRESH_TOKEN_PROPERTY_NAME) + .setDescription( + "The pre-generated refresh token to be used with BigQuery for" + + " authentication.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_ACCESS_TOKEN_PROPERTY_NAME) + .setDescription( + "The pre-generated access token to be used with BigQuery for" + + " authentication.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_CLIENT_ID_PROPERTY_NAME) + .setDescription( + "The client ID to be used for user authentication or to refresh" + + " pre-generated tokens.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_CLIENT_SECRET_PROPERTY_NAME) + .setDescription( + "The client secret to be used for user authentication or to refresh" + + " pre-generated tokens.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME) + .setDescription("The service account email to be impersonated.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME) + .setDescription( + "Comma separated list of service account emails in the impersonation chain.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME) + .setDescription( + "Comma separated list of OAuth2 scopes to use with impersonated account.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME) + .setDescription("Impersonated account token lifetime.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(OAUTH_P12_PASSWORD_PROPERTY_NAME) + .setDescription("Password for p12 secret file.") + .build()))); + + static Set VALID_PROPERTIES = + Collections.unmodifiableSet( + new HashSet<>( + Arrays.asList( + BigQueryConnectionProperty.newBuilder() + .setName(MAX_BYTES_BILLED_PROPERTY_NAME) + .setDescription( + " Limits the bytes billed for this query. Queries with bytes billed above" + + " this limit will fail (without incurring a charge). If" + + " unspecified, the project default is used.") + .setDefaultValue(String.valueOf(DEFAULT_MAX_BYTES_BILLED_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(CONNECTION_POOL_SIZE_PROPERTY_NAME) + .setDescription("Connection pool size if connection pooling is enabled.") + .setDefaultValue(String.valueOf(DEFAULT_CONNECTION_POOL_SIZE_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LISTENER_POOL_SIZE_PROPERTY_NAME) + .setDescription("Listener pool size if connection pooling is enabled.") + .setDefaultValue(String.valueOf(DEFAULT_LISTENER_POOL_SIZE_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(RETRY_INITIAL_DELAY_PROPERTY_NAME) + .setDescription("Initial delay, in seconds, before the first retry.") + .setDefaultValue(String.valueOf(DEFAULT_RETRY_INITIAL_DELAY_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(RETRY_MAX_DELAY_PROPERTY_NAME) + .setDescription("Max limit for the retry delay, in seconds.") + .setDefaultValue(String.valueOf(DEFAULT_RETRY_MAX_DELAY_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME) + .setDescription( + "The length of time, in seconds, for which the connector retries a failed" + + " API call before timing out.") + .setDefaultValue(String.valueOf(DEFAULT_RETRY_TIMEOUT_IN_SECS_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(JOB_TIMEOUT_PROPERTY_NAME) + .setDescription( + "Job timeout (in seconds) after which the job is cancelled on the server") + .setDefaultValue(String.valueOf(DEFAULT_JOB_TIMEOUT_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME) + .setDescription( + "This option determines whether the connector uses the REST API or" + + " returns an error when encountering fetch workflows unsupported by" + + " the High-Throughput API.") + .setDefaultValue(String.valueOf(DEFAULT_UNSUPPORTED_HTAPI_FALLBACK_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME) + .setDescription( + "The expiration time (in milliseconds) for tables in a user-specified" + + " large result dataset.") + .setDefaultValue( + String.valueOf(DEFAULT_DESTINATION_DATASET_EXPIRATION_TIME_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME) + .setDescription( + "The name of the partner-operated cloud which is a new instance of Google" + + " production, known as a Trusted Partner Cloud universe.") + .setDefaultValue(DEFAULT_UNIVERSE_DOMAIN_VALUE) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(PROJECT_ID_PROPERTY_NAME) + .setDescription("A globally unique identifier for your project.") + .setDefaultValue(BigQueryOptions.getDefaultProjectId()) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LOG_PATH_PROPERTY_NAME) + .setDescription( + "The directory where the connector saves log files (when logging is" + + " enabled).") + .setDefaultValue(DEFAULT_LOG_PATH) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(DEFAULT_DATASET_PROPERTY_NAME) + .setDescription( + "This default dataset for query execution. If this option is set, queries" + + " with unqualified \n" + + "table names will run against this dataset.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LOCATION_PROPERTY_NAME) + .setDescription( + "The location where datasets are created/queried. The location will be" + + " determined\n" + + " automatically by BigQuery if not specified.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ENABLE_HTAPI_PROPERTY_NAME) + .setDescription( + "Enables or disables Read API usage in the Driver. Disabled by default.") + .setDefaultValue(String.valueOf(DEFAULT_ENABLE_HTAPI_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(HTAPI_ACTIVATION_RATIO_PROPERTY_NAME) + .setDescription( + "Connector switches to BigQuery Storage API when the number of pages" + + " exceed this value.") + .setDefaultValue(String.valueOf(DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(KMS_KEY_NAME_PROPERTY_NAME) + .setDescription( + "The KMS key name tells BigQuery which key to use when encrypting or" + + " decrypting your data.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(QUERY_PROPERTIES_NAME) + .setDescription( + "Connection-level properties to customize query behavior.") // TODO: + // Figure out + // a clean way + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LABELS_PROPERTY_NAME) + .setDescription( + "Labels associated with the query to organize and group query jobs.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME) + .setDescription( + "If the number of total rows exceeds this value, the connector switches" + + " to the BigQuery Storage API for faster processing.") + .setDefaultValue(String.valueOf(DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ENABLE_SESSION_PROPERTY_NAME) + .setDescription( + "Enable to capture your SQL activities or enable multi statement" + + " transactions. Disabled by default.") + .setDefaultValue(String.valueOf(DEFAULT_ENABLE_SESSION_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LOG_LEVEL_PROPERTY_NAME) + .setDescription( + "Sets the Log Level for the Driver. Set to Level.OFF by default.") + .setDefaultValue(String.valueOf(DEFAULT_LOG_LEVEL)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(USE_QUERY_CACHE_PROPERTY_NAME) + .setDescription("Enables or disables Query caching. Set to true by default.") + .setDefaultValue(String.valueOf(DEFAULT_USE_QUERY_CACHE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(QUERY_DIALECT_PROPERTY_NAME) + .setDescription( + "Parameter for selecting if the queries should use standard or legacy SQL" + + " syntax.") + .setDefaultValue(DEFAULT_QUERY_DIALECT_VALUE) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ALLOW_LARGE_RESULTS_PROPERTY_NAME) + .setDescription( + "Enabled by default, must be used with legacy SQL. Used for setting" + + " destination table & dataset.") + .setDefaultValue(String.valueOf(DEFAULT_ALLOW_LARGE_RESULTS)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LARGE_RESULTS_TABLE_PROPERTY_NAME) + .setDescription("The destination table where queries are saved.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(LARGE_RESULTS_DATASET_PROPERTY_NAME) + .setDescription("The destination dataset where queries are saved.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(JOB_CREATION_MODE_PROPERTY_NAME) + .setDescription( + "Enables or disables Stateless Query mode. Set to false by default.") + .setDefaultValue(String.valueOf(DEFAULT_JOB_CREATION_MODE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(MAX_RESULTS_PROPERTY_NAME) + .setDescription("Maximum number of results per page") + .setDefaultValue(String.valueOf(DEFAULT_MAX_RESULTS_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_AUDIENCE_URI_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. Corresponds to the audience" + + " property\n" + + " in the external account configuration file.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. The file location or the URI" + + " of\n" + + " the subject token. Corresponds to the credential_source property" + + " in\n" + + " the external account configuration file.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_POOL_USER_PROJECT_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. The project number associated" + + " with\n" + + " the workforce pool. Corresponds to the" + + " workforce_pool_user_project\n" + + " property in the external account configuration file.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. The service account email." + + " Only\n" + + " present when service account impersonation is used. Corresponds" + + " to\n" + + " the service_account_impersonation_url property in the external" + + " account\n" + + " configuration file.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. The subject token type." + + " Corresponds\n" + + " to the subject_token_type property in the external account" + + " configuration file.") + .setDefaultValue("urn:ietf:params:oauth:tokentype:id_token") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(BYOID_TOKEN_URI_PROPERTY_NAME) + .setDescription( + "Used for External Account Authentication. The URI used to generate" + + " authentication\n" + + " tokens. Corresponds to the token_url property in the external" + + " account\n" + + " configuration file.") + .setDefaultValue("https://sts.googleapis.com/v1/token") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(PARTNER_TOKEN_PROPERTY_NAME) + .setDescription("The partner name and environment.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME) + .setDescription( + "The number of threads used to call a DatabaseMetaData method.") + .setDefaultValue(String.valueOf(DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ENABLE_WRITE_API_PROPERTY_NAME) + .setDescription( + "Enables or disables Write API usage for bulk inserts in the Driver." + + " Disabled by default.") + .setDefaultValue(String.valueOf(DEFAULT_ENABLE_WRITE_API_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME) + .setDescription( + "Connector switches to BigQuery Storage Write API when the number of rows" + + " for executeBatch insert exceed this value. Do not change unless" + + " necessary.") + .setDefaultValue(String.valueOf(DEFAULT_SWA_ACTIVATION_ROW_COUNT_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(SWA_APPEND_ROW_COUNT_PROPERTY_NAME) + .setDescription("Size of the write stream. Do not change unless necessary.") + .setDefaultValue(String.valueOf(DEFAULT_SWA_APPEND_ROW_COUNT_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(ADDITIONAL_PROJECTS_PROPERTY_NAME) + .setDescription( + "A comma-separated list of Google Cloud project IDs that can be accessed" + + " for querying, in addition to the primary project specified in the" + + " connection.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME) + .setDescription( + "If true and DefaultDataset is set, DatabaseMetaData.getTables() and" + + " .getColumns() will filter results based on the DefaultDataset" + + " when catalog/schema patterns are null or wildcards.") + .setDefaultValue( + String.valueOf(DEFAULT_FILTER_TABLES_ON_DEFAULT_DATASET_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME) + .setDescription( + "Enables or disables whether the connector requests access to Google" + + " Drive. Set to false (0) by default.") + .setDefaultValue(String.valueOf(DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE)) + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(SSL_TRUST_STORE_PROPERTY_NAME) + .setDescription( + "The full path of the Java TrustStore containing the server certificate" + + " for one-way SSL authentication.\n" + + "If the trust store requires a password, provide it using the" + + " property SSLTrustStorePwd.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(SSL_TRUST_STORE_PWD_PROPERTY_NAME) + .setDescription( + "The password for accessing the Java TrustStore that is specified using" + + " the property SSLTrustStore.") + .build()))); + + private BigQueryJdbcUrlUtility() {} + + /** + * Parses a URI property from the given URI. + * + * @param uri The URI to parse. + * @param property The name of the property to parse. + * @return The String value of the property, or the default value if the property is not found. + */ + static String parseUriProperty(String uri, String property) { + Pattern pattern = Pattern.compile(String.format("(?is)(?:;|\\?)%s=(.*?)(?:;|$)", property)); + Matcher matcher = pattern.matcher(uri); + if (matcher.find() && matcher.groupCount() == 1) { + return CharEscapers.decodeUriPath(matcher.group(1)); + } + return null; + } + + /** + * Appends the given properties to the given URL. + * + * @param url The URL to append the properties to. + * @param properties The properties to append. + * @return The string value of the updated URL. + */ + static String appendPropertiesToURL(String url, String callerClassName, Properties properties) { + LOG.finest("++enter++ " + callerClassName); + StringBuilder urlBuilder = new StringBuilder(url); + for (Entry entry : properties.entrySet()) { + if (entry.getValue() != null && !"".equals(entry.getValue())) { + LOG.info( + String.format("Appending %s with value %s to URL", entry.getKey(), entry.getValue())); + urlBuilder.append(";").append(entry.getKey()).append("=").append(entry.getValue()); + } + } + return urlBuilder.toString(); + } + + static boolean convertIntToBoolean(String value, String propertyName) { + int integerValue; + + try { + if (value.equalsIgnoreCase("true")) { + integerValue = 1; + } else if (value.equalsIgnoreCase("false")) { + integerValue = 0; + } else { + integerValue = Integer.parseInt(value); + } + + } catch (NumberFormatException ex) { + throw new IllegalArgumentException( + String.format( + "Invalid value for %s. For Boolean connection properties, use 0 for false and 1 for" + + " true.", + propertyName), + ex); + } + if (integerValue == 1) { + return true; + } else if (integerValue == 0) { + return false; + } else { + throw new IllegalArgumentException( + String.format( + "Invalid value for %s. For Boolean connection properties, use 0 for false and 1 for" + + " true.", + propertyName)); + } + } + + // todo just make it a map + static Map parseQueryProperties(String url, String callerClassName) { + return parsePropertiesMap(url, QUERY_PROPERTIES_NAME, callerClassName); + } + + static Map parseLabels(String url, String callerClassName) { + return parsePropertiesMap(url, LABELS_PROPERTY_NAME, callerClassName); + } + + static String parseStringProperty( + String url, String propertyName, String defaultValue, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (parsedValue != null) { + return parsedValue; + } + return defaultValue; + } + + static List parseStringListProperty( + String url, String propertyName, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String rawValue = parseStringProperty(url, propertyName, null, callerClassName); + if (rawValue == null || rawValue.trim().isEmpty()) { + return Collections.emptyList(); + } + return Arrays.stream(rawValue.split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); + } + + public static String parsePartnerTokenProperty(String url, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + // This property is expected to be set by partners only. For more details on exact format + // supported, refer b/396086960 + String regex = + PARTNER_TOKEN_PROPERTY_NAME + "=\\s*\\(\\s*(GPN:[^;]*?)\\s*(?:;\\s*([^)]*?))?\\s*\\)"; + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(url); + + if (matcher.find()) { + String gpnPart = matcher.group(1); + String environmentPart = matcher.group(2); + StringBuilder partnerToken = new StringBuilder(" ("); + partnerToken.append(gpnPart); + if (environmentPart != null && !environmentPart.trim().isEmpty()) { + partnerToken.append("; "); + partnerToken.append(environmentPart); + } + partnerToken.append(")"); + return partnerToken.toString(); + } + return null; + } + + static Integer parseIntProperty( + String url, String propertyName, Integer defaultValue, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (parsedValue != null) { + try { + return Integer.parseInt(parsedValue); + } catch (NumberFormatException e) { + LOG.severe( + String.format( + "Invalid integer value '%s' for property '%s'. Please provide a valid integer.", + parsedValue, propertyName)); + throw new IllegalArgumentException( + String.format("Invalid integer value for property '%s': %s", propertyName, parsedValue), + e); + } + } + return defaultValue; + } + + static Long parseLongProperty( + String url, String propertyName, Long defaultValue, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (parsedValue != null) { + return Long.parseLong(parsedValue); + } + return defaultValue; + } + + static Boolean parseBooleanProperty( + String url, String propertyName, Boolean defaultValue, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (parsedValue != null) { + return convertIntToBoolean(parsedValue, propertyName); + } + return defaultValue; + } + + public static Level parseLogLevel(String logLevelString) { + int logLevel = logLevelString != null ? Integer.parseInt(logLevelString) : DEFAULT_LOG_LEVEL; + switch (logLevel) { + case 8: + return Level.ALL; + case 7: + return Level.FINEST; + case 6: + return Level.FINER; + case 5: + return Level.FINE; + case 4: + return Level.CONFIG; + case 3: + return Level.INFO; + case 2: + return Level.WARNING; + case 1: + return Level.SEVERE; + case 0: + default: + LOG.info( + String.format( + "%s value not provided, defaulting to %s.", LOG_LEVEL_PROPERTY_NAME, Level.OFF)); + return Level.OFF; + } + } + + static Map parseOverrideProperties(String url, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + Map overrideProps = new HashMap<>(); + Pattern pattern = + Pattern.compile( + String.format( + "(?is)(%s|%s)=([^;]+)", + ENDPOINT_OVERRIDES_PROPERTY_NAME, PRIVATE_SERVICE_CONNECT_PROPERTY_NAME)); + Matcher matcher = pattern.matcher(url); + String overridePropertiesString; + if (matcher.find() && matcher.groupCount() >= 1) { + overridePropertiesString = matcher.group(2); + } else { + return overrideProps; + } + for (String property : OVERRIDE_PROPERTIES) { + Pattern propertyPattern = Pattern.compile(String.format("(?i)%s=(.*?)(?:[,;]|$)", property)); + Matcher propertyMatcher = propertyPattern.matcher(overridePropertiesString); + if (propertyMatcher.find() && propertyMatcher.groupCount() >= 1) { + overrideProps.put(property, propertyMatcher.group(1)); + } + } + return overrideProps; + } + + public static boolean parseJobCreationMode(String url, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + + String jobCreationMode = + BigQueryJdbcUrlUtility.parseUriProperty(url, JOB_CREATION_MODE_PROPERTY_NAME); + + if (jobCreationMode == null) { + LOG.fine( + String.format( + "%s value not provided, defaulting to %s. Caller: %s", + JOB_CREATION_MODE_PROPERTY_NAME, DEFAULT_JOB_CREATION_MODE, callerClassName)); + // Default Job creation mode is JOB_CREATION_OPTIONAL(2) + // which translates to options.setQueryPreviewEnabled(true) + return true; + } + if (jobCreationMode.equalsIgnoreCase("1")) { + return false; + } else if (jobCreationMode.equalsIgnoreCase("2")) { + return true; + } else { + throw new NumberFormatException( + String.format( + "Invalid value for %s. Use 1 for JOB_CREATION_REQUIRED and 2 for" + + " JOB_CREATION_OPTIONAL.", + JOB_CREATION_MODE_PROPERTY_NAME)); + } + } + + public static String parseBYOIDProperty(String url, String property, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + + String value = BigQueryJdbcUrlUtility.parseUriProperty(url, property); + String defaultValue = BigQueryJdbcUrlUtility.getConnectionPropertyDefaultValue(property); + if (value != null) { + return value; + } else if (defaultValue != null) { + return defaultValue; + } + return null; + } + + public static String getConnectionPropertyDefaultValue(String propertyName) { + // TODO: change how we store properties because this method has to go through all of them + for (BigQueryConnectionProperty property : VALID_PROPERTIES) { + if (property.getName().equals(propertyName)) { + return property.getDefaultValue(); + } + } + return null; + } + + public static long parseRetryTimeoutInSecs(String url, String callerClassName) { + return BigQueryJdbcUrlUtility.parseLongProperty( + url, + RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME, + DEFAULT_RETRY_TIMEOUT_IN_SECS_VALUE, + callerClassName); + } + + public static long parseJobTimeout(String url, String callerClassName) { + return parseLongProperty( + url, JOB_TIMEOUT_PROPERTY_NAME, DEFAULT_JOB_TIMEOUT_VALUE, callerClassName); + } + + public static long parseRetryInitialDelayInSecs(String url, String callerClassName) { + return BigQueryJdbcUrlUtility.parseLongProperty( + url, RETRY_INITIAL_DELAY_PROPERTY_NAME, DEFAULT_RETRY_INITIAL_DELAY_VALUE, callerClassName); + } + + public static long parseRetryMaxDelayInSecs(String url, String callerClassName) { + return BigQueryJdbcUrlUtility.parseLongProperty( + url, RETRY_MAX_DELAY_PROPERTY_NAME, DEFAULT_RETRY_MAX_DELAY_VALUE, callerClassName); + } + + // Convenience Helper Methods + public static long parseConnectionPoolSize(String url, String callerClassName) { + if (url == null || url.isEmpty()) { + throw new BigQueryJdbcRuntimeException("Connection url is empty"); + } + return parseLongProperty( + url, + CONNECTION_POOL_SIZE_PROPERTY_NAME, + DEFAULT_CONNECTION_POOL_SIZE_VALUE, + callerClassName); + } + + public static long parseListenerPoolSize(String url, String callerClassName) { + if (url == null || url.isEmpty()) { + throw new BigQueryJdbcRuntimeException("Connection url is empty"); + } + return parseLongProperty( + url, LISTENER_POOL_SIZE_PROPERTY_NAME, DEFAULT_LISTENER_POOL_SIZE_VALUE, callerClassName); + } + + public static long parseMaximumBytesBilled(String url, String callerClassName) { + if (url == null || url.isEmpty()) { + throw new BigQueryJdbcRuntimeException("Connection url is empty"); + } + return parseLongProperty( + url, MAX_BYTES_BILLED_PROPERTY_NAME, DEFAULT_MAX_BYTES_BILLED_VALUE, callerClassName); + } + + private static Map parsePropertiesMap( + String url, String propertyName, String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String propertiesString = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (propertiesString == null || propertiesString.isEmpty()) { + LOG.fine(String.format("Unable to parse property name: %s from url: %s", propertyName, url)); + return null; + } + Map propertiesMap = new HashMap<>(); + String[] keyValuePairs = propertiesString.split(","); + + for (String keyValuePair : keyValuePairs) { + String[] parts = keyValuePair.split("="); + if (parts.length == 2) { + propertiesMap.put(parts[0], parts[1]); + } else { + LOG.warning( + String.format( + "Invalid KeyValue pair: %s found in url: %s for property name: %s", + keyValuePair, url, propertyName)); + } + } + return propertiesMap; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArray.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArray.java new file mode 100644 index 0000000000..3b557a15a7 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArray.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryFieldValueListWrapper.getNestedFieldValueListWrapper; + +import com.google.api.core.InternalApi; +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.Schema; +import java.sql.ResultSet; +import java.util.List; + +/** An implementation of {@link BigQueryBaseArray} used to represent Array values from Json data. */ +@InternalApi +class BigQueryJsonArray extends BigQueryBaseArray { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryJsonArray.class.getName()); + private static final BigQueryTypeCoercer BIGQUERY_TYPE_COERCER = + BigQueryTypeCoercionUtility.INSTANCE; + private List values; + + BigQueryJsonArray(Field schema, FieldValue values) { + super(schema); + this.values = (values == null || values.isNull()) ? null : values.getRepeatedValue(); + } + + @Override + public Object getArray() { + ensureValid(); + LOG.finest("++enter++"); + if (this.values == null) { + return null; + } + return getArrayInternal(0, this.values.size()); + } + + @Override + public Object getArray(long index, int count) { + ensureValid(); + LOG.finest("++enter++"); + if (this.values == null) { + return null; + } + Tuple range = createRange(index, count, this.values.size()); + return getArrayInternal(range.x(), range.y()); + } + + @Override + public ResultSet getResultSet() { + ensureValid(); + LOG.finest("++enter++"); + if (this.values == null) { + return new BigQueryJsonResultSet(); + } + BigQueryFieldValueListWrapper bigQueryFieldValueListWrapper = + getNestedFieldValueListWrapper(FieldList.of(singleElementSchema()), this.values); + return BigQueryJsonResultSet.getNestedResultSet( + Schema.of(this.schema), bigQueryFieldValueListWrapper, 0, this.values.size()); + } + + @Override + public ResultSet getResultSet(long index, int count) { + ensureValid(); + LOG.finest("++enter++"); + if (this.values == null) { + return new BigQueryJsonResultSet(); + } + Tuple range = createRange(index, count, this.values.size()); + BigQueryFieldValueListWrapper bigQueryFieldValueListWrapper = + getNestedFieldValueListWrapper(FieldList.of(singleElementSchema()), this.values); + return BigQueryJsonResultSet.getNestedResultSet( + Schema.of(this.schema), bigQueryFieldValueListWrapper, range.x(), range.y()); + } + + @Override + public void free() { + this.values = null; + markInvalid(); + } + + @Override + Object getCoercedValue(int index) { + FieldValue fieldValue = this.values.get(index); + return this.arrayOfStruct + ? new BigQueryJsonStruct(this.schema.getSubFields(), fieldValue) + : BIGQUERY_TYPE_COERCER.coerceTo(getTargetClass(), fieldValue); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java new file mode 100644 index 0000000000..f9d7b11538 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java @@ -0,0 +1,317 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryBaseArray.isArray; +import static com.google.cloud.bigquery.jdbc.BigQueryBaseStruct.isStruct; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.concurrent.BlockingQueue; + +/** {@link ResultSet} Implementation for JSON datasource (Using REST APIs) */ +class BigQueryJsonResultSet extends BigQueryBaseResultSet { + private final long totalRows; + private final BlockingQueue buffer; + private boolean hasReachedEnd = false; + // Points to the current record + private BigQueryFieldValueListWrapper cursor; + // Tracks the index of the nested element under process + private int nestedRowIndex; + private long rowCnt = 0; + private boolean afterLast = false; + private final int fromIndex; + private final int toIndexExclusive; + private final Thread[] ownedThreads; + + private BigQueryJsonResultSet( + Schema schema, + long totalRows, + BlockingQueue buffer, + BigQueryStatement statement, + boolean isNested, + BigQueryFieldValueListWrapper cursor, + int fromIndex, + int toIndexExclusive, + Thread[] ownedThreads, + BigQuery bigQuery) { + super(bigQuery, statement, schema, isNested); + this.totalRows = totalRows; + this.buffer = buffer; + this.cursor = cursor; + this.fromIndex = fromIndex; + this.toIndexExclusive = toIndexExclusive; + this.nestedRowIndex = fromIndex - 1; + this.ownedThreads = ownedThreads; + } + + /** + * This method returns an instance of BigQueryJsonResultSet after adding it in the list of + * JsonResultSetFinalizer + * + * @return BigQueryJsonResultSet + */ + static BigQueryJsonResultSet of( + Schema schema, + long totalRows, + BlockingQueue buffer, + BigQueryStatement statement, + Thread[] ownedThreads, + BigQuery bigQuery) { + + return new BigQueryJsonResultSet( + schema, totalRows, buffer, statement, false, null, -1, -1, ownedThreads, bigQuery); + } + + static BigQueryJsonResultSet of( + Schema schema, + long totalRows, + BlockingQueue buffer, + BigQueryStatement statement, + Thread[] ownedThreads) { + + return new BigQueryJsonResultSet( + schema, totalRows, buffer, statement, false, null, -1, -1, ownedThreads, null); + } + + BigQueryJsonResultSet() { + super(null, null, null, false); + totalRows = 0; + buffer = null; + fromIndex = 0; + ownedThreads = new Thread[0]; + toIndexExclusive = 0; + } + + // + + /** + * Wrapper method which can be used for initialising the instance of BigQueryJsonResultSet for the + * nested Records + * + * @param schema Table schema + * @param cursor Points to the current record + * @param fromIndex starting index under consideration + * @param toIndexExclusive last index under consideration + * @return The BigQueryJsonResultSet + */ + static BigQueryJsonResultSet getNestedResultSet( + Schema schema, BigQueryFieldValueListWrapper cursor, int fromIndex, int toIndexExclusive) { + return new BigQueryJsonResultSet( + schema, + -1, + null, + null, /* statement will be null in case of nested java.sql.Result. */ + true, + cursor, + fromIndex, + toIndexExclusive, + null, + null); + } + + /* Advances the result set to the next row, returning false if no such row exists. Potentially blocking operation */ + public boolean next() throws SQLException { + checkClosed(); + if (this.isNested) { + // We are working with the nested record, the cursor would have been + // populated. + if (this.cursor == null || this.cursor.getArrayFieldValueList() == null) { + throw new IllegalStateException( + "Cursor/ArrayFieldValueList can not be null working with the nested record"); + } + // Check if there's a next record in the array which can be read + if (this.nestedRowIndex < (this.toIndexExclusive - 1)) { + this.nestedRowIndex++; + return true; + } + this.afterLast = true; + return false; + + } else { + // If end of stream is reached or we are past the last row i.e + // rowcnt == totalRows (rowcnt starts at 0) + // then we can simply return false + if (this.hasReachedEnd || this.isLast()) { + this.afterLast = true; + return false; + } + try { + // Advance the cursor,Potentially blocking operation + this.cursor = this.buffer.take(); + this.rowCnt++; + // Check for end of stream + if (this.cursor.isLast()) { + this.cursor = null; + this.hasReachedEnd = true; + return false; + } + // Cursor has been advanced + return true; + + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException( + "Error occurred while advancing the cursor. This could happen when connection is closed while we call the next method", + ex); + } + } + } + + @Override + public Object getObject(int columnIndex) throws SQLException { + // columnIndex is SQL index starting at 1 + checkClosed(); + LOG.finest("++enter++"); + FieldValue value = getObjectInternal(columnIndex); + if (value == null || value.isNull()) { + return null; + } + + if (this.isNested && columnIndex == 1) { + return this.bigQueryTypeCoercer.coerceTo(Integer.class, value); + } + + if (this.isNested && columnIndex == 2) { + Field arrayField = this.schema.getFields().get(0); + if (isStruct(arrayField)) { + return new BigQueryJsonStruct(arrayField.getSubFields(), value); + } + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + arrayField.getType().getStandardType()); + return this.bigQueryTypeCoercer.coerceTo(targetClass, value); + } + + int extraIndex = this.isNested ? 2 : 1; + Field fieldSchema = this.schemaFieldList.get(columnIndex - extraIndex); + if (isArray(fieldSchema)) { + return new BigQueryJsonArray(fieldSchema, value); + } else if (isStruct(fieldSchema)) { + return new BigQueryJsonStruct(fieldSchema.getSubFields(), value); + } else { + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + fieldSchema.getType().getStandardType()); + return this.bigQueryTypeCoercer.coerceTo(targetClass, value); + } + } + + /** + * This method will be called by every other getter of this {@link java.sql.ResultSet}, including + * {@link #getObject(int)} to get the value in its rawest form i.e. {@link FieldValue} to coerce + * it further as required. + * + * @param columnIndex the first column is 1, the second is 2, ... + * @return an instance of {@link FieldValue} represents value at columnIndex column. + */ + private FieldValue getObjectInternal(int columnIndex) throws SQLException { + checkClosed(); + LOG.finest("++enter++"); + FieldValue value; + if (this.isNested) { + boolean validIndexForNestedResultSet = columnIndex == 1 || columnIndex == 2; + // BigQuery doesn't support multidimensional arrays, so just the default row + // num column (1) and the actual column (2) is supposed to be read + if (!validIndexForNestedResultSet) { + throw new IllegalArgumentException( + "Column index is required to be 1 or 2 for the nested arrays"); + } + if (this.cursor.getArrayFieldValueList() == null + || this.cursor.getArrayFieldValueList().get(this.nestedRowIndex) == null) { + throw new IllegalStateException("ArrayFieldValueList cannot be null"); + } + + // For Arrays the first column is Index, ref: + // https://docs.oracle.com/javase/7/docs/api/java/sql/Array.html#getResultSet() + if (columnIndex == 1) { + return FieldValue.of(Attribute.PRIMITIVE, Integer.toString(this.nestedRowIndex + 1)); + } else { + // columnIndex = 2 + // This ignores the columnIndex, as there's just one column, and we have already incremented + // the nestedRowIndex + value = this.cursor.getArrayFieldValueList().get(this.nestedRowIndex); + } + } + // non nested, return the value + else { + // SQL Index to 0 based index + value = this.cursor.getFieldValueList().get(columnIndex - 1); + } + setWasNull(value.getValue()); + return value; + } + + @Override + public void close() { + LOG.fine(String.format("Closing BigqueryJsonResultSet %s.", this)); + this.isClosed = true; + if (ownedThreads != null) { + for (Thread ownedThread : ownedThreads) { + if (!ownedThread.isInterrupted()) { + ownedThread.interrupt(); + } + } + } + super.close(); + } + + @Override + public boolean isBeforeFirst() throws SQLException { + checkClosed(); + LOG.finest("++enter++"); + if (this.isNested) { + return this.nestedRowIndex < this.fromIndex; + } else { + return this.cursor == null && this.rowCnt == 0; + } + } + + @Override + public boolean isAfterLast() throws SQLException { + checkClosed(); + LOG.finest("++enter++"); + return this.afterLast; + } + + @Override + public boolean isFirst() throws SQLException { + checkClosed(); + LOG.finest("++enter++"); + if (this.isNested) { + return this.nestedRowIndex == this.fromIndex; + } else { + return this.rowCnt == 1; + } + } + + @Override + public boolean isLast() throws SQLException { + checkClosed(); + LOG.finest("++enter++"); + if (this.isNested) { + return this.nestedRowIndex == this.toIndexExclusive - 1; + } else { + return this.rowCnt == this.totalRows; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStruct.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStruct.java new file mode 100644 index 0000000000..35217f8e71 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStruct.java @@ -0,0 +1,80 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryBaseArray.isArray; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import java.lang.reflect.Array; +import java.util.List; + +/** + * An implementation of {@link BigQueryBaseStruct} used to represent Struct values from Json data. + */ +@InternalApi +class BigQueryJsonStruct extends BigQueryBaseStruct { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryJsonStruct.class.getName()); + + private static final BigQueryTypeCoercer BIGQUERY_TYPE_COERCER = + BigQueryTypeCoercionUtility.INSTANCE; + + private final FieldList schema; + private final List values; + + public BigQueryJsonStruct(FieldList schema, FieldValue values) { + this.schema = schema; + this.values = (values == null || values.isNull()) ? null : values.getRecordValue(); + } + + @Override + FieldList getSchema() { + return this.schema; + } + + @Override + public Object[] getAttributes() { + LOG.finest("++enter++"); + int size = schema.size(); + Object[] attributes = (Object[]) Array.newInstance(Object.class, size); + + for (int index = 0; index < size; index++) { + Field currentSchema = schema.get(index); + FieldValue currentValue = values == null ? null : values.get(index); + Object coercedValue = getValue(currentSchema, currentValue); + Array.set(attributes, index, coercedValue); + } + return attributes; + } + + private Object getValue(Field currentSchema, FieldValue currentValue) { + LOG.finest("++enter++"); + if (isArray(currentSchema)) { + return new BigQueryJsonArray(currentSchema, currentValue); + } else if (isStruct(currentSchema)) { + return new BigQueryJsonStruct(currentSchema.getSubFields(), currentValue); + } else { + Class targetClass = + BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping.get( + currentSchema.getType().getStandardType()); + return BIGQUERY_TYPE_COERCER.coerceTo(targetClass, currentValue); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsConnection.java new file mode 100644 index 0000000000..1804cc14c4 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsConnection.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.METHOD_NOT_IMPLEMENTED; + +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.sql.Array; +import java.sql.Blob; +import java.sql.CallableStatement; +import java.sql.Clob; +import java.sql.Connection; +import java.sql.NClob; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.SQLXML; +import java.sql.Savepoint; +import java.sql.Struct; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Executor; + +/** NoOps Abstract base class for BigQuery JDBC Connection. */ +abstract class BigQueryNoOpsConnection implements Connection { + + @Override + public CallableStatement prepareCall(String sql) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public String nativeSQL(String sql) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean isWrapperFor(Class iface) { + return false; + } + + @Override + public boolean isReadOnly() { + return false; + } + + @Override + public void setReadOnly(boolean readOnly) {} + + @Override + public void setCatalog(String catalog) {} + + // TODO: post MVP feature + + @Override + public Map> getTypeMap() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void setTypeMap(Map> map) {} + + @Override + public Savepoint setSavepoint() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Savepoint setSavepoint(String name) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void rollback(Savepoint savepoint) {} + + @Override + public void releaseSavepoint(Savepoint savepoint) {} + + @Override + public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public CallableStatement prepareCall( + String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Clob createClob() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Blob createBlob() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public NClob createNClob() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public SQLXML createSQLXML() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean isValid(int timeout) throws SQLException { + return false; + } + + @Override + public void setClientInfo(String name, String value) {} + + @Override + public String getClientInfo(String name) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Properties getClientInfo() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void setClientInfo(Properties properties) {} + + @Override + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public String getSchema() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void setSchema(String schema) {} + + @Override + public void setNetworkTimeout(Executor executor, int milliseconds) {} + + @Override + public int getNetworkTimeout() { + return 0; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsResultSet.java new file mode 100644 index 0000000000..e4b29f7cd5 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsResultSet.java @@ -0,0 +1,693 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.METHOD_NOT_IMPLEMENTED; + +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.sql.SQLXML; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Map; + +/** NoOps Abstract base class for BigQuery JDBC ResultSet(s). */ +abstract class BigQueryNoOpsResultSet implements ResultSet { + + @Override + public int getFetchDirection() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void setFetchSize(int rows) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public int getFetchSize() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public String getCursorName() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean absolute(int row) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void beforeFirst() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void afterLast() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean first() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean last() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public int getRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean relative(int rows) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean previous() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean rowUpdated() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean rowInserted() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean rowDeleted() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNull(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBoolean(int columnIndex, boolean x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateByte(int columnIndex, byte x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateShort(int columnIndex, short x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateInt(int columnIndex, int x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateLong(int columnIndex, long x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateFloat(int columnIndex, float x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateDouble(int columnIndex, double x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateString(int columnIndex, String x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBytes(int columnIndex, byte[] x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateDate(int columnIndex, Date x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateTime(int columnIndex, Time x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateObject(int columnIndex, Object x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNull(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBoolean(String columnLabel, boolean x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateByte(String columnLabel, byte x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateShort(String columnLabel, short x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateInt(String columnLabel, int x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateLong(String columnLabel, long x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateFloat(String columnLabel, float x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateDouble(String columnLabel, double x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateString(String columnLabel, String x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBytes(String columnLabel, byte[] x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateDate(String columnLabel, Date x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateTime(String columnLabel, Time x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, int length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, int length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateObject(String columnLabel, Object x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void insertRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void deleteRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void refreshRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void cancelRowUpdates() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void moveToInsertRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void moveToCurrentRow() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Object getObject(int columnIndex, Map> map) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Ref getRef(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Object getObject(String columnLabel, Map> map) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Ref getRef(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public URL getURL(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public URL getURL(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateRef(int columnIndex, Ref x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateRef(String columnLabel, Ref x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(int columnIndex, Blob x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(String columnLabel, Blob x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(int columnIndex, Clob x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(String columnLabel, Clob x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateArray(int columnIndex, Array x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateArray(String columnLabel, Array x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public RowId getRowId(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public RowId getRowId(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateRowId(int columnIndex, RowId x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateRowId(String columnLabel, RowId x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNString(int columnIndex, String nString) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNString(String columnLabel, String nString) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(int columnIndex, NClob nClob) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(String columnLabel, NClob nClob) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public NClob getNClob(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public NClob getNClob(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public SQLXML getSQLXML(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public SQLXML getSQLXML(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public String getNString(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public String getNString(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Reader getNCharacterStream(int columnIndex) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public Reader getNCharacterStream(String columnLabel) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream, long length) + throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(int columnIndex, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateClob(String columnLabel, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(int columnIndex, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void updateNClob(String columnLabel, Reader reader) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public T getObject(int columnIndex, Class type) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public T getObject(String columnLabel, Class type) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public SQLWarning getWarnings() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public void clearWarnings() throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + void checkClosed() throws SQLException { + if (isClosed()) { + throw new BigQueryJdbcException("This " + getClass().getName() + " has been closed"); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsStatement.java new file mode 100644 index 0000000000..2e71bfaf75 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryNoOpsStatement.java @@ -0,0 +1,90 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.METHOD_NOT_IMPLEMENTED; + +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +abstract class BigQueryNoOpsStatement implements Statement { + + @Override + public void setCursorName(String name) throws SQLException { + // TODO: ResultSet Concurrency is read only(Not updatable) + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public T unwrap(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public ResultSet getGeneratedKeys() throws SQLException { + // TODO: Returns an empty resultset. + // return empty ResultSet + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { + // Implementation detailed in BigQuery JDBC Design - Wiring of executeQuery, executeUpdate and + // execute methods + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { + // Implementation detailed in BigQuery JDBC Design - Wiring of executeQuery, executeUpdate and + // execute methods + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public int executeUpdate(String sql, String[] columnNames) throws SQLException { + // Implementation detailed in BigQuery JDBC Design - Wiring of executeQuery, executeUpdate and + // execute methods + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { + // Implementation detailed in BigQuery JDBC Design - Wiring of executeQuery, executeUpdate and + // execute methods + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean execute(String sql, int[] columnIndexes) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } + + @Override + public boolean execute(String sql, String[] columnNames) throws SQLException { + // Implementation detailed in BigQuery JDBC Design - Wiring of executeQuery, executeUpdate and + // execute methods + throw new BigQueryJdbcSqlFeatureNotSupportedException(METHOD_NOT_IMPLEMENTED); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java new file mode 100644 index 0000000000..9644dd581d --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java @@ -0,0 +1,281 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.sql.SQLException; +import java.util.ArrayList; + +class BigQueryParameterHandler { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + + public BigQueryParameterHandler(int parameterCount) { + this.parametersArraySize = parameterCount; + } + + BigQueryParameterHandler(int parameterCount, ArrayList parametersList) { + this.parametersArraySize = parameterCount; + this.parametersList = parametersList; + } + + // Indicates whether the parameter is input, output or both + // Default is UNSPECIFIED + // Used by CallableStatement + enum BigQueryStatementParameterType { + UNSPECIFIED, + IN, + OUT, + INOUT + }; + + private int parametersArraySize; + ArrayList parametersList = new ArrayList<>(parametersArraySize); + + private long highestIndex = 0; + + QueryJobConfiguration.Builder configureParameters( + QueryJobConfiguration.Builder jobConfigurationBuilder) throws SQLException { + LOG.finest("++enter++"); + try { + for (int i = 1; i <= this.parametersArraySize; i++) { + + Object parameterValue = getParameter(i); + StandardSQLTypeName sqlType = getSqlType(i); + LOG.info( + String.format( + "Parameter %s of type %s at index %s added to QueryJobConfiguration", + parameterValue, sqlType, i)); + jobConfigurationBuilder.addPositionalParameter( + QueryParameterValue.of(parameterValue, sqlType)); + } + } catch (NullPointerException e) { + if (e.getMessage().contains("Null type")) { + throw new BigQueryJdbcException("One or more parameters missing in Prepared statement.", e); + } + } + return jobConfigurationBuilder; + } + + void setParameter(int parameterIndex, Object value, Class type) + throws BigQueryJdbcSqlFeatureNotSupportedException { + LOG.finest("++enter++"); + LOG.finest(String.format("setParameter called by : %s", type.getName())); + checkValidIndex(parameterIndex); + + int arrayIndex = parameterIndex - 1; + if (parameterIndex >= this.highestIndex || this.parametersList.get(arrayIndex) == null) { + parametersList.ensureCapacity(parameterIndex); + while (parametersList.size() < parameterIndex) { + parametersList.add(null); + } + parametersList.set(arrayIndex, new BigQueryJdbcParameter()); + } + this.highestIndex = Math.max(parameterIndex, highestIndex); + BigQueryJdbcParameter parameter = parametersList.get(arrayIndex); + + parameter.setIndex(parameterIndex); + parameter.setValue(value); + parameter.setType(type); + parameter.setSqlType(BigQueryJdbcTypeMappings.classToType(type)); + parameter.setParamName(""); + parameter.setParamType(BigQueryStatementParameterType.UNSPECIFIED); + parameter.setScale(-1); + + LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + } + + private void checkValidIndex(int parameterIndex) { + if (parameterIndex > this.parametersArraySize) { + throw new IndexOutOfBoundsException("All parameters already provided."); + } + } + + Object getParameter(int index) { + // Index is 1-based. Converting to 0 based for java. + int arrayIndex = index - 1; + if (parametersList.size() <= arrayIndex || parametersList.get(arrayIndex) == null) { + return null; + } + return parametersList.get(arrayIndex).getValue(); + } + + Class getType(int index) { + // Index is 1-based. Converting to 0 based for java. + int arrayIndex = index - 1; + if (parametersList.size() <= arrayIndex || parametersList.get(arrayIndex) == null) { + return null; + } + return parametersList.get(arrayIndex).getType(); + } + + StandardSQLTypeName getSqlType(int index) { + // Index is 1-based. Converting to 0 based for java. + int arrayIndex = index - 1; + if (parametersList.size() <= arrayIndex || parametersList.get(arrayIndex) == null) { + return null; + } + return parametersList.get(arrayIndex).getSqlType(); + } + + void clearParameters() { + LOG.finest("++enter++"); + parametersList.clear(); + highestIndex = 0; + } + + // set parameter by name and type + void setParameter( + String paramName, + Object value, + Class type, + BigQueryStatementParameterType paramType, + int scale) + throws BigQueryJdbcSqlFeatureNotSupportedException { + LOG.finest("++enter++"); + LOG.finest(String.format("setParameter called by : %s", type.getName())); + if (paramName == null || paramName.isEmpty()) { + throw new IllegalArgumentException("paramName cannot be null or empty"); + } + BigQueryJdbcParameter parameter = null; + for (BigQueryJdbcParameter p : parametersList) { + if (paramName.equals(p.getParamName())) { + parameter = p; + break; + } + } + if (parameter == null) { + // Add new parameter. + parameter = new BigQueryJdbcParameter(); + parameter.setIndex(-1); + } + parameter.setValue(value); + parameter.setType(type); + parameter.setSqlType(BigQueryJdbcTypeMappings.classToType(type)); + parameter.setParamName(paramName); + parameter.setParamType(paramType); + parameter.setScale(scale); + if (parameter.getIndex() == -1) { + parametersList.add(parameter); + } + LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + } + + // set parameter by index and type + void setParameter( + int parameterIndex, + Object value, + Class type, + BigQueryStatementParameterType paramType, + int scale) + throws BigQueryJdbcSqlFeatureNotSupportedException { + LOG.finest("++enter++"); + LOG.finest(String.format("setParameter called by : %s", type.getName())); + checkValidIndex(parameterIndex); + int arrayIndex = parameterIndex - 1; + if (parameterIndex >= this.highestIndex || this.parametersList.get(arrayIndex) == null) { + parametersList.ensureCapacity(parameterIndex); + while (parametersList.size() < parameterIndex) { + parametersList.add(null); + } + parametersList.set(arrayIndex, new BigQueryJdbcParameter()); + } + this.highestIndex = Math.max(parameterIndex, highestIndex); + BigQueryJdbcParameter parameter = parametersList.get(arrayIndex); + + parameter.setIndex(parameterIndex); + parameter.setValue(value); + parameter.setType(type); + parameter.setSqlType(BigQueryJdbcTypeMappings.classToType(type)); + parameter.setParamName(""); + parameter.setParamType(paramType); + parameter.setScale(scale); + + LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + } + + // Get Parameter by name + Object getParameter(String name) { + for (BigQueryJdbcParameter p : parametersList) { + if (name.equals(p.getParamName())) { + return p.getValue(); + } + } + return null; + } + + // Get parameter type by index + BigQueryStatementParameterType getParameterType(int index) { + // Index is 1-based. Converting to 0 based for java. + int arrayIndex = index - 1; + if (parametersList.size() <= arrayIndex || parametersList.get(arrayIndex) == null) { + return null; + } + return parametersList.get(arrayIndex).getParamType(); + } + + // Get parameter type by name + BigQueryStatementParameterType getParameterType(String name) { + for (BigQueryJdbcParameter p : parametersList) { + if (name.equals(p.getParamName())) { + return p.getParamType(); + } + } + return null; + } + + // Get scale type by index + int getParameterScale(int index) { + // Index is 1-based. Converting to 0 based for java. + int arrayIndex = index - 1; + if (parametersList.size() <= arrayIndex || parametersList.get(arrayIndex) == null) { + return -1; + } + return parametersList.get(arrayIndex).getScale(); + } + + // Get parameter scale by name + int getParameterScale(String name) { + for (BigQueryJdbcParameter p : parametersList) { + if (name.equals(p.getParamName())) { + return p.getScale(); + } + } + return -1; + } + + Class getType(String name) { + for (BigQueryJdbcParameter p : parametersList) { + if (name.equals(p.getParamName())) { + return p.getType(); + } + } + return null; + } + + StandardSQLTypeName getSqlType(String name) { + for (BigQueryJdbcParameter p : parametersList) { + if (name.equals(p.getParamName())) { + return p.getSqlType(); + } + } + return null; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java new file mode 100644 index 0000000000..ebb07dc11f --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java @@ -0,0 +1,497 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.common.annotations.VisibleForTesting; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.UUID; +import java.util.concurrent.Executor; +import java.util.concurrent.LinkedBlockingDeque; +import javax.sql.ConnectionEvent; +import javax.sql.ConnectionEventListener; +import javax.sql.PooledConnection; +import javax.sql.StatementEventListener; + +class BigQueryPooledConnection implements PooledConnection { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + + private String id; // Mainly for internal use + private Connection bqConnection; + private boolean inUse = false; + private Long listenerPoolSize = 10L; + private LinkedBlockingDeque listeners; + + BigQueryPooledConnection(Connection bqConnection) { + this.bqConnection = bqConnection; + this.id = UUID.randomUUID().toString(); + String connectionUrl = ((BigQueryConnection) bqConnection).getConnectionUrl(); + if (connectionUrl != null && !connectionUrl.isEmpty()) { + this.listenerPoolSize = + BigQueryJdbcUrlUtility.parseListenerPoolSize(connectionUrl, this.toString()); + } + if (getListenerPoolSize() > 0L) { + listeners = new LinkedBlockingDeque<>(getListenerPoolSize().intValue()); + } else { + listeners = new LinkedBlockingDeque<>(); + } + } + + Long getListenerPoolSize() { + return listenerPoolSize; + } + + @VisibleForTesting + boolean inUse() { + return inUse; + } + + @VisibleForTesting + boolean isListenerPooled(ConnectionEventListener l) { + return listeners.contains(l); + } + + @Override + public synchronized Connection getConnection() throws SQLException { + LOG.finest("++enter++"); + if (inUse) { + throw new SQLException("PooledConnection is already in use."); + } + inUse = true; + // Return a wrapper around the underlying physical connection. + return new BigQueryPooledConnectionWrapper(bqConnection, this); + } + + @Override + public synchronized void close() throws SQLException { + LOG.finest("++enter++"); + // Notify listeners that the *PooledConnection* is being closed. + ConnectionEvent event = new ConnectionEvent(this); + for (ConnectionEventListener listener : listeners) { + listener.connectionClosed(event); // This is likely not the intended event for this action + } + // Marks the pooled connection to be not in use. + inUse = false; + } + + @Override + public synchronized void addConnectionEventListener(ConnectionEventListener listener) { + LOG.finest("++enter++"); + if (listener == null) { + return; + } + if (this.listeners.contains(listener)) { + return; + } + this.listeners.add(listener); + } + + @Override + public synchronized void removeConnectionEventListener(ConnectionEventListener listener) { + LOG.finest("++enter++"); + if (listener == null) { + return; + } + if (!this.listeners.contains(listener)) { + return; + } + this.listeners.remove(listener); + } + + // Method called by the BigQueryPooledConnectionWrapper when the logical + // Connection is closed. + public synchronized void connectionHandleClosed(BigQueryPooledConnectionWrapper handle) { + LOG.finest("++enter++"); + inUse = false; + ConnectionEvent event = new ConnectionEvent(this); + for (ConnectionEventListener listener : listeners) { + listener.connectionClosed(event); + } + LOG.finest("Connection handle returned to the pool."); + } + + // Method to notify listeners about a connection error. This can be called + // by the application if they are using PooledConnection directly or by the + // BigQueryPooledConnectionWrapper when a connection is aborted. + public synchronized void fireConnectionError(SQLException e) { + LOG.finest("++enter++"); + inUse = false; + ConnectionEvent event = new ConnectionEvent(this, e); + for (ConnectionEventListener listener : listeners) { + listener.connectionErrorOccurred(event); + } + LOG.finest( + String.format("Connection handle removed from the pool due to error: %s", e.getMessage())); + // Listners no longer need to listen for this connection since it has been removed from the + // pool. + for (ConnectionEventListener listener : listeners) { + removeConnectionEventListener(listener); + } + } + + @Override + public void addStatementEventListener(StatementEventListener arg0) { + throw new UnsupportedOperationException( + "Method 'addStatementEventListener' is not supported by the BQ Driver"); + } + + @Override + public void removeStatementEventListener(StatementEventListener arg0) { + throw new UnsupportedOperationException( + "Method 'removeStatementEventListener' is not supported by the BQ Driver"); + } + + // Inner class: Connection Wrapper around the actual physical Connection + // This class notifies the listeners or calls the listner notification methods + // provided by the pooled connection. + static class BigQueryPooledConnectionWrapper implements Connection { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private Connection bqConnectionDelegate; + private BigQueryPooledConnection pooledConnection; + private boolean closed = false; + + public BigQueryPooledConnectionWrapper( + Connection bqConnectionDelegate, BigQueryPooledConnection pooledConnection) { + this.bqConnectionDelegate = bqConnectionDelegate; + this.pooledConnection = pooledConnection; + } + + @Override + public void close() throws SQLException { + LOG.finest("++enter++"); + if (!closed) { + // Instead of physically closing, we notify the PooledConnection + // that this handle is no longer in use. + pooledConnection.connectionHandleClosed(this); + closed = true; + LOG.finest("Logical connection closed (returned to pool)."); + } + } + + @Override + public boolean isClosed() throws SQLException { + return closed || bqConnectionDelegate.isClosed(); + } + + @Override + public java.sql.Statement createStatement() throws SQLException { + return bqConnectionDelegate.createStatement(); + } + + @Override + public java.sql.PreparedStatement prepareStatement(String sql) throws SQLException { + return bqConnectionDelegate.prepareStatement(sql); + } + + @Override + public java.sql.CallableStatement prepareCall(String sql) throws SQLException { + return bqConnectionDelegate.prepareCall(sql); + } + + @Override + public String nativeSQL(String sql) throws SQLException { + return bqConnectionDelegate.nativeSQL(sql); + } + + @Override + public void setAutoCommit(boolean autoCommit) throws SQLException { + bqConnectionDelegate.setAutoCommit(autoCommit); + } + + @Override + public boolean getAutoCommit() throws SQLException { + return bqConnectionDelegate.getAutoCommit(); + } + + @Override + public void commit() throws SQLException { + bqConnectionDelegate.commit(); + } + + @Override + public void rollback() throws SQLException { + bqConnectionDelegate.rollback(); + } + + @Override + public java.sql.DatabaseMetaData getMetaData() throws SQLException { + return bqConnectionDelegate.getMetaData(); + } + + @Override + public void setReadOnly(boolean readOnly) throws SQLException { + bqConnectionDelegate.setReadOnly(readOnly); + } + + @Override + public boolean isReadOnly() throws SQLException { + return bqConnectionDelegate.isReadOnly(); + } + + @Override + public void setCatalog(String catalog) throws SQLException { + bqConnectionDelegate.setCatalog(catalog); + } + + @Override + public String getCatalog() throws SQLException { + return bqConnectionDelegate.getCatalog(); + } + + @Override + public void setTransactionIsolation(int level) throws SQLException { + bqConnectionDelegate.setTransactionIsolation(level); + } + + @Override + public int getTransactionIsolation() throws SQLException { + return bqConnectionDelegate.getTransactionIsolation(); + } + + @Override + public java.sql.SQLWarning getWarnings() throws SQLException { + return bqConnectionDelegate.getWarnings(); + } + + @Override + public void clearWarnings() throws SQLException { + bqConnectionDelegate.clearWarnings(); + } + + @Override + public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) + throws SQLException { + return bqConnectionDelegate.createStatement(resultSetType, resultSetConcurrency); + } + + @Override + public java.sql.PreparedStatement prepareStatement( + String sql, int resultSetType, int resultSetConcurrency) throws SQLException { + return bqConnectionDelegate.prepareStatement(sql, resultSetType, resultSetConcurrency); + } + + @Override + public java.sql.CallableStatement prepareCall( + String sql, int resultSetType, int resultSetConcurrency) throws SQLException { + return bqConnectionDelegate.prepareCall(sql, resultSetType, resultSetConcurrency); + } + + @Override + public java.util.Map> getTypeMap() throws SQLException { + return bqConnectionDelegate.getTypeMap(); + } + + @Override + public void setTypeMap(java.util.Map> map) throws SQLException { + bqConnectionDelegate.setTypeMap(map); + } + + @Override + public void setHoldability(int holdability) throws SQLException { + bqConnectionDelegate.setHoldability(holdability); + } + + @Override + public int getHoldability() throws SQLException { + return bqConnectionDelegate.getHoldability(); + } + + @Override + public java.sql.Savepoint setSavepoint() throws SQLException { + return bqConnectionDelegate.setSavepoint(); + } + + @Override + public java.sql.Savepoint setSavepoint(String name) throws SQLException { + return bqConnectionDelegate.setSavepoint(name); + } + + @Override + public void rollback(java.sql.Savepoint savepoint) throws SQLException { + bqConnectionDelegate.rollback(savepoint); + } + + @Override + public void releaseSavepoint(java.sql.Savepoint savepoint) throws SQLException { + bqConnectionDelegate.releaseSavepoint(savepoint); + } + + @Override + public java.sql.Statement createStatement( + int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { + return bqConnectionDelegate.createStatement( + resultSetType, resultSetConcurrency, resultSetHoldability); + } + + @Override + public java.sql.PreparedStatement prepareStatement( + String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + return bqConnectionDelegate.prepareStatement( + sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + @Override + public java.sql.CallableStatement prepareCall( + String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) + throws SQLException { + return bqConnectionDelegate.prepareCall( + sql, resultSetType, resultSetConcurrency, resultSetHoldability); + } + + @Override + public java.sql.PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) + throws SQLException { + return bqConnectionDelegate.prepareStatement(sql, autoGeneratedKeys); + } + + @Override + public java.sql.PreparedStatement prepareStatement(String sql, int[] columnIndices) + throws SQLException { + return bqConnectionDelegate.prepareStatement(sql, columnIndices); + } + + @Override + public java.sql.PreparedStatement prepareStatement(String sql, String[] columnNames) + throws SQLException { + return bqConnectionDelegate.prepareStatement(sql, columnNames); + } + + @Override + public java.sql.Clob createClob() throws SQLException { + return bqConnectionDelegate.createClob(); + } + + @Override + public java.sql.Blob createBlob() throws SQLException { + return bqConnectionDelegate.createBlob(); + } + + @Override + public java.sql.NClob createNClob() throws SQLException { + return bqConnectionDelegate.createNClob(); + } + + @Override + public java.sql.SQLXML createSQLXML() throws SQLException { + return bqConnectionDelegate.createSQLXML(); + } + + @Override + public boolean isValid(int timeout) throws SQLException { + return bqConnectionDelegate.isValid(timeout); + } + + @Override + public void setClientInfo(String name, String value) throws java.sql.SQLClientInfoException { + bqConnectionDelegate.setClientInfo(name, value); + } + + @Override + public void setClientInfo(java.util.Properties properties) + throws java.sql.SQLClientInfoException { + bqConnectionDelegate.setClientInfo(properties); + } + + @Override + public String getClientInfo(String name) throws SQLException { + return bqConnectionDelegate.getClientInfo(name); + } + + @Override + public java.util.Properties getClientInfo() throws SQLException { + return bqConnectionDelegate.getClientInfo(); + } + + @Override + public java.sql.Array createArrayOf(String typeName, Object[] elements) throws SQLException { + return bqConnectionDelegate.createArrayOf(typeName, elements); + } + + @Override + public java.sql.Struct createStruct(String typeName, Object[] attributes) throws SQLException { + return bqConnectionDelegate.createStruct(typeName, attributes); + } + + @Override + public T unwrap(Class iface) throws SQLException { + return bqConnectionDelegate.unwrap(iface); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + return bqConnectionDelegate.isWrapperFor(iface); + } + + @Override + public void setSchema(String schema) throws SQLException { + bqConnectionDelegate.setSchema(schema); + } + + @Override + public String getSchema() throws SQLException { + return bqConnectionDelegate.getSchema(); + } + + @Override + public void setNetworkTimeout(java.util.concurrent.Executor executor, int milliseconds) + throws SQLException { + bqConnectionDelegate.setNetworkTimeout(executor, milliseconds); + } + + @Override + public int getNetworkTimeout() throws SQLException { + return bqConnectionDelegate.getNetworkTimeout(); + } + + @Override + public void abort(Executor arg0) throws SQLException { + LOG.finest("++enter++"); + if (!closed) { + // We notify the pooled connection that physical connection + // is being aborted. We assume here that abort() is called for + // error cases. + SQLException e = new SQLException("Connection is being terminated and aborted"); + pooledConnection.fireConnectionError(e); + closed = true; + LOG.finest("Logical connection aborted (removed from pool)."); + } + // Call the delate abort to actually close the undelying connection. + bqConnectionDelegate.abort(arg0); + } + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (getClass() != obj.getClass()) return false; + BigQueryPooledConnection other = (BigQueryPooledConnection) obj; + if (id == null) { + if (other.id != null) return false; + } else if (!id.equals(other.id)) return false; + return true; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java new file mode 100644 index 0000000000..2410f6a58a --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java @@ -0,0 +1,611 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryParameterValue; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsRequest; +import com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse; +import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; +import com.google.cloud.bigquery.storage.v1.TableName; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.protobuf.Descriptors.DescriptorValidationException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Clob; +import java.sql.Date; +import java.sql.NClob; +import java.sql.ParameterMetaData; +import java.sql.PreparedStatement; +import java.sql.Ref; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.RowId; +import java.sql.SQLException; +import java.sql.SQLXML; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.LinkedList; +import java.util.Queue; + +class BigQueryPreparedStatement extends BigQueryStatement implements PreparedStatement { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final char POSITIONAL_PARAMETER_CHAR = '?'; + // Making this protected so BigQueryCallableStatement subclass can access the parameters. + protected final BigQueryParameterHandler parameterHandler; + protected int parameterCount = 0; + protected String currentQuery; + private Queue> batchParameters = new LinkedList<>(); + private Schema insertSchema = null; + private TableName insertTableName = null; + + BigQueryPreparedStatement(BigQueryConnection connection, String query) { + super(connection); + setCurrentQuery(query); + this.parameterHandler = new BigQueryParameterHandler(this.parameterCount); + } + + void setCurrentQuery(String currentQuery) { + this.parameterCount = getParameterCount(currentQuery); + this.currentQuery = currentQuery; + } + + private int getParameterCount(String query) { + LOG.finest("++enter++"); + return (int) query.chars().filter(ch -> ch == POSITIONAL_PARAMETER_CHAR).count(); + } + + @Override + public ResultSet executeQuery() throws SQLException { + LOG.finest("++enter++"); + logQueryExecutionStart(this.currentQuery); + try { + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(this.currentQuery); + jobConfiguration.setParameterMode("POSITIONAL"); + jobConfiguration = this.parameterHandler.configureParameters(jobConfiguration); + runQuery(this.currentQuery, jobConfiguration.build()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + return getCurrentResultSet(); + } + + @Override + public long executeLargeUpdate() throws SQLException { + LOG.finest("++enter++"); + logQueryExecutionStart(this.currentQuery); + try { + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(this.currentQuery); + jobConfiguration.setParameterMode("POSITIONAL"); + jobConfiguration = this.parameterHandler.configureParameters(jobConfiguration); + runQuery(this.currentQuery, jobConfiguration.build()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + return this.currentUpdateCount; + } + + @Override + public int executeUpdate() throws SQLException { + LOG.finest("++enter++"); + return checkUpdateCount(executeLargeUpdate()); + } + + @Override + public boolean execute() throws SQLException { + LOG.finest("++enter++"); + logQueryExecutionStart(this.currentQuery); + try { + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(this.currentQuery); + jobConfiguration.setParameterMode("POSITIONAL"); + jobConfiguration = this.parameterHandler.configureParameters(jobConfiguration); + runQuery(this.currentQuery, jobConfiguration.build()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + return getCurrentResultSet() != null; + } + + @Override + public void clearParameters() { + LOG.finest("++enter++"); + this.parameterHandler.clearParameters(); + this.parameterCount = 0; + } + + @Override + public void setNull(int parameterIndex, int sqlType) { + // TODO(neenu): implement null case + } + + @Override + public void setBoolean(int parameterIndex, boolean x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Boolean.class); + } + + @Override + public void setByte(int parameterIndex, byte x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Byte.class); + } + + @Override + public void setShort(int parameterIndex, short x) { + // TODO(neenu): implement Bytes conversion. + } + + @Override + public void setInt(int parameterIndex, int x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Integer.class); + } + + @Override + public void setLong(int parameterIndex, long x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Long.class); + } + + @Override + public void setFloat(int parameterIndex, float x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Float.class); + } + + @Override + public void setDouble(int parameterIndex, double x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, Double.class); + } + + @Override + public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, BigDecimal.class); + } + + @Override + public void setString(int parameterIndex, String x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x, String.class); + } + + @Override + public void setBytes(int parameterIndex, byte[] x) { + // TODO(neenu): implement Bytes conversion. + } + + @Override + public void setDate(int parameterIndex, Date x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x.toString(), String.class); + } + + @Override + public void setTime(int parameterIndex, Time x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x.toString(), String.class); + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { + checkClosed(); + this.parameterHandler.setParameter(parameterIndex, x.toString(), String.class); + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, int length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setUnicodeStream(int parameterIndex, InputStream x, int length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, int length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType) {} + + @Override + public void setObject(int parameterIndex, Object x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void addBatch() { + LOG.finest("++enter++"); + ArrayList currentParameterList = + deepCopyParameterList(this.parameterHandler.parametersList); + this.batchParameters.add(currentParameterList); + } + + private ArrayList deepCopyParameterList( + ArrayList parametersList) { + ArrayList copiedParameterList = new ArrayList<>(); + for (BigQueryJdbcParameter parameter : parametersList) { + BigQueryJdbcParameter newParameter = new BigQueryJdbcParameter(parameter); + copiedParameterList.add(newParameter); + } + return copiedParameterList; + } + + @Override + public int[] executeBatch() throws SQLException { + LOG.finest("++enter++"); + int[] result = new int[this.batchParameters.size()]; + if (this.batchParameters.isEmpty()) { + return result; + } + if (useWriteAPI()) { + try (BigQueryWriteClient writeClient = this.connection.getBigQueryWriteClient()) { + LOG.info("Using Write API for bulk INSERT operation."); + ArrayList currentParameterList = this.batchParameters.peek(); + if (this.insertSchema == null && this.insertTableName == null) { + QueryStatistics insertJobQueryStatistics = + getQueryStatistics(getWriteBatchJobConfiguration(currentParameterList)); + setInsertMetadata(insertJobQueryStatistics); + } + + long rowCount = bulkInsertWithWriteAPI(writeClient); + int[] insertArray = new int[Math.toIntExact(rowCount)]; + Arrays.fill(insertArray, 1); + return insertArray; + + } catch (DescriptorValidationException | IOException | InterruptedException e) { + throw new BigQueryJdbcRuntimeException(e); + } + + } else { + try { + LOG.info("Using individual INSERT query runs."); + int count = this.batchParameters.size(); + StringBuilder combinedQuery = new StringBuilder(); + for (int i = 0; i < count; i++) { + + if (this.currentQuery.trim().endsWith(";")) { + combinedQuery.append(this.currentQuery); + } else { + combinedQuery.append(this.currentQuery).append(";"); + } + } + // executeBatch in PreparedStatement is used for BulkInsert/DML. + // If not correct Type, fails later. + runQuery( + combinedQuery.toString(), getStandardBatchJobConfiguration(combinedQuery.toString())); + int i = 0; + while (getUpdateCount() != -1 && i < count) { + result[i] = getUpdateCount(); + getMoreResults(); + i++; + } + return result; + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + } + + private long bulkInsertWithWriteAPI(BigQueryWriteClient bigQueryWriteClient) + throws DescriptorValidationException, + IOException, + InterruptedException, + BigQueryJdbcException { + LOG.finest("++enter++"); + RetrySettings retrySettings = this.connection.getRetrySettings(); + + BigQueryJdbcBulkInsertWriter bulkInsertWriter = new BigQueryJdbcBulkInsertWriter(); + bulkInsertWriter.initialize(this.insertTableName, bigQueryWriteClient, retrySettings); + + try { + long offset = 0; + JsonArray jsonArray = new JsonArray(); + Gson gson = new Gson(); + int count = this.batchParameters.size(); + for (int i = 0; i < count; i++) { + + ArrayList parameterList = this.batchParameters.poll(); + FieldList fieldLists = this.insertSchema.getFields(); + if (fieldLists.size() == parameterList.size()) { + + JsonObject rowObject = new JsonObject(); + for (int j = 0; j < parameterList.size(); j++) { + BigQueryJdbcParameter parameter = parameterList.get(j); + if (parameter.getSqlType() == StandardSQLTypeName.STRING) { + rowObject.addProperty(fieldLists.get(j).getName(), parameter.getValue().toString()); + } else { + rowObject.addProperty(fieldLists.get(j).getName(), gson.toJson(parameter.getValue())); + } + } + jsonArray.add(rowObject); + + if (jsonArray.size() == this.querySettings.getWriteAPIAppendRowCount() + || this.batchParameters.size() == 0) { + bulkInsertWriter.append(jsonArray, offset); + LOG.finest("Append called "); + offset += jsonArray.size(); + jsonArray = new JsonArray(); + } + } else { + throw new BigQueryJdbcException("Mismatch between field count and parameter count."); + } + } + } catch (BigQueryJdbcException e) { + throw new RuntimeException(e); + } + + long rowCount = bulkInsertWriter.cleanup(bigQueryWriteClient); + + BatchCommitWriteStreamsRequest commitRequest = + BatchCommitWriteStreamsRequest.newBuilder() + .setParent(this.insertTableName.toString()) + .addWriteStreams(bulkInsertWriter.getStreamName()) + .build(); + BatchCommitWriteStreamsResponse commitResponse = + bigQueryWriteClient.batchCommitWriteStreams(commitRequest); + if (commitResponse.hasCommitTime() == false) { + throw new BigQueryJdbcException("Error committing the streams"); + } + LOG.finest("Commit called."); + return rowCount; + } + + private void setInsertMetadata(QueryStatistics statistics) throws SQLException { + LOG.finest("++enter++"); + if (!statistics.getStatementType().equals(StatementType.INSERT) + || statistics.getSchema() == null + || statistics.getReferencedTables().stream().distinct().count() > 1) { + throw new BigQueryJdbcException( + "Use java.sql.Statement.executeBatch() for heterogeneous DML batches"); + } + + this.insertSchema = statistics.getSchema(); + TableId tableID = statistics.getReferencedTables().get(0); + this.insertTableName = + TableName.of(tableID.getProject(), tableID.getDataset(), tableID.getTable()); + LOG.finest( + String.format( + "this.insertTableName : %s, this.insertSchema : %s", + this.insertTableName, this.insertSchema.toString())); + } + + QueryJobConfiguration getWriteBatchJobConfiguration( + ArrayList currentParameterList) throws SQLException { + LOG.finest("++enter++"); + BigQueryParameterHandler batchHandler = + new BigQueryParameterHandler(this.parameterCount, currentParameterList); + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(this.currentQuery); + jobConfiguration.setParameterMode("POSITIONAL"); + jobConfiguration = batchHandler.configureParameters(jobConfiguration); + return jobConfiguration.build(); + } + + QueryJobConfiguration getStandardBatchJobConfiguration(String query) throws SQLException { + LOG.finest("++enter++"); + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(query); + jobConfiguration.setParameterMode("POSITIONAL"); + jobConfiguration.setPriority(QueryJobConfiguration.Priority.BATCH); + int index = 0; + while (!this.batchParameters.isEmpty()) { + ArrayList parameterList = this.batchParameters.poll(); + + for (BigQueryJdbcParameter parameter : parameterList) { + Object parameterValue = parameter.getValue(); + StandardSQLTypeName sqlType = parameter.getSqlType(); + LOG.finest( + String.format( + "Parameter %s of type %s at index %s added to QueryJobConfiguration", + parameterValue, sqlType, index++)); + jobConfiguration.addPositionalParameter(QueryParameterValue.of(parameterValue, sqlType)); + } + } + return jobConfiguration.build(); + } + + Boolean useWriteAPI() { + LOG.finest("++enter++"); + if (this.querySettings.isUseWriteAPI()) { + if (this.batchParameters.size() >= this.querySettings.getWriteAPIActivationRowCount()) { + return true; + } + } + return false; + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, int length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setRef(int parameterIndex, Ref x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBlob(int parameterIndex, Blob x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setClob(int parameterIndex, Clob x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setArray(int parameterIndex, Array x) { + // TODO(neenu) :IMPLEMENT ARRAY + } + + @Override + public ResultSetMetaData getMetaData() { + // TODO(neenu) :IMPLEMENT metadata + return null; + } + + @Override + public void setDate(int parameterIndex, Date x, Calendar cal) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setTime(int parameterIndex, Time x, Calendar cal) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNull(int parameterIndex, int sqlType, String typeName) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setURL(int parameterIndex, URL x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public ParameterMetaData getParameterMetaData() { + // TODO(neenu) :IMPLEMENT + return null; + } + + @Override + public void setRowId(int parameterIndex, RowId x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNString(int parameterIndex, String value) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNClob(int parameterIndex, NClob value) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setClob(int parameterIndex, Reader reader, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNClob(int parameterIndex, Reader reader, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setSQLXML(int parameterIndex, SQLXML xmlObject) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) { + // TODO(neenu) : IMPLEMENT? + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader, long length) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setAsciiStream(int parameterIndex, InputStream x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBinaryStream(int parameterIndex, InputStream x) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setCharacterStream(int parameterIndex, Reader reader) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNCharacterStream(int parameterIndex, Reader value) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setClob(int parameterIndex, Reader reader) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setBlob(int parameterIndex, InputStream inputStream) { + // TODO :NOT IMPLEMENTED + } + + @Override + public void setNClob(int parameterIndex, Reader reader) { + // TODO :NOT IMPLEMENTED + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSet.java new file mode 100644 index 0000000000..c24e37abdd --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSet.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; + +public interface BigQueryResultSet { + /* + * This function returns Job Id for the corresponding BQ Job that generated result. + * Note that it is not available for certain queries (low-latency queries) and for metadata results. + * + * @return JobId object or null. + */ + public JobId getJobId(); + + /* + * This function returns Query Id for the corresponding low-latency query produced results. + * It is null for regular (non-low latency) jobs and metadata results. + * + * @return Query Id string or null. + */ + public String getQueryId(); + + /* + * Returns com.google.cloud.bigquery.JobStatistics.QueryStatistics object with statistics for the + * completed Job for non-low latency queries. + * + * @return QueryStatistics object or null. + */ + public QueryStatistics getQueryStatistics(); +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java new file mode 100644 index 0000000000..15a1cca349 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizers.java @@ -0,0 +1,73 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import java.lang.ref.PhantomReference; +import java.lang.ref.ReferenceQueue; + +@InternalApi +class BigQueryResultSetFinalizers { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryResultSetFinalizers.class.getName()); + + @InternalApi + static class ArrowResultSetFinalizer extends PhantomReference { + Thread ownedThread; + + public ArrowResultSetFinalizer( + BigQueryArrowResultSet referent, + ReferenceQueue q, + Thread ownedThread) { + super(referent, q); + this.ownedThread = ownedThread; + } + + // Free resources. Remove all the hard refs + public void finalizeResources() { + LOG.finest("++enter++"); + if (ownedThread != null && !ownedThread.isInterrupted()) { + ownedThread.interrupt(); + } + } + } + + @InternalApi + static class JsonResultSetFinalizer extends PhantomReference { + Thread[] ownedThreads; + + public JsonResultSetFinalizer( + BigQueryJsonResultSet referent, + ReferenceQueue q, + Thread[] ownedThreads) { + super(referent, q); + this.ownedThreads = ownedThreads; + } + + // Free resources. Remove all the hard refs + public void finalizeResources() { + LOG.finest("++enter++"); + if (ownedThreads != null) { + for (Thread ownedThread : ownedThreads) { + if (!ownedThread.isInterrupted()) { + ownedThread.interrupt(); + } + } + } + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadata.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadata.java new file mode 100644 index 0000000000..d18c689333 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadata.java @@ -0,0 +1,213 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Types; + +/** This class returns ResultSetMetadata for the JSON and the Arrow ResultSets */ +class BigQueryResultSetMetadata implements ResultSetMetaData { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private final FieldList schemaFieldList; + private final Statement statement; + private final int columnCount; + + private static final int DEFAULT_DISPLAY_SIZE = 50; + + private BigQueryResultSetMetadata(FieldList schemaFieldList, Statement statement) { + LOG.finest("++enter++"); + this.schemaFieldList = schemaFieldList; + this.columnCount = schemaFieldList.size(); + this.statement = statement; + } + + static BigQueryResultSetMetadata of(FieldList schemaFieldList, Statement statement) { + return new BigQueryResultSetMetadata(schemaFieldList, statement); + } + + private Field getField(int sqlColumn) { + return this.schemaFieldList.get(sqlColumn - 1); + } + + @Override + public int getColumnCount() { + return this.columnCount; + } + + @Override + public boolean isAutoIncrement(int column) { + // BQ doesn't support auto increment + return false; + } + + @Override + public boolean isCaseSensitive(int column) { + int colType = getColumnType(column); + return colType == Types.NVARCHAR; + } + + @Override + public boolean isSearchable(int column) { + int colType = getColumnType(column); + return colType != Types.OTHER; + } + + @Override + public boolean isCurrency(int column) { + return false; + } + + @Override + public int isNullable(int column) { + Mode colMode = getField(column).getMode(); + if (colMode == null) { + return ResultSetMetaData.columnNullableUnknown; + } + return colMode == Mode.NULLABLE + ? ResultSetMetaData.columnNullable + : ResultSetMetaData.columnNoNulls; + } + + @Override + public boolean isSigned(int column) { + int colType = getColumnType(column); + return colType == Types.FLOAT + || colType == Types.DOUBLE + || colType == Types.BIGINT + || colType == Types.NUMERIC; + } + + @Override + public int getColumnDisplaySize(int column) { + int colType = getColumnType(column); + switch (colType) { + case Types.BOOLEAN: + return 5; + case Types.DATE: + case Types.BIGINT: + return 10; + case Types.DOUBLE: + case Types.DECIMAL: + case Types.NUMERIC: + return 14; + case Types.TIMESTAMP: + return 16; + default: + return DEFAULT_DISPLAY_SIZE; + } + } + + @Override + public String getColumnLabel(int column) { + return getField(column).getName(); + } + + @Override + public String getColumnName(int column) { + return getField(column).getName(); + } + + @Override + public int getPrecision(int column) { + return (int) (getField(column).getPrecision() != null ? getField(column).getPrecision() : 0); + } + + @Override + public int getScale(int column) { + return (int) (getField(column).getScale() != null ? getField(column).getScale() : 0); + } + + @Override + public String getTableName(int column) { + // returning "" as per the specs as there might be multiple tables involved, or we + // might be reading from the temp table + return ""; + } + + @Override + public String getCatalogName(int column) { + return ""; // not applicable + } + + @Override + public String getSchemaName(int column) { + return ""; // not applicable + } + + private StandardSQLTypeName getStandardSQLTypeName(int column) { + Field field = getField(column); + if (field.getMode() == Mode.REPEATED) { + return StandardSQLTypeName.ARRAY; + } + return getField(column).getType().getStandardType(); + } + + @Override + public int getColumnType(int column) { + return BigQueryJdbcTypeMappings.standardSQLToJavaSqlTypesMapping.get( + getStandardSQLTypeName(column)); + } + + @Override + public String getColumnTypeName(int column) { + return getStandardSQLTypeName(column).name(); + } + + @Override + public boolean isReadOnly(int column) { + return false; + } + + @Override + public boolean isWritable(int column) { + return !isReadOnly(column); + } + + @Override + public boolean isDefinitelyWritable(int column) { + return false; + } + + @Override + public String getColumnClassName(int column) { + Field field = getField(column); + if (field.getMode() == Mode.REPEATED) { + return java.sql.Array.class.getName(); + } + return BigQueryJdbcTypeMappings.standardSQLToJavaTypeMapping + .get(field.getType().getStandardType()) + .getName(); + } + + // Unsupported methods: + @Override + public T unwrap(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException("unwrap is not implemented"); + } + + @Override + public boolean isWrapperFor(Class iface) throws SQLException { + throw new BigQueryJdbcSqlFeatureNotSupportedException("isWrapperFor is not implemented"); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySettings.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySettings.java new file mode 100644 index 0000000000..16f13a7784 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySettings.java @@ -0,0 +1,857 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.Clustering; +import com.google.cloud.bigquery.ConnectionProperty; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.EncryptionConfiguration; +import com.google.cloud.bigquery.ExternalTableDefinition; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.Priority; +import com.google.cloud.bigquery.RangePartitioning; +import com.google.cloud.bigquery.TimePartitioning; +import com.google.cloud.bigquery.UserDefinedFunction; +import java.util.List; +import java.util.Map; + +/** This class is used to pass user defined settings for execution of Queries. */ +// TODO: Expose this class as public once we decide on how to expose the slow +// query path to the end users. IMP: revisit the set of params to be exposed via BigQuerySettings +class BigQuerySettings { + + private final boolean useReadAPI; + private final int highThroughputActivationRatio; + private final int highThroughputMinTableSize; + private final boolean unsupportedHTAPIFallback; + + private final boolean enableSession; + + private final ConnectionProperty sessionInfoConnectionProperty; + + private final boolean useQueryCache; + private final String queryDialect; + private final List queryProperties; + private final Boolean allowLargeResults; + private final String kmsKeyName; + private final Clustering clustering; + + private final JobInfo.CreateDisposition createDisposition; + + private final EncryptionConfiguration destinationEncryptionConfiguration; + + private final String destinationTable; + private final String destinationDataset; + private final long destinationDatasetExpirationTime; + + private final long jobTimeoutMs; + + private final int maximumBillingTier; + + private final QueryJobConfiguration.Priority priority; + + private final RangePartitioning rangePartitioning; + + private final List schemaUpdateOptions; + + private final Map tableDefinitions; + + private final TimePartitioning timePartitioning; + + private final List userDefinedFunctions; + + private final JobInfo.WriteDisposition writeDisposition; + + private final int numBufferedRows; + + private final long maxResultPerPage; + + private final DatasetId defaultDataset; + + private final boolean useWriteAPI; + private final int writeAPIActivationRowCount; + private final int writeAPIAppendRowCount; + + private final long maxBytesBilled; + private final Map labels; + + private BigQuerySettings(Builder builder) { + this.useReadAPI = builder.useReadAPI; + this.highThroughputActivationRatio = builder.highThroughputActivationRatio; + this.highThroughputMinTableSize = builder.highThroughputMinTableSize; + this.useQueryCache = builder.useQueryCache; + this.queryDialect = builder.queryDialect; + this.queryProperties = builder.queryProperties; + this.allowLargeResults = builder.allowLargeResults; + this.kmsKeyName = builder.kmsKeyName; + this.clustering = builder.clustering; + this.createDisposition = builder.createDisposition; + this.destinationEncryptionConfiguration = builder.destinationEncryptionConfiguration; + this.destinationTable = builder.destinationTable; + this.destinationDataset = builder.destinationDataset; + this.destinationDatasetExpirationTime = builder.destinationDatasetExpirationTime; + this.jobTimeoutMs = builder.jobTimeoutMs; + this.maximumBillingTier = builder.maximumBillingTier; + this.priority = builder.priority; + this.rangePartitioning = builder.rangePartitioning; + this.schemaUpdateOptions = builder.schemaUpdateOptions; + this.tableDefinitions = builder.tableDefinitions; + this.timePartitioning = builder.timePartitioning; + this.userDefinedFunctions = builder.userDefinedFunctions; + this.writeDisposition = builder.writeDisposition; + this.numBufferedRows = builder.numBufferedRows; + this.maxResultPerPage = builder.maxResultPerPage; + this.defaultDataset = builder.defaultDataset; + this.enableSession = builder.enableSession; + this.unsupportedHTAPIFallback = builder.unsupportedHTAPIFallback; + this.sessionInfoConnectionProperty = builder.sessionInfoConnectionProperty; + this.useWriteAPI = builder.useWriteAPI; + this.writeAPIActivationRowCount = builder.writeAPIActivationRowCount; + this.writeAPIAppendRowCount = builder.writeAPIAppendRowCount; + this.maxBytesBilled = builder.maxBytesBilled; + this.labels = builder.labels; + } + + /** Returns a builder for a BigQuerySettings object. */ + static Builder newBuilder() { + return new Builder(); + } + + /** + * Returns useReadAPI flag, enabled by default. Read API will be used if the underlying conditions + * are satisfied and this flag is enabled + */ + Boolean getUseReadAPI() { + return useReadAPI; + } + + /** + * Returns integer value for when the connector switches to BigQuery Storage API when the number + * of pages and rows in query results exceed this value and HighThroughPutMinTableSize, + * respectively. + */ + int getHighThroughputActivationRatio() { + return highThroughputActivationRatio; + } + + /** + * Returns integer value for when query results are large, exceeding both row and page limits, the + * connector switches to the BigQuery Storage API for faster processing. + */ + int getHighThroughputMinTableSize() { + return highThroughputMinTableSize; + } + + /** + * Determines if session features are enabled. + * + *

    Enabling session-level features allows for capturing SQL activities or enabling + * multi-statement transactions. Session tracking is disabled by default. + * + * @return true if session is enabled, false otherwise. + */ + boolean isEnableSession() { + return enableSession; + } + + /** + * When the connector uses fetch workflows not supported on the High-Throughput API, this option + * specifies whether the connector falls back to the REST API or returns an error. By default it + * falls back to standard API. + * + * @return true if falls back to standard, false to error. + */ + boolean isUnsupportedHTAPIFallback() { + return unsupportedHTAPIFallback; + } + + /** + * Returns information about the BigQuery session ConnectionProperty associated with this job. + * + *

    BigQuery's sessions provide a way to link multiple jobs and maintain temporary data, such as + * temporary tables, between them. They are needed for using multi-statement transactions that + * span across multiple queries. + * + * @return An instance of {@link ConnectionProperty} containing session details, or {@code null} + * if this job is not part of a session. + */ + ConnectionProperty getSessionInfoConnectionProperty() { + return sessionInfoConnectionProperty; + } + + Boolean getUseQueryCache() { + return useQueryCache; + } + + String getQueryDialect() { + return queryDialect; + } + + List getQueryProperties() { + return this.queryProperties; + } + + /** + * Returns the KMS resource name which is the unique identifier you give to your encryption key in + * Google Cloud's Key Management Service (KMS). Tells BigQuery which key to use when encrypting or + * decrypting your data. + */ + String getKmsKeyName() { + return kmsKeyName; + } + + Boolean getAllowLargeResults() { + return allowLargeResults; + } + + /** Returns the clustering specification for the destination table. */ + Clustering getClustering() { + return clustering; + } + + /** + * Returns whether the job is allowed to create new tables. + * + * @see + * Create Disposition + */ + JobInfo.CreateDisposition getCreateDisposition() { + return createDisposition; + } + + /** Returns the custom encryption configuration (e.g., Cloud KMS keys) */ + EncryptionConfiguration getDestinationEncryptionConfiguration() { + return destinationEncryptionConfiguration; + } + + /** + * Returns the table where you want to store query results. If not provided a default temp table + * is created when needed. + */ + String getDestinationTable() { + return destinationTable; + } + + /** + * Returns the dataset where you want to store query results. If not provided a default dataset is + * created when needed. + */ + String getDestinationDataset() { + return destinationDataset; + } + + long getDestinationDatasetExpirationTime() { + return destinationDatasetExpirationTime; + } + + /** Returns the timeout associated with this job */ + Long getJobTimeoutMs() { + return jobTimeoutMs; + } + + /** Returns the optional billing tier limit for this job. */ + Integer getMaximumBillingTier() { + return maximumBillingTier; + } + + /** Returns the query priority. */ + QueryJobConfiguration.Priority getPriority() { + return priority; + } + + /** Returns the range partitioning specification for the table */ + RangePartitioning getRangePartitioning() { + return rangePartitioning; + } + + /** + * Returns options allowing the schema of the destination table to be updated as a side effect of + * the query job. Schema update options are supported in two cases: when writeDisposition is + * WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition + * of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always + * overwrite the schema. + */ + List getSchemaUpdateOptions() { + return schemaUpdateOptions; + } + + /** + * Returns the external tables definitions. If querying external data sources outside BigQuery, + * this value describes the data format, location and other properties of the data sources. By + * defining these properties, the data sources can be queried as if they were standard BigQuery + * tables. + */ + Map getTableDefinitions() { + return tableDefinitions; + } + + /** Returns the time partitioning specification for the destination table. */ + TimePartitioning getTimePartitioning() { + return timePartitioning; + } + + /** + * Returns user defined function resources that can be used by this query. Function resources can + * either be defined inline ({@link UserDefinedFunction.Type#INLINE}) or loaded from a Google + * Cloud Storage URI ({@link UserDefinedFunction.Type#FROM_URI}. + */ + List getUserDefinedFunctions() { + return userDefinedFunctions; + } + + /** + * Returns the action that should occur if the destination table already exists. + * + * @see + * Write Disposition + */ + JobInfo.WriteDisposition getWriteDisposition() { + return writeDisposition; + } + + /** Returns the number of rows of data to pre-fetch */ + Integer getNumBufferedRows() { + return numBufferedRows; + } + + Long getMaxResultPerPage() { + return maxResultPerPage; + } + + DatasetId getDefaultDataset() { + return defaultDataset; + } + + boolean isUseWriteAPI() { + return useWriteAPI; + } + + int getWriteAPIActivationRowCount() { + return writeAPIActivationRowCount; + } + + int getWriteAPIAppendRowCount() { + return writeAPIAppendRowCount; + } + + long getMaxBytesBilled() { + return maxBytesBilled; + } + + Map getLabels() { + return labels; + } + + @Override + public String toString() { + return "BigQuerySettings{" + + "enableSession=" + + enableSession + + ", " + + "unsupportedHTAPIFallback=" + + unsupportedHTAPIFallback + + ", " + + "sessionInfo=" + + sessionInfoConnectionProperty + + ", " + + "useReadAPI=" + + useReadAPI + + ", " + + "kmsKeyName=" + + kmsKeyName + + ", " + + "highThroughputMinTableSize=" + + highThroughputMinTableSize + + ", " + + "highThroughputActivationRatio=" + + highThroughputActivationRatio + + ", " + + "useQueryCache=" + + useQueryCache + + ", " + + "queryDialect=" + + queryDialect + + ", " + + "queryProperties=" + + queryProperties + + ", " + + "allowLargeResults=" + + allowLargeResults + + ", " + + "clustering=" + + clustering + + ", " + + "createDisposition=" + + createDisposition + + ", " + + "destinationEncryptionConfiguration=" + + destinationEncryptionConfiguration + + ", " + + "destinationTable=" + + destinationTable + + ", " + + "destinationDataset=" + + destinationDataset + + ", " + + "destinationDatasetExpirationTime=" + + destinationDatasetExpirationTime + + ", " + + "jobTimeoutMs=" + + jobTimeoutMs + + ", " + + "maximumBillingTier=" + + maximumBillingTier + + ", " + + "priority=" + + priority + + ", " + + "rangePartitioning=" + + rangePartitioning + + ", " + + "schemaUpdateOptions=" + + schemaUpdateOptions + + ", " + + "tableDefinitions=" + + tableDefinitions + + ", " + + "timePartitioning=" + + timePartitioning + + ", " + + "userDefinedFunctions=" + + userDefinedFunctions + + ", " + + "writeDisposition=" + + writeDisposition + + ", " + + "numBufferedRows=" + + numBufferedRows + + ", " + + "maxResultPerPage=" + + maxResultPerPage + + ", " + + "defaultDataset=" + + defaultDataset + + ", " + + "useWriteAPI=" + + useWriteAPI + + ", " + + "writeAPIActivationRowCount=" + + writeAPIActivationRowCount + + ", " + + "writeAPIAppendRowCount=" + + writeAPIAppendRowCount + + ", " + + "maxBytesBilled=" + + maxBytesBilled + + "}"; + } + + /** Returns a builder pre-populated using the current values of this field. */ + Builder toBuilder() { + return new Builder(this); + } + + static final class Builder { + + private boolean useReadAPI; + private int highThroughputMinTableSize; + private int highThroughputActivationRatio; + private boolean enableSession; + private boolean unsupportedHTAPIFallback; + private ConnectionProperty sessionInfoConnectionProperty; + private boolean useQueryCache; + private String queryDialect; + private List queryProperties; + private Boolean allowLargeResults; + private String kmsKeyName; + private Clustering clustering; + private JobInfo.CreateDisposition createDisposition; + private EncryptionConfiguration destinationEncryptionConfiguration; + private String destinationTable; + private String destinationDataset; + private long destinationDatasetExpirationTime; + private long jobTimeoutMs; + private int maximumBillingTier; + private QueryJobConfiguration.Priority priority; + private RangePartitioning rangePartitioning; + private List schemaUpdateOptions; + private Map tableDefinitions; + private TimePartitioning timePartitioning; + private List userDefinedFunctions; + private JobInfo.WriteDisposition writeDisposition; + private int numBufferedRows; + private long maxResultPerPage; + private DatasetId defaultDataset; + private boolean useWriteAPI; + private int writeAPIActivationRowCount; + private int writeAPIAppendRowCount; + private long maxBytesBilled; + private Map labels; + + Builder() { + this.withDefaultValues(); + } + + private Builder(BigQuerySettings querySettings) { + this.useReadAPI = querySettings.getUseReadAPI(); + this.highThroughputMinTableSize = querySettings.getHighThroughputMinTableSize(); + this.highThroughputActivationRatio = querySettings.getHighThroughputActivationRatio(); + this.enableSession = querySettings.isEnableSession(); + this.unsupportedHTAPIFallback = querySettings.isUnsupportedHTAPIFallback(); + this.sessionInfoConnectionProperty = querySettings.getSessionInfoConnectionProperty(); + this.useQueryCache = querySettings.getUseQueryCache(); + this.queryDialect = querySettings.getQueryDialect(); + this.queryProperties = querySettings.getQueryProperties(); + this.allowLargeResults = querySettings.getAllowLargeResults(); + this.kmsKeyName = querySettings.getKmsKeyName(); + this.clustering = querySettings.getClustering(); + this.createDisposition = querySettings.getCreateDisposition(); + this.destinationEncryptionConfiguration = + querySettings.getDestinationEncryptionConfiguration(); + this.destinationTable = querySettings.getDestinationTable(); + this.destinationDataset = querySettings.getDestinationDataset(); + this.destinationDatasetExpirationTime = querySettings.destinationDatasetExpirationTime; + this.jobTimeoutMs = querySettings.getJobTimeoutMs(); + this.maximumBillingTier = querySettings.getMaximumBillingTier(); + this.priority = querySettings.getPriority(); + this.rangePartitioning = querySettings.getRangePartitioning(); + this.schemaUpdateOptions = querySettings.getSchemaUpdateOptions(); + this.tableDefinitions = querySettings.getTableDefinitions(); + this.timePartitioning = querySettings.getTimePartitioning(); + this.userDefinedFunctions = querySettings.getUserDefinedFunctions(); + this.writeDisposition = querySettings.getWriteDisposition(); + this.numBufferedRows = querySettings.getNumBufferedRows(); + this.maxResultPerPage = querySettings.getMaxResultPerPage(); + this.defaultDataset = querySettings.getDefaultDataset(); + this.useWriteAPI = querySettings.isUseWriteAPI(); + this.writeAPIActivationRowCount = querySettings.getWriteAPIActivationRowCount(); + this.writeAPIAppendRowCount = querySettings.getWriteAPIAppendRowCount(); + this.maxBytesBilled = querySettings.getMaxBytesBilled(); + this.labels = querySettings.getLabels(); + } + + Builder withDefaultValues() { + return setUseReadAPI(false) // Read API is disabled by default; + .setQueryDialect(BigQueryJdbcUrlUtility.DEFAULT_QUERY_DIALECT_VALUE) + .setNumBufferedRows(10000) // 10K records will be kept in the buffer (Blocking Queue); + .setMaxResultPerPage(BigQueryJdbcUrlUtility.DEFAULT_MAX_RESULTS_VALUE); + } + + /** + * Sets useReadAPI flag, enabled by default. Read API will be used if the underlying conditions + * are satisfied and this flag is enabled + * + * @param useReadAPI or {@code true} for none + */ + Builder setUseReadAPI(boolean useReadAPI) { + this.useReadAPI = useReadAPI; + return this; + } + + /** + * Sets the minimum table size for which the BigQuery Storage API will be used. + * + *

    When query results are large, exceeding both the row and page limits, the connector + * automatically switches to the BigQuery Storage API for faster processing. This method allows + * you to configure a threshold for table size, enabling the use of the BigQuery Storage API + * when the limit is exceeded, provided the table size exceeds the specified value. + * + * @param highThroughputMinTableSize the minimum table size to trigger the use of the BigQuery + * Storage API + */ + Builder setHighThroughputMinTableSize(int highThroughputMinTableSize) { + this.highThroughputMinTableSize = highThroughputMinTableSize; + return this; + } + + /** + * Sets the activation ratio for switching to the BigQuery Storage API. + * + *

    The connector switches to the BigQuery Storage API when the number of pages in the query + * results exceeds this value AND the table size is greater than or equal to the value set or + * default value of {@link #setHighThroughputMinTableSize(int)}. + * + * @param highThroughputActivationRatio the activation ratio for switching to BigQuery Storage + * API + */ + Builder setHighThroughputActivationRatio(int highThroughputActivationRatio) { + this.highThroughputActivationRatio = highThroughputActivationRatio; + return this; + } + + /** + * setting true, enables session-level features such as capturing SQL activities or enabling + * multi-statement transactions. Session tracking is disabled by default. + */ + Builder setEnableSession(boolean enableSession) { + this.enableSession = enableSession; + return this; + } + + /** + * When the connector uses fetch workflows not supported on the High-Throughput API, this option + * specifies whether the connector falls back to the REST API or returns an error. By default it + * falls back to standard API. + * + * @param unsupportedHTAPIFallback true if falls back to standard, false to error. + */ + Builder setUnsupportedHTAPIFallback(boolean unsupportedHTAPIFallback) { + this.unsupportedHTAPIFallback = unsupportedHTAPIFallback; + return this; + } + + /** + * Setting session information associated with the job. + * + *

    BigQuery's sessions provide a way to link multiple jobs and maintain temporary data, such + * as temporary tables, between them. They are needed for using multi-statement transactions + * that span across multiple queries. + */ + Builder setSessionInfoConnectionProperty(ConnectionProperty sessionInfoConnectionProperty) { + this.sessionInfoConnectionProperty = sessionInfoConnectionProperty; + return this; + } + + Builder setUseQueryCache(boolean useQueryCache) { + this.useQueryCache = useQueryCache; + return this; + } + + Builder setAllowLargeResults(Boolean allowLargeResults) { + this.allowLargeResults = allowLargeResults; + return this; + } + + /** + * Set the KMS resource key name which is the unique identifier you give to your encryption key + * in Google Cloud's Key Management Service (KMS). Tells BigQuery which key to use when + * encrypting or decrypting your data. + */ + Builder setKmsKeyName(String kmsKeyName) { + this.kmsKeyName = kmsKeyName; + return this; + } + + Builder setQueryDialect(String queryDialect) { + this.queryDialect = queryDialect; + return this; + } + + Builder setQueryProperties(List queryProperties) { + this.queryProperties = queryProperties; + return this; + } + + /** Sets the clustering specification for the destination table. */ + Builder setClustering(Clustering clustering) { + this.clustering = clustering; + return this; + } + + /** + * Sets whether the job is allowed to create tables. + * + * @see + * Create Disposition + */ + Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition) { + this.createDisposition = createDisposition; + return this; + } + + /** + * Sets the custom encryption configuration (e.g., Cloud KMS keys). + * + * @param destinationEncryptionConfiguration destinationEncryptionConfiguration or {@code null} + * for none + */ + Builder setDestinationEncryptionConfiguration( + EncryptionConfiguration destinationEncryptionConfiguration) { + this.destinationEncryptionConfiguration = destinationEncryptionConfiguration; + return this; + } + + Builder setDestinationTable(String destinationTable) { + this.destinationTable = destinationTable; + return this; + } + + Builder setDestinationDataset(String destinationDataset) { + this.destinationDataset = destinationDataset; + return this; + } + + Builder setDestinationDatasetExpirationTime(long destinationDatasetExpirationTime) { + this.destinationDatasetExpirationTime = destinationDatasetExpirationTime; + return this; + } + + /** + * [Optional] Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt + * to terminate the job. + * + * @param jobTimeoutMs jobTimeoutMs or {@code null} for none + */ + Builder setJobTimeoutMs(long jobTimeoutMs) { + this.jobTimeoutMs = jobTimeoutMs; + return this; + } + + /** + * Limits the billing tier for this job. Queries that have resource usage beyond this tier will + * fail (without incurring a charge). If unspecified, this will be set to your project default. + * + * @param maximumBillingTier maximum billing tier for this job + */ + Builder setMaximumBillingTier(int maximumBillingTier) { + this.maximumBillingTier = maximumBillingTier; + return this; + } + + /** + * Sets a priority for the query. If not specified the priority is assumed to be {@link + * Priority#INTERACTIVE}. + */ + Builder setPriority(QueryJobConfiguration.Priority priority) { + this.priority = priority; + return this; + } + + /** + * Range partitioning specification for this table. Only one of timePartitioning and + * rangePartitioning should be specified. + * + * @param rangePartitioning rangePartitioning or {@code null} for none + */ + Builder setRangePartitioning(RangePartitioning rangePartitioning) { + this.rangePartitioning = rangePartitioning; + return this; + } + + /** + * Sets options allowing the schema of the destination table to be updated as a side effect of + * the query job. Schema update options are supported in two cases: when writeDisposition is + * WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a + * partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE + * will always overwrite the schema. + */ + Builder setSchemaUpdateOptions(List schemaUpdateOptions) { + this.schemaUpdateOptions = schemaUpdateOptions; + return this; + } + + /** + * Sets the external tables definitions. If querying external data sources outside BigQuery, + * this value describes the data format, location and other properties of the data sources. By + * defining these properties, the data sources can be queried as if they were standard BigQuery + * tables. + */ + Builder setTableDefinitions(Map tableDefinitions) { + this.tableDefinitions = tableDefinitions; + return this; + } + + /** Sets the time partitioning specification for the destination table. */ + Builder setTimePartitioning(TimePartitioning timePartitioning) { + this.timePartitioning = timePartitioning; + return this; + } + + /** + * Sets user defined function resources that can be used by this query. Function resources can + * either be defined inline ({@link UserDefinedFunction#inline(String)}) or loaded from a Google + * Cloud Storage URI ({@link UserDefinedFunction#fromUri(String)}. + */ + Builder setUserDefinedFunctions(List userDefinedFunctions) { + this.userDefinedFunctions = userDefinedFunctions; + return this; + } + + /** + * Sets the action that should occur if the destination table already exists. + * + * @see + * Write Disposition + */ + Builder setWriteDisposition(JobInfo.WriteDisposition writeDisposition) { + this.writeDisposition = writeDisposition; + return this; + } + + /** + * Sets the number of rows in the buffer (a blocking queue) that query results are consumed + * from. + * + * @param numBufferedRows numBufferedRows or {@code null} for none + */ + Builder setNumBufferedRows(int numBufferedRows) { + this.numBufferedRows = numBufferedRows; + return this; + } + + /** + * Sets the maximum records per page to be used for pagination. This is used as an input for the + * tabledata.list and jobs.getQueryResults RPC calls + * + * @param maxResultPerPage + */ + Builder setMaxResultPerPage(long maxResultPerPage) { + this.maxResultPerPage = maxResultPerPage; + return this; + } + + Builder setDefaultDataset(DatasetId defaultDataset) { + this.defaultDataset = defaultDataset; + return this; + } + + Builder setUseWriteAPI(boolean useWriteAPI) { + this.useWriteAPI = useWriteAPI; + return this; + } + + Builder setWriteAPIActivationRowCount(int writeAPIActivationRowCount) { + this.writeAPIActivationRowCount = writeAPIActivationRowCount; + return this; + } + + Builder setWriteAPIAppendRowCount(int writeAPIAppendRowCount) { + this.writeAPIAppendRowCount = writeAPIAppendRowCount; + return this; + } + + Builder setMaxBytesBilled(long maxBytesBilled) { + this.maxBytesBilled = maxBytesBilled; + return this; + } + + Builder setLabels(Map labels) { + this.labels = labels; + return this; + } + + /** Creates a {@code BigQuerySettings} object. */ + BigQuerySettings build() { + return new BigQuerySettings(this); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySqlTypeConverter.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySqlTypeConverter.java new file mode 100644 index 0000000000..cfdc64a14e --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQuerySqlTypeConverter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; +import com.google.cloud.bigquery.jdbc.BigQueryStatement.SqlType; + +class BigQuerySqlTypeConverter { + + static SqlType getSqlTypeFromStatementType(StatementType statementType) { + switch (statementType.toString()) { + case "SELECT": + return SqlType.SELECT; + + case "INSERT": + case "UPDATE": + case "DELETE": + case "MERGE": + return SqlType.DML; + case "CALL": + return SqlType.DML_EXTRA; + + case "CREATE_TABLE": + case "CREATE_TABLE_AS_SELECT": + case "CREATE_VIEW": + case "CREATE_MODEL": + case "CREATE_MATERIALIZED_VIEW": + case "CREATE_FUNCTION": + case "CREATE_TABLE_FUNCTION": + case "CREATE_PROCEDURE": + case "CREATE_ROW_ACCESS_POLICY": + case "CREATE_SCHEMA": + case "CREATE_SNAPSHOT_TABLE": + case "CREATE_SEARCH_INDEX": + case "DROP_TABLE": + case "DROP_EXTERNAL_TABLE": + case "DROP_VIEW": + case "DROP_MODEL": + case "DROP_MATERIALIZED_VIEW": + case "DROP_FUNCTION": + case "DROP_TABLE_FUNCTION": + case "DROP_PROCEDURE": + case "DROP_SEARCH_INDEX": + case "DROP_SCHEMA": + case "DROP_SNAPSHOT_TABLE": + case "DROP_ROW_ACCESS_POLICY": + case "ALTER_TABLE": + case "ALTER_VIEW": + case "ALTER_MATERIALIZED_VIEW": + case "ALTER_SCHEMA": + case "TRUNCATE_TABLE": + case "CREATE_EXTERNAL_TABLE": + return SqlType.DDL; + case "SCRIPT": + return SqlType.SCRIPT; + case "BEGIN_TRANSACTION": + case "COMMIT_TRANSACTION": + case "ROLLBACK_TRANSACTION": + return SqlType.TCL; + case "EXPORT_DATA": + case "EXPORT_MODEL": + case "LOAD_DATA": + default: + return SqlType.OTHER; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java new file mode 100644 index 0000000000..0da0868880 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -0,0 +1,1522 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import com.google.api.gax.paging.Page; +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQuery.JobListOption; +import com.google.cloud.bigquery.BigQuery.QueryResultsOption; +import com.google.cloud.bigquery.BigQuery.TableDataListOption; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.Dataset; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.DatasetInfo; +import com.google.cloud.bigquery.EncryptionConfiguration; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobConfiguration; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.JobStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; +import com.google.cloud.bigquery.JobStatistics.ScriptStatistics; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableResult; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlSyntaxErrorException; +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; +import com.google.cloud.bigquery.storage.v1.ArrowSchema; +import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.DataFormat; +import com.google.cloud.bigquery.storage.v1.ReadRowsRequest; +import com.google.cloud.bigquery.storage.v1.ReadRowsResponse; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterators; +import java.lang.ref.ReferenceQueue; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLWarning; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.ThreadFactory; +import java.util.logging.Level; + +/** + * An implementation of {@link java.sql.Statement} for executing BigQuery SQL statement and + * returning the results it produces. + * + * @see BigQueryConnection#createStatement + * @see ResultSet + */ +public class BigQueryStatement extends BigQueryNoOpsStatement { + + // TODO (obada): Update this after benchmarking + private static final int MAX_PROCESS_QUERY_THREADS_CNT = 50; + protected static ExecutorService queryTaskExecutor = + Executors.newFixedThreadPool(MAX_PROCESS_QUERY_THREADS_CNT); + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private static final String DEFAULT_DATASET_NAME = "_google_jdbc"; + private static final String DEFAULT_TABLE_NAME = "temp_table_"; + private static final String JDBC_JOB_PREFIX = "google-jdbc-"; + protected ResultSet currentResultSet; + protected long currentUpdateCount = -1; + protected List jobIds = new ArrayList<>(); + protected JobIdWrapper parentJobId = null; + protected int currentJobIdIndex = -1; + protected List batchQueries = new ArrayList<>(); + protected BigQueryConnection connection; + protected int maxFieldSize = 0; + protected int maxRows = 0; + protected boolean isClosed = false; + protected boolean closeOnCompletion = false; + protected Object cancelLock = new Object(); + protected boolean isCanceled = false; + protected boolean poolable; + protected int queryTimeout = 0; + protected SQLWarning warning; + private int fetchDirection = ResultSet.FETCH_FORWARD; + private int fetchSize; + private String scriptQuery; + private Map extraLabels = new HashMap<>(); + + private BigQueryReadClient bigQueryReadClient = null; + private final BigQuery bigQuery; + + final BigQuerySettings querySettings; + + private BlockingQueue bigQueryFieldValueListWrapperBlockingQueue; + + private BlockingQueue arrowBatchWrapperBlockingQueue; + + // Variables Required for the ReferenceQueue implementation + static ReferenceQueue referenceQueueArrowRs = new ReferenceQueue<>(); + static ReferenceQueue referenceQueueJsonRs = new ReferenceQueue<>(); + static List arrowResultSetFinalizers = + new ArrayList<>(); + static List jsonResultSetFinalizers = + new ArrayList<>(); + + private static final ThreadFactory JDBC_THREAD_FACTORY = + new BigQueryThreadFactory("BigQuery-Thread-"); + + static { + BigQueryDaemonPollingTask.startGcDaemonTask( + referenceQueueArrowRs, + referenceQueueJsonRs, + arrowResultSetFinalizers, + jsonResultSetFinalizers); + } + + @VisibleForTesting + public BigQueryStatement(BigQueryConnection connection) { + this.connection = connection; + this.bigQuery = connection.getBigQuery(); + this.querySettings = generateBigQuerySettings(); + } + + private void resetStatementFields() { + this.isCanceled = false; + this.scriptQuery = null; + this.parentJobId = null; + this.currentJobIdIndex = -1; + this.currentUpdateCount = -1; + } + + private BigQuerySettings generateBigQuerySettings() { + LOG.finest("++enter++"); + + BigQuerySettings.Builder querySettings = BigQuerySettings.newBuilder(); + DatasetId defaultDataset = this.connection.getDefaultDataset(); + if (defaultDataset != null) { + querySettings.setDefaultDataset(this.connection.defaultDataset); + } + Long maxBytesBilled = this.connection.getMaxBytesBilled(); + if (maxBytesBilled > 0) { + querySettings.setMaxBytesBilled(maxBytesBilled); + } + if (this.connection.getLabels() != null && !this.connection.getLabels().isEmpty()) { + querySettings.setLabels(this.connection.getLabels()); + } + querySettings.setMaxResultPerPage(this.connection.getMaxResults()); + querySettings.setUseReadAPI(this.connection.isEnableHighThroughputAPI()); + querySettings.setHighThroughputMinTableSize(this.connection.getHighThroughputMinTableSize()); + querySettings.setHighThroughputActivationRatio( + this.connection.getHighThroughputActivationRatio()); + querySettings.setUnsupportedHTAPIFallback(this.connection.isUnsupportedHTAPIFallback()); + querySettings.setUseQueryCache(this.connection.isUseQueryCache()); + querySettings.setQueryDialect(this.connection.getQueryDialect()); + querySettings.setKmsKeyName(this.connection.getKmsKeyName()); + querySettings.setQueryProperties(this.connection.getQueryProperties()); + querySettings.setAllowLargeResults(this.connection.isAllowLargeResults()); + if (this.connection.getJobTimeoutInSeconds() > 0) { + querySettings.setJobTimeoutMs(this.connection.getJobTimeoutInSeconds() * 1000L); + } + if (this.connection.getDestinationTable() != null) { + querySettings.setDestinationTable(this.connection.getDestinationTable()); + } + if (this.connection.getDestinationDataset() != null) { + querySettings.setDestinationDataset(this.connection.getDestinationDataset()); + querySettings.setDestinationDatasetExpirationTime( + this.connection.getDestinationDatasetExpirationTime()); + } + // only create session if enable session and session info is null + if (this.connection.enableSession) { + if (this.connection.sessionInfoConnectionProperty == null) { + querySettings.setEnableSession(this.connection.isSessionEnabled()); + } else { + querySettings.setSessionInfoConnectionProperty( + this.connection.getSessionInfoConnectionProperty()); + } + } + querySettings.setUseWriteAPI(this.connection.isEnableWriteAPI()); + querySettings.setWriteAPIActivationRowCount(this.connection.getWriteAPIActivationRowCount()); + querySettings.setWriteAPIAppendRowCount(this.connection.getWriteAPIAppendRowCount()); + + return querySettings.build(); + } + + /** + * This method executes a BigQuery SQL query, return a single {@code ResultSet} object. + * + *

    Example of running a query: + * + *

    +   *  Connection connection = DriverManager.getConnection(CONNECTION_URL);
    +   *  Statement bigQueryStatement = bigQueryConnection.createStatement();
    +   *  ResultSet result = bigQueryStatement.executeQuery(QUERY);
    +   * 
    + * + * @param sql BigQuery SQL query + * @return {@code ResultSet} containing the output of the query + * @throws SQLException if a BigQuery access error occurs, this method is called on a closed + * {@code Statement}, the given SQL statement produces multiple or no result sets. + * @see java.sql.Statement#executeQuery(String) + */ + @Override + public ResultSet executeQuery(String sql) throws SQLException { + // TODO: write method to return state variables to original state. + LOG.finest("++enter++"); + logQueryExecutionStart(sql); + try { + QueryJobConfiguration jobConfiguration = + setDestinationDatasetAndTableInJobConfig(getJobConfig(sql).build()); + runQuery(sql, jobConfiguration); + } catch (InterruptedException ex) { + throw new BigQueryJdbcException(ex); + } + + if (!isSingularResultSet()) { + throw new BigQueryJdbcException( + "Query returned more than one or didn't return any ResultSet."); + } + // This contains all the other assertions spec required on this method + return getCurrentResultSet(); + } + + @Override + public long executeLargeUpdate(String sql) throws SQLException { + LOG.finest("++enter++"); + logQueryExecutionStart(sql); + try { + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(sql); + runQuery(sql, jobConfiguration.build()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + if (this.currentUpdateCount == -1) { + throw new BigQueryJdbcException( + "Update query expected to return affected row count. Double check query type."); + } + return this.currentUpdateCount; + } + + @Override + public int executeUpdate(String sql) throws SQLException { + LOG.finest("++enter++"); + return checkUpdateCount(executeLargeUpdate(sql)); + } + + int checkUpdateCount(long updateCount) { + LOG.finest("++enter++"); + if (updateCount > Integer.MAX_VALUE) { + LOG.warning("Warning: Table update exceeded maximum limit!"); + // Update count is -2 if update is successful but the update count exceeds Integer.MAX_VALUE + return -2; + } + return (int) updateCount; + } + + @Override + public boolean execute(String sql) throws SQLException { + LOG.finest("++enter++"); + logQueryExecutionStart(sql); + try { + QueryJobConfiguration jobConfiguration = getJobConfig(sql).build(); + // If Large Results are enabled, ensure query type is SELECT + if (isLargeResultsEnabled() && getQueryType(jobConfiguration, null) == SqlType.SELECT) { + jobConfiguration = setDestinationDatasetAndTableInJobConfig(jobConfiguration); + } + runQuery(sql, jobConfiguration); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + return getCurrentResultSet() != null; + } + + StatementType getStatementType(QueryJobConfiguration queryJobConfiguration) throws SQLException { + LOG.finest("++enter++"); + QueryJobConfiguration dryRunJobConfiguration = + queryJobConfiguration.toBuilder().setDryRun(true).build(); + Job job; + try { + job = bigQuery.create(JobInfo.of(dryRunJobConfiguration)); + } catch (BigQueryException ex) { + if (ex.getMessage().contains("Syntax error")) { + throw new BigQueryJdbcSqlSyntaxErrorException(ex); + } + throw new BigQueryJdbcException(ex); + } + QueryStatistics statistics = job.getStatistics(); + return statistics.getStatementType(); + } + + SqlType getQueryType(QueryJobConfiguration jobConfiguration, StatementType statementType) + throws SQLException { + LOG.finest("++enter++"); + if (statementType == null) { + statementType = getStatementType(jobConfiguration); + } + + SqlType sqlType = BigQuerySqlTypeConverter.getSqlTypeFromStatementType(statementType); + LOG.fine( + String.format( + "Query: %s, Statement Type: %s, SQL Type: %s", + jobConfiguration.getQuery(), statementType, sqlType)); + return sqlType; + } + + QueryStatistics getQueryStatistics(QueryJobConfiguration queryJobConfiguration) + throws BigQueryJdbcSqlSyntaxErrorException, BigQueryJdbcException { + LOG.finest("++enter++"); + QueryJobConfiguration dryRunJobConfiguration = + queryJobConfiguration.toBuilder().setDryRun(true).build(); + Job job; + try { + job = this.bigQuery.create(JobInfo.of(dryRunJobConfiguration)); + return job.getStatistics(); + } catch (BigQueryException ex) { + if (ex.getMessage().contains("Syntax error")) { + throw new BigQueryJdbcSqlSyntaxErrorException(ex); + } + throw new BigQueryJdbcException(ex); + } + } + + /** + * Releases this Statement's BigQuery and JDBC resources immediately instead of waiting for this + * to happen when it is automatically closed. These resources include the {@code ResultSet} + * object, batch queries, job IDs, and BigQuery connection
    + * + *

    Calling the method close on a Statement object that is already closed has no effect. + * + * @throws SQLException if a BigQuery access error occurs + */ + @Override + public void close() throws SQLException { + LOG.fine(String.format("Closing Statement %s.", this)); + if (isClosed()) { + return; + } + + boolean cancelSucceeded = false; + try { + cancel(); // This attempts to cancel jobs and calls closeStatementResources() + cancelSucceeded = true; + } catch (SQLException e) { + LOG.warning(String.format("Failed to cancel statement during close().", e)); + } finally { + if (!cancelSucceeded) { + closeStatementResources(); + } + this.connection = null; + this.isClosed = true; + } + } + + @Override + public int getMaxFieldSize() { + return this.maxFieldSize; + } + + @Override + public void setMaxFieldSize(int max) { + this.maxFieldSize = max; + } + + @Override + public int getMaxRows() { + return this.maxRows; + } + + @Override + public void setMaxRows(int max) { + this.maxRows = max; + } + + @Override + public void setEscapeProcessing(boolean enable) { + // TODO: verify how to implement this method + } + + @Override + public int getQueryTimeout() { + return this.queryTimeout; + } + + @Override + public void setQueryTimeout(int seconds) { + if (seconds < 0) { + throw new IllegalArgumentException("Query Timeout should be >= 0."); + } + this.queryTimeout = seconds; + } + + /** + * Cancels this {@code Statement} object, the running threads, and BigQuery jobs. + * + * @throws SQLException if a BigQuery access error occurs or this method is called on a closed + * {@code Statement} + */ + @Override + public void cancel() throws SQLException { + LOG.finest(String.format("Statement %s cancelled", this)); + synchronized (cancelLock) { + this.isCanceled = true; + for (JobId jobId : this.jobIds) { + try { + this.bigQuery.cancel(jobId); + LOG.info("Job " + jobId + "cancelled."); + } catch (BigQueryException e) { + if (e.getMessage() != null + && (e.getMessage().contains("Job is already in state DONE") + || e.getMessage().contains("Error: 3848323"))) { + LOG.warning("Attempted to cancel a job that was already done: " + jobId); + } else { + throw new BigQueryJdbcException(e); + } + } + } + jobIds.clear(); + } + // If a ResultSet exists, then it will be closed as well, closing the + // ownedThreads + closeStatementResources(); + } + + @Override + public SQLWarning getWarnings() { + return this.warning; + } + + @Override + public void clearWarnings() { + this.warning = null; + } + + @Override + public ResultSet getResultSet() { + return this.currentResultSet; + } + + @VisibleForTesting + void setUpdateCount(long count) { + this.currentUpdateCount = count; + } + + @Override + public int getUpdateCount() { + return (int) this.currentUpdateCount; + } + + @Override + public long getLargeUpdateCount() { + return this.currentUpdateCount; + } + + @Override + public boolean getMoreResults() throws SQLException { + return getMoreResults(CLOSE_CURRENT_RESULT); + } + + private void closeStatementResources() throws SQLException { + LOG.finest("++enter++"); + if (this.currentResultSet != null) { + // If Statement has 'CloseOnCompletion' set, resultset might + // call into the same function; In order to avoid stack overflow + // we will cleanup resultset before calling into 'close'. + ResultSet tmp = this.currentResultSet; + this.currentResultSet = null; + tmp.close(); + } + this.batchQueries.clear(); + this.currentUpdateCount = -1; + this.currentJobIdIndex = -1; + if (this.connection != null) { + if (this.connection.isTransactionStarted()) { + this.connection.rollback(); + } + this.connection.removeStatement(this); + } + } + + private boolean isSingularResultSet() { + return this.currentResultSet != null + && (this.parentJobId == null || this.parentJobId.getJobs().size() == 1); + } + + private String generateJobId() { + return JDBC_JOB_PREFIX + UUID.randomUUID().toString(); + } + + private class ExecuteResult { + public final TableResult tableResult; + public final Job job; + + ExecuteResult(TableResult tableResult, Job job) { + this.tableResult = tableResult; + this.job = job; + } + } + + @InternalApi + ExecuteResult executeJob(QueryJobConfiguration jobConfiguration) + throws InterruptedException, BigQueryException, BigQueryJdbcException { + LOG.finest("++enter++"); + Job job = null; + // Location is not properly passed from the connection, + // so we need to explicitly set it; + // Do not set custom JobId here or it will disable jobless queries. + JobId jobId = JobId.newBuilder().setLocation(connection.getLocation()).build(); + if (connection.getUseStatelessQueryMode()) { + Object result = bigQuery.queryWithTimeout(jobConfiguration, jobId, null); + if (result instanceof TableResult) { + TableResult tableResult = (TableResult) result; + if (tableResult.getJobId() != null) { + return new ExecuteResult(tableResult, bigQuery.getJob(tableResult.getJobId())); + } + return new ExecuteResult((TableResult) result, null); + } + + if (result instanceof Job) { + job = (Job) result; + } else { + throw new BigQueryJdbcException("Unexpected result type from queryWithTimeout"); + } + } else { + // Update jobId with custom JobId if jobless query is disabled. + jobId = jobId.toBuilder().setJob(generateJobId()).build(); + JobInfo jobInfo = JobInfo.newBuilder(jobConfiguration).setJobId(jobId).build(); + job = bigQuery.create(jobInfo); + } + + if (job == null) { + throw new BigQueryJdbcException("Failed to create BQ Job."); + } + synchronized (cancelLock) { + if (isCanceled) { + job.cancel(); + throw new BigQueryJdbcException("Query was cancelled."); + } + jobId = job.getJobId(); + jobIds.add(jobId); + } + LOG.info("Query submitted with Job ID: " + job.getJobId().getJob()); + TableResult result = + job.getQueryResults(QueryResultsOption.pageSize(querySettings.getMaxResultPerPage())); + synchronized (cancelLock) { + jobIds.remove(jobId); + } + return new ExecuteResult(result, job); + } + + /** + * Execute the SQL script and sets the reference of the underlying job, passing null querySettings + * will result in the FastQueryPath + */ + @InternalApi + void runQuery(String query, QueryJobConfiguration jobConfiguration) + throws SQLException, InterruptedException { + LOG.finest("++enter++"); + LOG.fine("Run Query started"); + + if (queryTimeout > 0) { + jobConfiguration = + jobConfiguration.toBuilder().setJobTimeoutMs(Long.valueOf(queryTimeout) * 1000).build(); + } + + try { + resetStatementFields(); + ExecuteResult executeResult = executeJob(jobConfiguration); + StatementType statementType = + executeResult.job == null + ? getStatementType(jobConfiguration) + : ((QueryStatistics) executeResult.job.getStatistics()).getStatementType(); + SqlType queryType = getQueryType(jobConfiguration, statementType); + handleQueryResult(query, executeResult.tableResult, queryType); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } catch (BigQueryException ex) { + if (ex.getMessage().contains("Syntax error")) { + throw new BigQueryJdbcSqlSyntaxErrorException(ex); + } + throw new BigQueryJdbcException(ex); + } + } + + private boolean isLargeResultsEnabled() { + String destinationTable = this.querySettings.getDestinationTable(); + String destinationDataset = this.querySettings.getDestinationDataset(); + return destinationDataset != null || destinationTable != null; + } + + private QueryJobConfiguration setDestinationDatasetAndTableInJobConfig( + QueryJobConfiguration jobConfiguration) { + String destinationTable = this.querySettings.getDestinationTable(); + String destinationDataset = this.querySettings.getDestinationDataset(); + if (destinationDataset != null || destinationTable != null) { + if (destinationDataset != null) { + checkIfDatasetExistElseCreate(destinationDataset); + } + if (jobConfiguration.useLegacySql() && destinationDataset == null) { + checkIfDatasetExistElseCreate(DEFAULT_DATASET_NAME); + destinationDataset = DEFAULT_DATASET_NAME; + } + if (destinationTable == null) { + destinationTable = getDefaultDestinationTable(); + } + return jobConfiguration.toBuilder() + .setAllowLargeResults(this.querySettings.getAllowLargeResults()) + .setDestinationTable(TableId.of(destinationDataset, destinationTable)) + .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) + .setWriteDisposition(JobInfo.WriteDisposition.WRITE_TRUNCATE) + .build(); + } + return jobConfiguration; + } + + Job getNextJob() { + while (this.currentJobIdIndex + 1 < this.parentJobId.getJobs().size()) { + this.currentJobIdIndex += 1; + Job currentJob = this.parentJobId.getJobs().get(this.currentJobIdIndex); + QueryStatistics queryStatistics = currentJob.getStatistics(); + ScriptStatistics scriptStatistics = queryStatistics.getScriptStatistics(); + // EXPRESSION jobs are not relevant for customer query and can be + // created by BQ depending on various conditions. We will just ignore + // them when presenting results. + if (!"expression".equalsIgnoreCase(scriptStatistics.getEvaluationKind())) { + return currentJob; + } + } + return null; + } + + void handleQueryResult(String query, TableResult results, SqlType queryType) + throws SQLException, InterruptedException { + LOG.finest("++enter++"); + switch (queryType) { + case SELECT: + processQueryResponse(query, results); + break; + case DML: + case DML_EXTRA: + try { + Job completedJob = this.bigQuery.getJob(results.getJobId()).waitFor(); + JobStatistics.QueryStatistics statistics = completedJob.getStatistics(); + updateAffectedRowCount(statistics.getNumDmlAffectedRows()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } catch (NullPointerException ex) { + throw new BigQueryJdbcException(ex); + } + break; + case TCL: + case DDL: + updateAffectedRowCount(results.getTotalRows()); + break; + case SCRIPT: + try { + Page childJobs = + this.bigQuery.listJobs(JobListOption.parentJobId(results.getJobId().getJob())); + + ArrayList childJobList = new ArrayList<>(); + Iterator iterableJobs = childJobs.iterateAll().iterator(); + iterableJobs.forEachRemaining(childJobList::add); + Collections.reverse(childJobList); + + this.scriptQuery = query; + this.parentJobId = new JobIdWrapper(results.getJobId(), results, childJobList); + this.currentJobIdIndex = -1; + + Job currentJob = getNextJob(); + if (currentJob == null) { + return; + } + StatementType statementType = + ((QueryStatistics) (currentJob.getStatistics())).getStatementType(); + SqlType sqlType = getQueryType(currentJob.getConfiguration(), statementType); + handleQueryResult(query, currentJob.getQueryResults(), sqlType); + } catch (NullPointerException ex) { + throw new BigQueryJdbcException(ex); + } + break; + case OTHER: + throw new BigQueryJdbcException(String.format("Unexpected value: " + queryType)); + } + } + + private void updateAffectedRowCount(Long count) throws SQLException { + // TODO(neenu): check if this need to be closed vs removed) + if (this.currentResultSet != null) { + try { + this.currentResultSet.close(); + this.currentResultSet = null; + } catch (SQLException ex) { + throw new BigQueryJdbcException(ex); + } + } + this.currentUpdateCount = count; + } + + @InternalApi + BigQueryReadClient getBigQueryReadClient() { + if (this.bigQueryReadClient == null) { + this.bigQueryReadClient = this.connection.getBigQueryReadClient(); + } + return this.bigQueryReadClient; + } + + @InternalApi + ReadSession getReadSession(CreateReadSessionRequest readSessionRequest) { + LOG.finest("++enter++"); + return getBigQueryReadClient().createReadSession(readSessionRequest); + } + + @InternalApi + ArrowSchema getArrowSchema(ReadSession readSession) { + return readSession.getArrowSchema(); + } + + /** Uses Bigquery Storage Read API and returns the stream as ResultSet */ + @InternalApi + ResultSet processArrowResultSet(TableResult results) throws SQLException { + LOG.finest("++enter++"); + + // set the resultset + long totalRows = (getMaxRows() > 0) ? getMaxRows() : results.getTotalRows(); + JobId currentJobId = results.getJobId(); + TableId destinationTable = getDestinationTable(currentJobId); + Schema schema = results.getSchema(); + try { + String parent = String.format("projects/%s", destinationTable.getProject()); + String srcTable = + String.format( + "projects/%s/datasets/%s/tables/%s", + destinationTable.getProject(), + destinationTable.getDataset(), + destinationTable.getTable()); + + // Read all the columns if the source table (temp table) and stream the data back in Arrow + // format + ReadSession.Builder sessionBuilder = + ReadSession.newBuilder().setTable(srcTable).setDataFormat(DataFormat.ARROW); + + CreateReadSessionRequest.Builder builder = + CreateReadSessionRequest.newBuilder() + .setParent(parent) + .setReadSession(sessionBuilder) + .setMaxStreamCount(1); + + ReadSession readSession = getReadSession(builder.build()); + this.arrowBatchWrapperBlockingQueue = new LinkedBlockingDeque<>(getBufferSize()); + // deserialize and populate the buffer async, so that the client isn't blocked + Thread populateBufferWorker = + populateArrowBufferedQueue( + readSession, this.arrowBatchWrapperBlockingQueue, this.bigQueryReadClient); + + BigQueryArrowResultSet arrowResultSet = + BigQueryArrowResultSet.of( + schema, + getArrowSchema(readSession), + totalRows, + this, + this.arrowBatchWrapperBlockingQueue, + populateBufferWorker, + this.bigQuery); + arrowResultSetFinalizers.add( + new BigQueryResultSetFinalizers.ArrowResultSetFinalizer( + arrowResultSet, referenceQueueArrowRs, populateBufferWorker)); + arrowResultSet.setJobId(currentJobId); + return arrowResultSet; + + } catch (Exception ex) { + throw new BigQueryJdbcException(ex.getMessage(), ex); + } + } + + /** Asynchronously reads results and populates an arrow record queue */ + @InternalApi + Thread populateArrowBufferedQueue( + ReadSession readSession, + BlockingQueue arrowBatchWrapperBlockingQueue, + BigQueryReadClient bqReadClient) { + LOG.finest("++enter++"); + + Runnable arrowStreamProcessor = + () -> { + try { + // Use the first stream to perform reading. + String streamName = readSession.getStreams(0).getName(); + ReadRowsRequest readRowsRequest = + ReadRowsRequest.newBuilder().setReadStream(streamName).build(); + + // Process each block of rows as they arrive and decode using our simple row reader. + com.google.api.gax.rpc.ServerStream stream = + bqReadClient.readRowsCallable().call(readRowsRequest); + for (ReadRowsResponse response : stream) { + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown()) { // do not process and shutdown + break; + } + + ArrowRecordBatch currentBatch = response.getArrowRecordBatch(); + arrowBatchWrapperBlockingQueue.put(BigQueryArrowBatchWrapper.of(currentBatch)); + } + + } catch (RuntimeException | InterruptedException e) { + LOG.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ arrowStreamProcessor", + e); + } finally { // logic needed for graceful shutdown + // marking end of stream + try { + arrowBatchWrapperBlockingQueue.put( + BigQueryArrowBatchWrapper.of(null, true)); // mark the end of the stream + } catch (InterruptedException e) { + LOG.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ markLast", + e); + } + } + }; + + Thread populateBufferWorker = JDBC_THREAD_FACTORY.newThread(arrowStreamProcessor); + populateBufferWorker.start(); + return populateBufferWorker; + } + + /** Executes SQL query using either fast query path or read API */ + void processQueryResponse(String query, TableResult results) throws SQLException { + LOG.finest( + String.format( + "API call completed{Query=%s, Parent Job ID=%s, Total rows=%s} ", + query, results.getJobId(), results.getTotalRows())); + JobId currentJobId = results.getJobId(); + if (currentJobId == null) { + LOG.fine("Standard API with Stateless query used."); + this.currentResultSet = processJsonResultSet(results); + } else if (useReadAPI(results)) { + LOG.fine("HighThroughputAPI used."); + LOG.info("HTAPI job ID: " + currentJobId.getJob()); + this.currentResultSet = processArrowResultSet(results); + } else { + // read API cannot be used. + LOG.fine("Standard API used."); + this.currentResultSet = processJsonResultSet(results); + } + this.currentUpdateCount = -1; + } + + // The read Ratio should be met + // AND the User must not have disabled the Read API + @VisibleForTesting + boolean useReadAPI(TableResult results) throws BigQueryJdbcSqlFeatureNotSupportedException { + LOG.finest("++enter++"); + if (!meetsReadRatio(results)) { + return false; + } + LOG.fine("Read API threshold is met."); + return querySettings.getUseReadAPI(); + } + + private boolean meetsReadRatio(TableResult results) { + LOG.finest("++enter++"); + long totalRows = results.getTotalRows(); + + if (totalRows == 0 || totalRows < querySettings.getHighThroughputMinTableSize()) { + return false; + } + + // TODO(BQ Team): TableResult doesnt expose the number of records in the current page, hence the + // below log iterates and counts. This is inefficient and we may eventually want to expose + // PageSize with TableResults + // TODO(Obada): Scope for performance optimization. + int pageSize = Iterators.size(results.getValues().iterator()); + return totalRows / pageSize > querySettings.getHighThroughputActivationRatio(); + } + + BigQueryJsonResultSet processJsonResultSet(TableResult results) { + String jobIdOrQueryId = + results.getJobId() == null ? results.getQueryId() : results.getJobId().getJob(); + LOG.info(String.format("BigQuery Job %s completed. Fetching results.", jobIdOrQueryId)); + List threadList = new ArrayList(); + + Schema schema = results.getSchema(); + long totalRows = (getMaxRows() > 0) ? getMaxRows() : results.getTotalRows(); + this.bigQueryFieldValueListWrapperBlockingQueue = new LinkedBlockingDeque<>(getBufferSize()); + BlockingQueue> rpcResponseQueue = + new LinkedBlockingDeque<>(getPageCacheSize(getBufferSize(), schema)); + + JobId jobId = results.getJobId(); + if (jobId != null) { + // Thread to make rpc calls to fetch data from the server + Thread nextPageWorker = + runNextPageTaskAsync(results, results.getNextPageToken(), jobId, rpcResponseQueue); + threadList.add(nextPageWorker); + } else { + try { + populateFirstPage(results, rpcResponseQueue); + rpcResponseQueue.put(Tuple.of(null, false)); + } catch (InterruptedException e) { + LOG.log( + Level.WARNING, + "\n" + + Thread.currentThread().getName() + + " Interrupted @ processJsonQueryResponseResults"); + } + } + + // Thread to parse data received from the server to client library objects + Thread populateBufferWorker = + parseAndPopulateRpcDataAsync( + schema, this.bigQueryFieldValueListWrapperBlockingQueue, rpcResponseQueue); + threadList.add(populateBufferWorker); + + Thread[] jsonWorkers = threadList.toArray(new Thread[0]); + + BigQueryJsonResultSet jsonResultSet = + BigQueryJsonResultSet.of( + schema, + totalRows, + this.bigQueryFieldValueListWrapperBlockingQueue, + this, + jsonWorkers, + this.bigQuery); + jsonResultSet.setJobId(jobId); + jsonResultSet.setQueryId(results.getQueryId()); + jsonResultSetFinalizers.add( + new BigQueryResultSetFinalizers.JsonResultSetFinalizer( + jsonResultSet, referenceQueueJsonRs, jsonWorkers)); + return jsonResultSet; + } + + void populateFirstPage( + TableResult result, BlockingQueue> rpcResponseQueue) { + LOG.finest("++enter++"); + // parse and put the first page in the pageCache before the other pages are parsed from the RPC + // calls + try { + // this is the first page which we have received. + rpcResponseQueue.put(Tuple.of(result, true)); + } catch (InterruptedException e) { + LOG.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ populateFirstPage"); + } + } + + @Override + public void setFetchDirection(int direction) throws SQLException { + if (direction != ResultSet.FETCH_FORWARD) { + throw new BigQueryJdbcSqlFeatureNotSupportedException("Only FETCH_FORWARD is supported."); + } + this.fetchDirection = direction; + } + + @VisibleForTesting + Thread runNextPageTaskAsync( + TableResult result, + String firstPageToken, + JobId jobId, + BlockingQueue> rpcResponseQueue) { + LOG.finest("++enter++"); + // parse and put the first page in the pageCache before the other pages are parsed from the RPC + // calls + populateFirstPage(result, rpcResponseQueue); + + // This thread makes the RPC calls and paginates + Runnable nextPageTask = + () -> { + // results.getPageToken(); + String pageToken = firstPageToken; + TableId destinationTable = null; + if (firstPageToken != null) { + destinationTable = getDestinationTable(jobId); + } + try { + // paginate for non null token + while (pageToken != null) { + // do not process further pages and shutdown + if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { + LOG.log( + Level.WARNING, + "\n" + + Thread.currentThread().getName() + + " Interrupted @ runNextPageTaskAsync"); + break; + } + long startTime = System.nanoTime(); + TableResult results = + this.bigQuery.listTableData( + destinationTable, + TableDataListOption.pageSize(querySettings.getMaxResultPerPage()), + TableDataListOption.pageToken(pageToken)); + + pageToken = results.getNextPageToken(); + // this will be parsed asynchronously without blocking the current + // thread + rpcResponseQueue.put(Tuple.of(results, true)); + LOG.fine( + String.format( + "Fetched %d results from the server in %d ms.", + querySettings.getMaxResultPerPage(), + (int) ((System.nanoTime() - startTime) / 1000000))); + } + // this will stop the parseDataTask as well when the pagination + // completes + rpcResponseQueue.put(Tuple.of(null, false)); + } catch (Exception ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + // We cannot do queryTaskExecutor.shutdownNow() here as populate buffer method may not + // have finished processing the records and even that will be interrupted + }; + + Thread nextPageWorker = JDBC_THREAD_FACTORY.newThread(nextPageTask); + nextPageWorker.start(); + return nextPageWorker; + } + + /** + * Takes TableResult from rpcResponseQueue and populates + * bigQueryFieldValueListWrapperBlockingQueue with FieldValueList + */ + @VisibleForTesting + Thread parseAndPopulateRpcDataAsync( + Schema schema, + BlockingQueue bigQueryFieldValueListWrapperBlockingQueue, + BlockingQueue> rpcResponseQueue) { + LOG.finest("++enter++"); + + Runnable populateBufferRunnable = + () -> { // producer thread populating the buffer + Iterable fieldValueLists; + // as we have to process the first page + boolean hasRows = true; + while (hasRows) { + try { + Tuple nextPageTuple = rpcResponseQueue.take(); + if (nextPageTuple.x() != null) { + fieldValueLists = nextPageTuple.x().getValues(); + } else { + fieldValueLists = null; + } + hasRows = nextPageTuple.y(); + + } catch (InterruptedException e) { + LOG.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); + // Thread might get interrupted while calling the Cancel method, which is + // expected, so logging this instead of throwing the exception back + break; + } + + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown() + || fieldValueLists == null) { + // do not process further pages and shutdown (outerloop) + break; + } + + long startTime = System.nanoTime(); + long results = 0; + for (FieldValueList fieldValueList : fieldValueLists) { + try { + if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { + // do not process further pages and shutdown (inner loop) + break; + } + bigQueryFieldValueListWrapperBlockingQueue.put( + BigQueryFieldValueListWrapper.of(schema.getFields(), fieldValueList)); + results += 1; + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } + LOG.fine( + String.format( + "Processed %d results in %d ms.", + results, (int) ((System.nanoTime() - startTime) / 1000000))); + } + try { + // All the pages has been processed, put this marker + bigQueryFieldValueListWrapperBlockingQueue.put( + BigQueryFieldValueListWrapper.of(null, null, true)); + } catch (InterruptedException e) { + LOG.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Interrupted @ populateBufferAsync", + e); + } + }; + + Thread populateBufferWorker = JDBC_THREAD_FACTORY.newThread(populateBufferRunnable); + populateBufferWorker.start(); + return populateBufferWorker; + } + + /** + * Helper method that determines the optimal number of caches pages to improve read performance + */ + @VisibleForTesting + int getPageCacheSize(Integer numBufferedRows, Schema schema) { + LOG.finest("++enter++"); + // Min number of pages to cache + final int MIN_CACHE_SIZE = 3; + // Min number of pages to cache + final int MAX_CACHE_SIZE = 20; + int numColumns = schema.getFields().size(); + int numCachedPages; + long numCachedRows = numBufferedRows == null ? 0 : numBufferedRows.longValue(); + + // TODO: Further enhance this logic depending on customer feedback on memory consumption + if (numCachedRows > 10000) { + // the size of numBufferedRows is quite large and as per our tests we should be able to + // do enough even with low + numCachedPages = 2; + } + // too many fields are being read, setting the page size on the lower end + else if (numColumns > 15 && numCachedRows > 5000) { + numCachedPages = 3; + } + // low pagesize with fewer number of columns, we can cache more pages + else if (numCachedRows < 2000 && numColumns < 15) { + numCachedPages = 20; + } + // default - under 10K numCachedRows with any number of columns + else { + numCachedPages = 5; + } + return numCachedPages < MIN_CACHE_SIZE + ? MIN_CACHE_SIZE + : (Math.min(numCachedPages, MAX_CACHE_SIZE)); + } + + @Override + public int getFetchDirection() { + return this.fetchDirection; + } + + // TODO(neenu): Fix this value + // getNumBufferedRows in querySettings is always the same withDefaultValues - 20000 buffer size + // So, getBufferSize is also 20000. + private int getBufferSize() { + return (this.querySettings == null + || this.querySettings.getNumBufferedRows() == null + || this.querySettings.getNumBufferedRows() < 10000 + ? 20000 + : Math.min(this.querySettings.getNumBufferedRows() * 2, 100000)); + } + + /** Returns the destinationTable from jobId by calling `jobs.get` API */ + TableId getDestinationTable(JobId jobId) { + Job job = this.bigQuery.getJob(jobId); + LOG.finest(String.format("Destination Table retrieved from %s", job.getJobId())); + return ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable(); + } + + QueryJobConfiguration.Builder getJobConfig(String query) { + LOG.finest("++enter++"); + QueryJobConfiguration.Builder queryConfigBuilder = QueryJobConfiguration.newBuilder(query); + if (this.querySettings.getJobTimeoutMs() > 0) { + queryConfigBuilder.setJobTimeoutMs(this.querySettings.getJobTimeoutMs()); + } + if (this.querySettings.getMaxBytesBilled() > 0) { + queryConfigBuilder.setMaximumBytesBilled(this.querySettings.getMaxBytesBilled()); + } + if (this.querySettings.getDefaultDataset() != null) { + queryConfigBuilder.setDefaultDataset(this.querySettings.getDefaultDataset()); + } + Map mergedLabels = new HashMap<>(); + if (this.querySettings.getLabels() != null) { + mergedLabels.putAll(this.querySettings.getLabels()); + } + if (this.extraLabels != null) { + mergedLabels.putAll(this.extraLabels); + } + queryConfigBuilder.setLabels(mergedLabels); + queryConfigBuilder.setUseQueryCache(this.querySettings.getUseQueryCache()); + queryConfigBuilder.setMaxResults(this.querySettings.getMaxResultPerPage()); + if (this.querySettings.getSessionInfoConnectionProperty() != null) { + queryConfigBuilder.setConnectionProperties( + ImmutableList.of(this.querySettings.getSessionInfoConnectionProperty())); + } else { + queryConfigBuilder.setCreateSession(querySettings.isEnableSession()); + } + if (this.querySettings.getKmsKeyName() != null) { + EncryptionConfiguration encryption = + EncryptionConfiguration.newBuilder() + .setKmsKeyName(this.querySettings.getKmsKeyName()) + .build(); + queryConfigBuilder.setDestinationEncryptionConfiguration(encryption); + } + if (this.querySettings.getQueryProperties() != null) { + queryConfigBuilder.setConnectionProperties(this.querySettings.getQueryProperties()); + } + boolean useLegacy = + QueryDialectType.BIG_QUERY.equals( + QueryDialectType.valueOf(this.querySettings.getQueryDialect())); + queryConfigBuilder.setUseLegacySql(useLegacy); + + return queryConfigBuilder; + } + + private void checkIfDatasetExistElseCreate(String datasetName) { + Dataset dataset = bigQuery.getDataset(DatasetId.of(datasetName)); + if (dataset == null) { + LOG.info(String.format("Creating a hidden dataset: %s ", datasetName)); + DatasetInfo datasetInfo = + DatasetInfo.newBuilder(datasetName) + .setDefaultTableLifetime(this.querySettings.getDestinationDatasetExpirationTime()) + .build(); + bigQuery.create(datasetInfo); + } + } + + private String getDefaultDestinationTable() { + String timeOfCreation = String.valueOf(Instant.now().toEpochMilli()); + String randomizedId = String.valueOf(new Random().nextInt(9999)); + return DEFAULT_TABLE_NAME + timeOfCreation + randomizedId; + } + + @InternalApi + JobIdWrapper insertJob(JobConfiguration jobConfiguration) throws SQLException { + Job job; + JobInfo jobInfo = JobInfo.of(jobConfiguration); + LOG.finest("++enter++"); + try { + job = this.bigQuery.create(jobInfo); + } catch (BigQueryException ex) { + throw new BigQueryJdbcException(ex); + } + return new JobIdWrapper(job.getJobId(), null, null); + } + + @Override + public void setFetchSize(int rows) { + this.fetchSize = rows; + } + + @Override + public int getFetchSize() { + return this.fetchSize; + } + + /** + * Gets the extra labels for this statement. + * + * @return A map of the extra labels. + */ + public Map getExtraLabels() { + return this.extraLabels; + } + + /** + * Sets the extra labels for this statement. + * + * @param extraLabels A map of the extra labels. + */ + public void setExtraLabels(Map extraLabels) { + this.extraLabels = extraLabels; + } + + @Override + public int getResultSetConcurrency() { + return ResultSet.CONCUR_READ_ONLY; + } + + ResultSet getCurrentResultSet() { + return this.currentResultSet; + } + + @Override + public int getResultSetType() { + return ResultSet.TYPE_FORWARD_ONLY; + } + + /** + * Wraps jobId and the firstPage of QueryResponse, so that we can avoid RPC to fetch the first + * page again + */ + static class JobIdWrapper { + + private JobId jobId; + private TableResult firstPage; + private ArrayList jobs; + + public JobIdWrapper(JobId jobId, TableResult firstPage, ArrayList jobs) { + this.jobId = jobId; + this.firstPage = firstPage; + this.jobs = jobs; + } + + JobId getJobId() { + return this.jobId; + } + + void setJobId(JobId jobId) { + this.jobId = jobId; + } + + TableResult getResults() { + return this.firstPage; + } + + void setResults(TableResult firstPage) { + this.firstPage = firstPage; + } + + ArrayList getJobs() { + return jobs; + } + + void setJobs(ArrayList jobs) { + this.jobs = jobs; + } + } + + @Override + public void addBatch(String sql) throws SQLException { + if (sql == null || sql.isEmpty()) { + return; + } + LOG.finest("++enter++"); + sql = sql.trim(); + if (!sql.endsWith(";")) { + sql += "; "; + } + SqlType sqlType = getQueryType(QueryJobConfiguration.newBuilder(sql).build(), null); + if (!SqlType.DML.equals(sqlType)) { + throw new IllegalArgumentException("addBatch currently supports DML operations."); + } + this.batchQueries.add(sql); + } + + @Override + public void clearBatch() { + this.batchQueries.clear(); + } + + @Override + public int[] executeBatch() throws SQLException { + LOG.finest("++enter++"); + int[] result = new int[this.batchQueries.size()]; + if (this.batchQueries.isEmpty()) { + return result; + } + + try { + String combinedQueries = String.join("", this.batchQueries); + QueryJobConfiguration.Builder jobConfiguration = getJobConfig(combinedQueries); + jobConfiguration.setPriority(QueryJobConfiguration.Priority.BATCH); + runQuery(combinedQueries, jobConfiguration.build()); + } catch (InterruptedException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + + int i = 0; + while (getUpdateCount() != -1 && i < this.batchQueries.size()) { + result[i] = getUpdateCount(); + getMoreResults(); + i++; + } + + clearBatch(); + return result; + } + + @Override + public Connection getConnection() { + return this.connection; + } + + public boolean hasMoreResults() { + if (this.parentJobId == null) { + return false; + } + return this.currentJobIdIndex + 1 < this.parentJobId.getJobs().size(); + } + + @Override + public boolean getMoreResults(int current) throws SQLException { + LOG.finest("++enter++"); + checkClosed(); + if (current != CLOSE_CURRENT_RESULT) { + throw new BigQueryJdbcSqlFeatureNotSupportedException( + "The JDBC driver only supports Statement.CLOSE_CURRENT_RESULT."); + } + + if (this.parentJobId == null) { + return false; + } + + try { + if (this.currentResultSet != null) { + this.currentResultSet.close(); + this.currentResultSet = null; + // Statement can be closed if it was the last result + if (isClosed) { + return false; + } + } + + Job currentJob = getNextJob(); + if (currentJob != null) { + StatementType statementType = + ((QueryStatistics) (currentJob.getStatistics())).getStatementType(); + SqlType sqlType = getQueryType(currentJob.getConfiguration(), statementType); + handleQueryResult(this.scriptQuery, currentJob.getQueryResults(), sqlType); + + return sqlType == SqlType.SELECT; + } else { + resetStatementFields(); + return false; + } + } catch (InterruptedException | SQLException ex) { + throw new BigQueryJdbcRuntimeException(ex); + } + } + + @Override + public boolean isWrapperFor(Class iface) { + return iface.isInstance(this); + } + + @Override + public T unwrap(Class iface) throws SQLException { + if (!isWrapperFor(iface)) { + throw new BigQueryJdbcException( + String.format("Unable to cast Statement to %s class.", iface.getName())); + } + return (T) this; + } + + @Override + public int getResultSetHoldability() { + return ResultSet.CLOSE_CURSORS_AT_COMMIT; + } + + @Override + public boolean isClosed() { + return this.isClosed; + } + + @Override + public void setPoolable(boolean poolable) { + this.poolable = poolable; + } + + @Override + public boolean isPoolable() { + return this.poolable; + } + + @Override + public void closeOnCompletion() { + this.closeOnCompletion = true; + } + + @Override + public boolean isCloseOnCompletion() { + return this.closeOnCompletion; + } + + protected void logQueryExecutionStart(String sql) { + if (sql == null) { + return; + } + String sanitizedSql = sql.trim().replaceAll("\\s+", " "); + String truncatedSql = + sanitizedSql.length() > 256 ? sanitizedSql.substring(0, 256) + "..." : sanitizedSql; + LOG.info("Executing query: " + truncatedSql); + LOG.info("Using query settings: " + this.querySettings.toString()); + } + + /** Throws a {@link BigQueryJdbcException} if this object is closed */ + void checkClosed() throws SQLException { + if (isClosed()) { + throw new BigQueryJdbcException("This " + getClass().getName() + " has been closed"); + } + } + + enum SqlType { + SELECT, + DML, + DML_EXTRA, + DDL, + SCRIPT, + TCL, + OTHER + } + + enum QueryDialectType { + SQL, + BIG_QUERY + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java new file mode 100644 index 0000000000..a5aa7a73a5 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import java.util.concurrent.ThreadFactory; + +@InternalApi +class BigQueryThreadFactory implements ThreadFactory { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryThreadFactory.class.getName()); + private String threadPrefix; + private int threadSerialNum = 0; + + public BigQueryThreadFactory(String threadPrefix) { + this.threadPrefix = threadPrefix; + } + + public BigQueryThreadFactory() { + this.threadPrefix = "DEFAULT_POOL_"; + } + + @Override + public Thread newThread(Runnable r) { + Thread t = new Thread(r, threadPrefix + (++threadSerialNum)); // non thread safe increment + t.setDaemon(true); + LOG.finest(String.format("New thread %s created.", t.getName())); + return t; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java new file mode 100644 index 0000000000..d156c2d662 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java @@ -0,0 +1,149 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionException; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionNotFoundException; +import java.util.Map; + +/** + * Provides a declarative mechanism for coercing an object from one type to another. For example, + * coercion of {@link String} to {@link Integer} can be achieved like this: + * + *

    + *   Integer value = BigQueryTypeCoercer.INSTANCE.coerceTo(Integer.class, "3452148");
    + *   System.out.println(value); // 3452148
    + * 
    + * + * A {@link BigQueryTypeCoercer} is baked with all the default {@link BigQueryCoercion}s from {@link + * BigQueryDefaultCoercions} to coerce all the primitive types. + * + *

    It is also possible to extend the behaviour of {@link BigQueryTypeCoercer} to other custom + * user defined types by creating an implementation of {@link BigQueryCoercion} and register it with + * {@link BigQueryTypeCoercerBuilder} using it's {@link + * BigQueryTypeCoercerBuilder#registerTypeCoercion(BigQueryCoercion)} method. + * + *

    + *   public class TextToStringCoercion extends BigQueryBigQueryCoercion{
    + *
    + *    public TextToStringCoercion() {
    + *       super(Text.class, String.class);
    + *    }
    + *
    + *    @Override
    + *    String coerce(Text text) {
    + *       return text.toString();  // logic to coerce from Text type to String type
    + *    }
    + *  }
    + * 
    + * + * and use it like this + * + *
    + *    byte[] bytesArray = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33};
    + *    Text text = new Text(bytesArray);
    + *
    + *    BigQueryTypeCoercer typeCoercer = new BigQueryTypeCoercerBuilder()
    + *         .registerCoercion(new TextToStringCoercion())  // registering a custom coercion
    + *         .build();
    + *    System.out.println(typeCoercer.coerceTo(String.class, text));  //  Hello World!
    + * 
    + */ +@InternalApi +class BigQueryTypeCoercer { + private static final BigQueryJdbcCustomLogger LOG = + new BigQueryJdbcCustomLogger(BigQueryTypeCoercer.class.getName()); + + /** A {@link BigQueryTypeCoercer} instance with all the inbuilt {@link BigQueryCoercion}s */ + static BigQueryTypeCoercer INSTANCE; + + static { + INSTANCE = BigQueryDefaultCoercions.builder().build(); + } + + private final Map, Map, BigQueryCoercion>> allCoercions; + + BigQueryTypeCoercer(Map, Map, BigQueryCoercion>> allCoercions) { + this.allCoercions = allCoercions; + } + + /** + * Coerce an object to the type specified. + * + * @param value the object that needs to be coerced. + * @param targetClass the target class for the coercion + * @throws BigQueryJdbcCoercionNotFoundException when coercion can not be performed to the target + * type. + * @throws BigQueryJdbcCoercionException when an error is encountered while performing the + * coercion. + */ + T coerceTo(Class targetClass, Object value) { + Class sourceClass = value == null ? Void.class : value.getClass(); + // FieldValue object for null-values requires special check + if (sourceClass == FieldValue.class && ((FieldValue.class.cast(value)).isNull())) { + sourceClass = Void.class; + } + // No coercion needed + if (sourceClass.equals(targetClass)) { + return targetClass.cast(value); + } + BigQueryCoercion coercion = findCoercion(sourceClass, targetClass); + LOG.finest(() -> String.format("%s coercion for %s", coercion, value)); + // Value is null case & no explicit coercion + if (sourceClass == Void.class && coercion == null) { + return null; + } + if (coercion == null) { + if (targetClass.equals(String.class)) { + return (T) value.toString(); + } + throw new BigQueryJdbcCoercionNotFoundException(sourceClass, targetClass); + } + try { + return coercion.coerce(sourceClass != Void.class ? value : null); + } catch (Exception ex) { + throw new BigQueryJdbcCoercionException(ex); + } + } + + /** + * Creates a {@link BigQueryTypeCoercerBuilder} with all the default coercions from {@link + * BigQueryDefaultCoercions}. + */ + static BigQueryTypeCoercerBuilder builder() { + return BigQueryDefaultCoercions.builder(); + } + + private BigQueryCoercion findCoercion(Class sourceClass, Class targetClass) { + Map, BigQueryCoercion> bySourceMap = this.allCoercions.get(sourceClass); + // AutoValue generated concrete classes are registered with their abstract classes and not the + // concrete class. Lets make sure the we can find the registered abstract class for such + // classes. The abstract class in these cases would be the super class of the generated + // AutoValue concrete classes. + if (bySourceMap == null) { + Class registeredAbstractClass = sourceClass.getSuperclass(); + bySourceMap = this.allCoercions.get(registeredAbstractClass); + } + // If we still can't find the coercion source class entry then just return. + if (bySourceMap == null) { + return null; + } + return (BigQueryCoercion) bySourceMap.get(targetClass); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerBuilder.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerBuilder.java new file mode 100644 index 0000000000..8539515ed1 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; + +/** + * A builder to create {@link BigQueryTypeCoercer} to perform the coercion of custom user defined + * types. + */ +@InternalApi +class BigQueryTypeCoercerBuilder { + + private final Map, Map, BigQueryCoercion>> allCoercions; + + BigQueryTypeCoercerBuilder() { + this.allCoercions = new HashMap<>(); + } + + /** + * registers a {@link BigQueryCoercion} + * + * @param coercion A {@link BigQueryCoercion} to register with this builder. + */ + BigQueryTypeCoercerBuilder registerTypeCoercion(BigQueryCoercion coercion) { + Type[] typeArguments = + ((ParameterizedType) coercion.getClass().getGenericInterfaces()[0]) + .getActualTypeArguments(); + Class sourceClass = (Class) typeArguments[0]; + Class targetClass = (Class) typeArguments[1]; + this.registerInternal(coercion, sourceClass, targetClass); + return this; + } + + /** + * registers a {@link BigQueryCoercion} using an implementation of {@link Function} + * + * @param function A {@link Function} to register with the builder. + * @param sourceClass the source class + * @param targetClass the target class + */ + BigQueryTypeCoercerBuilder registerTypeCoercion( + Function function, Class sourceClass, Class targetClass) { + this.registerInternal((BigQueryCoercion) function::apply, sourceClass, targetClass); + return this; + } + + /** builds the {@link BigQueryTypeCoercer} with all the registered {@link BigQueryCoercion}s. */ + BigQueryTypeCoercer build() { + return new BigQueryTypeCoercer(this.allCoercions); + } + + private void registerInternal( + BigQueryCoercion coercion, Class sourceClass, Class targetClass) { + Map, BigQueryCoercion> mapBySource = + this.allCoercions.getOrDefault(sourceClass, new HashMap<>()); + mapBySource.put(targetClass, coercion); + this.allCoercions.putIfAbsent(sourceClass, mapBySource); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercionUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercionUtility.java new file mode 100644 index 0000000000..9a4dc21304 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercionUtility.java @@ -0,0 +1,409 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.api.core.InternalApi; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.Range; +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.Period; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.concurrent.TimeUnit; +import org.apache.arrow.vector.PeriodDuration; +import org.apache.arrow.vector.util.Text; + +@InternalApi +class BigQueryTypeCoercionUtility { + + static BigQueryTypeCoercer INSTANCE; + + static { + INSTANCE = + BigQueryTypeCoercer.builder() + .registerTypeCoercion(new FieldValueToString()) + .registerTypeCoercion(new FieldValueToInteger()) + .registerTypeCoercion(new FieldValueToFloat()) + .registerTypeCoercion(new FieldValueToShort()) + .registerTypeCoercion(new FieldValueToLong()) + .registerTypeCoercion(new FieldValueToDouble()) + .registerTypeCoercion(new FieldValueToBigDecimal()) + .registerTypeCoercion(new FieldValueToBoolean()) + .registerTypeCoercion(new FieldValueToBytesArray()) + .registerTypeCoercion(new FieldValueToTimestamp()) + .registerTypeCoercion(new FieldValueToTime()) + .registerTypeCoercion(new FieldValueToDate()) + .registerTypeCoercion(new FieldValueToObject()) + .registerTypeCoercion(new StringToBytesArray()) + .registerTypeCoercion(new RangeToString()) + .registerTypeCoercion(new IntegerToLong()) + .registerTypeCoercion(new BytesArrayToString()) + + // Read API Type coercions + .registerTypeCoercion(Timestamp::valueOf, LocalDateTime.class, Timestamp.class) + .registerTypeCoercion(Text::toString, Text.class, String.class) + .registerTypeCoercion(new TextToInteger()) + .registerTypeCoercion(new LongToTimestamp()) + .registerTypeCoercion(new LongToTime()) + .registerTypeCoercion(new IntegerToDate()) + .registerTypeCoercion( + (Timestamp ts) -> Date.valueOf(ts.toLocalDateTime().toLocalDate()), + Timestamp.class, + Date.class) + .registerTypeCoercion( + (Timestamp ts) -> Time.valueOf(ts.toLocalDateTime().toLocalTime()), + Timestamp.class, + Time.class) + .registerTypeCoercion( + (Time time) -> // Per JDBC spec, the date component should be 1970-01-01 + Timestamp.valueOf(LocalDateTime.of(LocalDate.ofEpochDay(0), time.toLocalTime())), + Time.class, + Timestamp.class) + .registerTypeCoercion( + (Date date) -> new Timestamp(date.getTime()), Date.class, Timestamp.class) + .registerTypeCoercion(new TimestampToString()) + .registerTypeCoercion(new TimeToString()) + .registerTypeCoercion((Long l) -> l != 0L, Long.class, Boolean.class) + .registerTypeCoercion((Double d) -> d != 0.0d, Double.class, Boolean.class) + .registerTypeCoercion( + (BigDecimal bd) -> bd.compareTo(BigDecimal.ZERO) != 0, + BigDecimal.class, + Boolean.class) + .registerTypeCoercion((Integer i) -> i != 0, Integer.class, Boolean.class) + .registerTypeCoercion((Float f) -> f != 0.0f, Float.class, Boolean.class) + .registerTypeCoercion((Short s) -> s.shortValue() != 0, Short.class, Boolean.class) + .registerTypeCoercion((Boolean b) -> b ? 1L : 0L, Boolean.class, Long.class) + .registerTypeCoercion((Boolean b) -> b ? 1.0d : 0.0d, Boolean.class, Double.class) + .registerTypeCoercion((Boolean b) -> b ? 1.0f : 0.0f, Boolean.class, Float.class) + .registerTypeCoercion((Boolean b) -> (short) (b ? 1 : 0), Boolean.class, Short.class) + .registerTypeCoercion((Boolean b) -> (byte) (b ? 1 : 0), Boolean.class, Byte.class) + .registerTypeCoercion( + (Boolean b) -> b ? BigDecimal.ONE : BigDecimal.ZERO, + Boolean.class, + BigDecimal.class) + .registerTypeCoercion(new PeriodDurationToString()) + .registerTypeCoercion(unused -> (byte) 0, Void.class, Byte.class) + .registerTypeCoercion(unused -> 0, Void.class, Integer.class) + .registerTypeCoercion(unused -> 0L, Void.class, Long.class) + .registerTypeCoercion(unused -> 0D, Void.class, Double.class) + .registerTypeCoercion(unused -> 0f, Void.class, Float.class) + .registerTypeCoercion(unused -> (short) 0, Void.class, Short.class) + .build(); + } + + private static class TimestampToString implements BigQueryCoercion { + private static final DateTimeFormatter FORMATTER = + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS"); + + @Override + public String coerce(Timestamp value) { + return FORMATTER.format(value.toLocalDateTime()); + } + } + + private static class TimeToString implements BigQueryCoercion { + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("HH:mm:ss.SSS"); + + @Override + public String coerce(Time value) { + return FORMATTER.format(value.toLocalTime()); + } + } + + private static class PeriodDurationToString implements BigQueryCoercion { + + @Override + public String coerce(PeriodDuration value) { + StringBuilder builder = new StringBuilder(); + + // Conversion of Period + Period period = value.getPeriod().normalized(); + + builder + .append(period.getYears()) + .append("-") + .append(period.getMonths()) + .append(" ") + .append(period.getDays()) + .append(" "); + + // Conversion of Duration + Duration duration = value.getDuration(); + if (duration.isNegative()) { + builder.append("-"); + duration = duration.negated(); + } + long hours = duration.toHours(); + duration = duration.minusHours(hours); + long minutes = duration.toMinutes(); + duration = duration.minusMinutes(minutes); + long seconds = duration.getSeconds(); + duration = duration.minusSeconds(seconds); + long microseconds = duration.toNanos() / 1000; + + builder + .append(hours) + .append(":") + .append(minutes) + .append(":") + .append(seconds) + .append(".") + .append(microseconds); + + String result = builder.toString(); + result = result.replaceFirst("--", "-"); + + return result; + } + } + + private static class IntegerToDate implements BigQueryCoercion { + + @Override + public Date coerce(Integer value) { + // For example int 18993 represents 2022-01-01 + // Using LocalDate here to avoid this date getting affected by local time zones. + LocalDate date = LocalDate.ofEpochDay(Long.valueOf(value)); + return Date.valueOf(date); + } + } + + private static class LongToTime implements BigQueryCoercion { + + @Override + public Time coerce(Long value) { + + int HH = (int) TimeUnit.MICROSECONDS.toHours(value); + int MM = (int) (TimeUnit.MICROSECONDS.toMinutes(value) % 60); + int SS = (int) (TimeUnit.MICROSECONDS.toSeconds(value) % 60); + + // Note: BQ Time has a precision of up to six fractional digits (microsecond precision) + // but java.sql.Time do not. So data after seconds is not returned. + return new Time(HH, MM, SS); + } + } + + private static class LongToTimestamp implements BigQueryCoercion { + + @Override + public Timestamp coerce(Long value) { + // Long value is in microseconds. All further calculations should account for the unit. + Instant instant = Instant.ofEpochMilli(value / 1000).plusNanos((value % 1000) * 1000); + // JDBC is defaulting to UTC because BQ UI defaults to UTC. + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.of("UTC")); + return Timestamp.valueOf(localDateTime); + } + } + + private static class TextToInteger implements BigQueryCoercion { + + @Override + public Integer coerce(Text value) { + return Integer.parseInt(value.toString()); + } + } + + private static class FieldValueToObject implements BigQueryCoercion { + + @Override + public Object coerce(FieldValue fieldValue) { + return fieldValue.getValue(); + } + } + + private static class FieldValueToDate implements BigQueryCoercion { + + @Override + public Date coerce(FieldValue fieldValue) { + return Date.valueOf(fieldValue.getStringValue()); + } + } + + private static class FieldValueToTime implements BigQueryCoercion { + + @Override + public Time coerce(FieldValue fieldValue) { + // Time ranges from 00:00:00 to 23:59:59.999999 in BigQuery + String strTime = fieldValue.getStringValue(); + try { + LocalTime localTime = LocalTime.parse(strTime); + // Convert LocalTime to milliseconds of the day. This correctly preserves millisecond + // precision and truncates anything smaller + long millis = TimeUnit.NANOSECONDS.toMillis(localTime.toNanoOfDay()); + return new Time(millis); + } catch (java.time.format.DateTimeParseException e) { + throw new IllegalArgumentException( + "Cannot parse the value " + strTime + " to java.sql.Time", e); + } + } + } + + private static class FieldValueToTimestamp implements BigQueryCoercion { + + @Override + public Timestamp coerce(FieldValue fieldValue) { + String rawValue = fieldValue.getStringValue(); + // BigQuery DATETIME strings are formatted like "YYYY-MM-DD'T'HH:MM:SS.fffffffff" + // BigQuery TIMESTAMP strings are numeric epoch seconds. + if (rawValue.contains("T")) { + // It's a DATETIME string. + // Timestamp.valueOf() expects "yyyy-mm-dd hh:mm:ss.fffffffff" format. + return Timestamp.valueOf(rawValue.replace('T', ' ')); + } else { + // It's a TIMESTAMP numeric string. + long microseconds = fieldValue.getTimestampValue(); + Instant instant = Instant.EPOCH.plus(microseconds, ChronoUnit.MICROS); + // JDBC is defaulting to UTC because BQ UI defaults to UTC. + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.of("UTC")); + return Timestamp.valueOf(localDateTime); + } + } + } + + private static class FieldValueToBytesArray implements BigQueryCoercion { + + @Override + public byte[] coerce(FieldValue fieldValue) { + return fieldValue.getBytesValue(); + } + } + + private static class StringToBytesArray implements BigQueryCoercion { + + @Override + public byte[] coerce(String value) { + return value.getBytes(); + } + } + + private static class BytesArrayToString implements BigQueryCoercion { + + @Override + public String coerce(byte[] value) { + return java.util.Base64.getEncoder().encodeToString(value); + } + } + + private static class FieldValueToBoolean implements BigQueryCoercion { + + @Override + public Boolean coerce(FieldValue fieldValue) { + return !fieldValue.isNull() && fieldValue.getBooleanValue(); + } + } + + private static class FieldValueToBigDecimal implements BigQueryCoercion { + + @Override + public BigDecimal coerce(FieldValue fieldValue) { + return fieldValue.getNumericValue(); + } + } + + private static class FieldValueToDouble implements BigQueryCoercion { + + @Override + public Double coerce(FieldValue fieldValue) { + return fieldValue.getDoubleValue(); + } + } + + private static class FieldValueToLong implements BigQueryCoercion { + + @Override + public Long coerce(FieldValue fieldValue) { + return fieldValue.getLongValue(); + } + } + + private static class FieldValueToInteger implements BigQueryCoercion { + + @Override + public Integer coerce(FieldValue fieldValue) { + return (int) fieldValue.getLongValue(); + } + } + + private static class FieldValueToFloat implements BigQueryCoercion { + + @Override + public Float coerce(FieldValue fieldValue) { + return (float) fieldValue.getDoubleValue(); + } + } + + private static class FieldValueToShort implements BigQueryCoercion { + + @Override + public Short coerce(FieldValue fieldValue) { + return (short) fieldValue.getLongValue(); + } + } + + private static class FieldValueToString implements BigQueryCoercion { + + @Override + public String coerce(FieldValue fieldValue) { + if (Attribute.REPEATED.equals(fieldValue.getAttribute())) { // Case for Arrays + return fieldValue.getValue().toString(); + } + if (Attribute.RANGE.equals(fieldValue.getAttribute())) { // Range values + Range rangeValue = fieldValue.getRangeValue(); + return INSTANCE.coerceTo(String.class, rangeValue); + } + if (Attribute.RECORD.equals(fieldValue.getAttribute())) { // Case for Structs + return fieldValue.getRecordValue().toString(); + } + return fieldValue.getStringValue(); + } + } + + private static class IntegerToLong implements BigQueryCoercion { + + @Override + public Long coerce(Integer intValue) { + if (intValue == null) { + return 0L; + } + return Long.valueOf(intValue); + } + } + + private static class RangeToString implements BigQueryCoercion { + + @Override + public String coerce(Range value) { + FieldValue startValue = value.getStart(); + FieldValue endValue = value.getEnd(); + + String start = startValue.isNull() ? "UNBOUNDED" : startValue.getStringValue(); + String end = endValue.isNull() ? "UNBOUNDED" : endValue.getStringValue(); + // The start of a range is inclusive, and the end is exclusive. + return String.format("[%s, %s)", start, end); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java new file mode 100644 index 0000000000..b1501890bd --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java @@ -0,0 +1,664 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Logger; + +/** + * BigQuery JDBC implementation of {@link javax.sql.DataSource} + * + *

    A factory for connections to the physical data source that this DataSource object represents. + * An alternative to the DriverManager facility, a DataSource object is the preferred means of + * getting a connection. An object that implements the DataSource interface will typically be + * registered with a naming service based on the Java™ Naming and Directory (JNDI) API. + */ +public class DataSource implements javax.sql.DataSource { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private String URL; + private String projectId; + private String defaultDataset; + private String location; + private String userAgent; + private Boolean enableHighThroughputAPI; + private Integer highThroughputMinTableSize; + private Integer highThroughputActivationRatio; + private Boolean unsupportedHTAPIFallback; + private String kmsKeyName; + private Map queryProperties; + private String logLevel; + private Boolean enableSession; + private String logPath; + private Integer oAuthType; + private String oAuthServiceAcctEmail; + private String oAuthPvtKeyPath; + private String oAuthPvtKey; + private String oAuthAccessToken; + private String oAuthRefreshToken; + private Boolean useQueryCache; + private String queryDialect; + private Boolean allowLargeResults; + private String destinationTable; + private String destinationDataset; + private Long destinationDatasetExpirationTime; + private String universeDomain; + private String proxyHost; + private String proxyPort; + private String proxyUid; + private String proxyPwd; + private String oAuthClientId; + private String oAuthClientSecret; + private Integer jobCreationMode; + private Long maxResults; + private String partnerToken; + private Boolean enableWriteAPI; + private String additionalProjects; + private Boolean filterTablesOnDefaultDataset; + private Integer requestGoogleDriveScope; + private Integer metadataFetchThreadCount; + private String sslTrustStorePath; + private String sslTrustStorePassword; + + // Make sure the JDBC driver class is loaded. + static { + try { + Class.forName("com.google.cloud.bigquery.jdbc.BigQueryDriver"); + } catch (ClassNotFoundException ex) { + throw new IllegalStateException( + "DataSource failed to load com.google.cloud.bigquery.jdbc.BigQueryDriver", ex); + } + } + + /** An implementation of DataSource must include a public no-arg constructor. */ + public DataSource() {} + + @Override + public Connection getConnection() throws SQLException { + if (getURL() == null) { + throw new BigQueryJdbcException( + "Connection URL is null. Please specify a valid Connection URL to get Connection."); + } + if (!BigQueryDriver.getRegisteredDriver().acceptsURL(getURL())) { + throw new BigQueryJdbcException( + "The URL " + getURL() + " is invalid. Please specify a valid Connection URL. "); + } + return DriverManager.getConnection(getURL(), createProperties()); + } + + private Properties createProperties() { + Properties connectionProperties = new Properties(); + if (this.projectId != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PROJECT_ID_PROPERTY_NAME, this.projectId); + } + if (this.defaultDataset != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.DEFAULT_DATASET_PROPERTY_NAME, this.defaultDataset); + } + if (this.location != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LOCATION_PROPERTY_NAME, this.location); + } + if (this.enableHighThroughputAPI != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ENABLE_HTAPI_PROPERTY_NAME, + String.valueOf(this.enableHighThroughputAPI)); + } + if (this.unsupportedHTAPIFallback != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME, + String.valueOf(this.unsupportedHTAPIFallback)); + } + if (this.highThroughputMinTableSize != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME, + String.valueOf(this.highThroughputMinTableSize)); + } + if (this.highThroughputActivationRatio != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.HTAPI_ACTIVATION_RATIO_PROPERTY_NAME, + String.valueOf(this.highThroughputActivationRatio)); + } + if (this.kmsKeyName != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.KMS_KEY_NAME_PROPERTY_NAME, this.kmsKeyName); + } + if (this.queryProperties != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.QUERY_PROPERTIES_NAME, this.queryProperties.toString()); + } + if (this.enableSession != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ENABLE_SESSION_PROPERTY_NAME, String.valueOf(this.enableSession)); + } + if (this.logLevel != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LOG_LEVEL_PROPERTY_NAME, this.logLevel); + } + if (this.logPath != null) { + connectionProperties.setProperty(BigQueryJdbcUrlUtility.LOG_PATH_PROPERTY_NAME, this.logPath); + } + if (this.oAuthType != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, String.valueOf(this.oAuthType)); + } + if (this.oAuthServiceAcctEmail != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME, this.oAuthServiceAcctEmail); + } + if (this.oAuthPvtKeyPath != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, this.oAuthPvtKeyPath); + } + if (this.oAuthPvtKey != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, this.oAuthPvtKey); + } + if (this.oAuthAccessToken != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME, this.oAuthAccessToken); + } + if (this.oAuthRefreshToken != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME, this.oAuthRefreshToken); + } + if (this.useQueryCache != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.USE_QUERY_CACHE_PROPERTY_NAME, String.valueOf(this.useQueryCache)); + } + if (this.queryDialect != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.QUERY_DIALECT_PROPERTY_NAME, this.queryDialect); + } + if (this.allowLargeResults != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ALLOW_LARGE_RESULTS_PROPERTY_NAME, + String.valueOf(this.allowLargeResults)); + } + if (this.destinationTable != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LARGE_RESULTS_TABLE_PROPERTY_NAME, this.destinationTable); + } + if (this.destinationDataset != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LARGE_RESULTS_DATASET_PROPERTY_NAME, this.destinationDataset); + } + if (this.destinationDatasetExpirationTime != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME, + String.valueOf(this.destinationDatasetExpirationTime)); + } + if (this.universeDomain != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, this.universeDomain); + } + if (this.proxyHost != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, this.proxyHost); + } + if (this.proxyPort != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, this.proxyPort); + } + if (this.proxyUid != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME, this.proxyUid); + } + if (this.proxyPwd != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME, this.proxyPwd); + } + if (this.oAuthClientId != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, this.oAuthClientId); + } + if (this.oAuthClientSecret != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, this.oAuthClientSecret); + } + if (this.jobCreationMode != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.JOB_CREATION_MODE_PROPERTY_NAME, + String.valueOf(this.jobCreationMode)); + } + if (this.maxResults != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.MAX_RESULTS_PROPERTY_NAME, String.valueOf(this.maxResults)); + } + if (this.partnerToken != null && !this.partnerToken.isEmpty()) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.PARTNER_TOKEN_PROPERTY_NAME, this.partnerToken); + } + if (this.enableWriteAPI != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ENABLE_WRITE_API_PROPERTY_NAME, + String.valueOf(this.enableWriteAPI)); + } + if (this.additionalProjects != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.ADDITIONAL_PROJECTS_PROPERTY_NAME, this.additionalProjects); + } + if (this.filterTablesOnDefaultDataset != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME, + String.valueOf(this.filterTablesOnDefaultDataset)); + } + if (this.requestGoogleDriveScope != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + String.valueOf(this.requestGoogleDriveScope)); + } + if (this.metadataFetchThreadCount != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME, + String.valueOf(this.metadataFetchThreadCount)); + } + if (this.sslTrustStorePath != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROPERTY_NAME, + String.valueOf(this.sslTrustStorePath)); + } + if (this.sslTrustStorePassword != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, + String.valueOf(this.sslTrustStorePassword)); + } + return connectionProperties; + } + + @Override + public Connection getConnection(String username, String password) throws SQLException { + LOG.warning( + "Username and Password is not supported in Bigquery JDBC Driver. Values discarded."); + return getConnection(); + } + + public String getURL() { + return URL; + } + + public void setURL(String URL) { + this.URL = URL; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getDefaultDataset() { + return defaultDataset; + } + + public void setDefaultDataset(String defaultDataset) { + this.defaultDataset = defaultDataset; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(String userAgent) { + this.userAgent = userAgent; + } + + public String getPartnerToken() { + return partnerToken; + } + + public void setPartnerToken(String partnerToken) { + // This property is expected to be set by partners only. For more details on exact format + // supported, refer b/396086960 + this.partnerToken = partnerToken; + } + + public boolean getEnableHighThroughputAPI() { + return enableHighThroughputAPI; + } + + public void setEnableHighThroughputAPI(Boolean enableHighThroughputAPI) { + this.enableHighThroughputAPI = enableHighThroughputAPI; + } + + public int getHighThroughputMinTableSize() { + return highThroughputMinTableSize; + } + + public int getHighThroughputActivationRatio() { + return highThroughputActivationRatio; + } + + public void setHighThroughputMinTableSize(Integer highThroughputMinTableSize) { + this.highThroughputMinTableSize = highThroughputMinTableSize; + } + + public void setHighThroughputActivationRatio(Integer highThroughputActivationRatio) { + this.highThroughputActivationRatio = highThroughputActivationRatio; + } + + public void setKmsKeyName(String kmsKeyName) { + this.kmsKeyName = kmsKeyName; + } + + public String getKmsKeyName() { + return this.kmsKeyName; + } + + public void setQueryProperties(Map queryProperties) { + this.queryProperties = queryProperties; + } + + public Map getQueryProperties() { + return this.queryProperties; + } + + public void setUnsupportedHTAPIFallback(Boolean unsupportedHTAPIFallback) { + this.unsupportedHTAPIFallback = unsupportedHTAPIFallback; + } + + public boolean getUnsupportedHTAPIFallback() { + return this.unsupportedHTAPIFallback; + } + + public boolean getEnableSession() { + return enableSession; + } + + public void setEnableSession(Boolean enableSession) { + this.enableSession = enableSession; + } + + public String getLogLevel() { + return logLevel; + } + + public void setLogLevel(String logLevel) { + this.logLevel = logLevel; + } + + public String getLogPath() { + return logPath; + } + + public void setLogPath(String logPath) { + this.logPath = logPath; + } + + public String getUniverseDomain() { + return universeDomain; + } + + public void setUniverseDomain(String universeDomain) { + this.universeDomain = universeDomain; + } + + public String getProxyHost() { + return proxyHost; + } + + public void setProxyHost(String proxyHost) { + this.proxyHost = proxyHost; + } + + public String getProxyPort() { + return proxyPort; + } + + public void setProxyPort(String proxyPort) { + this.proxyPort = proxyPort; + } + + public String getProxyUid() { + return proxyUid; + } + + public void setProxyUid(String proxyUid) { + this.proxyUid = proxyUid; + } + + public String getProxyPwd() { + return proxyPwd; + } + + public void setProxyPwd(String proxyPwd) { + this.proxyPwd = proxyPwd; + } + + public int getOAuthType() { + return oAuthType; + } + + public void setOAuthType(Integer oAuthType) { + this.oAuthType = oAuthType; + } + + public String getOAuthServiceAcctEmail() { + return oAuthServiceAcctEmail; + } + + public void setOAuthServiceAcctEmail(String oAuthServiceAcctEmail) { + this.oAuthServiceAcctEmail = oAuthServiceAcctEmail; + } + + public String getOAuthPvtKeyPath() { + return oAuthPvtKeyPath; + } + + public String getOAuthPvtKey() { + return oAuthPvtKey; + } + + public void setOAuthPvtKey(String oAuthPvtKey) { + this.oAuthPvtKey = oAuthPvtKey; + } + + public void setOAuthPvtKeyPath(String oAuthPvtKeyPath) { + this.oAuthPvtKeyPath = oAuthPvtKeyPath; + } + + public String getOAuthAccessToken() { + return oAuthAccessToken; + } + + public void setOAuthAccessToken(String oAuthAccessToken) { + this.oAuthAccessToken = oAuthAccessToken; + } + + public String getOAuthRefreshToken() { + return oAuthRefreshToken; + } + + public void setOAuthRefreshToken(String oAuthRefreshToken) { + this.oAuthRefreshToken = oAuthRefreshToken; + } + + public Boolean getUseQueryCache() { + return useQueryCache; + } + + public String getQueryDialect() { + return queryDialect; + } + + public Boolean getAllowLargeResults() { + return allowLargeResults; + } + + public String getDestinationTable() { + return destinationTable; + } + + public String getDestinationDataset() { + return destinationDataset; + } + + public Long getDestinationDatasetExpirationTime() { + return destinationDatasetExpirationTime; + } + + public void setUseQueryCache(Boolean useQueryCache) { + this.useQueryCache = useQueryCache; + } + + public void setQueryDialect(String queryDialect) { + this.queryDialect = queryDialect; + } + + public void setAllowLargeResults(Boolean allowLargeResults) { + this.allowLargeResults = allowLargeResults; + } + + public void setDestinationTable(String destinationTable) { + this.destinationTable = destinationTable; + } + + public void setDestinationDataset(String destinationDataset) { + this.destinationDataset = destinationDataset; + } + + public void setDestinationDatasetExpirationTime(long destinationDatasetExpirationTime) { + this.destinationDatasetExpirationTime = destinationDatasetExpirationTime; + } + + public String getOAuthClientId() { + return oAuthClientId; + } + + public void setOAuthClientId(String oAuthClientId) { + this.oAuthClientId = oAuthClientId; + } + + public String getOAuthClientSecret() { + return oAuthClientSecret; + } + + public void setOAuthClientSecret(String oAuthClientSecret) { + this.oAuthClientSecret = oAuthClientSecret; + } + + public Integer getJobCreationMode() { + return jobCreationMode; + } + + public void setJobCreationMode(Integer jobCreationMode) { + this.jobCreationMode = jobCreationMode; + } + + public Boolean getEnableWriteAPI() { + return enableWriteAPI; + } + + public void setEnableWriteAPI(Boolean enableWriteAPI) { + this.enableWriteAPI = enableWriteAPI; + } + + public String getAdditionalProjects() { + return additionalProjects; + } + + public void setAdditionalProjects(String additionalProjects) { + this.additionalProjects = additionalProjects; + } + + public Boolean getFilterTablesOnDefaultDataset() { + return filterTablesOnDefaultDataset; + } + + public void setFilterTablesOnDefaultDataset(Boolean filterTablesOnDefaultDataset) { + this.filterTablesOnDefaultDataset = filterTablesOnDefaultDataset; + } + + public Integer getRequestGoogleDriveScope() { + return requestGoogleDriveScope; + } + + public void setRequestGoogleDriveScope(Integer requestGoogleDriveScope) { + this.requestGoogleDriveScope = requestGoogleDriveScope; + } + + public Integer getMetadataFetchThreadCount() { + return metadataFetchThreadCount; + } + + public void setMetadataFetchThreadCount(Integer metadataFetchThreadCount) { + this.metadataFetchThreadCount = metadataFetchThreadCount; + } + + public String getSSLTrustStorePath() { + return sslTrustStorePath; + } + + public void setSSLTrustStorePath(String sslTrustStorePath) { + this.sslTrustStorePath = sslTrustStorePath; + } + + public String getSSLTrustStorePassword() { + return sslTrustStorePassword; + } + + public void setSSLTrustStorePassword(String sslTrustStorePassword) { + this.sslTrustStorePassword = sslTrustStorePassword; + } + + @Override + public PrintWriter getLogWriter() { + return null; + } + + @Override + public void setLogWriter(PrintWriter out) {} + + @Override + public void setLoginTimeout(int seconds) {} + + @Override + public int getLoginTimeout() { + return 0; + } + + @Override + public Logger getParentLogger() { + return BigQueryJdbcRootLogger.getRootLogger(); + } + + @Override + public T unwrap(Class iface) { + return null; + } + + @Override + public boolean isWrapperFor(Class iface) { + return false; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java new file mode 100644 index 0000000000..412e4ca9ee --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.common.annotations.VisibleForTesting; +import java.sql.Connection; +import java.sql.SQLException; +import javax.sql.ConnectionPoolDataSource; +import javax.sql.PooledConnection; + +public class PooledConnectionDataSource extends DataSource implements ConnectionPoolDataSource { + private PooledConnectionListener connectionPoolManager = null; + Connection bqConnection = null; + + @Override + public PooledConnection getPooledConnection() throws SQLException { + if (connectionPoolManager != null && !connectionPoolManager.isConnectionPoolEmpty()) { + return connectionPoolManager.getPooledConnection(); + } + // Create the Underlying physical connection + if (bqConnection == null) { + bqConnection = super.getConnection(); + } + if (bqConnection == null) { + throw new BigQueryJdbcRuntimeException( + "Cannot get pooled connection: unable to get underlying physical connection"); + } + String connectionURl = ((BigQueryConnection) bqConnection).getConnectionUrl(); + Long connectionPoolSize = + BigQueryJdbcUrlUtility.parseConnectionPoolSize(connectionURl, this.toString()); + if (connectionPoolManager == null) { + connectionPoolManager = new PooledConnectionListener(connectionPoolSize); + } + BigQueryPooledConnection bqPooledConnection = new BigQueryPooledConnection(bqConnection); + bqPooledConnection.addConnectionEventListener(connectionPoolManager); + return bqPooledConnection; + } + + @VisibleForTesting + void setConnection(Connection connection) { + this.bqConnection = connection; + } + + @VisibleForTesting + public PooledConnectionListener getConnectionPoolManager() { + return this.connectionPoolManager; + } + + @Override + public PooledConnection getPooledConnection(String arg0, String arg1) throws SQLException { + throw new UnsupportedOperationException("This operation is not supported by the driver"); + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java new file mode 100644 index 0000000000..c0f0820438 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java @@ -0,0 +1,145 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import java.util.UUID; +import java.util.concurrent.LinkedBlockingDeque; +import javax.sql.ConnectionEvent; +import javax.sql.ConnectionEventListener; +import javax.sql.PooledConnection; + +public class PooledConnectionListener implements ConnectionEventListener { + private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); + private String id; // Mainly for internal use + private LinkedBlockingDeque connectionPool; + private Long connectionPoolSize = 0L; + + public PooledConnectionListener(Long connPoolSize) { + id = UUID.randomUUID().toString(); + this.connectionPoolSize = connPoolSize; + if (getConnectionPoolSize() > 0L) { + connectionPool = new LinkedBlockingDeque<>(getConnectionPoolSize().intValue()); + } else { + connectionPool = new LinkedBlockingDeque<>(); + } + } + + public Long getConnectionPoolSize() { + return this.connectionPoolSize; + } + + public int getConnectionPoolCurrentCapacity() { + return this.connectionPool.size(); + } + + public boolean isConnectionPoolEmpty() { + return (connectionPool != null && connectionPool.isEmpty()); + } + + PooledConnection getPooledConnection() { + if (isConnectionPoolEmpty()) { + LOG.warning("Connection pool is empty"); + return null; + } + // Return the first element. + return connectionPool.getFirst(); + } + + void addConnection(PooledConnection connection) { + LOG.finest("++enter++"); + if (connection == null) { + LOG.warning("Connection passed in is null"); + return; + } + if (connectionPool.contains(connection)) { + LOG.warning("Connection already in the pool"); + return; + } + connectionPool.add(connection); + } + + void removeConnection(PooledConnection connection) { + LOG.finest("++enter++"); + if (connection == null) { + LOG.warning("Connection passed in is null"); + return; + } + if (!connectionPool.contains(connection)) { + LOG.warning("Connection already in the pool"); + return; + } + connectionPool.remove(connection); + } + + @Override + public void connectionClosed(ConnectionEvent event) { + LOG.finest("++enter++"); + Object eventSource = event.getSource(); + if (eventSource == null + || !(eventSource instanceof BigQueryPooledConnection) + || !(eventSource.getClass().isAssignableFrom(BigQueryPooledConnection.class))) { + throw new IllegalArgumentException( + "Invalid ConnectionEvent source passed to connectionClosed. Expecting" + + " BigQueryPooledConnection."); + } + BigQueryPooledConnection bqPooledConnection = (BigQueryPooledConnection) eventSource; + addConnection(bqPooledConnection); + LOG.finest("Added pooled connection to connection pool"); + } + + @Override + public void connectionErrorOccurred(ConnectionEvent event) { + LOG.finest("++enter++"); + Object eventSource = event.getSource(); + if (eventSource == null + || !(eventSource instanceof BigQueryPooledConnection) + || !(eventSource.getClass().isAssignableFrom(BigQueryPooledConnection.class))) { + throw new IllegalArgumentException( + "Invalid ConnectionEvent source passed to connectionClosed. Expecting" + + " BigQueryPooledConnection."); + } + BigQueryPooledConnection bqPooledConnection = (BigQueryPooledConnection) eventSource; + removeConnection(bqPooledConnection); + String errorMessage = + (event.getSQLException() != null) + ? event.getSQLException().getMessage() + : "Connection error occured"; + LOG.finest( + String.format( + "Removed pooled connection from connection pool due to error: %s", errorMessage)); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (getClass() != obj.getClass()) return false; + PooledConnectionListener other = (PooledConnectionListener) obj; + if (id == null) { + if (other.id != null) return false; + } else if (!id.equals(other.id)) return false; + return true; + } +} diff --git a/google-cloud-bigquery-jdbc/src/main/resources/META-INF/services/java.sql.Driver b/google-cloud-bigquery-jdbc/src/main/resources/META-INF/services/java.sql.Driver new file mode 100644 index 0000000000..1ea35896be --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/META-INF/services/java.sql.Driver @@ -0,0 +1 @@ +com.google.cloud.bigquery.jdbc.BigQueryDriver diff --git a/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetCrossReference.sql b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetCrossReference.sql new file mode 100644 index 0000000000..da83862704 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetCrossReference.sql @@ -0,0 +1,72 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT PKTABLE_CAT, + PKTABLE_SCHEM, + PKTABLE_NAME, + PRIMARY.column_name AS PKCOLUMN_NAME, + FOREIGN.constraint_catalog AS FKTABLE_CAT, + FOREIGN.constraint_schema AS FKTABLE_SCHEM, + FOREIGN.table_name AS FKTABLE_NAME, + FOREIGN.column_name AS FKCOLUMN_NAME, + FOREIGN.ordinal_position AS KEY_SEQ, + NULL AS UPDATE_RULE, + NULL AS DELETE_RULE, + FOREIGN.constraint_name AS FK_NAME, + PRIMARY.constraint_name AS PK_NAME, + NULL AS DEFERRABILITY +FROM (SELECT DISTINCT CCU.table_catalog AS PKTABLE_CAT, + CCU.table_schema AS PKTABLE_SCHEM, + CCU.table_name AS PKTABLE_NAME, + TC.constraint_catalog, + TC.constraint_schema, + TC.constraint_name, + TC.table_catalog, + TC.table_schema, + TC.table_name, + TC.constraint_type, + KCU.column_name, + KCU.ordinal_position, + KCU.position_in_unique_constraint + FROM `%1$s.%2$s.INFORMATION_SCHEMA.TABLE_CONSTRAINTS` TC + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` KCU + USING + (constraint_catalog, + constraint_schema, + constraint_name, + table_catalog, + table_schema, + table_name) + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE` CCU + USING + (constraint_catalog, + constraint_schema, + constraint_name) + WHERE constraint_type = 'FOREIGN KEY' + AND TC.table_name = '%6$s') FOREIGN + INNER JOIN (SELECT * + FROM `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` + WHERE position_in_unique_constraint IS NULL + AND RTRIM(table_name) = '%3$s') PRIMARY +ON + FOREIGN.PKTABLE_CAT = PRIMARY.table_catalog + AND FOREIGN.PKTABLE_SCHEM = PRIMARY.table_schema + AND FOREIGN.PKTABLE_NAME = PRIMARY.table_name + AND FOREIGN.position_in_unique_constraint = + PRIMARY.ordinal_position +ORDER BY FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, KEY_SEQ \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetExportedKeys.sql b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetExportedKeys.sql new file mode 100644 index 0000000000..4058f6bff6 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetExportedKeys.sql @@ -0,0 +1,71 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT PKTABLE_CAT, + PKTABLE_SCHEM, + PKTABLE_NAME, + PRIMARY.column_name AS PKCOLUMN_NAME, + FOREIGN.constraint_catalog AS FKTABLE_CAT, + FOREIGN.constraint_schema AS FKTABLE_SCHEM, + FOREIGN.table_name AS FKTABLE_NAME, + FOREIGN.column_name AS FKCOLUMN_NAME, + FOREIGN.ordinal_position AS KEY_SEQ, + NULL AS UPDATE_RULE, + NULL AS DELETE_RULE, + FOREIGN.constraint_name AS FK_NAME, + PRIMARY.constraint_name AS PK_NAME, + NULL AS DEFERRABILITY +FROM (SELECT DISTINCT CCU.table_catalog AS PKTABLE_CAT, + CCU.table_schema AS PKTABLE_SCHEM, + CCU.table_name AS PKTABLE_NAME, + TC.constraint_catalog, + TC.constraint_schema, + TC.constraint_name, + TC.table_catalog, + TC.table_schema, + TC.table_name, + TC.constraint_type, + KCU.column_name, + KCU.ordinal_position, + KCU.position_in_unique_constraint + FROM `%1$s.%2$s.INFORMATION_SCHEMA.TABLE_CONSTRAINTS` TC + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` KCU + USING + (constraint_catalog, + constraint_schema, + constraint_name, + table_catalog, + table_schema, + table_name) + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE` CCU + USING + (constraint_catalog, + constraint_schema, + constraint_name) + WHERE constraint_type = 'FOREIGN KEY') FOREIGN + INNER JOIN (SELECT * + FROM `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` + WHERE position_in_unique_constraint IS NULL + AND RTRIM(table_name) = '%3$s') PRIMARY +ON + FOREIGN.PKTABLE_CAT = PRIMARY.table_catalog + AND FOREIGN.PKTABLE_SCHEM = PRIMARY.table_schema + AND FOREIGN.PKTABLE_NAME = PRIMARY.table_name + AND FOREIGN.position_in_unique_constraint = + PRIMARY.ordinal_position +ORDER BY FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, KEY_SEQ \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetImportedKeys.sql b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetImportedKeys.sql new file mode 100644 index 0000000000..3f4142eb05 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetImportedKeys.sql @@ -0,0 +1,71 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT PKTABLE_CAT, + PKTABLE_SCHEM, + PKTABLE_NAME, + PRIMARY.column_name AS PKCOLUMN_NAME, + FOREIGN.constraint_catalog AS FKTABLE_CAT, + FOREIGN.constraint_schema AS FKTABLE_SCHEM, + FOREIGN.table_name AS FKTABLE_NAME, + FOREIGN.column_name AS FKCOLUMN_NAME, + FOREIGN.ordinal_position AS KEY_SEQ, + NULL AS UPDATE_RULE, + NULL AS DELETE_RULE, + FOREIGN.constraint_name AS FK_NAME, + PRIMARY.constraint_name AS PK_NAME, + NULL AS DEFERRABILITY +FROM (SELECT DISTINCT CCU.table_catalog AS PKTABLE_CAT, + CCU.table_schema AS PKTABLE_SCHEM, + CCU.table_name AS PKTABLE_NAME, + TC.constraint_catalog, + TC.constraint_schema, + TC.constraint_name, + TC.table_catalog, + TC.table_schema, + TC.table_name, + TC.constraint_type, + KCU.column_name, + KCU.ordinal_position, + KCU.position_in_unique_constraint + FROM `%1$s.%2$s.INFORMATION_SCHEMA.TABLE_CONSTRAINTS` TC + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` KCU + USING + (constraint_catalog, + constraint_schema, + constraint_name, + table_catalog, + table_schema, + table_name) + INNER JOIN + `%1$s.%2$s.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE` CCU + USING + (constraint_catalog, + constraint_schema, + constraint_name) + WHERE constraint_type = 'FOREIGN KEY' + AND TC.table_name = '%3$s') FOREIGN + INNER JOIN (SELECT * + FROM `%1$s.%2$s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE` + WHERE position_in_unique_constraint IS NULL) PRIMARY +ON + FOREIGN.PKTABLE_CAT = PRIMARY.table_catalog + AND FOREIGN.PKTABLE_SCHEM = PRIMARY.table_schema + AND FOREIGN.PKTABLE_NAME = PRIMARY.table_name + AND FOREIGN.position_in_unique_constraint = + PRIMARY.ordinal_position +ORDER BY PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetPrimaryKeys.sql b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetPrimaryKeys.sql new file mode 100644 index 0000000000..282910fb97 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/DatabaseMetaData_GetPrimaryKeys.sql @@ -0,0 +1,30 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT table_catalog AS TABLE_CAT, + table_schema AS TABLE_SCHEM, + table_name AS TABLE_NAME, + column_name AS COLUMN_NAME, + ordinal_position AS KEY_SEQ, + constraint_name AS PK_NAME +FROM + %s.%s.INFORMATION_SCHEMA.KEY_COLUMN_USAGE +WHERE + table_name = '%s' + AND CONTAINS_SUBSTR(constraint_name + , 'pk$') +ORDER BY + COLUMN_NAME; diff --git a/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/dependencies.properties b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/dependencies.properties new file mode 100644 index 0000000000..6908cb6cc7 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/main/resources/com/google/cloud/bigquery/jdbc/dependencies.properties @@ -0,0 +1,4 @@ +# Versions of oneself +# {x-version-update-start:google-cloud-bigquery-jdbc:current} +version.jdbc=${project.version} +# {x-version-update-end} \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/ArrowFormatTypeBigQueryCoercionUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/ArrowFormatTypeBigQueryCoercionUtilityTest.java new file mode 100644 index 0000000000..0524fc87d1 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/ArrowFormatTypeBigQueryCoercionUtilityTest.java @@ -0,0 +1,234 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryTypeCoercionUtility.INSTANCE; +import static com.google.common.truth.Truth.assertThat; +import static java.time.Month.FEBRUARY; +import static java.time.Month.JANUARY; + +import com.google.cloud.bigquery.FieldElementType; +import com.google.cloud.bigquery.Range; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.Period; +import org.apache.arrow.vector.PeriodDuration; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; +import org.apache.arrow.vector.util.Text; +import org.junit.Rule; +import org.junit.Test; + +public class ArrowFormatTypeBigQueryCoercionUtilityTest { + + @Rule public final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + private static final Range RANGE_DATE = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .setStart("1970-01-02") + .setEnd("1970-03-04") + .build(); + + private static final Range RANGE_DATETIME = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .setStart("2014-08-19 05:41:35.220000") + .setEnd("2015-09-20 06:41:35.220000") + .build(); + + private static final Range RANGE_TIMESTAMP = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .setStart("2014-08-19 12:41:35.220000+00:00") + .setEnd("2015-09-20 13:41:35.220000+01:00") + .build(); + + @Test + public void nullToString() { + assertThat(INSTANCE.coerceTo(String.class, null)).isNull(); + } + + @Test + public void JsonStringArrayListToString() { + JsonStringArrayList employeeList = new JsonStringArrayList<>(); + employeeList.add(1); + employeeList.add(2); + employeeList.add(3); + + assertThat(INSTANCE.coerceTo(String.class, employeeList)).isEqualTo("[1,2,3]"); + } + + @Test + public void localDateTimeToTimestamp() { + LocalDateTime localDatetime = LocalDateTime.of(1995, FEBRUARY, 23, 20, 15); + + assertThat(INSTANCE.coerceTo(Timestamp.class, localDatetime)) + .isEqualTo(Timestamp.valueOf(localDatetime)); + } + + @Test + public void textToString() { + Text text = new Text("Hello World!"); + + assertThat(INSTANCE.coerceTo(String.class, text)).isEqualTo("Hello World!"); + } + + @Test + public void nullToInteger() { + assertThat(INSTANCE.coerceTo(Integer.class, null)).isEqualTo(0); + } + + @Test + public void textToInteger() { + Text text = new Text("51423"); + + assertThat(INSTANCE.coerceTo(Integer.class, text)).isEqualTo(51423); + } + + @Test + public void longToInteger() { + assertThat(INSTANCE.coerceTo(Integer.class, 56L)).isEqualTo(56); + } + + @Test + public void bigDecimalToInteger() { + assertThat(INSTANCE.coerceTo(Integer.class, new BigDecimal("56"))).isEqualTo(56); + } + + @Test + public void nullToLong() { + assertThat(INSTANCE.coerceTo(Long.class, null)).isEqualTo(0L); + } + + @Test + public void bigDecimalToLong() { + assertThat(INSTANCE.coerceTo(Long.class, new BigDecimal("56"))).isEqualTo(56L); + } + + @Test + public void nullToDouble() { + assertThat(INSTANCE.coerceTo(Double.class, null)).isEqualTo(0D); + } + + @Test + public void bigDecimalToDouble() { + assertThat(INSTANCE.coerceTo(Double.class, new BigDecimal("56"))).isEqualTo(56D); + } + + @Test + public void nullToBoolean() { + assertThat(INSTANCE.coerceTo(Boolean.class, null)).isFalse(); + } + + @Test + public void nullToByteArray() { + assertThat(INSTANCE.coerceTo(byte[].class, null)).isNull(); + } + + @Test + public void nullToTimestamp() { + assertThat(INSTANCE.coerceTo(Timestamp.class, null)).isNull(); + } + + @Test + public void longToTimestamp() { + assertThat(INSTANCE.coerceTo(Timestamp.class, 1408452095220000L)) + .isEqualTo(new Timestamp(1408452095220L)); + } + + @Test + public void nullToTime() { + assertThat(INSTANCE.coerceTo(Time.class, null)).isNull(); + } + + @Test + public void longToTime() { + assertThat(INSTANCE.coerceTo(Time.class, 1408452095220000L)) + .isEqualTo(new Time(1408452095000L)); + } + + @Test + public void nullToDate() { + assertThat(INSTANCE.coerceTo(Date.class, null)).isNull(); + } + + @Test + public void integerToDate() { + LocalDate expectedDate = LocalDate.of(2022, JANUARY, 1); + assertThat(INSTANCE.coerceTo(Date.class, 18993).toLocalDate()).isEqualTo(expectedDate); + } + + @Test + public void periodDurationToString() { + Period period = Period.of(1, 3, 24); + Duration duration = Duration.ofHours(3).plusMinutes(45).plusSeconds(23).plusNanos(123456000); + PeriodDuration periodDuration = new PeriodDuration(period, duration); + assertThat(INSTANCE.coerceTo(String.class, periodDuration)).isEqualTo("1-3 24 3:45:23.123456"); + + Period period2 = Period.of(1, 6, -8); + Duration duration2 = Duration.ofHours(9).plusMinutes(43).plusSeconds(23).plusNanos(123456000); + PeriodDuration periodDuration2 = new PeriodDuration(period2, duration2); + assertThat(INSTANCE.coerceTo(String.class, periodDuration2)).isEqualTo("1-6 -8 9:43:23.123456"); + } + + // Range tests + + @Test + public void JsonStringHashMapToString() { + JsonStringHashMap employeeMap = new JsonStringHashMap<>(); + employeeMap.putIfAbsent("name1", "type1"); + employeeMap.putIfAbsent("name2", "type2"); + employeeMap.putIfAbsent("name3", "type3"); + + assertThat(INSTANCE.coerceTo(String.class, employeeMap)) + .isEqualTo("{\"name1\":\"type1\",\"name2\":\"type2\",\"name3\":\"type3\"}"); + } + + @Test + public void rangeDateToString() { + String expectedRangeDate = + String.format( + "[%s, %s)", + RANGE_DATE.getStart().getStringValue(), RANGE_DATE.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATE)).isEqualTo(expectedRangeDate); + } + + @Test + public void rangeDatetimeToString() { + String expectedRangeDate = + String.format( + "[%s, %s)", + RANGE_DATETIME.getStart().getStringValue(), RANGE_DATETIME.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATETIME)).isEqualTo(expectedRangeDate); + } + + @Test + public void rangeTimestampToString() { + String expectedRangeTimestamp = + String.format( + "[%s, %s)", + RANGE_TIMESTAMP.getStart().getStringValue(), RANGE_TIMESTAMP.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_TIMESTAMP)).isEqualTo(expectedRangeTimestamp); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfPrimitivesTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfPrimitivesTest.java new file mode 100644 index 0000000000..5b33fda788 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfPrimitivesTest.java @@ -0,0 +1,367 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.StandardSQLTypeName.BIGNUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.BOOL; +import static com.google.cloud.bigquery.StandardSQLTypeName.BYTES; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATE; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATETIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.FLOAT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.GEOGRAPHY; +import static com.google.cloud.bigquery.StandardSQLTypeName.INT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.NUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.STRING; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIMESTAMP; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.INVALID_ARRAY; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arrowArraySchemaAndValue; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.nestedResultSetToColumnLists; +import static com.google.common.truth.Truth.assertThat; +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; +import static java.time.Month.MARCH; +import static java.util.Arrays.copyOfRange; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.stream.Stream; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.Text; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class BigQueryArrowArrayOfPrimitivesTest { + + private final Field schema; + private final JsonStringArrayList arrayValues; + private final Object[] expected; + private final int javaSqlTypeCode; + private Array array; + private final StandardSQLTypeName currentType; + + @ClassRule public static final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + public BigQueryArrowArrayOfPrimitivesTest( + StandardSQLTypeName currentType, + Tuple> schemaAndValue, + Object[] expected, + int javaSqlTypeCode) { + this.currentType = currentType; + this.schema = schemaAndValue.x(); + this.arrayValues = schemaAndValue.y(); + this.expected = expected; + this.javaSqlTypeCode = javaSqlTypeCode; + } + + @Before + public void setUp() { + array = new BigQueryArrowArray(this.schema, this.arrayValues); + } + + @Parameters(name = "{index}: primitive array of {0}") + public static Collection data() { + timeZoneRule.enforce(); + LocalDateTime aTimeStamp = LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820227000); + LocalDate aDate = LocalDate.of(2023, MARCH, 30); + LocalTime aTime = LocalTime.of(11, 14, 19, 820227); + return Arrays.asList( + new Object[][] { + { + INT64, + arrowArraySchemaAndValue(INT64, 10L, 20L, 30L, 40L), + new Long[] {10L, 20L, 30L, 40L}, + Types.BIGINT + }, + { + BOOL, + arrowArraySchemaAndValue(BOOL, TRUE, FALSE, FALSE, TRUE), + new Boolean[] {true, false, false, true}, + Types.BOOLEAN + }, + { + FLOAT64, + arrowArraySchemaAndValue( + FLOAT64, + Double.valueOf("11.2"), + Double.valueOf("33.4"), + Double.valueOf("55.6"), + Double.valueOf("77.8")), + new Double[] {11.2, 33.4, 55.6, 77.8}, + Types.DOUBLE + }, + { + NUMERIC, + arrowArraySchemaAndValue( + NUMERIC, + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657")), + new BigDecimal[] { + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657") + }, + Types.NUMERIC + }, + { + BIGNUMERIC, + arrowArraySchemaAndValue( + BIGNUMERIC, + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657")), + new BigDecimal[] { + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657") + }, + Types.NUMERIC + }, + { + STRING, + arrowArraySchemaAndValue( + STRING, new Text("one"), new Text("two"), new Text("three"), new Text("four")), + new String[] {"one", "two", "three", "four"}, + Types.NVARCHAR + }, + { + TIMESTAMP, + arrowArraySchemaAndValue( + TIMESTAMP, + Long.valueOf("1680174859820227"), + Long.valueOf("1680261259820227"), + Long.valueOf("1680347659820227"), + Long.valueOf("1680434059820227")), + new Timestamp[] { + Timestamp.valueOf(aTimeStamp), // 2023-03-30 16:44:19.82 + Timestamp.valueOf(aTimeStamp.plusDays(1)), + Timestamp.valueOf(aTimeStamp.plusDays(2)), + Timestamp.valueOf(aTimeStamp.plusDays(3)) + }, + Types.TIMESTAMP + }, + { + DATE, + arrowArraySchemaAndValue(DATE, 19446, 19447, 19448, 19449), + new Date[] { + Date.valueOf(aDate), + Date.valueOf(aDate.plusDays(1)), + Date.valueOf(aDate.plusDays(2)), + Date.valueOf(aDate.plusDays(3)) + }, + Types.DATE + }, + { + TIME, + arrowArraySchemaAndValue( + TIME, + Long.valueOf("40459820227"), // 11:14:19.820227 + Long.valueOf("40460820227"), + Long.valueOf("40461820227"), + Long.valueOf("40462820227")), + new Time[] { + Time.valueOf(aTime), + Time.valueOf(aTime.plusSeconds(1)), + Time.valueOf(aTime.plusSeconds(2)), + Time.valueOf(aTime.plusSeconds(3)) + }, + Types.TIME + }, + { + DATETIME, + arrowArraySchemaAndValue( + DATETIME, + LocalDateTime.parse("2023-03-30T11:14:19.820227"), + LocalDateTime.parse("2023-03-30T11:15:19.820227"), + LocalDateTime.parse("2023-03-30T11:16:19.820227"), + LocalDateTime.parse("2023-03-30T11:17:19.820227")), + new Timestamp[] { + Timestamp.valueOf(LocalDateTime.parse("2023-03-30T11:14:19.820227")), + Timestamp.valueOf(LocalDateTime.parse("2023-03-30T11:15:19.820227")), + Timestamp.valueOf(LocalDateTime.parse("2023-03-30T11:16:19.820227")), + Timestamp.valueOf(LocalDateTime.parse("2023-03-30T11:17:19.820227")) + }, + Types.TIMESTAMP + }, + { + GEOGRAPHY, + arrowArraySchemaAndValue( + GEOGRAPHY, + new Text("POINT(-122 47)"), + new Text("POINT(-122 48)"), + new Text("POINT(-121 47)"), + new Text("POINT(-123 48)")), + new String[] {"POINT(-122 47)", "POINT(-122 48)", "POINT(-121 47)", "POINT(-123 48)"}, + Types.OTHER + }, + { + BYTES, + arrowArraySchemaAndValue( + BYTES, + Stream.of("one", "two", "three", "four") + .map(String::getBytes) + .toArray(byte[][]::new)), // array of bytes array + new byte[][] { + "one".getBytes(), "two".getBytes(), "three".getBytes(), "four".getBytes() + }, + Types.VARBINARY + } + }); + } + + @Test + public void getArray() throws SQLException { + assertThat(array.getArray()).isEqualTo(this.expected); + } + + @Test + public void getSlicedArray() throws SQLException { + int fromIndex = 1; + int toIndexExclusive = 3; + Object[] expectedSlicedArray = + copyOfRange(this.expected, fromIndex, toIndexExclusive); // copying index(1,2) + + // the first element is at index 1 + assertThat(array.getArray(fromIndex + 1, 2)).isEqualTo(expectedSlicedArray); + } + + @Test + public void getSlicedArrayWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getArray(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getResultSet() throws SQLException { + ResultSet resultSet = this.array.getResultSet(); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + ArrayList indexList = indexAndValues.x(); + ArrayList columnValues = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {1, 2, 3, 4}); + assertThat(columnValues.toArray()).isEqualTo(this.expected); + } + + @Test + public void getSlicedResultSet() throws SQLException { + int fromIndex = 1; + int toIndexExclusive = 3; + Object[] expectedSlicedArray = + copyOfRange(this.expected, fromIndex, toIndexExclusive); // copying index(1,2) + + // the first element is at index 1 + ResultSet resultSet = array.getResultSet(fromIndex + 1, 2); + + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + ArrayList indexList = indexAndValues.x(); + ArrayList columnValues = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {2, 3}); + assertThat(columnValues.toArray()).isEqualTo(expectedSlicedArray); + } + + @Test + public void getSlicedResultSetWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getResultSet(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getBaseTypeName() throws SQLException { + assertThat(array.getBaseTypeName()).isEqualTo(this.currentType.name()); + } + + @Test + public void getBaseType() throws SQLException { + assertThat(array.getBaseType()).isEqualTo(this.javaSqlTypeCode); + } + + @Test + public void free() throws SQLException { + this.array.free(); + + ensureArrayIsInvalid(() -> array.getArray()); + ensureArrayIsInvalid(() -> array.getArray(1, 2)); + ensureArrayIsInvalid(() -> array.getResultSet()); + ensureArrayIsInvalid(() -> array.getResultSet(1, 2)); + ensureArrayIsInvalid(() -> array.getBaseTypeName()); + ensureArrayIsInvalid(() -> array.getBaseType()); + } + + @Test + public void getArrayWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(emptyMap())); + Exception exception2 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Test + public void getResultSetWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getResultSet(emptyMap())); + Exception exception2 = + assertThrows( + SQLFeatureNotSupportedException.class, () -> array.getResultSet(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + private void ensureArrayIsInvalid(ThrowingRunnable block) { + Exception exception = assertThrows(IllegalStateException.class, block); + assertThat(exception.getMessage()).isEqualTo(INVALID_ARRAY); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfStructTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfStructTest.java new file mode 100644 index 0000000000..7cb84e70ab --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowArrayOfStructTest.java @@ -0,0 +1,205 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.LegacySQLTypeName.RECORD; +import static com.google.cloud.bigquery.StandardSQLTypeName.BOOL; +import static com.google.cloud.bigquery.StandardSQLTypeName.INT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.STRING; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.INVALID_ARRAY; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arrowArrayOf; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arrowStructOf; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.nestedResultSetToColumnLists; +import static com.google.common.truth.Truth.assertThat; +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.StandardSQLTypeName; +import java.sql.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Struct; +import java.sql.Types; +import java.util.ArrayList; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; +import org.apache.arrow.vector.util.Text; +import org.junit.Before; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; + +public class BigQueryArrowArrayOfStructTest { + + private Array array; + + @Before + public void setUp() { + FieldList profileSchema = + FieldList.of( + Field.newBuilder("name", LegacySQLTypeName.STRING).build(), + Field.newBuilder("age", LegacySQLTypeName.INTEGER).build(), + Field.newBuilder("adult", LegacySQLTypeName.BOOLEAN).build()); + + JsonStringHashMap record1 = + arrowStructOf( + Tuple.of(STRING, new Text("Arya")), Tuple.of(INT64, 15L), Tuple.of(BOOL, FALSE)) + .y(); + JsonStringHashMap record2 = + arrowStructOf( + Tuple.of(STRING, new Text("Khal Drogo")), + Tuple.of(INT64, 35L), + Tuple.of(BOOL, TRUE)) + .y(); + JsonStringHashMap record3 = + arrowStructOf( + Tuple.of(STRING, new Text("Ned Stark")), Tuple.of(INT64, 45L), Tuple.of(BOOL, TRUE)) + .y(); + JsonStringHashMap record4 = + arrowStructOf( + Tuple.of(STRING, new Text("Jon Snow")), Tuple.of(INT64, 25L), Tuple.of(BOOL, TRUE)) + .y(); + + Field arrayOfStructSchema = + Field.newBuilder("profiles", RECORD, profileSchema).setMode(Mode.REPEATED).build(); + + JsonStringArrayList> arrayOfStructValue = + arrowArrayOf(record1, record2, record3, record4); + array = new BigQueryArrowArray(arrayOfStructSchema, arrayOfStructValue); + } + + @Test + public void getArray() throws SQLException { + Struct[] structArray = (Struct[]) array.getArray(); + + assertThat(structArray.length).isEqualTo(4); + assertThat(structArray[0].getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(structArray[1].getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structArray[2].getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + assertThat(structArray[3].getAttributes()).isEqualTo(asList("Jon Snow", 25L, true).toArray()); + } + + @Test + public void getSlicedArray() throws SQLException { + Struct[] structArray = (Struct[]) array.getArray(2, 2); + + assertThat(structArray.length).isEqualTo(2); + assertThat(structArray[0].getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structArray[1].getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + } + + @Test + public void getSlicedArrayWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getArray(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getResultSet() throws SQLException { + ResultSet resultSet = array.getResultSet(); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + + ArrayList indexList = indexAndValues.x(); + ArrayList structs = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {1, 2, 3, 4}); + assertThat(structs.get(0).getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(structs.get(1).getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structs.get(2).getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + assertThat(structs.get(3).getAttributes()).isEqualTo(asList("Jon Snow", 25L, true).toArray()); + } + + @Test + public void getSlicedResultSet() throws SQLException { + ResultSet resultSet = array.getResultSet(2, 2); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + + ArrayList indexList = indexAndValues.x(); + ArrayList structs = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {2, 3}); + assertThat(structs.get(0).getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structs.get(1).getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + } + + @Test + public void getResultSetWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getResultSet(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getBaseTypeName() throws SQLException { + assertThat(array.getBaseTypeName()).isEqualTo(StandardSQLTypeName.STRUCT.name()); + } + + @Test + public void getBaseType() throws SQLException { + assertThat(array.getBaseType()).isEqualTo(Types.STRUCT); + } + + @Test + public void free() throws SQLException { + this.array.free(); + + ensureArrayIsInvalid(() -> array.getArray()); + ensureArrayIsInvalid(() -> array.getArray(1, 2)); + ensureArrayIsInvalid(() -> array.getBaseTypeName()); + ensureArrayIsInvalid(() -> array.getBaseType()); + } + + @Test + public void getArrayWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(emptyMap())); + Exception exception2 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Test + public void getResultSetWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getResultSet(emptyMap())); + Exception exception2 = + assertThrows( + SQLFeatureNotSupportedException.class, () -> array.getResultSet(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + private void ensureArrayIsInvalid(ThrowingRunnable block) { + Exception exception = assertThrows(IllegalStateException.class, block); + assertThat(exception.getMessage()).isEqualTo(INVALID_ARRAY); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java new file mode 100644 index 0000000000..efde49309d --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSetTest.java @@ -0,0 +1,358 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.utils.ArrowUtilities.serializeSchema; +import static com.google.cloud.bigquery.jdbc.utils.ArrowUtilities.serializeVectorSchemaRoot; +import static com.google.common.truth.Truth.assertThat; +import static org.apache.arrow.vector.types.Types.MinorType.INT; +import static org.apache.arrow.vector.types.Types.MinorType.VARCHAR; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; +import com.google.cloud.bigquery.storage.v1.ArrowSchema; +import com.google.common.collect.ImmutableList; +import java.io.IOException; +import java.sql.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Struct; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingDeque; +import org.apache.arrow.memory.RootAllocator; +import org.apache.arrow.vector.BitVector; +import org.apache.arrow.vector.DateMilliVector; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.Float8Vector; +import org.apache.arrow.vector.IntVector; +import org.apache.arrow.vector.TimeMilliVector; +import org.apache.arrow.vector.TimeStampMicroVector; +import org.apache.arrow.vector.VarBinaryVector; +import org.apache.arrow.vector.VarCharVector; +import org.apache.arrow.vector.VectorSchemaRoot; +import org.apache.arrow.vector.complex.ListVector; +import org.apache.arrow.vector.complex.StructVector; +import org.apache.arrow.vector.complex.impl.UnionListWriter; +import org.apache.arrow.vector.types.pojo.FieldType; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.Text; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryArrowResultSetTest { + + private static final FieldList fieldList = + FieldList.of( + Field.of("boolField", StandardSQLTypeName.BOOL), + Field.of("int64Filed", StandardSQLTypeName.INT64), + Field.of("float64Field", StandardSQLTypeName.FLOAT64), + Field.of("stringField", StandardSQLTypeName.STRING), + Field.of("timeStampField", StandardSQLTypeName.TIMESTAMP), + Field.of("bytesField", StandardSQLTypeName.BYTES), + Field.newBuilder("intArrayField", StandardSQLTypeName.INT64) + .setMode(Field.Mode.REPEATED) + .build(), + Field.of( + "structField", + StandardSQLTypeName.STRUCT, + Field.of("name", StandardSQLTypeName.STRING), + Field.of("age", StandardSQLTypeName.INT64)), + Field.of("numericField", StandardSQLTypeName.BIGNUMERIC), + Field.of("timeField", StandardSQLTypeName.TIME), + Field.of("dateField", StandardSQLTypeName.DATE)); + + private BigQueryArrowBatchWrapper arrowBatchWrapper; + private BigQueryArrowBatchWrapper arrowBatchWrapperLast; + + private BigQueryStatement statement; + + private BlockingQueue buffer; + private BlockingQueue bufferWithTwoRows; + private static final Schema QUERY_SCHEMA = Schema.of(fieldList); + + private VectorSchemaRoot vectorSchemaRoot; + private BigQueryArrowResultSet bigQueryArrowResultSet; + private BigQueryArrowResultSet bigQueryArrowResultSetNested; + + private VectorSchemaRoot getTestVectorSchemaRoot() { + RootAllocator allocator = new RootAllocator(); + BitVector boolField = + new BitVector("boolField", allocator); // Mapped with StandardSQLTypeName.BOOL + boolField.allocateNew(2); + boolField.set(0, 0); + boolField.setValueCount(1); + IntVector int64Filed = + new IntVector("int64Filed", allocator); // Mapped with StandardSQLTypeName.INT64 + int64Filed.allocateNew(2); + int64Filed.set(0, 1); + int64Filed.setValueCount(1); + Float8Vector float64Field = + new Float8Vector("float64Field", allocator); // Mapped with StandardSQLTypeName.FLOAT64 + float64Field.allocateNew(2); + float64Field.set(0, 1.1f); + float64Field.setValueCount(1); + VarCharVector stringField = + new VarCharVector("stringField", allocator); // Mapped with StandardSQLTypeName.STRING + stringField.allocateNew(2); + stringField.set(0, new Text("text1")); + stringField.setValueCount(1); + TimeStampMicroVector timeStampField = + new TimeStampMicroVector( + "timeStampField", allocator); // Mapped with StandardSQLTypeName.TIMESTAMP + timeStampField.allocateNew(2); + timeStampField.set(0, 10000L); + timeStampField.setValueCount(1); + VarBinaryVector bytesField = + new VarBinaryVector("bytesField", allocator); // Mapped with StandardSQLTypeName.BYTES + bytesField.allocateNew(2); + bytesField.set(0, "text1".getBytes()); + bytesField.setValueCount(1); + + ListVector listVector = ListVector.empty("intArrayField", allocator); + UnionListWriter listWriter = listVector.getWriter(); + listWriter.setPosition(0); + listWriter.startList(); + listWriter.writeBigInt(10L); + listWriter.writeBigInt(20L); + listWriter.setValueCount(2); + listWriter.endList(); + listVector.setValueCount(1); + + StructVector structVector = StructVector.empty("structField", allocator); + VarCharVector nameVector = + structVector.addOrGet( + "name", FieldType.notNullable(VARCHAR.getType()), VarCharVector.class); + IntVector ageVector = + structVector.addOrGet("age", FieldType.notNullable(INT.getType()), IntVector.class); + structVector.allocateNew(); + + nameVector.set(0, new Text("Jon Doe")); + nameVector.setValueCount(1); + + ageVector.set(0, 29); + ageVector.setValueCount(1); + + structVector.setValueCount(1); + structVector.setIndexDefined(0); + + IntVector numericField = + new IntVector("numericField", allocator); // Mapped with StandardSQLTypeName.BIGNUMERIC + numericField.allocateNew(1000); + numericField.set(0, 1); + numericField.setValueCount(1); + TimeMilliVector timeField = + new TimeMilliVector("timeField", allocator); // Mapped with StandardSQLTypeName.TIME + timeField.allocateNew(2); + timeField.set(0, 1234); + timeField.setValueCount(1); + DateMilliVector dateField = + new DateMilliVector("dateField", allocator); // Mapped with StandardSQLTypeName.DATE + dateField.allocateNew(2); + dateField.set(0, 5000); + dateField.setValueCount(1); + + List fieldVectors = + ImmutableList.of( + boolField, + int64Filed, + float64Field, + stringField, + timeStampField, + bytesField, + listVector, + structVector, + numericField, + timeField, + dateField); + return new VectorSchemaRoot(fieldVectors); + } + + private JsonStringArrayList getJsonStringArrayList() { + JsonStringArrayList jsonStringArrayList = new JsonStringArrayList<>(); + jsonStringArrayList.addAll(Arrays.asList(10L, 20L)); + return jsonStringArrayList; + } + + @Before + public void setUp() throws SQLException, IOException { + buffer = new LinkedBlockingDeque<>(); + bufferWithTwoRows = new LinkedBlockingDeque<>(); + vectorSchemaRoot = getTestVectorSchemaRoot(); + ArrowRecordBatch batch = + ArrowRecordBatch.newBuilder() + .setSerializedRecordBatch(serializeVectorSchemaRoot(vectorSchemaRoot)) + .build(); + arrowBatchWrapper = BigQueryArrowBatchWrapper.of(batch); + arrowBatchWrapperLast = BigQueryArrowBatchWrapper.of(null, true); // last flag + buffer.add(arrowBatchWrapper); + buffer.add(arrowBatchWrapperLast); + bufferWithTwoRows.add(arrowBatchWrapper); + bufferWithTwoRows.add(arrowBatchWrapperLast); + + statement = mock(BigQueryStatement.class); + ArrowSchema arrowSchema = + ArrowSchema.newBuilder() + .setSerializedSchema(serializeSchema(vectorSchemaRoot.getSchema())) + .build(); + Thread workerThread = new Thread(); + bigQueryArrowResultSet = + BigQueryArrowResultSet.of( + QUERY_SCHEMA, arrowSchema, 1, statement, buffer, workerThread, null); + + // nested result set data setup + JsonStringArrayList jsonStringArrayList = getJsonStringArrayList(); + Schema arraySchema = + Schema.of( + Field.newBuilder("integerArray", StandardSQLTypeName.INT64) + .setMode(Mode.REPEATED) + .build()); + bigQueryArrowResultSetNested = + BigQueryArrowResultSet.getNestedResultSet( + arraySchema, + BigQueryArrowBatchWrapper.getNestedFieldValueListWrapper(jsonStringArrayList), + 0, + jsonStringArrayList.size()); + } + + @Test + public void testVectorSchemaRoot() { + assertThat(vectorSchemaRoot).isNotNull(); + assertThat(vectorSchemaRoot.getRowCount()).isEqualTo(1); + } + + @Test + public void testBufferSize() { + assertThat(buffer).isNotNull(); + assertThat(buffer.size()).isEqualTo(2); + } + + @Test + public void testRowCount() throws SQLException, IOException { + ArrowSchema arrowSchema = + ArrowSchema.newBuilder() + .setSerializedSchema(serializeSchema(vectorSchemaRoot.getSchema())) + .build(); + Thread workerThread = new Thread(); + // ResultSet with 1 row buffer and 1 total rows. + BigQueryArrowResultSet bigQueryArrowResultSet2 = + BigQueryArrowResultSet.of( + QUERY_SCHEMA, arrowSchema, 1, statement, buffer, workerThread, null); + + assertThat(resultSetRowCount(bigQueryArrowResultSet2)).isEqualTo(1); + // ResultSet with 2 rows buffer and 1 total rows. + bigQueryArrowResultSet2 = + BigQueryArrowResultSet.of( + QUERY_SCHEMA, arrowSchema, 1, statement, bufferWithTwoRows, workerThread, null); + + assertThat(resultSetRowCount(bigQueryArrowResultSet2)).isEqualTo(1); + } + + @Test + // This method tests iteration and Resultset's type getters + public void testIteration() throws SQLException { + int cnt = 0; + assertThat(bigQueryArrowResultSet.isBeforeFirst()).isTrue(); + while (bigQueryArrowResultSet.next()) { + cnt++; + assertThat(bigQueryArrowResultSet.isLast()).isTrue(); // we have one test row + assertThat(bigQueryArrowResultSet.isFirst()).isTrue(); // we have one test row + + assertThat(bigQueryArrowResultSet.getString(4)).isEqualTo("text1"); + + // array + assertThat(bigQueryArrowResultSet.getArray("intArrayField").getArray()) + .isEqualTo(new Object[] {10L, 20L}); + assertThat(bigQueryArrowResultSet.getArray(7).getArray()).isEqualTo(new Object[] {10L, 20L}); + assertThat(((Array) bigQueryArrowResultSet.getObject("intArrayField")).getArray()) + .isEqualTo(new Object[] {10L, 20L}); + assertThat(((Array) bigQueryArrowResultSet.getObject(7)).getArray()) + .isEqualTo(new Object[] {10L, 20L}); + + // struct + assertThat(((Struct) bigQueryArrowResultSet.getObject("structField")).getAttributes()) + .isEqualTo(new Object[] {"Jon Doe", 29L}); + assertThat(((Struct) bigQueryArrowResultSet.getObject(8)).getAttributes()) + .isEqualTo(new Object[] {"Jon Doe", 29L}); + } + assertThat(cnt).isEqualTo(1); + assertThat(bigQueryArrowResultSet.next()).isFalse(); + assertThat(bigQueryArrowResultSet.isAfterLast()).isTrue(); + } + + @Test + public void testIsClosed() { + assertThat(bigQueryArrowResultSet.isClosed()).isFalse(); + } + + @Test + public void testResultSetHoldability() throws SQLException { + assertThat(bigQueryArrowResultSet.getHoldability()) + .isEqualTo(bigQueryArrowResultSet.HOLD_CURSORS_OVER_COMMIT); + } + + @Test + public void testStatement() throws SQLException { + assertThat(bigQueryArrowResultSet.getStatement()).isEqualTo(statement); + assertThat(bigQueryArrowResultSetNested.getStatement()).isNull(); + } + + @Test + public void testConcurrencyTypeColumn() throws SQLException { + assertThat(bigQueryArrowResultSet.getConcurrency()).isEqualTo(ResultSet.CONCUR_READ_ONLY); + assertThat(bigQueryArrowResultSet.getType()).isEqualTo(ResultSet.TYPE_FORWARD_ONLY); + assertThat(bigQueryArrowResultSet.findColumn("boolField")).isEqualTo(1); + } + + @Test + public void testIterationNested() throws SQLException { + int cnt = 0; + assertThat(bigQueryArrowResultSetNested.isBeforeFirst()).isTrue(); + while (bigQueryArrowResultSetNested.next()) { + cnt++; + if (cnt == 1) { + assertThat(bigQueryArrowResultSetNested.isFirst()).isTrue(); + + } else { // 2nd row is the last row + assertThat(bigQueryArrowResultSetNested.isLast()).isTrue(); + } + assertThat(bigQueryArrowResultSetNested.getInt(1)) + .isEqualTo(cnt); // the first column is index 1 + assertThat(bigQueryArrowResultSetNested.getInt(2)) + .isEqualTo(cnt * 10); // second column has values 10 and 20 + } + assertThat(cnt).isEqualTo(2); + assertThat(bigQueryArrowResultSetNested.next()).isFalse(); + assertThat(bigQueryArrowResultSetNested.isAfterLast()).isTrue(); + } + + private int resultSetRowCount(BigQueryArrowResultSet resultSet) throws SQLException { + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + } + return rowCount; + } + + // TODO: Unit Test for iteration and getters +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStructTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStructTest.java new file mode 100644 index 0000000000..2c3bedcc4c --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryArrowStructTest.java @@ -0,0 +1,245 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.StandardSQLTypeName.BIGNUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.BOOL; +import static com.google.cloud.bigquery.StandardSQLTypeName.BYTES; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATE; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATETIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.FLOAT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.GEOGRAPHY; +import static com.google.cloud.bigquery.StandardSQLTypeName.INT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.NUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.STRING; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIMESTAMP; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arrowArraySchemaAndValue; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arrowStructOf; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.toArrowStruct; +import static com.google.common.truth.Truth.assertThat; +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; +import static java.time.Month.MARCH; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; +import org.apache.arrow.vector.util.Text; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +public class BigQueryArrowStructTest { + + @Rule public final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + private Struct structWithPrimitiveValues; + + @Before + public void setUp() { + Tuple> schemaAndValues = + arrowStructOf( + Tuple.of(INT64, Long.valueOf("10")), + Tuple.of(BOOL, TRUE), + Tuple.of(FLOAT64, Double.valueOf("11.2")), + Tuple.of(NUMERIC, new BigDecimal("11.2657")), + Tuple.of(BIGNUMERIC, new BigDecimal("11.2657")), + Tuple.of(STRING, new Text("one")), + Tuple.of(TIMESTAMP, Long.valueOf("1680174859820227")), // 2023-03-30 16:44:19.82 + Tuple.of(DATE, 19446), // 2023-03-30 + Tuple.of(TIME, Long.valueOf("40459820227")), + Tuple.of(DATETIME, LocalDateTime.parse("2023-03-30T11:14:19.820227")), + Tuple.of(GEOGRAPHY, new Text("POINT(-122 47)")), + Tuple.of(BYTES, "one".getBytes())); + + structWithPrimitiveValues = new BigQueryArrowStruct(schemaAndValues.x(), schemaAndValues.y()); + } + + @Test + public void structOfPrimitives() throws SQLException { + assertThat(structWithPrimitiveValues.getAttributes()) + .isEqualTo( + asList( + 10L, + true, + 11.2, + new BigDecimal("11.2657"), + new BigDecimal("11.2657"), + "one", + Timestamp.valueOf(LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820227000)), + Date.valueOf(LocalDate.of(2023, MARCH, 30)), + Time.valueOf(LocalTime.of(11, 14, 19, 820227)), + Timestamp.valueOf("2023-03-30 11:14:19.820227"), + "POINT(-122 47)", + "one".getBytes()) + .toArray()); + } + + @Test + public void structOfArrays() throws SQLException { + LocalDateTime aTimeStamp = LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820227000); + LocalDate aDate = LocalDate.of(2023, MARCH, 30); + LocalTime aTime = LocalTime.of(11, 14, 19, 820227); + List>> schemaAndValues = + Arrays.asList( + arrowArraySchemaAndValue(INT64, 10L, 20L), + arrowArraySchemaAndValue(BOOL, Boolean.TRUE, FALSE), + arrowArraySchemaAndValue(FLOAT64, Double.valueOf("11.2"), Double.valueOf("33.4")), + arrowArraySchemaAndValue(NUMERIC, new BigDecimal("11.2657"), new BigDecimal("33.4657")), + arrowArraySchemaAndValue( + BIGNUMERIC, new BigDecimal("11.2657"), new BigDecimal("33.4657")), + arrowArraySchemaAndValue(STRING, new Text("one"), new Text("two")), + arrowArraySchemaAndValue( + TIMESTAMP, Long.valueOf("1680174859820227"), Long.valueOf("1680261259820227")), + arrowArraySchemaAndValue(DATE, 19446, 19447), + arrowArraySchemaAndValue( + TIME, Long.valueOf("40459820227"), Long.valueOf("40460820227")), + arrowArraySchemaAndValue( + DATETIME, + LocalDateTime.parse("2023-03-30T11:14:19.820227"), + LocalDateTime.parse("2023-03-30T11:15:19.820227")), + arrowArraySchemaAndValue( + GEOGRAPHY, new Text("POINT(-122 47)"), new Text("POINT(-122 48)")), + arrowArraySchemaAndValue( + BYTES, Stream.of("one", "two").map(String::getBytes).toArray(byte[][]::new))); + + List orderedSchemas = + schemaAndValues.stream().map(Tuple::x).collect(Collectors.toList()); + JsonStringHashMap jsonStringHashMap = toArrowStruct(schemaAndValues); + + Struct struct = new BigQueryArrowStruct(FieldList.of(orderedSchemas), jsonStringHashMap); + + Object[] attributes = struct.getAttributes(); + assertThat(((Array) attributes[0]).getArray()).isEqualTo(new Long[] {10L, 20L}); + assertThat(((Array) attributes[1]).getArray()).isEqualTo(new Boolean[] {true, false}); + assertThat(((Array) attributes[2]).getArray()).isEqualTo(new Double[] {11.2, 33.4}); + assertThat(((Array) attributes[3]).getArray()) + .isEqualTo(new BigDecimal[] {new BigDecimal("11.2657"), new BigDecimal("33.4657")}); + assertThat(((Array) attributes[4]).getArray()) + .isEqualTo(new BigDecimal[] {new BigDecimal("11.2657"), new BigDecimal("33.4657")}); + assertThat(((Array) attributes[5]).getArray()).isEqualTo(new String[] {"one", "two"}); + assertThat(((Array) attributes[6]).getArray()) + .isEqualTo( + new Timestamp[] { + Timestamp.valueOf(aTimeStamp), // 2023-03-30 16:44:19.82 + Timestamp.valueOf(aTimeStamp.plusDays(1)) + }); + assertThat(((Array) attributes[7]).getArray()) + .isEqualTo(new Date[] {Date.valueOf(aDate), Date.valueOf(aDate.plusDays(1))}); + assertThat(((Array) attributes[8]).getArray()) + .isEqualTo(new Time[] {Time.valueOf(aTime), Time.valueOf(aTime.plusSeconds(1))}); + assertThat(((Array) attributes[9]).getArray()) // DATETIME + .isEqualTo( + new Timestamp[] { + Timestamp.valueOf("2023-03-30 11:14:19.820227"), + Timestamp.valueOf("2023-03-30 11:15:19.820227") + }); + assertThat(((Array) attributes[10]).getArray()) + .isEqualTo(new String[] {"POINT(-122 47)", "POINT(-122 48)"}); + assertThat(((Array) attributes[11]).getArray()) + .isEqualTo(new byte[][] {"one".getBytes(), "two".getBytes()}); + } + + @Test + public void structOfStructs() throws SQLException { + FieldList profileSchema = + FieldList.of( + Field.of("name", LegacySQLTypeName.STRING), + Field.of("age", LegacySQLTypeName.INTEGER), + Field.of("adult", LegacySQLTypeName.BOOLEAN)); + FieldList addressSchema = + FieldList.of( + Field.of("state", LegacySQLTypeName.STRING), + Field.of("zip", LegacySQLTypeName.INTEGER)); + FieldList rootStructSchema = + FieldList.of( + Field.of("profile", LegacySQLTypeName.RECORD, profileSchema), + Field.of("address", LegacySQLTypeName.RECORD, addressSchema)); + + JsonStringHashMap profileValue = + new JsonStringHashMap() { + { + put("name", new Text("Arya")); + put("age", 15L); + put("adult", FALSE); + } + }; + JsonStringHashMap addressValue = + new JsonStringHashMap() { + { + put("state", new Text("Michigan")); + put("zip", 49086L); + } + }; + JsonStringHashMap rootStructValue = + new JsonStringHashMap() { + { + put("profile", profileValue); + put("address", addressValue); + } + }; + + Struct struct = new BigQueryArrowStruct(rootStructSchema, rootStructValue); + Object[] attributes = struct.getAttributes(); + Struct profileStruct = (Struct) attributes[0]; + Struct addressStruct = (Struct) attributes[1]; + + assertThat(profileStruct.getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(addressStruct.getAttributes()).isEqualTo(asList("Michigan", 49086L).toArray()); + } + + @Test + public void getSQLTypeNameIsNotSupported() { + Exception exception = + assertThrows( + SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName); + assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Test + public void getAttributesWithCustomTypeMappingsIsNotSupported() { + Exception exception = + assertThrows( + SQLFeatureNotSupportedException.class, + () -> structWithPrimitiveValues.getAttributes(emptyMap())); + assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSetTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSetTest.java new file mode 100644 index 0000000000..90dad9935a --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSetTest.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertFalse; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.CALLS_REAL_METHODS; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import java.lang.reflect.Field; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryBaseResultSetTest { + private BigQuery bigQuery; + private BigQueryBaseResultSet resultSet; + private Job job; + private QueryStatistics statistics; + + @Before + public void setUp() { + // Using mock() for QueryStatistics because Builder() seems to not be available + // from outside. + bigQuery = mock(BigQuery.class); + job = mock(Job.class); + doReturn(job).when(bigQuery).getJob(any(JobId.class)); + + statistics = mock(QueryStatistics.class); + doReturn(statistics).when(job).getStatistics(); + + resultSet = mock(BigQueryBaseResultSet.class, CALLS_REAL_METHODS); + try { + Field field = BigQueryBaseResultSet.class.getDeclaredField("bigQuery"); + field.setAccessible(true); + field.set(resultSet, bigQuery); + } catch (Exception e) { + assertFalse(true); + } + } + + @Test + public void testGetQueryId() { + resultSet.setQueryId("queryId"); + assertThat(resultSet.getQueryId()).isEqualTo("queryId"); + } + + @Test + public void testGetJobId() { + resultSet.setJobId(JobId.of("jobId")); + assertThat(resultSet.getJobId()).isEqualTo(JobId.of("jobId")); + } + + @Test + public void testGetQueryStatistics() { + resultSet.setJobId(JobId.of("jobId")); + assertThat(resultSet.getQueryStatistics()).isInstanceOf(QueryStatistics.class); + } + + @Test + public void testGetQueryStatisticsCaching() { + resultSet.setJobId(JobId.of("jobId")); + assertThat(resultSet.getQueryStatistics()).isInstanceOf(QueryStatistics.class); + // Change return value to null to ensure lazy init saved the state + doReturn(null).when(job).getStatistics(); + assertThat(resultSet.getQueryStatistics()).isInstanceOf(QueryStatistics.class); + } + + @Test + public void testGetQueryStatistics_no_client() { + resultSet = mock(BigQueryBaseResultSet.class, CALLS_REAL_METHODS); + assertThat(resultSet.getQueryStatistics()).isNull(); + } + + @Test + public void testGetQueryStatistics_no_job_id() { + assertThat(resultSet.getQueryStatistics()).isNull(); + } + + @Test + public void testGetQueryStatistics_no_job() { + doReturn(job).when(bigQuery).getJob(any(JobId.class)); + assertThat(resultSet.getQueryStatistics()).isNull(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBigQueryTypeCoercerBuilderTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBigQueryTypeCoercerBuilderTest.java new file mode 100644 index 0000000000..4af1632456 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryBigQueryTypeCoercerBuilderTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.jdbc.TestType.Text; +import org.junit.Test; + +public class BigQueryBigQueryTypeCoercerBuilderTest { + + @Test + public void shouldBeAbleToConvertCustomTypes() { + byte[] bytesArray = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33}; + Text text = new Text(bytesArray); + + BigQueryTypeCoercer bigQueryTypeCoercer = + new BigQueryTypeCoercerBuilder().registerTypeCoercion(new TextToStringCoercion()).build(); + + assertThat(bigQueryTypeCoercer.coerceTo(String.class, text)).isEqualTo("Hello World!"); + } + + private static class TextToStringCoercion implements BigQueryCoercion { + @Override + public String coerce(Text value) { + return new String(value.getBytes()); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatementTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatementTest.java new file mode 100644 index 0000000000..f9729bf21e --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatementTest.java @@ -0,0 +1,1118 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.BigQueryParameterHandler.BigQueryStatementParameterType; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.math.BigDecimal; +import java.sql.*; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Map; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryCallableStatementTest { + + private BigQueryConnection bigQueryConnection; + private static final String GET_PARAM_KEY = "ParamKey"; + private static final String PARAM_KEY = GET_PARAM_KEY; + + @Before + public void setUp() throws IOException, SQLException { + bigQueryConnection = mock(BigQueryConnection.class); + } + + @Test + public void testCreateCallableStatement() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc"); + assertNotNull(statement); + + assertEquals("call testProc", statement.getCallableStatementSql()); + } + + @Test + public void testRegisterOutParamIndexVarchar() throws SQLException { + registerOutParamIndexHelper(1, Types.VARCHAR, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamIndexNVarchar() throws SQLException { + registerOutParamIndexHelper(1, Types.NVARCHAR, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamIndexBigInt() throws SQLException { + registerOutParamIndexHelper(1, Types.BIGINT, Long.class, StandardSQLTypeName.INT64, -1); + } + + @Test + public void testRegisterOutParamIndexInteger() throws SQLException { + registerOutParamIndexHelper(1, Types.INTEGER, Integer.class, StandardSQLTypeName.INT64, -1); + } + + @Test + public void testRegisterOutParamIndexBoolean() throws SQLException { + registerOutParamIndexHelper(1, Types.BOOLEAN, Boolean.class, StandardSQLTypeName.BOOL, -1); + } + + @Test + public void testRegisterOutParamIndexDouble() throws SQLException { + registerOutParamIndexHelper(1, Types.DOUBLE, Double.class, StandardSQLTypeName.FLOAT64, -1); + } + + @Test + public void testRegisterOutParamIndexFloat() throws SQLException { + registerOutParamIndexHelper(1, Types.FLOAT, Float.class, StandardSQLTypeName.FLOAT64, -1); + } + + @Test + public void testRegisterOutParamIndexNumeric() throws SQLException { + registerOutParamIndexHelper(1, Types.NUMERIC, BigDecimal.class, StandardSQLTypeName.NUMERIC, 2); + } + + @Test + public void testRegisterOutParamIndexTimestamp() throws SQLException { + registerOutParamIndexHelper( + 1, Types.TIMESTAMP, Timestamp.class, StandardSQLTypeName.TIMESTAMP, -1); + } + + @Test + public void testRegisterOutParamIndexDate() throws SQLException { + registerOutParamIndexHelper(1, Types.DATE, Date.class, StandardSQLTypeName.DATE, -1); + } + + @Test + public void testRegisterOutParamIndexTime() throws SQLException { + registerOutParamIndexHelper(1, Types.TIME, Time.class, StandardSQLTypeName.TIME, -1); + } + + @Test + public void testRegisterOutParamIndexOther() throws SQLException { + registerOutParamIndexHelper(1, Types.OTHER, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamIndexBinary() throws SQLException { + registerOutParamIndexHelper(1, Types.BINARY, byte[].class, StandardSQLTypeName.BYTES, -1); + } + + @Test + public void testRegisterOutParamIndexVarBinary() throws SQLException { + registerOutParamIndexHelper(1, Types.VARBINARY, byte[].class, StandardSQLTypeName.BYTES, -1); + } + + @Test + public void testRegisterOutParamIndexStruct() throws SQLException { + registerOutParamIndexHelper(1, Types.STRUCT, Struct.class, StandardSQLTypeName.STRUCT, -1); + } + + @Test + public void testRegisterOutParamIndexArray() throws SQLException { + registerOutParamIndexHelper(1, Types.ARRAY, Array.class, StandardSQLTypeName.ARRAY, -1); + } + + @Test + public void testRegisterOutParamIndexBit() throws SQLException { + registerOutParamIndexHelper(1, Types.BIT, Boolean.class, StandardSQLTypeName.BOOL, -1); + } + + @Test + public void testRegisterOutParamNameVarchar() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.VARCHAR, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamNameNVarchar() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.NVARCHAR, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamNameBigInt() throws SQLException { + registerOutParamNameHelper("ParamKey", Types.BIGINT, Long.class, StandardSQLTypeName.INT64, -1); + } + + @Test + public void testRegisterOutParamNameInteger() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.INTEGER, Integer.class, StandardSQLTypeName.INT64, -1); + } + + @Test + public void testRegisterOutParamNameBoolean() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.BOOLEAN, Boolean.class, StandardSQLTypeName.BOOL, -1); + } + + @Test + public void testRegisterOutParamNameDouble() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.DOUBLE, Double.class, StandardSQLTypeName.FLOAT64, -1); + } + + @Test + public void testRegisterOutParamNameFloat() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.FLOAT, Float.class, StandardSQLTypeName.FLOAT64, -1); + } + + @Test + public void testRegisterOutParamNameNumeric() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.NUMERIC, BigDecimal.class, StandardSQLTypeName.NUMERIC, 2); + } + + @Test + public void testRegisterOutParamNameTimestamp() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.TIMESTAMP, Timestamp.class, StandardSQLTypeName.TIMESTAMP, -1); + } + + @Test + public void testRegisterOutParamNameDate() throws SQLException { + registerOutParamNameHelper("ParamKey", Types.DATE, Date.class, StandardSQLTypeName.DATE, -1); + } + + @Test + public void testRegisterOutParamNameTime() throws SQLException { + registerOutParamNameHelper("ParamKey", Types.TIME, Time.class, StandardSQLTypeName.TIME, -1); + } + + @Test + public void testRegisterOutParamNameOther() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.OTHER, String.class, StandardSQLTypeName.STRING, -1); + } + + @Test + public void testRegisterOutParamNameBinary() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.BINARY, byte[].class, StandardSQLTypeName.BYTES, -1); + } + + @Test + public void testRegisterOutParamNameVarBinary() throws SQLException { + registerOutParamNameHelper( + "ParamKey", Types.VARBINARY, byte[].class, StandardSQLTypeName.BYTES, -1); + } + + @Test + public void testRegisterOutParamNameStruct() throws SQLException { + registerOutParamIndexHelper(1, Types.STRUCT, Struct.class, StandardSQLTypeName.STRUCT, -1); + } + + @Test + public void testRegisterOutParamNameArray() throws SQLException { + registerOutParamNameHelper("ParamKey", Types.ARRAY, Array.class, StandardSQLTypeName.ARRAY, -1); + } + + @Test + public void testRegisterOutParamNameBit() throws SQLException { + registerOutParamNameHelper("ParamKey", Types.BIT, Boolean.class, StandardSQLTypeName.BOOL, -1); + } + + @Test + public void testRegisterOutParamIndexScaleFail() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + assertThrows( + IllegalArgumentException.class, () -> statement.registerOutParameter(1, Types.VARCHAR, 3)); + } + + @Test + public void testRegisterOutNameIndexScaleFail() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + assertThrows( + IllegalArgumentException.class, + () -> statement.registerOutParameter("ParamKey", Types.VARCHAR, 3)); + } + + @Test + public void testGetArrayParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Array expected = mock(Array.class); + + statement.getParameterHandler().setParameter(1, expected, Array.class); + Array actual = statement.getArray(1); + assertEquals(expected, actual); + } + + @Test + public void testGetArrayParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Array expected = mock(Array.class); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Array.class, BigQueryStatementParameterType.IN, 0); + Array actual = statement.getArray(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetBigDecimalParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + BigDecimal expected = mock(BigDecimal.class); + + statement.getParameterHandler().setParameter(1, expected, BigDecimal.class); + BigDecimal actual = statement.getBigDecimal(1); + assertEquals(expected, actual); + } + + @Test + public void testGetBigDecimalParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + BigDecimal expected = mock(BigDecimal.class); + + statement + .getParameterHandler() + .setParameter( + GET_PARAM_KEY, expected, BigDecimal.class, BigQueryStatementParameterType.IN, 0); + BigDecimal actual = statement.getBigDecimal(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetBooleanParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Boolean expected = true; + + statement.getParameterHandler().setParameter(1, expected, Boolean.class); + Boolean actual = statement.getBoolean(1); + assertEquals(expected, actual); + } + + @Test + public void testGetBooleanParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Boolean expected = true; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Boolean.class, BigQueryStatementParameterType.IN, 0); + Boolean actual = statement.getBoolean(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetByteParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Byte expected = "hello".getBytes()[0]; + + statement.getParameterHandler().setParameter(1, expected, Byte.class); + Byte actual = statement.getByte(1); + assertEquals(expected, actual); + } + + @Test + public void testGetByteParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Byte expected = "hello".getBytes()[0]; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Byte.class, BigQueryStatementParameterType.IN, 0); + Byte actual = statement.getByte(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetBytesParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + byte[] expected = "hello".getBytes(); + + statement.getParameterHandler().setParameter(1, expected, byte[].class); + byte[] actual = statement.getBytes(1); + assertEquals(expected, actual); + } + + @Test + public void testGetBytesParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + byte[] expected = "hello".getBytes(); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, byte[].class, BigQueryStatementParameterType.IN, 0); + byte[] actual = statement.getBytes(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetCharacterStreamParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + Reader actual = statement.getCharacterStream(1); + assertNotNull(actual); + assertTrue(actual instanceof StringReader); + } + + @Test + public void testGetCharacterStreamParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + Reader actual = statement.getCharacterStream(GET_PARAM_KEY); + assertNotNull(actual); + assertTrue(actual instanceof StringReader); + } + + @Test + public void testGetDateParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Date expected = mock(Date.class); + + statement.getParameterHandler().setParameter(1, expected, Date.class); + Date actual = statement.getDate(1); + assertEquals(expected, actual); + } + + @Test + public void testGetDateParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Date expected = mock(Date.class); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Date.class, BigQueryStatementParameterType.IN, 0); + Date actual = statement.getDate(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetDateParamWithCalByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Date expected = new Date(cal.getTimeInMillis()); + + statement.getParameterHandler().setParameter(1, expected, Date.class); + Date actual = statement.getDate(1, cal); + assertEquals(expected, actual); + } + + @Test + public void testGetDateParamWithCalByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Date expected = new Date(cal.getTimeInMillis()); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Date.class, BigQueryStatementParameterType.IN, 0); + Date actual = statement.getDate(GET_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testGetDoubleParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Double expected = 10.123; + + statement.getParameterHandler().setParameter(1, expected, Double.class); + Double actual = statement.getDouble(1); + assertEquals(expected, actual); + } + + @Test + public void testGetDoubleParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Double expected = 10.123; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Double.class, BigQueryStatementParameterType.IN, 0); + Double actual = statement.getDouble(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetFloatParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Float expected = 10.123F; + + statement.getParameterHandler().setParameter(1, expected, Float.class); + Float actual = statement.getFloat(1); + assertEquals(expected, actual); + } + + @Test + public void testGetFloatParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Float expected = 10.123F; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Float.class, BigQueryStatementParameterType.IN, 0); + Float actual = statement.getFloat(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetIntegerParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Integer expected = 10; + + statement.getParameterHandler().setParameter(1, expected, Integer.class); + Integer actual = statement.getInt(1); + assertEquals(expected, actual); + } + + @Test + public void testGetIntegerParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Integer expected = 10; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Integer.class, BigQueryStatementParameterType.IN, 0); + Integer actual = statement.getInt(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetLongParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 10L; + + statement.getParameterHandler().setParameter(1, expected, Long.class); + Long actual = statement.getLong(1); + assertEquals(expected, actual); + } + + @Test + public void testGetLongParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 10L; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Long.class, BigQueryStatementParameterType.IN, 0); + Long actual = statement.getLong(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetNCharacterStreamParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + Reader actual = statement.getNCharacterStream(1); + assertNotNull(actual); + assertTrue(actual instanceof StringReader); + } + + @Test + public void testGetNCharacterStreamParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + Reader actual = statement.getNCharacterStream(GET_PARAM_KEY); + assertNotNull(actual); + assertTrue(actual instanceof StringReader); + } + + @Test + public void testGetNStringParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + String actual = statement.getNString(1); + assertEquals(expected, actual); + } + + @Test + public void testGetNStringByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + String actual = statement.getNString(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetObjectParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + Object actual = statement.getObject(1); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetObjectParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + Object actual = statement.getObject(GET_PARAM_KEY); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetObjectParamWithMapByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Map> map = new HashMap<>(); + map.putIfAbsent(StandardSQLTypeName.STRING.name(), String.class); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + Object actual = statement.getObject(1, map); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetObjectParamWithMapByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Map> map = new HashMap<>(); + map.putIfAbsent(StandardSQLTypeName.STRING.name(), String.class); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + Object actual = statement.getObject(GET_PARAM_KEY, map); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetObjectParamWithClassByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + Object actual = statement.getObject(1, String.class); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetObjectParamWithClassByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + Object actual = statement.getObject(GET_PARAM_KEY, String.class); + assertEquals(expected, actual.toString()); + } + + @Test + public void testGetStringParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "test"; + + statement.getParameterHandler().setParameter(1, expected, String.class); + String actual = statement.getString(1); + assertEquals(expected, actual); + } + + @Test + public void testGetStringParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "test"; + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, String.class, BigQueryStatementParameterType.IN, 0); + String actual = statement.getString(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetTimeParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Time expected = mock(Time.class); + + statement.getParameterHandler().setParameter(1, expected, Time.class); + Time actual = statement.getTime(1); + assertEquals(expected, actual); + } + + @Test + public void testGetTimeParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Time expected = mock(Time.class); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Time.class, BigQueryStatementParameterType.IN, 0); + Time actual = statement.getTime(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetTimeParamWithCalByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Time expected = new Time(cal.getTimeInMillis()); + + statement.getParameterHandler().setParameter(1, expected, Time.class); + Time actual = statement.getTime(1, cal); + assertEquals(expected, actual); + } + + @Test + public void testGetTimeParamWithCalByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Time expected = new Time(cal.getTimeInMillis()); + + statement + .getParameterHandler() + .setParameter(GET_PARAM_KEY, expected, Time.class, BigQueryStatementParameterType.IN, 0); + Time actual = statement.getTime(GET_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testGetTimestampParamByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Timestamp expected = mock(Timestamp.class); + + statement.getParameterHandler().setParameter(1, expected, Timestamp.class); + Timestamp actual = statement.getTimestamp(1); + assertEquals(expected, actual); + } + + @Test + public void testGetTimestampParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Timestamp expected = mock(Timestamp.class); + + statement + .getParameterHandler() + .setParameter( + GET_PARAM_KEY, expected, Timestamp.class, BigQueryStatementParameterType.IN, 0); + Timestamp actual = statement.getTimestamp(GET_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testGetTimestampParamWithCalByIndex() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Timestamp expected = new Timestamp(cal.getTimeInMillis()); + + statement.getParameterHandler().setParameter(1, expected, Timestamp.class); + Timestamp actual = statement.getTimestamp(1, cal); + assertEquals(expected, actual); + } + + @Test + public void testGetTimestampParamWithCalByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Calendar cal = Calendar.getInstance(); + Timestamp expected = new Timestamp(cal.getTimeInMillis()); + + statement + .getParameterHandler() + .setParameter( + GET_PARAM_KEY, expected, Timestamp.class, BigQueryStatementParameterType.IN, 0); + Timestamp actual = statement.getTimestamp(GET_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testSetBigDecimalParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + BigDecimal expected = mock(BigDecimal.class); + + statement.setBigDecimal(PARAM_KEY, expected); + BigDecimal actual = statement.getBigDecimal(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetBooleanParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Boolean expected = true; + + statement.setBoolean(PARAM_KEY, expected); + Boolean actual = statement.getBoolean(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetByteParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Byte expected = "hello".getBytes()[0]; + + statement.setByte(PARAM_KEY, expected); + Byte actual = statement.getByte(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetByteArrayParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + byte[] expected = "heelo".getBytes(); + + statement.setBytes(PARAM_KEY, expected); + byte[] actual = statement.getBytes(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetDateParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Date expected = mock(Date.class); + statement.setDate(PARAM_KEY, expected); + Date actual = statement.getDate(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetDateCalParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Date expectedDate = mock(Date.class); + Calendar expectedCal = mock(Calendar.class); + + doReturn(1L).when(expectedDate).getTime(); + doReturn(1L).when(expectedCal).getTime(); + doReturn(1L).when(expectedCal).getTimeInMillis(); + statement.setDate(PARAM_KEY, expectedDate, expectedCal); + Date actual = statement.getDate(PARAM_KEY); + assertEquals(new Date(1L), actual); + actual = statement.getDate(PARAM_KEY, expectedCal); + assertEquals(new Date(1L), actual); + } + + @Test + public void testSetDoubleParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Double expected = 123.123; + statement.setDouble(PARAM_KEY, expected); + Double actual = statement.getDouble(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetFloatParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Float expected = 123.123F; + statement.setFloat(PARAM_KEY, expected); + Float actual = statement.getFloat(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetIntParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Integer expected = 1; + statement.setInt(PARAM_KEY, expected); + Integer actual = statement.getInt(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetLongParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 1L; + statement.setLong(PARAM_KEY, expected); + Long actual = statement.getLong(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetObjectParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 1L; + statement.setObject(PARAM_KEY, expected); + Long actual = statement.getObject(PARAM_KEY, Long.class); + assertEquals(expected, actual); + } + + @Test + public void testSetObjectSqlTypeParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 1L; + statement.setObject(PARAM_KEY, expected, java.sql.Types.BIGINT); + Long actual = statement.getObject(PARAM_KEY, Long.class); + assertEquals(expected, actual); + } + + @Test + public void testSetObjectSqlTypeScaleParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Long expected = 1L; + statement.setObject(PARAM_KEY, expected, java.sql.Types.BIGINT, 5); + Long actual = statement.getObject(PARAM_KEY, Long.class); + assertEquals(expected, actual); + int scale = statement.getParameterHandler().getParameterScale(PARAM_KEY); + assertEquals(5, scale); + } + + @Test + public void testSetStringParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + String expected = "hello"; + statement.setString(PARAM_KEY, expected); + String actual = statement.getString(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetTimeParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Time expected = mock(Time.class); + statement.setTime(PARAM_KEY, expected); + Time actual = statement.getTime(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetTimeCalParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Time expectedTime = mock(Time.class); + Calendar expectedCal = mock(Calendar.class); + + doReturn(1L).when(expectedTime).getTime(); + doReturn(1L).when(expectedCal).getTime(); + doReturn(1L).when(expectedCal).getTimeInMillis(); + statement.setTime(PARAM_KEY, expectedTime, expectedCal); + Time actual = statement.getTime(PARAM_KEY); + assertEquals(new Time(1L), actual); + actual = statement.getTime(PARAM_KEY, expectedCal); + assertEquals(new Time(1L), actual); + } + + @Test + public void testSetTimestampParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Timestamp expected = mock(Timestamp.class); + statement.setTimestamp(PARAM_KEY, expected); + Timestamp actual = statement.getTimestamp(PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetTimestampCalParamByName() throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + Timestamp expectedTimestamp = mock(Timestamp.class); + Calendar expectedCal = mock(Calendar.class); + + doReturn(1L).when(expectedTimestamp).getTime(); + doReturn(1L).when(expectedCal).getTime(); + doReturn(1L).when(expectedCal).getTimeInMillis(); + statement.setTimestamp(PARAM_KEY, expectedTimestamp, expectedCal); + Timestamp actual = statement.getTimestamp(PARAM_KEY); + assertEquals(new Timestamp(1L), actual); + actual = statement.getTimestamp(PARAM_KEY, expectedCal); + assertEquals(new Timestamp(1L), actual); + } + + ////////// Private helper methods //////////////////////// + private void registerOutParamIndexHelper( + int paramIndex, int javaSqlType, Class javaType, StandardSQLTypeName sqlType, int scale) + throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + + if (scale >= 0) { + statement.registerOutParameter(paramIndex, javaSqlType, scale); + } else { + statement.registerOutParameter(paramIndex, javaSqlType); + } + BigQueryParameterHandler paramHandler = statement.getParameterHandler(); + assertNotNull(paramHandler); + + assertNull(paramHandler.getParameter(paramIndex)); + assertEquals(BigQueryStatementParameterType.OUT, paramHandler.getParameterType(paramIndex)); + assertEquals(scale, paramHandler.getParameterScale(paramIndex)); + assertEquals(javaType, paramHandler.getType(paramIndex)); + assertEquals(sqlType, paramHandler.getSqlType(paramIndex)); + } + + private void registerOutParamNameHelper( + String paramName, int javaSqlType, Class javaType, StandardSQLTypeName sqlType, int scale) + throws SQLException { + BigQueryCallableStatement statement = + new BigQueryCallableStatement(bigQueryConnection, "call testProc('?')"); + assertNotNull(statement); + + if (scale >= 0) { + statement.registerOutParameter(paramName, javaSqlType, scale); + } else { + statement.registerOutParameter(paramName, javaSqlType); + } + BigQueryParameterHandler paramHandler = statement.getParameterHandler(); + assertNotNull(paramHandler); + + assertNull(paramHandler.getParameter(paramName)); + assertEquals(BigQueryStatementParameterType.OUT, paramHandler.getParameterType(paramName)); + assertEquals(scale, paramHandler.getParameterScale(paramName)); + assertEquals(javaType, paramHandler.getType(paramName)); + assertEquals(sqlType, paramHandler.getSqlType(paramName)); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java new file mode 100644 index 0000000000..22f98af07e --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -0,0 +1,343 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.*; + +import com.google.api.gax.rpc.HeaderProvider; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; +import java.io.IOException; +import java.io.InputStream; +import java.sql.SQLException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryConnectionTest { + + private static final String DEFAULT_VERSION = "0.0.0"; + private static final String DEFAULT_JDBC_TOKEN_VALUE = "Google-BigQuery-JDBC-Driver"; + private String expectedVersion; + + @Before + public void setUp() throws IOException { + // Read the expected version from the dependencies.properties file once. + expectedVersion = getExpectedVersion(); + } + + private String getExpectedVersion() { + Properties props = new Properties(); + try (InputStream in = + getClass().getResourceAsStream("/com/google/cloud/bigquery/jdbc/dependencies.properties")) { + if (in != null) { + props.load(in); + String version = props.getProperty("version.jdbc"); + if (version != null) { + return version; + } + } + } catch (IOException e) { + System.err.println("Error reading dependencies.properties: " + e.getMessage()); + } + return DEFAULT_VERSION; + } + + @Test + public void testGetLibraryVersion() throws IOException, SQLException { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + String result = connection.getLibraryVersion(BigQueryConnection.class); + assertEquals(expectedVersion, result); + } + } + + @Test + public void testHeaderProvider() throws IOException, SQLException { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + String agent = headerProvider.getHeaders().get("user-agent"); + assertTrue(agent.startsWith(DEFAULT_JDBC_TOKEN_VALUE + "/" + expectedVersion)); + assertFalse(agent.contains("(GPN:")); + } + } + + @Test + public void testHeaderProviderWithPartnerToken() throws IOException, SQLException { + String partnerTokenString = "(GPN:MyPartner; staging)"; + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;PartnerToken=" + + partnerTokenString; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + String agent = headerProvider.getHeaders().get("user-agent"); + assertTrue( + agent.startsWith( + DEFAULT_JDBC_TOKEN_VALUE + "/" + expectedVersion + " " + partnerTokenString)); + assertTrue(agent.contains("(GPN:")); + assertTrue(agent.contains("MyPartner;")); + assertTrue(agent.contains("staging)")); + } + } + + @Test + public void testHeaderProviderWithEmptyPartnerToken() throws IOException, SQLException { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;PartnerToken="; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + String agent = headerProvider.getHeaders().get("user-agent"); + assertTrue(agent.startsWith(DEFAULT_JDBC_TOKEN_VALUE + "/" + expectedVersion)); + assertFalse(agent.contains("(GPN:")); + } + } + + @Test + public void testHeaderProviderWithPartnerTokenNoEnv() throws IOException, SQLException { + String partnerTokenString = "(GPN:MyPartner)"; + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;PartnerToken=" + + partnerTokenString; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + String agent = headerProvider.getHeaders().get("user-agent"); + assertTrue( + agent.startsWith( + DEFAULT_JDBC_TOKEN_VALUE + "/" + expectedVersion + " " + partnerTokenString)); + assertTrue(agent.contains("GPN:")); + assertTrue(agent.contains("MyPartner")); + } + } + + @Test + public void testHeaderProviderWithInvalidPartner() throws IOException, SQLException { + String partnerTokenString = "(MyPartner; staging)"; + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;PartnerToken=" + + partnerTokenString; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + String agent = headerProvider.getHeaders().get("user-agent"); + assertTrue(agent.startsWith(DEFAULT_JDBC_TOKEN_VALUE + "/" + expectedVersion)); + assertFalse(agent.contains("(MyPartner;")); + assertFalse(agent.contains("(GPN:")); + } + } + + @Test + public void testWriteAPIConnectionProperties() throws SQLException { + // Test without connection properties. Defaults to default values. + String connectionUriDefault = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connectionDefault = new BigQueryConnection(connectionUriDefault)) { + + assertFalse(connectionDefault.enableWriteAPI); + assertEquals(3, connectionDefault.writeAPIActivationRowCount); + assertEquals(1000, connectionDefault.writeAPIAppendRowCount); + } catch (IOException | SQLException e) { + throw new BigQueryJdbcException(e); + } + + // Test with connection properties + String connectionUri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "EnableWriteAPI=1;SWA_ActivationRowCount=6;SWA_AppendRowCount=500"; + try (BigQueryConnection connection = new BigQueryConnection(connectionUri)) { + assertTrue(connection.enableWriteAPI); + assertEquals(6, connection.writeAPIActivationRowCount); + assertEquals(500, connection.writeAPIAppendRowCount); + } catch (IOException | SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testGetWriteClient() throws SQLException { + // Test without connection properties. Defaults to default values. + String connectionUriDefault = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connectionDefault = new BigQueryConnection(connectionUriDefault)) { + assertNull(connectionDefault.bigQueryWriteClient); + // Lazy initialization + BigQueryWriteClient writeClient = connectionDefault.getBigQueryWriteClient(); + assertNotNull(writeClient); + assertFalse(writeClient.isShutdown()); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testAdditionalProjects() throws IOException, BigQueryJdbcException { + String url1 = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "AdditionalProjects=projA,projB"; + try (BigQueryConnection conn1 = new BigQueryConnection(url1)) { + List additionalProjects1 = conn1.getAdditionalProjects(); + assertNotNull(additionalProjects1); + assertEquals(Arrays.asList("projA", "projB"), additionalProjects1); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + String url2 = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "AdditionalProjects=projX"; + try (BigQueryConnection conn2 = new BigQueryConnection(url2)) { + List additionalProjects2 = conn2.getAdditionalProjects(); + assertNotNull(additionalProjects2); + assertEquals(Collections.singletonList("projX"), additionalProjects2); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testFilterTablesOnDefaultDatasetProperty() throws SQLException, IOException { + // Test default value + String urlDefault = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connectionDefault = new BigQueryConnection(urlDefault)) { + assertFalse( + "Default value for FilterTablesOnDefaultDataset should be false", + connectionDefault.isFilterTablesOnDefaultDataset()); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + + // Test explicitly setting to true + String urlTrue = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "FilterTablesOnDefaultDataset=1;"; + try (BigQueryConnection connectionTrue = new BigQueryConnection(urlTrue)) { + assertTrue( + "FilterTablesOnDefaultDataset should be true when set to 1", + connectionTrue.isFilterTablesOnDefaultDataset()); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testRequestGoogleDriveScopeProperty() throws IOException, SQLException { + // Test enabled + String urlEnabled = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "RequestGoogleDriveScope=1;"; + try (BigQueryConnection connectionEnabled = new BigQueryConnection(urlEnabled)) { + assertEquals( + "RequestGoogleDriveScope should be enabled when set to 1", + 1, + connectionEnabled.isRequestGoogleDriveScope()); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + + // Test disabled + String urlDisabled = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "RequestGoogleDriveScope=0;"; + try (BigQueryConnection connectionDisabled = new BigQueryConnection(urlDisabled)) { + assertEquals( + "RequestGoogleDriveScope should be disabled when set to 0", + 0, + connectionDisabled.isRequestGoogleDriveScope()); + } catch (SQLException | IOException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testMetaDataFetchThreadCountProperty() throws SQLException, IOException { + // Test Case 1: Should use the default value when the property is not specified. + String urlDefault = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connectionDefault = new BigQueryConnection(urlDefault)) { + assertEquals( + "Should use the default value when the property is not set", + BigQueryJdbcUrlUtility.DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE, + connectionDefault.getMetadataFetchThreadCount()); + } + + // Test Case 2: Should use the custom value when a valid integer is provided. + String urlCustom = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;" + + "MetaDataFetchThreadCount=16;"; + try (BigQueryConnection connectionCustom = new BigQueryConnection(urlCustom)) { + assertEquals( + "Should use the custom value when a valid integer is provided", + 16, + connectionCustom.getMetadataFetchThreadCount()); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java new file mode 100644 index 0000000000..b99ff4bec5 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDaemonPollingTaskTest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.bigquery.jdbc.BigQueryResultSetFinalizers.ArrowResultSetFinalizer; +import java.lang.ref.ReferenceQueue; +import java.util.ArrayList; +import java.util.List; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryDaemonPollingTaskTest { + + static ReferenceQueue referenceQueueArrowRs; + static ReferenceQueue referenceQueueJsonRs; + static List arrowResultSetFinalizers; + static List jsonResultSetFinalizers; + + @Before + public void setUp() { + referenceQueueArrowRs = new ReferenceQueue<>(); + referenceQueueJsonRs = new ReferenceQueue<>(); + arrowResultSetFinalizers = new ArrayList<>(); + jsonResultSetFinalizers = new ArrayList<>(); + } + + @Test + public void testStartGcDaemonTask() { + + // start the Daemon first and then make sure it doesn't get started again + BigQueryDaemonPollingTask.startGcDaemonTask( + referenceQueueArrowRs, + referenceQueueJsonRs, + arrowResultSetFinalizers, + jsonResultSetFinalizers); // Daemon thread might have already started by the Junit at + // BigQueryStatementTest, hence we ignore the response here and + // check it on the line below + + assertThat( + BigQueryDaemonPollingTask.startGcDaemonTask( + referenceQueueArrowRs, + referenceQueueJsonRs, + arrowResultSetFinalizers, + jsonResultSetFinalizers)) + .isFalse(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java new file mode 100644 index 0000000000..536aae15bf --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaDataTest.java @@ -0,0 +1,3209 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.*; + +import com.google.api.gax.paging.Page; +import com.google.cloud.bigquery.*; +import com.google.cloud.bigquery.BigQuery.RoutineListOption; +import java.io.IOException; +import java.io.InputStream; +import java.sql.DatabaseMetaData; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Types; +import java.util.*; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.regex.Pattern; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryDatabaseMetaDataTest { + + private BigQueryConnection bigQueryConnection; + private BigQueryDatabaseMetaData dbMetadata; + private BigQuery bigqueryClient; + + @Before + public void setUp() throws SQLException { + bigQueryConnection = mock(BigQueryConnection.class); + bigqueryClient = mock(BigQuery.class); + Statement mockStatement = mock(Statement.class); + + when(bigQueryConnection.getConnectionUrl()).thenReturn("jdbc:bigquery://test-project"); + when(bigQueryConnection.getBigQuery()).thenReturn(bigqueryClient); + when(bigQueryConnection.createStatement()).thenReturn(mockStatement); + + dbMetadata = new BigQueryDatabaseMetaData(bigQueryConnection); + } + + private Table mockBigQueryTable( + String project, String dataset, String table, TableDefinition.Type type, String description) { + Table mockTable = mock(Table.class); + TableId mockTableId = TableId.of(project, dataset, table); + TableDefinition mockDefinition = mock(TableDefinition.class); + + when(mockTable.getTableId()).thenReturn(mockTableId); + when(mockTable.getDefinition()).thenReturn(mockDefinition); + when(mockDefinition.getType()).thenReturn(type); + when(mockTable.getDescription()).thenReturn(description); + + return mockTable; + } + + private StandardSQLDataType mockStandardSQLDataType(StandardSQLTypeName typeKind) { + StandardSQLDataType mockDataType = mock(StandardSQLDataType.class); + when(mockDataType.getTypeKind()).thenReturn(typeKind.name()); + return mockDataType; + } + + private RoutineArgument mockRoutineArgument(String name, StandardSQLTypeName type, String mode) { + RoutineArgument mockArg = mock(RoutineArgument.class); + when(mockArg.getName()).thenReturn(name); + StandardSQLDataType mockDataType = mockStandardSQLDataType(type); + when(mockArg.getDataType()).thenReturn(mockDataType); + when(mockArg.getMode()).thenReturn(mode); // "IN", "OUT", "INOUT", or null + return mockArg; + } + + private Routine mockBigQueryRoutineWithArgs( + String project, + String dataset, + String routineName, + String routineType, + String description, + List arguments) { + Routine mockRoutine = mock(Routine.class); + RoutineId mockRoutineId = RoutineId.of(project, dataset, routineName); + when(mockRoutine.getRoutineId()).thenReturn(mockRoutineId); + when(mockRoutine.getRoutineType()).thenReturn(routineType); + when(mockRoutine.getDescription()).thenReturn(description); + if (arguments != null) { + when(mockRoutine.getArguments()).thenReturn(arguments); + } else { + when(mockRoutine.getArguments()).thenReturn(Collections.emptyList()); + } + return mockRoutine; + } + + private StandardSQLTableType mockStandardSQLTableType(List columns) { + StandardSQLTableType mockTableType = mock(StandardSQLTableType.class); + when(mockTableType.getColumns()).thenReturn(columns); + return mockTableType; + } + + private StandardSQLField mockStandardSQLField(String name, StandardSQLTypeName type) { + StandardSQLField mockField = mock(StandardSQLField.class); + StandardSQLDataType mockedDataType = mockStandardSQLDataType(type); + when(mockField.getName()).thenReturn(name); + when(mockField.getDataType()).thenReturn(mockedDataType); + return mockField; + } + + @Test + public void testBigqueryDatabaseMetaDataGetters() throws SQLException { + BigQueryDatabaseMetaData dbMetadata = new BigQueryDatabaseMetaData(bigQueryConnection); + assertEquals("GoogleJDBCDriverForGoogleBigQuery", dbMetadata.getDriverName()); + assertEquals("Google BigQuery", dbMetadata.getDatabaseProductName()); + assertEquals("2.0", dbMetadata.getDatabaseProductVersion()); + assertEquals("Dataset", dbMetadata.getSchemaTerm()); + assertEquals("Procedure", dbMetadata.getProcedureTerm()); + assertEquals("Project", dbMetadata.getCatalogTerm()); + } + + @Test + public void testReadSqlFromFile() throws SQLException { + BigQueryDatabaseMetaData dbMetadata = new BigQueryDatabaseMetaData(bigQueryConnection); + + String primaryKeysQuery = + BigQueryDatabaseMetaData.readSqlFromFile("DatabaseMetaData_GetPrimaryKeys.sql"); + assertTrue(primaryKeysQuery.contains("pk$")); + + try { + when(bigQueryConnection.prepareStatement(primaryKeysQuery)).thenCallRealMethod(); + String sql = + dbMetadata.replaceSqlParameters( + primaryKeysQuery, "project_name", "dataset_name", "table_name"); + assertTrue(sql.contains("project_name.dataset_name.INFORMATION_SCHEMA.KEY_COLUMN_USAGE")); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + @Test + public void testNeedsListing() { + assertTrue("Null pattern should require listing", dbMetadata.needsListing(null)); + assertTrue("Pattern with % should require listing", dbMetadata.needsListing("abc%def")); + assertTrue("Pattern with _ should require listing", dbMetadata.needsListing("abc_def")); + assertTrue("Pattern with both wildcards", dbMetadata.needsListing("a%c_d%f")); + assertFalse("Empty pattern should not require listing", dbMetadata.needsListing("")); + assertFalse("Pattern without wildcards", dbMetadata.needsListing("exactName")); + } + + @Test + public void testCompileSqlLikePattern() { + // Null input -> Null pattern + assertNull(dbMetadata.compileSqlLikePattern(null)); + + // Empty input -> Pattern matching nothing ($^) + Pattern emptyPattern = dbMetadata.compileSqlLikePattern(""); + assertNotNull(emptyPattern); + assertFalse(emptyPattern.matcher("").matches()); + assertFalse(emptyPattern.matcher("a").matches()); + assertEquals("(?!)", emptyPattern.pattern()); + + // Exact match + Pattern exactPattern = dbMetadata.compileSqlLikePattern("tableName"); + assertNotNull(exactPattern); + assertTrue(exactPattern.matcher("tableName").matches()); + assertTrue(exactPattern.matcher("TABLENAME").matches()); + assertFalse(exactPattern.matcher("tableNameX").matches()); + assertFalse(exactPattern.matcher("XtableName").matches()); + + // Percent wildcard (%) -> .* + Pattern percentPattern = dbMetadata.compileSqlLikePattern("table%"); + assertNotNull(percentPattern); + assertTrue(percentPattern.matcher("table").matches()); + assertTrue(percentPattern.matcher("tableName").matches()); + assertTrue(percentPattern.matcher("TABLE_123").matches()); + assertFalse(percentPattern.matcher("myTable").matches()); + + Pattern percentPattern2 = dbMetadata.compileSqlLikePattern("%Name"); + assertNotNull(percentPattern2); + assertTrue(percentPattern2.matcher("Name").matches()); + assertTrue(percentPattern2.matcher("tableName").matches()); + assertTrue(percentPattern2.matcher("VIEW_NAME").matches()); + assertFalse(percentPattern2.matcher("NameSuffix").matches()); + + Pattern percentPattern3 = dbMetadata.compileSqlLikePattern("ta%le"); + assertNotNull(percentPattern3); + assertTrue(percentPattern3.matcher("table").matches()); + assertTrue(percentPattern3.matcher("TALLE").matches()); + assertTrue(percentPattern3.matcher("tale").matches()); + assertFalse(percentPattern3.matcher("table123").matches()); + + // Underscore wildcard (_) -> . + Pattern underscorePattern = dbMetadata.compileSqlLikePattern("t_ble"); + assertNotNull(underscorePattern); + assertTrue(underscorePattern.matcher("table").matches()); + assertTrue(underscorePattern.matcher("tAble").matches()); + assertTrue(underscorePattern.matcher("tXble").matches()); + assertFalse(underscorePattern.matcher("tble").matches()); + assertFalse(underscorePattern.matcher("taable").matches()); + + // Mixed wildcards + Pattern mixedPattern = dbMetadata.compileSqlLikePattern("data_%_set%"); + assertNotNull(mixedPattern); + assertTrue(mixedPattern.matcher("data_1_set").matches()); + assertTrue(mixedPattern.matcher("data_foo_set_bar").matches()); + assertTrue(mixedPattern.matcher("DATA_X_SET").matches()); + assertFalse(mixedPattern.matcher("dataset").matches()); + assertFalse(mixedPattern.matcher("data_set").matches()); + + // Escaping regex metacharacters + Pattern dotPattern = dbMetadata.compileSqlLikePattern("version_1.0"); + assertNotNull(dotPattern); + assertTrue(dotPattern.matcher("version_1.0").matches()); + assertFalse(dotPattern.matcher("version_1X0").matches()); + + Pattern bracketPattern = dbMetadata.compileSqlLikePattern("array[0]"); + assertNotNull(bracketPattern); + assertTrue(bracketPattern.matcher("array[0]").matches()); + assertFalse(bracketPattern.matcher("array_0_").matches()); + } + + @Test + public void testMapBigQueryTypeToJdbc_ScalarTypes() { + // INT64 -> BIGINT + Field fieldInt64 = + Field.newBuilder("test_int", StandardSQLTypeName.INT64) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoInt64 = + dbMetadata.mapBigQueryTypeToJdbc(fieldInt64); + assertEquals(Types.BIGINT, infoInt64.jdbcType); + assertEquals("BIGINT", infoInt64.typeName); + assertEquals(Integer.valueOf(19), infoInt64.columnSize); + assertEquals(Integer.valueOf(0), infoInt64.decimalDigits); + assertEquals(Integer.valueOf(10), infoInt64.numPrecRadix); + + // STRING -> NVARCHAR + Field fieldString = + Field.newBuilder("test_string", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoString = + dbMetadata.mapBigQueryTypeToJdbc(fieldString); + assertEquals(Types.NVARCHAR, infoString.jdbcType); + assertEquals("NVARCHAR", infoString.typeName); + assertNull(infoString.columnSize); + assertNull(infoString.decimalDigits); + assertNull(infoString.numPrecRadix); + + // BOOL -> BOOLEAN + Field fieldBool = + Field.newBuilder("test_bool", StandardSQLTypeName.BOOL) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoBool = dbMetadata.mapBigQueryTypeToJdbc(fieldBool); + assertEquals(Types.BOOLEAN, infoBool.jdbcType); + assertEquals("BOOLEAN", infoBool.typeName); + assertEquals(Integer.valueOf(1), infoBool.columnSize); + + // BYTES -> VARBINARY + Field fieldBytes = + Field.newBuilder("test_bytes", StandardSQLTypeName.BYTES) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoBytes = + dbMetadata.mapBigQueryTypeToJdbc(fieldBytes); + assertEquals(Types.VARBINARY, infoBytes.jdbcType); + assertEquals("VARBINARY", infoBytes.typeName); + assertNull(infoBytes.columnSize); + + // TIMESTAMP -> TIMESTAMP + Field fieldTimestamp = + Field.newBuilder("test_ts", StandardSQLTypeName.TIMESTAMP) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoTimestamp = + dbMetadata.mapBigQueryTypeToJdbc(fieldTimestamp); + assertEquals(Types.TIMESTAMP, infoTimestamp.jdbcType); + assertEquals("TIMESTAMP", infoTimestamp.typeName); + assertEquals(Integer.valueOf(29), infoTimestamp.columnSize); + assertNull(infoTimestamp.decimalDigits); + assertNull(infoTimestamp.numPrecRadix); + + // DATETIME -> TIMESTAMP + Field fieldDateTime = + Field.newBuilder("test_dt", StandardSQLTypeName.DATETIME) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoDateTime = + dbMetadata.mapBigQueryTypeToJdbc(fieldDateTime); + assertEquals(Types.TIMESTAMP, infoDateTime.jdbcType); + assertEquals("TIMESTAMP", infoDateTime.typeName); + assertEquals(Integer.valueOf(29), infoDateTime.columnSize); + assertNull(infoDateTime.decimalDigits); + assertNull(infoDateTime.numPrecRadix); + + // NUMERIC -> NUMERIC + Field fieldNumeric = + Field.newBuilder("test_num", StandardSQLTypeName.NUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoNumeric = + dbMetadata.mapBigQueryTypeToJdbc(fieldNumeric); + assertEquals(Types.NUMERIC, infoNumeric.jdbcType); + assertEquals("NUMERIC", infoNumeric.typeName); + assertEquals(Integer.valueOf(38), infoNumeric.columnSize); + assertEquals(Integer.valueOf(9), infoNumeric.decimalDigits); + assertEquals(Integer.valueOf(10), infoNumeric.numPrecRadix); + + // BIGNUMERIC -> NUMERIC + Field fieldBigNumeric = + Field.newBuilder("test_bignum", StandardSQLTypeName.BIGNUMERIC) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoBigNumeric = + dbMetadata.mapBigQueryTypeToJdbc(fieldBigNumeric); + assertEquals(Types.NUMERIC, infoBigNumeric.jdbcType); + assertEquals("NUMERIC", infoBigNumeric.typeName); + assertEquals(Integer.valueOf(77), infoBigNumeric.columnSize); + assertEquals(Integer.valueOf(38), infoBigNumeric.decimalDigits); + assertEquals(Integer.valueOf(10), infoBigNumeric.numPrecRadix); + + // GEOGRAPHY -> VARCHAR + Field fieldGeo = + Field.newBuilder("test_geo", StandardSQLTypeName.GEOGRAPHY) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoGeo = dbMetadata.mapBigQueryTypeToJdbc(fieldGeo); + assertEquals(Types.VARCHAR, infoGeo.jdbcType); + assertEquals("VARCHAR", infoGeo.typeName); + assertNull(infoGeo.columnSize); + + // DATE + Field fieldDate = + Field.newBuilder("test_date", StandardSQLTypeName.DATE) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoDate = dbMetadata.mapBigQueryTypeToJdbc(fieldDate); + assertEquals(Types.DATE, infoDate.jdbcType); + assertEquals("DATE", infoDate.typeName); + + // TIME + Field fieldTime = + Field.newBuilder("test_time", StandardSQLTypeName.TIME) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoTime = dbMetadata.mapBigQueryTypeToJdbc(fieldTime); + assertEquals(Types.TIME, infoTime.jdbcType); + assertEquals("TIME", infoTime.typeName); + + // STRUCT + Field fieldStruct = + Field.newBuilder( + "test_struct", + StandardSQLTypeName.STRUCT, + Field.of("sub_field", StandardSQLTypeName.STRING)) + .setMode(Field.Mode.NULLABLE) + .build(); + BigQueryDatabaseMetaData.ColumnTypeInfo infoStruct = + dbMetadata.mapBigQueryTypeToJdbc(fieldStruct); + assertEquals(Types.STRUCT, infoStruct.jdbcType); + assertEquals("STRUCT", infoStruct.typeName); + } + + @Test + public void testMapBigQueryTypeToJdbc_ArrayType() { + Field fieldArray = + Field.newBuilder("test_array", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REPEATED) + .build(); + + BigQueryDatabaseMetaData.ColumnTypeInfo infoArray = + dbMetadata.mapBigQueryTypeToJdbc(fieldArray); + assertEquals(Types.ARRAY, infoArray.jdbcType); + assertEquals("ARRAY", infoArray.typeName); + assertNull(infoArray.columnSize); + assertNull(infoArray.decimalDigits); + assertNull(infoArray.numPrecRadix); + } + + @Test + public void testCreateColumnRow() { + Field realField = + Field.newBuilder("user_name", StandardSQLTypeName.STRING) + .setMode(Field.Mode.NULLABLE) + .setDescription("Name of the user") + .build(); + + String catalog = "test-project"; + String schema = "test_dataset"; + String table = "users"; + int ordinalPos = 3; + + List row = + dbMetadata.createColumnRow(catalog, schema, table, realField, ordinalPos); + + assertNotNull(row); + assertEquals(24, row.size()); + + assertEquals(catalog, row.get(0).getStringValue()); // 1. TABLE_CAT + assertEquals(schema, row.get(1).getStringValue()); // 2. TABLE_SCHEM + assertEquals(table, row.get(2).getStringValue()); // 3. TABLE_NAME + assertEquals("user_name", row.get(3).getStringValue()); // 4. COLUMN_NAME + assertEquals(String.valueOf(Types.NVARCHAR), row.get(4).getStringValue()); // 5. DATA_TYPE + assertEquals("NVARCHAR", row.get(5).getStringValue()); // 6. TYPE_NAME + assertTrue(row.get(6).isNull()); // 7. COLUMN_SIZE (was null for STRING) + assertTrue(row.get(7).isNull()); // 8. BUFFER_LENGTH (always null) + assertTrue(row.get(8).isNull()); // 9. DECIMAL_DIGITS (null for STRING) + assertTrue(row.get(9).isNull()); // 10. NUM_PREC_RADIX (null for STRING) + assertEquals( + String.valueOf(DatabaseMetaData.columnNullable), + row.get(10).getStringValue()); // 11. NULLABLE + assertEquals("Name of the user", row.get(11).getStringValue()); // 12. REMARKS + assertTrue(row.get(12).isNull()); // 13. COLUMN_DEF (null) + // 14, 15 unused + assertTrue(row.get(15).isNull()); // 16. CHAR_OCTET_LENGTH (was null) + assertEquals(String.valueOf(ordinalPos), row.get(16).getStringValue()); // 17. ORDINAL_POSITION + assertEquals("YES", row.get(17).getStringValue()); // 18. IS_NULLABLE (YES for NULLABLE mode) + // 19-22 SCOPE/SOURCE (null) + assertEquals("NO", row.get(22).getStringValue()); // 23. IS_AUTOINCREMENT (NO) + assertEquals("NO", row.get(23).getStringValue()); // 24. IS_GENERATEDCOLUMN (NO) + } + + @Test + public void testCreateColumnRow_RequiredInt() { + Field realField = + Field.newBuilder("user_id", StandardSQLTypeName.INT64).setMode(Field.Mode.REQUIRED).build(); + + String catalog = "p"; + String schema = "d"; + String table = "t"; + int ordinalPos = 1; + + List row = + dbMetadata.createColumnRow(catalog, schema, table, realField, ordinalPos); + + assertEquals(24, row.size()); + assertEquals("user_id", row.get(3).getStringValue()); // COLUMN_NAME + assertEquals(String.valueOf(Types.BIGINT), row.get(4).getStringValue()); // DATA_TYPE + assertEquals("BIGINT", row.get(5).getStringValue()); // TYPE_NAME + assertEquals("19", row.get(6).getStringValue()); // COLUMN_SIZE + assertEquals("0", row.get(8).getStringValue()); // DECIMAL_DIGITS + assertEquals("10", row.get(9).getStringValue()); // NUM_PREC_RADIX + assertEquals( + String.valueOf(DatabaseMetaData.columnNoNulls), row.get(10).getStringValue()); // NULLABLE + assertTrue(row.get(11).isNull()); // REMARKS (null description) + assertEquals(String.valueOf(ordinalPos), row.get(16).getStringValue()); // ORDINAL_POSITION + assertEquals("NO", row.get(17).getStringValue()); // IS_NULLABLE (NO for REQUIRED mode) + } + + @Test + public void testDefineGetTablesSchema() { + Schema schema = dbMetadata.defineGetTablesSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(10, fields.size()); + + Field tableCat = fields.get("TABLE_CAT"); + assertEquals("TABLE_CAT", tableCat.getName()); + assertEquals(StandardSQLTypeName.STRING, tableCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, tableCat.getMode()); + + Field tableName = fields.get("TABLE_NAME"); + assertEquals("TABLE_NAME", tableName.getName()); + assertEquals(StandardSQLTypeName.STRING, tableName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, tableName.getMode()); + + Field tableType = fields.get("TABLE_TYPE"); + assertEquals("TABLE_TYPE", tableType.getName()); + assertEquals(StandardSQLTypeName.STRING, tableType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, tableType.getMode()); + + Field remarks = fields.get("REMARKS"); + assertEquals("REMARKS", remarks.getName()); + assertEquals(StandardSQLTypeName.STRING, remarks.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, remarks.getMode()); + + Field refGeneration = fields.get("REF_GENERATION"); + assertEquals("REF_GENERATION", refGeneration.getName()); + assertEquals(StandardSQLTypeName.STRING, refGeneration.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, refGeneration.getMode()); + } + + @Test + public void testProcessTableInfo_Basic() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "proj"; + String schema = "ds"; + String name = "my_table"; + TableDefinition.Type type = TableDefinition.Type.TABLE; + String description = "My test table"; + + Table table = mockBigQueryTable(catalog, schema, name, type, description); + + dbMetadata.processTableInfo(table, null, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertNotNull(row); + assertEquals(10, row.size()); + assertEquals(catalog, row.get("TABLE_CAT").getStringValue()); + assertEquals(schema, row.get("TABLE_SCHEM").getStringValue()); + assertEquals(name, row.get("TABLE_NAME").getStringValue()); + assertEquals(type.toString(), row.get("TABLE_TYPE").getStringValue()); + assertEquals(description, row.get("REMARKS").getStringValue()); + assertTrue(row.get("TYPE_CAT").isNull()); + assertTrue(row.get("TYPE_SCHEM").isNull()); + assertTrue(row.get("TYPE_NAME").isNull()); + assertTrue(row.get("SELF_REFERENCING_COL_NAME").isNull()); + assertTrue(row.get("REF_GENERATION").isNull()); + } + + @Test + public void testProcessTableInfo_TypeFilterMatch() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Set requestedTypes = new HashSet<>(Arrays.asList("VIEW", "TABLE")); + + Table table = mockBigQueryTable("p", "d", "t", TableDefinition.Type.TABLE, "Desc"); + + dbMetadata.processTableInfo(table, requestedTypes, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + assertEquals("TABLE", collectedResults.get(0).get("TABLE_TYPE").getStringValue()); + } + + @Test + public void testProcessTableInfo_TypeFilterMismatch() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Set requestedTypes = new HashSet<>(Collections.singletonList("VIEW")); + + Table table = mockBigQueryTable("p", "d", "t", TableDefinition.Type.TABLE, "Desc"); + + dbMetadata.processTableInfo(table, requestedTypes, collectedResults, resultSchemaFields); + + assertEquals(0, collectedResults.size()); + } + + @Test + public void testProcessTableInfo_NullDescription() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + Table table = mockBigQueryTable("p", "d", "t_no_desc", TableDefinition.Type.TABLE, null); + + dbMetadata.processTableInfo(table, null, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertTrue(row.get("REMARKS").isNull()); + } + + private FieldValueList createTableRow( + String cat, String schem, String name, String type, FieldList schemaFields) { + List values = new ArrayList<>(); + values.add(dbMetadata.createStringFieldValue(cat)); // TABLE_CAT + values.add(dbMetadata.createStringFieldValue(schem)); // TABLE_SCHEM + values.add(dbMetadata.createStringFieldValue(name)); // TABLE_NAME + values.add(dbMetadata.createStringFieldValue(type)); // TABLE_TYPE + values.add(dbMetadata.createStringFieldValue("Remark for " + name)); // REMARKS + values.add(dbMetadata.createNullFieldValue()); // TYPE_CAT + values.add(dbMetadata.createNullFieldValue()); // TYPE_SCHEM + values.add(dbMetadata.createNullFieldValue()); // TYPE_NAME + values.add(dbMetadata.createNullFieldValue()); // SELF_REFERENCING_COL_NAME + values.add(dbMetadata.createNullFieldValue()); // REF_GENERATION + return FieldValueList.of(values, schemaFields); + } + + @Test + public void testSortResults_Tables() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + // Add rows in unsorted order (based on TYPE, CAT, SCHEM, NAME) + results.add(createTableRow("cat_a", "sch_z", "table_1", "TABLE", schemaFields)); + results.add(createTableRow("cat_b", "sch_a", "view_1", "VIEW", schemaFields)); + results.add(createTableRow("cat_a", "sch_c", "table_2", "TABLE", schemaFields)); + results.add(createTableRow(null, "sch_b", "table_0", "TABLE", schemaFields)); + results.add(createTableRow("cat_a", "sch_z", "table_0", "TABLE", schemaFields)); + results.add(createTableRow("cat_a", null, "view_0", "VIEW", schemaFields)); + + Comparator comparator = dbMetadata.defineGetTablesComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getTables", dbMetadata.LOG); + + // Expected order: TABLEs first, then VIEWs. Within type, sort by CAT, SCHEM, NAME + assertEquals(6, results.size()); + + // 1. Null cat, sch_b, table_0, TABLE + assertTrue("Row 0 TABLE_CAT should be null", results.get(0).get("TABLE_CAT").isNull()); + assertEquals("sch_b", results.get(0).get("TABLE_SCHEM").getStringValue()); + assertEquals("table_0", results.get(0).get("TABLE_NAME").getStringValue()); + assertEquals("TABLE", results.get(0).get("TABLE_TYPE").getStringValue()); + + // 2. cat_a, sch_c, table_2, TABLE + assertEquals("cat_a", results.get(1).get("TABLE_CAT").getStringValue()); + assertEquals("sch_c", results.get(1).get("TABLE_SCHEM").getStringValue()); + assertEquals("table_2", results.get(1).get("TABLE_NAME").getStringValue()); + assertEquals("TABLE", results.get(1).get("TABLE_TYPE").getStringValue()); + + // 3. cat_a, sch_z, table_0, TABLE + assertEquals("cat_a", results.get(2).get("TABLE_CAT").getStringValue()); + assertEquals("sch_z", results.get(2).get("TABLE_SCHEM").getStringValue()); + assertEquals("table_0", results.get(2).get("TABLE_NAME").getStringValue()); + assertEquals("TABLE", results.get(2).get("TABLE_TYPE").getStringValue()); + + // 4. cat_a, sch_z, table_1, TABLE + assertEquals("cat_a", results.get(3).get("TABLE_CAT").getStringValue()); + assertEquals("sch_z", results.get(3).get("TABLE_SCHEM").getStringValue()); + assertEquals("table_1", results.get(3).get("TABLE_NAME").getStringValue()); + assertEquals("TABLE", results.get(3).get("TABLE_TYPE").getStringValue()); + + // 5. cat_a, null, view_0, VIEW + assertEquals("cat_a", results.get(4).get("TABLE_CAT").getStringValue()); + assertTrue("Row 4 TABLE_SCHEM should be null", results.get(4).get("TABLE_SCHEM").isNull()); + assertEquals("view_0", results.get(4).get("TABLE_NAME").getStringValue()); + assertEquals("VIEW", results.get(4).get("TABLE_TYPE").getStringValue()); + + // 6. cat_b, sch_a, view_1, VIEW + assertEquals("cat_b", results.get(5).get("TABLE_CAT").getStringValue()); + assertEquals("sch_a", results.get(5).get("TABLE_SCHEM").getStringValue()); + assertEquals("view_1", results.get(5).get("TABLE_NAME").getStringValue()); + assertEquals("VIEW", results.get(5).get("TABLE_TYPE").getStringValue()); + } + + @Test + public void testSortResults_Tables_EmptyList() { + Schema resultSchema = dbMetadata.defineGetTablesSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + Comparator comparator = dbMetadata.defineGetTablesComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getTables", dbMetadata.LOG); + assertTrue(results.isEmpty()); + } + + @Test + public void testDefineGetSchemasSchema() { + Schema schema = dbMetadata.defineGetSchemasSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(2, fields.size()); + + Field tableSchem = fields.get("TABLE_SCHEM"); + assertEquals("TABLE_SCHEM", tableSchem.getName()); + assertEquals(StandardSQLTypeName.STRING, tableSchem.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, tableSchem.getMode()); + + Field tableCatalog = fields.get("TABLE_CATALOG"); + assertEquals("TABLE_CATALOG", tableCatalog.getName()); + assertEquals(StandardSQLTypeName.STRING, tableCatalog.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, tableCatalog.getMode()); + } + + private Dataset mockBigQueryDataset(String project, String datasetName) { + Dataset mockDataset = mock(Dataset.class); + DatasetId mockDatasetId = DatasetId.of(project, datasetName); + when(mockDataset.getDatasetId()).thenReturn(mockDatasetId); + return mockDataset; + } + + @Test + public void testProcessSchemaInfo() { + Schema resultSchema = dbMetadata.defineGetSchemasSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "project-alpha"; + String schemaName = "dataset_beta"; + Dataset dataset = mockBigQueryDataset(catalog, schemaName); + + dbMetadata.processSchemaInfo(dataset, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertNotNull(row); + assertEquals(2, row.size()); + assertEquals(schemaName, row.get("TABLE_SCHEM").getStringValue()); + assertEquals(catalog, row.get("TABLE_CATALOG").getStringValue()); + } + + private FieldValueList createSchemaRow(String cat, String schem, FieldList schemaFields) { + List values = new ArrayList<>(); + values.add(dbMetadata.createStringFieldValue(schem)); // TABLE_SCHEM + values.add(dbMetadata.createStringFieldValue(cat)); // TABLE_CATALOG + return FieldValueList.of(values, schemaFields); + } + + @Test + public void testSortResults_Schemas() { + Schema resultSchema = dbMetadata.defineGetSchemasSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + results.add(createSchemaRow("proj_b", "schema_z", schemaFields)); + results.add(createSchemaRow("proj_a", "schema_y", schemaFields)); + results.add(createSchemaRow(null, "schema_x", schemaFields)); + results.add(createSchemaRow("proj_b", "schema_a", schemaFields)); + results.add(createSchemaRow("proj_a", "schema_c", schemaFields)); + + Comparator comparator = dbMetadata.defineGetSchemasComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getSchemas", dbMetadata.LOG); + + // Expected order: Sort by TABLE_CATALOG (nulls first), then TABLE_SCHEM + assertEquals(5, results.size()); + + // 1. Null catalog, schema_x + assertTrue("Row 0 TABLE_CATALOG should be null", results.get(0).get("TABLE_CATALOG").isNull()); + assertEquals("schema_x", results.get(0).get("TABLE_SCHEM").getStringValue()); + + // 2. proj_a, schema_c + assertEquals("proj_a", results.get(1).get("TABLE_CATALOG").getStringValue()); + assertEquals("schema_c", results.get(1).get("TABLE_SCHEM").getStringValue()); + + // 3. proj_a, schema_y + assertEquals("proj_a", results.get(2).get("TABLE_CATALOG").getStringValue()); + assertEquals("schema_y", results.get(2).get("TABLE_SCHEM").getStringValue()); + + // 4. proj_b, schema_a + assertEquals("proj_b", results.get(3).get("TABLE_CATALOG").getStringValue()); + assertEquals("schema_a", results.get(3).get("TABLE_SCHEM").getStringValue()); + + // 5. proj_b, schema_z + assertEquals("proj_b", results.get(4).get("TABLE_CATALOG").getStringValue()); + assertEquals("schema_z", results.get(4).get("TABLE_SCHEM").getStringValue()); + } + + @Test + public void testSortResults_Schemas_EmptyList() { + Schema resultSchema = dbMetadata.defineGetSchemasSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + Comparator comparator = dbMetadata.defineGetSchemasComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getSchemas", dbMetadata.LOG); + assertTrue(results.isEmpty()); + } + + private Routine mockBigQueryRoutine( + String project, String dataset, String routineName, String routineType, String description) { + Routine mockRoutine = mock(Routine.class); + RoutineId mockRoutineId = RoutineId.of(project, dataset, routineName); + when(mockRoutine.getRoutineId()).thenReturn(mockRoutineId); + when(mockRoutine.getRoutineType()).thenReturn(routineType); + when(mockRoutine.getDescription()).thenReturn(description); + return mockRoutine; + } + + @Test + public void testDefineGetProceduresSchema() { + Schema schema = dbMetadata.defineGetProceduresSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(9, fields.size()); + + Field procCat = fields.get("PROCEDURE_CAT"); + assertEquals("PROCEDURE_CAT", procCat.getName()); + assertEquals(StandardSQLTypeName.STRING, procCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, procCat.getMode()); + + Field procName = fields.get("PROCEDURE_NAME"); + assertEquals("PROCEDURE_NAME", procName.getName()); + assertEquals(StandardSQLTypeName.STRING, procName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, procName.getMode()); + + Field remarks = fields.get("REMARKS"); + assertEquals("REMARKS", remarks.getName()); + assertEquals(StandardSQLTypeName.STRING, remarks.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, remarks.getMode()); + + Field procType = fields.get("PROCEDURE_TYPE"); + assertEquals("PROCEDURE_TYPE", procType.getName()); + assertEquals(StandardSQLTypeName.INT64, procType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, procType.getMode()); + + Field specificName = fields.get("SPECIFIC_NAME"); + assertEquals("SPECIFIC_NAME", specificName.getName()); + assertEquals(StandardSQLTypeName.STRING, specificName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, specificName.getMode()); + } + + @Test + public void testProcessProcedureInfo_BasicProcedure() { + Schema resultSchema = dbMetadata.defineGetProceduresSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "proj-1"; + String schema = "dataset_a"; + String name = "my_proc"; + String description = "A test procedure"; + + Routine routine = mockBigQueryRoutine(catalog, schema, name, "PROCEDURE", description); + + dbMetadata.processProcedureInfo(routine, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertNotNull(row); + assertEquals(9, row.size()); + assertEquals(catalog, row.get("PROCEDURE_CAT").getStringValue()); + assertEquals(schema, row.get("PROCEDURE_SCHEM").getStringValue()); + assertEquals(name, row.get("PROCEDURE_NAME").getStringValue()); + assertTrue(row.get("reserved1").isNull()); + assertTrue(row.get("reserved2").isNull()); + assertTrue(row.get("reserved3").isNull()); + assertEquals(description, row.get("REMARKS").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.procedureResultUnknown), + row.get("PROCEDURE_TYPE").getStringValue()); + assertEquals(name, row.get("SPECIFIC_NAME").getStringValue()); + } + + @Test + public void testProcessProcedureInfo_NullDescription() { + Schema resultSchema = dbMetadata.defineGetProceduresSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "proj-1"; + String schema = "dataset_a"; + String name = "proc_no_desc"; + + Routine routine = mockBigQueryRoutine(catalog, schema, name, "PROCEDURE", null); + + dbMetadata.processProcedureInfo(routine, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertTrue(row.get("REMARKS").isNull()); + } + + @Test + public void testProcessProcedureInfo_SkipsNonProcedure() { + Schema resultSchema = dbMetadata.defineGetProceduresSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + Routine routine = mockBigQueryRoutine("p", "d", "my_func", "FUNCTION", "A function"); + + dbMetadata.processProcedureInfo(routine, collectedResults, resultSchemaFields); + + assertTrue(collectedResults.isEmpty()); + } + + private FieldValueList createProcedureRow( + String cat, String schem, String name, String specName, FieldList schemaFields) { + List values = new ArrayList<>(); + values.add(dbMetadata.createStringFieldValue(cat)); // PROCEDURE_CAT + values.add(dbMetadata.createStringFieldValue(schem)); // PROCEDURE_SCHEM + values.add(dbMetadata.createStringFieldValue(name)); // PROCEDURE_NAME + values.add(dbMetadata.createNullFieldValue()); // reserved1 + values.add(dbMetadata.createNullFieldValue()); // reserved2 + values.add(dbMetadata.createNullFieldValue()); // reserved3 + values.add(dbMetadata.createStringFieldValue("Remark for " + name)); // REMARKS + values.add( + dbMetadata.createLongFieldValue( + (long) DatabaseMetaData.procedureResultUnknown)); // PROCEDURE_TYPE + values.add(dbMetadata.createStringFieldValue(specName)); // SPECIFIC_NAME + return FieldValueList.of(values, schemaFields); + } + + @Test + public void testSortResults_Procedures() { + Schema resultSchema = dbMetadata.defineGetProceduresSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + // Add rows in unsorted order (Sort by CAT, SCHEM, NAME, SPECIFIC_NAME) + results.add(createProcedureRow("cat_b", "sch_c", "proc_1", "proc_1_spec", schemaFields)); + results.add( + createProcedureRow("cat_a", "sch_z", "proc_alpha", "proc_alpha_spec", schemaFields)); + results.add(createProcedureRow("cat_a", "sch_z", "proc_beta", "proc_beta_spec", schemaFields)); + results.add(createProcedureRow(null, "sch_y", "proc_gamma", "proc_gamma_spec", schemaFields)); + results.add(createProcedureRow("cat_a", null, "proc_delta", "proc_delta_spec", schemaFields)); + results.add( + createProcedureRow("cat_a", "sch_z", "proc_alpha", "proc_alpha_spec_older", schemaFields)); + + Comparator comparator = dbMetadata.defineGetProceduresComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getProcedures", dbMetadata.LOG); + + // Expected Order: Null Cat, then Cat A (Null Schem, then sch_z), then Cat B. Within that, Name, + // then Spec Name. + assertEquals(6, results.size()); + + // 1. Null cat, sch_y, proc_gamma, proc_gamma_spec + assertTrue("Row 0 PROC_CAT should be null", results.get(0).get("PROCEDURE_CAT").isNull()); + assertEquals("sch_y", results.get(0).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_gamma", results.get(0).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_gamma_spec", results.get(0).get("SPECIFIC_NAME").getStringValue()); + + // 2. cat_a, Null schem, proc_delta, proc_delta_spec + assertEquals("cat_a", results.get(1).get("PROCEDURE_CAT").getStringValue()); + assertTrue("Row 1 PROC_SCHEM should be null", results.get(1).get("PROCEDURE_SCHEM").isNull()); + assertEquals("proc_delta", results.get(1).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_delta_spec", results.get(1).get("SPECIFIC_NAME").getStringValue()); + + // 3. cat_a, sch_z, proc_alpha, "proc_alpha_spec" (comes first lexicographically) <<< CORRECTED + // EXPECTATION + assertEquals("cat_a", results.get(2).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_z", results.get(2).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_alpha", results.get(2).get("PROCEDURE_NAME").getStringValue()); + assertEquals( + "proc_alpha_spec", results.get(2).get("SPECIFIC_NAME").getStringValue()); // <<< CORRECTED + + // 4. cat_a, sch_z, proc_alpha, "proc_alpha_spec_older" (comes second lexicographically) <<< + // CORRECTED EXPECTATION + assertEquals("cat_a", results.get(3).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_z", results.get(3).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_alpha", results.get(3).get("PROCEDURE_NAME").getStringValue()); + assertEquals( + "proc_alpha_spec_older", + results.get(3).get("SPECIFIC_NAME").getStringValue()); // <<< CORRECTED + + // 5. cat_a, sch_z, proc_beta, proc_beta_spec + assertEquals("cat_a", results.get(4).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_z", results.get(4).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_beta", results.get(4).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_beta_spec", results.get(4).get("SPECIFIC_NAME").getStringValue()); + + // 6. cat_b, sch_c, proc_1, proc_1_spec + assertEquals("cat_b", results.get(5).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_c", results.get(5).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_1", results.get(5).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_1_spec", results.get(5).get("SPECIFIC_NAME").getStringValue()); + } + + @Test + public void testSortResults_Procedures_EmptyList() { + Schema resultSchema = dbMetadata.defineGetProceduresSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + Comparator comparator = dbMetadata.defineGetProceduresComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getProcedures", dbMetadata.LOG); + assertTrue(results.isEmpty()); + } + + @Test + public void testFindMatchingBigQueryObjects_Routines_ListWithPattern() { + String catalog = "p-cat"; + String schema = "d-sch"; + String pattern = "proc_%"; + DatasetId datasetId = DatasetId.of(catalog, schema); + + Routine proc1 = mockBigQueryRoutine(catalog, schema, "proc_abc", "PROCEDURE", "p1"); + Routine proc2 = mockBigQueryRoutine(catalog, schema, "proc_xyz", "PROCEDURE", "p2"); + Routine func1 = mockBigQueryRoutine(catalog, schema, "func_123", "FUNCTION", "f1"); + Routine otherProc = mockBigQueryRoutine(catalog, schema, "another_proc", "PROCEDURE", "p3"); + + Page page = mock(Page.class); + when(page.iterateAll()).thenReturn(Arrays.asList(proc1, func1, proc2, otherProc)); + when(bigqueryClient.listRoutines(eq(datasetId), any(BigQuery.RoutineListOption.class))) + .thenReturn(page); + + Pattern regex = dbMetadata.compileSqlLikePattern(pattern); + assertNotNull(regex); + + List results = + dbMetadata.findMatchingBigQueryObjects( + "Routine", + () -> bigqueryClient.listRoutines(datasetId, BigQuery.RoutineListOption.pageSize(500)), + (name) -> + bigqueryClient.getRoutine( + RoutineId.of(datasetId.getProject(), datasetId.getDataset(), name)), + (rt) -> rt.getRoutineId().getRoutine(), + pattern, + regex, + dbMetadata.LOG); + + verify(bigqueryClient, times(1)) + .listRoutines(eq(datasetId), any(BigQuery.RoutineListOption.class)); + verify(bigqueryClient, never()).getRoutine(any(RoutineId.class)); + + assertNotNull(results); + List resultList = new ArrayList<>(results); + + assertEquals("Should contain only matching routines", 2, resultList.size()); + assertTrue("Should contain proc_abc", resultList.contains(proc1)); + assertTrue("Should contain proc_xyz", resultList.contains(proc2)); + assertFalse("Should not contain func_123", resultList.contains(func1)); + assertFalse("Should not contain another_proc", resultList.contains(otherProc)); + } + + @Test + public void testFindMatchingBigQueryObjects_Routines_ListNoPattern() { + String catalog = "p-cat"; + String schema = "d-sch"; + String pattern = null; + DatasetId datasetId = DatasetId.of(catalog, schema); + + Routine proc1 = mockBigQueryRoutine(catalog, schema, "proc_abc", "PROCEDURE", "p1"); + Routine func1 = mockBigQueryRoutine(catalog, schema, "func_123", "FUNCTION", "f1"); + + Page page = mock(Page.class); + when(page.iterateAll()).thenReturn(Arrays.asList(proc1, func1)); + when(bigqueryClient.listRoutines(eq(datasetId), any(BigQuery.RoutineListOption.class))) + .thenReturn(page); + + Pattern regex = dbMetadata.compileSqlLikePattern(pattern); + List results = + dbMetadata.findMatchingBigQueryObjects( + "Routine", + () -> bigqueryClient.listRoutines(datasetId, BigQuery.RoutineListOption.pageSize(500)), + (name) -> + bigqueryClient.getRoutine( + RoutineId.of(datasetId.getProject(), datasetId.getDataset(), name)), + (rt) -> rt.getRoutineId().getRoutine(), + pattern, + regex, + dbMetadata.LOG); + + verify(bigqueryClient, times(1)) + .listRoutines(eq(datasetId), any(BigQuery.RoutineListOption.class)); + + assertNotNull(results); + List resultList = new ArrayList<>(results); + + assertEquals("Should contain all routines when pattern is null", 2, resultList.size()); + assertTrue("Should contain proc_abc", resultList.contains(proc1)); + assertTrue("Should contain func_123", resultList.contains(func1)); + } + + @Test + public void testFindMatchingBigQueryObjects_Routines_GetSpecific() { + String catalog = "p-cat"; + String schema = "d-sch"; + String procNameExact = "exactprocname"; + DatasetId datasetId = DatasetId.of(catalog, schema); + RoutineId routineId = RoutineId.of(catalog, schema, procNameExact); + Routine mockRoutine = mockBigQueryRoutine(catalog, schema, procNameExact, "PROCEDURE", "desc"); + + when(bigqueryClient.getRoutine(eq(routineId))).thenReturn(mockRoutine); + Pattern regex = dbMetadata.compileSqlLikePattern(procNameExact); + + List results = + dbMetadata.findMatchingBigQueryObjects( + "Routine", + () -> bigqueryClient.listRoutines(datasetId, BigQuery.RoutineListOption.pageSize(500)), + (name) -> + bigqueryClient.getRoutine( + RoutineId.of(datasetId.getProject(), datasetId.getDataset(), name)), + (rt) -> rt.getRoutineId().getRoutine(), + procNameExact, + regex, + dbMetadata.LOG); + + verify(bigqueryClient, times(1)).getRoutine(eq(routineId)); + verify(bigqueryClient, never()) + .listRoutines(any(DatasetId.class), any(BigQuery.RoutineListOption.class)); + + assertNotNull(results); + List resultList = new ArrayList<>(results); + assertEquals(1, resultList.size()); + assertSame(mockRoutine, resultList.get(0)); + } + + @Test + public void testDefineGetProcedureColumnsSchema() { + Schema schema = dbMetadata.defineGetProcedureColumnsSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(20, fields.size()); + + Field procCat = fields.get("PROCEDURE_CAT"); + assertEquals("PROCEDURE_CAT", procCat.getName()); + assertEquals(StandardSQLTypeName.STRING, procCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, procCat.getMode()); + + Field colName = fields.get("COLUMN_NAME"); + assertEquals("COLUMN_NAME", colName.getName()); + assertEquals(StandardSQLTypeName.STRING, colName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, colName.getMode()); + + Field colType = fields.get("COLUMN_TYPE"); + assertEquals("COLUMN_TYPE", colType.getName()); + assertEquals(StandardSQLTypeName.INT64, colType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, colType.getMode()); + + Field dataType = fields.get("DATA_TYPE"); + assertEquals("DATA_TYPE", dataType.getName()); + assertEquals(StandardSQLTypeName.INT64, dataType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, dataType.getMode()); + + Field typeName = fields.get("TYPE_NAME"); + assertEquals("TYPE_NAME", typeName.getName()); + assertEquals(StandardSQLTypeName.STRING, typeName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, typeName.getMode()); + + Field ordinalPos = fields.get("ORDINAL_POSITION"); + assertEquals("ORDINAL_POSITION", ordinalPos.getName()); + assertEquals(StandardSQLTypeName.INT64, ordinalPos.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, ordinalPos.getMode()); + + Field isNullable = fields.get("IS_NULLABLE"); + assertEquals("IS_NULLABLE", isNullable.getName()); + assertEquals(StandardSQLTypeName.STRING, isNullable.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, isNullable.getMode()); + + Field specificName = fields.get("SPECIFIC_NAME"); + assertEquals("SPECIFIC_NAME", specificName.getName()); + assertEquals(StandardSQLTypeName.STRING, specificName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, specificName.getMode()); + } + + @Test + public void testDetermineTypeInfoFromDataType() { + // INT64 + StandardSQLDataType sqlInt64 = mockStandardSQLDataType(StandardSQLTypeName.INT64); + BigQueryDatabaseMetaData.ColumnTypeInfo infoInt64 = + dbMetadata.determineTypeInfoFromDataType(sqlInt64, "p", "c", 1); + assertEquals(Types.BIGINT, infoInt64.jdbcType); + assertEquals("BIGINT", infoInt64.typeName); + + // STRING + StandardSQLDataType sqlString = mockStandardSQLDataType(StandardSQLTypeName.STRING); + BigQueryDatabaseMetaData.ColumnTypeInfo infoString = + dbMetadata.determineTypeInfoFromDataType(sqlString, "p", "c", 1); + assertEquals(Types.NVARCHAR, infoString.jdbcType); + assertEquals("NVARCHAR", infoString.typeName); + + // BOOL + StandardSQLDataType sqlBool = mockStandardSQLDataType(StandardSQLTypeName.BOOL); + BigQueryDatabaseMetaData.ColumnTypeInfo infoBool = + dbMetadata.determineTypeInfoFromDataType(sqlBool, "p", "c", 1); + assertEquals(Types.BOOLEAN, infoBool.jdbcType); + assertEquals("BOOLEAN", infoBool.typeName); + + // STRUCT + StandardSQLDataType sqlStruct = mockStandardSQLDataType(StandardSQLTypeName.STRUCT); + BigQueryDatabaseMetaData.ColumnTypeInfo infoStruct = + dbMetadata.determineTypeInfoFromDataType(sqlStruct, "p", "c", 1); + assertEquals(Types.STRUCT, infoStruct.jdbcType); + assertEquals("STRUCT", infoStruct.typeName); + + // Case: null typeKind from StandardSQLDataType (should default to VARCHAR) + StandardSQLDataType sqlNullKind = mock(StandardSQLDataType.class); + when(sqlNullKind.getTypeKind()).thenReturn(null); + BigQueryDatabaseMetaData.ColumnTypeInfo infoNullKind = + dbMetadata.determineTypeInfoFromDataType(sqlNullKind, "p", "c", 1); + assertEquals(Types.VARCHAR, infoNullKind.jdbcType); + assertEquals("VARCHAR", infoNullKind.typeName); + + // Case: unknown typeKind from StandardSQLDataType (should default to VARCHAR) + StandardSQLDataType sqlUnknownKind = mock(StandardSQLDataType.class); + when(sqlUnknownKind.getTypeKind()).thenReturn("SUPER_DOOPER_TYPE"); + BigQueryDatabaseMetaData.ColumnTypeInfo infoUnknownKind = + dbMetadata.determineTypeInfoFromDataType(sqlUnknownKind, "p", "c", 1); + assertEquals(Types.VARCHAR, infoUnknownKind.jdbcType); + assertEquals("VARCHAR", infoUnknownKind.typeName); + } + + @Test + public void testCreateProcedureColumnRow_BasicInParam() { + String catalog = "proj_x"; + String schema = "data_y"; + String procName = "proc_z"; + String specificName = "proc_z_specific"; + + RoutineArgument arg = mockRoutineArgument("param_in", StandardSQLTypeName.STRING, "IN"); + int ordinalPos = 1; + + List row = + dbMetadata.createProcedureColumnRow( + catalog, schema, procName, specificName, arg, ordinalPos, "param_in"); + + assertNotNull(row); + assertEquals(20, row.size()); + + assertEquals(catalog, row.get(0).getStringValue()); // 1. PROCEDURE_CAT + assertEquals(schema, row.get(1).getStringValue()); // 2. PROCEDURE_SCHEM + assertEquals(procName, row.get(2).getStringValue()); // 3. PROCEDURE_NAME + assertEquals("param_in", row.get(3).getStringValue()); // 4. COLUMN_NAME + assertEquals( + String.valueOf(DatabaseMetaData.procedureColumnIn), + row.get(4).getStringValue()); // 5. COLUMN_TYPE + assertEquals(String.valueOf(Types.NVARCHAR), row.get(5).getStringValue()); // 6. DATA_TYPE + assertEquals("NVARCHAR", row.get(6).getStringValue()); // 7. TYPE_NAME + assertTrue(row.get(7).isNull()); // 8. PRECISION + assertTrue(row.get(8).isNull()); // 9. LENGTH + assertTrue(row.get(9).isNull()); // 10. SCALE + assertTrue(row.get(10).isNull()); // 11. RADIX + assertEquals( + String.valueOf(DatabaseMetaData.procedureNullable), + row.get(11).getStringValue()); // 12. NULLABLE + assertTrue(row.get(12).isNull()); // 13. REMARKS + assertTrue(row.get(13).isNull()); // 14. COLUMN_DEF + assertTrue(row.get(14).isNull()); // 15. SQL_DATA_TYPE + assertTrue(row.get(15).isNull()); // 16. SQL_DATETIME_SUB + assertTrue(row.get(16).isNull()); // 17. CHAR_OCTET_LENGTH + assertEquals(String.valueOf(ordinalPos), row.get(17).getStringValue()); // 18. ORDINAL_POSITION + assertEquals("YES", row.get(18).getStringValue()); // 19. IS_NULLABLE + assertEquals(specificName, row.get(19).getStringValue()); // 20. SPECIFIC_NAME + } + + @Test + public void testCreateProcedureColumnRow_NumericOutParam() { + RoutineArgument arg = mockRoutineArgument("param_out_num", StandardSQLTypeName.NUMERIC, "OUT"); + int ordinalPos = 2; + + List row = + dbMetadata.createProcedureColumnRow( + "p", "d", "proc", "proc_spec", arg, ordinalPos, "param_out_num"); + + assertEquals( + String.valueOf(DatabaseMetaData.procedureColumnOut), + row.get(4).getStringValue()); // COLUMN_TYPE + assertEquals(String.valueOf(Types.NUMERIC), row.get(5).getStringValue()); // DATA_TYPE + assertEquals("NUMERIC", row.get(6).getStringValue()); // TYPE_NAME + assertEquals("38", row.get(7).getStringValue()); // PRECISION + assertEquals("9", row.get(9).getStringValue()); // SCALE + assertEquals("10", row.get(10).getStringValue()); // RADIX + } + + @Test + public void testCreateProcedureColumnRow_InOutTimestampParam() { + RoutineArgument arg = + mockRoutineArgument("param_inout_ts", StandardSQLTypeName.TIMESTAMP, "INOUT"); + List row = + dbMetadata.createProcedureColumnRow( + "p", "d", "proc", "proc_spec", arg, 3, "param_inout_ts"); + + assertEquals( + String.valueOf(DatabaseMetaData.procedureColumnInOut), row.get(4).getStringValue()); + assertEquals(String.valueOf(Types.TIMESTAMP), row.get(5).getStringValue()); + assertEquals("TIMESTAMP", row.get(6).getStringValue()); + assertEquals("29", row.get(7).getStringValue()); // PRECISION for TIMESTAMP + } + + @Test + public void testCreateProcedureColumnRow_UnknownModeDefaultsToUnknownType() { + RoutineArgument arg = + mockRoutineArgument("param_unknown_mode", StandardSQLTypeName.BOOL, "UNKNOWN_MODE"); + List row = + dbMetadata.createProcedureColumnRow( + "p", "d", "proc", "proc_spec", arg, 1, "param_unknown_mode"); + assertEquals( + String.valueOf(DatabaseMetaData.procedureColumnUnknown), row.get(4).getStringValue()); + } + + @Test + public void testCreateProcedureColumnRow_NullArgumentObject() { + List row = + dbMetadata.createProcedureColumnRow( + "cat", "schem", "proc", "spec", null, 1, "fallback_arg_name"); + + assertNotNull(row); + assertEquals(20, row.size()); + assertEquals("fallback_arg_name", row.get(3).getStringValue()); // COLUMN_NAME + assertEquals(String.valueOf(Types.VARCHAR), row.get(5).getStringValue()); // DATA_TYPE + assertEquals("VARCHAR", row.get(6).getStringValue()); // TYPE_NAME + assertEquals( + String.valueOf(DatabaseMetaData.procedureColumnUnknown), row.get(4).getStringValue()); + } + + @Test + public void testCreateProcedureColumnRow_NullArgumentDataType() { + RoutineArgument argWithNullDataType = mock(RoutineArgument.class); + when(argWithNullDataType.getName()).thenReturn("arg_null_type"); + when(argWithNullDataType.getDataType()).thenReturn(null); + when(argWithNullDataType.getMode()).thenReturn("IN"); + + List row = + dbMetadata.createProcedureColumnRow( + "cat", "schem", "proc", "spec", argWithNullDataType, 1, "arg_null_type"); + + assertNotNull(row); + assertEquals("arg_null_type", row.get(3).getStringValue()); + assertEquals( + String.valueOf(Types.VARCHAR), row.get(5).getStringValue()); // DATA_TYPE should default + assertEquals("VARCHAR", row.get(6).getStringValue()); // TYPE_NAME should default + } + + @Test + public void testProcessProcedureArguments_NoArguments() { + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Pattern noColumnNamePattern = null; // Match all columns + + Routine routine = + mockBigQueryRoutineWithArgs( + "p", "d", "proc_no_args", "PROCEDURE", "desc", Collections.emptyList()); // No arguments + + dbMetadata.processProcedureArguments( + routine, noColumnNamePattern, collectedResults, resultFields); + assertTrue(collectedResults.isEmpty()); + } + + @Test + public void testProcessProcedureArguments_WithArgumentsNoFilter() { + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Pattern noColumnNamePattern = null; + + RoutineArgument arg1 = mockRoutineArgument("param1", StandardSQLTypeName.INT64, "IN"); + RoutineArgument arg2 = mockRoutineArgument("param2", StandardSQLTypeName.STRING, "OUT"); + Routine routine = + mockBigQueryRoutineWithArgs( + "p", "d", "proc_two_args", "PROCEDURE", "desc", Arrays.asList(arg1, arg2)); + + dbMetadata.processProcedureArguments( + routine, noColumnNamePattern, collectedResults, resultFields); + assertEquals(2, collectedResults.size()); + assertEquals("param1", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + assertEquals("param2", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(1), collectedResults.get(0).get("ORDINAL_POSITION").getStringValue()); + assertEquals( + String.valueOf(2), collectedResults.get(1).get("ORDINAL_POSITION").getStringValue()); + } + + @Test + public void testProcessProcedureArguments_WithColumnNameFilter() { + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Pattern columnNamePattern = Pattern.compile(".*_id"); // Match columns ending with _id + + RoutineArgument arg1 = mockRoutineArgument("user_id", StandardSQLTypeName.INT64, "IN"); + RoutineArgument arg2 = mockRoutineArgument("user_name", StandardSQLTypeName.STRING, "IN"); + RoutineArgument arg3 = mockRoutineArgument("session_id", StandardSQLTypeName.STRING, "INOUT"); + + Routine routine = + mockBigQueryRoutineWithArgs( + "p", "d", "proc_filtered_args", "PROCEDURE", "desc", Arrays.asList(arg1, arg2, arg3)); + + dbMetadata.processProcedureArguments( + routine, columnNamePattern, collectedResults, resultFields); + assertEquals(2, collectedResults.size()); + assertEquals("user_id", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + assertEquals("session_id", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + } + + @Test + public void testProcessProcedureArguments_HandlesNullArgumentInList() { + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Pattern noColumnNamePattern = null; + + RoutineArgument arg1 = mockRoutineArgument("valid_arg", StandardSQLTypeName.INT64, "IN"); + List argsWithNull = new ArrayList<>(); + argsWithNull.add(arg1); + argsWithNull.add(null); // Add a null argument + RoutineArgument arg3 = + mockRoutineArgument("another_valid_arg", StandardSQLTypeName.STRING, "OUT"); + argsWithNull.add(arg3); + + Routine routine = mock(Routine.class); + RoutineId routineId = RoutineId.of("p", "d", "proc_with_null_arg_in_list"); + when(routine.getRoutineId()).thenReturn(routineId); + when(routine.getRoutineType()).thenReturn("PROCEDURE"); + when(routine.getArguments()).thenReturn(argsWithNull); + + dbMetadata.processProcedureArguments( + routine, noColumnNamePattern, collectedResults, resultFields); + + assertEquals(3, collectedResults.size()); + assertEquals("valid_arg", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + // The fallback name generated by processProcedureArguments when arg is null in list + assertEquals( + "arg_retrieval_err_2", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(Types.VARCHAR), + collectedResults.get(1).get("DATA_TYPE").getStringValue()); // Default type for null arg + assertEquals("another_valid_arg", collectedResults.get(2).get("COLUMN_NAME").getStringValue()); + } + + private FieldValueList createProcedureColumnRowForSortTest( + String cat, + String schem, + String procName, + String specName, + String colName, + int ordinal, + FieldList schemaFields) { + List values = new ArrayList<>(20); + values.add(dbMetadata.createStringFieldValue(cat)); // 1. PROC_CAT + values.add(dbMetadata.createStringFieldValue(schem)); // 2. PROC_SCHEM + values.add(dbMetadata.createStringFieldValue(procName)); // 3. PROC_NAME + values.add(dbMetadata.createStringFieldValue(colName)); // 4. COLUMN_NAME + values.add( + dbMetadata.createLongFieldValue( + (long) DatabaseMetaData.procedureColumnIn)); // 5. COLUMN_TYPE + values.add(dbMetadata.createLongFieldValue((long) Types.VARCHAR)); // 6. DATA_TYPE + values.add(dbMetadata.createStringFieldValue("VARCHAR")); // 7. TYPE_NAME + values.add(dbMetadata.createNullFieldValue()); // 8. PRECISION + values.add(dbMetadata.createNullFieldValue()); // 9. LENGTH + values.add(dbMetadata.createNullFieldValue()); // 10. SCALE + values.add(dbMetadata.createNullFieldValue()); // 11. RADIX + values.add( + dbMetadata.createLongFieldValue((long) DatabaseMetaData.procedureNullable)); // 12. NULLABLE + values.add(dbMetadata.createStringFieldValue("Remark for " + colName)); // 13. REMARKS + values.add(dbMetadata.createNullFieldValue()); // 14. COLUMN_DEF + values.add(dbMetadata.createNullFieldValue()); // 15. SQL_DATA_TYPE + values.add(dbMetadata.createNullFieldValue()); // 16. SQL_DATETIME_SUB + values.add(dbMetadata.createNullFieldValue()); // 17. CHAR_OCTET_LENGTH + values.add(dbMetadata.createLongFieldValue((long) ordinal)); // 18. ORDINAL_POSITION + values.add(dbMetadata.createStringFieldValue("YES")); // 19. IS_NULLABLE + values.add(dbMetadata.createStringFieldValue(specName)); // 20. SPECIFIC_NAME + return FieldValueList.of(values, schemaFields); + } + + @Test + public void testDefineGetProcedureColumnsComparator() { + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + // Order: PROC_CAT, PROC_SCHEM, PROC_NAME, SPECIFIC_NAME, COLUMN_NAME + results.add( + createProcedureColumnRowForSortTest( + "cat_b", "sch_y", "proc_1", "proc_1_spec", "param_a", 1, schemaFields)); + results.add( + createProcedureColumnRowForSortTest( + "cat_a", "sch_z", "proc_alpha", "proc_alpha_spec", "arg_z", 2, schemaFields)); + results.add( + createProcedureColumnRowForSortTest( + "cat_a", + "sch_z", + "proc_alpha", + "proc_alpha_spec", + "arg_m", + 1, + schemaFields)); // Same proc, different col + results.add( + createProcedureColumnRowForSortTest( + null, "sch_x", "proc_beta", "proc_beta_spec", "col_first", 1, schemaFields)); + results.add( + createProcedureColumnRowForSortTest( + "cat_a", null, "proc_gamma", "proc_gamma_spec", "input1", 1, schemaFields)); + + Comparator comparator = + dbMetadata.defineGetProcedureColumnsComparator(schemaFields); + assertNotNull(comparator); + dbMetadata.sortResults(results, comparator, "getProcedureColumns", dbMetadata.LOG); + + assertEquals(5, results.size()); + + // 1. Null cat, sch_x, proc_beta, proc_beta_spec, col_first + assertTrue(results.get(0).get("PROCEDURE_CAT").isNull()); + assertEquals("sch_x", results.get(0).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_beta", results.get(0).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_beta_spec", results.get(0).get("SPECIFIC_NAME").getStringValue()); + assertEquals("col_first", results.get(0).get("COLUMN_NAME").getStringValue()); + + // 2. cat_a, Null schem, proc_gamma, proc_gamma_spec, input1 + assertEquals("cat_a", results.get(1).get("PROCEDURE_CAT").getStringValue()); + assertTrue(results.get(1).get("PROCEDURE_SCHEM").isNull()); + assertEquals("proc_gamma", results.get(1).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_gamma_spec", results.get(1).get("SPECIFIC_NAME").getStringValue()); + assertEquals("input1", results.get(1).get("COLUMN_NAME").getStringValue()); + + // 3. cat_a, sch_z, proc_alpha, proc_alpha_spec, arg_m (m before z) + assertEquals("cat_a", results.get(2).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_z", results.get(2).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_alpha", results.get(2).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_alpha_spec", results.get(2).get("SPECIFIC_NAME").getStringValue()); + assertEquals("arg_m", results.get(2).get("COLUMN_NAME").getStringValue()); + + // 4. cat_a, sch_z, proc_alpha, proc_alpha_spec, arg_z + assertEquals("cat_a", results.get(3).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_z", results.get(3).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_alpha", results.get(3).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_alpha_spec", results.get(3).get("SPECIFIC_NAME").getStringValue()); + assertEquals("arg_z", results.get(3).get("COLUMN_NAME").getStringValue()); + + // 5. cat_b, sch_y, proc_1, proc_1_spec, param_a + assertEquals("cat_b", results.get(4).get("PROCEDURE_CAT").getStringValue()); + assertEquals("sch_y", results.get(4).get("PROCEDURE_SCHEM").getStringValue()); + assertEquals("proc_1", results.get(4).get("PROCEDURE_NAME").getStringValue()); + assertEquals("proc_1_spec", results.get(4).get("SPECIFIC_NAME").getStringValue()); + assertEquals("param_a", results.get(4).get("COLUMN_NAME").getStringValue()); + } + + @Test + public void testListMatchingProcedureIdsFromDatasets() throws Exception { + String catalog = "test-proj"; + String schema1Name = "dataset1"; + String schema2Name = "dataset2"; + Dataset dataset1 = mockBigQueryDataset(catalog, schema1Name); + Dataset dataset2 = mockBigQueryDataset(catalog, schema2Name); + List datasetsToScan = Arrays.asList(dataset1, dataset2); + + Routine proc1_ds1 = mockBigQueryRoutine(catalog, schema1Name, "proc_a", "PROCEDURE", "desc a"); + Routine func1_ds1 = mockBigQueryRoutine(catalog, schema1Name, "func_b", "FUNCTION", "desc b"); + Routine proc2_ds2 = mockBigQueryRoutine(catalog, schema2Name, "proc_c", "PROCEDURE", "desc c"); + + Page page1 = mock(Page.class); + when(page1.iterateAll()).thenReturn(Arrays.asList(proc1_ds1, func1_ds1)); + when(bigqueryClient.listRoutines(eq(dataset1.getDatasetId()), any(RoutineListOption.class))) + .thenReturn(page1); + + Page page2 = mock(Page.class); + when(page2.iterateAll()).thenReturn(Collections.singletonList(proc2_ds2)); + when(bigqueryClient.listRoutines(eq(dataset2.getDatasetId()), any(RoutineListOption.class))) + .thenReturn(page2); + + ExecutorService mockExecutor = mock(ExecutorService.class); + doAnswer( + invocation -> { + Callable callable = invocation.getArgument(0); + @SuppressWarnings("unchecked") // Suppress warning for raw Future mock + Future mockedFuture = mock(Future.class); + + try { + Object result = callable.call(); + doReturn(result).when(mockedFuture).get(); + } catch (InterruptedException interruptedException) { + doThrow(interruptedException).when(mockedFuture).get(); + } catch (Exception e) { + doThrow(new ExecutionException(e)).when(mockedFuture).get(); + } + return mockedFuture; + }) + .when(mockExecutor) + .submit(any(Callable.class)); + + List resultIds = + dbMetadata.listMatchingProcedureIdsFromDatasets( + datasetsToScan, null, null, mockExecutor, catalog, dbMetadata.LOG); + + assertEquals(2, resultIds.size()); + assertTrue(resultIds.contains(proc1_ds1.getRoutineId())); + assertTrue(resultIds.contains(proc2_ds2.getRoutineId())); + assertFalse(resultIds.contains(func1_ds1.getRoutineId())); // Should not contain functions + + verify(mockExecutor, times(2)).submit(any(Callable.class)); + } + + @Test + public void testSubmitProcedureArgumentProcessingJobs_Basic() throws InterruptedException { + String catalog = "p"; + String schemaName = "d"; + RoutineArgument arg1 = mockRoutineArgument("arg1_name", StandardSQLTypeName.STRING, "IN"); + Routine proc1 = + mockBigQueryRoutineWithArgs( + catalog, schemaName, "proc1", "PROCEDURE", "desc1", Collections.singletonList(arg1)); + Routine func1 = + mockBigQueryRoutineWithArgs( + catalog, + schemaName, + "func1", + "FUNCTION", + "desc_func", + Collections.emptyList()); // Should be skipped + Routine proc2 = + mockBigQueryRoutineWithArgs( + catalog, schemaName, "proc2", "PROCEDURE", "desc2", Collections.emptyList()); + + List fullRoutines = Arrays.asList(proc1, func1, proc2); + Pattern columnNameRegex = null; + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Schema resultSchema = dbMetadata.defineGetProcedureColumnsSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + + ExecutorService mockExecutor = mock(ExecutorService.class); + List> processingTaskFutures = new ArrayList<>(); + + // Capture the runnable submitted to the executor + List submittedRunnables = new ArrayList<>(); + doAnswer( + invocation -> { + Runnable runnable = invocation.getArgument(0); + submittedRunnables.add(runnable); + Future future = mock(Future.class); + return future; + }) + .when(mockExecutor) + .submit(any(Runnable.class)); + + dbMetadata.submitProcedureArgumentProcessingJobs( + fullRoutines, + columnNameRegex, + collectedResults, + resultSchemaFields, + mockExecutor, + processingTaskFutures, + dbMetadata.LOG); + + verify(mockExecutor, times(2)).submit(any(Runnable.class)); + assertEquals(2, processingTaskFutures.size()); + } + + @Test + public void testDefineGetTableTypesSchema() { + Schema schema = BigQueryDatabaseMetaData.defineGetTableTypesSchema(); + + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Should have one column", 1, fields.size()); + + Field tableTypeField = fields.get("TABLE_TYPE"); + assertNotNull("TABLE_TYPE field should exist", tableTypeField); + assertEquals("Field name should be TABLE_TYPE", "TABLE_TYPE", tableTypeField.getName()); + assertEquals( + "Field type should be STRING", + StandardSQLTypeName.STRING, + tableTypeField.getType().getStandardType()); + assertEquals("Field mode should be REQUIRED", Field.Mode.REQUIRED, tableTypeField.getMode()); + } + + @Test + public void testPrepareGetTableTypesRows() { + Schema schema = BigQueryDatabaseMetaData.defineGetTableTypesSchema(); + List rows = BigQueryDatabaseMetaData.prepareGetTableTypesRows(schema); + + assertNotNull("Rows list should not be null", rows); + String[] expectedTableTypes = {"EXTERNAL", "MATERIALIZED VIEW", "SNAPSHOT", "TABLE", "VIEW"}; + assertEquals( + "Should have " + expectedTableTypes.length + " rows", + expectedTableTypes.length, + rows.size()); + + Set foundTypes = new HashSet<>(); + for (int i = 0; i < rows.size(); i++) { + FieldValueList row = rows.get(i); + assertEquals("Row " + i + " should have 1 field value", 1, row.size()); + assertFalse("FieldValue in row " + i + " should not be SQL NULL", row.get(0).isNull()); + + String tableType = row.get(0).getStringValue(); + foundTypes.add(tableType); + } + + assertEquals( + "All expected table types should be present and correctly mapped", + new HashSet<>(Arrays.asList(expectedTableTypes)), + foundTypes); + } + + @Test + public void testGetTableTypes() throws SQLException { + try (ResultSet rs = dbMetadata.getTableTypes()) { + assertNotNull("ResultSet from getTableTypes() should not be null", rs); + + ResultSetMetaData rsmd = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", rsmd); + assertEquals("Should have one column", 1, rsmd.getColumnCount()); + assertEquals("Column name should be TABLE_TYPE", "TABLE_TYPE", rsmd.getColumnName(1)); + assertEquals("Column type should be NVARCHAR", Types.NVARCHAR, rsmd.getColumnType(1)); + + List actualTableTypes = new ArrayList<>(); + while (rs.next()) { + actualTableTypes.add(rs.getString("TABLE_TYPE")); + } + + String[] expectedTableTypes = {"EXTERNAL", "MATERIALIZED VIEW", "SNAPSHOT", "TABLE", "VIEW"}; + assertEquals( + "Number of table types should match", expectedTableTypes.length, actualTableTypes.size()); + + Set expectedSet = new HashSet<>(Arrays.asList(expectedTableTypes)); + Set actualSet = new HashSet<>(actualTableTypes); + assertEquals( + "All expected table types should be present in the ResultSet", expectedSet, actualSet); + } + } + + @Test + public void testDefineGetSuperTablesSchema() { + Schema schema = dbMetadata.defineGetSuperTablesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 4 fields", 4, fields.size()); + + Field tableCat = fields.get("TABLE_CAT"); + assertNotNull(tableCat); + assertEquals("TABLE_CAT", tableCat.getName()); + assertEquals(StandardSQLTypeName.STRING, tableCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, tableCat.getMode()); + + Field tableSchem = fields.get("TABLE_SCHEM"); + assertNotNull(tableSchem); + assertEquals("TABLE_SCHEM", tableSchem.getName()); + assertEquals(StandardSQLTypeName.STRING, tableSchem.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, tableSchem.getMode()); + + Field tableName = fields.get("TABLE_NAME"); + assertNotNull(tableName); + assertEquals("TABLE_NAME", tableName.getName()); + assertEquals(StandardSQLTypeName.STRING, tableName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, tableName.getMode()); + + Field superTableName = fields.get("SUPERTABLE_NAME"); + assertNotNull(superTableName); + assertEquals("SUPERTABLE_NAME", superTableName.getName()); + assertEquals(StandardSQLTypeName.STRING, superTableName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, superTableName.getMode()); + } + + @Test + public void testGetSuperTables_ReturnsEmptyResultSetWithCorrectMetadata() throws SQLException { + try (ResultSet rs = + dbMetadata.getSuperTables("testCatalog", "testSchemaPattern", "testTableNamePattern")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty (next() should return false)", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", metaData); + assertEquals("ResultSetMetaData should have 4 columns", 4, metaData.getColumnCount()); + + // Column 1: TABLE_CAT + assertEquals("TABLE_CAT", metaData.getColumnName(1)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(1)); // Assuming STRING maps to VARCHAR + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(1)); + + // Column 2: TABLE_SCHEM + assertEquals("TABLE_SCHEM", metaData.getColumnName(2)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(2)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(2)); + + // Column 3: TABLE_NAME + assertEquals("TABLE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); // REQUIRED + + // Column 4: SUPERTABLE_NAME + assertEquals("SUPERTABLE_NAME", metaData.getColumnName(4)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(4)); // REQUIRED + } + } + + @Test + public void testDefineGetSuperTypesSchema() { + Schema schema = dbMetadata.defineGetSuperTypesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 6 fields", 6, fields.size()); + + Field typeCat = fields.get("TYPE_CAT"); + assertNotNull(typeCat); + assertEquals("TYPE_CAT", typeCat.getName()); + assertEquals(StandardSQLTypeName.STRING, typeCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, typeCat.getMode()); + + Field typeSchem = fields.get("TYPE_SCHEM"); + assertNotNull(typeSchem); + assertEquals("TYPE_SCHEM", typeSchem.getName()); + assertEquals(StandardSQLTypeName.STRING, typeSchem.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, typeSchem.getMode()); + + Field typeName = fields.get("TYPE_NAME"); + assertNotNull(typeName); + assertEquals("TYPE_NAME", typeName.getName()); + assertEquals(StandardSQLTypeName.STRING, typeName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, typeName.getMode()); + + Field superTypeCat = fields.get("SUPERTYPE_CAT"); + assertNotNull(superTypeCat); + assertEquals("SUPERTYPE_CAT", superTypeCat.getName()); + assertEquals(StandardSQLTypeName.STRING, superTypeCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, superTypeCat.getMode()); + + Field superTypeSchem = fields.get("SUPERTYPE_SCHEM"); + assertNotNull(superTypeSchem); + assertEquals("SUPERTYPE_SCHEM", superTypeSchem.getName()); + assertEquals(StandardSQLTypeName.STRING, superTypeSchem.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, superTypeSchem.getMode()); + + Field superTypeName = fields.get("SUPERTYPE_NAME"); + assertNotNull(superTypeName); + assertEquals("SUPERTYPE_NAME", superTypeName.getName()); + assertEquals(StandardSQLTypeName.STRING, superTypeName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, superTypeName.getMode()); + } + + @Test + public void testGetSuperTypes_ReturnsEmptyResultSetWithCorrectMetadata() throws SQLException { + try (ResultSet rs = + dbMetadata.getSuperTypes("testCatalog", "testSchemaPattern", "testTypeNamePattern")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty (next() should return false)", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", metaData); + assertEquals("ResultSetMetaData should have 6 columns", 6, metaData.getColumnCount()); + + // Column 1: TYPE_CAT + assertEquals("TYPE_CAT", metaData.getColumnName(1)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(1)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(1)); + + // Column 2: TYPE_SCHEM + assertEquals("TYPE_SCHEM", metaData.getColumnName(2)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(2)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(2)); + + // Column 3: TYPE_NAME + assertEquals("TYPE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + // Column 4: SUPERTYPE_CAT + assertEquals("SUPERTYPE_CAT", metaData.getColumnName(4)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(4)); + + // Column 5: SUPERTYPE_SCHEM + assertEquals("SUPERTYPE_SCHEM", metaData.getColumnName(5)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(5)); + + // Column 6: SUPERTYPE_NAME + assertEquals("SUPERTYPE_NAME", metaData.getColumnName(6)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(6)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(6)); + } + } + + @Test + public void testDefineGetAttributesSchema() { + Schema schema = dbMetadata.defineGetAttributesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 21 fields", 21, fields.size()); + + assertEquals("TYPE_CAT", fields.get(0).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(0).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(0).getMode()); + + assertEquals("ATTR_NAME", fields.get(3).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(3).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(3).getMode()); + + assertEquals("DATA_TYPE", fields.get(4).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(4).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(4).getMode()); + + assertEquals("ORDINAL_POSITION", fields.get(15).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(15).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(15).getMode()); + + assertEquals("IS_NULLABLE", fields.get(16).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(16).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(16).getMode()); + + assertEquals("SOURCE_DATA_TYPE", fields.get(20).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(20).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(20).getMode()); + } + + @Test + public void testGetAttributes_ReturnsEmptyResultSet() throws SQLException { + try (ResultSet rs = + dbMetadata.getAttributes("testCat", "testSchema", "testType", "testAttr%")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 21 columns", 21, metaData.getColumnCount()); + + assertEquals("TYPE_CAT", metaData.getColumnName(1)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(1)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(1)); + + assertEquals("ATTR_NAME", metaData.getColumnName(4)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(4)); + + assertEquals("DATA_TYPE", metaData.getColumnName(5)); + assertEquals(Types.BIGINT, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(5)); + + assertEquals("ORDINAL_POSITION", metaData.getColumnName(16)); + assertEquals(Types.BIGINT, metaData.getColumnType(16)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(16)); + + assertEquals("IS_NULLABLE", metaData.getColumnName(17)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(17)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(17)); + + assertEquals("SOURCE_DATA_TYPE", metaData.getColumnName(21)); + assertEquals(Types.BIGINT, metaData.getColumnType(21)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(21)); + } + } + + @Test + public void testDefineGetBestRowIdentifierSchema() { + Schema schema = dbMetadata.defineGetBestRowIdentifierSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 8 fields", 8, fields.size()); + + assertEquals("SCOPE", fields.get(0).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(0).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(0).getMode()); + + assertEquals("COLUMN_NAME", fields.get(1).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(1).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(1).getMode()); + + assertEquals("DATA_TYPE", fields.get(2).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(2).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(2).getMode()); + + assertEquals("BUFFER_LENGTH", fields.get(5).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(5).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(5).getMode()); + + assertEquals("DECIMAL_DIGITS", fields.get(6).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(6).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(6).getMode()); + + assertEquals("PSEUDO_COLUMN", fields.get(7).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(7).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(7).getMode()); + } + + @Test + public void testGetBestRowIdentifier_ReturnsEmptyResultSetWithCorrectMetadata() + throws SQLException { + int testScope = DatabaseMetaData.bestRowSession; + boolean testNullable = true; + + try (ResultSet rs = + dbMetadata.getBestRowIdentifier( + "testCat", "testSchema", "testTable", testScope, testNullable)) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 8 columns", 8, metaData.getColumnCount()); + + assertEquals("SCOPE", metaData.getColumnName(1)); + assertEquals(Types.BIGINT, metaData.getColumnType(1)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(1)); + + assertEquals("COLUMN_NAME", metaData.getColumnName(2)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(2)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(2)); + + assertEquals("DATA_TYPE", metaData.getColumnName(3)); + assertEquals(Types.BIGINT, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("BUFFER_LENGTH", metaData.getColumnName(6)); + assertEquals(Types.BIGINT, metaData.getColumnType(6)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(6)); + + assertEquals("PSEUDO_COLUMN", metaData.getColumnName(8)); + assertEquals(Types.BIGINT, metaData.getColumnType(8)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(8)); + } + } + + @Test + public void testDefineGetUDTsSchema() { + Schema schema = dbMetadata.defineGetUDTsSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 7 fields", 7, fields.size()); + + assertEquals("TYPE_NAME", fields.get("TYPE_NAME").getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get("TYPE_NAME").getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get("TYPE_NAME").getMode()); + + assertEquals("CLASS_NAME", fields.get("CLASS_NAME").getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get("CLASS_NAME").getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get("CLASS_NAME").getMode()); + + assertEquals("DATA_TYPE", fields.get("DATA_TYPE").getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get("DATA_TYPE").getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get("DATA_TYPE").getMode()); + + assertEquals("BASE_TYPE", fields.get("BASE_TYPE").getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get("BASE_TYPE").getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get("BASE_TYPE").getMode()); + } + + @Test + public void testGetUDTs_ReturnsEmptyResultSet() throws SQLException { + int[] types = {Types.STRUCT, Types.DISTINCT}; + try (ResultSet rs = dbMetadata.getUDTs("testCat", "testSchema%", "testType%", types)) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 7 columns", 7, metaData.getColumnCount()); + + assertEquals("TYPE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("DATA_TYPE", metaData.getColumnName(5)); + assertEquals(Types.BIGINT, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(5)); + + assertEquals("BASE_TYPE", metaData.getColumnName(7)); + assertEquals(Types.BIGINT, metaData.getColumnType(7)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(7)); + } + } + + @Test + public void testDefineGetIndexInfoSchema() { + Schema schema = dbMetadata.defineGetIndexInfoSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 13 fields", 13, fields.size()); + + assertEquals("TABLE_NAME", fields.get(2).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(2).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(2).getMode()); + + assertEquals("NON_UNIQUE", fields.get(3).getName()); + assertEquals(StandardSQLTypeName.BOOL, fields.get(3).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(3).getMode()); + + assertEquals("TYPE", fields.get(6).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(6).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(6).getMode()); + + assertEquals("CARDINALITY", fields.get(10).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(10).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(10).getMode()); + } + + @Test + public void testGetIndexInfo_ReturnsEmptyResultSetWithCorrectMetadata() throws SQLException { + try (ResultSet rs = dbMetadata.getIndexInfo("testCat", "testSchema", "testTable", true, true)) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 13 columns", 13, metaData.getColumnCount()); + + assertEquals("TABLE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("NON_UNIQUE", metaData.getColumnName(4)); + assertEquals(Types.BOOLEAN, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(4)); + + assertEquals("TYPE", metaData.getColumnName(7)); + assertEquals(Types.BIGINT, metaData.getColumnType(7)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(7)); + + assertEquals("CARDINALITY", metaData.getColumnName(11)); + assertEquals(Types.BIGINT, metaData.getColumnType(11)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(11)); + } + } + + @Test + public void testDefineGetTablePrivilegesSchema() { + Schema schema = dbMetadata.defineGetTablePrivilegesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 7 fields", 7, fields.size()); + + assertEquals("TABLE_CAT", fields.get(0).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(0).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(0).getMode()); + + assertEquals("TABLE_NAME", fields.get(2).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(2).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(2).getMode()); + + assertEquals("GRANTEE", fields.get(4).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(4).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(4).getMode()); + + assertEquals("PRIVILEGE", fields.get(5).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(5).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(5).getMode()); + + assertEquals("IS_GRANTABLE", fields.get(6).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(6).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(6).getMode()); + } + + @Test + public void testGetTablePrivileges_ReturnsEmptyResultSetWithCorrectMetadata() + throws SQLException { + try (ResultSet rs = dbMetadata.getTablePrivileges("testCat", "testSchema%", "testTable%")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 7 columns", 7, metaData.getColumnCount()); + + assertEquals("TABLE_CAT", metaData.getColumnName(1)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(1)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(1)); + + assertEquals("TABLE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("GRANTEE", metaData.getColumnName(5)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(5)); + + assertEquals("PRIVILEGE", metaData.getColumnName(6)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(6)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(6)); + + assertEquals("IS_GRANTABLE", metaData.getColumnName(7)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(7)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(7)); + } + } + + @Test + public void testDefineGetColumnPrivilegesSchema() { + Schema schema = dbMetadata.defineGetColumnPrivilegesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 8 fields", 8, fields.size()); + + assertEquals("TABLE_SCHEM", fields.get(1).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(1).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(1).getMode()); + + assertEquals("COLUMN_NAME", fields.get(3).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(3).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(3).getMode()); + + assertEquals("GRANTOR", fields.get(4).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(4).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(4).getMode()); + + assertEquals("PRIVILEGE", fields.get(6).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(6).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(6).getMode()); + + assertEquals("IS_GRANTABLE", fields.get(7).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(7).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(7).getMode()); + } + + @Test + public void testGetColumnPrivileges_ReturnsEmptyResultSetWithCorrectMetadata() + throws SQLException { + try (ResultSet rs = + dbMetadata.getColumnPrivileges("testCat", "testSchema", "testTable", "testCol%")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 8 columns", 8, metaData.getColumnCount()); + + assertEquals("TABLE_SCHEM", metaData.getColumnName(2)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(2)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(2)); + + assertEquals("COLUMN_NAME", metaData.getColumnName(4)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(4)); + + assertEquals("GRANTOR", metaData.getColumnName(5)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(5)); + + assertEquals("PRIVILEGE", metaData.getColumnName(7)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(7)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(7)); + + assertEquals("IS_GRANTABLE", metaData.getColumnName(8)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(8)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(8)); + } + } + + @Test + public void testDefineGetVersionColumnsSchema() { + Schema schema = dbMetadata.defineGetVersionColumnsSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 8 fields", 8, fields.size()); + + assertEquals("SCOPE", fields.get(0).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(0).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(0).getMode()); + + assertEquals("COLUMN_NAME", fields.get(1).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(1).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(1).getMode()); + + assertEquals("DATA_TYPE", fields.get(2).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(2).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(2).getMode()); + + assertEquals("BUFFER_LENGTH", fields.get(5).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(5).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(5).getMode()); + + assertEquals("PSEUDO_COLUMN", fields.get(7).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(7).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(7).getMode()); + } + + @Test + public void testGetVersionColumns_ReturnsEmptyResultSetWithCorrectMetadata() throws SQLException { + try (ResultSet rs = dbMetadata.getVersionColumns("testCat", "testSchema", "testTable")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 8 columns", 8, metaData.getColumnCount()); + + assertEquals("SCOPE", metaData.getColumnName(1)); + assertEquals(Types.BIGINT, metaData.getColumnType(1)); + assertEquals(ResultSetMetaData.columnNullable, metaData.isNullable(1)); + + assertEquals("COLUMN_NAME", metaData.getColumnName(2)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(2)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(2)); + + assertEquals("DATA_TYPE", metaData.getColumnName(3)); + assertEquals(Types.BIGINT, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("BUFFER_LENGTH", metaData.getColumnName(6)); + assertEquals(Types.BIGINT, metaData.getColumnType(6)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(6)); + + assertEquals("PSEUDO_COLUMN", metaData.getColumnName(8)); + assertEquals(Types.BIGINT, metaData.getColumnType(8)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(8)); + } + } + + @Test + public void testDefineGetPseudoColumnsSchema() { + Schema schema = dbMetadata.defineGetPseudoColumnsSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 12 fields", 12, fields.size()); + + assertEquals("TABLE_NAME", fields.get(2).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(2).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(2).getMode()); + + assertEquals("COLUMN_NAME", fields.get(3).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(3).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(3).getMode()); + + assertEquals("DATA_TYPE", fields.get(4).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(4).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(4).getMode()); + + assertEquals("COLUMN_SIZE", fields.get(5).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(5).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(5).getMode()); + + assertEquals("COLUMN_USAGE", fields.get(8).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(8).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(8).getMode()); + + assertEquals("IS_NULLABLE", fields.get(11).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(11).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(11).getMode()); + } + + @Test + public void testGetPseudoColumns_ReturnsEmptyResultSet() throws SQLException { + try (ResultSet rs = dbMetadata.getPseudoColumns("testCat", "testSchema%", "testTable%", "%")) { + assertNotNull("ResultSet should not be null", rs); + assertFalse("ResultSet should be empty", rs.next()); + + ResultSetMetaData metaData = rs.getMetaData(); + assertEquals("ResultSetMetaData should have 12 columns", 12, metaData.getColumnCount()); + + assertEquals("TABLE_NAME", metaData.getColumnName(3)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(3)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(3)); + + assertEquals("COLUMN_NAME", metaData.getColumnName(4)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(4)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(4)); + + assertEquals("DATA_TYPE", metaData.getColumnName(5)); + assertEquals(Types.BIGINT, metaData.getColumnType(5)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(5)); + + assertEquals("COLUMN_SIZE", metaData.getColumnName(6)); + assertEquals(Types.BIGINT, metaData.getColumnType(6)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(6)); + + assertEquals("COLUMN_USAGE", metaData.getColumnName(9)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(9)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(9)); + + assertEquals("IS_NULLABLE", metaData.getColumnName(12)); + assertEquals(Types.NVARCHAR, metaData.getColumnType(12)); + assertEquals(ResultSetMetaData.columnNoNulls, metaData.isNullable(12)); + } + } + + @Test + public void testDefineGetFunctionsSchema() { + Schema schema = dbMetadata.defineGetFunctionsSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(6, fields.size()); + + Field funcCat = fields.get("FUNCTION_CAT"); + assertEquals("FUNCTION_CAT", funcCat.getName()); + assertEquals(StandardSQLTypeName.STRING, funcCat.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, funcCat.getMode()); + + Field funcSchem = fields.get("FUNCTION_SCHEM"); + assertEquals("FUNCTION_SCHEM", funcSchem.getName()); + assertEquals(StandardSQLTypeName.STRING, funcSchem.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, funcSchem.getMode()); + + Field funcName = fields.get("FUNCTION_NAME"); + assertEquals("FUNCTION_NAME", funcName.getName()); + assertEquals(StandardSQLTypeName.STRING, funcName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, funcName.getMode()); + + Field remarks = fields.get("REMARKS"); + assertEquals("REMARKS", remarks.getName()); + assertEquals(StandardSQLTypeName.STRING, remarks.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, remarks.getMode()); + + Field funcType = fields.get("FUNCTION_TYPE"); + assertEquals("FUNCTION_TYPE", funcType.getName()); + assertEquals(StandardSQLTypeName.INT64, funcType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, funcType.getMode()); + + Field specificName = fields.get("SPECIFIC_NAME"); + assertEquals("SPECIFIC_NAME", specificName.getName()); + assertEquals(StandardSQLTypeName.STRING, specificName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, specificName.getMode()); + } + + @Test + public void testProcessFunctionInfo_ScalarFunction() { + Schema resultSchema = dbMetadata.defineGetFunctionsSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "proj-func"; + String schema = "dataset_func"; + String name = "my_scalar_func"; + String description = "A test scalar function"; + + Routine routine = mockBigQueryRoutine(catalog, schema, name, "SCALAR_FUNCTION", description); + + dbMetadata.processFunctionInfo(routine, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertNotNull(row); + assertEquals(6, row.size()); + assertEquals(catalog, row.get("FUNCTION_CAT").getStringValue()); + assertEquals(schema, row.get("FUNCTION_SCHEM").getStringValue()); + assertEquals(name, row.get("FUNCTION_NAME").getStringValue()); + assertEquals(description, row.get("REMARKS").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionResultUnknown), + row.get("FUNCTION_TYPE").getStringValue()); + assertEquals(name, row.get("SPECIFIC_NAME").getStringValue()); + } + + @Test + public void testProcessFunctionInfo_TableFunction() { + Schema resultSchema = dbMetadata.defineGetFunctionsSchema(); + FieldList resultSchemaFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + String catalog = "proj-func"; + String schema = "dataset_func"; + String name = "my_table_func"; + String description = "A test Table function"; + + Routine routine = mockBigQueryRoutine(catalog, schema, name, "TABLE_FUNCTION", description); + + dbMetadata.processFunctionInfo(routine, collectedResults, resultSchemaFields); + + assertEquals(1, collectedResults.size()); + FieldValueList row = collectedResults.get(0); + assertNotNull(row); + assertEquals(6, row.size()); + assertEquals(catalog, row.get("FUNCTION_CAT").getStringValue()); + assertEquals(schema, row.get("FUNCTION_SCHEM").getStringValue()); + assertEquals(name, row.get("FUNCTION_NAME").getStringValue()); + assertEquals(description, row.get("REMARKS").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionReturnsTable), + row.get("FUNCTION_TYPE").getStringValue()); + assertEquals(name, row.get("SPECIFIC_NAME").getStringValue()); + } + + private FieldValueList createFunctionRow( + String cat, + String schem, + String name, + String specName, + int funcType, + FieldList schemaFields) { + List values = new ArrayList<>(); + values.add(dbMetadata.createStringFieldValue(cat)); // FUNCTION_CAT + values.add(dbMetadata.createStringFieldValue(schem)); // FUNCTION_SCHEM + values.add(dbMetadata.createStringFieldValue(name)); // FUNCTION_NAME + values.add(dbMetadata.createStringFieldValue("Remark for " + name)); // REMARKS + values.add(dbMetadata.createLongFieldValue((long) funcType)); // FUNCTION_TYPE + values.add(dbMetadata.createStringFieldValue(specName)); // SPECIFIC_NAME + return FieldValueList.of(values, schemaFields); + } + + @Test + public void testSortResults_Functions() { + Schema resultSchema = dbMetadata.defineGetFunctionsSchema(); + FieldList schemaFields = resultSchema.getFields(); + List results = new ArrayList<>(); + + // Add rows in unsorted order + results.add( + createFunctionRow( + "cat_b", + "sch_c", + "func_1", + "func_1_spec", + DatabaseMetaData.functionResultUnknown, + schemaFields)); + results.add( + createFunctionRow( + "cat_a", + "sch_z", + "func_alpha", + "func_alpha_spec", + DatabaseMetaData.functionReturnsTable, + schemaFields)); + results.add( + createFunctionRow( + "cat_a", + "sch_z", + "func_beta", + "func_beta_spec", + DatabaseMetaData.functionResultUnknown, + schemaFields)); + results.add( + createFunctionRow( + null, + "sch_y", + "func_gamma", + "func_gamma_spec", + DatabaseMetaData.functionReturnsTable, + schemaFields)); + results.add( + createFunctionRow( + "cat_a", + null, + "func_delta", + "func_delta_spec", + DatabaseMetaData.functionResultUnknown, + schemaFields)); + results.add( + createFunctionRow( + "cat_a", + "sch_z", + "func_alpha", + "func_alpha_spec_older", + DatabaseMetaData.functionReturnsTable, + schemaFields)); + + Comparator comparator = dbMetadata.defineGetFunctionsComparator(schemaFields); + dbMetadata.sortResults(results, comparator, "getFunctions", dbMetadata.LOG); + + // Expected Order: Null Cat, then Cat A (Null Schem, then sch_z), then Cat B. Within that, Name, + // then Spec Name. + assertEquals(6, results.size()); + + // Check order based on the comparator (CAT, SCHEM, NAME, SPECIFIC_NAME) + assertEquals("func_gamma", results.get(0).get("FUNCTION_NAME").getStringValue()); // null cat + assertEquals( + "func_delta", results.get(1).get("FUNCTION_NAME").getStringValue()); // cat_a, null schem + assertEquals( + "func_alpha", + results.get(2).get("FUNCTION_NAME").getStringValue()); // cat_a, sch_z, alpha, spec + assertEquals( + "func_alpha", + results.get(3).get("FUNCTION_NAME").getStringValue()); // cat_a, sch_z, alpha, spec_older + assertEquals( + "func_beta", results.get(4).get("FUNCTION_NAME").getStringValue()); // cat_a, sch_z, beta + assertEquals("func_1", results.get(5).get("FUNCTION_NAME").getStringValue()); // cat_b + } + + @Test + public void testDefineGetTypeInfoSchema() { + Schema schema = dbMetadata.defineGetTypeInfoSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 18 fields", 18, fields.size()); + + Field typeName = fields.get("TYPE_NAME"); + assertNotNull(typeName); + assertEquals("TYPE_NAME", typeName.getName()); + assertEquals(StandardSQLTypeName.STRING, typeName.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, typeName.getMode()); + + Field dataType = fields.get("DATA_TYPE"); + assertNotNull(dataType); + assertEquals("DATA_TYPE", dataType.getName()); + assertEquals(StandardSQLTypeName.INT64, dataType.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, dataType.getMode()); + + Field precision = fields.get("PRECISION"); + assertNotNull(precision); + assertEquals("PRECISION", precision.getName()); + assertEquals(StandardSQLTypeName.INT64, precision.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, precision.getMode()); + + Field caseSensitive = fields.get("CASE_SENSITIVE"); + assertNotNull(caseSensitive); + assertEquals("CASE_SENSITIVE", caseSensitive.getName()); + assertEquals(StandardSQLTypeName.BOOL, caseSensitive.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, caseSensitive.getMode()); + + Field numPrecRadix = fields.get("NUM_PREC_RADIX"); + assertNotNull(numPrecRadix); + assertEquals("NUM_PREC_RADIX", numPrecRadix.getName()); + assertEquals(StandardSQLTypeName.INT64, numPrecRadix.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, numPrecRadix.getMode()); + } + + @Test + public void testPrepareGetTypeInfoRows() { + Schema typeInfoSchema = dbMetadata.defineGetTypeInfoSchema(); + FieldList schemaFields = typeInfoSchema.getFields(); + List rows = dbMetadata.prepareGetTypeInfoRows(schemaFields); + + assertNotNull("Rows list should not be null", rows); + assertEquals("Should have 17 rows for 17 types", 17, rows.size()); + + // INT64 (should be BIGINT in JDBC) + Optional int64RowOpt = + rows.stream() + .filter(row -> "INT64".equals(row.get("TYPE_NAME").getStringValue())) + .findFirst(); + assertTrue("INT64 type info row should exist", int64RowOpt.isPresent()); + FieldValueList int64Row = int64RowOpt.get(); + assertEquals(String.valueOf(Types.BIGINT), int64Row.get("DATA_TYPE").getStringValue()); + assertEquals("19", int64Row.get("PRECISION").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.typeNullable), int64Row.get("NULLABLE").getStringValue()); + assertEquals("0", int64Row.get("CASE_SENSITIVE").getStringValue()); + assertEquals("10", int64Row.get("NUM_PREC_RADIX").getStringValue()); + + // BOOL (should be BOOLEAN in JDBC) + Optional boolRowOpt = + rows.stream() + .filter(row -> "BOOL".equals(row.get("TYPE_NAME").getStringValue())) + .findFirst(); + assertTrue("BOOL type info row should exist", boolRowOpt.isPresent()); + FieldValueList boolRow = boolRowOpt.get(); + assertEquals(String.valueOf(Types.BOOLEAN), boolRow.get("DATA_TYPE").getStringValue()); + assertEquals("1", boolRow.get("PRECISION").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.typeNullable), boolRow.get("NULLABLE").getStringValue()); + assertEquals("0", boolRow.get("CASE_SENSITIVE").getStringValue()); // false + assertTrue(boolRow.get("NUM_PREC_RADIX").isNull()); + + // STRING (should be NVARCHAR in JDBC) + Optional stringRowOpt = + rows.stream() + .filter(row -> "STRING".equals(row.get("TYPE_NAME").getStringValue())) + .findFirst(); + assertTrue("STRING type info row should exist", stringRowOpt.isPresent()); + FieldValueList stringRow = stringRowOpt.get(); + assertEquals(String.valueOf(Types.NVARCHAR), stringRow.get("DATA_TYPE").getStringValue()); + assertTrue(stringRow.get("PRECISION").isNull()); // Precision is null for STRING + assertEquals("'", stringRow.get("LITERAL_PREFIX").getStringValue()); + assertEquals("'", stringRow.get("LITERAL_SUFFIX").getStringValue()); + assertEquals("LENGTH", stringRow.get("CREATE_PARAMS").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.typeNullable), stringRow.get("NULLABLE").getStringValue()); + assertEquals("1", stringRow.get("CASE_SENSITIVE").getStringValue()); // true + assertTrue(stringRow.get("NUM_PREC_RADIX").isNull()); + } + + @Test + public void testGetTypeInfo() throws SQLException { + try (ResultSet rs = dbMetadata.getTypeInfo()) { + assertNotNull("ResultSet from getTypeInfo() should not be null", rs); + + ResultSetMetaData rsmd = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", rsmd); + assertEquals("Should have 18 columns", 18, rsmd.getColumnCount()); + assertEquals("TYPE_NAME", rsmd.getColumnName(1)); + assertEquals("DATA_TYPE", rsmd.getColumnName(2)); + assertEquals("PRECISION", rsmd.getColumnName(3)); + + List dataTypes = new ArrayList<>(); + int rowCount = 0; + while (rs.next()) { + rowCount++; + dataTypes.add(rs.getInt("DATA_TYPE")); + if ("INT64".equals(rs.getString("TYPE_NAME"))) { + assertEquals(Types.BIGINT, rs.getInt("DATA_TYPE")); + assertEquals(19, rs.getInt("PRECISION")); + } + } + assertEquals("Should have 17 rows for 17 types", 17, rowCount); + + // Verify sorting by DATA_TYPE + List sortedDataTypes = new ArrayList<>(dataTypes); + Collections.sort(sortedDataTypes); + assertEquals("Results should be sorted by DATA_TYPE", sortedDataTypes, dataTypes); + } + } + + @Test + public void testDefineGetFunctionColumnsSchema() { + Schema schema = dbMetadata.defineGetFunctionColumnsSchema(); + assertNotNull(schema); + FieldList fields = schema.getFields(); + assertEquals(17, fields.size()); + + assertEquals("FUNCTION_CAT", fields.get(0).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(0).getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, fields.get(0).getMode()); + + assertEquals("COLUMN_NAME", fields.get(3).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(3).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(3).getMode()); + + assertEquals("COLUMN_TYPE", fields.get(4).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(4).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(4).getMode()); + + assertEquals("ORDINAL_POSITION", fields.get(14).getName()); + assertEquals(StandardSQLTypeName.INT64, fields.get(14).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(14).getMode()); + + assertEquals("SPECIFIC_NAME", fields.get(16).getName()); + assertEquals(StandardSQLTypeName.STRING, fields.get(16).getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, fields.get(16).getMode()); + } + + @Test + public void testCreateFunctionColumnRow() { + StandardSQLDataType stringType = mockStandardSQLDataType(StandardSQLTypeName.STRING); + List row = + dbMetadata.createFunctionColumnRow( + "cat", + "sch", + "func", + "func_spec", + "param_in", + DatabaseMetaData.functionColumnIn, + stringType, + 1); + + assertEquals(17, row.size()); + assertEquals("cat", row.get(0).getStringValue()); + assertEquals("sch", row.get(1).getStringValue()); + assertEquals("func", row.get(2).getStringValue()); + assertEquals("param_in", row.get(3).getStringValue()); + assertEquals(String.valueOf(DatabaseMetaData.functionColumnIn), row.get(4).getStringValue()); + assertEquals(String.valueOf(Types.NVARCHAR), row.get(5).getStringValue()); // DATA_TYPE + assertEquals("NVARCHAR", row.get(6).getStringValue()); // TYPE_NAME + assertTrue(row.get(7).isNull()); // PRECISION + assertTrue(row.get(8).isNull()); // LENGTH + assertTrue(row.get(9).isNull()); // SCALE + assertTrue(row.get(10).isNull()); // RADIX + assertEquals( + String.valueOf(DatabaseMetaData.functionNullableUnknown), + row.get(11).getStringValue()); // NULLABLE + assertTrue(row.get(12).isNull()); // REMARKS + assertTrue(row.get(13).isNull()); // CHAR_OCTET_LENGTH (should be columnSize) + assertEquals("1", row.get(14).getStringValue()); // ORDINAL_POSITION + assertEquals("", row.get(15).getStringValue()); // IS_NULLABLE + assertEquals("func_spec", row.get(16).getStringValue()); // SPECIFIC_NAME + } + + @Test + public void testProcessFunctionParametersAndReturnValue_ScalarFunctionWithArgs() { + Schema resultSchema = dbMetadata.defineGetFunctionColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + RoutineArgument arg1 = mockRoutineArgument("in_str", StandardSQLTypeName.STRING, "IN"); + RoutineArgument arg2 = mockRoutineArgument("in_int", StandardSQLTypeName.INT64, "IN"); + Routine scalarFunc = + mockBigQueryRoutineWithArgs( + "cat", "ds", "my_scalar", "SCALAR_FUNCTION", "desc", Arrays.asList(arg1, arg2)); + when(scalarFunc.getReturnTableType()).thenReturn(null); // No return table for scalar + + dbMetadata.processFunctionParametersAndReturnValue( + scalarFunc, null, collectedResults, resultFields); + + assertEquals(2, collectedResults.size()); + // First argument + assertEquals("in_str", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionColumnIn), + collectedResults.get(0).get("COLUMN_TYPE").getStringValue()); + assertEquals("1", collectedResults.get(0).get("ORDINAL_POSITION").getStringValue()); + // Second argument + assertEquals("in_int", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionColumnIn), + collectedResults.get(1).get("COLUMN_TYPE").getStringValue()); + assertEquals("2", collectedResults.get(1).get("ORDINAL_POSITION").getStringValue()); + } + + @Test + public void testProcessFunctionParametersAndReturnValue_TableFunctionWithReturnTable() { + Schema resultSchema = dbMetadata.defineGetFunctionColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + + StandardSQLField returnCol1 = mockStandardSQLField("out_id", StandardSQLTypeName.INT64); + StandardSQLField returnCol2 = mockStandardSQLField("out_val", StandardSQLTypeName.STRING); + StandardSQLTableType returnTable = + mockStandardSQLTableType(Arrays.asList(returnCol1, returnCol2)); + + Routine tableFunc = + mockBigQueryRoutineWithArgs( + "cat", "ds", "my_table_func", "TABLE_FUNCTION", "desc", Collections.emptyList()); + when(tableFunc.getReturnTableType()).thenReturn(returnTable); + + dbMetadata.processFunctionParametersAndReturnValue( + tableFunc, null, collectedResults, resultFields); + + assertEquals(2, collectedResults.size()); + // First return column + assertEquals("out_id", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionColumnResult), + collectedResults.get(0).get("COLUMN_TYPE").getStringValue()); + assertEquals("1", collectedResults.get(0).get("ORDINAL_POSITION").getStringValue()); + // Second return column + assertEquals("out_val", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + assertEquals( + String.valueOf(DatabaseMetaData.functionColumnResult), + collectedResults.get(1).get("COLUMN_TYPE").getStringValue()); + assertEquals("2", collectedResults.get(1).get("ORDINAL_POSITION").getStringValue()); + } + + @Test + public void testProcessFunctionParametersAndReturnValue_ColumnNameFilter() { + Schema resultSchema = dbMetadata.defineGetFunctionColumnsSchema(); + FieldList resultFields = resultSchema.getFields(); + List collectedResults = Collections.synchronizedList(new ArrayList<>()); + Pattern columnNamePattern = Pattern.compile("id_.*"); // Match columns starting with "id_" + + RoutineArgument arg1 = mockRoutineArgument("id_arg", StandardSQLTypeName.INT64, "IN"); + RoutineArgument arg2 = mockRoutineArgument("name_arg", StandardSQLTypeName.STRING, "IN"); + StandardSQLField returnCol1 = mockStandardSQLField("id_return", StandardSQLTypeName.BOOL); + StandardSQLField returnCol2 = mockStandardSQLField("value_return", StandardSQLTypeName.FLOAT64); + StandardSQLTableType returnTable = + mockStandardSQLTableType(Arrays.asList(returnCol1, returnCol2)); + + Routine tableFunc = + mockBigQueryRoutineWithArgs( + "cat", "ds", "filter_func", "TABLE_FUNCTION", "desc", Arrays.asList(arg1, arg2)); + when(tableFunc.getReturnTableType()).thenReturn(returnTable); + + dbMetadata.processFunctionParametersAndReturnValue( + tableFunc, columnNamePattern, collectedResults, resultFields); + + assertEquals(2, collectedResults.size()); // Should match id_arg and id_return + assertEquals("id_return", collectedResults.get(0).get("COLUMN_NAME").getStringValue()); + assertEquals("id_arg", collectedResults.get(1).get("COLUMN_NAME").getStringValue()); + } + + @Test + public void testDefineGetClientInfoPropertiesSchema() { + Schema schema = dbMetadata.defineGetClientInfoPropertiesSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Schema should have 4 fields", 4, fields.size()); + + Field nameField = fields.get("NAME"); + assertNotNull(nameField); + assertEquals("NAME", nameField.getName()); + assertEquals(StandardSQLTypeName.STRING, nameField.getType().getStandardType()); + assertEquals(Field.Mode.REQUIRED, nameField.getMode()); + + Field maxLenField = fields.get("MAX_LEN"); + assertNotNull(maxLenField); + assertEquals("MAX_LEN", maxLenField.getName()); + assertEquals(StandardSQLTypeName.INT64, maxLenField.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, maxLenField.getMode()); + + Field defaultValueField = fields.get("DEFAULT_VALUE"); + assertNotNull(defaultValueField); + assertEquals("DEFAULT_VALUE", defaultValueField.getName()); + assertEquals(StandardSQLTypeName.STRING, defaultValueField.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, defaultValueField.getMode()); + + Field descriptionField = fields.get("DESCRIPTION"); + assertNotNull(descriptionField); + assertEquals("DESCRIPTION", descriptionField.getName()); + assertEquals(StandardSQLTypeName.STRING, descriptionField.getType().getStandardType()); + assertEquals(Field.Mode.NULLABLE, descriptionField.getMode()); + } + + @Test + public void testGetClientInfoProperties() throws SQLException { + try (ResultSet rs = dbMetadata.getClientInfoProperties()) { + assertNotNull("ResultSet from getClientInfoProperties() should not be null", rs); + + ResultSetMetaData rsmd = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", rsmd); + assertEquals("Should have 4 columns", 4, rsmd.getColumnCount()); + assertEquals("NAME", rsmd.getColumnName(1)); + assertEquals(Types.NVARCHAR, rsmd.getColumnType(1)); + assertEquals("MAX_LEN", rsmd.getColumnName(2)); + assertEquals(Types.BIGINT, rsmd.getColumnType(2)); + assertEquals("DEFAULT_VALUE", rsmd.getColumnName(3)); + assertEquals(Types.NVARCHAR, rsmd.getColumnType(3)); + assertEquals("DESCRIPTION", rsmd.getColumnName(4)); + assertEquals(Types.NVARCHAR, rsmd.getColumnType(4)); + + List> actualRows = new ArrayList<>(); + while (rs.next()) { + Map row = new HashMap<>(); + row.put("NAME", rs.getString("NAME")); + row.put("MAX_LEN", rs.getLong("MAX_LEN")); + row.put("DEFAULT_VALUE", rs.getObject("DEFAULT_VALUE")); + row.put("DESCRIPTION", rs.getString("DESCRIPTION")); + actualRows.add(row); + } + + assertEquals("Should return 3 client info properties", 3, actualRows.size()); + + Map appNameRow = actualRows.get(0); + assertEquals("ApplicationName", appNameRow.get("NAME")); + assertEquals(25L, appNameRow.get("MAX_LEN")); + assertNull(appNameRow.get("DEFAULT_VALUE")); + assertEquals( + "The name of the application currently utilizing the connection.", + appNameRow.get("DESCRIPTION")); + + Map clientHostnameRow = actualRows.get(1); + assertEquals("ClientHostname", clientHostnameRow.get("NAME")); + + Map clientUserRow = actualRows.get(2); + assertEquals("ClientUser", clientUserRow.get("NAME")); + } + } + + @Test + public void testDefineGetCatalogsSchema() { + Schema schema = dbMetadata.defineGetCatalogsSchema(); + assertNotNull("Schema should not be null", schema); + FieldList fields = schema.getFields(); + assertEquals("Should have one column", 1, fields.size()); + + Field tableCatField = fields.get("TABLE_CAT"); + assertNotNull("TABLE_CAT field should exist", tableCatField); + assertEquals("Field name should be TABLE_CAT", "TABLE_CAT", tableCatField.getName()); + assertEquals( + "Field type should be STRING", + StandardSQLTypeName.STRING, + tableCatField.getType().getStandardType()); + assertEquals("Field mode should be REQUIRED", Field.Mode.REQUIRED, tableCatField.getMode()); + } + + @Test + public void testPrepareGetCatalogsRows() { + Schema catalogsSchema = dbMetadata.defineGetCatalogsSchema(); + FieldList schemaFields = catalogsSchema.getFields(); + + // Test with a valid catalog name + List testCatalogName = new ArrayList<>(); + testCatalogName.add("test_catalog"); + + List rowsWithCatalog = + dbMetadata.prepareGetCatalogsRows(schemaFields, testCatalogName); + + assertNotNull("Rows list should not be null when catalog name is provided", rowsWithCatalog); + assertEquals("Should have one row when a catalog name is provided", 1, rowsWithCatalog.size()); + FieldValueList row = rowsWithCatalog.get(0); + assertEquals("Row should have 1 field value", 1, row.size()); + assertFalse("FieldValue in row should not be SQL NULL", row.get(0).isNull()); + assertEquals( + "TABLE_CAT should match the provided catalog name", + testCatalogName.get(0), + row.get(0).getStringValue()); + + // Test with empty catalog name list + List testEmptyCatalogList = new ArrayList<>(); + List rowsWithNullCatalog = + dbMetadata.prepareGetCatalogsRows(schemaFields, testEmptyCatalogList); + assertNotNull("Rows list should not be null when catalog name is null", rowsWithNullCatalog); + assertTrue("Should have zero rows when catalog name is null", rowsWithNullCatalog.isEmpty()); + } + + @Test + public void testGetSchemas_NoArgs_DelegatesCorrectly() { + BigQueryDatabaseMetaData spiedDbMetadata = spy(dbMetadata); + ResultSet mockResultSet = mock(ResultSet.class); + doReturn(mockResultSet).when(spiedDbMetadata).getSchemas(null, null); + + ResultSet rs = spiedDbMetadata.getSchemas(); + + assertSame( + "The returned ResultSet should be the one from the two-argument method", mockResultSet, rs); + verify(spiedDbMetadata, times(1)).getSchemas(null, null); + } + + // Non-Resultset DatabaseMetadata tests + + @Test + public void testIdentifierQuoteString() { + String actual = dbMetadata.getIdentifierQuoteString(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_QUOTED_IDENTIFIER, actual); + } + + @Test + public void testSQLKeyWords() { + String actual = dbMetadata.getSQLKeywords(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_RESERVED_KEYWORDS, actual); + } + + @Test + public void testNumericFunctions() { + String actual = dbMetadata.getNumericFunctions(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_NUMERIC_FNS, actual); + } + + @Test + public void testStringFunctions() { + String actual = dbMetadata.getStringFunctions(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_STRING_FNS, actual); + } + + @Test + public void testTimeAndDateFunctions() { + String actual = dbMetadata.getTimeDateFunctions(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_TIME_DATE_FNS, actual); + } + + @Test + public void testSystemFunctions() { + String actual = dbMetadata.getSystemFunctions(); + assertNull(actual); + } + + @Test + public void testSearchStringEscape() { + String actual = dbMetadata.getSearchStringEscape(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_ESCAPE, actual); + } + + @Test + public void testExtraNameChars() { + String actual = dbMetadata.getExtraNameCharacters(); + assertNull(actual); + } + + @Test + public void testCatalogSeparator() { + String actual = dbMetadata.getCatalogSeparator(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_CATALOG_SEPARATOR, actual); + } + + @Test + public void testMaxCharLiteralLength() { + int actual = dbMetadata.getMaxCharLiteralLength(); + assertEquals(0, actual); + } + + @Test + public void testMaxBinaryLiteralLength() { + int actual = dbMetadata.getMaxBinaryLiteralLength(); + assertEquals(0, actual); + } + + @Test + public void testMaxColumnNameLength() { + int actual = dbMetadata.getMaxColumnNameLength(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_MAX_COL_NAME_LEN, actual); + } + + @Test + public void testMaxColumnsInTable() { + int actual = dbMetadata.getMaxColumnsInTable(); + assertEquals(BigQueryDatabaseMetaData.GOOGLE_SQL_MAX_COLS_PER_TABLE, actual); + } + + @Test + public void testMaxColumnsInSelect() { + int actual = dbMetadata.getMaxColumnsInSelect(); + assertEquals(0, actual); + } + + @Test + public void testMaxColumnsInGroupBy() { + int actual = dbMetadata.getMaxColumnsInGroupBy(); + assertEquals(0, actual); + } + + @Test + public void testMaxColumnsInOrderBy() { + int actual = dbMetadata.getMaxColumnsInOrderBy(); + assertEquals(0, actual); + } + + @Test + public void testMaxColumnsInIndex() { + int actual = dbMetadata.getMaxColumnsInIndex(); + assertEquals(0, actual); + } + + @Test + public void testSupportsResultSetHoldabilitySupported() { + assertTrue(dbMetadata.supportsResultSetHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT)); + } + + @Test + public void testSupportsResultSetHoldabilityNotSupported() { + assertFalse(dbMetadata.supportsResultSetHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT)); + } + + @Test + public void testSupportsResultSetHoldabilityInvalid() { + assertFalse(dbMetadata.supportsResultSetHoldability(-1)); + } + + @Test + public void testResultSetHoldability() { + int actual = dbMetadata.getResultSetHoldability(); + assertEquals(ResultSet.CLOSE_CURSORS_AT_COMMIT, actual); + } + + @Test + public void testDatabaseMajorVersion() { + int actual = dbMetadata.getDatabaseMajorVersion(); + assertEquals(2, actual); + } + + @Test + public void testDatabaseMinorVersion() { + int actual = dbMetadata.getDatabaseMinorVersion(); + assertEquals(0, actual); + } + + @Test + public void testAllProceduresAreCallable() throws SQLException { + assertFalse(dbMetadata.allProceduresAreCallable()); + } + + @Test + public void testAllTablesAreSelectable() throws SQLException { + assertTrue(dbMetadata.allTablesAreSelectable()); + } + + @Test + public void testGetDriverVersionInfoFromProperties() { + Properties props = new Properties(); + String expectedVersionString = "0.0.0"; + int expectedMajor = 0; + int expectedMinor = 0; + + try (InputStream input = + getClass().getResourceAsStream("/com/google/cloud/bigquery/jdbc/dependencies.properties")) { + if (input != null) { + props.load(input); + expectedVersionString = props.getProperty("version.jdbc"); + if (expectedVersionString != null) { + String[] parts = expectedVersionString.split("\\."); + expectedMajor = Integer.parseInt(parts[0]); + expectedMinor = Integer.parseInt(parts[1].replaceAll("[^0-9].*", "")); + } + } + } catch (IOException | NumberFormatException e) { + fail( + "Error reading or parsing dependencies.properties for testing driver version: " + + e.getMessage()); + } + assertEquals(expectedVersionString, dbMetadata.getDriverVersion()); + assertEquals(expectedMajor, dbMetadata.getDriverMajorVersion()); + assertEquals(expectedMinor, dbMetadata.getDriverMinorVersion()); + } + + @Test + public void testSupportsUnion() throws SQLException { + assertTrue(dbMetadata.supportsUnion()); + } + + @Test + public void testSupportsUnionAll() throws SQLException { + assertTrue(dbMetadata.supportsUnionAll()); + } + + @Test + public void testGetMaxConnections() throws SQLException { + assertEquals(0, dbMetadata.getMaxConnections()); + } + + @Test + public void testGetMaxCursorNameLength() throws SQLException { + assertEquals(0, dbMetadata.getMaxCursorNameLength()); + } + + @Test + public void testGetMaxIndexLength() throws SQLException { + assertEquals(0, dbMetadata.getMaxIndexLength()); + } + + @Test + public void testGetMaxSchemaNameLength() throws SQLException { + assertEquals(1024, dbMetadata.getMaxSchemaNameLength()); + } + + @Test + public void testGetMaxProcedureNameLength() throws SQLException { + assertEquals(256, dbMetadata.getMaxProcedureNameLength()); + } + + @Test + public void testGetMaxCatalogNameLength() throws SQLException { + assertEquals(30, dbMetadata.getMaxCatalogNameLength()); + } + + @Test + public void testGetMaxRowSize() throws SQLException { + assertEquals(0, dbMetadata.getMaxRowSize()); + } + + @Test + public void testDoesMaxRowSizeIncludeBlobs() { + assertFalse(dbMetadata.doesMaxRowSizeIncludeBlobs()); + } + + @Test + public void testGetMaxStatementLength() throws SQLException { + assertEquals(0, dbMetadata.getMaxStatementLength()); + } + + @Test + public void testGetMaxStatements() throws SQLException { + assertEquals(0, dbMetadata.getMaxStatements()); + } + + @Test + public void testGetMaxTableNameLength() throws SQLException { + assertEquals(1024, dbMetadata.getMaxTableNameLength()); + } + + @Test + public void testGetMaxTablesInSelect() throws SQLException { + assertEquals(1000, dbMetadata.getMaxTablesInSelect()); + } + + @Test + public void testGetDefaultTransactionIsolation() throws SQLException { + assertEquals(8, dbMetadata.getDefaultTransactionIsolation()); + } + + @Test + public void testSupportsResultSetType() throws SQLException { + assertTrue(dbMetadata.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY)); + assertFalse(dbMetadata.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)); + assertFalse(dbMetadata.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE)); + } + + @Test + public void testSupportsResultSetConcurrency() throws SQLException { + assertTrue( + dbMetadata.supportsResultSetConcurrency( + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)); + assertFalse( + dbMetadata.supportsResultSetConcurrency( + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)); + assertFalse( + dbMetadata.supportsResultSetConcurrency( + ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)); + assertFalse( + dbMetadata.supportsResultSetConcurrency( + ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE)); + } + + @Test + public void testGetSQLStateType() throws SQLException { + assertEquals(DatabaseMetaData.sqlStateSQL, dbMetadata.getSQLStateType()); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercionsTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercionsTest.java new file mode 100644 index 0000000000..d9cc0efb77 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDefaultCoercionsTest.java @@ -0,0 +1,221 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.BigQueryTypeCoercer.INSTANCE; +import static com.google.common.truth.Truth.assertThat; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Collection; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class BigQueryDefaultCoercionsTest { + + private final BigQueryTypeCoercer bigQueryTypeCoercer; + + public BigQueryDefaultCoercionsTest(String label, BigQueryTypeCoercer bigQueryTypeCoercer) { + this.bigQueryTypeCoercer = bigQueryTypeCoercer; + } + + @Parameters(name = "{index}: {0}") + public static Collection data() { + return Arrays.asList( + new Object[][] { + {"default BigQueryTypeCoercer", INSTANCE}, + {"customizable BigQueryTypeCoercer", BigQueryTypeCoercer.builder().build()} + }); + } + + @Test + public void stringToBoolean() { + assertThat(bigQueryTypeCoercer.coerceTo(Boolean.class, "true")).isTrue(); + assertThat(bigQueryTypeCoercer.coerceTo(Boolean.class, "false")).isFalse(); + } + + @Test + public void stringToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, "3452148")).isEqualTo(3452148); + } + + @Test + public void stringToBigInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(BigInteger.class, "2147483647456")) + .isEqualTo(new BigInteger("2147483647456")); + } + + @Test + public void stringToLong() { + assertThat(bigQueryTypeCoercer.coerceTo(Long.class, "2147483647456")) + .isEqualTo(Long.valueOf("2147483647456")); + } + + @Test + public void stringToDouble() { + assertThat(bigQueryTypeCoercer.coerceTo(Double.class, "2147483647456.56684593495")) + .isEqualTo(Double.valueOf("2147483647456.56684593495")); + } + + @Test + public void stringToBigDecimal() { + assertThat(bigQueryTypeCoercer.coerceTo(BigDecimal.class, "2147483647456.56684593495")) + .isEqualTo(new BigDecimal("2147483647456.56684593495")); + } + + @Test + public void booleanToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, true)).isEqualTo("true"); + assertThat(bigQueryTypeCoercer.coerceTo(String.class, false)).isEqualTo("false"); + } + + @Test + public void booleanToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, true)).isEqualTo(1); + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, false)).isEqualTo(0); + } + + @Test + public void longToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, 2147483647L)).isEqualTo(2147483647); + } + + @Test + public void longToShort() { + assertThat(bigQueryTypeCoercer.coerceTo(Short.class, 32000L)).isEqualTo((short) 32000); + } + + @Test + public void longToByte() { + assertThat(bigQueryTypeCoercer.coerceTo(Byte.class, 127L)).isEqualTo((byte) 127); + } + + @Test + public void longToDouble() { + assertThat(bigQueryTypeCoercer.coerceTo(Double.class, 2147483647456L)) + .isEqualTo(Double.valueOf("2147483647456")); + } + + @Test + public void longToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, 2147483647456L)) + .isEqualTo("2147483647456"); + } + + @Test + public void doubleToFloat() { + assertThat(bigQueryTypeCoercer.coerceTo(Float.class, Double.valueOf("4567.213245"))) + .isEqualTo(Float.valueOf("4567.213245")); + } + + @Test + public void doubleToLong() { + assertThat(bigQueryTypeCoercer.coerceTo(Long.class, Double.valueOf("2147483647456.213245"))) + .isEqualTo(2147483647456L); + } + + @Test + public void doubleToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, Double.valueOf("21474836.213245"))) + .isEqualTo(21474836); + } + + @Test + public void doubleToBigDecimal() { + assertThat(bigQueryTypeCoercer.coerceTo(BigDecimal.class, Double.valueOf("21474836.213245"))) + .isEqualTo(new BigDecimal("21474836.213245")); + } + + @Test + public void doubleToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, Double.valueOf("21474836.213245"))) + .isEqualTo("2.1474836213245E7"); + } + + @Test + public void floatToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, 62356.45f)).isEqualTo(62356); + } + + @Test + public void floatToDouble() { + assertThat(bigQueryTypeCoercer.coerceTo(Double.class, 62356.45f)) + .isEqualTo(Double.valueOf(62356.45f)); + } + + @Test + public void floatToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, 62356.45f)).isEqualTo("62356.45"); + } + + @Test + public void bigIntegerToLong() { + assertThat(bigQueryTypeCoercer.coerceTo(Long.class, new BigInteger("2147483647"))) + .isEqualTo(2147483647L); + } + + @Test + public void bigIntegerToBigDecimal() { + assertThat(bigQueryTypeCoercer.coerceTo(BigDecimal.class, new BigInteger("2147483647"))) + .isEqualTo(new BigDecimal("2147483647")); + } + + @Test + public void bigIntegerToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, new BigInteger("2147483647"))) + .isEqualTo("2147483647"); + } + + @Test + public void bigDecimalToDouble() { + assertThat(bigQueryTypeCoercer.coerceTo(Double.class, new BigDecimal("2147483647.74356"))) + .isEqualTo(2147483647.74356); + } + + @Test + public void bigDecimalToBigInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(BigInteger.class, new BigDecimal("2147483647.74356"))) + .isEqualTo(new BigInteger("2147483647")); + } + + @Test + public void bigDecimalToInteger() { + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, new BigDecimal("2147483647.74356"))) + .isEqualTo(2147483647); + } + + @Test + public void bigDecimalToLong() { + assertThat(bigQueryTypeCoercer.coerceTo(Long.class, new BigDecimal("2147483647.74356"))) + .isEqualTo(2147483647L); + } + + @Test + public void bigDecimalToString() { + assertThat(bigQueryTypeCoercer.coerceTo(String.class, new BigDecimal("2147483647.74356"))) + .isEqualTo("2147483647.74356"); + } + + @Test + public void nullToBoolean() { + assertThat(bigQueryTypeCoercer.coerceTo(Boolean.class, null)).isFalse(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java new file mode 100644 index 0000000000..125de54dfa --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java @@ -0,0 +1,97 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import java.sql.Connection; +import java.sql.DriverPropertyInfo; +import java.sql.SQLException; +import java.util.Properties; +import java.util.logging.Logger; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryDriverTest { + + static BigQueryDriver bigQueryDriver; + + @Before + public void setUp() { + bigQueryDriver = BigQueryDriver.getRegisteredDriver(); + } + + @Test + public void testInvalidURLDoesNotConnect() { + assertThrows(IllegalArgumentException.class, () -> bigQueryDriver.connect("badURL.com", null)); + } + + @Test + public void testValidURLDoesConnect() throws SQLException { + Connection connection = + bigQueryDriver.connect( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;", + new Properties()); + assertThat(connection.isClosed()).isFalse(); + } + + @Test + public void testInvalidURLInAcceptsURLReturnsFalse() throws SQLException { + assertThat(bigQueryDriver.acceptsURL("badURL.com")).isFalse(); + } + + @Test + public void testValidURLInAcceptsURLReturnsTrue() throws SQLException { + assertThat(bigQueryDriver.acceptsURL("jdbc:bigquery:https://google.com:8080;projectId=123456")) + .isTrue(); + } + + @Test + public void testGetPropertyInfoReturnsValidProperties() { + DriverPropertyInfo[] res = + bigQueryDriver.getPropertyInfo( + "jdbc:bigquery:https://google.com:8080;projectId=123456;OAuthType=3", new Properties()); + int i = 0; + for (BigQueryConnectionProperty prop : BigQueryJdbcUrlUtility.VALID_PROPERTIES) { + assertThat(res[i].name).isEqualTo(prop.getName()); + i++; + } + } + + @Test + public void testGetMajorVersionMatchesDriverMajorVersion() { + assertThat(bigQueryDriver.getMajorVersion()).isEqualTo(0); + } + + @Test + public void testGetMinorVersionMatchesDriverMinorVersion() { + assertThat(bigQueryDriver.getMinorVersion()).isEqualTo(1); + } + + @Test + public void testGetParentLoggerReturnsLogger() { + assertThat(bigQueryDriver.getParentLogger()).isInstanceOf(Logger.class); + } + + @Test + public void testJDBCCompliantReturnsFalse() { + assertThat(bigQueryDriver.jdbcCompliant()).isFalse(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java new file mode 100644 index 0000000000..616f3bab97 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java @@ -0,0 +1,82 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import com.google.cloud.bigquery.jdbc.utils.URIBuilder; + +public class BigQueryJdbcBaseTest { + + // This is a fake pkcs8 key generated specifically for unittests + protected static final String fake_pkcs8_key = + "-----BEGIN PRIVATE KEY-----\n" + + // + "MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAnt6w5AMZBvOecsJ9\n" + + // + "4TeVz+GpAtBnTqkxWfxLJykkvb+V/3IhXr5Zw40y47RdoRly/QDFJz3Ac+nmwCSP\n" + + // + "8QW3GQIDAQABAkBPmdrd1COFFSnN7F9wKg65QyMQ0uUAR8v/f2cUbwwGuhwdMuGZ\n" + + // + "DPwgVZySxFKort7TfPru6NzbACL3EFAl9y9RAiEA7XPq5Tu+LOw4/CZFABykguBV\n" + + // + "8rYC+F72+GqkhvlGhZUCIQCrR2/zGIKqJSTKfQhKOteP7cx5dWrumHYNuC5InOGC\n" + + // + "dQIgM6bzgcntJHh+LNtmRw/z+UQzbgiJvN1re7426+VtocECIE7ejFxicviqNfDP\n" + + // + "9ltIES8Dj152hRDtP589qoJhSy5pAiAJot/kBQD8yFYMU1X02oi+6f8QqXxcHwZX\n" + + // + "2wK1Zawz/A==\n" + + // + "-----END PRIVATE KEY-----"; + + protected static URIBuilder getBaseUri() { + return new URIBuilder("jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"); + } + + protected static URIBuilder getBaseUri(int authType) { + return getBaseUri().append("OAuthType", authType); + } + + protected static URIBuilder getBaseUri(int authType, String projectId) { + return getBaseUri(authType).append("PROJECT_ID", projectId); + } + + protected static URIBuilder getUriOAuthServiceAccount() { + return getBaseUri() + .append("OAuthType", 0) + .append("OAuthServiceAcctEmail", "service@account") + .append("OAuthPvtKey", fake_pkcs8_key); + } + + protected static URIBuilder getUriOAuthUserAccount() { + return getBaseUri() + .append("OAuthType", 1) + .append("OAuthClientId", "client@id") + .append("OAuthClientSecret", "client_secret"); + } + + protected static URIBuilder getUriOAuthToken() { + return getBaseUri().append("OAuthType", 2).append("OAuthAccessToken", "RedactedToken"); + } + + protected static URIBuilder getUriOAuthApplicationDefault() { + return getBaseUri().append("OAuthType", 3); + } + + protected static URIBuilder getUriOAuthExternal() { + return getBaseUri().append("OAuthType", 4).append("OAuthPvtKey", fake_pkcs8_key); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java new file mode 100644 index 0000000000..b7fc031621 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java @@ -0,0 +1,505 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ImpersonatedCredentials; +import com.google.auth.oauth2.UserAuthorizer; +import com.google.auth.oauth2.UserCredentials; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Paths; +import java.security.PrivateKey; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +public class BigQueryJdbcOAuthUtilityTest extends BigQueryJdbcBaseTest { + + private static final int USER_AUTH_PORT = 53737; + private static final String EXPECTED_USER_AUTH_URL = + "https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=client_id&redirect_uri=http://localhost:" + + USER_AUTH_PORT + + "&scope=https://www.googleapis.com/auth/bigquery&state=test_state&access_type=offline&prompt=consent&login_hint=test_user&include_granted_scopes=true"; + + @Test + public void testParseOAuthPropsForAuthType0KeyfileOnly() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=0;" + + "OAuthPvtKeyPath=C:\\SecureFiles\\ServiceKeyFile.p12;", + null); + + assertThat(result.get("OAuthType")).isEqualTo("GOOGLE_SERVICE_ACCOUNT"); + assertThat(result.get("OAuthPvtKeyPath")).isEqualTo("C:\\SecureFiles\\ServiceKeyFile.p12"); + } + + @Test + public void testParseOAuthPropsForAuthType0ViaEmail() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=0;" + + "OAuthServiceAcctEmail=dummytest@dummytest.iam.gserviceaccount.com;" + + "OAuthPvtKey=RedactedKey;", + null); + + assertThat(result.get("OAuthType")).isEqualTo("GOOGLE_SERVICE_ACCOUNT"); + assertThat(result.get("OAuthServiceAcctEmail")) + .isEqualTo("dummytest@dummytest.iam.gserviceaccount.com"); + assertThat(result.get("OAuthPvtKey")).isEqualTo("RedactedKey"); + } + + @Test + public void testInvalidTokenUriForAuthType0() { + String connectionString = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=0;" + + "OAuthServiceAcctEmail=dummytest@dummytest.iam.gserviceaccount.com;" + + "OAuthPvtKey=" + + fake_pkcs8_key + + ";" + + "EndpointOverrides=OAuth2=brokenuri{};"; + Map oauthProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + Map overrideProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + + try { + BigQueryJdbcOAuthUtility.getCredentials(oauthProperties, overrideProperties, null); + Assert.fail(); + } catch (BigQueryJdbcRuntimeException e) { + assertThat(e.getMessage()).contains("java.net.URISyntaxException"); + } + } + + @Test + public void testParseOAuthPropsForAuthType2() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;", + null); + + assertThat(result.get("OAuthType")).isEqualTo("PRE_GENERATED_TOKEN"); + assertThat(result.get("OAuthAccessToken")).isEqualTo("RedactedToken"); + } + + @Test + public void testParseOAuthPropsForAuthType3() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=MyBigQueryProject;", + null); + + assertThat(result.get("OAuthType")).isEqualTo("APPLICATION_DEFAULT_CREDENTIALS"); + } + + @Test + public void testParseOAuthPropsForDefaultAuthType() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3", + null); + + assertThat(result.get("OAuthType")).isEqualTo("APPLICATION_DEFAULT_CREDENTIALS"); + } + + @Test + public void testGetCredentialsForPreGeneratedToken() { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;", + null); + + GoogleCredentials credentials = + BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, null); + assertThat(credentials).isNotNull(); + } + + @Test + public void testGetCredentialsForPreGeneratedTokenTPC() throws IOException { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;" + + "universeDomain=testDomain;", + null); + Map stringStringMap = new HashMap<>(); + stringStringMap.put( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, "testDomain"); + Map overrideProperties = new HashMap<>(stringStringMap); + + GoogleCredentials credentials = + BigQueryJdbcOAuthUtility.getCredentials(authProperties, overrideProperties, null); + assertThat(credentials.getUniverseDomain()).isEqualTo("testDomain"); + } + + @Test + @Ignore // For running locally only similar to our other JDBC tests. + public void testGetCredentialsForApplicationDefault() { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=MyBigQueryProject;", + null); + + GoogleCredentials credentials = + BigQueryJdbcOAuthUtility.getCredentials(authProperties, null, null); + assertThat(credentials).isNotNull(); + } + + @Test + public void testParseOAuthPropsForUserAuth() { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=1;ProjectId=MyBigQueryProject;" + + "OAuthClientId=client;OAuthClientSecret=secret;", + null); + + assertThat(authProperties.get("OAuthType")).isEqualTo("GOOGLE_USER_ACCOUNT"); + assertThat(authProperties.get("OAuthClientId")).isEqualTo("client"); + assertThat(authProperties.get("OAuthClientSecret")).isEqualTo("secret"); + } + + @Test + public void testGenerateUserAuthURL() { + try { + HashMap authProperties = new HashMap<>(); + authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "client_id"); + authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "client_secret"); + + UserAuthorizer userAuthorizer = + BigQueryJdbcOAuthUtility.getUserAuthorizer( + authProperties, new HashMap(), USER_AUTH_PORT, null); + + String userId = "test_user"; + String state = "test_state"; + URI baseURI = URI.create("http://example.com/foo"); + + URL authURL = userAuthorizer.getAuthorizationUrl(userId, state, baseURI); + + assertThat(authURL.toString()).isEqualTo(EXPECTED_USER_AUTH_URL); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + @Test + public void testGenerateUserAuthURLOverrideOauthEndpoint() { + try { + + URI overrideTokenSeverURI = new URI("https://oauth2-gsprivateall.p.googleapis.com/token"); + String connectionString = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=1;" + + "OAuthClientId=client;OAuthClientSecret=secret;" + + "EndpointOverrides=OAuth2=" + + overrideTokenSeverURI + + ";"; + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + Map overrideProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + + UserAuthorizer userAuthorizer = + BigQueryJdbcOAuthUtility.getUserAuthorizer( + authProperties, overrideProperties, USER_AUTH_PORT, null); + + assertThat(overrideTokenSeverURI).isEqualTo(userAuthorizer.toBuilder().getTokenServerUri()); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + @Test + public void testParseOAuthPropsForRefreshToken() { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;OAuthRefreshToken=token;" + + "OAuthClientId=client;OAuthClientSecret=secret;", + null); + + assertThat(authProperties.get("OAuthType")).isEqualTo("PRE_GENERATED_TOKEN"); + assertThat(authProperties.get("OAuthRefreshToken")).isEqualTo("token"); + assertThat(authProperties.get("OAuthClientId")).isEqualTo("client"); + assertThat(authProperties.get("OAuthClientSecret")).isEqualTo("secret"); + } + + @Test + public void testParseOverridePropsForRefreshTokenAuth() { + try { + + String connectionString = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=2;OAuthRefreshToken=token;" + + "OAuthClientId=client;OAuthClientSecret=secret;" + + "EndpointOverrides=Oauth2=https://oauth2-private.p.googleapis.com/token;"; + + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + Map overrideProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + + UserCredentials userCredentials = + BigQueryJdbcOAuthUtility.getPreGeneratedRefreshTokenCredentials( + authProperties, overrideProperties, null); + + assertThat(userCredentials.toBuilder().getTokenServerUri()) + .isEqualTo(URI.create("https://oauth2-private.p.googleapis.com/token")); + + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + @Test + public void testParseBYOIDProps() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:433;OAuthType=4;" + + "ProjectId=MyBigQueryProject;" + + "BYOID_AudienceUri=//iam.googleapis.com/locations/global/workforcePools/pool-id/providers/provider-id;" + + "BYOID_PoolUserProject=workforceProjectNumber;" + + "BYOID_CredentialSource={\"file\": \"C:\\\\Token.txt\"};" + + "BYOID_SA_Impersonation_Uri=testSA;" + + "BYOID_SubjectTokenType=urn:ietf:params:oauth:tokentype:jwt;" + + "BYOID_TokenUri=https://testuri.com/v1/token", + null); + + assertThat(result.get("BYOID_AudienceUri")) + .isEqualTo( + "//iam.googleapis.com/locations/global/workforcePools/pool-id/providers/provider-id"); + assertThat(result.get("BYOID_PoolUserProject")).isEqualTo("workforceProjectNumber"); + assertThat(result.get("BYOID_CredentialSource")).isEqualTo("{\"file\": \"C:\\\\Token.txt\"}"); + assertThat(result.get("BYOID_SA_Impersonation_Uri")).isEqualTo("testSA"); + assertThat(result.get("BYOID_SubjectTokenType")) + .isEqualTo("urn:ietf:params:oauth:tokentype:jwt"); + assertThat(result.get("BYOID_TokenUri")).isEqualTo("https://testuri.com/v1/token"); + } + + @Test + public void testParseOAuthProperties_UserAccount_RequestDriveScopeEnabled() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" + + "RequestGoogleDriveScope=1;"; + Map properties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + assertEquals( + String.valueOf(BigQueryJdbcOAuthUtility.AuthType.GOOGLE_USER_ACCOUNT), + properties.get(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME)); + assertEquals( + "redactedClientId", properties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); + assertEquals( + "redactedClientSecret", + properties.get(BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + assertEquals( + "1", properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); + } + + @Test + public void testParseOAuthProperties_UserAccount_RequestDriveScopeDisabled() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" + + "RequestGoogleDriveScope=0;"; + Map properties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + assertEquals( + "0", properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); + } + + @Test + public void testParseOAuthProperties_UserAccount_RequestDriveScopeDefault() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;"; + Map properties = + BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + assertEquals( + String.valueOf(BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE), + properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); + } + + @Test + public void testGetUserAuthorizer_WithDriveScope() throws URISyntaxException { + Map authProperties = new HashMap<>(); + authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); + authProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); + authProperties.put(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "1"); + + UserAuthorizer authorizer = + BigQueryJdbcOAuthUtility.getUserAuthorizer( + authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); + + assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/bigquery")); + assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); + assertEquals(2, authorizer.getScopes().size()); + } + + @Test + public void testGetUserAuthorizer_WithoutDriveScope() throws URISyntaxException { + Map authProperties = new HashMap<>(); + authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); + authProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); + authProperties.put(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "0"); + + UserAuthorizer authorizer = + BigQueryJdbcOAuthUtility.getUserAuthorizer( + authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); + assertTrue(authorizer.getScopes().contains("https://www.googleapis.com/auth/bigquery")); + assertFalse(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); + assertEquals(1, authorizer.getScopes().size()); + } + + @Test + public void testGetUserAuthorizer_InvalidDriveScopeValue() throws URISyntaxException { + Map authProperties = new HashMap<>(); + authProperties.put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, "redactedClientId"); + authProperties.put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, "redactedClientSecret"); + authProperties.put( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, "invalid_value"); + UserAuthorizer authorizer = + BigQueryJdbcOAuthUtility.getUserAuthorizer( + authProperties, Collections.emptyMap(), 12345, this.getClass().getName()); + assertFalse(authorizer.getScopes().contains("https://www.googleapis.com/auth/drive.readonly")); + } + + @Test + public void testParseUserImpersonationDefault() { + String connectionUri = + getUriOAuthServiceAccount() + .append("ServiceAccountImpersonationEmail", "impersonated") + .toString(); + Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionUri, ""); + assertEquals( + "impersonated", + result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME)); + assertEquals( + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE, + result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME)); + assertEquals( + BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE, + result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME)); + } + + @Test + public void testParseUserImpersonationNonDefault() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + getUriOAuthServiceAccount() + .append("ServiceAccountImpersonationEmail", "impersonated") + .append("ServiceAccountImpersonationScopes", "scopes") + .append("ServiceAccountImpersonationTokenLifetime", 300) + .toString(), + ""); + assertEquals( + "impersonated", + result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME)); + assertEquals( + "scopes", result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME)); + assertEquals( + "300", + result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME)); + } + + @Test + public void testGetServiceAccountImpersonatedCredentials() { + Map authProperties = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + getUriOAuthServiceAccount() + .append("ServiceAccountImpersonationEmail", "impersonated") + .toString(), + ""); + GoogleCredentials credentials = + BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, null); + assertThat(credentials).isInstanceOf(ImpersonatedCredentials.class); + } + + @Test + public void testPrivateKeyFromPkcs8() { + PrivateKey pk = BigQueryJdbcOAuthUtility.privateKeyFromPkcs8(fake_pkcs8_key); + assertNotNull(pk); + } + + @Test + public void testPrivateKeyFromPkcs8_wrong() { + PrivateKey pk = BigQueryJdbcOAuthUtility.privateKeyFromPkcs8(""); + assertNull(pk); + } + + // Command to generate key: + // keytool -genkey -alias privatekey -keyalg RSA -keysize 2048 -storepass notasecret \ + // -keypass notasecret -storetype pkcs12 -keystore ./fake.p12 + @Test + public void testPrivateKeyFromP12File() { + URL resource = BigQueryJdbcOAuthUtilityTest.class.getResource("/fake.p12"); + try { + PrivateKey pk = + BigQueryJdbcOAuthUtility.privateKeyFromP12File( + Paths.get(resource.toURI()).toAbsolutePath().toString(), "notasecret"); + assertNotNull(pk); + } catch (Exception e) { + assertTrue(false); + } + } + + @Test + public void testPrivateKeyFromP12File_missing_file() { + PrivateKey pk = BigQueryJdbcOAuthUtility.privateKeyFromP12File("", ""); + assertNull(pk); + } + + @Test + public void testPrivateKeyFromP12File_wrong_password() { + URL resource = BigQueryJdbcOAuthUtilityTest.class.getResource("/fake.p12"); + try { + PrivateKey pk = + BigQueryJdbcOAuthUtility.privateKeyFromP12File( + Paths.get(resource.toURI()).toAbsolutePath().toString(), "fake"); + assertNull(pk); + } catch (Exception e) { + assertTrue(false); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameterTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameterTest.java new file mode 100644 index 0000000000..815759892b --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcParameterTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.BigQueryParameterHandler.BigQueryStatementParameterType; +import org.junit.Test; + +public class BigQueryJdbcParameterTest { + + @Test + public void testSettersAndGetters() { + int expectedIndex = 3; + Object expectedValue = "String Object"; + Class expectedType = String.class; + StandardSQLTypeName expectedSqlType = StandardSQLTypeName.STRING; + String expectedParamName = "StringParameter"; + BigQueryStatementParameterType expectedParamType = BigQueryStatementParameterType.IN; + int expectedScale = -1; + + BigQueryJdbcParameter parameter = new BigQueryJdbcParameter(); + parameter.setIndex(3); + parameter.setValue("String Object"); + parameter.setType(String.class); + parameter.setSqlType(StandardSQLTypeName.STRING); + parameter.setParamName("StringParameter"); + parameter.setParamType(BigQueryStatementParameterType.IN); + parameter.setScale(-1); + + assertEquals(expectedIndex, parameter.getIndex()); + assertEquals(expectedValue, parameter.getValue()); + assertEquals(expectedType, parameter.getType()); + assertEquals(expectedSqlType, parameter.getSqlType()); + assertEquals(expectedParamName, parameter.getParamName()); + assertEquals(expectedParamType, parameter.getParamType()); + assertEquals(expectedScale, parameter.getScale()); + } + + @Test + public void testCopyConstructor() { + int expectedIndex = 3; + Object expectedValue = "String Object"; + Class expectedType = String.class; + StandardSQLTypeName expectedSqlType = StandardSQLTypeName.STRING; + + BigQueryJdbcParameter parameter = new BigQueryJdbcParameter(); + parameter.setIndex(3); + parameter.setValue("String Object"); + parameter.setType(String.class); + parameter.setSqlType(StandardSQLTypeName.STRING); + + BigQueryJdbcParameter copiedParameter = new BigQueryJdbcParameter(parameter); + + assertEquals(expectedIndex, copiedParameter.getIndex()); + assertEquals(expectedValue, copiedParameter.getValue()); + assertEquals(expectedType, copiedParameter.getType()); + assertEquals(expectedSqlType, copiedParameter.getSqlType()); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java new file mode 100644 index 0000000000..203502cdac --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java @@ -0,0 +1,293 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; + +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.http.HttpTransportOptions; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.junit.Test; + +public class BigQueryJdbcProxyUtilityTest { + @Test + public void testParsingAllProxyProperties() { + Map result = + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=3128;" + + "ProxyUid=fahmz;" + + "ProxyPwd=pass;", + null); + + assertThat(result.get("ProxyHost")).isEqualTo("34.94.167.18"); + assertThat(result.get("ProxyPort")).isEqualTo("3128"); + assertThat(result.get("ProxyUid")).isEqualTo("fahmz"); + assertThat(result.get("ProxyPwd")).isEqualTo("pass"); + } + + @Test + public void testParsingInvalidPortThrowsIllegalArgument() { + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=portnumber;" + + "ProxyUid=fahmz;" + + "ProxyPwd=pass;", + null)); + } + + @Test + public void testMissingHostThrowsIllegalArgument() { + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyPort=3128;" + + "ProxyUid=fahmz;" + + "ProxyPwd=pass;", + null)); + } + + @Test + public void testMissingPortThrowsIllegalArgument() { + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyUid=fahmz;" + + "ProxyPwd=pass;", + null)); + } + + @Test + public void testMissingUidWithPwdThrowsIllegalArgument() { + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=3128;" + + "ProxyPwd=pass;", + null)); + } + + @Test + public void testMissingPwdWithUidThrowsIllegalArgument() { + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcProxyUtility.parseProxyProperties( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=3128;" + + "ProxyUid=fahmz;", + null)); + } + + @Test + public void testGetHttpTransportOptionsWithAuthenticatedProxy() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=TestProject" + + ";OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=3128;" + + "ProxyUid=fahmz;" + + "ProxyPwd=pass;"; + + Map proxyProperties = + BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); + HttpTransportOptions result = + BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + assertNotNull(result); + } + + @Test + public void testGetHttpTransportOptionsWithNonAuthenticatedProxy() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=TestProject" + + ";OAuthType=3;" + + "ProxyHost=34.94.167.18;" + + "ProxyPort=3128;"; + + Map proxyProperties = + BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); + HttpTransportOptions result = + BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + assertNotNull(result); + } + + @Test + public void testGetHttpTransportOptionsWithNoProxySettingsReturnsNull() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=TestProject" + + ";OAuthType=3;"; + + Map proxyProperties = + BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); + HttpTransportOptions result = + BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + assertNull(result); + } + + private String getTestResourcePath(String resourceName) throws URISyntaxException { + URL resourceUrl = getClass().getClassLoader().getResource(resourceName); + if (resourceUrl == null) { + throw new RuntimeException("Test resource not found: " + resourceName); + } + return new File(resourceUrl.toURI()).getAbsolutePath(); + } + + @Test + public void testGetHttpTransportOptions_withSslTrustStore_noPassword() throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_nopass.jks"); + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), trustStorePath, null, "TestClass"); + assertNotNull(options); + assertNotNull(options.getHttpTransportFactory()); + } + + @Test + public void testGetHttpTransportOptions_withSslTrustStore_withCorrectPassword() throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_withpass.jks"); + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), trustStorePath, "testpassword", "TestClass"); + assertNotNull(options); + assertNotNull(options.getHttpTransportFactory()); + } + + @Test + public void testGetHttpTransportOptions_withSslTrustStore_withIncorrectPassword() + throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_withpass.jks"); + BigQueryJdbcRuntimeException exception = + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), + trustStorePath, + "wrongpassword", + "TestClass")); + assertThat(exception.getCause()).isInstanceOf(IOException.class); + } + + @Test + public void testGetHttpTransportOptions_withInvalidSslTrustStorePath() { + String invalidPath = "/path/to/nonexistent/truststore.jks"; + BigQueryJdbcRuntimeException exception = + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), invalidPath, null, "TestClass")); + + assertThat(exception.getCause()).isInstanceOf(FileNotFoundException.class); + } + + @Test + public void testGetHttpTransportOptions_withSslAndProxy() throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_nopass.jks"); + Map proxyProperties = new HashMap<>(); + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, "proxy.example.com"); + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, "8080"); + + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + proxyProperties, trustStorePath, null, "TestClass"); + assertNotNull(options); + assertNotNull(options.getHttpTransportFactory()); + } + + @Test + public void testGetTransportChannelProvider_withSslTrustStore_noPassword() throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_nopass.jks"); + TransportChannelProvider provider = + BigQueryJdbcProxyUtility.getTransportChannelProvider( + Collections.emptyMap(), trustStorePath, null, "TestClass"); + assertNotNull(provider); + } + + @Test + public void testGetTransportChannelProvider_withSslTrustStore_withCorrectPassword() + throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_withpass.jks"); + TransportChannelProvider provider = + BigQueryJdbcProxyUtility.getTransportChannelProvider( + Collections.emptyMap(), trustStorePath, "testpassword", "TestClass"); + assertNotNull(provider); + } + + @Test + public void testGetTransportChannelProvider_withSslAndProxy() throws Exception { + String trustStorePath = getTestResourcePath("test_truststore_nopass.jks"); + Map proxyProperties = new HashMap<>(); + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, "proxy.example.com"); + proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, "8080"); + + TransportChannelProvider provider = + BigQueryJdbcProxyUtility.getTransportChannelProvider( + proxyProperties, trustStorePath, null, "TestClass"); + assertNotNull(provider); + } + + @Test + public void testGetTransportChannelProvider_noProxyNoSsl_returnsNull() { + TransportChannelProvider provider = + BigQueryJdbcProxyUtility.getTransportChannelProvider( + Collections.emptyMap(), null, null, "TestClass"); + assertNull(provider); + } + + @Test + public void testGetHttpTransportOptions_noProxyNoSsl_returnsNull() { + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), null, null, "TestClass"); + assertNull(options); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java new file mode 100644 index 0000000000..86f087bf35 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -0,0 +1,803 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.common.collect.Maps; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import org.junit.Test; + +public class BigQueryJdbcUrlUtilityTest { + + @Test + public void testParsePropertyWithNoDefault() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken"; + + String result = BigQueryJdbcUrlUtility.parseUriProperty(url, "OAuthType"); + assertThat(result).isNull(); + } + + @Test + public void testParsePropertyWithDefault() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken"; + + String result = BigQueryJdbcUrlUtility.parseUriProperty(url, "OAuthType"); + assertThat(result).isEqualTo(null); + } + + @Test + public void testParsePropertyWithValue() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken"; + + String result = BigQueryJdbcUrlUtility.parseUriProperty(url, "ProjectId"); + assertThat(result).isEqualTo("MyBigQueryProject"); + } + + @Test + public void testParsePropertyWithValueCaseInsensitive() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "PROJECTID=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken"; + + String result = BigQueryJdbcUrlUtility.parseUriProperty(url, "ProjectId"); + assertThat(result).isEqualTo("MyBigQueryProject"); + } + + @Test + public void testAppendPropertiesToURL() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken"; + Properties properties = new Properties(); + properties.setProperty("OAuthType", "3"); + + String updatedUrl = BigQueryJdbcUrlUtility.appendPropertiesToURL(url, null, properties); + assertThat(updatedUrl.contains("OAuthType=3")); + } + + @Test + public void testConnectionPropertiesFromURI() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;OAUTHTYPE=3;DEFAULTDATASET=testDataset;LOCATION=us-central1"; + + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "OAUTHTYPE")).isEqualTo("3"); + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "LOCATION")) + .isEqualTo("us-central1"); + } + + @Test + public void testConnectionPropertiesFromURIMultiline() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;Multiline=value1\nvalue2\n;"; + + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "Multiline")) + .isEqualTo("value1\nvalue2\n"); + } + + @Test + public void testConnectionPropertiesFromURIMultilineNoSemicolon() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;Multiline=value1\nvalue2"; + + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "Multiline")) + .isEqualTo("value1\nvalue2"); + } + + @Test + public void testOverridePropertiesFromURICompatibility() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;PrivateServiceConnectUris=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + } + + @Test + public void testOverridePropertiesDoesNotAffectOriginalParsersAtEnd() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," + + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;PROJECTID=testProject;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + assertThat(parsedPSCProperties.get("OAUTH2")) + .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); + } + + @Test + public void testOverridePropertiesDoesNotParseOutsideOfPrivateServiceConnectUris() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;" + // Hard to see but semicolon ends it here. + + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;PROJECTID=testProject;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + assertThat(parsedPSCProperties.get("OAUTH2")).isNull(); + } + + @Test + public void testOverridePropertiesDoesNotParserPropertiesInMiddle() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com,OAUTHTYPE=2," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," + + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + assertThat(parsedPSCProperties.get("OAUTH2")) + .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); + } + + @Test + public void testOverridePropertyBeforeProceedingOverrideParameterDoesNotParse() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com;" + + "PrivateServiceConnectUris=" + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," + + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertNull(parsedPSCProperties.get("BIGQUERY")); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + assertThat(parsedPSCProperties.get("OAUTH2")) + .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); + } + + @Test + public void testOverridePropertiesFromURIGoogleExperience() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;EndpointOverrides=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + } + + @Test + public void testAllOverridePropertiesFromURIGoogleExperience() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;EndpointOverrides=" + + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," + + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com," + + "STS=https://sts-myprivateserver.p.googleapis.com;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + assertThat(parsedPSCProperties.get("OAUTH2")) + .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("STS")) + .isEqualTo("https://sts-myprivateserver.p.googleapis.com"); + } + + @Test + public void testCaseSensitivityOverridePropertiesFromURI() { + String connection_uri = + "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;endpointOverrides=" + + "bigQuery=https://bigquery-myprivateserver.p.googleapis.com," + + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; + + Map parsedPSCProperties = + BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); + + assertThat(parsedPSCProperties.get("BIGQUERY")) + .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); + assertThat(parsedPSCProperties.get("READ_API")) + .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); + } + + @Test + public void testParseJobCreationModeDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; + + boolean jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); + assertTrue(jobCreationMode); + } + + @Test + public void testParseJobCreationMode() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobCreationMode=1"; + + boolean jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); + assertFalse(jobCreationMode); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobCreationMode=2"; + + jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); + assertTrue(jobCreationMode); + } + + @Test + public void testParseJobCreationModeInvalidInteger() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobCreationMode=25"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null)); + } + + @Test + public void testParseJobCreationModeInvalidString() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobCreationMode=JOB_CREATION_OPTIONAL"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null)); + } + + @Test + public void testGetConnectionPropertyDefaultValue() { + assertEquals( + BigQueryJdbcUrlUtility.getConnectionPropertyDefaultValue("BYOID_TokenUri"), + "https://sts.googleapis.com/v1/token"); + } + + @Test + public void testParseRetryTimeoutInSecs() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "Timeout=10"; + + long retryTimeoutInSeconds = + BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); + assertEquals(10, retryTimeoutInSeconds); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "Timeout=20"; + + retryTimeoutInSeconds = BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); + assertEquals(20, retryTimeoutInSeconds); + } + + @Test + public void testParseRetryTimeoutInSecsDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long retryTimeoutInSeconds = + BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); + assertEquals(0, retryTimeoutInSeconds); + } + + @Test + public void testParseRetryTimeoutSecondsInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "Timeout=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null)); + } + + public void testParseJobTimeout() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobTimeout=10"; + + long jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); + assertEquals(10, jobTimeout); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobTimeout=20"; + + jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); + assertEquals(20, jobTimeout); + } + + @Test + public void testParseJobTimeoutDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); + assertEquals(0L, jobTimeout); + } + + @Test + public void testParseJobTimeoutInvalid() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "JobTimeout=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null)); + } + + @Test + public void testParsePartnerTokenProperty() { + // Case with partner name and environment + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "PartnerToken=(GPN:partner_company; dev);ProjectId=MyBigQueryProject;"; + String expected = " (GPN:partner_company; dev)"; + String result = + BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertThat(result).isEqualTo(expected); + + // Case with only partner name + url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "PartnerToken=(GPN:another_partner);ProjectId=MyBigQueryProject;"; + expected = " (GPN:another_partner)"; + result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertThat(result).isEqualTo(expected); + + // Case when PartnerToken property is not present + url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;"; + result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertNull(result); + + // Case when PartnerToken property is present but empty + url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PartnerToken=();"; + result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertNull(result); + + // Case when PartnerToken property is present but without partner name + url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PartnerToken=(env);"; + result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertNull(result); + + // Case with extra spaces around the values + url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "PartnerToken= ( GPN: partner_name ; test_env ) ;"; + expected = " (GPN: partner_name; test_env)"; + result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + assertThat(result).isEqualTo(expected); + } + + public void testParseRetryInitialDelayInSecs() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryInitialDelay=10"; + + long retryInitialDelaySeconds = + BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); + assertEquals(10, retryInitialDelaySeconds); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryInitialDelay=20"; + + retryInitialDelaySeconds = + BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); + assertEquals(20, retryInitialDelaySeconds); + } + + @Test + public void testParseRetryInitialDelayInSecsDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long retryInitialDelaySeconds = + BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); + assertEquals(0, retryInitialDelaySeconds); + } + + @Test + public void testParseRetryInitialDelaySecondsInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryInitialDelay=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null)); + } + + @Test + public void testParseRetryMaxDelayInSecs() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryMaxDelay=10"; + + long retryMaxDelaySeconds = + BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); + assertEquals(10, retryMaxDelaySeconds); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryMaxDelay=20"; + + retryMaxDelaySeconds = BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); + assertEquals(20, retryMaxDelaySeconds); + } + + @Test + public void testParseRetryMaxDelayInSecsDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long retryMaxDelaySeconds = + BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); + assertEquals(0, retryMaxDelaySeconds); + } + + @Test + public void testParseRetryMaxDelaySecondsInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "RetryMaxDelay=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null)); + } + + @Test + public void testParseRequestGoogleDriveScope_Default() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; + Integer value = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, + this.getClass().getName()); + assertEquals( + Integer.valueOf(BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE), value); + } + + // Connection Pool Size + + @Test + public void testParseConnectionPoolSize() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ConnectionPoolSize=10"; + long connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); + assertEquals(10, connectionPoolSize); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ConnectionPoolSize=20"; + + connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); + assertEquals(20, connectionPoolSize); + } + + @Test + public void testParseConnectionPoolSizeDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); + assertEquals(10, connectionPoolSize); + } + + @Test + public void testParseConnectionPoolSizeDefaultNullConnectionUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize(null, null)); + } + + @Test + public void testParseConnectionPoolSizeDefaultEmptyConnectionUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize("", null)); + } + + @Test + public void testParseConnectionPoolSizeInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ConnectionPoolSize=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null)); + } + + // Listener Pool Size + + @Test + public void testParseListenerPoolSize() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ListenerPoolSize=10"; + long listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); + assertEquals(10, listenerPoolSize); + + connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ListenerPoolSize=20"; + + listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); + assertEquals(20, listenerPoolSize); + } + + @Test + public void testParseListenerPoolSizeDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); + assertEquals(10, listenerPoolSize); + } + + @Test + public void testParseListenerPoolSizeDefaultNullConnectionUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseListenerPoolSize(null, null)); + } + + @Test + public void testParseListenerPoolSizeDefaultEmptyConnectionUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseListenerPoolSize("", null)); + } + + @Test + public void testParseListenerPoolSizeInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ListenerPoolSize=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null)); + } + + @Test + public void testParseStringListProperty_NullOrEmpty() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;SomeProp="; + List result = + BigQueryJdbcUrlUtility.parseStringListProperty(url, "NonExistentProp", "TestClass"); + assertEquals(Collections.emptyList(), result); + + result = BigQueryJdbcUrlUtility.parseStringListProperty(url, "SomeProp", "TestClass"); + assertEquals(Collections.emptyList(), result); + + String urlWithEmptyList = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=,,"; + result = + BigQueryJdbcUrlUtility.parseStringListProperty(urlWithEmptyList, "ListProp", "TestClass"); + assertEquals(Collections.emptyList(), result); + } + + @Test + public void testParseStringListProperty_SingleValue() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=project1"; + List result = + BigQueryJdbcUrlUtility.parseStringListProperty(url, "ListProp", "TestClass"); + assertEquals(Collections.singletonList("project1"), result); + } + + @Test + public void testParseStringListProperty_MultipleValues() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=project1,project2,project3"; + List result = + BigQueryJdbcUrlUtility.parseStringListProperty(url, "ListProp", "TestClass"); + assertEquals(Arrays.asList("project1", "project2", "project3"), result); + } + + @Test + public void testParseIntProperty_ValidInteger() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;SomeIntProp=123"; + Integer defaultValue = 0; + Integer result = + BigQueryJdbcUrlUtility.parseIntProperty(url, "SomeIntProp", defaultValue, "TestClass"); + assertEquals(Integer.valueOf(123), result); + } + + @Test + public void testParseIntProperty_PropertyNotPresent() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;SomeIntProp=123"; + Integer defaultValue = 42; + Integer result = + BigQueryJdbcUrlUtility.parseIntProperty(url, "MissingIntProp", defaultValue, "TestClass"); + assertEquals(defaultValue, result); + } + + @Test + public void testParseIntProperty_InvalidIntegerValue() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;InvalidIntProp=abc"; + Integer defaultValue = 77; + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcUrlUtility.parseIntProperty( + url, "InvalidIntProp", defaultValue, "TestClass")); + } + + @Test + public void testParseIntProperty_EmptyStringValue() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;EmptyIntProp="; + Integer defaultValue = 88; + assertThrows( + IllegalArgumentException.class, + () -> + BigQueryJdbcUrlUtility.parseIntProperty( + url, "EmptyIntProp", defaultValue, "TestClass")); + } + + @Test + public void testParseMaxBytesBilled() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "MaximumBytesBilled=10000"; + + long maxBytesBilled = BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null); + assertEquals(10000, maxBytesBilled); + } + + @Test + public void testParseMaxBytesBilledDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + long maxBytesBilled = BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null); + assertEquals(0, maxBytesBilled); + } + + @Test + public void testParseMaxBytesBilledNullUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled(null, null)); + } + + @Test + public void testParseMaxBytesBilledEmptyUrl() { + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled("", null)); + } + + @Test + public void testParseMaxBytesBilledInvalidLong() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "MaximumBytesBilled=invalid"; + + assertThrows( + NumberFormatException.class, + () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null)); + } + + @Test + public void testParseLabels() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "Labels=k1=v1,k2=v2,k3=v3;"; + + Map labels = BigQueryJdbcUrlUtility.parseLabels(connection_uri, null); + assertNotNull(labels); + assertFalse(labels.isEmpty()); + assertEquals(3, labels.size()); + + Map expected = + new HashMap() { + { + put("k1", "v1"); + put("k2", "v2"); + put("k3", "v3"); + } + }; + + assertTrue(Maps.difference(expected, labels).areEqual()); + } + + @Test + public void testParseLabelsEmpty() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; + + Map labels = BigQueryJdbcUrlUtility.parseLabels(connection_uri, null); + assertNull(labels); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfPrimitivesTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfPrimitivesTest.java new file mode 100644 index 0000000000..6f10ae79a0 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfPrimitivesTest.java @@ -0,0 +1,342 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.StandardSQLTypeName.BIGNUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.BOOL; +import static com.google.cloud.bigquery.StandardSQLTypeName.BYTES; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATE; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATETIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.FLOAT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.GEOGRAPHY; +import static com.google.cloud.bigquery.StandardSQLTypeName.INT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.NUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.STRING; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIMESTAMP; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.INVALID_ARRAY; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arraySchemaAndValue; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.nestedResultSetToColumnLists; +import static com.google.common.truth.Truth.assertThat; +import static java.time.Month.MARCH; +import static java.util.Arrays.copyOfRange; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import com.google.common.io.BaseEncoding; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +@RunWith(Parameterized.class) +public class BigQueryJsonArrayOfPrimitivesTest { + + private final Field schema; + private final FieldValue arrayValues; + private final Object[] expected; + private final int javaSqlTypeCode; + private Array array; + private final StandardSQLTypeName currentType; + + @ClassRule public static final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + public BigQueryJsonArrayOfPrimitivesTest( + StandardSQLTypeName currentType, + Tuple schemaAndValue, + Object[] expected, + int javaSqlTypeCode) { + this.currentType = currentType; + this.schema = schemaAndValue.x(); + this.arrayValues = schemaAndValue.y(); + this.expected = expected; + this.javaSqlTypeCode = javaSqlTypeCode; + } + + @Before + public void setUp() { + array = new BigQueryJsonArray(this.schema, this.arrayValues); + } + + @Parameters(name = "{index}: primitive array of {0}") + public static Collection data() { + timeZoneRule.enforce(); + LocalDateTime aTimeStamp = LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820227000); + LocalDate aDate = LocalDate.of(2023, MARCH, 30); + LocalTime aTime = LocalTime.of(11, 14, 19, 820227000); + return Arrays.asList( + new Object[][] { + { + INT64, + arraySchemaAndValue(INT64, "10", "20", "30", "40"), + new Long[] {10L, 20L, 30L, 40L}, + Types.BIGINT + }, + { + BOOL, + arraySchemaAndValue(BOOL, "true", "false", "false", "true"), + new Boolean[] {true, false, false, true}, + Types.BOOLEAN + }, + { + FLOAT64, + arraySchemaAndValue(FLOAT64, "11.2", "33.4", "55.6", "77.8"), + new Double[] {11.2, 33.4, 55.6, 77.8}, + Types.DOUBLE + }, + { + NUMERIC, + arraySchemaAndValue(NUMERIC, "11.2657", "33.4657", "55.6657", "77.8657"), + new BigDecimal[] { + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657") + }, + Types.NUMERIC + }, + { + BIGNUMERIC, + arraySchemaAndValue(BIGNUMERIC, "11.2657", "33.4657", "55.6657", "77.8657"), + new BigDecimal[] { + new BigDecimal("11.2657"), + new BigDecimal("33.4657"), + new BigDecimal("55.6657"), + new BigDecimal("77.8657") + }, + Types.NUMERIC + }, + { + STRING, + arraySchemaAndValue(STRING, "one", "two", "three", "four"), + new String[] {"one", "two", "three", "four"}, + Types.NVARCHAR + }, + { + TIMESTAMP, + arraySchemaAndValue( + TIMESTAMP, + "1680174859.8202269", + "1680261259.8202269", + "1680347659.8202269", + "1680434059.8202269"), + new Timestamp[] { + Timestamp.valueOf(aTimeStamp), // 2023-03-30 16:44:19.82 + Timestamp.valueOf(aTimeStamp.plusDays(1)), + Timestamp.valueOf(aTimeStamp.plusDays(2)), + Timestamp.valueOf(aTimeStamp.plusDays(3)) + }, + Types.TIMESTAMP + }, + { + DATE, + arraySchemaAndValue(DATE, "2023-03-30", "2023-03-31", "2023-04-01", "2023-04-02"), + new Date[] { + Date.valueOf(aDate), + Date.valueOf(aDate.plusDays(1)), + Date.valueOf(aDate.plusDays(2)), + Date.valueOf(aDate.plusDays(3)) + }, + Types.DATE + }, + { + TIME, + arraySchemaAndValue( + TIME, "11:14:19.820227", "11:14:20.820227", "11:14:21.820227", "11:14:22.820227"), + new Time[] { + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.toNanoOfDay())), + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.plusSeconds(1).toNanoOfDay())), + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.plusSeconds(2).toNanoOfDay())), + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.plusSeconds(3).toNanoOfDay())) + }, + Types.TIME + }, + { + DATETIME, + arraySchemaAndValue( + DATETIME, + "2023-03-30T11:14:19.820227", + "2023-03-30T11:15:19.820227", + "2023-03-30T11:16:19.820227", + "2023-03-30T11:17:19.820227"), + new Timestamp[] { + Timestamp.valueOf("2023-03-30 11:14:19.820227"), + Timestamp.valueOf("2023-03-30 11:15:19.820227"), + Timestamp.valueOf("2023-03-30 11:16:19.820227"), + Timestamp.valueOf("2023-03-30 11:17:19.820227") + }, + Types.TIMESTAMP + }, + { + GEOGRAPHY, + arraySchemaAndValue( + GEOGRAPHY, "POINT(-122 47)", "POINT(-122 48)", "POINT(-121 47)", "POINT(-123 48)"), + new String[] {"POINT(-122 47)", "POINT(-122 48)", "POINT(-121 47)", "POINT(-123 48)"}, + Types.OTHER + }, + { + BYTES, + arraySchemaAndValue( + BYTES, + Stream.of("one", "two", "three", "four") + .map(s -> BaseEncoding.base64().encode(s.getBytes())) + .toArray(String[]::new)), + new byte[][] { + "one".getBytes(), "two".getBytes(), "three".getBytes(), "four".getBytes() + }, + Types.VARBINARY + } + }); + } + + @Test + public void getArray() throws SQLException { + assertThat(array.getArray()).isEqualTo(this.expected); + } + + @Test + public void getSlicedArray() throws SQLException { + int fromIndex = 1; + int toIndexExclusive = 3; + Object[] expectedSlicedArray = + copyOfRange(this.expected, fromIndex, toIndexExclusive); // copying index(1,2) + + // the first element is at index 1 + assertThat(array.getArray(fromIndex + 1, 2)).isEqualTo(expectedSlicedArray); + } + + @Test + public void getSlicedArrayWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getArray(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getResultSet() throws SQLException { + ResultSet resultSet = this.array.getResultSet(); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + ArrayList indexList = indexAndValues.x(); + ArrayList columnValues = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {1, 2, 3, 4}); + assertThat(columnValues.toArray()).isEqualTo(this.expected); + } + + @Test + public void getSlicedResultSet() throws SQLException { + int fromIndex = 1; + int toIndexExclusive = 3; + Object[] expectedSlicedArray = + copyOfRange(this.expected, fromIndex, toIndexExclusive); // copying index(1,2) + + // the first element is at index 1 + ResultSet resultSet = array.getResultSet(fromIndex + 1, 2); + + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + ArrayList indexList = indexAndValues.x(); + ArrayList columnValues = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {2, 3}); + assertThat(columnValues.toArray()).isEqualTo(expectedSlicedArray); + } + + @Test + public void getSlicedResultSetWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getResultSet(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getBaseTypeName() throws SQLException { + assertThat(array.getBaseTypeName()).isEqualTo(this.currentType.name()); + } + + @Test + public void getBaseType() throws SQLException { + assertThat(array.getBaseType()).isEqualTo(this.javaSqlTypeCode); + } + + @Test + public void free() throws SQLException { + this.array.free(); + + ensureArrayIsInvalid(() -> array.getArray()); + ensureArrayIsInvalid(() -> array.getArray(1, 2)); + ensureArrayIsInvalid(() -> array.getResultSet()); + ensureArrayIsInvalid(() -> array.getResultSet(1, 2)); + ensureArrayIsInvalid(() -> array.getBaseTypeName()); + ensureArrayIsInvalid(() -> array.getBaseType()); + } + + @Test + public void getArrayWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(emptyMap())); + Exception exception2 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Test + public void getResultSetWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getResultSet(emptyMap())); + Exception exception2 = + assertThrows( + SQLFeatureNotSupportedException.class, () -> array.getResultSet(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + private void ensureArrayIsInvalid(ThrowingRunnable block) { + Exception exception = assertThrows(IllegalStateException.class, block); + assertThat(exception.getMessage()).isEqualTo(INVALID_ARRAY); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfStructTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfStructTest.java new file mode 100644 index 0000000000..b390d642e4 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonArrayOfStructTest.java @@ -0,0 +1,204 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.FieldValue.Attribute.PRIMITIVE; +import static com.google.cloud.bigquery.LegacySQLTypeName.RECORD; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.INVALID_ARRAY; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.nestedResultSetToColumnLists; +import static com.google.common.truth.Truth.assertThat; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.StandardSQLTypeName; +import java.sql.Array; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Struct; +import java.sql.Types; +import java.util.ArrayList; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; + +public class BigQueryJsonArrayOfStructTest { + + private Array array; + + @Before + public void setUp() { + FieldList profileSchema = + FieldList.of( + Field.newBuilder("name", LegacySQLTypeName.STRING).build(), + Field.newBuilder("age", LegacySQLTypeName.INTEGER).build(), + Field.newBuilder("adult", LegacySQLTypeName.BOOLEAN).build()); + + FieldValue record1 = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList( + FieldValue.of(PRIMITIVE, "Arya"), + FieldValue.of(PRIMITIVE, "15"), + FieldValue.of(PRIMITIVE, "false")))); + FieldValue record2 = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList( + FieldValue.of(PRIMITIVE, "Khal Drogo"), + FieldValue.of(PRIMITIVE, "35"), + FieldValue.of(PRIMITIVE, "true")))); + FieldValue record3 = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList( + FieldValue.of(PRIMITIVE, "Ned Stark"), + FieldValue.of(PRIMITIVE, "45"), + FieldValue.of(PRIMITIVE, "true")))); + FieldValue record4 = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList( + FieldValue.of(PRIMITIVE, "Jon Snow"), + FieldValue.of(PRIMITIVE, "25"), + FieldValue.of(PRIMITIVE, "true")))); + + Field arrayOfStructSchema = + Field.newBuilder("profiles", RECORD, profileSchema).setMode(Mode.REPEATED).build(); + + FieldValue arrayOfStructValue = + FieldValue.of( + Attribute.REPEATED, FieldValueList.of(asList(record1, record2, record3, record4))); + array = new BigQueryJsonArray(arrayOfStructSchema, arrayOfStructValue); + } + + @Test + public void getArray() throws SQLException { + Struct[] structArray = (Struct[]) array.getArray(); + + assertThat(structArray.length).isEqualTo(4); + assertThat(structArray[0].getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(structArray[1].getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structArray[2].getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + assertThat(structArray[3].getAttributes()).isEqualTo(asList("Jon Snow", 25L, true).toArray()); + } + + @Test + public void getSlicedArray() throws SQLException { + Struct[] structArray = (Struct[]) array.getArray(2, 2); + + assertThat(structArray.length).isEqualTo(2); + assertThat(structArray[0].getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structArray[1].getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + } + + @Test + public void getSlicedArrayWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getArray(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getResultSet() throws SQLException { + ResultSet resultSet = array.getResultSet(); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + + ArrayList indexList = indexAndValues.x(); + ArrayList structs = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {1, 2, 3, 4}); + assertThat(structs.get(0).getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(structs.get(1).getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structs.get(2).getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + assertThat(structs.get(3).getAttributes()).isEqualTo(asList("Jon Snow", 25L, true).toArray()); + } + + @Test + public void getSlicedResultSet() throws SQLException { + ResultSet resultSet = array.getResultSet(2, 2); + Tuple, ArrayList> indexAndValues = + nestedResultSetToColumnLists(resultSet); + + ArrayList indexList = indexAndValues.x(); + ArrayList structs = indexAndValues.y(); + + assertThat(indexList.toArray()).isEqualTo(new Object[] {2, 3}); + assertThat(structs.get(0).getAttributes()).isEqualTo(asList("Khal Drogo", 35L, true).toArray()); + assertThat(structs.get(1).getAttributes()).isEqualTo(asList("Ned Stark", 45L, true).toArray()); + } + + @Test + public void getResultSetWhenCountIsGreaterThanOriginalArrayLength() { + IllegalArgumentException illegalArgumentException = + assertThrows(IllegalArgumentException.class, () -> array.getResultSet(2, 10)); + assertThat(illegalArgumentException.getMessage()) + .isEqualTo("The array index is out of range: 12, number of elements: 4."); + } + + @Test + public void getBaseTypeName() throws SQLException { + assertThat(array.getBaseTypeName()).isEqualTo(StandardSQLTypeName.STRUCT.name()); + } + + @Test + public void getBaseType() throws SQLException { + assertThat(array.getBaseType()).isEqualTo(Types.STRUCT); + } + + @Test + public void free() throws SQLException { + this.array.free(); + + ensureArrayIsInvalid(() -> array.getArray()); + ensureArrayIsInvalid(() -> array.getArray(1, 2)); + ensureArrayIsInvalid(() -> array.getBaseTypeName()); + ensureArrayIsInvalid(() -> array.getBaseType()); + } + + @Test + public void getArrayWithCustomTypeMappingsIsNotSupported() { + Exception exception1 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(emptyMap())); + Exception exception2 = + assertThrows(SQLFeatureNotSupportedException.class, () -> array.getArray(1, 2, emptyMap())); + assertThat(exception1.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + assertThat(exception2.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + private void ensureArrayIsInvalid(ThrowingRunnable block) { + Exception exception = Assert.assertThrows(IllegalStateException.class, block); + assertThat(exception.getMessage()).isEqualTo(INVALID_ARRAY); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSetTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSetTest.java new file mode 100644 index 0000000000..4c715833ff --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSetTest.java @@ -0,0 +1,476 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static java.time.Month.MARCH; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import com.google.common.collect.ImmutableList; +import com.google.common.io.BaseEncoding; +import com.google.common.io.CharStreams; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.sql.Array; +import java.sql.Blob; +import java.sql.Date; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Calendar; +import java.util.TimeZone; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +public class BigQueryJsonResultSetTest { + + @Rule public final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + private static final FieldList fieldList = + FieldList.of( + Field.of("first", StandardSQLTypeName.BOOL), + Field.of("second", StandardSQLTypeName.INT64), + Field.of("third", StandardSQLTypeName.FLOAT64), + Field.of("fourth", StandardSQLTypeName.STRING), + Field.of("fifth", StandardSQLTypeName.TIMESTAMP), + Field.of("sixth", StandardSQLTypeName.BYTES), + Field.of("seventh", StandardSQLTypeName.STRING), + Field.newBuilder("eight", StandardSQLTypeName.INT64).setMode(Field.Mode.REPEATED).build(), + Field.of( + "ninth", + StandardSQLTypeName.STRUCT, + Field.of("first", StandardSQLTypeName.FLOAT64), + Field.of("second", StandardSQLTypeName.TIMESTAMP)), + Field.of("tenth", StandardSQLTypeName.NUMERIC), + Field.of("eleventh", StandardSQLTypeName.BIGNUMERIC), + Field.of("twelfth", LegacySQLTypeName.TIME), + Field.of("thirteenth", LegacySQLTypeName.INTEGER), + Field.of("fourteenth", LegacySQLTypeName.DATE)); + + LocalDateTime aTimeStamp = LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820000000); + LocalTime aTime = LocalTime.of(11, 14, 19, 820000000); + private static final String STRING_VAL = "STRING_VALUE"; + private static final Schema QUERY_SCHEMA = Schema.of(fieldList); + private final FieldValue booleanFv = FieldValue.of(Attribute.PRIMITIVE, "false"); + private final FieldValue integerFv = FieldValue.of(Attribute.PRIMITIVE, "1"); + private final FieldValue floatFv = FieldValue.of(Attribute.PRIMITIVE, "1.5"); + private final FieldValue stringFv = FieldValue.of(Attribute.PRIMITIVE, STRING_VAL); + private final FieldValue timestampFv = + FieldValue.of(Attribute.PRIMITIVE, "1680174859.820000"); // 2023-03-30 16:44:19.82 + + private final FieldValue bytesFv = + FieldValue.of( + Attribute.PRIMITIVE, + BaseEncoding.base64().encode(STRING_VAL.getBytes(StandardCharsets.UTF_8))); + + private final FieldValue nullFv = FieldValue.of(Attribute.PRIMITIVE, null); + private final FieldValue repeatedFv = + FieldValue.of( + Attribute.REPEATED, + FieldValueList.of( + ImmutableList.of( + FieldValue.of(Attribute.PRIMITIVE, "10"), + FieldValue.of(Attribute.PRIMITIVE, "20")))); + private final FieldValue recordFv = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + ImmutableList.of(floatFv, timestampFv), fieldList.get("ninth").getSubFields())); + private final FieldValue numericFv = FieldValue.of(Attribute.PRIMITIVE, "12345678"); + private final FieldValue bigNumericFv = FieldValue.of(Attribute.PRIMITIVE, "12345678.99"); + + private final FieldValue timeFv = FieldValue.of(Attribute.PRIMITIVE, "11:14:19.820000"); + + private final FieldValue shortFv = FieldValue.of(Attribute.PRIMITIVE, "10"); + private final FieldValue dateFv = FieldValue.of(Attribute.PRIMITIVE, "2020-01-15"); + + private final FieldValueList fieldValues = + FieldValueList.of( + ImmutableList.of( + booleanFv, // 1 + integerFv, // 2 + floatFv, // 3 + stringFv, // 4 + timestampFv, // 5 + bytesFv, // 6 + nullFv, // 7 + repeatedFv, // 8 + recordFv, // 9 + numericFv, // 10 + bigNumericFv, // 11 + timeFv, // 12 + shortFv, // 13 + dateFv // 14 + ), + fieldList); + + private BigQueryFieldValueListWrapper bigQueryFieldValueListWrapperNested; + + private BigQueryStatement statement; + private BigQueryStatement statementForTwoRows; + + private BigQueryJsonResultSet bigQueryJsonResultSet; + private BigQueryJsonResultSet bigQueryJsonResultSetNested; + + private BlockingQueue buffer; + private BlockingQueue bufferWithTwoRows; + + @Before + public void setUp() { + // Buffer with one row + buffer = new LinkedBlockingDeque<>(2); + statement = mock(BigQueryStatement.class); + buffer.add(BigQueryFieldValueListWrapper.of(fieldList, fieldValues)); + buffer.add(BigQueryFieldValueListWrapper.of(null, null, true)); // last marker + Thread[] workerThreads = {new Thread()}; + bigQueryJsonResultSet = + BigQueryJsonResultSet.of(QUERY_SCHEMA, 1L, buffer, statement, workerThreads); + + // Buffer with 2 rows. + bufferWithTwoRows = new LinkedBlockingDeque<>(3); + statementForTwoRows = mock(BigQueryStatement.class); + bufferWithTwoRows.add(BigQueryFieldValueListWrapper.of(fieldList, fieldValues)); + bufferWithTwoRows.add(BigQueryFieldValueListWrapper.of(fieldList, fieldValues)); + bufferWithTwoRows.add(BigQueryFieldValueListWrapper.of(null, null, true)); // last marker + + // values for nested types + Field fieldEight = fieldList.get("eight"); + FieldValue fieldEightValue = fieldValues.get("eight"); + FieldList nestedFieldList = Schema.of(fieldEight).getFields(); + bigQueryFieldValueListWrapperNested = + BigQueryFieldValueListWrapper.getNestedFieldValueListWrapper( + nestedFieldList, fieldEightValue.getRepeatedValue()); + bigQueryJsonResultSetNested = + BigQueryJsonResultSet.getNestedResultSet( + Schema.of(fieldEight), + bigQueryFieldValueListWrapperNested, + 0, + fieldEightValue.getRepeatedValue().size()); + } + + private boolean resetResultSet() + throws SQLException { // re-initialises the resultset and moves the cursor to the first row + Thread[] workerThreads = {new Thread()}; + bigQueryJsonResultSet = + BigQueryJsonResultSet.of(QUERY_SCHEMA, 1L, buffer, statement, workerThreads); + return bigQueryJsonResultSet.next(); // move to the first row + } + + @Test + public void testIsClosed() { + assertThat(bigQueryJsonResultSet.isClosed()).isFalse(); + } + + @Test + public void testClose() { + // TODO(prashant): Add test case after close method is implemented + } + + @Test + public void testRowCount() throws SQLException { + Thread[] workerThreads = {new Thread()}; + // ResultSet with 1 row buffer and 1 total rows. + BigQueryJsonResultSet bigQueryJsonResultSet2 = + BigQueryJsonResultSet.of(QUERY_SCHEMA, 1L, buffer, statement, workerThreads); + assertThat(resultSetRowCount(bigQueryJsonResultSet2)).isEqualTo(1); + // ResultSet with 2 rows buffer and 1 total rows. + bigQueryJsonResultSet2 = + BigQueryJsonResultSet.of( + QUERY_SCHEMA, 1L, bufferWithTwoRows, statementForTwoRows, workerThreads); + assertThat(resultSetRowCount(bigQueryJsonResultSet2)).isEqualTo(1); + } + + @Test + // This method tests iteration and Resultset's type getters + public void testIteration() throws SQLException { + int cnt = 0; + assertThat(bigQueryJsonResultSet.isBeforeFirst()).isTrue(); + while (bigQueryJsonResultSet.next()) { + cnt++; + assertThat(bigQueryJsonResultSet.isLast()).isTrue(); // we have one test row + assertThat(bigQueryJsonResultSet.isFirst()).isTrue(); // we have one test row + assertThat(bigQueryJsonResultSet.getBoolean("first")).isFalse(); + assertThat(bigQueryJsonResultSet.getBoolean(1)).isFalse(); + assertThat(bigQueryJsonResultSet.getInt("second")).isEqualTo(1); + assertThat(bigQueryJsonResultSet.getInt(2)).isEqualTo(1); + assertThat(bigQueryJsonResultSet.getFloat("third")).isEqualTo(1.5f); + assertThat(bigQueryJsonResultSet.getFloat(3)).isEqualTo(1.5f); + assertThat(bigQueryJsonResultSet.getString("fourth")).isEqualTo(STRING_VAL); + assertThat(bigQueryJsonResultSet.getString(4)).isEqualTo(STRING_VAL); + assertThat(bigQueryJsonResultSet.getTimestamp("fifth")) + .isEqualTo(Timestamp.valueOf(aTimeStamp)); + assertThat(bigQueryJsonResultSet.getTimestamp(5)).isEqualTo(Timestamp.valueOf(aTimeStamp)); + assertThat(bigQueryJsonResultSet.wasNull()).isFalse(); + assertThat(bigQueryJsonResultSet.getObject("seventh")).isNull(); // test null + assertThat(bigQueryJsonResultSet.getObject(7)).isNull(); + assertThat(bigQueryJsonResultSet.wasNull()).isTrue(); + assertThat(bigQueryJsonResultSet.getArray("eight").getArray()) + .isEqualTo(new Object[] {10L, 20L}); + assertThat(bigQueryJsonResultSet.getArray(8).getArray()).isEqualTo(new Object[] {10L, 20L}); + assertThat(((Array) bigQueryJsonResultSet.getObject("eight")).getArray()) + .isEqualTo(new Object[] {10L, 20L}); + assertThat(((Array) bigQueryJsonResultSet.getObject(8)).getArray()) + .isEqualTo(new Object[] {10L, 20L}); + assertThat(((Struct) bigQueryJsonResultSet.getObject("ninth")).getAttributes()) + .isEqualTo(new Object[] {1.5, Timestamp.valueOf(aTimeStamp)}); + assertThat(((Struct) bigQueryJsonResultSet.getObject(9)).getAttributes()) + .isEqualTo(new Object[] {1.5, Timestamp.valueOf(aTimeStamp)}); + assertThat(bigQueryJsonResultSet.getLong("tenth")).isEqualTo(12345678L); + assertThat(bigQueryJsonResultSet.getLong(10)).isEqualTo(12345678L); + assertThat(bigQueryJsonResultSet.getDouble("eleventh")).isEqualTo(12345678.99D); + assertThat(bigQueryJsonResultSet.getDouble(11)).isEqualTo(12345678.99D); + Time expectedTime = new Time(TimeUnit.NANOSECONDS.toMillis(aTime.toNanoOfDay())); + assertThat(bigQueryJsonResultSet.getTime("twelfth")).isEqualTo(expectedTime); + assertThat(bigQueryJsonResultSet.getTime(12)).isEqualTo(expectedTime); + assertThat(bigQueryJsonResultSet.getShort("thirteenth")).isEqualTo((short) 10); + assertThat(bigQueryJsonResultSet.getShort(13)).isEqualTo((short) 10); + } + assertThat(cnt).isEqualTo(1); + assertThat(bigQueryJsonResultSet.next()).isFalse(); + assertThat(bigQueryJsonResultSet.isAfterLast()).isTrue(); + } + + @Test + public void testGetObjectWithPrimitives() throws SQLException { + bigQueryJsonResultSet.next(); + assertThat(bigQueryJsonResultSet.getObject("first")).isEqualTo(false); + assertThat(bigQueryJsonResultSet.getObject(1)).isEqualTo(false); + assertThat(bigQueryJsonResultSet.getObject("second")).isEqualTo(1); + assertThat(bigQueryJsonResultSet.getObject(2)).isEqualTo(1); + assertThat(bigQueryJsonResultSet.getObject("third")).isEqualTo(1.5); + assertThat(bigQueryJsonResultSet.getObject(3)).isEqualTo(1.5); + assertThat(bigQueryJsonResultSet.getObject("fourth")).isEqualTo(STRING_VAL); + assertThat(bigQueryJsonResultSet.getObject(4)).isEqualTo(STRING_VAL); + assertThat(bigQueryJsonResultSet.getObject("fifth")).isEqualTo(Timestamp.valueOf(aTimeStamp)); + assertThat(bigQueryJsonResultSet.getObject(5)).isEqualTo(Timestamp.valueOf(aTimeStamp)); + assertThat(bigQueryJsonResultSet.getObject("sixth")) + .isEqualTo(STRING_VAL.getBytes(StandardCharsets.UTF_8)); + assertThat(bigQueryJsonResultSet.getObject(6)) + .isEqualTo(STRING_VAL.getBytes(StandardCharsets.UTF_8)); + assertThat(bigQueryJsonResultSet.wasNull()).isFalse(); + assertThat(bigQueryJsonResultSet.getObject("seventh")).isNull(); // test null + assertThat(bigQueryJsonResultSet.getObject(7)).isNull(); + assertThat(bigQueryJsonResultSet.wasNull()).isTrue(); + + assertThat(bigQueryJsonResultSet.getObject("tenth")).isEqualTo(new BigDecimal("12345678")); + assertThat(bigQueryJsonResultSet.getObject(10)).isEqualTo(new BigDecimal("12345678")); + assertThat(bigQueryJsonResultSet.getObject("eleventh")) + .isEqualTo(new BigDecimal("12345678.99")); + assertThat(bigQueryJsonResultSet.getObject(11)).isEqualTo(new BigDecimal("12345678.99")); + Time expectedTime = new Time(TimeUnit.NANOSECONDS.toMillis(aTime.toNanoOfDay())); + assertThat(bigQueryJsonResultSet.getObject("twelfth")).isEqualTo(expectedTime); + assertThat(bigQueryJsonResultSet.getObject(12)).isEqualTo(expectedTime); + assertThat(bigQueryJsonResultSet.getObject("thirteenth")).isEqualTo((short) 10); + assertThat(bigQueryJsonResultSet.getObject(13)).isEqualTo((short) 10); + } + + // validate the input streams + @Test + public void testCharacterStream() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + Reader charStream = bigQueryJsonResultSet.getCharacterStream("fourth"); + String expectedVal = CharStreams.toString(charStream); + assertThat(expectedVal).isEqualTo(STRING_VAL); + } + + @Test + public void testBinaryStream() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + StringBuilder textBuilder = new StringBuilder(); + InputStream binInputStream = bigQueryJsonResultSet.getBinaryStream(6); + Reader reader = new BufferedReader(new InputStreamReader(binInputStream)); + int c; + while ((c = reader.read()) != -1) { + textBuilder.append((char) c); + } + assertThat(textBuilder.toString()).isEqualTo(STRING_VAL); + reader.close(); + } + + @Test + public void testAsciiStream() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + StringBuilder textBuilder = new StringBuilder(); + InputStream binInputStream = bigQueryJsonResultSet.getAsciiStream(4); + Reader reader = new BufferedReader(new InputStreamReader(binInputStream)); + int c; + while ((c = reader.read()) != -1) { + textBuilder.append((char) c); + } + String expectedAsciiString = + new String(STRING_VAL.getBytes(), 0, STRING_VAL.length(), StandardCharsets.US_ASCII); + assertThat(textBuilder.length()).isEqualTo(expectedAsciiString.length()); + assertThat(textBuilder.toString()).isEqualTo(expectedAsciiString); + reader.close(); + } + + @Test + public void testUnicodeStream() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + InputStream binInputStream = bigQueryJsonResultSet.getUnicodeStream(4); + byte[] cbuf = new byte[100]; + int len = binInputStream.read(cbuf, 0, cbuf.length); + String colFourVal = new String(cbuf, 0, len, StandardCharsets.UTF_16LE); + assertThat(colFourVal).isEqualTo(STRING_VAL); + } + + @Test + public void testClob() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + java.sql.Clob clobVal = bigQueryJsonResultSet.getClob(4); + StringBuilder textBuilder = new StringBuilder(); + Reader charStream = clobVal.getCharacterStream(); + int intValueOfChar; + while ((intValueOfChar = charStream.read()) != -1) { + textBuilder.append((char) intValueOfChar); + } + charStream.close(); + assertThat(textBuilder.toString()).isEqualTo(STRING_VAL); + } + + @Test + public void testBlob() throws SQLException, IOException { + assertThat(resetResultSet()).isTrue(); + StringBuilder textBuilder = new StringBuilder(); + Blob blobVal = bigQueryJsonResultSet.getBlob(6); + InputStream binInputStream = blobVal.getBinaryStream(); + Reader reader = new BufferedReader(new InputStreamReader(binInputStream)); + int c; + while ((c = reader.read()) != -1) { + textBuilder.append((char) c); + } + assertThat(textBuilder.toString()).isEqualTo(STRING_VAL); + reader.close(); + } + + @Test + public void testBytes() throws SQLException { + assertThat(resetResultSet()).isTrue(); + assertThat(bigQueryJsonResultSet.getBytes("sixth")) + .isEqualTo(STRING_VAL.getBytes(StandardCharsets.UTF_8)); + assertThat(bigQueryJsonResultSet.getBytes(6)) + .isEqualTo(STRING_VAL.getBytes(StandardCharsets.UTF_8)); + } + + @Test + public void testResultSetHoldability() + throws SQLException { // TODO(prashant): Revisit this after Statement's commit is finalised + assertThat(bigQueryJsonResultSet.getHoldability()) + .isEqualTo(ResultSet.HOLD_CURSORS_OVER_COMMIT); + } + + @Test + public void testStatement() throws SQLException { + assertThat(bigQueryJsonResultSet.getStatement()).isEqualTo(statement); + assertThat(bigQueryJsonResultSetNested.getStatement()).isNull(); + } + + @Test + public void testConcurrency() throws SQLException { + assertThat(bigQueryJsonResultSet.getConcurrency()).isEqualTo(ResultSet.CONCUR_READ_ONLY); + assertThat(bigQueryJsonResultSet.getType()).isEqualTo(ResultSet.TYPE_FORWARD_ONLY); + assertThat(bigQueryJsonResultSet.findColumn("first")).isEqualTo(1); + } + + @Test + public void testIterationNested() throws SQLException { + int cnt = 0; + assertThat(bigQueryJsonResultSetNested.isBeforeFirst()).isTrue(); + while (bigQueryJsonResultSetNested.next()) { + cnt++; + if (cnt == 1) { + assertThat(bigQueryJsonResultSetNested.isFirst()).isTrue(); + + } else { // 2nd row is the last row + assertThat(bigQueryJsonResultSetNested.isLast()).isTrue(); + } + assertThat(bigQueryJsonResultSetNested.getInt(1)) + .isEqualTo(cnt); // the first column is index 1 + assertThat(bigQueryJsonResultSetNested.getInt(2)) + .isEqualTo(cnt * 10); // second column has values 10 and 20 + } + assertThat(cnt).isEqualTo(2); + assertThat(bigQueryJsonResultSetNested.next()).isFalse(); + assertThat(bigQueryJsonResultSetNested.isAfterLast()).isTrue(); + } + + @Test + public void testTime() throws SQLException { + assertThat(resetResultSet()).isTrue(); + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("EST")); + Time expectedTime = new Time(TimeUnit.NANOSECONDS.toMillis(aTime.toNanoOfDay())); + assertThat(bigQueryJsonResultSet.getTime(12)) + .isEqualTo(bigQueryJsonResultSet.getTime(12, calendar)); + assertThat(expectedTime).isEqualTo(bigQueryJsonResultSet.getTime(12, calendar)); + assertThat(bigQueryJsonResultSet.getTime("twelfth")) + .isEqualTo(bigQueryJsonResultSet.getTime("twelfth", calendar)); + } + + @Test + public void testTimestamp() throws SQLException { + assertThat(resetResultSet()).isTrue(); + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("EST")); + Timestamp time = bigQueryJsonResultSet.getTimestamp(5); + Timestamp timeWithCal = bigQueryJsonResultSet.getTimestamp(5, calendar); + assertThat(time).isEqualTo(timeWithCal); + assertThat(bigQueryJsonResultSet.getTimestamp("fifth")) + .isEqualTo(bigQueryJsonResultSet.getTimestamp("fifth")); + } + + @Test + public void testDate() throws SQLException { + assertThat(resetResultSet()).isTrue(); + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("EST")); + // epoc should match + assertThat(bigQueryJsonResultSet.getDate(14).getTime()) + .isEqualTo(bigQueryJsonResultSet.getDate(14, calendar).getTime()); + assertThat(Date.valueOf("2020-01-15").getTime()) + .isEqualTo(bigQueryJsonResultSet.getDate(14, calendar).getTime()); + assertThat(bigQueryJsonResultSet.getDate("fourteenth").getTime()) + .isEqualTo(bigQueryJsonResultSet.getDate("fourteenth", calendar).getTime()); + } + + private int resultSetRowCount(BigQueryJsonResultSet resultSet) throws SQLException { + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + } + return rowCount; + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStructTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStructTest.java new file mode 100644 index 0000000000..f07d8cad27 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJsonStructTest.java @@ -0,0 +1,264 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.FieldValue.Attribute.PRIMITIVE; +import static com.google.cloud.bigquery.FieldValue.Attribute.RECORD; +import static com.google.cloud.bigquery.StandardSQLTypeName.BIGNUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.BOOL; +import static com.google.cloud.bigquery.StandardSQLTypeName.BYTES; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATE; +import static com.google.cloud.bigquery.StandardSQLTypeName.DATETIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.FLOAT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.GEOGRAPHY; +import static com.google.cloud.bigquery.StandardSQLTypeName.INT64; +import static com.google.cloud.bigquery.StandardSQLTypeName.NUMERIC; +import static com.google.cloud.bigquery.StandardSQLTypeName.STRING; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIME; +import static com.google.cloud.bigquery.StandardSQLTypeName.TIMESTAMP; +import static com.google.cloud.bigquery.jdbc.BigQueryErrorMessage.CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.arraySchemaAndValue; +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.primitiveSchemaAndValue; +import static com.google.common.io.BaseEncoding.base64; +import static com.google.common.truth.Truth.assertThat; +import static java.time.Month.MARCH; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.jdbc.rules.TimeZoneRule; +import com.google.common.io.BaseEncoding; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.Date; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +public class BigQueryJsonStructTest { + + @Rule public final TimeZoneRule timeZoneRule = new TimeZoneRule("UTC"); + + private Struct structWithPrimitiveValues; + private Struct structWithNullValue; + + @Before + public void setUp() { + List> schemaAndValues = + Arrays.asList( + primitiveSchemaAndValue(INT64, "10"), + primitiveSchemaAndValue(BOOL, "true"), + primitiveSchemaAndValue(FLOAT64, "11.2"), + primitiveSchemaAndValue(NUMERIC, "11.2657"), + primitiveSchemaAndValue(BIGNUMERIC, "11.2657"), + primitiveSchemaAndValue(STRING, "one"), + primitiveSchemaAndValue(TIMESTAMP, "1680174859.8200000"), // 2023-03-30 16:44:19.82 + primitiveSchemaAndValue(DATE, "2023-03-30"), + primitiveSchemaAndValue(TIME, "11:14:19.820000"), + primitiveSchemaAndValue(DATETIME, "2023-03-30T11:14:19.8200000"), + primitiveSchemaAndValue(GEOGRAPHY, "POINT(-122 47)"), + primitiveSchemaAndValue(BYTES, base64().encode("one".getBytes()))); + List orderedSchemas = + schemaAndValues.stream().map(Tuple::x).collect(Collectors.toList()); + List orderedValues = + schemaAndValues.stream().map(Tuple::y).collect(Collectors.toList()); + + structWithPrimitiveValues = + new BigQueryJsonStruct( + FieldList.of(orderedSchemas), FieldValue.of(RECORD, FieldValueList.of(orderedValues))); + structWithNullValue = + new BigQueryJsonStruct(FieldList.of(orderedSchemas), FieldValue.of(PRIMITIVE, null)); + } + + @Test + public void structOfPrimitives() throws SQLException { + assertThat(structWithPrimitiveValues.getAttributes()) + .isEqualTo( + Arrays.asList( + 10L, + true, + 11.2, + new BigDecimal("11.2657"), + new BigDecimal("11.2657"), + "one", + Timestamp.valueOf(LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820000000)), + Date.valueOf(LocalDate.of(2023, MARCH, 30)), + new Time( + TimeUnit.NANOSECONDS.toMillis( + LocalTime.parse("11:14:19.820").toNanoOfDay())), + Timestamp.valueOf("2023-03-30 11:14:19.8200000"), + "POINT(-122 47)", + "one".getBytes()) + .toArray()); + } + + @Test + public void structOfArrays() throws SQLException { + LocalDateTime aTimeStamp = LocalDateTime.of(2023, MARCH, 30, 11, 14, 19, 820000000); + LocalDate aDate = LocalDate.of(2023, MARCH, 30); + LocalTime aTime = LocalTime.of(11, 14, 19, 820000000); + List> schemaAndValues = + Arrays.asList( + arraySchemaAndValue(INT64, "10", "20"), + arraySchemaAndValue(BOOL, "true", "false"), + arraySchemaAndValue(FLOAT64, "11.2", "33.4"), + arraySchemaAndValue(NUMERIC, "11.2657", "33.4657"), + arraySchemaAndValue(BIGNUMERIC, "11.2657", "33.4657"), + arraySchemaAndValue(STRING, "one", "two"), + arraySchemaAndValue(TIMESTAMP, "1680174859.820000", "1680261259.820000"), + arraySchemaAndValue(DATE, "2023-03-30", "2023-03-31"), + arraySchemaAndValue(TIME, "11:14:19.820000", "11:14:20.820000"), + arraySchemaAndValue( + DATETIME, "2023-03-30T11:14:19.820000", "2023-03-30T11:15:19.820000"), + arraySchemaAndValue(GEOGRAPHY, "POINT(-122 47)", "POINT(-122 48)"), + arraySchemaAndValue( + BYTES, + Stream.of("one", "two") + .map(s -> BaseEncoding.base64().encode(s.getBytes())) + .toArray(String[]::new))); + + List orderedSchemas = + schemaAndValues.stream().map(Tuple::x).collect(Collectors.toList()); + List orderedValues = + schemaAndValues.stream().map(Tuple::y).collect(Collectors.toList()); + + Struct struct = + new BigQueryJsonStruct( + FieldList.of(orderedSchemas), FieldValue.of(RECORD, FieldValueList.of(orderedValues))); + + Object[] attributes = struct.getAttributes(); + assertThat(((Array) attributes[0]).getArray()).isEqualTo(new Long[] {10L, 20L}); + assertThat(((Array) attributes[1]).getArray()).isEqualTo(new Boolean[] {true, false}); + assertThat(((Array) attributes[2]).getArray()).isEqualTo(new Double[] {11.2, 33.4}); + assertThat(((Array) attributes[3]).getArray()) + .isEqualTo(new BigDecimal[] {new BigDecimal("11.2657"), new BigDecimal("33.4657")}); + assertThat(((Array) attributes[4]).getArray()) + .isEqualTo(new BigDecimal[] {new BigDecimal("11.2657"), new BigDecimal("33.4657")}); + assertThat(((Array) attributes[5]).getArray()).isEqualTo(new String[] {"one", "two"}); + assertThat(((Array) attributes[6]).getArray()) + .isEqualTo( + new Timestamp[] { + Timestamp.valueOf(aTimeStamp), // 2023-03-30 16:44:19.82 + Timestamp.valueOf(aTimeStamp.plusDays(1)) + }); + assertThat(((Array) attributes[7]).getArray()) + .isEqualTo(new Date[] {Date.valueOf(aDate), Date.valueOf(aDate.plusDays(1))}); + assertThat(((Array) attributes[8]).getArray()) + .isEqualTo( + new Time[] { + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.toNanoOfDay())), + new Time(TimeUnit.NANOSECONDS.toMillis(aTime.plusSeconds(1).toNanoOfDay())) + }); + assertThat(((Array) attributes[9]).getArray()) // DATETIME + .isEqualTo( + new Timestamp[] { + Timestamp.valueOf("2023-03-30 11:14:19.820000"), + Timestamp.valueOf("2023-03-30 11:15:19.820000") + }); + assertThat(((Array) attributes[10]).getArray()) + .isEqualTo(new String[] {"POINT(-122 47)", "POINT(-122 48)"}); + assertThat(((Array) attributes[11]).getArray()) + .isEqualTo(new byte[][] {"one".getBytes(), "two".getBytes()}); + } + + @Test + public void structOfStructs() throws SQLException { + FieldList profileSchema = + FieldList.of( + Field.of("name", LegacySQLTypeName.STRING), + Field.of("age", LegacySQLTypeName.INTEGER), + Field.of("adult", LegacySQLTypeName.BOOLEAN)); + FieldList addressSchema = + FieldList.of( + Field.of("state", LegacySQLTypeName.STRING), + Field.of("zip", LegacySQLTypeName.INTEGER)); + FieldList rootStructSchema = + FieldList.of( + Field.of("profile", LegacySQLTypeName.RECORD, profileSchema), + Field.of("address", LegacySQLTypeName.RECORD, addressSchema)); + + FieldValue profileValue = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList( + FieldValue.of(PRIMITIVE, "Arya"), + FieldValue.of(PRIMITIVE, "15"), + FieldValue.of(PRIMITIVE, "false")))); + FieldValue addressValue = + FieldValue.of( + Attribute.RECORD, + FieldValueList.of( + asList(FieldValue.of(PRIMITIVE, "Michigan"), FieldValue.of(PRIMITIVE, "49086")))); + + FieldValue rootStructValue = + FieldValue.of(RECORD, FieldValueList.of(asList(profileValue, addressValue))); + + Struct struct = new BigQueryJsonStruct(rootStructSchema, rootStructValue); + Object[] attributes = struct.getAttributes(); + Struct profileStruct = (Struct) attributes[0]; + Struct addressStruct = (Struct) attributes[1]; + + assertThat(profileStruct.getAttributes()).isEqualTo(asList("Arya", 15L, false).toArray()); + assertThat(addressStruct.getAttributes()).isEqualTo(asList("Michigan", 49086L).toArray()); + } + + @Test + public void structWithNullValue() throws SQLException { + assertThat(structWithNullValue.getAttributes()) + .isEqualTo( + Arrays.asList(0L, false, 0.0, null, null, null, null, null, null, null, null, null) + .toArray()); + } + + @Test + public void getSQLTypeNameIsNotSupported() { + Exception exception = + assertThrows( + SQLFeatureNotSupportedException.class, structWithPrimitiveValues::getSQLTypeName); + assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } + + @Test + public void getAttributesWithCustomTypeMappingsIsNotSupported() { + Exception exception = + assertThrows( + SQLFeatureNotSupportedException.class, + () -> structWithPrimitiveValues.getAttributes(emptyMap())); + assertThat(exception.getMessage()).isEqualTo(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandlerTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandlerTest.java new file mode 100644 index 0000000000..0dc085b602 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandlerTest.java @@ -0,0 +1,142 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.jdbc.BigQueryParameterHandler.BigQueryStatementParameterType; +import org.junit.Test; + +public class BigQueryParameterHandlerTest { + + @Test + public void testGetSetParameterByName() throws Exception { + BigQueryParameterHandler paramHandler = new BigQueryParameterHandler(2); + // Add Param 1 + paramHandler.setParameter( + "ParamKey1", "ParamValue1", String.class, BigQueryStatementParameterType.IN, -1); + String paramValue = (String) paramHandler.getParameter("ParamKey1"); + assertNotNull(paramValue); + assertEquals("ParamValue1", paramValue); + BigQueryStatementParameterType paramType = paramHandler.getParameterType("ParamKey1"); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.IN, paramType); + int scale = paramHandler.getParameterScale("ParamKey1"); + assertEquals(-1, scale); + assertEquals(String.class, paramHandler.getType("ParamKey1")); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType("ParamKey1")); + + // Add Param 2 + paramHandler.setParameter( + "ParamKey2", "ParamValue2", String.class, BigQueryStatementParameterType.INOUT, 1); + paramValue = (String) paramHandler.getParameter("ParamKey2"); + assertNotNull(paramValue); + assertEquals("ParamValue2", paramValue); + paramType = paramHandler.getParameterType("ParamKey2"); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.INOUT, paramType); + scale = paramHandler.getParameterScale("ParamKey2"); + assertEquals(1, scale); + assertEquals(String.class, paramHandler.getType("ParamKey2")); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType("ParamKey2")); + + // Update Param 1 + paramHandler.setParameter( + "ParamKey1", "ParamValue1-UPD", String.class, BigQueryStatementParameterType.OUT, 1); + paramValue = (String) paramHandler.getParameter("ParamKey1"); + assertNotNull(paramValue); + assertEquals("ParamValue1-UPD", paramValue); + paramType = paramHandler.getParameterType("ParamKey1"); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.OUT, paramType); + scale = paramHandler.getParameterScale("ParamKey1"); + assertEquals(1, scale); + assertEquals(String.class, paramHandler.getType("ParamKey1")); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType("ParamKey1")); + + // Update Param 2 + paramHandler.setParameter( + "ParamKey2", "ParamValue2-UPD", String.class, BigQueryStatementParameterType.INOUT, 2); + paramValue = (String) paramHandler.getParameter("ParamKey2"); + assertNotNull(paramValue); + assertEquals("ParamValue2-UPD", paramValue); + paramType = paramHandler.getParameterType("ParamKey2"); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.INOUT, paramType); + scale = paramHandler.getParameterScale("ParamKey2"); + assertEquals(2, scale); + assertEquals(String.class, paramHandler.getType("ParamKey2")); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType("ParamKey2")); + } + + @Test + public void testGetSetParameterByIndex() throws Exception { + BigQueryParameterHandler paramHandler = new BigQueryParameterHandler(2); + + // Add Param 1 + paramHandler.setParameter(1, "ParamValue1", String.class); + String value = (String) paramHandler.getParameter(1); + assertNotNull(value); + assertEquals("ParamValue1", value); + BigQueryStatementParameterType paramType = paramHandler.getParameterType(1); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.UNSPECIFIED, paramType); + assertEquals(String.class, paramHandler.getType(1)); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType(1)); + + // Add Param 2 + paramHandler.setParameter( + 2, "ParamValue2", String.class, BigQueryStatementParameterType.IN, -1); + value = (String) paramHandler.getParameter(2); + assertNotNull(value); + assertEquals("ParamValue2", value); + paramType = paramHandler.getParameterType(2); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.IN, paramType); + int scale = paramHandler.getParameterScale(2); + assertEquals(-1, scale); + assertEquals(String.class, paramHandler.getType(2)); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType(2)); + + // Update Param 1 + paramHandler.setParameter(1, "ParamValue1-UPD", String.class); + value = (String) paramHandler.getParameter(1); + assertNotNull(value); + assertEquals("ParamValue1-UPD", value); + paramType = paramHandler.getParameterType(1); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.UNSPECIFIED, paramType); + assertEquals(String.class, paramHandler.getType(1)); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType(1)); + + // Update Param 2 + paramHandler.setParameter( + 2, "ParamValue2-UPD", String.class, BigQueryStatementParameterType.OUT, 2); + value = (String) paramHandler.getParameter(2); + assertNotNull(value); + assertEquals("ParamValue2-UPD", value); + paramType = paramHandler.getParameterType(2); + assertNotNull(paramType); + assertEquals(BigQueryStatementParameterType.OUT, paramType); + scale = paramHandler.getParameterScale(2); + assertEquals(2, scale); + assertEquals(String.class, paramHandler.getType(2)); + assertEquals(StandardSQLTypeName.STRING, paramHandler.getSqlType(2)); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java new file mode 100644 index 0000000000..ee9d63beb9 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.utils.TestUtilities.TestConnectionListener; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; + +import java.io.IOException; +import java.sql.*; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryPooledConnectionTest { + private BigQueryConnection bigQueryConnection; + private static final Long LISTENER_POOL_SIZE = 10L; + + @Before + public void setUp() throws IOException, SQLException { + bigQueryConnection = mock(BigQueryConnection.class); + } + + @Test + public void testGetPooledConnection() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + } + + @Test + public void testPooledConnectionClose() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + connection.close(); + assertFalse(pooledConnection.inUse()); + } + + @Test + public void testReuseConnectionAfterClose() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + connection.close(); + assertFalse(pooledConnection.inUse()); + + connection = pooledConnection.getConnection(); + assertTrue(pooledConnection.inUse()); + } + + @Test + public void testAddConnectionListener() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + TestConnectionListener listner = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listner); + + assertTrue(pooledConnection.isListenerPooled(listner)); + } + + @Test + public void testRemoveConnectionListener() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + TestConnectionListener listner = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listner); + assertEquals(0, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + assertTrue(pooledConnection.isListenerPooled(listner)); + pooledConnection.removeConnectionEventListener(listner); + assertFalse(pooledConnection.isListenerPooled(listner)); + } + + @Test + public void testConnectionHandleClosedByConnection() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + TestConnectionListener listner = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listner); + assertEquals(0, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + connection.close(); + assertFalse(pooledConnection.inUse()); + assertEquals(1, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + assertTrue(pooledConnection.isListenerPooled(listner)); + } + + @Test + public void testConnectionHandleClosedByPooledConnection() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + TestConnectionListener listner = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listner); + assertEquals(0, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + pooledConnection.close(); + assertFalse(pooledConnection.inUse()); + assertEquals(1, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + assertTrue(pooledConnection.isListenerPooled(listner)); + } + + @Test + public void testFireConnectionError() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + TestConnectionListener listner = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listner); + assertEquals(0, listner.getConnectionClosedCount()); + assertEquals(0, listner.getConnectionErrorCount()); + + pooledConnection.fireConnectionError(new SQLException("test")); + assertFalse(pooledConnection.inUse()); + assertEquals(0, listner.getConnectionClosedCount()); + assertEquals(1, listner.getConnectionErrorCount()); + + assertFalse(pooledConnection.isListenerPooled(listner)); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizersTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizersTest.java new file mode 100644 index 0000000000..7332dce936 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetFinalizersTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Before; +import org.junit.Test; + +public class BigQueryResultSetFinalizersTest { + Thread arrowWorker; + Thread[] jsonWorkers; + + @Before + public void setUp() { + // create and start the demon threads + arrowWorker = + new Thread( + () -> { + while (true) { + if (Thread.currentThread().isInterrupted()) { + break; + } + } + }); + arrowWorker.setDaemon(true); + Thread jsonWorker = + new Thread( + () -> { + while (true) { + if (Thread.currentThread().isInterrupted()) { + break; + } + } + }); + jsonWorker.setDaemon(true); + jsonWorkers = new Thread[] {jsonWorker}; + arrowWorker.start(); + jsonWorker.start(); + } + + @Test + public void testFinalizeResources() { + BigQueryResultSetFinalizers.ArrowResultSetFinalizer arrowResultSetFinalizer = + new BigQueryResultSetFinalizers.ArrowResultSetFinalizer(null, null, arrowWorker); + arrowResultSetFinalizer.finalizeResources(); + assertThat(arrowWorker.isInterrupted()).isTrue(); + BigQueryResultSetFinalizers.JsonResultSetFinalizer jsonResultSetFinalizer = + new BigQueryResultSetFinalizers.JsonResultSetFinalizer(null, null, jsonWorkers); + jsonResultSetFinalizer.finalizeResources(); + assertThat(jsonWorkers[0].isInterrupted()).isTrue(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadataTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadataTest.java new file mode 100644 index 0000000000..b4d14296d1 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryResultSetMetadataTest.java @@ -0,0 +1,277 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.LegacySQLTypeName; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.common.collect.ImmutableList; +import java.sql.Array; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Types; +import java.util.List; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class BigQueryResultSetMetadataTest { + + private BigQueryStatement statement; + + private static Field tenthField = + Field.newBuilder("tenth", LegacySQLTypeName.NUMERIC) + .setName("tenth") + .setType(StandardSQLTypeName.NUMERIC) + .setPrecision(12L) + .setScale(9L) + .build(); + private static final FieldList fieldList = + FieldList.of( + Field.of("first", StandardSQLTypeName.BOOL), + Field.of("second", StandardSQLTypeName.INT64), + Field.of("third", StandardSQLTypeName.FLOAT64), + Field.of("fourth", StandardSQLTypeName.STRING), + Field.of("fifth", StandardSQLTypeName.TIMESTAMP), + Field.of("sixth", StandardSQLTypeName.BYTES), + Field.of("seventh", StandardSQLTypeName.STRING), + Field.newBuilder("eight", StandardSQLTypeName.STRING) + .setMode(Field.Mode.REPEATED) + .build(), + Field.of( + "ninth", + StandardSQLTypeName.STRUCT, + Field.of("first", StandardSQLTypeName.FLOAT64), + Field.of("second", StandardSQLTypeName.TIMESTAMP)), + tenthField, + Field.of("eleventh", StandardSQLTypeName.BIGNUMERIC), + Field.of("twelfth", LegacySQLTypeName.TIME), + Field.of("thirteenth", LegacySQLTypeName.DATE)); + + private static final List fieldListSqlTypes = + ImmutableList.of( + Types.BOOLEAN, + Types.BIGINT, + Types.DOUBLE, + Types.NVARCHAR, + Types.TIMESTAMP, + Types.VARBINARY, + Types.NVARCHAR, + Types.ARRAY, + Types.STRUCT, + Types.NUMERIC, + Types.NUMERIC, + Types.TIME, + Types.DATE); + + private static final List fieldListClassNames = + ImmutableList.of( + "java.lang.Boolean", + "java.lang.Long", + "java.lang.Double", + "java.lang.String", + "java.sql.Timestamp", + byte[].class.getName(), + "java.lang.String", + Array.class.getName(), + "java.sql.Struct", + "java.math.BigDecimal", + "java.math.BigDecimal", + "java.sql.Time", + "java.sql.Date"); + private static final Schema QUERY_SCHEMA = Schema.of(fieldList); + + private ResultSetMetaData resultSetMetaData; + + private ResultSetMetaData resultSetMetaDataNested; + + @Before + public void setUp() throws SQLException { + statement = mock(BigQueryStatement.class); + Thread[] workerThreads = {new Thread()}; + BigQueryJsonResultSet bigQueryJsonResultSet = + BigQueryJsonResultSet.of(QUERY_SCHEMA, 1L, null, statement, workerThreads); + // values for nested types + resultSetMetaData = bigQueryJsonResultSet.getMetaData(); + + // values for nested types + Field fieldEight = fieldList.get("eight"); + // The schema for the nested result set should describe the elements of the array. + Field elementField = fieldEight.toBuilder().setMode(Field.Mode.NULLABLE).build(); + FieldList nestedFieldList = FieldList.of(elementField); + BigQueryFieldValueListWrapper bigQueryFieldValueListWrapperNested = + BigQueryFieldValueListWrapper.getNestedFieldValueListWrapper(nestedFieldList, null); + BigQueryJsonResultSet bigQueryJsonResultSetNested = + BigQueryJsonResultSet.getNestedResultSet( + Schema.of(nestedFieldList), bigQueryFieldValueListWrapperNested, -1, -1); + resultSetMetaDataNested = bigQueryJsonResultSetNested.getMetaData(); + } + + @Test + public void testGetColumnType() throws SQLException { + // match the mapping for all the types in the test dataset + for (int colIndex = 1; colIndex <= 13; colIndex++) { + assertThat(resultSetMetaData.getColumnType(colIndex)) + .isEqualTo(fieldListSqlTypes.get(colIndex - 1)); + } + } + + @Test + public void testGetColumnTypeName() throws SQLException { + assertThat(resultSetMetaData.getColumnTypeName(1)).isEqualTo("BOOL"); + assertThat(resultSetMetaData.getColumnTypeName(2)).isEqualTo("INT64"); + assertThat(resultSetMetaData.getColumnTypeName(3)).isEqualTo("FLOAT64"); + assertThat(resultSetMetaData.getColumnTypeName(4)).isEqualTo("STRING"); + assertThat(resultSetMetaData.getColumnTypeName(5)).isEqualTo("TIMESTAMP"); + assertThat(resultSetMetaData.getColumnTypeName(6)).isEqualTo("BYTES"); + assertThat(resultSetMetaData.getColumnTypeName(7)).isEqualTo("STRING"); + assertThat(resultSetMetaData.getColumnTypeName(8)).isEqualTo("ARRAY"); + assertThat(resultSetMetaData.getColumnTypeName(9)).isEqualTo("STRUCT"); + assertThat(resultSetMetaData.getColumnTypeName(10)).isEqualTo("NUMERIC"); + assertThat(resultSetMetaData.getColumnTypeName(11)).isEqualTo("BIGNUMERIC"); + assertThat(resultSetMetaData.getColumnTypeName(12)).isEqualTo("TIME"); + assertThat(resultSetMetaData.getColumnTypeName(13)).isEqualTo("DATE"); + } + + @Test + public void testColumnClassName() + throws SQLException { // match the mapping for all the types in the test dataset + for (int colIndex = 1; colIndex <= 13; colIndex++) { + assertThat(resultSetMetaData.getColumnClassName(colIndex)) + .isEqualTo(fieldListClassNames.get(colIndex - 1)); + } + } + + @Test + public void testResultSetMetadataProperties() throws SQLException { + assertThat(resultSetMetaData).isNotNull(); + assertThat(resultSetMetaData.getColumnCount()).isEqualTo(13); + assertThat(resultSetMetaData.isAutoIncrement(1)).isFalse(); + assertThat(resultSetMetaData.isSearchable(4)).isTrue(); + assertThat(resultSetMetaData.isCurrency(4)).isFalse(); + assertThat(resultSetMetaData.isReadOnly(4)).isFalse(); + assertThat(resultSetMetaData.isDefinitelyWritable(4)).isFalse(); + assertThat(resultSetMetaData.isWritable(4)).isTrue(); + assertThat(resultSetMetaData.isNullable(4)).isEqualTo(ResultSetMetaData.columnNullableUnknown); + } + + @Test + public void testPrecision() throws SQLException { + assertThat(resultSetMetaData.getPrecision(10)).isEqualTo(12L); + assertThat(resultSetMetaData.getPrecision(1)) + .isEqualTo(0); // schema doesn't have this info, should be defaulted to 0 + } + + @Test + public void testSigned() throws SQLException { + assertThat(resultSetMetaData.isSigned(4)).isFalse(); + assertThat(resultSetMetaData.isSigned(2)).isTrue(); + } + + @Test + public void testCheckNameLabelCatalog() throws SQLException { + assertThat(resultSetMetaData.getColumnLabel(1)).isEqualTo("first"); + assertThat(resultSetMetaData.getColumnName(10)).isEqualTo("tenth"); + assertThat(resultSetMetaData.getColumnName(10)).isEqualTo("tenth"); + assertThat(resultSetMetaData.getSchemaName(10)).isEqualTo(""); + assertThat(resultSetMetaData.getCatalogName(10)).isEqualTo(""); + } + + @Test + public void testCheckCaseSensitive() throws SQLException { + assertThat(resultSetMetaData.isCaseSensitive(2)).isFalse(); + assertThat(resultSetMetaData.isCaseSensitive(4)).isTrue(); + } + + @Test + public void testScale() throws SQLException { + assertThat(resultSetMetaData.getScale(10)).isEqualTo(9L); + assertThat(resultSetMetaData.getScale(4)).isEqualTo(0L); + } + + @Test + public void testColumnDisplaySize() throws SQLException { + assertThat(resultSetMetaData.getColumnDisplaySize(1)).isEqualTo(5); + assertThat(resultSetMetaData.getColumnDisplaySize(13)).isEqualTo(10); + assertThat(resultSetMetaData.getColumnDisplaySize(2)).isEqualTo(10); + assertThat(resultSetMetaData.getColumnDisplaySize(3)).isEqualTo(14); + assertThat(resultSetMetaData.getColumnDisplaySize(12)).isEqualTo(50); + assertThat(resultSetMetaData.getColumnDisplaySize(5)).isEqualTo(16); + } + + // Nested Types + + @Test + public void testResultSetMetaDataNestedColType() throws SQLException { + assertThat(resultSetMetaDataNested).isNotNull(); + assertThat(resultSetMetaDataNested.getColumnType(1)).isEqualTo(Types.NVARCHAR); + assertThat(resultSetMetaDataNested.getColumnClassName(1)).isEqualTo("java.lang.String"); + } + + @Test + public void testNestedresultSetMetaDataNestedProperties() throws SQLException { + assertThat(resultSetMetaDataNested.getColumnCount()).isEqualTo(1); + assertThat(resultSetMetaDataNested.isAutoIncrement(1)).isFalse(); + assertThat(resultSetMetaDataNested.isSearchable(1)).isTrue(); + assertThat(resultSetMetaDataNested.isCurrency(1)).isFalse(); + assertThat(resultSetMetaDataNested.isReadOnly(1)).isFalse(); + assertThat(resultSetMetaDataNested.isDefinitelyWritable(1)).isFalse(); + assertThat(resultSetMetaDataNested.isWritable(1)).isTrue(); + assertThat(resultSetMetaDataNested.isNullable(1)).isEqualTo(ResultSetMetaData.columnNullable); + } + + @Test + public void testNestedPrecision() throws SQLException { + assertThat(resultSetMetaDataNested.getPrecision(1)) + .isEqualTo(0); // schema doesn't have this info, should be defaulted to 0 + } + + @Test + public void testNestedSigned() throws SQLException { + assertThat(resultSetMetaDataNested.isSigned(1)).isFalse(); + } + + @Test + public void testNestedCheckNameLabelCatalog() throws SQLException { + assertThat(resultSetMetaDataNested.getColumnLabel(1)).isEqualTo("eight"); + assertThat(resultSetMetaDataNested.getColumnName(1)).isEqualTo("eight"); + assertThat(resultSetMetaDataNested.getSchemaName(1)).isEqualTo(""); + assertThat(resultSetMetaDataNested.getCatalogName(1)).isEqualTo(""); + } + + @Test + public void testNestedCheckCaseSensitive() throws SQLException { + assertThat(resultSetMetaDataNested.isCaseSensitive(1)).isTrue(); + } + + @Test + public void testNestedScale() throws SQLException { + assertThat(resultSetMetaDataNested.getScale(1)).isEqualTo(0L); + } + + @Test + public void testNestedColumnDisplaySize() throws SQLException { + assertThat(resultSetMetaDataNested.getColumnDisplaySize(1)).isEqualTo(50); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java new file mode 100644 index 0000000000..22dc072192 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryStatementTest.java @@ -0,0 +1,483 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.jdbc.utils.ArrowUtilities.serializeSchema; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQuery.QueryResultsOption; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobId; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.JobStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics; +import com.google.cloud.bigquery.JobStatistics.QueryStatistics.StatementType; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.Priority; +import com.google.cloud.bigquery.Schema; +import com.google.cloud.bigquery.StandardSQLTypeName; +import com.google.cloud.bigquery.TableId; +import com.google.cloud.bigquery.TableResult; +import com.google.cloud.bigquery.jdbc.BigQueryStatement.JobIdWrapper; +import com.google.cloud.bigquery.spi.BigQueryRpcFactory; +import com.google.cloud.bigquery.storage.v1.ArrowSchema; +import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; +import com.google.cloud.bigquery.storage.v1.CreateReadSessionRequest; +import com.google.cloud.bigquery.storage.v1.ReadSession; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.BlockingQueue; +import org.apache.arrow.memory.RootAllocator; +import org.apache.arrow.vector.BitVector; +import org.apache.arrow.vector.FieldVector; +import org.apache.arrow.vector.IntVector; +import org.apache.arrow.vector.VectorSchemaRoot; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; + +public class BigQueryStatementTest { + + private BigQueryConnection bigQueryConnection; + private static final String PROJECT = "project"; + + private BigQueryRpcFactory rpcFactoryMock; + + private BigQueryReadClient storageReadClient; + + private BigQuery bigquery; + + private BigQueryStatement bigQueryStatement; + + private final String query = "select * from test"; + + private final String jobIdVal = UUID.randomUUID().toString(); + + private JobId jobId; + + private static final FieldList fieldList = + FieldList.of( + Field.of("first", StandardSQLTypeName.BOOL), + Field.of("second", StandardSQLTypeName.INT64)); + + private static final String DEFAULT_TEST_DATASET = "bigquery_test_dataset"; + + private static final TableId TABLE_ID = TableId.of(DEFAULT_TEST_DATASET, PROJECT); + + private static ArrowSchema arrowSchema; + + private final Map LABELS = + new HashMap() { + { + put("key1", "val1"); + put("key2", "val2"); + put("key3", "val3"); + } + }; + + private Job getJobMock( + TableResult result, QueryJobConfiguration configuration, StatementType type) + throws InterruptedException { + Job job = mock(Job.class); + JobStatistics.QueryStatistics statistics = mock(QueryStatistics.class); + JobId jobId = mock(JobId.class); + doReturn(result).when(job).getQueryResults(any(QueryResultsOption.class)); + doReturn(jobId).when(job).getJobId(); + doReturn(configuration).when(job).getConfiguration(); + doReturn(statistics).when(job).getStatistics(); + doReturn(type).when(statistics).getStatementType(); + return job; + } + + @Before + public void setUp() throws IOException, SQLException { + bigQueryConnection = mock(BigQueryConnection.class); + rpcFactoryMock = mock(BigQueryRpcFactory.class); + bigquery = mock(BigQuery.class); + bigQueryConnection.bigQuery = bigquery; + storageReadClient = mock(BigQueryReadClient.class); + jobId = JobId.newBuilder().setJob(jobIdVal).build(); + + doReturn(bigquery).when(bigQueryConnection).getBigQuery(); + doReturn(10L).when(bigQueryConnection).getJobTimeoutInSeconds(); + doReturn(10L).when(bigQueryConnection).getMaxBytesBilled(); + doReturn(LABELS).when(bigQueryConnection).getLabels(); + doReturn(BigQueryJdbcUrlUtility.DEFAULT_QUERY_DIALECT_VALUE) + .when(bigQueryConnection) + .getQueryDialect(); + doReturn(1000L).when(bigQueryConnection).getMaxResults(); + bigQueryStatement = new BigQueryStatement(bigQueryConnection); + VectorSchemaRoot vectorSchemaRoot = getTestVectorSchemaRoot(); + arrowSchema = + ArrowSchema.newBuilder() + .setSerializedSchema(serializeSchema(vectorSchemaRoot.getSchema())) + .build(); + // bigQueryConnection.addOpenStatements(bigQueryStatement); + + } + + private VectorSchemaRoot getTestVectorSchemaRoot() { + RootAllocator allocator = new RootAllocator(); + BitVector boolField = + new BitVector("boolField", allocator); // Mapped with StandardSQLTypeName.BOOL + boolField.allocateNew(2); + boolField.set(0, 0); + boolField.setValueCount(1); + IntVector int64Filed = + new IntVector("int64Filed", allocator); // Mapped with StandardSQLTypeName.INT64 + int64Filed.allocateNew(2); + int64Filed.set(0, 1); + int64Filed.setValueCount(1); + List fieldVectors = ImmutableList.of(boolField, int64Filed); + return new VectorSchemaRoot(fieldVectors); + } + + private BigQueryOptions createBigQueryOptionsForProject( + String project, BigQueryRpcFactory rpcFactory) { + return BigQueryOptions.newBuilder() + .setProjectId(project) + .setServiceRpcFactory(rpcFactory) + .setRetrySettings(ServiceOptions.getNoRetrySettings()) + .build(); + } + + @Test + public void testStatementNonNull() { + assertThat(bigQueryStatement).isNotNull(); + } + + @Ignore + public void testExecFastQueryPath() throws SQLException, InterruptedException { + JobIdWrapper jobIdWrapper = new JobIdWrapper(jobId, null, null); + BigQueryStatement bigQueryStatementSpy = Mockito.spy(bigQueryStatement); + + TableResult result = Mockito.mock(TableResult.class); + BigQueryJsonResultSet jsonResultSet = mock(BigQueryJsonResultSet.class); + QueryJobConfiguration jobConfiguration = QueryJobConfiguration.newBuilder(query).build(); + + doReturn(result).when(bigquery).query(jobConfiguration); + doReturn(jsonResultSet).when(bigQueryStatementSpy).processJsonResultSet(result); + + bigQueryStatementSpy.runQuery(query, jobConfiguration); + // verify the statement's state + assertThat(bigQueryStatementSpy.jobIds.size()).isEqualTo(1); // job id should be created + assertThat(bigQueryStatementSpy.jobIds.get(0)).isNotNull(); + // assertThat(bigQueryStatementSpy.currentResultSet).isNotNull(); + + } + + @Test + public void testExecSlowQueryPath() throws SQLException, InterruptedException { + JobIdWrapper jobIdWrapper = new JobIdWrapper(jobId, null, null); + BigQueryStatement bigQueryStatementSpy = Mockito.spy(bigQueryStatement); + TableResult tableResult = mock(TableResult.class); + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(query) + .setPriority(Priority.BATCH) // query settings for slow query path + .build(); + Job job = getJobMock(tableResult, queryJobConfiguration, StatementType.SELECT); + + doReturn(job).when(bigquery).create(any(JobInfo.class)); + + doReturn(jobIdWrapper) + .when(bigQueryStatementSpy) + .insertJob(any(com.google.cloud.bigquery.JobConfiguration.class)); + doReturn(false).when(bigQueryStatementSpy).useReadAPI(eq(tableResult)); + doReturn(mock(JobId.class)).when(tableResult).getJobId(); + + ResultSet bigQueryJsonResultSet = mock(BigQueryJsonResultSet.class); + + doReturn(bigQueryJsonResultSet) + .when(bigQueryStatementSpy) + .processJsonResultSet(any(TableResult.class)); + + bigQueryStatementSpy.runQuery(query, queryJobConfiguration); + // verify the statement's state + // job id is created during runQuery, but cleaned up after function completes. + assertThat(bigQueryStatementSpy.jobIds.size()).isEqualTo(0); + assertThat(bigQueryStatementSpy.getResultSet()).isEqualTo(bigQueryJsonResultSet); + } + + @Test + public void getArrowResultSetTest() throws SQLException { + BigQueryStatement bigQueryStatementSpy = Mockito.spy(bigQueryStatement); + BigQueryReadClient bigQueryReadClient = Mockito.spy(mock(BigQueryReadClient.class)); + Schema schema = Schema.of(fieldList); + ReadSession readSession = ReadSession.getDefaultInstance(); + doReturn(bigQueryReadClient).when(bigQueryStatementSpy).getBigQueryReadClient(); + doReturn(readSession) + .when(bigQueryStatementSpy) + .getReadSession(any(CreateReadSessionRequest.class)); + Thread mockWorker = new Thread(); + doReturn(mockWorker) + .when(bigQueryStatementSpy) + .populateArrowBufferedQueue( + any(ReadSession.class), any(BlockingQueue.class), any(BigQueryReadClient.class)); + + doReturn(arrowSchema).when(bigQueryStatementSpy).getArrowSchema(any(ReadSession.class)); + + JobId jobId = JobId.of("123"); + TableResult result = Mockito.mock(TableResult.class); + doReturn(schema).when(result).getSchema(); + doReturn(10L).when(result).getTotalRows(); + doReturn(TABLE_ID).when(bigQueryStatementSpy).getDestinationTable(any()); + doReturn(jobId).when(result).getJobId(); + Job job = mock(Job.class); + doReturn(mock(QueryStatistics.class)).when(job).getStatistics(); + doReturn(job).when(bigquery).getJob(jobId); + + ResultSet resultSet = bigQueryStatementSpy.processArrowResultSet(result); + assertThat(resultSet).isNotNull(); + assertThat(resultSet).isInstanceOf(BigQueryArrowResultSet.class); + assertThat(resultSet.isLast()).isFalse(); // as we have 10 rows + } + + @Test + public void getJobTimeoutTest() throws Exception { + QueryJobConfiguration jobConfig = bigQueryStatement.getJobConfig("select 1").build(); + assertEquals(10000L, jobConfig.getJobTimeoutMs().longValue()); + } + + @Test + public void getMaxBytesBilledTest() throws Exception { + QueryJobConfiguration jobConfig = bigQueryStatement.getJobConfig("select 1").build(); + assertEquals(10L, jobConfig.getMaximumBytesBilled().longValue()); + } + + @Test + public void testSetMaxRowsJson() throws SQLException { + assertEquals(0, bigQueryStatement.getMaxRows()); + bigQueryStatement.setMaxRows(10); + assertEquals(10, bigQueryStatement.getMaxRows()); + } + + @Test + public void setQueryTimeoutTest() throws Exception { + bigQueryStatement.setQueryTimeout(3); + BigQueryStatement bigQueryStatementSpy = Mockito.spy(bigQueryStatement); + + TableResult result = Mockito.mock(TableResult.class); + BigQueryJsonResultSet jsonResultSet = mock(BigQueryJsonResultSet.class); + QueryJobConfiguration jobConfiguration = + QueryJobConfiguration.newBuilder(query).setJobTimeoutMs(10000L).build(); + + Job job = getJobMock(result, jobConfiguration, StatementType.SELECT); + doReturn(job).when(bigquery).create(any(JobInfo.class)); + + doReturn(jsonResultSet).when(bigQueryStatementSpy).processJsonResultSet(result); + ArgumentCaptor captor = ArgumentCaptor.forClass(JobInfo.class); + + bigQueryStatementSpy.runQuery(query, jobConfiguration); + verify(bigquery).create(captor.capture()); + QueryJobConfiguration jobConfig = captor.getValue().getConfiguration(); + assertEquals(3000L, jobConfig.getJobTimeoutMs().longValue()); + } + + @Test + public void getLabelsTest() throws Exception { + QueryJobConfiguration jobConfig = bigQueryStatement.getJobConfig("select 1").build(); + Map expected = + new HashMap() { + { + put("key1", "val1"); + put("key2", "val2"); + put("key3", "val3"); + } + }; + + assertTrue(Maps.difference(expected, jobConfig.getLabels()).areEqual()); + } + + @Test + public void getUpdateCountTest() { + bigQueryStatement.setUpdateCount(100L); + assertEquals(100, bigQueryStatement.getUpdateCount()); + assertEquals(100L, bigQueryStatement.getLargeUpdateCount()); + } + + @Test + public void testSetExtraLabels() { + Map extraLabels = new HashMap<>(); + extraLabels.put("extraKey1", "extraVal1"); + bigQueryStatement.setExtraLabels(extraLabels); + assertEquals(extraLabels, bigQueryStatement.getExtraLabels()); + } + + @Test + public void testGetJobConfigWithExtraLabels() { + Map extraLabels = new HashMap<>(); + extraLabels.put("extraKey1", "extraVal1"); + extraLabels.put("key1", "overrideVal1"); // Override connection label + bigQueryStatement.setExtraLabels(extraLabels); + + QueryJobConfiguration jobConfig = bigQueryStatement.getJobConfig("select 1").build(); + Map expectedLabels = new HashMap<>(); + expectedLabels.put("key1", "overrideVal1"); + expectedLabels.put("key2", "val2"); + expectedLabels.put("key3", "val3"); + expectedLabels.put("extraKey1", "extraVal1"); + + assertTrue(Maps.difference(expectedLabels, jobConfig.getLabels()).areEqual()); + } + + @Test + public void testJoblessQuery() throws SQLException, InterruptedException { + // 1. Test JobCreationMode=2 (jobless) + doReturn(true).when(bigQueryConnection).getUseStatelessQueryMode(); + BigQueryStatement joblessStatement = new BigQueryStatement(bigQueryConnection); + BigQueryStatement joblessStatementSpy = Mockito.spy(joblessStatement); + + TableResult tableResultMock = mock(TableResult.class); + doReturn("queryId").when(tableResultMock).getQueryId(); + doReturn(null).when(tableResultMock).getJobId(); + doReturn(tableResultMock) + .when(bigquery) + .queryWithTimeout(any(QueryJobConfiguration.class), any(), any()); + doReturn(mock(BigQueryJsonResultSet.class)) + .when(joblessStatementSpy) + .processJsonResultSet(tableResultMock); + + Job dryRunJobMock = getJobMock(null, null, StatementType.SELECT); + ArgumentCaptor dryRunCaptor = ArgumentCaptor.forClass(JobInfo.class); + doReturn(dryRunJobMock).when(bigquery).create(dryRunCaptor.capture()); + + joblessStatementSpy.executeQuery("SELECT 1"); + + verify(bigquery).queryWithTimeout(any(QueryJobConfiguration.class), any(), any()); + verify(bigquery).create(any(JobInfo.class)); + assertTrue( + Boolean.TRUE.equals( + ((QueryJobConfiguration) dryRunCaptor.getValue().getConfiguration()).dryRun())); + + // 2. Test JobCreationMode=1 (jobful) + Mockito.reset(bigquery); + doReturn(false).when(bigQueryConnection).getUseStatelessQueryMode(); + BigQueryStatement jobfulStatement = new BigQueryStatement(bigQueryConnection); + BigQueryStatement jobfulStatementSpy = Mockito.spy(jobfulStatement); + + TableResult tableResultJobfulMock = mock(TableResult.class); + QueryJobConfiguration jobConf = QueryJobConfiguration.newBuilder("SELECT 1").build(); + Job jobMock = getJobMock(tableResultJobfulMock, jobConf, StatementType.SELECT); + ArgumentCaptor jobfulCaptor = ArgumentCaptor.forClass(JobInfo.class); + doReturn(jobMock).when(bigquery).create(jobfulCaptor.capture()); + doReturn(mock(BigQueryJsonResultSet.class)) + .when(jobfulStatementSpy) + .processJsonResultSet(tableResultJobfulMock); + + jobfulStatementSpy.executeQuery("SELECT 1"); + + verify(bigquery).create(any(JobInfo.class)); + assertTrue( + jobfulCaptor.getAllValues().stream() + .noneMatch( + jobInfo -> + Boolean.TRUE.equals( + ((QueryJobConfiguration) jobInfo.getConfiguration()).dryRun()))); + verify(bigquery, Mockito.never()) + .queryWithTimeout(any(QueryJobConfiguration.class), any(), any()); + } + + @Test + public void testCloseCancelsJob() throws SQLException, InterruptedException { + BigQueryStatement bigQueryStatementSpy = Mockito.spy(bigQueryStatement); + TableResult tableResult = mock(TableResult.class); + Schema mockSchema = Schema.of(FieldList.of()); + doReturn(mockSchema).when(tableResult).getSchema(); + QueryJobConfiguration queryJobConfiguration = + QueryJobConfiguration.newBuilder(query).setPriority(Priority.BATCH).build(); + Job job = getJobMock(tableResult, queryJobConfiguration, StatementType.SELECT); + + doReturn(job).when(bigquery).create(any(JobInfo.class)); + doReturn(false).when(bigQueryStatementSpy).useReadAPI(eq(tableResult)); + doReturn(mock(JobId.class)).when(tableResult).getJobId(); + Mockito.when(job.getQueryResults(any(QueryResultsOption.class))) + .thenAnswer( + invocation -> { + Thread.sleep(2000); + return null; + }); + Thread t = + new Thread( + () -> { + try { + bigQueryStatementSpy.runQuery(query, queryJobConfiguration); + } catch (Exception e) { + } + }); + + t.start(); + // Sleep to allow background thread to call "create". + Thread.sleep(500); + bigQueryStatementSpy.close(); + t.join(); + verify(bigquery, Mockito.times(1)).cancel(any(JobId.class)); + } + + @Test + public void testCancelWithJoblessQuery() throws SQLException, InterruptedException { + doReturn(true).when(bigQueryConnection).getUseStatelessQueryMode(); + BigQueryStatement joblessStatement = new BigQueryStatement(bigQueryConnection); + BigQueryStatement joblessStatementSpy = Mockito.spy(joblessStatement); + + TableResult tableResultMock = mock(TableResult.class); + doReturn(null).when(tableResultMock).getJobId(); + + doReturn(tableResultMock) + .when(bigquery) + .queryWithTimeout(any(QueryJobConfiguration.class), any(), any()); + + Job dryRunJobMock = getJobMock(null, null, StatementType.SELECT); + doReturn(dryRunJobMock).when(bigquery).create(any(JobInfo.class)); + + BigQueryJsonResultSet resultSetMock = mock(BigQueryJsonResultSet.class); + doReturn(resultSetMock).when(joblessStatementSpy).processJsonResultSet(tableResultMock); + + joblessStatementSpy.executeQuery("SELECT 1"); + + // Pre-check: statement has a result set + assertTrue(joblessStatementSpy.currentResultSet != null); + + joblessStatementSpy.cancel(); + + // Post-check: The result set's close() method was called + verify(resultSetMock).close(); + + // And no backend cancellation was attempted + verify(bigquery, Mockito.never()).cancel(any(JobId.class)); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactoryTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactoryTest.java new file mode 100644 index 0000000000..d271df0e26 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactoryTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; + +import java.util.concurrent.ThreadFactory; +import org.junit.Before; +import org.junit.Test; + +public class BigQueryThreadFactoryTest { + + private static ThreadFactory JDBC_THREAD_FACTORY; + + @Before + public void setUp() { + JDBC_THREAD_FACTORY = new BigQueryThreadFactory("BigQuery-Thread-"); + } + + @Test + public void testNewThread() { + assertThat(JDBC_THREAD_FACTORY).isNotNull(); + Thread thread = JDBC_THREAD_FACTORY.newThread(() -> {}); + assertThat(thread).isNotNull(); + assertThat(thread.getName()).startsWith("BigQuery-Thread-"); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerTest.java new file mode 100644 index 0000000000..a758cf15c0 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercerTest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionException; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionNotFoundException; +import com.google.cloud.bigquery.jdbc.TestType.Text; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.function.Function; +import org.junit.Test; + +public class BigQueryTypeCoercerTest { + + @Test + public void shouldReturnSameValueWhenTargetTypeIsSameAsSourceType() { + assertThat(BigQueryTypeCoercer.INSTANCE.coerceTo(Integer.class, 56)).isEqualTo(56); + assertThat(BigQueryTypeCoercer.INSTANCE.coerceTo(Long.class, 56L)).isEqualTo(56L); + } + + @Test + public void shouldBeAbleToComposeMultipleCoercions() { + StringToBigDecimal stringToBigDecimal = new StringToBigDecimal(); + BigDecimalToBigInteger bigDecimalToBigInteger = new BigDecimalToBigInteger(); + + Function composedCoercion = + stringToBigDecimal.andThen(bigDecimalToBigInteger); + + BigQueryTypeCoercer bigQueryTypeCoercer = + new BigQueryTypeCoercerBuilder() + .registerTypeCoercion(composedCoercion, String.class, BigInteger.class) + .build(); + + assertThat(bigQueryTypeCoercer.coerceTo(BigInteger.class, "123567.66884")) + .isEqualTo(BigInteger.valueOf(123567)); + } + + @Test + public void shouldThrowCoercionNotFoundException() { + byte[] bytesArray = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33}; + Text text = new Text(bytesArray); + + BigQueryJdbcCoercionNotFoundException exception = + assertThrows( + BigQueryJdbcCoercionNotFoundException.class, + () -> BigQueryTypeCoercer.INSTANCE.coerceTo(Long.class, text)); + assertThat(exception.getMessage()) + .isEqualTo( + "Coercion not found for " + + "[com.google.cloud.bigquery.jdbc.TestType.Text -> java.lang.Long]" + + " conversion"); + } + + @Test + public void shouldThrowCoercionException() { + BigQueryTypeCoercer bigQueryTypeCoercer = + new BigQueryTypeCoercerBuilder() + .registerTypeCoercion(Math::toIntExact, Long.class, Integer.class) + .build(); + BigQueryJdbcCoercionException exception = + assertThrows( + BigQueryJdbcCoercionException.class, + () -> bigQueryTypeCoercer.coerceTo(Integer.class, 2147483648L)); + assertThat(exception.getMessage()).isEqualTo("Coercion error"); + assertThat(exception.getCause()).isInstanceOf(ArithmeticException.class); + } + + private static class StringToBigDecimal implements BigQueryCoercion { + + @Override + public BigDecimal coerce(String value) { + return new BigDecimal(value); + } + } + + private static class BigDecimalToBigInteger implements BigQueryCoercion { + + @Override + public BigInteger coerce(BigDecimal value) { + return value.toBigInteger(); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/FieldValueTypeBigQueryCoercionUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/FieldValueTypeBigQueryCoercionUtilityTest.java new file mode 100644 index 0000000000..456b750ca5 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/FieldValueTypeBigQueryCoercionUtilityTest.java @@ -0,0 +1,378 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.cloud.bigquery.FieldValue.Attribute.PRIMITIVE; +import static com.google.cloud.bigquery.FieldValue.Attribute.RANGE; +import static com.google.cloud.bigquery.FieldValue.Attribute.RECORD; +import static com.google.cloud.bigquery.FieldValue.Attribute.REPEATED; +import static com.google.cloud.bigquery.jdbc.BigQueryTypeCoercionUtility.INSTANCE; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; + +import com.google.cloud.bigquery.FieldElementType; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.Range; +import com.google.cloud.bigquery.exception.BigQueryJdbcCoercionException; +import com.google.common.collect.ImmutableList; +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Time; +import java.sql.Timestamp; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.temporal.ChronoUnit; +import java.util.concurrent.TimeUnit; +import org.junit.Test; + +public class FieldValueTypeBigQueryCoercionUtilityTest { + private static final FieldValue STRING_VALUE = FieldValue.of(PRIMITIVE, "sample-string"); + private static final FieldValue INTEGER_VALUE = FieldValue.of(PRIMITIVE, "345"); + private static final FieldValue FLOAT_VALUE = FieldValue.of(PRIMITIVE, "345.21"); + private static final FieldValue SHORT_VALUE = FieldValue.of(PRIMITIVE, "345"); + private static final FieldValue LONG_VALUE = FieldValue.of(PRIMITIVE, "4374218905"); + private static final FieldValue DOUBLE_VALUE = FieldValue.of(PRIMITIVE, "56453.458393"); + private static final FieldValue BIG_DECIMAL_VALUE = FieldValue.of(PRIMITIVE, "56453.458393"); + private static final FieldValue BASE64_ENCODED_VALUE = + FieldValue.of(PRIMITIVE, "SGVsbG8gV29ybGQK"); // Hello World! + private static final FieldValue TIMESTAMP_VALUE = FieldValue.of(PRIMITIVE, "1408452095.22"); + private static final FieldValue DATE_VALUE = FieldValue.of(PRIMITIVE, "2023-03-13"); + private static final FieldValue TIME_VALUE = FieldValue.of(PRIMITIVE, "23:59:59"); + private static final FieldValue TIME_WITH_NANOSECOND_VALUE = + FieldValue.of(PRIMITIVE, "23:59:59.99999"); + private static final FieldValue TRUE_VALUE = FieldValue.of(PRIMITIVE, "true"); + private static final FieldValue FALSE_VALUE = FieldValue.of(PRIMITIVE, "false"); + private static final FieldValue NULL_VALUE = FieldValue.of(PRIMITIVE, null); + private static final FieldValue INTEGER_ARRAY = + FieldValue.of( + REPEATED, + FieldValueList.of( + ImmutableList.of(FieldValue.of(PRIMITIVE, 1), FieldValue.of(PRIMITIVE, 2)))); + private static final FieldValue RECORD_VALUE = + FieldValue.of( + RECORD, ImmutableList.of(INTEGER_VALUE, STRING_VALUE, TIME_VALUE, INTEGER_ARRAY)); + + private static final Range RANGE_DATE = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATE").build()) + .setStart("1970-01-02") + .setEnd("1970-03-04") + .build(); + + private static final Range RANGE_DATETIME = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("DATETIME").build()) + .setStart("2014-08-19 05:41:35.220000") + .setEnd("2015-09-20 06:41:35.220000") + .build(); + + private static final Range RANGE_TIMESTAMP = + Range.newBuilder() + .setType(FieldElementType.newBuilder().setType("TIMESTAMP").build()) + .setStart("2014-08-19 12:41:35.220000+00:00") + .setEnd("2015-09-20 13:41:35.220000+01:00") + .build(); + + private static final FieldValue RANGE_DATE_VALUE = FieldValue.of(RANGE, RANGE_DATE); + private static final FieldValue RANGE_DATE_TIME_VALUE = FieldValue.of(RANGE, RANGE_DATETIME); + private static final FieldValue RANGE_TIMESTAMP_VALUE = FieldValue.of(RANGE, RANGE_TIMESTAMP); + + @Test + public void fieldValueToStringRangeDate() { + String expectedRangeDate = + String.format( + "[%s, %s)", + RANGE_DATE.getStart().getStringValue(), RANGE_DATE.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATE_VALUE)).isEqualTo(expectedRangeDate); + } + + @Test + public void rangeDateToString() { + String expectedRangeDate = + String.format( + "[%s, %s)", + RANGE_DATE.getStart().getStringValue(), RANGE_DATE.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATE)).isEqualTo(expectedRangeDate); + } + + @Test + public void fieldValueToStringRangeDatetime() { + String expectedRangeDatetime = + String.format( + "[%s, %s)", + RANGE_DATETIME.getStart().getStringValue(), RANGE_DATETIME.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATE_TIME_VALUE)) + .isEqualTo(expectedRangeDatetime); + } + + @Test + public void rangeDatetimeToString() { + String expectedRangeDate = + String.format( + "[%s, %s)", + RANGE_DATETIME.getStart().getStringValue(), RANGE_DATETIME.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_DATETIME)).isEqualTo(expectedRangeDate); + } + + @Test + public void fieldValueToStringRangeTimestamp() { + String expectedRangeTimestamp = + String.format( + "[%s, %s)", + RANGE_TIMESTAMP.getStart().getStringValue(), RANGE_TIMESTAMP.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_TIMESTAMP_VALUE)) + .isEqualTo(expectedRangeTimestamp); + } + + @Test + public void rangeTimestampToString() { + String expectedRangeTimestamp = + String.format( + "[%s, %s)", + RANGE_TIMESTAMP.getStart().getStringValue(), RANGE_TIMESTAMP.getEnd().getStringValue()); + assertThat(INSTANCE.coerceTo(String.class, RANGE_TIMESTAMP)).isEqualTo(expectedRangeTimestamp); + } + + @Test + public void fieldValueToString() { + assertThat(INSTANCE.coerceTo(String.class, STRING_VALUE)).isEqualTo("sample-string"); + } + + @Test + public void fieldValueToStringWhenNull() { + assertThat(INSTANCE.coerceTo(String.class, null)).isNull(); + } + + @Test + public void fieldValueToStringWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(String.class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToStringWhenInnerValueIsAnArray() { + assertThat(INSTANCE.coerceTo(String.class, INTEGER_ARRAY)) + .isEqualTo( + "[FieldValue{attribute=PRIMITIVE, value=1, useInt64Timestamps=false}, FieldValue{attribute=PRIMITIVE, value=2, useInt64Timestamps=false}]"); + } + + @Test + public void fieldValueToInteger() { + assertThat(INSTANCE.coerceTo(Integer.class, INTEGER_VALUE)).isEqualTo(345); + } + + @Test + public void fieldValueToIntegerWhenNull() { + assertThat(INSTANCE.coerceTo(Integer.class, null)).isEqualTo(0); + } + + @Test + public void fieldValueToIntegerWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Integer.class, NULL_VALUE)).isEqualTo(0); + } + + @Test + public void fieldValueToFloat() { + assertThat(INSTANCE.coerceTo(Float.class, FLOAT_VALUE)).isEqualTo(345.21f); + } + + @Test + public void fieldValueToFloatWhenNull() { + assertThat(INSTANCE.coerceTo(Float.class, null)).isEqualTo(0f); + } + + @Test + public void fieldValueToFloatWhenInnerValueNull() { + assertThat(INSTANCE.coerceTo(Float.class, NULL_VALUE)).isEqualTo(0f); + } + + @Test + public void fieldValueToShort() { + assertThat(INSTANCE.coerceTo(Short.class, SHORT_VALUE)).isEqualTo((short) 345); + } + + @Test + public void fieldValueToShortWhenNull() { + assertThat(INSTANCE.coerceTo(Short.class, null)).isEqualTo((short) 0); + } + + @Test + public void fieldValueToShortWhenInnerValueNull() { + assertThat(INSTANCE.coerceTo(Short.class, NULL_VALUE)).isEqualTo((short) 0); + } + + @Test + public void fieldValueToLong() { + assertThat(INSTANCE.coerceTo(Long.class, LONG_VALUE)).isEqualTo(4374218905L); + } + + @Test + public void fieldValueToLongWhenNull() { + assertThat(INSTANCE.coerceTo(Long.class, null)).isEqualTo(0L); + } + + @Test + public void fieldValueToLongWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Long.class, NULL_VALUE)).isEqualTo(0L); + } + + @Test + public void fieldValueToDouble() { + assertThat(INSTANCE.coerceTo(Double.class, DOUBLE_VALUE)).isEqualTo(56453.458393D); + } + + @Test + public void fieldValueToDoubleWhenNull() { + assertThat(INSTANCE.coerceTo(Double.class, null)).isEqualTo(0D); + } + + @Test + public void fieldValueToDoubleWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Double.class, NULL_VALUE)).isEqualTo(0D); + } + + @Test + public void fieldValueToBigDecimal() { + assertThat(INSTANCE.coerceTo(BigDecimal.class, BIG_DECIMAL_VALUE)) + .isEqualTo(new BigDecimal("56453.458393")); + } + + @Test + public void fieldValueToBigDecimalWhenNull() { + assertThat(INSTANCE.coerceTo(BigDecimal.class, null)).isNull(); + } + + @Test + public void fieldValueToBigDecimalWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(BigDecimal.class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToBoolean() { + assertThat(INSTANCE.coerceTo(Boolean.class, TRUE_VALUE)).isTrue(); + assertThat(INSTANCE.coerceTo(Boolean.class, FALSE_VALUE)).isFalse(); + } + + @Test + public void fieldValueToBooleanWhenNull() { + assertThat(INSTANCE.coerceTo(Boolean.class, null)).isFalse(); + } + + @Test + public void fieldValueToBooleanWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Boolean.class, NULL_VALUE)).isFalse(); + } + + @Test + public void fieldValueToBytesArray() { + assertThat(INSTANCE.coerceTo(byte[].class, BASE64_ENCODED_VALUE)) + .isEqualTo(new byte[] {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 10}); + } + + @Test + public void fieldValueToBytesArrayWhenNull() { + assertThat(INSTANCE.coerceTo(byte[].class, null)).isNull(); + } + + @Test + public void fieldValueToBytesArrayWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(byte[].class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToTimestamp() { + Instant instant = Instant.EPOCH.plus(TIMESTAMP_VALUE.getTimestampValue(), ChronoUnit.MICROS); + LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.of("UTC")); + assertThat(INSTANCE.coerceTo(Timestamp.class, TIMESTAMP_VALUE)) + .isEqualTo(Timestamp.valueOf(localDateTime)); + } + + @Test + public void fieldValueToTimestampWhenNull() { + assertThat(INSTANCE.coerceTo(Timestamp.class, null)).isNull(); + } + + @Test + public void fieldValueToTimestampWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Timestamp.class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToTime() { + LocalTime expectedTime = LocalTime.of(23, 59, 59); + assertThat(INSTANCE.coerceTo(Time.class, TIME_VALUE)) + .isEqualTo(new Time(TimeUnit.NANOSECONDS.toMillis(expectedTime.toNanoOfDay()))); + LocalTime expectedTimeWithNanos = LocalTime.parse("23:59:59.99999"); + assertThat(INSTANCE.coerceTo(Time.class, TIME_WITH_NANOSECOND_VALUE)) + .isEqualTo(new Time(TimeUnit.NANOSECONDS.toMillis(expectedTimeWithNanos.toNanoOfDay()))); + } + + @Test + public void fieldValueToTimeWhenNull() { + assertThat(INSTANCE.coerceTo(Time.class, null)).isNull(); + } + + @Test + public void fieldValueToTimeWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Time.class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToTimeWithInvalidValue() { + FieldValue invalidTime = FieldValue.of(PRIMITIVE, "99:99:99"); + + BigQueryJdbcCoercionException coercionException = + assertThrows( + BigQueryJdbcCoercionException.class, () -> INSTANCE.coerceTo(Time.class, invalidTime)); + assertThat(coercionException.getCause()).isInstanceOf(IllegalArgumentException.class); + } + + @Test + public void fieldValueToDate() { + LocalDate expectedDate = LocalDate.of(2023, 3, 13); + assertThat(INSTANCE.coerceTo(Date.class, DATE_VALUE)).isEqualTo(Date.valueOf(expectedDate)); + } + + @Test + public void fieldValueToDateWhenNull() { + assertThat(INSTANCE.coerceTo(Date.class, null)).isNull(); + } + + @Test + public void fieldValueToDateWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Date.class, NULL_VALUE)).isNull(); + } + + @Test + public void fieldValueToObject() { + assertThat(INSTANCE.coerceTo(Object.class, RECORD_VALUE)) + .isEqualTo(ImmutableList.of(INTEGER_VALUE, STRING_VALUE, TIME_VALUE, INTEGER_ARRAY)); + } + + @Test + public void fieldValueToObjectWhenNull() { + assertThat(INSTANCE.coerceTo(Object.class, null)).isNull(); + } + + @Test + public void fieldValueToObjectWhenInnerValueIsNull() { + assertThat(INSTANCE.coerceTo(Object.class, NULL_VALUE)).isNull(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/NullHandlingTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/NullHandlingTest.java new file mode 100644 index 0000000000..ab274c8797 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/NullHandlingTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static com.google.common.truth.Truth.assertThat; + +import org.junit.Test; + +public class NullHandlingTest { + + @Test + public void shouldReturnNullForNullByDefault() { + assertThat(BigQueryTypeCoercer.INSTANCE.coerceTo(Integer.class, null)).isNull(); + } + + @Test + public void shouldReturnCustomValueForNull() { + BigQueryTypeCoercer bigQueryTypeCoercer = + new BigQueryTypeCoercerBuilder().registerTypeCoercion(new NullToIntegerCoercion()).build(); + + assertThat(bigQueryTypeCoercer.coerceTo(Integer.class, null)).isEqualTo(0); + } + + private static class NullToIntegerCoercion implements BigQueryCoercion { + @Override + public Integer coerce(Void value) { + return 0; // returning zero as the default value + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java new file mode 100644 index 0000000000..bacfdae1da --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import java.sql.SQLException; +import javax.sql.PooledConnection; +import org.junit.Test; + +public class PooledConnectionDataSourceTest { + private static final Long LISTENER_POOL_SIZE = 20L; + private static final Long CONNECTION_POOL_SIZE = 20L; + private static final Long DEFAULT_LISTENER_POOL_SIZE = 10L; + private static final Long DEFAULT_CONNECTION_POOL_SIZE = 10L; + + @Test + public void testGetPooledConnection() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + BigQueryConnection bqConnection = mock(BigQueryConnection.class); + doReturn(connectionUrl).when(bqConnection).getConnectionUrl(); + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setConnection(bqConnection); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + assertTrue(pooledConnection instanceof BigQueryPooledConnection); + BigQueryPooledConnection bqPooledConnection = (BigQueryPooledConnection) pooledConnection; + assertEquals(LISTENER_POOL_SIZE, bqPooledConnection.getListenerPoolSize()); + assertNotNull(pooledDataSource.getConnectionPoolManager()); + assertEquals( + CONNECTION_POOL_SIZE, pooledDataSource.getConnectionPoolManager().getConnectionPoolSize()); + } + + @Test + public void testGetPooledConnectionNoConnectionURl() throws SQLException { + BigQueryConnection bqConnection = mock(BigQueryConnection.class); + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setConnection(bqConnection); + + assertThrows(BigQueryJdbcRuntimeException.class, () -> pooledDataSource.getPooledConnection()); + } + + @Test + public void testGetPooledConnectionFailInvalidConnectionURl() { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ListenerPoolSize=invalid"; + BigQueryConnection bqConnection = mock(BigQueryConnection.class); + doReturn(connectionUrl).when(bqConnection).getConnectionUrl(); + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setConnection(bqConnection); + + assertThrows(NumberFormatException.class, () -> pooledDataSource.getPooledConnection()); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java new file mode 100644 index 0000000000..d200709c43 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java @@ -0,0 +1,172 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.SQLException; +import org.junit.Before; +import org.junit.Test; + +public class PooledConnectionListenerTest { + private BigQueryConnection bigQueryConnection; + private static final Long LISTENER_POOL_SIZE = 10L; + private static final Long CONNECTION_POOL_SIZE = 10L; + + @Before + public void setUp() throws IOException, SQLException { + bigQueryConnection = mock(BigQueryConnection.class); + } + + @Test + public void testAddConnectionListener() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + assertNull(listener.getPooledConnection()); + } + + @Test + public void testRemoveConnectionListener() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + assertTrue(pooledConnection.isListenerPooled(listener)); + pooledConnection.removeConnectionEventListener(listener); + assertFalse(pooledConnection.isListenerPooled(listener)); + } + + @Test + public void testConnectionHandleClosedByConnection() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + connection.close(); + assertFalse(pooledConnection.inUse()); + assertFalse(listener.isConnectionPoolEmpty()); + assertEquals(1, listener.getConnectionPoolCurrentCapacity()); + assertTrue(pooledConnection.isListenerPooled(listener)); + } + + @Test + public void testConnectionHandleClosedByPooledConnection() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + pooledConnection.close(); + assertFalse(pooledConnection.inUse()); + assertFalse(listener.isConnectionPoolEmpty()); + assertEquals(1, listener.getConnectionPoolCurrentCapacity()); + assertTrue(pooledConnection.isListenerPooled(listener)); + } + + @Test + public void testFireConnectionError() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + pooledConnection.fireConnectionError(new SQLException("test")); + assertFalse(pooledConnection.inUse()); + assertTrue(listener.isConnectionPoolEmpty()); + assertFalse(pooledConnection.isListenerPooled(listener)); + } + + @Test + public void testGetConnectionWhenPoolEmpty() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + assertNull(listener.getPooledConnection()); + } + + @Test + public void testGetConnectionWhenPoolNonEmpty() throws SQLException { + BigQueryPooledConnection pooledConnection = new BigQueryPooledConnection(bigQueryConnection); + assertFalse(pooledConnection.inUse()); + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertTrue(pooledConnection.inUse()); + + PooledConnectionListener listener = new PooledConnectionListener(LISTENER_POOL_SIZE); + assertEquals(CONNECTION_POOL_SIZE, listener.getConnectionPoolSize()); + assertEquals(LISTENER_POOL_SIZE, pooledConnection.getListenerPoolSize()); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + connection.close(); + assertFalse(pooledConnection.inUse()); + assertFalse(listener.isConnectionPoolEmpty()); + assertTrue(pooledConnection.isListenerPooled(listener)); + + assertNotNull(listener.getPooledConnection()); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/TestType.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/TestType.java new file mode 100644 index 0000000000..3222525c5e --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/TestType.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc; + +public class TestType { + public static class Text { + private final byte[] bytes; + + public Text(byte[] bytes) { + this.bytes = bytes; + } + + public byte[] getBytes() { + return bytes; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBase.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBase.java new file mode 100644 index 0000000000..5aa41b2975 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBase.java @@ -0,0 +1,21 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import com.google.cloud.bigquery.jdbc.BigQueryJdbcBaseTest; + +public class ITBase extends BigQueryJdbcBaseTest {} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java new file mode 100644 index 0000000000..411a488714 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java @@ -0,0 +1,4439 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryError; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.DatasetId; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlSyntaxErrorException; +import com.google.cloud.bigquery.jdbc.BigQueryConnection; +import com.google.cloud.bigquery.jdbc.BigQueryDriver; +import com.google.cloud.bigquery.jdbc.DataSource; +import com.google.cloud.bigquery.jdbc.PooledConnectionDataSource; +import com.google.cloud.bigquery.jdbc.PooledConnectionListener; +import com.google.cloud.bigquery.jdbc.utils.TestUtilities.TestConnectionListener; +import com.google.common.collect.ImmutableMap; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.math.BigDecimal; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.Date; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Time; +import java.sql.Timestamp; +import java.sql.Types; +import java.time.Instant; +import java.time.LocalTime; +import java.util.Arrays; +import java.util.Calendar; +import java.util.HashSet; +import java.util.Properties; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.function.BiFunction; +import javax.sql.PooledConnection; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +public class ITBigQueryJDBCTest extends ITBase { + static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + static Connection bigQueryConnection; + static BigQuery bigQuery; + static Statement bigQueryStatement; + static Connection bigQueryConnectionNoReadApi; + static Statement bigQueryStatementNoReadApi; + static final String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3"; + static final String session_enabled_connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;EnableSession=1"; + private static final String BASE_QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 order by" + + " trip_distance asc LIMIT %s"; + private static final Random random = new Random(); + private static final int randomNumber = random.nextInt(9999); + private static final String DATASET = "JDBC_PRESUBMIT_INTEGRATION_DATASET"; + private static final String DATASET2 = "JDBC_PRESUBMIT_INTEGRATION_DATASET_2"; + private static final String CONSTRAINTS_DATASET = "JDBC_CONSTRAINTS_TEST_DATASET"; + private static final String CONSTRAINTS_TABLE_NAME = "JDBC_CONSTRAINTS_TEST_TABLE"; + private static final String CONSTRAINTS_TABLE_NAME2 = "JDBC_CONSTRAINTS_TEST_TABLE2"; + private static final String CONSTRAINTS_TABLE_NAME3 = "JDBC_CONSTRAINTS_TEST_TABLE3"; + private static final String CALLABLE_STMT_PROC_NAME = "IT_CALLABLE_STMT_PROC_TEST"; + private static final String CALLABLE_STMT_TABLE_NAME = "IT_CALLABLE_STMT_PROC_TABLE"; + private static final String CALLABLE_STMT_PARAM_KEY = "CALL_STMT_PARAM_KEY"; + private static final String CALLABLE_STMT_DML_INSERT_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_INSERT_TEST"; + private static final String CALLABLE_STMT_DML_UPDATE_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_UPDATE_TEST"; + private static final String CALLABLE_STMT_DML_DELETE_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_DELETE_TEST"; + private static final String CALLABLE_STMT_DML_TABLE_NAME = "IT_CALLABLE_STMT_PROC_DML_TABLE"; + private static final Long DEFAULT_CONN_POOL_SIZE = 10L; + private static final Long CUSTOM_CONN_POOL_SIZE = 5L; + private static final Object EXCEPTION_REPLACEMENT = "EXCEPTION-WAS-RAISED"; + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + private JsonObject getAuthJson() throws IOException { + final String secret = requireEnvVar("SA_SECRET"); + JsonObject authJson; + // Supporting both formats of SA_SECRET: + // - Local runs can point to a json file + // - Cloud Build has JSON value + try { + InputStream stream = Files.newInputStream(Paths.get(secret)); + InputStreamReader reader = new InputStreamReader(stream); + authJson = JsonParser.parseReader(reader).getAsJsonObject(); + } catch (IOException e) { + authJson = JsonParser.parseString(secret).getAsJsonObject(); + } + assertTrue(authJson.has("client_email")); + assertTrue(authJson.has("private_key")); + assertTrue(authJson.has("project_id")); + return authJson; + } + + private void validateConnection(String connection_uri) throws SQLException { + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 850"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @BeforeClass + public static void beforeClass() throws SQLException { + bigQueryConnection = DriverManager.getConnection(connection_uri, new Properties()); + bigQueryStatement = bigQueryConnection.createStatement(); + + Properties noReadApi = new Properties(); + noReadApi.setProperty("EnableHighThroughputAPI", "0"); + bigQueryConnectionNoReadApi = DriverManager.getConnection(connection_uri, noReadApi); + bigQueryStatementNoReadApi = bigQueryConnectionNoReadApi.createStatement(); + bigQuery = BigQueryOptions.newBuilder().build().getService(); + } + + @AfterClass + public static void afterClass() throws SQLException { + bigQueryStatement.close(); + bigQueryConnection.close(); + bigQueryStatementNoReadApi.close(); + bigQueryConnectionNoReadApi.close(); + } + + @Test + public void testValidServiceAccountAuthentication() throws SQLException, IOException { + final JsonObject authJson = getAuthJson(); + File tempFile = File.createTempFile("auth", ".json"); + tempFile.deleteOnExit(); + Files.write(tempFile.toPath(), authJson.toString().getBytes()); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + authJson.get("project_id").getAsString() + + ";OAuthType=0;" + + "OAuthPvtKeyPath=" + + tempFile.toPath() + + ";"; + + validateConnection(connection_uri); + } + + @Test + public void testServiceAccountAuthenticationMissingOAuthPvtKeyPath() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=0;"; + + try { + DriverManager.getConnection(connection_uri); + Assert.fail(); + } catch (BigQueryJdbcRuntimeException ex) { + assertTrue(ex.getMessage().contains("No valid credentials provided.")); + } + } + + @Test + public void testValidServiceAccountAuthenticationOAuthPvtKeyAsPath() + throws SQLException, IOException { + final JsonObject authJson = getAuthJson(); + File tempFile = File.createTempFile("auth", ".json"); + tempFile.deleteOnExit(); + Files.write(tempFile.toPath(), authJson.toString().getBytes()); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + authJson.get("project_id").getAsString() + + ";OAuthType=0;" + + "OAuthServiceAcctEmail=;" + + ";OAuthPvtKey=" + + tempFile.toPath() + + ";"; + validateConnection(connection_uri); + } + + @Test + public void testValidServiceAccountAuthenticationViaEmailAndPkcs8Key() + throws SQLException, IOException { + final JsonObject authJson = getAuthJson(); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + authJson.get("project_id").getAsString() + + ";OAuthType=0;" + + "OAuthServiceAcctEmail=" + + authJson.get("client_email").getAsString() + + ";OAuthPvtKey=" + + authJson.get("private_key").getAsString() + + ";"; + validateConnection(connection_uri); + } + + @Test + public void testValidServiceAccountAuthenticationOAuthPvtKeyAsJson() + throws SQLException, IOException { + final JsonObject authJson = getAuthJson(); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + authJson.get("project_id").getAsString() + + ";OAuthType=0;" + + "OAuthServiceAcctEmail=;" + + ";OAuthPvtKey=" + + authJson.toString() + + ";"; + validateConnection(connection_uri); + } + + // TODO(kirl): Enable this test when pipeline has p12 secret available. + @Test + @Ignore + public void testValidServiceAccountAuthenticationP12() throws SQLException, IOException { + final JsonObject authJson = getAuthJson(); + final String p12_file = requireEnvVar("SA_SECRET_P12"); + + final String connectionUri = + getBaseUri(0, authJson.get("project_id").getAsString()) + .append("OAuthServiceAcctEmail", authJson.get("client_email").getAsString()) + .append("OAuthPvtKeyPath", p12_file) + .toString(); + validateConnection(connectionUri); + } + + @Test + @Ignore + public void testValidGoogleUserAccountAuthentication() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAuthType=1;OAuthClientId=client_id;OAuthClientSecret=client_secret;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_USER_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + @Test + @Ignore + public void testValidExternalAccountAuthentication() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=4;" + + "BYOID_AudienceUri=//iam.googleapis.com/projects//locations//workloadIdentityPools//providers/;" + + "BYOID_SubjectTokenType=;BYOID_CredentialSource={\"file\":\"/path/to/file\"};" + + "BYOID_SA_Impersonation_Uri=;BYOID_TokenUri=;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "EXTERNAL_ACCOUNT_AUTH", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + @Test + @Ignore + public void testValidExternalAccountAuthenticationFromFile() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=4;" + + "OAuthPvtKeyPath=/path/to/file;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "EXTERNAL_ACCOUNT_AUTH", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + @Test + @Ignore + public void testValidExternalAccountAuthenticationRawJson() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=4;OAuthPvtKey={\n" + + " \"universe_domain\": \"googleapis.com\",\n" + + " \"type\": \"external_account\",\n" + + " \"audience\":" + + " \"//iam.googleapis.com/projects//locations//workloadIdentityPools//providers/\",\n" + + " \"subject_token_type\": \"\",\n" + + " \"token_url\": \"\",\n" + + " \"credential_source\": {\n" + + " \"file\": \"/path/to/file\"\n" + + " },\n" + + " \"service_account_impersonation_url\": \"\"\n" + + "};"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "EXTERNAL_ACCOUNT_AUTH", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + // TODO(farhan): figure out how to programmatically generate an access token and test + @Test + @Ignore + public void testValidPreGeneratedAccessTokenAuthentication() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=2;OAuthAccessToken=access_token;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "PRE_GENERATED_TOKEN", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + // TODO(obada): figure out how to programmatically generate a refresh token and test + @Test + @Ignore + public void testValidRefreshTokenAuthentication() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=2;OAuthRefreshToken=refresh_token;" + + ";OAuthClientId=client;OAuthClientSecret=secret;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "PRE_GENERATED_TOKEN", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertEquals(50, resultSetRowCount(resultSet)); + connection.close(); + } + + @Test + public void testValidApplicationDefaultCredentialsAuthentication() throws SQLException { + String connection_uri = getBaseUri(3, PROJECT_ID).toString(); + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "APPLICATION_DEFAULT_CREDENTIALS", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + connection.close(); + } + + // This test is useing the same client email as a main authorization & impersonation. + // It requires account to have 'tokenCreator' permission, see + // https://cloud.google.com/docs/authentication/use-service-account-impersonation#required-roles + @Test + public void testServiceAccountAuthenticationWithImpersonation() throws IOException, SQLException { + final JsonObject authJson = getAuthJson(); + + String connection_uri = + getBaseUri(0, authJson.get("project_id").getAsString()) + .append("OAuthServiceAcctEmail", authJson.get("client_email").getAsString()) + .append("OAuthPvtKey", authJson.get("private_key").getAsString()) + .append("ServiceAccountImpersonationEmail", authJson.get("client_email").getAsString()) + .toString(); + validateConnection(connection_uri); + } + + // This test uses the same client email for the main authorization and a chain of impersonations. + // It requires the account to have 'tokenCreator' permission on itself. + @Test + public void testServiceAccountAuthenticationWithChainedImpersonation() + throws IOException, SQLException { + final JsonObject authJson = getAuthJson(); + String clientEmail = authJson.get("client_email").getAsString(); + + String connection_uri = + getBaseUri(0, authJson.get("project_id").getAsString()) + .append("OAuthServiceAcctEmail", clientEmail) + .append("OAuthPvtKey", authJson.get("private_key").getAsString()) + .append("ServiceAccountImpersonationEmail", clientEmail) + .append("ServiceAccountImpersonationChain", clientEmail + "," + clientEmail) + .toString(); + validateConnection(connection_uri); + } + + @Test + public void testFastQueryPathSmall() throws SQLException { + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 850"; + ResultSet jsonResultSet = bigQueryStatement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(850, resultSetRowCount(jsonResultSet)); + } + + @Test + public void testSmallSelectAndVerifyResults() throws SQLException { + String query = + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` WHERE" + + " repository_name LIKE 'X%' LIMIT 10"; + + ResultSet resultSet = bigQueryStatement.executeQuery(query); + int rowCount = 0; + while (resultSet.next()) { + assertTrue(resultSet.getString(1).startsWith("X")); + rowCount++; + } + assertEquals(10, rowCount); + } + + @Test + // reads without using ReadAPI and makes sure that they are in order, which implies threads worked + // correctly + public void testIterateOrderJsonMultiThread_NoReadApi() throws SQLException { + int expectedCnt = 10000; + String query = String.format(BASE_QUERY, expectedCnt); + ResultSet rs = bigQueryStatementNoReadApi.executeQuery(query); + int cnt = 0; + double oldTriDis = 0.0d; + while (rs.next()) { + double tripDis = rs.getDouble("trip_distance"); + ++cnt; + assertTrue(oldTriDis <= tripDis); + oldTriDis = tripDis; + } + assertEquals(expectedCnt, cnt); // all the records were retrieved + } + + @Test + public void testInvalidQuery() throws SQLException { + String query = "SELECT *"; + + try { + bigQueryStatement.executeQuery(query); + Assert.fail(); + } catch (BigQueryJdbcException e) { + assertTrue(e.getMessage().contains("SELECT * must have a FROM clause")); + } + } + + @Test + public void testDriver() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3"; + + Driver driver = BigQueryDriver.getRegisteredDriver(); + assertTrue(driver.acceptsURL(connection_uri)); + + Connection connection = driver.connect(connection_uri, new Properties()); + assertNotNull(connection); + Statement st = connection.createStatement(); + boolean rs = + st.execute("Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"); + assertTrue(rs); + connection.close(); + } + + @Test + public void testDefaultDataset() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;DEFAULTDATASET=testDataset"; + + Driver driver = BigQueryDriver.getRegisteredDriver(); + assertTrue(driver.acceptsURL(connection_uri)); + + Connection connection = driver.connect(connection_uri, new Properties()); + assertNotNull(connection); + assertEquals( + DatasetId.of("testDataset"), ((BigQueryConnection) connection).getDefaultDataset()); + + String connection_uri_null_default_dataset = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3"; + + assertTrue(driver.acceptsURL(connection_uri_null_default_dataset)); + + Connection connection2 = driver.connect(connection_uri_null_default_dataset, new Properties()); + assertNotNull(connection2); + assertNull(((BigQueryConnection) connection2).getDefaultDataset()); + connection.close(); + connection2.close(); + } + + @Test + public void testDefaultDatasetWithProject() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;DEFAULTDATASET=" + + PROJECT_ID + + ".testDataset"; + + Driver driver = BigQueryDriver.getRegisteredDriver(); + assertTrue(driver.acceptsURL(connection_uri)); + + Connection connection = driver.connect(connection_uri, new Properties()); + assertNotNull(connection); + assertEquals( + DatasetId.of(PROJECT_ID, "testDataset"), + ((BigQueryConnection) connection).getDefaultDataset()); + connection.close(); + } + + @Test + public void testLocation() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;LOCATION=EU"; + + Driver driver = BigQueryDriver.getRegisteredDriver(); + assertTrue(driver.acceptsURL(connection_uri)); + + Connection connection = driver.connect(connection_uri, new Properties()); + assertEquals(((BigQueryConnection) connection).getLocation(), "EU"); + + Statement statement = connection.createStatement(); + + // Query a dataset in the EU + String query = + "SELECT name FROM `bigquery-public-data.covid19_italy_eu.data_by_province` LIMIT 100"; + ResultSet resultSet = statement.executeQuery(query); + assertEquals(100, resultSetRowCount(resultSet)); + + String connection_uri_null_location = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3"; + + assertTrue(driver.acceptsURL(connection_uri_null_location)); + + Connection connection2 = driver.connect(connection_uri_null_location, new Properties()); + assertNotNull(connection2); + assertNull(((BigQueryConnection) connection2).getLocation()); + connection.close(); + connection2.close(); + } + + @Test + public void testIncorrectLocation() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;LOCATION=europe-west3"; + + Driver driver = BigQueryDriver.getRegisteredDriver(); + + Connection connection = driver.connect(connection_uri, new Properties()); + assertEquals(((BigQueryConnection) connection).getLocation(), "europe-west3"); + + // Query a dataset in the US + Statement statement = connection.createStatement(); + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"; + BigQueryJdbcException ex = + assertThrows(BigQueryJdbcException.class, () -> statement.executeQuery(query)); + BigQueryError error = ex.getBigQueryException().getError(); + assertNotNull(error); + assertEquals("accessDenied", error.getReason()); + connection.close(); + } + + @Test + public void testCreateStatementWithResultSetHoldabilityUnsupportedTypeForwardOnly() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.createStatement(ResultSet.TYPE_FORWARD_ONLY, 1, 1)); + } + + @Test + public void testCreateStatementWithResultSetHoldabilityUnsupportedConcurReadOnly() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.createStatement(1, ResultSet.CONCUR_READ_ONLY, 1)); + } + + @Test + public void testCreateStatementWithResultSetHoldabilityUnsupportedCloseCursorsAtCommit() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.createStatement(1, 1, ResultSet.CLOSE_CURSORS_AT_COMMIT)); + } + + @Test + public void testCreateStatementWithResultSetConcurrencyUnsupportedTypeForwardOnly() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.createStatement(ResultSet.TYPE_FORWARD_ONLY, 1)); + } + + @Test + public void testCreateStatementWithResultSetConcurrencyUnsupportedConcurReadOnly() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.createStatement(1, ResultSet.CONCUR_READ_ONLY)); + } + + @Test + public void testSetTransactionIsolationToNotSerializableThrowsNotSupported() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryConnection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE + 1)); + } + + @Test + public void testSetHoldabilityForNonCloseCursorsThrowsNotSupported() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> connection.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT + 1)); + connection.close(); + } + + @Test + public void testCreateStatementWhenConnectionClosedThrows() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows(IllegalStateException.class, connection::createStatement); + } + + @Test + public void testCreateStatementWithResultSetHoldabilityWhenConnectionClosedThrows() + throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows(IllegalStateException.class, () -> connection.createStatement(1, 1, 1)); + } + + @Test + public void testCreateStatementWithResultSetConcurrencyWhenConnectionClosedThrows() + throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows(IllegalStateException.class, () -> connection.createStatement(1, 1)); + } + + @Test + public void testSetAutoCommitWithClosedConnectionThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.close(); + assertThrows(IllegalStateException.class, () -> connection.setAutoCommit(true)); + } + + @Test + public void testSetCommitToFalseWithoutSessionEnabledThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(connection_uri); + assertThrows(IllegalStateException.class, () -> connection.setAutoCommit(false)); + connection.close(); + } + + @Test + public void testCommitWithConnectionClosedThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.close(); + assertThrows(IllegalStateException.class, connection::commit); + } + + @Test + public void testCommitToFalseWithoutSessionEnabledThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(connection_uri); + assertThrows(IllegalStateException.class, connection::commit); + connection.close(); + } + + @Test + public void testCommitWithNoTransactionStartedThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + assertThrows(IllegalStateException.class, connection::commit); + connection.close(); + } + + @Test + public void testRollbackWithConnectionClosedThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.close(); + assertThrows(IllegalStateException.class, connection::rollback); + } + + @Test + public void testRollbackToFalseWithoutSessionEnabledThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(connection_uri); + assertThrows(IllegalStateException.class, connection::rollback); + connection.close(); + } + + @Test + public void testRollbackWithoutTransactionStartedThrowsIllegalState() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + assertThrows(IllegalStateException.class, connection::rollback); + connection.close(); + } + + @Test + public void testGetLocationWhenConnectionClosedThrows() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows( + IllegalStateException.class, () -> ((BigQueryConnection) connection).getLocation()); + connection.close(); + } + + @Test + public void testGetDefaultDatasetWhenConnectionClosedThrows() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows( + IllegalStateException.class, () -> ((BigQueryConnection) connection).getDefaultDataset()); + } + + @Test + public void testGetAutocommitWhenConnectionClosedThrows() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows(IllegalStateException.class, connection::getAutoCommit); + } + + @Test + public void testSetAutocommitWhenConnectionClosedThrows() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + + connection.close(); + assertThrows(IllegalStateException.class, () -> connection.setAutoCommit(true)); + } + + @Test + public void testExecuteUpdate() throws SQLException { + String TABLE_NAME = "JDBC_EXECUTE_UPDATE_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING, `IntegerField` INTEGER);", + DATASET, TABLE_NAME); + String insertQuery = + String.format( + "INSERT INTO %s.%s (StringField, IntegerField) " + + "VALUES ('string1',111 ), ('string2',111 ), ('string3',222 ), ('string4',333 );", + DATASET, TABLE_NAME); + String updateQuery = + String.format( + "UPDATE %s.%s SET StringField='Jane Doe' WHERE IntegerField=111", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT * FROM %s.%s", DATASET, TABLE_NAME); + + int createStatus = bigQueryStatement.executeUpdate(createQuery); + assertEquals(0, createStatus); + + int insertStatus = bigQueryStatement.executeUpdate(insertQuery); + assertEquals(4, insertStatus); + + bigQueryStatement.executeQuery(selectQuery); + int selectStatus = bigQueryStatement.getUpdateCount(); + assertEquals(-1, selectStatus); + + int updateStatus = bigQueryStatement.executeUpdate(updateQuery); + assertEquals(2, updateStatus); + + int dropStatus = bigQueryStatement.executeUpdate(dropQuery); + assertEquals(0, dropStatus); + + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TABLE_NAME)); + } + + @Test + public void testExecuteQueryWithInsert() throws SQLException { + String TABLE_NAME = "JDBC_EXECUTE_UPDATE_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING, `IntegerField` INTEGER);", + DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + + assertEquals(0, bigQueryStatement.executeUpdate(createQuery)); + assertThrows(BigQueryJdbcException.class, () -> bigQueryStatement.executeQuery(dropQuery)); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TABLE_NAME)); + } + + @Test + public void testExecuteQueryWithMultipleReturns() throws SQLException { + String query = + String.format("SELECT * FROM bigquery-public-data.samples.github_timeline LIMIT 1;"); + + assertThrows(BigQueryJdbcException.class, () -> bigQueryStatement.executeQuery(query + query)); + } + + @Test + public void testExecuteUpdateWithSelect() throws SQLException { + String selectQuery = + String.format("SELECT * FROM bigquery-public-data.samples.github_timeline LIMIT 1;"); + + assertThrows(BigQueryJdbcException.class, () -> bigQueryStatement.executeUpdate(selectQuery)); + } + + @Test + public void testExecuteMethod() throws SQLException { + + String TABLE_NAME = "JDBC_EXECUTE_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING, `IntegerField` INTEGER);", + DATASET, TABLE_NAME); + String insertQuery = + String.format( + "INSERT INTO %s.%s (StringField, IntegerField) " + + "VALUES ('string1',111 ), ('string2',111 ), ('string3',222 ), ('string4',333 );", + DATASET, TABLE_NAME); + String updateQuery = + String.format( + "UPDATE %s.%s SET StringField='Jane Doe' WHERE IntegerField=111", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT * FROM %s.%s", DATASET, TABLE_NAME); + + boolean createStatus = bigQueryStatement.execute(createQuery); + assertFalse(createStatus); + + boolean insertStatus = bigQueryStatement.execute(insertQuery); + assertFalse(insertStatus); + + boolean selectStatus = bigQueryStatement.execute(selectQuery); + assertTrue(selectStatus); + int selectCount = bigQueryStatement.getUpdateCount(); + assertEquals(-1, selectCount); + ResultSet resultSet = bigQueryStatement.getResultSet(); + assertNotNull(resultSet); + + boolean updateStatus = bigQueryStatement.execute(updateQuery); + assertFalse(updateStatus); + + boolean dropStatus = bigQueryStatement.execute(dropQuery); + assertFalse(dropStatus); + } + + @Test + public void testPreparedExecuteMethod() throws SQLException { + + String TABLE_NAME = "JDBC_PREPARED_EXECUTE_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING, `IntegerField` INTEGER);", + DATASET, TABLE_NAME); + String insertQuery = + String.format( + "INSERT INTO %s.%s (StringField, IntegerField) VALUES (?,?), (?,?), (?,?), (?,?);", + DATASET, TABLE_NAME); + String updateQuery = + String.format("UPDATE %s.%s SET StringField=? WHERE IntegerField=?", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT ? FROM %s.%s", DATASET, TABLE_NAME); + + boolean createStatus = bigQueryStatement.execute(createQuery); + assertFalse(createStatus); + + PreparedStatement insertStmt = bigQueryConnection.prepareStatement(insertQuery); + insertStmt.setString(1, "String1"); + insertStmt.setInt(2, 111); + insertStmt.setString(3, "String2"); + insertStmt.setInt(4, 222); + insertStmt.setString(5, "String3"); + insertStmt.setInt(6, 333); + insertStmt.setString(7, "String4"); + insertStmt.setInt(8, 444); + + boolean insertStatus = insertStmt.execute(); + assertFalse(insertStatus); + + PreparedStatement selectStmt = bigQueryConnection.prepareStatement(selectQuery); + selectStmt.setString(1, "StringField"); + boolean selectStatus = selectStmt.execute(); + assertTrue(selectStatus); + + int selectCount = selectStmt.getUpdateCount(); + assertEquals(-1, selectCount); + ResultSet resultSet = selectStmt.getResultSet(); + assertNotNull(resultSet); + + PreparedStatement updateStmt = bigQueryConnection.prepareStatement(updateQuery); + updateStmt.setString(1, "Jane Doe"); + updateStmt.setInt(2, 222); + boolean updateStatus = updateStmt.execute(); + assertFalse(updateStatus); + + boolean dropStatus = bigQueryStatement.execute(dropQuery); + assertFalse(dropStatus); + } + + @Test + public void testPreparedStatementThrowsSyntaxError() throws SQLException { + String TABLE_NAME = "JDBC_PREPARED_SYNTAX_ERR_TABLE_" + randomNumber; + String createQuery = + String.format("CREATE OR REPLACE TABLE %s.%s (? STRING, ? INTEGER);", DATASET, TABLE_NAME); + + PreparedStatement preparedStatement = bigQueryConnection.prepareStatement(createQuery); + preparedStatement.setString(1, "StringField"); + preparedStatement.setString(2, "IntegerField"); + assertThrows(BigQueryJdbcSqlSyntaxErrorException.class, preparedStatement::execute); + + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TABLE_NAME)); + } + + @Test + public void testPreparedStatementThrowsJdbcException() throws SQLException { + String TABLE_NAME = "JDBC_PREPARED_MISSING_PARAM_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (StringField STRING, IntegerField INTEGER);", + DATASET, TABLE_NAME); + boolean createStatus = bigQueryStatement.execute(createQuery); + assertFalse(createStatus); + + String insertQuery = + String.format( + "INSERT INTO %s.%s (StringField, IntegerField) " + "VALUES (?,?), (?,?);", + DATASET, TABLE_NAME); + PreparedStatement insertStmt = bigQueryConnection.prepareStatement(insertQuery); + insertStmt.setString(1, "String1"); + insertStmt.setInt(2, 111); + assertThrows(BigQueryJdbcException.class, insertStmt::execute); + + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TABLE_NAME)); + } + + @Test + public void testSetFetchDirectionFetchReverseThrowsUnsupported() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryStatement.setFetchDirection(ResultSet.FETCH_REVERSE)); + } + + @Test + public void testSetFetchDirectionFetchUnknownThrowsUnsupported() { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> bigQueryStatement.setFetchDirection(ResultSet.FETCH_UNKNOWN)); + } + + @Test + public void testExecuteBatchQueryTypeSelectThrowsUnsupported() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + String query = + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` WHERE" + + " repository_name LIKE 'X%' LIMIT 10"; + Statement statement = connection.createStatement(); + + assertThrows(IllegalArgumentException.class, () -> statement.addBatch(query)); + connection.close(); + } + + @Test + public void testValidExecuteBatch() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + int[] results; + for (int i = 0; i < 3; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + results = statement.executeBatch(); + + // assertions + assertEquals(3, results.length); + for (int updateCount : results) { + assertEquals(1, updateCount); + } + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testAddBatchWithoutSemicolon() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_MISSING_SEMICOLON_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', 4)"; + statement.addBatch(insertQuery); + statement.addBatch(insertQuery); + int[] results = statement.executeBatch(); + + // assertions + assertEquals(2, results.length); + for (int updateCount : results) { + assertEquals(1, updateCount); + } + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testEmptySqlToAddBatch() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EMPTY_EXECUTE_BATCH_TABLE_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + String emptySql = ""; + statement.addBatch(emptySql); + int[] results = statement.executeBatch(); + + // assertions + assertEquals(0, results.length); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testEmptyExecuteBatch() throws SQLException { + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + int[] result = statement.executeBatch(); + + assertEquals(0, result.length); + connection.close(); + } + + @Test + public void testNonValidStatementTypeForAddBatchThrows() { + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_NON_VALID_TYPE_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + assertThrows( + IllegalArgumentException.class, () -> bigQueryStatement.addBatch(createBatchTable)); + } + + @Test + public void testAllValidStatementTypesForAddBatch() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_ALL_VALID_TYPES_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + "); "; + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 13 WHERE age = %s;", DATASET, BATCH_TABLE, randomNumber); + String deleteQuery = + String.format("DELETE FROM %s.%s WHERE name='Farhan';", DATASET, BATCH_TABLE); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + statement.addBatch(insertQuery); + statement.addBatch(updateQuery); + statement.addBatch(deleteQuery); + int[] results = statement.executeBatch(); + + // assertion + for (int updateCount : results) { + assertEquals(1, updateCount); + } + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testUnsupportedHTAPIFallbacksToStandardQueriesWithRange() throws SQLException { + String selectQuery = "select * from `DATATYPERANGETEST.RangeIntervalTestTable` LIMIT 5000;"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";MaxResults=500;HighThroughputActivationRatio=1;" + + "HighThroughputMinTableSize=100;" + + "EnableHighThroughputAPI=1;UnsupportedHTAPIFallback=1;JobCreationMode=1;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertNotNull(resultSet); + + ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + resultSet.next(); + assertEquals(3, resultSetMetaData.getColumnCount()); + connection.close(); + } + + @Test + public void testIntervalDataTypeWithArrowResultSet() throws SQLException { + String selectQuery = + "select * from `DATATYPERANGETEST.RangeIntervalTestTable` order by intColumn limit 5000;"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";MaxResults=500;HighThroughputActivationRatio=1;" + + "HighThroughputMinTableSize=100;" + + "EnableHighThroughputAPI=1;JobCreationMode=1;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + + ResultSet resultSet = statement.executeQuery(selectQuery); + assertTrue(resultSet.getClass().getName().contains("BigQueryArrowResultSet")); + resultSet.next(); + assertEquals("0-0 10 -12:30:0.0", resultSet.getString("intervalField")); + + // cleanup + connection.close(); + } + + @Test + public void testIntervalDataTypeWithJsonResultSet() throws SQLException { + String selectQuery = + "select * from `DATATYPERANGETEST.RangeIntervalTestTable` order by intColumn limit 10 ;"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";MaxResults=500;HighThroughputActivationRatio=1;" + + "HighThroughputMinTableSize=100;" + + "EnableHighThroughputAPI=0;JobCreationMode=1;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + + ResultSet resultSet = statement.executeQuery(selectQuery); + assertTrue(resultSet.getClass().getName().contains("BigQueryJsonResultSet")); + resultSet.next(); + assertEquals("0-0 10 -12:30:0", resultSet.getString("intervalField")); + + // cleanup + connection.close(); + } + + @Test + public void testValidLEPEndpointQuery() throws SQLException { + String DATASET = "JDBC_REGIONAL_DATASET"; + String TABLE_NAME = "REGIONAL_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";" + + "EndpointOverrides=BIGQUERY=https://us-east4-bigquery.googleapis.com;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertNotNull(resultSet.getMetaData()); + connection.close(); + } + + @Test + public void testValidEndpointWithInvalidBQPortThrows() throws SQLException { + String TABLE_NAME = "JDBC_REGIONAL_TABLE_" + randomNumber; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";" + + "EndpointOverrides=BIGQUERY=https://us-east4-bigquery.googleapis.com:12312312;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.executeQuery(selectQuery)); + connection.close(); + } + + @Test + public void testLEPEndpointDataNotFoundThrows() throws SQLException { + String DATASET = "JDBC_REGIONAL_DATASET"; + String TABLE_NAME = "REGIONAL_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";" + + "EndpointOverrides=BIGQUERY=https://us-east5-bigquery.googleapis.com;"; + + // Attempting read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.executeQuery(selectQuery)); + connection.close(); + } + + @Test + public void testValidREPEndpointQuery() throws SQLException { + String DATASET = "JDBC_REGIONAL_DATASET"; + String TABLE_NAME = "REGIONAL_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";" + + "EndpointOverrides=BIGQUERY=https://bigquery.us-east4.rep.googleapis.com;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertNotNull(resultSet.getMetaData()); + connection.close(); + } + + @Test + public void testREPEndpointDataNotFoundThrows() throws SQLException { + String DATASET = "JDBC_REGIONAL_DATASET"; + String TABLE_NAME = "REGIONAL_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";" + + "EndpointOverrides=BIGQUERY=https://bigquery.us-east7.rep.googleapis.com;"; + + // Attempting read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.executeQuery(selectQuery)); + connection.close(); + } + + @Test + public void testCloseStatement() throws SQLException { + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 10"; + Statement statement = bigQueryConnection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertEquals(10, resultSetRowCount(jsonResultSet)); + statement.close(); + assertTrue(statement.isClosed()); + } + + @Test + public void testCloseableStatementSingleResult() throws SQLException { + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 10"; + Statement statement = bigQueryConnection.createStatement(); + statement.closeOnCompletion(); + assertTrue(statement.isCloseOnCompletion()); + ResultSet jsonResultSet = statement.executeQuery(query); + assertFalse(statement.isClosed()); + jsonResultSet.close(); + assertTrue(statement.isClosed()); + } + + @Test + public void testCloseableStatementMultiResult() throws SQLException { + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 10;"; + Statement statement = bigQueryConnection.createStatement(); + statement.closeOnCompletion(); + assertTrue(statement.isCloseOnCompletion()); + statement.execute(query + query); + assertNotNull(statement.getResultSet()); + assertFalse(statement.isClosed()); + + assertTrue(statement.getMoreResults()); + assertNotNull(statement.getResultSet()); + assertFalse(statement.isClosed()); + + assertFalse(statement.getMoreResults()); + assertTrue(statement.isClosed()); + } + + @Test + public void testCloseableStatementMultiResultExplicitClose() throws SQLException { + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 10;"; + Statement statement = bigQueryConnection.createStatement(); + statement.closeOnCompletion(); + assertTrue(statement.isCloseOnCompletion()); + statement.execute(query + query); + ResultSet result = statement.getResultSet(); + result.close(); + assertFalse(statement.isClosed()); + + assertTrue(statement.getMoreResults()); + result = statement.getResultSet(); + result.close(); + assertTrue(statement.isClosed()); + } + + @Test + public void testConnectionIsValid() throws SQLException { + assertTrue(bigQueryConnection.isValid(10)); + assertTrue(bigQueryConnectionNoReadApi.isValid(10)); + } + + @Test + public void testDataSource() throws SQLException { + DataSource ds = new DataSource(); + ds.setURL("jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"); + ds.setOAuthType(3); + + try (Connection connection = ds.getConnection()) { + assertFalse(connection.isClosed()); + } + } + + @Test + public void testDataSourceOAuthPvtKeyPath() throws SQLException, IOException { + File tempFile = File.createTempFile("auth", ".json"); + tempFile.deleteOnExit(); + DataSource ds = new DataSource(); + ds.setURL("jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"); + ds.setOAuthType(0); + ds.setOAuthPvtKeyPath(tempFile.toPath().toString()); + assertEquals(0, ds.getOAuthType()); + assertEquals(tempFile.toPath().toString(), ds.getOAuthPvtKeyPath()); + } + + @Test + public void testPreparedStatementSmallSelect() throws SQLException { + String query = + "SELECT * FROM `bigquery-public-data.samples.github_timeline` where repository_language=?" + + " LIMIT 1000"; + PreparedStatement preparedStatement = bigQueryConnection.prepareStatement(query); + preparedStatement.setString(1, "Java"); + + ResultSet jsonResultSet = preparedStatement.executeQuery(); + + int rowCount = resultSetRowCount(jsonResultSet); + assertEquals(1000, rowCount); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + } + + @Test + public void testPreparedStatementExecuteUpdate() throws SQLException { + Random random = new Random(); + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME1 = "Inventory" + random.nextInt(9999); + String TABLE_NAME2 = "DetailedInventory" + random.nextInt(9999); + + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER);", + DATASET, TABLE_NAME1); + + String createQuery2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER," + + " `supply_constrained` BOOLEAN, `comment` STRING);", + DATASET, TABLE_NAME2); + + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (product, quantity, supply_constrained, comment) " + + "VALUES ('countertop microwave', 20, NULL,'[]' )," + + " ('front load washer', 20, false,'[]' ), " + + " ('microwave', 20, false,'[]' ), " + + " ('refrigerator', 10, false,'[]' );", + DATASET, TABLE_NAME2); + + bigQueryStatement.execute(createQuery); + bigQueryStatement.execute(createQuery2); + bigQueryStatement.execute(insertQuery2); + + String insertQuery = + String.format( + "INSERT INTO %s.%s (product, quantity) " + "VALUES (?,? ), (?,? );", + DATASET, TABLE_NAME1); + PreparedStatement insertPs = bigQueryConnection.prepareStatement(insertQuery); + insertPs.setString(1, "dishwasher"); + insertPs.setInt(2, 30); + insertPs.setString(3, "dryer"); + insertPs.setInt(4, 30); + + int insertStatus = insertPs.executeUpdate(); + assertEquals(2, insertStatus); + + String updateQuery = + String.format("UPDATE %s.%s SET quantity=? WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement updatePs = bigQueryConnection.prepareStatement(updateQuery); + updatePs.setString(2, "dryer"); + updatePs.setInt(1, 35); + + int updateStatus = updatePs.executeUpdate(); + assertEquals(1, updateStatus); + + String deleteQuery = String.format("DELETE FROM %s.%s WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement deletePs = bigQueryConnection.prepareStatement(deleteQuery); + deletePs.setString(1, "dishwasher"); + + int deleteStatus = deletePs.executeUpdate(); + assertEquals(1, deleteStatus); + + String mergeQuery = + String.format( + "MERGE %s.%s T\n" + + "USING %s.%s S\n" + + "ON T.product = S.product\n" + + "WHEN NOT MATCHED AND quantity < ? THEN\n" + + " INSERT(product, quantity, supply_constrained, comment)\n" + + " VALUES(product, quantity, true, ?)\n" + + "WHEN NOT MATCHED THEN\n" + + " INSERT(product, quantity, supply_constrained)\n" + + " VALUES(product, quantity, false)", + DATASET, TABLE_NAME2, DATASET, TABLE_NAME1); + PreparedStatement mergePs = bigQueryConnection.prepareStatement(mergeQuery); + mergePs.setInt(1, 20); + mergePs.setString(2, "comment" + random.nextInt(999)); + + int mergeStatus = mergePs.executeUpdate(); + assertEquals(1, mergeStatus); + + ResultSet rs = + bigQueryStatement.executeQuery( + String.format("SELECT COUNT(*) AS row_count\n" + "FROM %s.%s", DATASET, TABLE_NAME2)); + rs.next(); + assertEquals(5, rs.getInt(1)); + + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME1); + int dropStatus = bigQueryStatement.executeUpdate(dropQuery); + assertEquals(0, dropStatus); + bigQueryStatement.execute(String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME2)); + } + + @Test + public void testPreparedStatementDateTimeValues() throws SQLException { + Random random = new Random(); + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME1 = "DateTimeTestTable" + random.nextInt(9999); + + final String createTableQuery = + "CREATE OR REPLACE TABLE " + + " `%s.%s` " + + " (\n" + + "`StringField` STRING,\n" + + "`IntegerField` INTEGER,\n" + + "`TimestampField` TIMESTAMP,\n" + + "`TimeField` TIME,\n" + + "`DateField` DATE\n" + + ");"; + + String insertQuery = + String.format("INSERT INTO %s.%s VALUES (?,?,?,?,? );", DATASET, TABLE_NAME1); + + bigQueryStatement.execute(String.format(createTableQuery, DATASET, TABLE_NAME1)); + + PreparedStatement insertPs = bigQueryConnection.prepareStatement(insertQuery); + insertPs.setString(1, "dishwasher"); + insertPs.setInt(2, 1); + insertPs.setTimestamp(3, Timestamp.from(Instant.now())); + insertPs.setTime(4, Time.valueOf(LocalTime.NOON)); + insertPs.setDate(5, Date.valueOf("2025-12-3")); + + int insertStatus = insertPs.executeUpdate(); + assertEquals(1, insertStatus); + + ResultSet rs = + bigQueryStatement.executeQuery( + String.format("SELECT COUNT(*) AS row_count\n" + "FROM %s.%s", DATASET, TABLE_NAME1)); + rs.next(); + assertEquals(1, rs.getInt(1)); + + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME1); + int dropStatus = bigQueryStatement.executeUpdate(dropQuery); + assertEquals(0, dropStatus); + } + + @Test + public void testValidDestinationTableSavesQueriesWithLegacySQL() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;" + + "AllowLargeResults=1;" + + "LargeResultTable=destination_table_test_legacy;" + + "LargeResultDataset=INTEGRATION_TESTS;"; + String selectLegacyQuery = + "SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 200;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String selectQuery = "SELECT * FROM `INTEGRATION_TESTS.destination_table_test_legacy`;"; + ResultSet actualResultSet = bigQueryStatement.executeQuery(selectQuery); + assertTrue(0 < resultSetRowCount(actualResultSet)); + + // clean up + String deleteRows = "DELETE FROM `INTEGRATION_TESTS.destination_table_test_legacy` WHERE 1=1;"; + bigQueryStatement.execute(deleteRows); + connection.close(); + } + + @Test + public void testValidDestinationTableSavesQueriesWithStandardSQL() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=SQL;" + + "LargeResultTable=destination_table_test;" + + "LargeResultDataset=INTEGRATION_TESTS;"; + String selectLegacyQuery = + "SELECT * FROM `bigquery-public-data.deepmind_alphafold.metadata` LIMIT 200;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String selectQuery = "SELECT * FROM INTEGRATION_TESTS.destination_table_test;"; + ResultSet actualResultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(200, resultSetRowCount(actualResultSet)); + + // clean up + String deleteRows = "DELETE FROM `INTEGRATION_TESTS.destination_table_test` WHERE 1=1;"; + bigQueryStatement.execute(deleteRows); + connection.close(); + } + + @Test + public void testDestinationTableAndDestinationDatasetThatDoesNotExistsCreates() + throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;" + + "AllowLargeResults=1;" + + "LargeResultTable=FakeTable;" + + "LargeResultDataset=FakeDataset;"; + String selectLegacyQuery = + "SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 200;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String separateQuery = "SELECT * FROM FakeDataset.FakeTable;"; + boolean result = bigQueryStatement.execute(separateQuery); + assertTrue(result); + + // clean up + bigQueryStatement.execute("DROP SCHEMA FakeDataset CASCADE;"); + connection.close(); + } + + @Test + public void testDestinationTableWithMissingDestinationDatasetDefaults() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;" + + "AllowLargeResults=1;" + + "LargeResultTable=FakeTable;"; + String selectLegacyQuery = + "SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 200;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String separateQuery = "SELECT * FROM _google_jdbc.FakeTable;"; + boolean result = bigQueryStatement.execute(separateQuery); + assertTrue(result); + connection.close(); + } + + @Test + public void testNonSelectForLegacyDestinationTableThrows() throws SQLException { + // setup + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;" + + "AllowLargeResults=1;" + + "LargeResultTable=destination_table_test;" + + "LargeResultDataset=INTEGRATION_TESTS;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act & assertion + assertThrows(BigQueryJdbcException.class, () -> statement.execute(createTransactionTable)); + connection.close(); + } + + @Test + public void testNonSelectForStandardDestinationTableDoesNotThrow() throws SQLException { + // setup + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=SQL;" + + "AllowLargeResults=1;" + + "LargeResultTable=destination_table_test;" + + "LargeResultDataset=INTEGRATION_TESTS;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act & assertion + statement.execute(createTransactionTable); + connection.close(); + } + + @Test + public void testTableConstraints() throws SQLException { + ResultSet primaryKey1 = + bigQueryConnection + .getMetaData() + .getPrimaryKeys(PROJECT_ID, CONSTRAINTS_DATASET, CONSTRAINTS_TABLE_NAME); + primaryKey1.next(); + assertEquals("id", primaryKey1.getString(4)); + assertFalse(primaryKey1.next()); + + ResultSet primaryKey2 = + bigQueryConnection + .getMetaData() + .getPrimaryKeys(PROJECT_ID, CONSTRAINTS_DATASET, CONSTRAINTS_TABLE_NAME2); + primaryKey2.next(); + assertEquals("first_name", primaryKey2.getString(4)); + primaryKey2.next(); + assertEquals("last_name", primaryKey2.getString(4)); + assertFalse(primaryKey2.next()); + + ResultSet foreignKeys = + bigQueryConnection + .getMetaData() + .getImportedKeys(PROJECT_ID, CONSTRAINTS_DATASET, CONSTRAINTS_TABLE_NAME); + foreignKeys.next(); + assertEquals(CONSTRAINTS_TABLE_NAME2, foreignKeys.getString(3)); + assertEquals("first_name", foreignKeys.getString(4)); + assertEquals("name", foreignKeys.getString(8)); + foreignKeys.next(); + assertEquals(CONSTRAINTS_TABLE_NAME2, foreignKeys.getString(3)); + assertEquals("last_name", foreignKeys.getString(4)); + assertEquals("second_name", foreignKeys.getString(8)); + foreignKeys.next(); + assertEquals(CONSTRAINTS_TABLE_NAME3, foreignKeys.getString(3)); + assertEquals("address", foreignKeys.getString(4)); + assertEquals("address", foreignKeys.getString(8)); + assertFalse(foreignKeys.next()); + + ResultSet crossReference = + bigQueryConnection + .getMetaData() + .getCrossReference( + PROJECT_ID, + CONSTRAINTS_DATASET, + CONSTRAINTS_TABLE_NAME2, + PROJECT_ID, + CONSTRAINTS_DATASET, + CONSTRAINTS_TABLE_NAME); + crossReference.next(); + assertEquals(CONSTRAINTS_TABLE_NAME2, crossReference.getString(3)); + assertEquals("first_name", crossReference.getString(4)); + assertEquals("name", crossReference.getString(8)); + crossReference.next(); + assertEquals("last_name", crossReference.getString(4)); + assertEquals("second_name", crossReference.getString(8)); + assertFalse(crossReference.next()); + } + + @Test + public void testDatabaseMetadataGetCatalogs() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + try (ResultSet rs = databaseMetaData.getCatalogs()) { + assertNotNull("ResultSet from getCatalogs() should not be null", rs); + + ResultSetMetaData rsmd = rs.getMetaData(); + assertNotNull("ResultSetMetaData should not be null", rsmd); + assertEquals("Should have one column", 1, rsmd.getColumnCount()); + assertEquals("Column name should be TABLE_CAT", "TABLE_CAT", rsmd.getColumnName(1)); + + assertTrue("ResultSet should have one row", rs.next()); + assertEquals("Catalog name should match Project ID", PROJECT_ID, rs.getString("TABLE_CAT")); + assertFalse("ResultSet should have no more rows", rs.next()); + } + } + + @Test + public void testDatabaseMetadataGetProcedures() throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String procedureName = "create_customer"; + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + ResultSet resultSet = databaseMetaData.getProcedures(PROJECT_ID, DATASET, procedureName); + while (resultSet.next()) { + assertEquals(PROJECT_ID, resultSet.getString("PROCEDURE_CAT")); + assertEquals(DATASET, resultSet.getString("PROCEDURE_SCHEM")); + assertEquals(procedureName, resultSet.getString("PROCEDURE_NAME")); + assertEquals(procedureName, resultSet.getString("SPECIFIC_NAME")); + assertEquals(DatabaseMetaData.procedureResultUnknown, resultSet.getInt("PROCEDURE_TYPE")); + } + } + + @Test + public void testDatabaseMetadataGetProcedureColumns() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + + // --- Test Case 1: Specific schema and procedure, null column name pattern --- + String specificSchema = "JDBC_INTEGRATION_DATASET"; + String specificProcedure = "create_customer"; + ResultSet resultSet = + databaseMetaData.getProcedureColumns(PROJECT_ID, specificSchema, specificProcedure, null); + int specificProcRows = 0; + boolean foundNameParam = false; + boolean foundIdParam = false; + while (resultSet.next()) { + specificProcRows++; + assertEquals(PROJECT_ID, resultSet.getString("PROCEDURE_CAT")); + assertEquals(specificSchema, resultSet.getString("PROCEDURE_SCHEM")); + assertEquals(specificProcedure, resultSet.getString("PROCEDURE_NAME")); + assertEquals(specificProcedure, resultSet.getString("SPECIFIC_NAME")); + if ("name".equals(resultSet.getString("COLUMN_NAME"))) { + foundNameParam = true; + assertEquals(1, resultSet.getInt("ORDINAL_POSITION")); + } + if ("id".equals(resultSet.getString("COLUMN_NAME"))) { + foundIdParam = true; + assertEquals(2, resultSet.getInt("ORDINAL_POSITION")); + } + } + assertEquals("Should find 2 parameters for " + specificProcedure, 2, specificProcRows); + assertTrue("Parameter 'name' should be found", foundNameParam); + assertTrue("Parameter 'id' should be found", foundIdParam); + resultSet.close(); + + // --- Test Case 2: Specific schema, procedure, and column name pattern --- + String specificColumn = "name"; + resultSet = + databaseMetaData.getProcedureColumns( + PROJECT_ID, specificSchema, specificProcedure, specificColumn); + assertTrue("Should find the specific column 'name'", resultSet.next()); + assertEquals(PROJECT_ID, resultSet.getString("PROCEDURE_CAT")); + assertEquals(specificSchema, resultSet.getString("PROCEDURE_SCHEM")); + assertEquals(specificProcedure, resultSet.getString("PROCEDURE_NAME")); + assertEquals(specificColumn, resultSet.getString("COLUMN_NAME")); + assertEquals(1, resultSet.getInt("ORDINAL_POSITION")); + assertEquals( + (short) DatabaseMetaData.procedureColumnUnknown, resultSet.getShort("COLUMN_TYPE")); + assertEquals(java.sql.Types.NVARCHAR, resultSet.getInt("DATA_TYPE")); + assertEquals("NVARCHAR", resultSet.getString("TYPE_NAME")); + assertFalse("Should only find one row for exact column match", resultSet.next()); + resultSet.close(); + + // --- Test Case 3: Non-existent procedure --- + resultSet = + databaseMetaData.getProcedureColumns( + PROJECT_ID, specificSchema, "non_existent_procedure_xyz", null); + assertFalse("Should not find columns for a non-existent procedure", resultSet.next()); + resultSet.close(); + } + + @Test + public void testDatabaseMetadataGetColumns() throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_DATATYPES_INTEGRATION_TEST_TABLE"; + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + + // --- Test Case 1: Specific Column (StringField) --- + ResultSet resultSet = + databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "StringField"); + + assertTrue(resultSet.next()); + assertEquals(PROJECT_ID, resultSet.getString("TABLE_CAT")); + assertEquals(DATASET, resultSet.getString("TABLE_SCHEM")); + assertEquals(TABLE_NAME, resultSet.getString("TABLE_NAME")); + assertEquals("StringField", resultSet.getString("COLUMN_NAME")); + assertEquals("NVARCHAR", resultSet.getString("TYPE_NAME")); + resultSet.getObject("COLUMN_SIZE"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(6, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 2: All Columns --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, null); + assertTrue(resultSet.next()); + int count = 0; + do { + count++; + assertEquals(PROJECT_ID, resultSet.getString("TABLE_CAT")); + assertEquals(DATASET, resultSet.getString("TABLE_SCHEM")); + assertEquals(TABLE_NAME, resultSet.getString("TABLE_NAME")); + assertNotNull(resultSet.getString("COLUMN_NAME")); + } while (resultSet.next()); + assertEquals(16, count); + + // --- Test Case 3: Column Name Pattern Matching (%Field) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "%Time%"); + assertTrue(resultSet.next()); + count = 0; + do { + count++; + String columnName = resultSet.getString("COLUMN_NAME"); + assertTrue(columnName.contains("Time")); + } while (resultSet.next()); + assertEquals(3, count); + + // --- Test Case 4: Column Name Pattern Matching (Integer%) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "Integer%"); + assertTrue(resultSet.next()); + assertEquals("IntegerField", resultSet.getString("COLUMN_NAME")); + assertEquals("BIGINT", resultSet.getString("TYPE_NAME")); + assertEquals(19, resultSet.getInt("COLUMN_SIZE")); + assertEquals(0, resultSet.getInt("DECIMAL_DIGITS")); + assertEquals(10, resultSet.getInt("NUM_PREC_RADIX")); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(2, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 5: Specific Column (BooleanField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "BooleanField"); + assertTrue(resultSet.next()); + assertEquals("BooleanField", resultSet.getString("COLUMN_NAME")); + assertEquals("BOOLEAN", resultSet.getString("TYPE_NAME")); + assertEquals(1, resultSet.getInt("COLUMN_SIZE")); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(1, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 6: Specific Column (NumericField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "NumericField"); + assertTrue(resultSet.next()); + assertEquals("NumericField", resultSet.getString("COLUMN_NAME")); + assertEquals("NUMERIC", resultSet.getString("TYPE_NAME")); + assertEquals(38, resultSet.getInt("COLUMN_SIZE")); + assertEquals(9, resultSet.getInt("DECIMAL_DIGITS")); + assertEquals(10, resultSet.getInt("NUM_PREC_RADIX")); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(4, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 7: Specific Column (BytesField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "BytesField"); + assertTrue(resultSet.next()); + assertEquals("BytesField", resultSet.getString("COLUMN_NAME")); + assertEquals("VARBINARY", resultSet.getString("TYPE_NAME")); + resultSet.getObject("COLUMN_SIZE"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(7, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 8: Specific Column (ArrayField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "ArrayField"); + assertTrue(resultSet.next()); + assertEquals("ArrayField", resultSet.getString("COLUMN_NAME")); + assertEquals("ARRAY", resultSet.getString("TYPE_NAME")); + resultSet.getObject("COLUMN_SIZE"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(9, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 9: Specific Column (TimestampField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "TimestampField"); + assertTrue(resultSet.next()); + assertEquals("TimestampField", resultSet.getString("COLUMN_NAME")); + assertEquals("TIMESTAMP", resultSet.getString("TYPE_NAME")); + assertEquals(29, resultSet.getInt("COLUMN_SIZE")); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(10, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 10: Specific Column (DateField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "DateField"); + assertTrue(resultSet.next()); + assertEquals("DateField", resultSet.getString("COLUMN_NAME")); + assertEquals("DATE", resultSet.getString("TYPE_NAME")); + assertEquals(10, resultSet.getInt("COLUMN_SIZE")); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(11, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 11: Specific Column (TimeField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "TimeField"); + assertTrue(resultSet.next()); + assertEquals("TimeField", resultSet.getString("COLUMN_NAME")); + assertEquals("TIME", resultSet.getString("TYPE_NAME")); + assertEquals(15, resultSet.getInt("COLUMN_SIZE")); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(12, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 12: Specific Column (DateTimeField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "DateTimeField"); + assertTrue(resultSet.next()); + assertEquals("DateTimeField", resultSet.getString("COLUMN_NAME")); + assertEquals("TIMESTAMP", resultSet.getString("TYPE_NAME")); + assertEquals(29, resultSet.getInt("COLUMN_SIZE")); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(13, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + + // --- Test Case 13: Specific Column (GeographyField) --- + resultSet = databaseMetaData.getColumns(PROJECT_ID, DATASET, TABLE_NAME, "GeographyField"); + assertTrue(resultSet.next()); + assertEquals("GeographyField", resultSet.getString("COLUMN_NAME")); + assertEquals("VARCHAR", resultSet.getString("TYPE_NAME")); + resultSet.getObject("COLUMN_SIZE"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("DECIMAL_DIGITS"); + assertTrue(resultSet.wasNull()); + resultSet.getObject("NUM_PREC_RADIX"); + assertTrue(resultSet.wasNull()); + assertEquals(1, resultSet.getInt("NULLABLE")); + assertEquals(14, resultSet.getInt("ORDINAL_POSITION")); + assertFalse(resultSet.next()); + } + + @Test + public void testDatabaseMetadataGetTables() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + String DATASET = "JDBC_TABLE_TYPES_TEST"; + + // --- Test Case 1: Get all tables (types = null) --- + ResultSet rsAll = databaseMetaData.getTables(PROJECT_ID, DATASET, null, null); + Set allTableNames = new HashSet<>(); + while (rsAll.next()) { + allTableNames.add(rsAll.getString("TABLE_NAME")); + } + assertTrue(allTableNames.contains("base_table")); + assertTrue(allTableNames.contains("my_view")); + assertTrue(allTableNames.contains("external_table")); + assertTrue(allTableNames.contains("my_materialized_view")); + assertTrue(allTableNames.contains("base_table_clone")); + assertTrue(allTableNames.contains("base_table_snapshot")); + assertEquals(6, allTableNames.size()); + + // --- Test Case 2: Get only "TABLE" type --- + ResultSet rsTable = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"TABLE"}); + Set tableNames = new HashSet<>(); + while (rsTable.next()) { + tableNames.add(rsTable.getString("TABLE_NAME")); + } + assertTrue(tableNames.contains("base_table")); + assertTrue(tableNames.contains("base_table_clone")); + assertEquals(2, tableNames.size()); + + // --- Test Case 3: Get "VIEW" type --- + ResultSet rsView = databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"VIEW"}); + assertTrue(rsView.next()); + assertEquals("my_view", rsView.getString("TABLE_NAME")); + assertEquals("VIEW", rsView.getString("TABLE_TYPE")); + assertFalse(rsView.next()); + + // --- Test Case 4: Get "EXTERNAL TABLE" type --- + ResultSet rsExternal = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"EXTERNAL"}); + assertTrue(rsExternal.next()); + assertEquals("external_table", rsExternal.getString("TABLE_NAME")); + assertEquals("EXTERNAL", rsExternal.getString("TABLE_TYPE")); + assertFalse(rsExternal.next()); + + // --- Test Case 5: Get "MATERIALIZED_VIEW" type --- + ResultSet rsMaterialized = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"MATERIALIZED_VIEW"}); + assertTrue(rsMaterialized.next()); + assertEquals("my_materialized_view", rsMaterialized.getString("TABLE_NAME")); + assertEquals("MATERIALIZED_VIEW", rsMaterialized.getString("TABLE_TYPE")); + assertFalse(rsMaterialized.next()); + + // --- Test Case 6: Get "SNAPSHOT" type --- + ResultSet rsSnapshot = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"SNAPSHOT"}); + assertTrue(rsSnapshot.next()); + assertEquals("base_table_snapshot", rsSnapshot.getString("TABLE_NAME")); + assertEquals("SNAPSHOT", rsSnapshot.getString("TABLE_TYPE")); + assertFalse(rsSnapshot.next()); + + // --- Test Case 8: Get multiple types ("TABLE" and "VIEW") --- + ResultSet rsMulti = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {"TABLE", "VIEW"}); + Set multiTableNames = new HashSet<>(); + while (rsMulti.next()) { + multiTableNames.add(rsMulti.getString("TABLE_NAME")); + } + assertTrue(multiTableNames.contains("base_table")); + assertTrue(multiTableNames.contains("base_table_clone")); + assertTrue(multiTableNames.contains("my_view")); + assertEquals(3, multiTableNames.size()); + + // --- Test Case 9: tableNamePattern --- + ResultSet rsNamePattern = databaseMetaData.getTables(PROJECT_ID, DATASET, "base%", null); + Set baseTableNames = new HashSet<>(); + while (rsNamePattern.next()) { + baseTableNames.add(rsNamePattern.getString("TABLE_NAME")); + } + assertTrue(baseTableNames.contains("base_table")); + assertTrue(baseTableNames.contains("base_table_clone")); + assertTrue(baseTableNames.contains("base_table_snapshot")); + assertEquals(3, baseTableNames.size()); + + // --- Test Case 10: No matching table --- + ResultSet rsNoMatch = + databaseMetaData.getTables(PROJECT_ID, DATASET, "nonexistent_table", null); + assertFalse(rsNoMatch.next()); + + // --- Test Case 11: Null type in array --- + ResultSet rsNullType = + databaseMetaData.getTables(PROJECT_ID, DATASET, null, new String[] {null, "VIEW"}); + assertTrue(rsNullType.next()); + assertEquals("VIEW", rsNullType.getString("TABLE_TYPE")); + assertEquals("my_view", rsNullType.getString("TABLE_NAME")); + assertFalse(rsNullType.next()); + } + + @Test + public void testDatabaseMetadataGetSchemas() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + + // Test case 1: Get all schemas with catalog and check for the presence of specific schemas + ResultSet rsAll = databaseMetaData.getSchemas(PROJECT_ID, null); + Set actualSchemas = new HashSet<>(); + while (rsAll.next()) { + assertEquals(PROJECT_ID, rsAll.getString("TABLE_CATALOG")); + actualSchemas.add(rsAll.getString("TABLE_SCHEM")); + } + assertTrue(actualSchemas.contains("JDBC_INTEGRATION_DATASET")); + assertTrue(actualSchemas.contains("JDBC_TABLE_TYPES_TEST")); + assertTrue(actualSchemas.contains("ODBC_TEST_DATASET")); + + // Test case 2: Get schemas with catalog and schemaPattern matching "JDBC_NIGHTLY_IT_DATASET" + ResultSet rsPattern = databaseMetaData.getSchemas(PROJECT_ID, "JDBC_NIGHTLY_IT_DATASET"); + Set actualSchemasPattern = new HashSet<>(); + while (rsPattern.next()) { + assertEquals(PROJECT_ID, rsPattern.getString("TABLE_CATALOG")); + actualSchemasPattern.add(rsPattern.getString("TABLE_SCHEM")); + } + assertTrue(actualSchemasPattern.contains("JDBC_NIGHTLY_IT_DATASET")); + assertEquals(1, actualSchemasPattern.size()); + + // Test case 3: Get schemas with catalog and schemaPattern matching "nonexistent" + ResultSet rsNoMatch = databaseMetaData.getSchemas(PROJECT_ID, "nonexistent"); + assertFalse(rsNoMatch.next()); + + // Test case 4: Get schemas with non-existent catalog + rsNoMatch = databaseMetaData.getSchemas("invalid-catalog", null); + assertFalse(rsNoMatch.next()); + } + + @Test + public void testDatabaseMetadataGetSchemasNoArgs() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + String expectedCatalog = bigQueryConnection.getCatalog(); + assertNotNull("Project ID (catalog) from connection should not be null", expectedCatalog); + + // Test case: Get all schemas (datasets) for the current project + try (ResultSet rsAll = databaseMetaData.getSchemas()) { + assertNotNull("ResultSet from getSchemas() should not be null", rsAll); + boolean foundTestDataset = false; + int rowCount = 0; + while (rsAll.next()) { + rowCount++; + assertEquals( + "TABLE_CATALOG should match the connection's project ID", + expectedCatalog, + rsAll.getString("TABLE_CATALOG")); + String schemaName = rsAll.getString("TABLE_SCHEM"); + assertNotNull("TABLE_SCHEM should not be null", schemaName); + if (DATASET.equals(schemaName) + || DATASET2.equals(schemaName) + || CONSTRAINTS_DATASET.equals(schemaName) + || "JDBC_TABLE_TYPES_TEST".equals(schemaName) + || "JDBC_INTEGRATION_DATASET".equals(schemaName)) { + foundTestDataset = true; + } + } + assertTrue("At least one of the known test datasets should be found", foundTestDataset); + assertTrue("Should retrieve at least one schema/dataset", rowCount > 0); + } + } + + @Test + public void testDatabaseMetaDataGetFunctions() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + String testSchema = "JDBC_TABLE_TYPES_TEST"; + String testCatalog = PROJECT_ID; + + Set expectedFunctionNames = + new HashSet<>( + Arrays.asList( + "complex_scalar_sql_udf", + "persistent_sql_udf_named_params", + "scalar_js_udf", + "scalar_sql_udf")); + + // Test 1: Get all functions from a specific schema + ResultSet rsAll = databaseMetaData.getFunctions(testCatalog, testSchema, null); + Set foundFunctionNames = new HashSet<>(); + int countAll = 0; + while (rsAll.next()) { + countAll++; + assertEquals(testCatalog, rsAll.getString("FUNCTION_CAT")); + assertEquals(testSchema, rsAll.getString("FUNCTION_SCHEM")); + String funcName = rsAll.getString("FUNCTION_NAME"); + foundFunctionNames.add(funcName); + assertNull(rsAll.getString("REMARKS")); + assertEquals(DatabaseMetaData.functionResultUnknown, rsAll.getShort("FUNCTION_TYPE")); + assertEquals(funcName, rsAll.getString("SPECIFIC_NAME")); + } + assertEquals( + "Should find all " + expectedFunctionNames.size() + " functions in " + testSchema, + expectedFunctionNames.size(), + countAll); + assertEquals(expectedFunctionNames, foundFunctionNames); + rsAll.close(); + + // Test 2: Get a specific function using functionNamePattern + String specificFunctionName = "scalar_sql_udf"; + ResultSet rsSpecific = + databaseMetaData.getFunctions(testCatalog, testSchema, specificFunctionName); + assertTrue("Should find the specific function " + specificFunctionName, rsSpecific.next()); + assertEquals(testCatalog, rsSpecific.getString("FUNCTION_CAT")); + assertEquals(testSchema, rsSpecific.getString("FUNCTION_SCHEM")); + assertEquals(specificFunctionName, rsSpecific.getString("FUNCTION_NAME")); + assertNull(rsSpecific.getString("REMARKS")); + assertEquals(DatabaseMetaData.functionResultUnknown, rsSpecific.getShort("FUNCTION_TYPE")); + assertEquals(specificFunctionName, rsSpecific.getString("SPECIFIC_NAME")); + assertFalse("Should only find one row for exact function match", rsSpecific.next()); + rsSpecific.close(); + + // Test 3: Get functions using a wildcard functionNamePattern "scalar%" + // Expected order due to sorting: scalar_js_udf, scalar_sql_udf + ResultSet rsWildcard = databaseMetaData.getFunctions(testCatalog, testSchema, "scalar%"); + assertTrue("Should find functions matching 'scalar%'", rsWildcard.next()); + assertEquals("scalar_js_udf", rsWildcard.getString("FUNCTION_NAME")); + assertEquals(DatabaseMetaData.functionResultUnknown, rsWildcard.getShort("FUNCTION_TYPE")); + + assertTrue("Should find the second function matching 'scalar%'", rsWildcard.next()); + assertEquals("scalar_sql_udf", rsWildcard.getString("FUNCTION_NAME")); + assertEquals(DatabaseMetaData.functionResultUnknown, rsWildcard.getShort("FUNCTION_TYPE")); + assertFalse("Should be no more functions matching 'scalar%'", rsWildcard.next()); + rsWildcard.close(); + + // Test 4: Schema pattern with wildcard + ResultSet rsSchemaWildcard = + databaseMetaData.getFunctions(testCatalog, "JDBC_TABLE_TYPES_T%", "complex_scalar_sql_udf"); + assertTrue("Should find function with schema wildcard", rsSchemaWildcard.next()); + assertEquals(testSchema, rsSchemaWildcard.getString("FUNCTION_SCHEM")); + assertEquals("complex_scalar_sql_udf", rsSchemaWildcard.getString("FUNCTION_NAME")); + assertFalse( + "Should only find one row for this schema wildcard and specific function", + rsSchemaWildcard.next()); + rsSchemaWildcard.close(); + + // Test 5: Non-existent function + ResultSet rsNonExistentFunc = + databaseMetaData.getFunctions(testCatalog, testSchema, "non_existent_function_xyz123"); + assertFalse("Should not find a non-existent function", rsNonExistentFunc.next()); + rsNonExistentFunc.close(); + + // Test 6: Non-existent schema + ResultSet rsNonExistentSchema = + databaseMetaData.getFunctions(testCatalog, "NON_EXISTENT_SCHEMA_XYZ123", null); + assertFalse("Should not find functions in a non-existent schema", rsNonExistentSchema.next()); + rsNonExistentSchema.close(); + + // Test 7: Empty schema pattern + ResultSet rsEmptySchema = databaseMetaData.getFunctions(testCatalog, "", null); + assertFalse("Empty schema pattern should return no results", rsEmptySchema.next()); + rsEmptySchema.close(); + + // Test 8: Empty function name pattern + ResultSet rsEmptyFunction = databaseMetaData.getFunctions(testCatalog, testSchema, ""); + assertFalse("Empty function name pattern should return no results", rsEmptyFunction.next()); + rsEmptyFunction.close(); + + // Test 9: Null catalog + ResultSet rsNullCatalog = databaseMetaData.getFunctions(null, testSchema, null); + assertFalse("Null catalog should return no results", rsNullCatalog.next()); + rsNullCatalog.close(); + } + + @Test + public void testDatabaseMetadataGetFunctionColumns() throws SQLException { + DatabaseMetaData databaseMetaData = bigQueryConnection.getMetaData(); + String testCatalog = PROJECT_ID; + String testSchema = "JDBC_TABLE_TYPES_TEST"; + + // Test Case 1: Specific function 'scalar_sql_udf', specific column 'x' + String specificFunction1 = "scalar_sql_udf"; + String specificColumn1 = "x"; + ResultSet rs = + databaseMetaData.getFunctionColumns( + testCatalog, testSchema, specificFunction1, specificColumn1); + + assertTrue("Should find column 'x' for function 'scalar_sql_udf'", rs.next()); + assertEquals(testCatalog, rs.getString("FUNCTION_CAT")); + assertEquals(testSchema, rs.getString("FUNCTION_SCHEM")); + assertEquals(specificFunction1, rs.getString("FUNCTION_NAME")); + assertEquals(specificColumn1, rs.getString("COLUMN_NAME")); + assertEquals(DatabaseMetaData.functionColumnUnknown, rs.getShort("COLUMN_TYPE")); + assertEquals(Types.BIGINT, rs.getInt("DATA_TYPE")); + assertEquals("BIGINT", rs.getString("TYPE_NAME")); + assertEquals(19, rs.getInt("PRECISION")); + assertEquals(null, rs.getObject("LENGTH")); + assertTrue(rs.wasNull()); + assertEquals(0, rs.getShort("SCALE")); + assertEquals(10, rs.getShort("RADIX")); + assertEquals(DatabaseMetaData.functionNullableUnknown, rs.getShort("NULLABLE")); + assertNull(rs.getString("REMARKS")); + assertEquals(null, rs.getObject("CHAR_OCTET_LENGTH")); + assertTrue(rs.wasNull()); + assertEquals(1, rs.getInt("ORDINAL_POSITION")); + assertEquals("", rs.getString("IS_NULLABLE")); + assertEquals(specificFunction1, rs.getString("SPECIFIC_NAME")); + assertFalse("Should only find one row for exact column match", rs.next()); + rs.close(); + + // Test Case 2: Specific function 'complex_scalar_sql_udf', specific column 'arr' + String specificFunction2 = "complex_scalar_sql_udf"; + String specificColumn2 = "arr"; + rs = + databaseMetaData.getFunctionColumns( + testCatalog, testSchema, specificFunction2, specificColumn2); + assertTrue("Should find column 'arr' for function 'complex_scalar_sql_udf'", rs.next()); + assertEquals(testCatalog, rs.getString("FUNCTION_CAT")); + assertEquals(testSchema, rs.getString("FUNCTION_SCHEM")); + assertEquals(specificFunction2, rs.getString("FUNCTION_NAME")); + assertEquals(specificColumn2, rs.getString("COLUMN_NAME")); + assertEquals(DatabaseMetaData.functionColumnUnknown, rs.getShort("COLUMN_TYPE")); + assertEquals(Types.ARRAY, rs.getInt("DATA_TYPE")); + assertEquals("ARRAY", rs.getString("TYPE_NAME")); + assertEquals(null, rs.getObject("PRECISION")); + assertTrue(rs.wasNull()); + assertEquals(null, rs.getObject("LENGTH")); + assertTrue(rs.wasNull()); + assertEquals(null, rs.getObject("SCALE")); + assertTrue(rs.wasNull()); + assertEquals(null, rs.getObject("RADIX")); + assertTrue(rs.wasNull()); + assertEquals(DatabaseMetaData.functionNullableUnknown, rs.getShort("NULLABLE")); + assertNull(rs.getString("REMARKS")); + assertEquals(null, rs.getObject("CHAR_OCTET_LENGTH")); + assertTrue(rs.wasNull()); + assertEquals(1, rs.getInt("ORDINAL_POSITION")); + assertEquals("", rs.getString("IS_NULLABLE")); + assertEquals(specificFunction2, rs.getString("SPECIFIC_NAME")); + assertFalse("Should only find one row for exact column match", rs.next()); + rs.close(); + + // Test Case 3: All columns for 'persistent_sql_udf_named_params' (sorted by ordinal position) + String specificFunction3 = "persistent_sql_udf_named_params"; + rs = databaseMetaData.getFunctionColumns(testCatalog, testSchema, specificFunction3, null); + assertTrue("Should find columns for " + specificFunction3, rs.next()); + assertEquals(specificFunction3, rs.getString("FUNCTION_NAME")); + assertEquals("value1", rs.getString("COLUMN_NAME")); // Ordinal Position 1 + assertEquals(DatabaseMetaData.functionColumnUnknown, rs.getShort("COLUMN_TYPE")); + assertEquals(Types.BIGINT, rs.getInt("DATA_TYPE")); + assertEquals("BIGINT", rs.getString("TYPE_NAME")); + assertEquals(1, rs.getInt("ORDINAL_POSITION")); + + assertTrue("Should find second column for " + specificFunction3, rs.next()); + assertEquals(specificFunction3, rs.getString("FUNCTION_NAME")); + assertEquals("value-two", rs.getString("COLUMN_NAME")); // Ordinal Position 2 + assertEquals(DatabaseMetaData.functionColumnUnknown, rs.getShort("COLUMN_TYPE")); + assertEquals(Types.NVARCHAR, rs.getInt("DATA_TYPE")); + assertEquals("NVARCHAR", rs.getString("TYPE_NAME")); + assertEquals(2, rs.getInt("ORDINAL_POSITION")); + assertFalse("Should be no more columns for " + specificFunction3, rs.next()); + rs.close(); + + // Test Case 4: Wildcard for function name "scalar%", specific column name "x" + rs = databaseMetaData.getFunctionColumns(testCatalog, testSchema, "scalar%", "x"); + assertTrue("Should find column 'x' for functions matching 'scalar%'", rs.next()); + assertEquals("scalar_sql_udf", rs.getString("FUNCTION_NAME")); + assertEquals("x", rs.getString("COLUMN_NAME")); + assertEquals(1, rs.getInt("ORDINAL_POSITION")); + assertFalse("Should be no more columns named 'x' for functions matching 'scalar%'", rs.next()); + rs.close(); + + // Test Case 5: Wildcard for column name "%" for 'scalar_js_udf' + String specificFunction4 = "scalar_js_udf"; + rs = databaseMetaData.getFunctionColumns(testCatalog, testSchema, specificFunction4, "%"); + assertTrue("Should find columns for " + specificFunction4 + " with wildcard", rs.next()); + assertEquals(specificFunction4, rs.getString("FUNCTION_NAME")); + assertEquals("name", rs.getString("COLUMN_NAME")); // Ordinal Position 1 + assertEquals(1, rs.getInt("ORDINAL_POSITION")); + + assertTrue("Should find second column for " + specificFunction4 + " with wildcard", rs.next()); + assertEquals(specificFunction4, rs.getString("FUNCTION_NAME")); + assertEquals("age", rs.getString("COLUMN_NAME")); // Ordinal Position 2 + assertEquals(2, rs.getInt("ORDINAL_POSITION")); + assertFalse("Should be no more columns for " + specificFunction4 + " with wildcard", rs.next()); + rs.close(); + + // Test Case 6: Non-existent function + rs = + databaseMetaData.getFunctionColumns( + testCatalog, testSchema, "non_existent_function_xyz", null); + assertFalse("Should not find columns for a non-existent function", rs.next()); + rs.close(); + } + + @Test + public void testRangeDataTypeWithJsonResultSet() throws SQLException { + String RANGE_DATA_TABLE = "JDBC_RANGE_DATA_TEST_TABLE_" + random.nextInt(99); + String range_date_literal = "RANGE '[2020-01-01, 2020-01-31)'"; + String range_datetime_literal = "RANGE '[2020-01-01 12:00:00, 2020-01-31 12:00:00)'"; + String range_timestamp_literal = + "RANGE '[2020-01-01 12:00:00+08, 2020-01-31 12:00:00+08)'"; + + String createRangeTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `range_date` RANGE," + + " `range_date_time` RANGE, `range_timestamp` RANGE);", + DATASET, RANGE_DATA_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, range_date, range_date_time, range_timestamp) VALUES (1, %s," + + " %s, %s);", + DATASET, + RANGE_DATA_TABLE, + range_date_literal, + range_datetime_literal, + range_timestamp_literal); + String selectQuery = + String.format( + "SELECT id, range_date, range_date_time, range_timestamp FROM %s.%s WHERE id = 1;", + DATASET, RANGE_DATA_TABLE); + + boolean status = bigQueryStatement.execute(createRangeTable); + assertFalse(status); + + status = bigQueryStatement.execute(insertQuery); + assertFalse(status); + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + + Integer numRows = 0; + String actual_range_date = ""; + String actual_range_datetime = ""; + String actual_range_timestamp = ""; + + while (resultSet.next()) { + numRows++; + actual_range_date = resultSet.getString("range_date"); + actual_range_datetime = resultSet.getString("range_date_time"); + actual_range_timestamp = resultSet.getString("range_timestamp"); + } + + String expected_range_date = "[2020-01-01, 2020-01-31)"; + String expected_range_datetime = "[2020-01-01T12:00:00, 2020-01-31T12:00:00)"; + String expected_range_timestamp = "[1577851200.000000, 1580443200.000000)"; + + assertThat(numRows).isEqualTo(1); + assertThat(actual_range_date).isEqualTo(expected_range_date); + assertThat(actual_range_datetime).isEqualTo(expected_range_datetime); + assertThat(actual_range_timestamp).isEqualTo(expected_range_timestamp); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, RANGE_DATA_TABLE)); + } + + @Test + public void testRangeDataTypeWithArrowResultSet() throws SQLException { + String selectQuery = + "select * from `DATATYPERANGETEST.RangeIntervalTestTable` order by intColumn limit 5000;"; + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";MaxResults=500;HighThroughputActivationRatio=1;" + + "HighThroughputMinTableSize=100;" + + "EnableHighThroughputAPI=1;JobCreationMode=1;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertTrue(resultSet.getClass().getName().contains("BigQueryArrowResultSet")); + resultSet.next(); + assertEquals("[2024-07-14, 2024-09-23)", resultSet.getString("rangeField")); + connection.close(); + } + + @Test + public void testPrepareCallSql() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc"); + assertNotNull(callableStatement); + callableStatement.close(); + } + + @Test + public void testRegisterOutParamIndex() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + callableStatement.registerOutParameter(1, Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testRegisterOutParamName() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testRegisterOutParamIndexScale() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + callableStatement.registerOutParameter(1, Types.NUMERIC, 2); + callableStatement.close(); + } + + @Test + public void testRegisterOutParamNameScale() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.NUMERIC, 2); + callableStatement.close(); + } + + @Test + public void testPrepareCallSqlResultSetTypeConcurrency() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + assertNotNull(callableStatement); + callableStatement.close(); + } + + @Test + public void testPrepareCallConcurrencyRegisterOutParamIndex() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + assertNotNull(callableStatement); + callableStatement.registerOutParameter(1, Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testPrepareCallConcurrencyRegisterOutParamName() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testPrepareCallConcurrencyRegisterOutParamIndexScale() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + assertNotNull(callableStatement); + callableStatement.registerOutParameter(1, Types.NUMERIC, 2); + callableStatement.close(); + } + + @Test + public void testPrepareCallConcurrencyRegisterOutParamNameScale() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.NUMERIC, 2); + callableStatement.close(); + } + + @Test + public void testPrepareCallSqlResultSetTypeConcurrencyHoldability() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.CLOSE_CURSORS_AT_COMMIT); + assertNotNull(callableStatement); + callableStatement.close(); + } + + @Test + public void testPrepareCallHoldabilityRegisterOutParamIndex() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.CLOSE_CURSORS_AT_COMMIT); + assertNotNull(callableStatement); + callableStatement.registerOutParameter(1, Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testPrepareCallHoldabilityRegisterOutParamName() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.CLOSE_CURSORS_AT_COMMIT); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.VARCHAR); + callableStatement.close(); + } + + @Test + public void testPrepareCallHoldabilityRegisterOutParamIndexScale() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.CLOSE_CURSORS_AT_COMMIT); + assertNotNull(callableStatement); + callableStatement.close(); + } + + @Test + public void testPrepareCallHoldabilityRegisterOutParamNameScale() throws SQLException { + CallableStatement callableStatement = + this.bigQueryConnection.prepareCall( + "call testProc('?')", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.CLOSE_CURSORS_AT_COMMIT); + assertNotNull(callableStatement); + callableStatement.registerOutParameter("ParamKey", Types.NUMERIC, 2); + callableStatement.close(); + } + + @Test + public void testPrepareCallFailureResultSetType() throws SQLException { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> + this.bigQueryConnection.prepareCall( + "call testProc", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY)); + } + + @Test + public void testPrepareCallFailureResultSetConcurrency() throws SQLException { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> + this.bigQueryConnection.prepareCall( + "call testProc", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)); + } + + @Test + public void testPrepareCallFailureResultSetHoldability() throws SQLException { + assertThrows( + BigQueryJdbcSqlFeatureNotSupportedException.class, + () -> + this.bigQueryConnection.prepareCall( + "call testProc", + ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_READ_ONLY, + ResultSet.HOLD_CURSORS_OVER_COMMIT)); + } + + // Integration tests for CallableStatement Setters and Getters + @Test + public void testSetterGetterBigDecimal() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + BigDecimal expected = new BigDecimal(12344); + callableStatement.setBigDecimal(CALLABLE_STMT_PARAM_KEY, expected); + BigDecimal actual = callableStatement.getBigDecimal(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterBoolean() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Boolean expected = true; + callableStatement.setBoolean(CALLABLE_STMT_PARAM_KEY, expected); + Boolean actual = callableStatement.getBoolean(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterByte() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Byte expected = "hello".getBytes()[0]; + callableStatement.setByte(CALLABLE_STMT_PARAM_KEY, expected); + Byte actual = callableStatement.getByte(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterBytes() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + byte[] expected = "hello".getBytes(); + callableStatement.setBytes(CALLABLE_STMT_PARAM_KEY, expected); + byte[] actual = callableStatement.getBytes(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterDate() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Date expected = new Date(1234567); + callableStatement.setDate(CALLABLE_STMT_PARAM_KEY, expected); + Date actual = callableStatement.getDate(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterDateCal() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Date expected = new Date(1L); + Calendar cal = Calendar.getInstance(); + callableStatement.setDate(CALLABLE_STMT_PARAM_KEY, expected, cal); + Date actual = callableStatement.getDate(CALLABLE_STMT_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterDouble() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Double expected = 123.2345; + callableStatement.setDouble(CALLABLE_STMT_PARAM_KEY, expected); + Double actual = callableStatement.getDouble(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterFloat() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Float expected = 123.2345F; + callableStatement.setFloat(CALLABLE_STMT_PARAM_KEY, expected); + Float actual = callableStatement.getFloat(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterInt() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Integer expected = 123; + callableStatement.setInt(CALLABLE_STMT_PARAM_KEY, expected); + Integer actual = callableStatement.getInt(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterLong() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Long expected = 123L; + callableStatement.setLong(CALLABLE_STMT_PARAM_KEY, expected); + Long actual = callableStatement.getLong(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterNString() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + String expected = "heelo"; + callableStatement.setNString(CALLABLE_STMT_PARAM_KEY, expected); + String actual = callableStatement.getNString(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterObject() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + String expected = "heelo"; + callableStatement.setObject(CALLABLE_STMT_PARAM_KEY, expected); + Object actual = callableStatement.getObject(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterObjectWithSQLType() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + String expected = "heelo"; + callableStatement.setObject(CALLABLE_STMT_PARAM_KEY, expected, Types.NVARCHAR); + Object actual = callableStatement.getObject(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterObjectWithSqlTypeAndScale() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + String expected = "heelo"; + callableStatement.setObject(CALLABLE_STMT_PARAM_KEY, expected, Types.NVARCHAR, 0); + Object actual = callableStatement.getObject(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterString() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + String expected = "123"; + callableStatement.setString(CALLABLE_STMT_PARAM_KEY, expected); + String actual = callableStatement.getString(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterTime() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Time expected = new Time(1234567); + callableStatement.setTime(CALLABLE_STMT_PARAM_KEY, expected); + Time actual = callableStatement.getTime(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterTimeCal() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Time expected = new Time(1L); + Calendar cal = Calendar.getInstance(); + callableStatement.setTime(CALLABLE_STMT_PARAM_KEY, expected, cal); + Time actual = callableStatement.getTime(CALLABLE_STMT_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterTimestamp() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Timestamp expected = new Timestamp(1234567); + callableStatement.setTimestamp(CALLABLE_STMT_PARAM_KEY, expected); + Timestamp actual = callableStatement.getTimestamp(CALLABLE_STMT_PARAM_KEY); + assertEquals(expected, actual); + } + + @Test + public void testSetterGetterTimestampCal() throws SQLException { + CallableStatement callableStatement = this.bigQueryConnection.prepareCall("call testProc('?')"); + assertNotNull(callableStatement); + Timestamp expected = new Timestamp(1L); + Calendar cal = Calendar.getInstance(); + callableStatement.setTimestamp(CALLABLE_STMT_PARAM_KEY, expected, cal); + Timestamp actual = callableStatement.getTimestamp(CALLABLE_STMT_PARAM_KEY, cal); + assertEquals(expected, actual); + } + + @Test + public void testPooledConnectionDataSourceSuccess() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + } + + @Test + public void testPooledConnectionDataSourceFailNoConnectionURl() throws SQLException { + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + + assertThrows(BigQueryJdbcException.class, () -> pooledDataSource.getPooledConnection()); + } + + @Test + public void testPooledConnectionDataSourceFailInvalidConnectionURl() { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "ListenerPoolSize=invalid"; + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + assertThrows(NumberFormatException.class, () -> pooledDataSource.getPooledConnection()); + } + + @Test + public void testPooledConnectionAddConnectionListener() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + TestConnectionListener listener = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listener); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + } + + @Test + public void testPooledConnectionRemoveConnectionListener() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + TestConnectionListener listener = new TestConnectionListener(); + pooledConnection.removeConnectionEventListener(listener); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + } + + @Test + public void testPooledConnectionConnectionClosed() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + TestConnectionListener listener = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listener); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + + connection.close(); + assertEquals(1, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + } + + @Test + public void testPooledConnectionClose() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + TestConnectionListener listener = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listener); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + + pooledConnection.close(); + assertEquals(1, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + } + + @Test + public void testPooledConnectionConnectionError() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + TestConnectionListener listener = new TestConnectionListener(); + pooledConnection.addConnectionEventListener(listener); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(0, listener.getConnectionErrorCount()); + + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + + ExecutorService executor = Executors.newFixedThreadPool(3); + connection.abort(executor); + assertEquals(0, listener.getConnectionClosedCount()); + assertEquals(1, listener.getConnectionErrorCount()); + + executor.shutdown(); + connection.close(); + pooledConnection.close(); + } + + @Test + public void testPooledConnectionListenerAddListener() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = new PooledConnectionListener(DEFAULT_CONN_POOL_SIZE); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + pooledConnection.close(); + } + + @Test + public void testPooledConnectionListenerRemoveListener() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = new PooledConnectionListener(DEFAULT_CONN_POOL_SIZE); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + pooledConnection.removeConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + pooledConnection.close(); + } + + @Test + public void testPooledConnectionListenerCloseConnection() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = new PooledConnectionListener(DEFAULT_CONN_POOL_SIZE); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + + connection.close(); + assertFalse(listener.isConnectionPoolEmpty()); + pooledConnection.close(); + } + + @Test + public void testPooledConnectionListenerClosePooledConnection() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = new PooledConnectionListener(DEFAULT_CONN_POOL_SIZE); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + pooledConnection.close(); + assertFalse(listener.isConnectionPoolEmpty()); + } + + @Test + public void testPooledConnectionListenerConnectionError() throws SQLException { + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;ConnectionPoolSize=20;ListenerPoolSize=20;"; + + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionUrl); + + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = new PooledConnectionListener(DEFAULT_CONN_POOL_SIZE); + pooledConnection.addConnectionEventListener(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + + ExecutorService executor = Executors.newFixedThreadPool(3); + connection.abort(executor); + assertTrue(listener.isConnectionPoolEmpty()); + + executor.shutdown(); + connection.close(); + pooledConnection.close(); + } + + @Test + public void testExecuteQueryWithConnectionPoolingEnabledDefaultPoolSize() throws SQLException { + String connectionURL = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";"; + assertConnectionPoolingResults(connectionURL, DEFAULT_CONN_POOL_SIZE); + } + + @Test + public void testExecuteQueryWithConnectionPoolingEnabledCustomPoolSize() throws SQLException { + String connectionURL = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";" + + "ConnectionPoolSize=" + + CUSTOM_CONN_POOL_SIZE + + ";"; + assertConnectionPoolingResults(connectionURL, CUSTOM_CONN_POOL_SIZE); + } + + private void assertConnectionPoolingResults(String connectionURL, Long connectionPoolSize) + throws SQLException { + // Create Pooled Connection Datasource + PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); + pooledDataSource.setURL(connectionURL); + + // Get pooled connection and ensure listner was added with default connection pool size. + PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); + assertNotNull(pooledConnection); + PooledConnectionListener listener = pooledDataSource.getConnectionPoolManager(); + assertNotNull(listener); + assertTrue(listener.isConnectionPoolEmpty()); + + // Get Underlying physical connection + Connection connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + + // Execute query with physical connection + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 850"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + + // Close physical connection + connection.close(); + assertFalse(listener.isConnectionPoolEmpty()); + assertEquals(1, listener.getConnectionPoolCurrentCapacity()); + assertEquals(connectionPoolSize, listener.getConnectionPoolSize()); + + // Reuse same physical connection. + connection = pooledConnection.getConnection(); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertFalse(listener.isConnectionPoolEmpty()); + assertEquals(1, listener.getConnectionPoolCurrentCapacity()); + assertEquals(connectionPoolSize, listener.getConnectionPoolSize()); + + // Execute query with reusable physical connection + jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + + // Return connection back to the pool. + connection.close(); + assertFalse(listener.isConnectionPoolEmpty()); + assertEquals(1, listener.getConnectionPoolCurrentCapacity()); + assertEquals(connectionPoolSize, listener.getConnectionPoolSize()); + pooledConnection.close(); + } + + @Test + public void testAdditionalProjectsInMetadata() throws SQLException { + String additionalProjectsValue = "bigquery-public-data"; + String datasetInAdditionalProject = "baseball"; + + String urlWithAdditionalProjects = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=" + + PROJECT_ID + + ";OAuthType=3" + + ";AdditionalProjects=" + + additionalProjectsValue; + + try (Connection conn = DriverManager.getConnection(urlWithAdditionalProjects)) { + DatabaseMetaData dbMetaData = conn.getMetaData(); + + // 1. Test getCatalogs() + Set foundCatalogs = new HashSet<>(); + try (ResultSet catalogsRs = dbMetaData.getCatalogs()) { + while (catalogsRs.next()) { + foundCatalogs.add(catalogsRs.getString("TABLE_CAT")); + } + } + assertTrue( + "getCatalogs() should contain the primary project ID", + foundCatalogs.contains(PROJECT_ID)); + assertTrue( + "getCatalogs() should contain the additional project ID", + foundCatalogs.contains(additionalProjectsValue)); + + // 2. Test getSchemas() + Set catalogsForSchemasFromAll = new HashSet<>(); + boolean foundAdditionalDataset = false; + try (ResultSet schemasRs = dbMetaData.getSchemas()) { + while (schemasRs.next()) { + String schemaName = schemasRs.getString("TABLE_SCHEM"); + String catalogName = schemasRs.getString("TABLE_CATALOG"); + catalogsForSchemasFromAll.add(catalogName); + if (additionalProjectsValue.equals(catalogName) + && datasetInAdditionalProject.equals(schemaName)) { + foundAdditionalDataset = true; + } + } + } + assertTrue( + "getSchemas() should list datasets from the primary project", + catalogsForSchemasFromAll.contains(PROJECT_ID)); + assertTrue( + "getSchemas() should list datasets from the additional project", + catalogsForSchemasFromAll.contains(additionalProjectsValue)); + assertTrue( + "Known dataset from additional project not found in getSchemas()", + foundAdditionalDataset); + + } catch (SQLException e) { + System.err.println("SQL Error during AdditionalProjects test: " + e.getMessage()); + throw e; + } + } + + @Test + public void testFilterTablesOnDefaultDataset_getTables() throws SQLException { + String defaultDatasetValue = CONSTRAINTS_DATASET; + String table1InDefaultDataset = CONSTRAINTS_TABLE_NAME; + String table2InDefaultDataset = CONSTRAINTS_TABLE_NAME2; + + String specificDatasetValue = "JDBC_TABLE_TYPES_TEST"; + String table1InSpecificDataset = "base_table"; + String table2InSpecificDataset = "external_table"; + + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=" + + PROJECT_ID + + ";OAuthType=3" + + ";DefaultDataset=" + + defaultDatasetValue + + ";FilterTablesOnDefaultDataset=1"; + try (Connection conn = DriverManager.getConnection(connectionUrl)) { + DatabaseMetaData dbMetaData = conn.getMetaData(); + + // Case 1: Catalog and schemaPattern are null/wildcard, should use DefaultDataset + try (ResultSet rs = dbMetaData.getTables(null, null, null, null)) { + Set tableNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(defaultDatasetValue, rs.getString("TABLE_SCHEM")); + tableNames.add(rs.getString("TABLE_NAME")); + } + assertTrue(tableNames.contains(table1InDefaultDataset)); + assertTrue(tableNames.contains(table2InDefaultDataset)); + } + + // Case 2: Explicit schemaPattern overrides DefaultDataset + try (ResultSet rs = dbMetaData.getTables(null, specificDatasetValue, null, null)) { + Set tableNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(specificDatasetValue, rs.getString("TABLE_SCHEM")); + tableNames.add(rs.getString("TABLE_NAME")); + } + assertTrue(tableNames.contains(table1InSpecificDataset)); + assertTrue(tableNames.contains(table2InSpecificDataset)); + } + + // Case 3: Explicit catalog, schemaPattern is null/wildcard, should use DefaultDataset within + // that catalog + try (ResultSet rs = dbMetaData.getTables(PROJECT_ID, null, null, null)) { + Set tableNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(defaultDatasetValue, rs.getString("TABLE_SCHEM")); + tableNames.add(rs.getString("TABLE_NAME")); + } + assertTrue(tableNames.contains(table1InDefaultDataset)); + assertTrue(tableNames.contains(table2InDefaultDataset)); + } + + // Case 4: Explicit catalog and schemaPattern override DefaultDataset + try (ResultSet rs = dbMetaData.getTables(PROJECT_ID, specificDatasetValue, null, null)) { + Set tableNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(specificDatasetValue, rs.getString("TABLE_SCHEM")); + tableNames.add(rs.getString("TABLE_NAME")); + } + assertTrue(tableNames.contains(table1InSpecificDataset)); + assertTrue(tableNames.contains(table2InSpecificDataset)); + } + } + } + + @Test + public void testFilterTablesOnDefaultDataset_getColumns() throws SQLException { + String defaultDatasetValue = CONSTRAINTS_DATASET; + String tableInDefaultDataset = CONSTRAINTS_TABLE_NAME; + String[] columnsInDefaultTable = {"id", "name", "second_name", "address"}; + + String specificDatasetValue = "JDBC_TABLE_TYPES_TEST"; + String tableInSpecificDataset = "base_table"; + String[] columnsInSpecificTable = {"id", "name", "created_at"}; + + String connectionUrl = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=" + + PROJECT_ID + + ";OAuthType=3" + + ";DefaultDataset=" + + defaultDatasetValue + + ";FilterTablesOnDefaultDataset=1"; + + try (Connection conn = DriverManager.getConnection(connectionUrl)) { + DatabaseMetaData dbMetaData = conn.getMetaData(); + + // Case 1: Catalog and schemaPattern are null/wildcard, should use DefaultDataset + try (ResultSet rs = dbMetaData.getColumns(null, null, tableInDefaultDataset, null)) { + Set columnNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(defaultDatasetValue, rs.getString("TABLE_SCHEM")); + assertEquals(tableInDefaultDataset, rs.getString("TABLE_NAME")); + columnNames.add(rs.getString("COLUMN_NAME")); + } + for (String expectedCol : columnsInDefaultTable) { + assertTrue(columnNames.contains(expectedCol)); + } + assertEquals(columnsInDefaultTable.length, columnNames.size()); + } + + // Case 2: Explicit schemaPattern overrides DefaultDataset + try (ResultSet rs = + dbMetaData.getColumns(null, specificDatasetValue, tableInSpecificDataset, null)) { + Set columnNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(specificDatasetValue, rs.getString("TABLE_SCHEM")); + assertEquals(tableInSpecificDataset, rs.getString("TABLE_NAME")); + columnNames.add(rs.getString("COLUMN_NAME")); + } + for (String expectedCol : columnsInSpecificTable) { + assertTrue(columnNames.contains(expectedCol)); + } + assertEquals(columnsInSpecificTable.length, columnNames.size()); + } + + // Case 3: Explicit catalog, schemaPattern is null/wildcard, should use DefaultDataset within + // that catalog + try (ResultSet rs = dbMetaData.getColumns(PROJECT_ID, null, tableInDefaultDataset, null)) { + Set columnNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(defaultDatasetValue, rs.getString("TABLE_SCHEM")); + assertEquals(tableInDefaultDataset, rs.getString("TABLE_NAME")); + columnNames.add(rs.getString("COLUMN_NAME")); + } + for (String expectedCol : columnsInDefaultTable) { + assertTrue(columnNames.contains(expectedCol)); + } + assertEquals(columnsInDefaultTable.length, columnNames.size()); + } + + // Case 4: Explicit catalog and schemaPattern override DefaultDataset + try (ResultSet rs = + dbMetaData.getColumns(PROJECT_ID, specificDatasetValue, tableInSpecificDataset, null)) { + Set columnNames = new HashSet<>(); + while (rs.next()) { + assertEquals(PROJECT_ID, rs.getString("TABLE_CAT")); + assertEquals(specificDatasetValue, rs.getString("TABLE_SCHEM")); + assertEquals(tableInSpecificDataset, rs.getString("TABLE_NAME")); + columnNames.add(rs.getString("COLUMN_NAME")); + } + for (String expectedCol : columnsInSpecificTable) { + assertTrue(columnNames.contains(expectedCol)); + } + assertEquals(columnsInSpecificTable.length, columnNames.size()); + } + } + } + + @Test + public void testAlterTable() throws SQLException { + String TABLE_NAME = "JDBC_ALTER_TABLE_" + randomNumber; + String createQuery = + String.format("CREATE OR REPLACE TABLE %s.%s (`StringField` STRING);", DATASET, TABLE_NAME); + String addColumnQuery = + String.format("ALTER TABLE %s.%s ADD COLUMN `IntegerField` INTEGER;", DATASET, TABLE_NAME); + String dropColumnQuery = + String.format( + "UPDATE %s.%s SET StringField='Jane Doe' WHERE IntegerField=111", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT * FROM %s.%s", DATASET, TABLE_NAME); + + int createStatus = bigQueryStatement.executeUpdate(createQuery); + assertEquals(0, createStatus); + + int addColumnStatus = bigQueryStatement.executeUpdate(addColumnQuery); + assertEquals(0, addColumnStatus); + + bigQueryStatement.executeQuery(selectQuery); + int selectStatus = bigQueryStatement.getUpdateCount(); + assertEquals(-1, selectStatus); + + int dropColumnStatus = bigQueryStatement.executeUpdate(dropColumnQuery); + assertEquals(0, dropColumnStatus); + + int dropStatus = bigQueryStatement.executeUpdate(dropQuery); + assertEquals(0, dropStatus); + + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TABLE_NAME)); + } + + public void testQueryPropertyDataSetProjectIdQueriesToCorrectDataset() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=dataset_project_id=" + + PROJECT_ID + + ";"; + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (15, 'Farhan', 25);", + "INTEGRATION_TESTS", "Test_Table"); + String selectQuery = + "SELECT * FROM `bigquery-devtools-drivers.INTEGRATION_TESTS.Test_Table` WHERE age=25;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + statement.execute(insertQuery); + + // assertions + boolean result = statement.execute(selectQuery); + assertTrue(result); + + // clean up + String deleteQuery = + String.format("DELETE FROM %s.%s WHERE age=25", "INTEGRATION_TESTS", "Test_Table"); + statement.execute(deleteQuery); + connection.close(); + } + + @Test + public void testQueryPropertyDataSetProjectIdQueriesToIncorrectDatasetThrows() + throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=dataset_project_id=bigquerytestdefault" + + ";"; + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (15, 'Farhan', 25);", + "INTEGRATION_TESTS", "Test_Table"); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act & assertion + assertThrows(BigQueryJdbcException.class, () -> statement.execute(insertQuery)); + connection.close(); + } + + @Test + public void testQueryPropertyTimeZoneQueries() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=time_zone=America/New_York;"; + String query = "SELECT * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(query); + + // assertions + assertNotNull(resultSet); + assertTrue(resultSet.next()); + connection.close(); + } + + @Test + public void testQueryPropertySessionIdSetsStatementSession() + throws SQLException, InterruptedException { + String sessionId = getSessionId(); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=session_id=" + + sessionId + + ";"; + String selectQuery = + "INSERT INTO `bigquery-devtools-drivers.JDBC_INTEGRATION_DATASET.No_KMS_Test_table` (id," + + " name, age) VALUES (132, 'Batman', 531);"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + boolean resultSet = statement.execute(selectQuery); + + // assertions + assertFalse(resultSet); + + // clean up + String deleteQuery = + String.format("DELETE FROM %s.%s WHERE age=25", "INTEGRATION_TESTS", "Test_Table"); + statement.execute(deleteQuery); + connection.close(); + } + + @Test + public void testEncryptedTableWithKmsQueries() throws SQLException { + // setup + String KMSKeyName = requireEnvVar("KMS_RESOURCE_PATH"); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";KMSKeyName=" + + KMSKeyName + + ";"; + String selectQuery = "SELECT * FROM `JDBC_INTEGRATION_DATASET.KMS_Test_table`;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectQuery); + + // assertions for data not encrypted + assertNotNull(resultSet); + assertTrue(resultSet.next()); + assertEquals("Farhan", resultSet.getString("name")); + connection.close(); + } + + @Test + public void testIncorrectKmsThrows() throws SQLException { + String KMSKeyName = requireEnvVar("KMS_RESOURCE_PATH"); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";KMSKeyName=" + + KMSKeyName + + ";"; + String selectQuery = + "INSERT INTO `bigquery-devtools-drivers.JDBC_INTEGRATION_DATASET.No_KMS_Test_table` (id," + + " name, age) VALUES (132, 'Batman', 531);"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act & assertion + assertThrows(BigQueryJdbcException.class, () -> statement.execute(selectQuery)); + connection.close(); + } + + @Test + public void testQueryPropertyServiceAccountFollowsIamPermission() throws SQLException { + final String SERVICE_ACCOUNT_EMAIL = requireEnvVar("SA_EMAIL"); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=service_account=" + + SERVICE_ACCOUNT_EMAIL + + ";"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(String.format(BASE_QUERY, 100)); + + // assertions + assertNotNull(resultSet); + assertTrue(resultSet.next()); + connection.close(); + } + + @Test + public void testValidLegacySQLStatement() throws SQLException { + String legacyJoinQuery = + "SELECT\n" + + " repo_name\n" + + "FROM\n" + + " [bigquery-public-data.github_repos.commits],\n" + + " [bigquery-public-data.github_repos.sample_commits] LIMIT 10"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;"; + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + + boolean result = statement.execute(legacyJoinQuery); + assertTrue(result); + connection.close(); + } + + @Test + public void testMultipleTransactionsThrowsUnsupported() throws SQLException { + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.execute("BEGIN TRANSACTION;")); + connection.close(); + } + + @Test + public void testConnectionWithMultipleTransactionCommits() throws SQLException { + String TRANSACTION_TABLE = "JDBC_MULTI_COMMIT_TABLE" + randomNumber; + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'DwightShrute', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + + Connection connection = DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + + Statement statement = connection.createStatement(); + statement.execute(insertQuery); + statement.execute(updateQuery); + connection.commit(); // First transaction + + // After commit, a new transaction should have started. + // Executing another query and then rolling it back. + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (15, 'MichaelScott', 25);", + DATASET, TRANSACTION_TABLE); + statement.execute(insertQuery2); + connection.rollback(); // Second transaction + + // Verify state with the static bigQueryStatement + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + int count = 0; + while (resultSet.next()) { + count++; + assertEquals(14, resultSet.getInt("age")); + } + assertEquals(1, count); // Only first transaction should be committed. + + // Verify the second insert was rolled back + ResultSet rs2 = + bigQueryStatement.executeQuery( + String.format("SELECT * FROM %s.%s WHERE id=15", DATASET, TRANSACTION_TABLE)); + assertFalse(rs2.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %s.%s", DATASET, TRANSACTION_TABLE)); + + statement.close(); + connection.close(); + } + + // Private Helper functions + private String getSessionId() throws InterruptedException { + QueryJobConfiguration stubJobConfig = + QueryJobConfiguration.newBuilder("Select 1;").setCreateSession(true).build(); + Job job = bigQuery.create(JobInfo.of(stubJobConfig)); + job = job.waitFor(); + Job stubJob = bigQuery.getJob(job.getJobId()); + return stubJob.getStatistics().getSessionInfo().getSessionId(); + } + + @Test + public void testCallableStatementScriptExecuteUpdate() throws SQLException { + int randomNum = java.util.UUID.randomUUID().hashCode(); + String insertName = "callable-statement-dml-insert-test"; + String insertResult = String.format("%s-%d", insertName, randomNum); + String updateName = "callable-statement-dml-update-test"; + String updateResult = String.format("%s-%d", updateName, randomNum); + String selectStmtQuery = + String.format("SELECT * FROM %s.%s WHERE id = ?", DATASET, CALLABLE_STMT_DML_TABLE_NAME); + String insertCallStmtQuery = + String.format("CALL %s.%s(?,?,?);", DATASET, CALLABLE_STMT_DML_INSERT_PROC_NAME); + String updateCallStmtQuery = + String.format("CALL %s.%s(?,?,?);", DATASET, CALLABLE_STMT_DML_UPDATE_PROC_NAME); + String deleteCallStmtQuery = + String.format("CALL %s.%s(?);", DATASET, CALLABLE_STMT_DML_DELETE_PROC_NAME); + + // DML INSERT + CallableStatement callableStatement = bigQueryConnection.prepareCall(insertCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setString(1, insertName); + callableStatement.setInt(2, randomNum); + callableStatement.setString(3, insertResult); + int rowsInserted = callableStatement.executeUpdate(); + assertEquals(1, rowsInserted); + + PreparedStatement preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + ResultSet rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertTrue(rs.next()); + + assertEquals(insertName, rs.getString(1)); + assertEquals(randomNum, rs.getInt(2)); + assertEquals(insertResult, rs.getString(3)); + + // DML UPDATE + callableStatement = bigQueryConnection.prepareCall(updateCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setString(1, updateName); + callableStatement.setInt(2, randomNum); + callableStatement.setString(3, updateResult); + int rowsUpdated = callableStatement.executeUpdate(); + assertEquals(1, rowsUpdated); + + preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertTrue(rs.next()); + + assertEquals(updateName, rs.getString(1)); + assertEquals(randomNum, rs.getInt(2)); + assertEquals(updateResult, rs.getString(3)); + + // DML DELETE + callableStatement = bigQueryConnection.prepareCall(deleteCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setInt(1, randomNum); + int rowsDeleted = callableStatement.executeUpdate(); + assertEquals(1, rowsDeleted); + + preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertFalse(rs.next()); + + callableStatement.close(); + } + + @Test + public void testCallableStatementScriptExecuteLargeUpdate() throws SQLException { + int randomNum = java.util.UUID.randomUUID().hashCode(); + String insertName = "callable-statement-dml-insert-test"; + String insertResult = String.format("%s-%d", insertName, randomNum); + String updateName = "callable-statement-dml-update-test"; + String updateResult = String.format("%s-%d", updateName, randomNum); + String selectStmtQuery = + String.format("SELECT * FROM %s.%s WHERE id = ?", DATASET, CALLABLE_STMT_DML_TABLE_NAME); + String insertCallStmtQuery = + String.format("CALL %s.%s(?,?,?);", DATASET, CALLABLE_STMT_DML_INSERT_PROC_NAME); + String updateCallStmtQuery = + String.format("CALL %s.%s(?,?,?);", DATASET, CALLABLE_STMT_DML_UPDATE_PROC_NAME); + String deleteCallStmtQuery = + String.format("CALL %s.%s(?);", DATASET, CALLABLE_STMT_DML_DELETE_PROC_NAME); + + // DML INSERT + CallableStatement callableStatement = bigQueryConnection.prepareCall(insertCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setString(1, insertName); + callableStatement.setInt(2, randomNum); + callableStatement.setString(3, insertResult); + long rowsInserted = callableStatement.executeLargeUpdate(); + assertEquals(1L, rowsInserted); + + PreparedStatement preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + ResultSet rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertTrue(rs.next()); + + assertEquals(insertName, rs.getString(1)); + assertEquals(randomNum, rs.getInt(2)); + assertEquals(insertResult, rs.getString(3)); + + // DML UPDATE + callableStatement = bigQueryConnection.prepareCall(updateCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setString(1, updateName); + callableStatement.setInt(2, randomNum); + callableStatement.setString(3, updateResult); + long rowsUpdated = callableStatement.executeLargeUpdate(); + assertEquals(1L, rowsUpdated); + + preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertTrue(rs.next()); + + assertEquals(updateName, rs.getString(1)); + assertEquals(randomNum, rs.getInt(2)); + assertEquals(updateResult, rs.getString(3)); + + // DML DELETE + callableStatement = bigQueryConnection.prepareCall(deleteCallStmtQuery); + assertNotNull(callableStatement); + callableStatement.setInt(1, randomNum); + long rowsDeleted = callableStatement.executeLargeUpdate(); + assertEquals(1L, rowsDeleted); + + preparedStatement = bigQueryConnection.prepareStatement(selectStmtQuery); + assertNotNull(preparedStatement); + preparedStatement.setInt(1, randomNum); + rs = preparedStatement.executeQuery(); + assertNotNull(rs); + assertFalse(rs.next()); + + callableStatement.close(); + } + + @Test + public void testScript() throws SQLException { + String BASE_QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 order by" + + " trip_distance asc LIMIT %s;"; + String query1 = String.format(BASE_QUERY, 5000); + String query2 = String.format(BASE_QUERY, 7000); + String query3 = String.format(BASE_QUERY, 9000); + + bigQueryStatement.execute(query1 + query2 + query3); + ResultSet resultSet = bigQueryStatement.getResultSet(); + assertEquals(5000, resultSetRowCount(resultSet)); + + boolean hasMoreResult = bigQueryStatement.getMoreResults(); + assertTrue(hasMoreResult); + resultSet = bigQueryStatement.getResultSet(); + assertEquals(7000, resultSetRowCount(resultSet)); + + hasMoreResult = bigQueryStatement.getMoreResults(); + assertTrue(hasMoreResult); + resultSet = bigQueryStatement.getResultSet(); + assertEquals(9000, resultSetRowCount(resultSet)); + } + + @Test + public void testCallableStatementScriptExecute() throws SQLException { + int randomNum = random.nextInt(99); + String callableStmtQuery = + String.format( + "DECLARE call_result STRING;" + + "CALL %s.%s(?,?,call_result);" + + "SELECT * FROM %s.%s WHERE result = call_result;", + DATASET, CALLABLE_STMT_PROC_NAME, DATASET, CALLABLE_STMT_TABLE_NAME); + CallableStatement callableStatement = bigQueryConnection.prepareCall(callableStmtQuery); + callableStatement.setString(1, "callable-stmt-test"); + callableStatement.setInt(2, randomNum); + + assertFalse(callableStatement.execute()); + assertEquals(1, callableStatement.getUpdateCount()); + + // This is an actual SELECT * from the above + assertTrue(callableStatement.getMoreResults()); + ResultSet resultSet = callableStatement.getResultSet(); + ResultSetMetaData rsMetadata = resultSet.getMetaData(); + assertEquals(3, rsMetadata.getColumnCount()); + + assertTrue(resultSet.next()); + + String expected = String.format("callable-stmt-test-%d", randomNum); + String actual = resultSet.getString(3); + + assertEquals(expected, actual); + + // Validate there are no more results + assertFalse(callableStatement.getMoreResults()); + assertEquals(-1, callableStatement.getUpdateCount()); + callableStatement.close(); + } + + @Test + public void testExecuteScriptWithExpession() throws SQLException { + int randomNum = random.nextInt(99); + String query = String.format("DECLARE x INT64; SET x = (SELECT %s); SELECT x;", randomNum); + + assertTrue(bigQueryStatement.execute(query)); + ResultSet rs = bigQueryStatement.getResultSet(); + assertTrue(rs.next()); + assertEquals(randomNum, rs.getInt(1)); + assertFalse(rs.next()); + assertFalse(bigQueryStatement.getMoreResults()); + assertEquals(-1, bigQueryStatement.getUpdateCount()); + } + + @Test + public void testInformationSchemaTables() throws SQLException { + String query = String.format("SELECT * FROM %s.INFORMATION_SCHEMA.TABLES", DATASET); + try (Statement statement = bigQueryConnection.createStatement(); + ResultSet resultSet = statement.executeQuery(query)) { + ResultSetMetaData metaData = resultSet.getMetaData(); + int columnCount = metaData.getColumnCount(); + assertTrue(columnCount > 0); + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + for (int i = 1; i <= columnCount; i++) { + Object obj = resultSet.getObject(i); + if (obj != null) { + assertNotNull(obj.toString()); + } + } + } + assertTrue(rowCount > 0); + } + } + + private void validate( + String method, + BiFunction getter, + ImmutableMap expectedResult) + throws Exception { + + try (Connection connection = DriverManager.getConnection(connection_uri); + Connection connectionHTAPI = + DriverManager.getConnection( + connection_uri + + ";HighThroughputMinTableSize=0;HighThroughputActivationRatio=0;EnableHighThroughputAPI=1;"); + Statement statement = connection.createStatement(); + Statement statementHTAPI = connectionHTAPI.createStatement()) { + + String query = + "SELECT * FROM INTEGRATION_TEST_FORMAT.all_bq_types WHERE stringField is not null"; + ResultSet resultSetRegular = statement.executeQuery(query); + ResultSet resultSetArrow = statementHTAPI.executeQuery(query); + resultSetRegular.next(); + resultSetArrow.next(); + + for (int i = 1; i <= resultSetRegular.getMetaData().getColumnCount(); i++) { + String columnName = resultSetRegular.getMetaData().getColumnName(i); + + String regularApiLabel = + String.format("[Method: %s] [Column: %s] [API: Regular]", method, columnName); + String htapiApiLabel = + String.format("[Method: %s] [Column: %s] [API: HTAPI]", method, columnName); + + if (expectedResult.containsKey(columnName)) { + Object expectedValue = expectedResult.get(columnName); + + assertEquals(regularApiLabel, expectedValue, getter.apply(resultSetRegular, i)); + assertEquals(htapiApiLabel, expectedValue, getter.apply(resultSetArrow, i)); + + } else { + String regularMsg = "Expected exception but got a value. " + regularApiLabel; + assertEquals(regularMsg, EXCEPTION_REPLACEMENT, getter.apply(resultSetRegular, i)); + + String htapiMsg = "Expected exception but got a value. " + htapiApiLabel; + assertEquals(htapiMsg, EXCEPTION_REPLACEMENT, getter.apply(resultSetArrow, i)); + } + } + } + } + + @Test + public void validateGetString() throws Exception { + final ImmutableMap stringResults = + new ImmutableMap.Builder() + .put("stringField", "StringValue") + .put("bytesField", "Qnl0ZXNWYWx1ZQ==") + .put("intField", "123") + .put("floatField", "10.5") + .put("numericField", "12345.67") + .put("bigNumericField", "98765432109876543210.123456789") + .put("booleanField", "true") + .put("timestampFiled", "2023-07-28 12:30:00.000000") + .put("dateField", "2023-07-28") + .put("timeField", "12:30:00.000") + .put("dateTimeField", "2023-07-28 12:30:00.000000") + .put("geographyField", "POINT(-74.006 40.7128)") + .put( + "recordField", + "{\"name\":\"NameValue\",\"recordNested\":{\"lastName\":\"LastNameValue\"}}") + .put("rangeField", "[2023-01-01, 2023-12-01)") + .put("jsonField", "{\"key\":\"value\"}") + .put("arrayString", "[abc, def, ghi]") + .put("arrayRecord", "[{\"value\":\"rec_val1\"}, {\"value\":\"rec_val2\"}]") + .put("arrayBytes", "[Ynl0ZTE=, Ynl0ZTI=]") + .put("arrayInteger", "[10, 20]") + .put("arrayNumeric", "[10.5, 20.5]") + .put("arrayBignumeric", "[100.1, 200.2]") + .put("arrayBoolean", "[true, false]") + .put("arrayTimestamp", "[2023-01-01 01:00:00.0, 2023-01-01 02:00:00.0]") + .put("arrayDate", "[2023-01-01, 2023-01-02]") + .put("arrayTime", "[01:00:00, 02:00:00]") + .put("arrayDatetime", "[2023-01-01 01:00:00.0, 2023-01-01 02:00:00.0]") + .put("arrayGeography", "[POINT(1 1), POINT(2 2)]") + .put("arrayRange", "[[2023-01-01, 2023-01-03), [2023-01-04, 2023-01-06)]") + .put("arrayJson", "[{\"a\":1}, {\"b\":2}]") + .put("arrayFloat", "[1.1, 2.2]") + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getString(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getString", getter, stringResults); + } + + @Test + public void validateGetInt() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", 123) + .put("floatField", 10) + .put("numericField", 12345) + .put("booleanField", 1) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getInt(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getInt", getter, result); + } + + @Test + public void validateGetLong() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", 123L) + .put("floatField", 10L) + .put("numericField", 12345L) + .put("booleanField", 1L) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getLong(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getLong", getter, result); + } + + @Test + public void validateGetBool() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", true) + .put("floatField", true) + .put("numericField", true) + .put("booleanField", true) + .put("bigNumericField", true) + .put("stringField", false) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getBoolean(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getBool", getter, result); + } + + @Test + public void validateGetFloat() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", (float) 123.0) + .put("floatField", (float) 10.5) + .put("numericField", (float) 12345.67) + .put("bigNumericField", (float) 98765432109876543210.123456789) + .put("booleanField", (float) 1.0) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getFloat(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getFloat", getter, result); + } + + @Test + public void validateGetDouble() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", (double) 123.0) + .put("floatField", (double) 10.5) + .put("numericField", (double) 12345.67) + .put("bigNumericField", (double) 98765432109876543210.123456789) + .put("booleanField", (double) 1.0) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getDouble(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getDouble", getter, result); + } + + @Test + public void validateGetShort() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", (short) 123) + .put("floatField", (short) 10) + .put("numericField", (short) 12345) + .put("booleanField", (short) 1) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getShort(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getShort", getter, result); + } + + @Test + public void validateGetTime() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("timeField", Time.valueOf("12:30:00")) + .put("dateTimeField", Time.valueOf("12:30:00")) + .put("timestampFiled", Time.valueOf("12:30:00")) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getTime(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getTime", getter, result); + } + + @Test + public void validateGetDate() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("dateField", Date.valueOf("2023-07-28")) + .put("dateTimeField", Date.valueOf("2023-07-28")) + .put("timestampFiled", Date.valueOf("2023-07-28")) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getDate(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getDate", getter, result); + } + + @Test + public void validateGetTimestamp() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("timeField", Timestamp.valueOf("1970-01-01 12:30:00")) + .put("dateField", Timestamp.valueOf("2023-07-28 00:00:00")) + .put("dateTimeField", Timestamp.valueOf("2023-07-28 12:30:00")) + .put("timestampFiled", Timestamp.valueOf("2023-07-28 12:30:00")) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getTimestamp(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getTimestamp", getter, result); + } + + @Test + public void validateGetByte() throws Exception { + final ImmutableMap result = + new ImmutableMap.Builder() + .put("intField", (byte) 123) + .put("booleanField", (byte) 1) + .put("floatField", (byte) 10) + .build(); + BiFunction getter = + (s, i) -> { + try { + return s.getByte(i); + } catch (Exception e) { + return EXCEPTION_REPLACEMENT; + } + }; + validate("getByte", getter, result); + } + + @Test + public void validateGetObjectNullValues() throws Exception { + try (Connection connection = DriverManager.getConnection(connection_uri); + Connection connectionHTAPI = + DriverManager.getConnection( + connection_uri + + ";HighThroughputMinTableSize=0;HighThroughputActivationRatio=0;EnableHighThroughputAPI=1;"); + Statement statement = connection.createStatement(); + Statement statementHTAPI = connectionHTAPI.createStatement()) { + + String query = + "SELECT * FROM INTEGRATION_TEST_FORMAT.all_bq_types WHERE stringField is null;"; + ResultSet resultSetRegular = statement.executeQuery(query); + ResultSet resultSetArrow = statementHTAPI.executeQuery(query); + resultSetRegular.next(); + resultSetArrow.next(); + + for (int i = 1; i <= resultSetRegular.getMetaData().getColumnCount(); i++) { + String columnName = resultSetRegular.getMetaData().getColumnName(i); + if (!columnName.contains("array")) { + assertNull(resultSetRegular.getObject(i)); + assertNull(resultSetArrow.getObject(i)); + } else { + assertEquals(resultSetRegular.getObject(i).toString(), "[]"); + assertEquals(resultSetArrow.getObject(i).toString(), "[]"); + } + } + } + } + + private int resultSetRowCount(ResultSet resultSet) throws SQLException { + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + } + return rowCount; + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java new file mode 100644 index 0000000000..30124b4a04 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java @@ -0,0 +1,1713 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import static com.google.common.truth.Truth.assertThat; +import static java.util.Arrays.asList; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.BigQueryOptions; +import com.google.cloud.bigquery.Job; +import com.google.cloud.bigquery.JobInfo; +import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcSqlSyntaxErrorException; +import com.google.cloud.bigquery.jdbc.BigQueryConnection; +import com.google.cloud.bigquery.jdbc.BigQueryDriver; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.Date; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.Properties; +import java.util.Random; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ITNightlyBigQueryTest { + static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + static Connection bigQueryConnection; + static Statement bigQueryStatement; + static BigQuery bigQuery; + private static final Random random = new Random(); + private static final int randomNumber = random.nextInt(9999); + private static final String BASE_QUERY = + "SELECT * FROM bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2017 order by" + + " trip_distance asc LIMIT %s"; + private static final String CONSTRAINTS_DATASET = "JDBC_CONSTRAINTS_TEST_DATASET"; + private static final String CONSTRAINTS_TABLE_NAME = "JDBC_CONSTRAINTS_TEST_TABLE"; + private static final String CONSTRAINTS_TABLE_NAME2 = "JDBC_CONSTRAINTS_TEST_TABLE2"; + private static final String CALLABLE_STMT_PROC_NAME = "IT_CALLABLE_STMT_PROC_TEST"; + private static final String CALLABLE_STMT_TABLE_NAME = "IT_CALLABLE_STMT_PROC_TABLE"; + private static final String CALLABLE_STMT_PARAM_KEY = "CALL_STMT_PARAM_KEY"; + private static final String CALLABLE_STMT_DML_INSERT_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_INSERT_TEST"; + private static final String CALLABLE_STMT_DML_UPDATE_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_UPDATE_TEST"; + private static final String CALLABLE_STMT_DML_DELETE_PROC_NAME = + "IT_CALLABLE_STMT_PROC_DML_DELETE_TEST"; + private static final String CALLABLE_STMT_DML_TABLE_NAME = "IT_CALLABLE_STMT_PROC_DML_TABLE"; + private static final String DATASET = "JDBC_NIGHTLY_IT_DATASET"; + private static final String DATASET2 = "JDBC_PRESUBMIT_INTEGRATION_DATASET_2"; + static final String session_enabled_connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;EnableSession=1"; + + static final String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3"; + + @BeforeClass + public static void beforeClass() throws SQLException { + bigQueryConnection = DriverManager.getConnection(connection_uri, new Properties()); + bigQueryStatement = bigQueryConnection.createStatement(); + bigQuery = BigQueryOptions.newBuilder().build().getService(); + } + + @AfterClass + public static void afterClass() throws SQLException { + bigQueryStatement.close(); + bigQueryConnection.close(); + } + + @Test + public void testMergeInExecuteBatch() throws SQLException { + Random random = new Random(); + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME1 = "Inventory" + random.nextInt(9999); + String TABLE_NAME2 = "DetailedInventory" + random.nextInt(9999); + + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER);", + DATASET, TABLE_NAME1); + + String createQuery2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER," + + " `supply_constrained` BOOLEAN, `comment` STRING);", + DATASET, TABLE_NAME2); + + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (product, quantity, supply_constrained, comment) " + + "VALUES ('countertop microwave', 20, NULL,'[]' )," + + " ('front load washer', 20, false,'[]' ), " + + " ('microwave', 20, false,'[]' ), " + + " ('refrigerator', 10, false,'[]' );", + DATASET, TABLE_NAME2); + + bigQueryStatement.execute(createQuery); + bigQueryStatement.execute(createQuery2); + bigQueryStatement.execute(insertQuery2); + + String insertQuery = + String.format( + "INSERT INTO %s.%s (product, quantity) " + + "VALUES (?,? ), (?,? ), (?,? ), (?,? ), (?,? ), (?,? );", + DATASET, TABLE_NAME1); + PreparedStatement insertPs = bigQueryConnection.prepareStatement(insertQuery); + insertPs.setString(1, "dishwasher"); + insertPs.setInt(2, 30); + insertPs.setString(3, "dryer"); + insertPs.setInt(4, 30); + insertPs.setString(5, "front load washer"); + insertPs.setInt(6, 20); + insertPs.setString(7, "microwave"); + insertPs.setInt(8, 20); + insertPs.setString(9, "oven"); + insertPs.setInt(10, 5); + insertPs.setString(11, "top load washer"); + insertPs.setInt(12, 10); + + int insertStatus = insertPs.executeUpdate(); + assertEquals(6, insertStatus); + + String updateQuery = + String.format("UPDATE %s.%s SET quantity=? WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement updatePs = bigQueryConnection.prepareStatement(updateQuery); + updatePs.setString(2, "dryer"); + updatePs.setInt(1, 35); + + int updateStatus = updatePs.executeUpdate(); + assertEquals(1, updateStatus); + + String deleteQuery = String.format("DELETE FROM %s.%s WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement deletePs = bigQueryConnection.prepareStatement(deleteQuery); + deletePs.setString(1, "dishwasher"); + + int deleteStatus = deletePs.executeUpdate(); + assertEquals(1, deleteStatus); + + Statement statement = bigQueryConnection.createStatement(); + String mergeQuery = + String.format( + "MERGE %s.%s T\n" + + "USING %s.%s S\n" + + "ON T.product = S.product\n" + + "WHEN NOT MATCHED AND quantity < 100 THEN\n" + + " INSERT(product, quantity, supply_constrained, comment)\n" + + " VALUES(product, quantity, true, '[]')\n", + DATASET, TABLE_NAME2, DATASET, TABLE_NAME1); + statement.addBatch(mergeQuery); + int[] result = statement.executeBatch(); + + assertEquals(1, result.length); + assertEquals(3, result[0]); + bigQueryStatement.execute(String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME1)); + bigQueryStatement.execute(String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME2)); + } + + @Test + public void testValidLongRunningQuery() throws SQLException { + // setup + String selectQuery = + "SELECT * FROM `bigquery-public-data.deepmind_alphafold.metadata` LIMIT 50000"; + + // Read data via JDBC + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + + for (int i = 0; i < 50000; i++) { + resultSet.next(); + assertFalse(resultSet.wasNull()); + assertNotNull(resultSet.getString(5)); + } + + // clean up + resultSet.close(); + } + + @Test + public void testQueryInterruptGracefullyStopsExplicitJob() + throws SQLException, InterruptedException { + AtomicBoolean threadException = new AtomicBoolean(true); + Connection bigQueryConnection = + DriverManager.getConnection(connection_uri + ";JobCreationMode=1", new Properties()); + Statement bigQueryStatement = bigQueryConnection.createStatement(); + + // This query takes 300 seconds to complete + String query300Seconds = + "DECLARE DELAY_TIME DATETIME; SET DELAY_TIME = DATETIME_ADD(CURRENT_DATETIME, INTERVAL 300" + + " SECOND); WHILE CURRENT_DATETIME < DELAY_TIME DO END WHILE;"; + + // Query will be started in the background thread & we will call cancel from current thread. + Thread t = + new Thread( + () -> { + SQLException e = + assertThrows( + SQLException.class, () -> bigQueryStatement.execute(query300Seconds)); + assertTrue(e.getMessage().contains("User requested cancellation")); + threadException.set(false); + }); + t.start(); + // Allow thread to actually initiate the query + Thread.sleep(3000); + bigQueryStatement.cancel(); + // Wait until background thread is finished + t.join(); + assertFalse(threadException.get()); + // Ensure statement can be used again + assertFalse(bigQueryStatement.isClosed()); + bigQueryStatement.executeQuery("SELECT 1"); + } + + @Test + public void testQueryInterruptGracefullyStopsOptionalJob() + throws SQLException, InterruptedException { + AtomicBoolean threadException = new AtomicBoolean(true); + Connection bigQueryConnection = + DriverManager.getConnection(connection_uri + ";JobCreationMode=2", new Properties()); + Statement bigQueryStatement = bigQueryConnection.createStatement(); + + // This query takes 300 seconds to complete + String query300Seconds = + "DECLARE DELAY_TIME DATETIME; SET DELAY_TIME = DATETIME_ADD(CURRENT_DATETIME, INTERVAL 300" + + " SECOND); WHILE CURRENT_DATETIME < DELAY_TIME DO END WHILE;"; + + // Query will be started in the background thread & we will call cancel from current thread. + Thread t = + new Thread( + () -> { + SQLException e = + assertThrows( + SQLException.class, () -> bigQueryStatement.execute(query300Seconds)); + assertTrue(e.getMessage().contains("Query was cancelled.")); + threadException.set(false); + }); + t.start(); + // Allow thread to actually initiate the query + Thread.sleep(3000); + bigQueryStatement.cancel(); + // Wait until background thread is finished + t.join(); + assertFalse(threadException.get()); + // Ensure statement can be used again + assertFalse(bigQueryStatement.isClosed()); + bigQueryStatement.executeQuery("SELECT 1"); + } + + @Test + public void testWideColumnQueries() throws SQLException { + String selectQuery = + "SELECT * FROM `bigquery-public-data.covid19_open_data_eu.covid19_open_data` LIMIT 50000"; + + // Read data via JDBC + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + + for (int i = 0; i < 50000; i++) { + resultSet.next(); + assertFalse(resultSet.wasNull()); + } + + // clean up + resultSet.close(); + } + + @Test + public void testExecuteLargeUpdate() throws SQLException { + String tableName = "JDBC_LARGE_UPDATE_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE TABLE %s.%s (" + + " gbifid STRING, scientificname STRING, " + + " individualcount INTEGER, isReviewed BOOLEAN)", + DATASET, tableName); + + String insertQuery = + String.format( + "INSERT INTO %s.%s (gbifid, scientificname, individualcount) " + + "SELECT gbifid, scientificname, individualcount FROM " + + "bigquery-public-data.gbif.occurrences;", + DATASET, tableName); + String updateQuery = + String.format( + "UPDATE %s.%s SET isReviewed = false WHERE individualcount >= 0 OR individualcount IS" + + " NULL", + DATASET, tableName); + + String selectQuery = String.format("SELECT * FROM %s.%s LIMIT 10", DATASET, tableName); + + bigQueryStatement.execute(createQuery); + + long insertCount = bigQueryStatement.executeLargeUpdate(insertQuery); + assertTrue(insertCount > Integer.MAX_VALUE); + + long updateCount = bigQueryStatement.executeLargeUpdate(updateQuery); + assertTrue(updateCount > Integer.MAX_VALUE); + + ResultSet selectResult = bigQueryStatement.executeQuery(selectQuery); + assertTrue(selectResult.next()); + assertFalse(selectResult.getBoolean("isReviewed")); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, tableName)); + } + + @Test + public void testHTAPIWithValidDestinationTableSavesQueriesWithStandardSQL() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=SQL;" + + "LargeResultTable=destination_table_test;" + + "LargeResultDataset=INTEGRATION_TESTS;" + + "EnableHighThroughputAPI=1;"; + String selectLegacyQuery = + "SELECT * FROM `bigquery-public-data.deepmind_alphafold.metadata` LIMIT 200000;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String selectQuery = "SELECT * FROM INTEGRATION_TESTS.destination_table_test;"; + ResultSet actualResultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(200000, resultSetRowCount(actualResultSet)); + + // clean up + String deleteRows = "DELETE FROM `INTEGRATION_TESTS.destination_table_test` WHERE 1=1;"; + bigQueryStatement.execute(deleteRows); + } + + @Test + public void testBigQueryConcurrentLimitWithExecuteBatch() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_CONCURRENT_LIMIT_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + int[] results; + for (int i = 0; i < 30; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + results = statement.executeBatch(); + + for (int updateCount : results) { + assertEquals(1, updateCount); + } + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + } + + @Test + public void testValidExecuteBatch() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + int[] results; + for (int i = 0; i < 30; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + results = statement.executeBatch(); + + // assertions + assertEquals(30, results.length); + for (int updateCount : results) { + assertEquals(1, updateCount); + } + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + } + + @Test + public void testValidExecuteBatchWithMultipleDatasets() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_MULTIPLE_DATASET_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + String createBatchTable2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET2, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + bigQueryStatement.execute(createBatchTable2); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + int[] results; + for (int i = 0; i < 15; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + for (int i = 0; i < 15; i++) { + String insertQuery = + "INSERT INTO " + + DATASET2 + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + results = statement.executeBatch(); + + // assertions + for (int updateCount : results) { + assertEquals(1, updateCount); + } + + // do a select to validate row count on each + String selectQuery = String.format("SELECT id, name, age FROM %s.%s ;", DATASET, BATCH_TABLE); + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(15, resultSetRowCount(resultSet)); + selectQuery = String.format("SELECT id, name, age FROM %s.%s ;", DATASET2, BATCH_TABLE); + resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(15, resultSetRowCount(resultSet)); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + } + + @Test + public void testValidExecuteBatchWithMultipleTables() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_MULTI_TABLES_" + random.nextInt(99); + String BATCH_TABLE_2 = "JDBC_EXECUTE_BATCH_TABLE_MULTI_TABLES_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + String createBatchTable2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE_2); + bigQueryStatement.execute(createBatchTable); + bigQueryStatement.execute(createBatchTable2); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + int[] results; + for (int i = 0; i < 5; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + for (int i = 0; i < 5; i++) { + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE_2 + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "; + statement.addBatch(insertQuery); + } + results = statement.executeBatch(); + + // assertions + for (int updateCount : results) { + assertEquals(1, updateCount); + } + + // do a select to test row count on each + String selectQuery = String.format("SELECT id, name, age FROM %s.%s ;", DATASET, BATCH_TABLE); + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(5, resultSetRowCount(resultSet)); + selectQuery = String.format("SELECT id, name, age FROM %s.%s ;", DATASET, BATCH_TABLE_2); + resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(5, resultSetRowCount(resultSet)); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE_2)); + } + + @Test + public void testPreparedStatementExecuteUpdate() throws SQLException { + Random random = new Random(); + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME1 = "Inventory" + random.nextInt(9999); + String TABLE_NAME2 = "DetailedInventory" + random.nextInt(9999); + + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER);", + DATASET, TABLE_NAME1); + + String createQuery2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`product` STRING, `quantity` INTEGER," + + " `supply_constrained` BOOLEAN, `comment` STRING);", + DATASET, TABLE_NAME2); + + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (product, quantity, supply_constrained, comment) " + + "VALUES ('countertop microwave', 20, NULL,'[]' )," + + " ('front load washer', 20, false,'[]' ), " + + " ('microwave', 20, false,'[]' ), " + + " ('refrigerator', 10, false,'[]' );", + DATASET, TABLE_NAME2); + + bigQueryStatement.execute(createQuery); + bigQueryStatement.execute(createQuery2); + bigQueryStatement.execute(insertQuery2); + + String insertQuery = + String.format( + "INSERT INTO %s.%s (product, quantity) " + + "VALUES (?,? ), (?,? ), (?,? ), (?,? ), (?,? ), (?,? );", + DATASET, TABLE_NAME1); + PreparedStatement insertPs = bigQueryConnection.prepareStatement(insertQuery); + insertPs.setString(1, "dishwasher"); + insertPs.setInt(2, 30); + insertPs.setString(3, "dryer"); + insertPs.setInt(4, 30); + insertPs.setString(5, "front load washer"); + insertPs.setInt(6, 20); + insertPs.setString(7, "microwave"); + insertPs.setInt(8, 20); + insertPs.setString(9, "oven"); + insertPs.setInt(10, 5); + insertPs.setString(11, "top load washer"); + insertPs.setInt(12, 10); + + int insertStatus = insertPs.executeUpdate(); + assertEquals(6, insertStatus); + + String updateQuery = + String.format("UPDATE %s.%s SET quantity=? WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement updatePs = bigQueryConnection.prepareStatement(updateQuery); + updatePs.setString(2, "dryer"); + updatePs.setInt(1, 35); + + int updateStatus = updatePs.executeUpdate(); + assertEquals(1, updateStatus); + + String deleteQuery = String.format("DELETE FROM %s.%s WHERE product=?", DATASET, TABLE_NAME1); + PreparedStatement deletePs = bigQueryConnection.prepareStatement(deleteQuery); + deletePs.setString(1, "dishwasher"); + + int deleteStatus = deletePs.executeUpdate(); + assertEquals(1, deleteStatus); + + String mergeQuery = + String.format( + "MERGE %s.%s T\n" + + "USING %s.%s S\n" + + "ON T.product = S.product\n" + + "WHEN NOT MATCHED AND quantity < ? THEN\n" + + " INSERT(product, quantity, supply_constrained, comment)\n" + + " VALUES(product, quantity, true, ?)\n" + + "WHEN NOT MATCHED THEN\n" + + " INSERT(product, quantity, supply_constrained)\n" + + " VALUES(product, quantity, false)", + DATASET, TABLE_NAME2, DATASET, TABLE_NAME1); + PreparedStatement mergePs = bigQueryConnection.prepareStatement(mergeQuery); + mergePs.setInt(1, 20); + mergePs.setString(2, "comment" + random.nextInt(999)); + + int mergeStatus = mergePs.executeUpdate(); + assertEquals(3, mergeStatus); + + ResultSet rs = + bigQueryStatement.executeQuery( + String.format("SELECT COUNT(*) AS row_count\n" + "FROM %s.%s", DATASET, TABLE_NAME2)); + rs.next(); + assertEquals(7, rs.getInt(1)); + + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME1); + int dropStatus = bigQueryStatement.executeUpdate(dropQuery); + assertEquals(0, dropStatus); + bigQueryStatement.execute(String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME2)); + } + + @Test + public void testFailedStatementInTheMiddleOfExecuteBatchStopsExecuting() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_ERROR_IN_MIDDLE_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + String createBatchTable2 = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET2, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + bigQueryStatement.execute(createBatchTable2); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET2, BATCH_TABLE); + + // act + for (int i = 0; i < 20; i++) { + if (i == 10) { + statement.addBatch( + "INSERT INTO " + + DATASET2 + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "); + } else { + statement.addBatch( + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + i + + "); "); + } + } + bigQueryStatement.execute(dropQuery); + + // assertions + assertThrows(BigQueryJdbcException.class, statement::executeBatch); + String selectQuery = String.format("SELECT id, name, age FROM %s.%s ;", DATASET, BATCH_TABLE); + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(10, resultSetRowCount(resultSet)); + bigQueryStatement.execute(String.format("DROP TABLE %s.%s", DATASET, BATCH_TABLE)); + } + + @Test + public void testHTAPIWithValidDestinationTableSavesQueriesWithLegacy() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryDialect=BIG_QUERY;" + + "LargeResultTable=destination_table_test;" + + "LargeResultDataset=INTEGRATION_TESTS;" + + "EnableHighThroughputAPI=1;"; + String selectLegacyQuery = + "SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 200000;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + ResultSet resultSet = statement.executeQuery(selectLegacyQuery); + + // assertion + assertNotNull(resultSet); + String selectQuery = "SELECT * FROM INTEGRATION_TESTS.destination_table_test;"; + ResultSet actualResultSet = bigQueryStatement.executeQuery(selectQuery); + assertTrue(0 < resultSetRowCount(actualResultSet)); + + // clean up + String deleteRows = "DELETE FROM `INTEGRATION_TESTS.destination_table_test` WHERE 1=1;"; + bigQueryStatement.execute(deleteRows); + } + + @Test + public void testMultiStatementTransactionRollbackByUser() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + + boolean status = statement.execute(insertQuery); + assertFalse(status); + int rows = statement.executeUpdate(updateQuery); + assertEquals(1, rows); + status = statement.execute(selectQuery); + assertTrue(status); + connection.rollback(); + assertTrue( + "After rollback() in manual commit mode, a new transaction should be started.", + connection.isTransactionStarted()); + + // Separate query to check if transaction rollback worked + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertFalse(resultSet.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + connection.close(); + } + + @Test + public void testMultiStatementTransactionDoesNotCommitWithoutCommit() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + + boolean status = statement.execute(insertQuery); + assertFalse(status); + int rows = statement.executeUpdate(updateQuery); + assertEquals(1, rows); + status = statement.execute(selectQuery); + assertTrue(status); + + // Separate query to check nothing committed + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertFalse(resultSet.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + statement.close(); + connection.close(); + } + + @Test + public void testValidMultiStatementTransactionCommits() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + + boolean status = statement.execute(insertQuery); + assertFalse(status); + status = statement.execute(updateQuery); + assertFalse(status); + status = statement.execute(selectQuery); + assertTrue(status); + connection.commit(); + + // Separate query to check inserted and updated data committed + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertTrue(resultSet.next()); + assertEquals(14, resultSet.getInt(3)); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + statement.close(); + connection.close(); + } + + @Test + public void testConnectionWithMultipleTransactionCommits() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + boolean status = statement.execute(insertQuery); + assertFalse(status); + status = statement.execute(updateQuery); + assertFalse(status); + status = statement.execute(selectQuery); + assertTrue(status); + connection.commit(); + + connection.setAutoCommit(false); + assertTrue(connection.isTransactionStarted()); + statement.execute(insertQuery); + connection.rollback(); + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + int count = 0; + while (resultSet.next()) { + count++; + } + assertEquals(1, count); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + connection.close(); + } + + @Test + public void testTransactionRollbackOnError() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s ;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + String transactionOnError = + "BEGIN\n" + + "\n" + + " BEGIN TRANSACTION;\n" + + " INSERT INTO " + + DATASET + + "." + + TRANSACTION_TABLE + + "\n" + + " VALUES (39, 'Drake', 123);\n" + + " SELECT 1/0;\n" + + " COMMIT TRANSACTION;\n" + + "\n" + + "EXCEPTION WHEN ERROR THEN\n" + + " SELECT @@error.message;\n" + + " ROLLBACK TRANSACTION;\n" + + "END;"; + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + Statement statement = connection.createStatement(); + statement.execute(transactionOnError); + + // do a check to see if no vals inserted + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertFalse(resultSet.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + connection.close(); + } + + @Test + public void testClearBatchClears() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_CLEAR_BATCH_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + bigQueryStatement.execute(createBatchTable); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 13 WHERE age = %s;", DATASET, BATCH_TABLE, randomNumber); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + statement.addBatch(updateQuery); + statement.clearBatch(); + int[] results = statement.executeBatch(); + + // assertion + assertEquals(0, results.length); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testMultipleExecuteBatches() throws SQLException { + // setup + String BATCH_TABLE = "JDBC_EXECUTE_BATCH_TABLE_MULTI_BATCHES_" + random.nextInt(99); + String createBatchTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, BATCH_TABLE); + String insertQuery = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', " + + randomNumber + + "); "; + String insertQuery2 = + "INSERT INTO " + + DATASET + + "." + + BATCH_TABLE + + " (id, name, age) " + + "VALUES (12, 'Farhan', 123), " + + " (12, 'Farhan', 123); "; + bigQueryStatement.execute(createBatchTable); + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act + // batch bypasses the 16 concurrent limit + statement.addBatch(insertQuery); + int[] firstResults = statement.executeBatch(); + statement.addBatch(insertQuery2); + int[] secondResults = statement.executeBatch(); + + // assertions + assertEquals(1, firstResults.length); + assertEquals(1, secondResults.length); + assertEquals(1, firstResults[0]); + assertEquals(2, secondResults[0]); + bigQueryStatement.execute(String.format("DROP TABLE IF EXISTS %S.%s", DATASET, BATCH_TABLE)); + connection.close(); + } + + @Test + public void testValidAllDataTypesSerializationFromSelectQuery() throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_DATATYPES_INTEGRATION_TEST_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + resultSet.next(); + assertEquals(16, resultSetMetaData.getColumnCount()); + assertTrue(resultSet.getBoolean(1)); + assertEquals(33, resultSet.getInt(2)); + assertEquals(50.05f, resultSet.getFloat(3), 0.0); + assertEquals(123.456, resultSet.getDouble(4), 0.0); + assertEquals(123.456789, resultSet.getDouble(5), 0.0); + assertEquals("testString", resultSet.getString(6)); + assertEquals("Test String", new String(resultSet.getBytes(7), StandardCharsets.UTF_8)); + Struct expectedStruct = (Struct) resultSet.getObject(8); + assertThat(expectedStruct.getAttributes()).isEqualTo(asList("Eric", 10L).toArray()); + assertArrayEquals( + new String[] {"one", "two", "three"}, (String[]) resultSet.getArray(9).getArray()); + + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356456"), resultSet.getObject(10)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getObject(11)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getObject(12)); + assertEquals(Timestamp.valueOf("2019-02-17 11:24:00"), resultSet.getObject(13)); + assertEquals("POINT(1 2)", resultSet.getString(14)); + assertEquals("{\"class\":{\"students\":[{\"name\":\"Jane\"}]}}", resultSet.getString(15)); + assertEquals("123-7 -19 0:24:12.000006", resultSet.getString(16)); + } + + @Test + public void testRepeatedStructFromSelectQuery() throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_REPEATED_STRUCT_INTEGRATION_TEST"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + resultSet.next(); + + Struct[] repeatedStruct = (Struct[]) resultSet.getArray(1).getArray(); + assertEquals(3, Arrays.stream(repeatedStruct).count()); + + Object[] alice = repeatedStruct[0].getAttributes(); + Object[] bob = repeatedStruct[1].getAttributes(); + Object[] charlie = repeatedStruct[2].getAttributes(); + assertEquals("Alice", alice[0]); + assertEquals("30", alice[1]); + assertEquals("Bob", bob[0]); + assertEquals("25", bob[1]); + assertEquals("Charlie", charlie[0]); + assertEquals("35", charlie[1]); + } + + @Test + public void testValidAllDataTypesSerializationFromSelectQueryArrowDataset() throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_INTEGRATION_ARROW_TEST_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME + " LIMIT 5000;"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=" + + PROJECT_ID + + ";EnableHighThroughputAPI=1;" + + "HighThroughputActivationRatio=2;" + + "HighThroughputMinTableSize=1000;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertNotNull(resultSet); + + ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + resultSet.next(); + assertEquals(15, resultSetMetaData.getColumnCount()); + assertTrue(resultSet.getBoolean(1)); + assertEquals(33, resultSet.getInt(2)); + assertEquals(50.05f, resultSet.getFloat(3), 0.0); + assertEquals(123.456, resultSet.getDouble(4), 0.0); + assertEquals(123.456789, resultSet.getDouble(5), 0.0); + assertEquals("testString", resultSet.getString(6)); + assertEquals("Test String", new String(resultSet.getBytes(7), StandardCharsets.UTF_8)); + Struct expectedStruct = (Struct) resultSet.getObject(8); + assertThat(expectedStruct.getAttributes()).isEqualTo(asList("Eric", 10L).toArray()); + assertEquals("{\"name\":\"Eric\",\"age\":10}", expectedStruct.toString()); + assertArrayEquals( + new String[] {"one", "two", "three"}, (String[]) resultSet.getArray(9).getArray()); + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356"), resultSet.getObject(10)); + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356"), resultSet.getTimestamp(10)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getObject(11)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getDate(11)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getObject(12)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getTime(12)); + assertEquals(Timestamp.valueOf("2022-01-22 22:22:12.142265"), resultSet.getObject(13)); + assertEquals("POINT(1 2)", resultSet.getString(14)); + assertEquals("{\"class\":{\"students\":[{\"name\":\"Jane\"}]}}", resultSet.getString(15)); + connection.close(); + } + + /////////////// MARKER + /// + + @Test + public void testBulkInsertOperation() throws SQLException { + String TABLE_NAME = "JDBC_BULK_INSERT_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING,\n" + + " `IntegerField` INTEGER," + + " `FloatField` FLOAT64," + + " `NumericField` NUMERIC," + + " `BigNumericField` BIGNUMERIC," + + " `BooleanField` BOOLEAN" + + " );", + DATASET, TABLE_NAME); + String insertQuery = + String.format("INSERT INTO %s.%s VALUES(?, ?, ?,?, ?, ?);", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT * FROM %s.%s", DATASET, TABLE_NAME); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;" + + "EnableWriteAPI=1;SWA_ActivationRowCount=5;SWA_AppendRowCount=500"; + + try (Connection connection = DriverManager.getConnection(connection_uri)) { + bigQueryStatement.execute(createQuery); + PreparedStatement statement = connection.prepareStatement(insertQuery); + for (int i = 0; i < 20; ++i) { + statement.setString(1, i + "StringField"); + statement.setInt(2, i); + statement.setFloat(3, (float) (i + .6)); + statement.setInt(4, random.nextInt()); + statement.setInt(5, random.nextInt()); + statement.setBoolean(6, true); + + statement.addBatch(); + } + int[] result = statement.executeBatch(); + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(result.length, resultSetRowCount(resultSet)); + + bigQueryStatement.execute(dropQuery); + + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testBulkInsertOperationStandard() throws SQLException { + String TABLE_NAME = "JDBC_BULK_INSERT_STANDARD_TABLE_" + randomNumber; + String createQuery = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`StringField` STRING,\n" + + " `IntegerField` INTEGER," + + " `FloatField` FLOAT64," + + " `NumericField` NUMERIC," + + " `BigNumericField` BIGNUMERIC," + + " `BooleanField` BOOLEAN" + + " );", + DATASET, TABLE_NAME); + String insertQuery = + String.format("INSERT INTO %s.%s VALUES(?, ?, ?,?, ?, ?);", DATASET, TABLE_NAME); + String dropQuery = String.format("DROP TABLE %s.%s", DATASET, TABLE_NAME); + String selectQuery = String.format("SELECT * FROM %s.%s", DATASET, TABLE_NAME); + + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;" + + "EnableWriteAPI=0;SWA_ActivationRowCount=50;SWA_AppendRowCount=500"; + + try (Connection connection = DriverManager.getConnection(connection_uri)) { + bigQueryStatement.execute(createQuery); + PreparedStatement statement = connection.prepareStatement(insertQuery); + for (int i = 0; i < 20; ++i) { + statement.setString(1, i + "StringField"); + statement.setInt(2, i); + statement.setFloat(3, (float) (i + .6)); + statement.setInt(4, random.nextInt()); + statement.setInt(5, random.nextInt()); + statement.setBoolean(6, true); + + statement.addBatch(); + } + int[] result = statement.executeBatch(); + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertEquals(result.length, resultSetRowCount(resultSet)); + + bigQueryStatement.execute(dropQuery); + + } catch (SQLException e) { + throw new BigQueryJdbcException(e); + } + } + + @Test + public void testExecuteQueryWithSetMaxRows() throws SQLException { + String TEST_MAX_ROWS_TABLE = "JDBC_TEST_MAX_ROWS_TABLE" + random.nextInt(99); + int id1 = random.nextInt(99); + int id2 = random.nextInt(99); + String createMaxRowsTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING);", + DATASET, TEST_MAX_ROWS_TABLE); + String insertQuery1 = + String.format( + "INSERT INTO %s.%s (id, name) VALUES (%s, 'max-rows-test-1');", + DATASET, TEST_MAX_ROWS_TABLE, id1); + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (id, name) VALUES (%s, 'max-rows-test-2');", + DATASET, TEST_MAX_ROWS_TABLE, id2); + String selectQuery = String.format("SELECT id, name FROM %s.%s;", DATASET, TEST_MAX_ROWS_TABLE); + + boolean executeResult = bigQueryStatement.execute(createMaxRowsTable); + assertFalse(executeResult); + int rowsInserted = bigQueryStatement.executeUpdate(insertQuery1); + assertEquals(1, rowsInserted); + rowsInserted = bigQueryStatement.executeUpdate(insertQuery2); + assertEquals(1, rowsInserted); + + bigQueryStatement.setMaxRows(1); + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + assertEquals(1, resultSetRowCount(resultSet)); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TEST_MAX_ROWS_TABLE)); + } + + @Test + public void testExecuteQueryWithoutSetMaxRows() throws SQLException { + String TEST_MAX_ROWS_TABLE = "JDBC_TEST_MAX_ROWS_TABLE" + random.nextInt(99); + int id1 = random.nextInt(99); + int id2 = random.nextInt(99); + String createMaxRowsTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING);", + DATASET, TEST_MAX_ROWS_TABLE); + String insertQuery1 = + String.format( + "INSERT INTO %s.%s (id, name) VALUES (%s, 'max-rows-test-1');", + DATASET, TEST_MAX_ROWS_TABLE, id1); + String insertQuery2 = + String.format( + "INSERT INTO %s.%s (id, name) VALUES (%s, 'max-rows-test-2');", + DATASET, TEST_MAX_ROWS_TABLE, id2); + String selectQuery = String.format("SELECT id, name FROM %s.%s;", DATASET, TEST_MAX_ROWS_TABLE); + + boolean executeResult = bigQueryStatement.execute(createMaxRowsTable); + assertFalse(executeResult); + int rowsInserted = bigQueryStatement.executeUpdate(insertQuery1); + assertEquals(1, rowsInserted); + rowsInserted = bigQueryStatement.executeUpdate(insertQuery2); + assertEquals(1, rowsInserted); + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + assertEquals(2, resultSetRowCount(resultSet)); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TEST_MAX_ROWS_TABLE)); + } + + @Test + public void testQueryPropertySessionIdIsUsedWithTransaction() + throws SQLException, InterruptedException { + // setup + String sessionId = getSessionId(); + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String beginTransaction = "BEGIN TRANSACTION; "; + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + String commitTransaction = "COMMIT TRANSACTION;"; + + String transactionQuery = + beginTransaction + + insertQuery + + insertQuery + + updateQuery + + selectQuery + + commitTransaction; + + bigQueryStatement.execute(createTransactionTable); + + // Run the transaction + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";QueryProperties=session_id=" + + sessionId + + ";"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + statement.execute(transactionQuery); + + // Test each query's result with getMoreResults + int resultsCount = 0; + boolean hasMoreResult = statement.getMoreResults(); + while (hasMoreResult || statement.getUpdateCount() != -1) { + if (statement.getUpdateCount() == -1) { + ResultSet result = statement.getResultSet(); + assertTrue(result.next()); + assertEquals(-1, statement.getUpdateCount()); + } else { + assertTrue(statement.getUpdateCount() > -1); + } + hasMoreResult = statement.getMoreResults(); + resultsCount++; + } + assertEquals(5, resultsCount); + + // Check the transaction was actually committed. + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + assertEquals(14, resultSet.getInt(3)); + } + assertEquals(2, rowCount); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + connection.close(); + } + + @Test + public void testRollbackOnConnectionClosed() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (15, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 12 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + + boolean status = statement.execute(insertQuery); + assertFalse(status); + int rows = statement.executeUpdate(updateQuery); + assertEquals(1, rows); + status = statement.execute(selectQuery); + assertTrue(status); + connection.close(); + + // Separate query to check if transaction rollback worked + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertFalse(resultSet.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + } + + @Test + public void testSingleStatementTransaction() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String beginTransaction = "BEGIN TRANSACTION; "; + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + String commitTransaction = "COMMIT TRANSACTION;"; + + String transactionQuery = + beginTransaction + + insertQuery + + insertQuery + + updateQuery + + selectQuery + + commitTransaction; + + bigQueryStatement.execute(createTransactionTable); + + // Run the transaction + Connection connection = DriverManager.getConnection(session_enabled_connection_uri); + Statement statement = connection.createStatement(); + statement.execute(transactionQuery); + + // Test each query's result with getMoreResults + int resultsCount = 0; + boolean hasMoreResult = statement.getMoreResults(); + while (hasMoreResult || statement.getUpdateCount() != -1) { + if (statement.getUpdateCount() == -1) { + ResultSet result = statement.getResultSet(); + assertTrue(result.next()); + assertEquals(-1, statement.getUpdateCount()); + } else { + assertTrue(statement.getUpdateCount() > -1); + } + hasMoreResult = statement.getMoreResults(); + resultsCount++; + } + assertEquals(5, resultsCount); + + // Check the transaction was actually committed. + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + assertEquals(14, resultSet.getInt(3)); + } + assertEquals(2, rowCount); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + connection.close(); + } + + @Test + public void testConnectionClosedRollsBackStartedTransactions() throws SQLException { + String TRANSACTION_TABLE = "JDBC_TRANSACTION_TABLE" + random.nextInt(99); + String createTransactionTable = + String.format( + "CREATE OR REPLACE TABLE %s.%s (`id` INTEGER, `name` STRING, `age` INTEGER);", + DATASET, TRANSACTION_TABLE); + String insertQuery = + String.format( + "INSERT INTO %s.%s (id, name, age) VALUES (12, 'Farhan', %s);", + DATASET, TRANSACTION_TABLE, randomNumber); + String updateQuery = + String.format( + "UPDATE %s.%s SET age = 14 WHERE age = %s;", DATASET, TRANSACTION_TABLE, randomNumber); + String selectQuery = + String.format("SELECT id, name, age FROM %s.%s WHERE id = 12;", DATASET, TRANSACTION_TABLE); + + bigQueryStatement.execute(createTransactionTable); + + BigQueryConnection connection = + (BigQueryConnection) DriverManager.getConnection(session_enabled_connection_uri); + connection.setAutoCommit(false); + Statement statement = connection.createStatement(); + assertTrue(connection.isTransactionStarted()); + + boolean status = statement.execute(insertQuery); + assertFalse(status); + int rows = statement.executeUpdate(updateQuery); + assertEquals(1, rows); + status = statement.execute(selectQuery); + assertTrue(status); + connection.close(); + + // Separate query to check if transaction rollback worked + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertFalse(resultSet.next()); + + bigQueryStatement.execute( + String.format("DROP TABLE IF EXISTS %S.%s", DATASET, TRANSACTION_TABLE)); + } + + @Test + public void testStatelessQueryPathSmall() throws SQLException { + Properties jobCreationMode = new Properties(); + jobCreationMode.setProperty("JobCreationMode", "2"); + Connection bigQueryConnectionUseStateless = + DriverManager.getConnection(connection_uri, jobCreationMode); + + Statement statement = bigQueryConnectionUseStateless.createStatement(); + + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 850"; + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(850, resultSetRowCount(jsonResultSet)); + + String queryEmpty = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 0"; + ResultSet jsonResultSetEmpty = statement.executeQuery(queryEmpty); + assertTrue(jsonResultSetEmpty.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(0, resultSetRowCount(jsonResultSetEmpty)); + bigQueryConnectionUseStateless.close(); + } + + @Test + public void testFastQueryPathMedium() throws SQLException { + String query = + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 9000"; + ResultSet jsonResultSet = bigQueryStatement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(9000, resultSetRowCount(jsonResultSet)); + } + + @Test + public void testFastQueryPathLarge() throws SQLException { + String query = + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 18000"; + ResultSet jsonResultSet = bigQueryStatement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(18000, resultSetRowCount(jsonResultSet)); + } + + @Test + // reads using ReadAPI and makes sure that they are in order, which implies threads worked + // correctly + public void testIterateOrderArrowMultiThread() throws SQLException { + int expectedCnt = 200000; + String longQuery = String.format(BASE_QUERY, expectedCnt); + ResultSet rs = bigQueryStatement.executeQuery(longQuery); + int cnt = 0; + double oldTriDis = 0.0d; + while (rs.next()) { + double tripDis = rs.getDouble("trip_distance"); + ++cnt; + assertTrue(oldTriDis <= tripDis); + oldTriDis = tripDis; + } + assertEquals(expectedCnt, cnt); // all the records were retrieved + } + + @Test + public void testNonEnabledUseLegacySQLThrowsSyntaxError() throws SQLException { + // setup + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;" + + "ProjectId=" + + PROJECT_ID + + ";"; + String selectLegacyQuery = + "SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 20000000;"; + Driver driver = BigQueryDriver.getRegisteredDriver(); + Connection connection = driver.connect(connection_uri, new Properties()); + Statement statement = connection.createStatement(); + + // act & assertion + assertThrows( + BigQueryJdbcSqlSyntaxErrorException.class, () -> statement.execute(selectLegacyQuery)); + connection.close(); + } + + @Test + public void testFastQueryPathEmpty() throws SQLException { + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT" + + " 0"; + ResultSet jsonResultSet = bigQueryStatement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(0, resultSetRowCount(jsonResultSet)); + } + + @Test + public void testReadAPIPathLarge() throws SQLException { + Properties withReadApi = new Properties(); + withReadApi.setProperty("EnableHighThroughputAPI", "1"); + withReadApi.setProperty("HighThroughputActivationRatio", "2"); + withReadApi.setProperty("HighThroughputMinTableSize", "1000"); + withReadApi.setProperty("MaxResults", "300"); + + Connection connection = DriverManager.getConnection(connection_uri, withReadApi); + Statement statement = connection.createStatement(); + int expectedCnt = 5000; + String longQuery = String.format(BASE_QUERY, expectedCnt); + ResultSet arrowResultSet = statement.executeQuery(longQuery); + assertTrue(arrowResultSet.getClass().getName().contains("BigQueryArrowResultSet")); + assertEquals(expectedCnt, resultSetRowCount(arrowResultSet)); + arrowResultSet.close(); + connection.close(); + } + + @Test + public void testReadAPIPathLargeWithThresholdParameters() throws SQLException { + String connectionUri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;MaxResults=300;HighThroughputActivationRatio=2;" + + "HighThroughputMinTableSize=100;EnableHighThroughputAPI=1"; + Connection connection = DriverManager.getConnection(connectionUri); + Statement statement = connection.createStatement(); + int expectedCnt = 1000; + String longQuery = String.format(BASE_QUERY, expectedCnt); + ResultSet arrowResultSet = statement.executeQuery(longQuery); + assertTrue(arrowResultSet.getClass().getName().contains("BigQueryArrowResultSet")); + assertEquals(expectedCnt, resultSetRowCount(arrowResultSet)); + arrowResultSet.close(); + connection.close(); + } + + @Test + public void testReadAPIPathLargeWithThresholdNotMet() throws SQLException { + String connectionUri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=3;HighThroughputActivationRatio=4;" + + "HighThroughputMinTableSize=100;EnableHighThroughputAPI=1"; + Connection connection = DriverManager.getConnection(connectionUri); + Statement statement = connection.createStatement(); + int expectedCnt = 5000; + String longQuery = String.format(BASE_QUERY, expectedCnt); + ResultSet arrowResultSet = statement.executeQuery(longQuery); + assertTrue(arrowResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertEquals(expectedCnt, resultSetRowCount(arrowResultSet)); + arrowResultSet.close(); + connection.close(); + } + + private String getSessionId() throws InterruptedException { + QueryJobConfiguration stubJobConfig = + QueryJobConfiguration.newBuilder("Select 1;").setCreateSession(true).build(); + Job job = bigQuery.create(JobInfo.of(stubJobConfig)); + job = job.waitFor(); + Job stubJob = bigQuery.getJob(job.getJobId()); + return stubJob.getStatistics().getSessionInfo().getSessionId(); + } + + private int resultSetRowCount(ResultSet resultSet) throws SQLException { + int rowCount = 0; + while (resultSet.next()) { + rowCount++; + } + return rowCount; + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITPSCBigQueryTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITPSCBigQueryTest.java new file mode 100644 index 0000000000..1b73f84b66 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITPSCBigQueryTest.java @@ -0,0 +1,300 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import static com.google.common.truth.Truth.assertThat; +import static java.util.Arrays.asList; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.BigQueryException; +import com.google.cloud.bigquery.jdbc.BigQueryConnection; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.sql.Connection; +import java.sql.Date; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Struct; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Properties; +import org.junit.Test; + +public class ITPSCBigQueryTest { + static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + private static final String SERVICE_ACCOUNT_EMAIL = requireEnvVar("SA_EMAIL"); + + private static String requireEnvVar(String varName) { + String value = System.getenv(varName); + assertNotNull( + "Environment variable " + varName + " is required to perform these tests.", + System.getenv(varName)); + return value; + } + + @Test + public void testNoOverrideTimesOut() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "APPLICATION_DEFAULT_CREDENTIALS", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 850"; + Statement statement = connection.createStatement(); + assertThrows(BigQueryException.class, () -> statement.executeQuery(query)); + } + + @Test + public void testValidADCAuthenticationInPSC() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "APPLICATION_DEFAULT_CREDENTIALS", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 850"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @Test + public void testValidOAuthType2AuthenticationInPSC() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=2;" + + "OAuthAccessToken=RedactedToken;" // TODO(fahmz): see if there is a way to use SMS + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "PRE_GENERATED_TOKEN", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 850"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @Test + public void testValidServiceAccountAuthenticationKeyFileInPSC() throws SQLException, IOException { + final String SERVICE_ACCOUNT_KEY = requireEnvVar("SA_SECRET"); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=0;" + + "OAuthPvtKeyPath=" + + SERVICE_ACCOUNT_KEY + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com," + + "OAuth2=https://oauth2-privateendpoint.p.googleapis.com/token;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + connection.close(); + } + + @Test + public void testValidServiceAccountAuthenticationViaEmailInPSC() throws SQLException { + final String SERVICE_ACCOUNT_KEY = requireEnvVar("SA_SECRET"); + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=0;" + + "OAuthServiceAcctEmail=" + + SERVICE_ACCOUNT_EMAIL + + ";OAuthPvtKey=" + + SERVICE_ACCOUNT_KEY + + ";EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com," + + "OAuth2=https://oauth2-privateendpoint.p.googleapis.com/token;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = + "SELECT DISTINCT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 850"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @Test + public void testValidAllDataTypesSerializationFromSelectQueryInPSC() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=0;" + + "OAuthPvtKeyPath=.\\google-cloud-bigquery-jdbc\\secret.json;" + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com," + + "OAuth2=https://oauth2-privateendpoint.p.googleapis.com/token;"; + Connection bigQueryConnection = DriverManager.getConnection(connection_uri, new Properties()); + Statement bigQueryStatement = bigQueryConnection.createStatement(); + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_DATATYPES_INTEGRATION_TEST_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + + ResultSet resultSet = bigQueryStatement.executeQuery(selectQuery); + assertNotNull(resultSet); + ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + resultSet.next(); + assertEquals(16, resultSetMetaData.getColumnCount()); + assertTrue(resultSet.getBoolean(1)); + assertEquals(33, resultSet.getInt(2)); + assertEquals(50.05f, resultSet.getFloat(3), 0.0); + assertEquals(123.456, resultSet.getDouble(4), 0.0); + assertEquals(123.456789, resultSet.getDouble(5), 0.0); + assertEquals("testString", resultSet.getString(6)); + assertEquals("Test String", new String(resultSet.getBytes(7), StandardCharsets.UTF_8)); + Struct expectedStruct = (Struct) resultSet.getObject(8); + assertThat(expectedStruct.getAttributes()).isEqualTo(asList("Eric", 10).toArray()); + assertArrayEquals( + new String[] {"one", "two", "three"}, (String[]) resultSet.getArray(9).getArray()); + + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356456"), resultSet.getObject(10)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getObject(11)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getObject(12)); + assertEquals(Timestamp.valueOf("2019-02-17 11:24:00"), resultSet.getObject(13)); + assertEquals("POINT(1 2)", resultSet.getString(14)); + assertEquals("{\"class\":{\"students\":[{\"name\":\"Jane\"}]}}", resultSet.getString(15)); + assertEquals("123-7 -19 0:24:12.000006", resultSet.getString(16)); + } + + @Test + public void testValidAllDataTypesSerializationFromSelectQueryArrowDatasetInPSC() + throws SQLException { + String DATASET = "JDBC_INTEGRATION_DATASET"; + String TABLE_NAME = "JDBC_INTEGRATION_ARROW_TEST_TABLE"; + String selectQuery = "select * from " + DATASET + "." + TABLE_NAME; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=0;" + + "OAuthPvtKeyPath=.\\google-cloud-bigquery-jdbc\\secret.json;;" + + "EnableHighThroughputAPI=1;" + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com," + + "READ_API=bigquerystorage-privateendpoint.p.googleapis.com:443," + + "OAuth2=https://oauth2-privateendpoint.p.googleapis.com/token;"; + + // Read data via JDBC + Connection connection = DriverManager.getConnection(connection_uri); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectQuery); + assertNotNull(resultSet); + + ResultSetMetaData resultSetMetaData = resultSet.getMetaData(); + resultSet.next(); + assertEquals(15, resultSetMetaData.getColumnCount()); + assertTrue(resultSet.getBoolean(1)); + assertEquals(33, resultSet.getInt(2)); + assertEquals(50.05f, resultSet.getFloat(3), 0.0); + assertEquals(123.456, resultSet.getDouble(4), 0.0); + assertEquals(123.456789, resultSet.getDouble(5), 0.0); + assertEquals("testString", resultSet.getString(6)); + assertEquals("Test String", new String(resultSet.getBytes(7), StandardCharsets.UTF_8)); + Struct expectedStruct = (Struct) resultSet.getObject(8); + assertThat(expectedStruct.getAttributes()).isEqualTo(asList("Eric", 10).toArray()); + assertEquals("{\"v\":{\"f\":[{\"v\":\"Eric\"},{\"v\":\"10\"}]}}", expectedStruct.toString()); + assertArrayEquals( + new String[] {"one", "two", "three"}, (String[]) resultSet.getArray(9).getArray()); + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356"), resultSet.getObject(10)); + assertEquals(Timestamp.valueOf("2020-04-27 18:07:25.356"), resultSet.getTimestamp(10)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getObject(11)); + assertEquals(Date.valueOf("2019-1-12"), resultSet.getDate(11)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getObject(12)); + assertEquals(Time.valueOf("14:00:00"), resultSet.getTime(12)); + assertEquals(Timestamp.valueOf("2022-01-22 22:22:12.142265"), resultSet.getObject(13)); + assertEquals("POINT(1 2)", resultSet.getString(14)); + assertEquals("{\"class\":{\"students\":[{\"name\":\"Jane\"}]}}", resultSet.getString(15)); + connection.close(); + } + + @Test + public void testValidExternalAccountAuthenticationInPSC() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=" + + PROJECT_ID + + ";OAUTHTYPE=4;" + + "BYOID_AudienceUri=//iam.googleapis.com/projects//locations//workloadIdentityPools//providers/;" + + "BYOID_SubjectTokenType=;" + + "BYOID_CredentialSource={\"file\":\"/path/to/file\"};" + + "BYOID_SA_Impersonation_Uri=;" + + "BYOID_TokenUri=;" + + "EndpointOverrides=BIGQUERY=https://bigquery-privateendpoint.p.googleapis.com," + + "OAuth2=https://oauth2-privateendpoint.p.googleapis.com/token;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "EXTERNAL_ACCOUNT_AUTH", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + + Statement statement = connection.createStatement(); + ResultSet resultSet = + statement.executeQuery( + "SELECT repository_name FROM `bigquery-public-data.samples.github_timeline` LIMIT 50"); + + assertNotNull(resultSet); + connection.close(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITProxyBigQueryTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITProxyBigQueryTest.java new file mode 100644 index 0000000000..fbde5ecc67 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITProxyBigQueryTest.java @@ -0,0 +1,234 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.ServiceOptions; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Arrays; +import java.util.List; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.experimental.runners.Enclosed; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; + +@RunWith(Enclosed.class) +public class ITProxyBigQueryTest { + static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); + static final String PROXY_HOST = "34.94.167.18"; + static final String PROXY_PORT = "3128"; + static final String PROXY_UID = "fahmz"; + static final String PROXY_PWD = "fahmz"; + + public static class NonParameterizedProxyTests { + @Test + public void testValidAuthenticatedProxy() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "ProxyHost=" + + PROXY_HOST + + ";ProxyPort=" + + PROXY_PORT + + ";ProxyUid=" + + PROXY_UID + + ";ProxyPwd=" + + PROXY_PWD + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + boolean result = + statement.execute( + "Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"); + assertTrue(result); + connection.close(); + } + + @Test + public void testAuthenticatedProxyWithOutAuthDetailsThrows() throws SQLException { + String query = "Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "ProxyHost=" + + PROXY_HOST + + ";ProxyPort=" + + PROXY_PORT + + ";"; + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.execute(query)); + } + + @Test + public void testNonExistingProxyTimesOut() throws SQLException { + String query = "Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"; + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "ProxyHost=111.12.111.11;" // If the test fails you may have this ip address + // assigned + + "ProxyPort=1111;"; + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + assertThrows(BigQueryJdbcException.class, () -> statement.execute(query)); + } + + @Test + @Ignore // Run this when Proxy server has no authentication otherwise you'll get a "407 Proxy + // Authentication Required". + public void testNonAuthenticatedProxy() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "ProxyHost=" + + PROXY_HOST + + ";ProxyPort=" + + PROXY_PORT + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + boolean result = + statement.execute( + "Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"); + assertTrue(result); + connection.close(); + } + + @Test + public void testValidNonProxyConnectionQueries() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + boolean result = + statement.execute( + "Select * FROM `bigquery-public-data.samples.github_timeline` LIMIT 180"); + assertTrue(result); + connection.close(); + } + + @Test + public void testReadAPIEnabledWithProxySettings() throws SQLException { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + "ProxyHost=" + + PROXY_HOST + + ";ProxyPort=" + + PROXY_PORT + + ";EnableHighThroughputAPI=1;" + + "ProxyUid=" + + PROXY_UID + + ";ProxyPwd=" + + PROXY_PWD + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + Statement statement = connection.createStatement(); + boolean result = + statement.execute( + "SELECT * FROM `bigquery-public-data.covid19_open_data_eu.covid19_open_data` LIMIT 200000"); + assertTrue(result); + connection.close(); + } + } + + @RunWith(Parameterized.class) + public static class ParametrizedMissingPropertiesTest { + private final String ProxyHost; + private final String ProxyPort; + private final String ProxyUid; + private final String ProxyPwd; + + public ParametrizedMissingPropertiesTest( + String ProxyHost, String ProxyPort, String ProxyUid, String ProxyPwd) { + this.ProxyHost = ProxyHost; + this.ProxyPort = ProxyPort; + this.ProxyUid = ProxyUid; + this.ProxyPwd = ProxyPwd; + } + + @Parameterized.Parameters + public static List ProxyParameters() { + String proxyHost = "ProxyHost=" + PROXY_HOST + ";"; + String proxyPort = "ProxyPort=" + PROXY_PORT + ";"; + String proxyUid = "ProxyUid=" + PROXY_UID + ";"; + String proxyPwd = "ProxyPwd=" + PROXY_PWD + ";"; + return Arrays.asList( + new String[][] { + {"", proxyPort, proxyUid, proxyPwd}, + {proxyHost, "", proxyUid, proxyPwd}, + {proxyHost, proxyPort, "", proxyPwd}, + {proxyHost, proxyPort, proxyUid, ""}, + {"", "", proxyUid, proxyPwd} + }); + } + + @Test + public void testMissingProxyParameterThrowsIllegalArgument() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=" + + PROJECT_ID + + ";OAuthType=3;" + + ProxyHost + + ProxyPort + + ProxyUid + + ProxyPwd; + assertThrows( + IllegalArgumentException.class, () -> DriverManager.getConnection(connection_uri)); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITTPCBigQueryTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITTPCBigQueryTest.java new file mode 100644 index 0000000000..3fa2d7d7e4 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITTPCBigQueryTest.java @@ -0,0 +1,220 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.it; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.bigquery.jdbc.BigQueryConnection; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import org.junit.Test; + +public class ITTPCBigQueryTest { + private static final String ENDPOINT_URL = System.getenv("ENDPOINT_URL"); + private static final String UNIVERSE_DOMAIN = System.getenv("UNIVERSE_DOMAIN"); + private static final String TPC_SERVICE_ACCOUNT = System.getenv("SERVICE_ACCOUNT"); + private static final String TPC_PVT_KEY = System.getenv("PRIVATE_KEY"); + private static final String TPC_ACCESS_TOKEN = System.getenv("ACCESS_TOKEN"); + private static final String TPC_PROJECT_ID = System.getenv("PROJECT_ID"); + + private static final String TPC_ENDPOINT = + (ENDPOINT_URL.isEmpty()) + ? "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443" + : "jdbc:bigquery://" + ENDPOINT_URL; + private static final String TPC_UNIVERSE_DOMAIN = + (UNIVERSE_DOMAIN.isEmpty()) ? "googleapis.com" : UNIVERSE_DOMAIN; + + // See here go/bq-cli-tpc for testing setup. + // Use the default test project. + // For the SA you will have to give it bigquery admin permissions cl/627813300 and will have to + // revert after testing. + // Plug in the values for the connection properties from the guide into the connection string. + @Test + public void testServiceAccountAuthenticationViaEmail() throws SQLException { + validateTPCEnvironment(); + String connection_uri = + TPC_ENDPOINT + + ";" + + "ProjectId=" + + TPC_PROJECT_ID + + ";" + + "OAuthType=0;" + + "universeDomain=" + + TPC_UNIVERSE_DOMAIN + + ";" + + "OAuthServiceAcctEmail=" + + TPC_SERVICE_ACCOUNT + + ";" + + "OAuthPvtKey=" + + TPC_PVT_KEY + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = "SELECT 1"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + // You will need to change the environment variable for GOOGLE_APPLICATION_CREDENTIALS to point to + // the SA key file. + @Test + public void testValidApplicationDefaultCredentialsAuthentication() throws SQLException { + validateTPCEnvironment(); + String connection_uri = + TPC_ENDPOINT + + ";" + + "OAuthType=3;" + + "ProjectId=" + + TPC_PROJECT_ID + + ";" + + "universeDomain=" + + TPC_UNIVERSE_DOMAIN + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "APPLICATION_DEFAULT_CREDENTIALS", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = "SELECT * FROM test.test;"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @Test + public void testValidPreGeneratedAccessTokenAuthentication() throws SQLException { + validateTPCEnvironment(); + String connection_uri = + TPC_ENDPOINT + + ";" + + "OAuthType=2;" + + "ProjectId=" + + TPC_PROJECT_ID + + ";" + + "OAuthAccessToken=" + + TPC_ACCESS_TOKEN + + ";" + + "universeDomain=" + + TPC_UNIVERSE_DOMAIN + + ";"; + + Connection connection = DriverManager.getConnection(connection_uri); + String query = "SELECT * FROM test.test;"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + assertNotNull(connection); + assertFalse(connection.isClosed()); + connection.close(); + } + + @Test + public void testSimpleQueryReturns() throws SQLException { + validateTPCEnvironment(); + String connection_uri = + TPC_ENDPOINT + + ";" + + "ProjectId=" + + TPC_PROJECT_ID + + ";" + + "OAuthType=0;" + + "universeDomain=" + + TPC_UNIVERSE_DOMAIN + + ";" + + "OAuthServiceAcctEmail=" + + TPC_SERVICE_ACCOUNT + + ";" + + "OAuthPvtKey=" + + TPC_PVT_KEY + + ";"; // Plug in this value when testing from the key file + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = "SELECT * FROM test.test;"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + @Test + public void testServiceAccountKeyFileReturns() throws SQLException { + validateTPCEnvironment(); + String connection_uri = + TPC_ENDPOINT + + ";" + + "ProjectId=" + + TPC_PROJECT_ID + + ";" + + "OAuthType=0;" + + "universeDomain=" + + TPC_UNIVERSE_DOMAIN + + ";" + // Point the key path to where you have downloaded it to. + + "OAuthPvtKeyPath=/Users/YourPathToSecretFile/SAKeyFile.json;"; + + Connection connection = DriverManager.getConnection(connection_uri); + assertNotNull(connection); + assertFalse(connection.isClosed()); + assertEquals( + "GOOGLE_SERVICE_ACCOUNT", + ((BigQueryConnection) connection).getAuthProperties().get("OAuthType")); + String query = "SELECT * FROM test.test;"; + Statement statement = connection.createStatement(); + ResultSet jsonResultSet = statement.executeQuery(query); + assertTrue(jsonResultSet.getClass().getName().contains("BigQueryJsonResultSet")); + connection.close(); + } + + private void validateTPCEnvironment() { + if (TPC_PROJECT_ID.isEmpty()) { + throw new IllegalArgumentException("TPC_PROJECT_ID is empty"); + } + if (TPC_SERVICE_ACCOUNT.isEmpty()) { + throw new IllegalArgumentException("TPC_SERVICE_ACCOUNT is empty"); + } + if (TPC_ENDPOINT.isEmpty()) { + throw new IllegalArgumentException("TPC_ENDPOINT is empty"); + } + if (TPC_PVT_KEY.isEmpty()) { + throw new IllegalArgumentException("TPC_PVT_KEY is empty"); + } + if (TPC_UNIVERSE_DOMAIN.isEmpty()) { + throw new IllegalArgumentException("TPC_UNIVERSE_DOMAIN is empty"); + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/rules/TimeZoneRule.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/rules/TimeZoneRule.java new file mode 100644 index 0000000000..ff5db108e8 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/rules/TimeZoneRule.java @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.rules; + +import java.util.TimeZone; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +public class TimeZoneRule implements TestRule { + + private final String timeZoneId; + private final TimeZone defaultTimeZone; + + public TimeZoneRule(String timeZoneId) { + this.timeZoneId = timeZoneId; + defaultTimeZone = TimeZone.getDefault(); + } + + @Override + public Statement apply(Statement base, Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + try { + TimeZone.setDefault(TimeZone.getTimeZone(timeZoneId)); + base.evaluate(); + } finally { + TimeZone.setDefault(defaultTimeZone); + } + } + }; + } + + /** + * Public method to enforce the rule from places like methods annotated with {@link + * org.junit.runners.Parameterized.Parameters} annotation which gets executed before this rule is + * applied. + */ + public void enforce() { + TimeZone.setDefault(TimeZone.getTimeZone(timeZoneId)); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/ArrowUtilities.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/ArrowUtilities.java new file mode 100644 index 0000000000..13f3007667 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/ArrowUtilities.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.utils; + +import com.google.api.core.InternalApi; +import com.google.protobuf.ByteString; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.channels.Channels; +import org.apache.arrow.vector.VectorSchemaRoot; +import org.apache.arrow.vector.VectorUnloader; +import org.apache.arrow.vector.ipc.WriteChannel; +import org.apache.arrow.vector.ipc.message.ArrowRecordBatch; +import org.apache.arrow.vector.ipc.message.MessageSerializer; +import org.apache.arrow.vector.types.pojo.Schema; + +@InternalApi("Used for testing purpose") +public class ArrowUtilities { + + public static ByteString serializeSchema(Schema schema) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + MessageSerializer.serialize(new WriteChannel(Channels.newChannel(out)), schema); + return ByteString.readFrom(new ByteArrayInputStream(out.toByteArray())); + } + + public static ByteString serializeVectorSchemaRoot(VectorSchemaRoot root) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + ArrowRecordBatch recordBatch = new VectorUnloader(root).getRecordBatch(); + MessageSerializer.serialize(new WriteChannel(Channels.newChannel(out)), recordBatch); + return ByteString.readFrom(new ByteArrayInputStream(out.toByteArray())); + + // ArrowStreamWriter writer = new ArrowStreamWriter(root, null, Channels.newChannel(out)); + // writer.start(); + // writer.writeBatch(); + // writer.end(); + // return ByteString.readFrom(new ByteArrayInputStream(out.toByteArray())); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/TestUtilities.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/TestUtilities.java new file mode 100644 index 0000000000..419cb9b0bc --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/TestUtilities.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.utils; + +import com.google.cloud.Tuple; +import com.google.cloud.bigquery.Field; +import com.google.cloud.bigquery.Field.Mode; +import com.google.cloud.bigquery.FieldList; +import com.google.cloud.bigquery.FieldValue; +import com.google.cloud.bigquery.FieldValue.Attribute; +import com.google.cloud.bigquery.FieldValueList; +import com.google.cloud.bigquery.StandardSQLTypeName; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.stream.Collectors; +import javax.sql.ConnectionEvent; +import javax.sql.ConnectionEventListener; +import org.apache.arrow.vector.util.JsonStringArrayList; +import org.apache.arrow.vector.util.JsonStringHashMap; + +public class TestUtilities { + + public static Tuple primitiveSchemaAndValue( + StandardSQLTypeName typeName, String value) { + Field schema = + Field.newBuilder(typeName.name() + "_column", typeName).setMode(Mode.NULLABLE).build(); + FieldValue primitiveValue = FieldValue.of(Attribute.PRIMITIVE, value); + + return Tuple.of(schema, primitiveValue); + } + + public static Tuple arraySchemaAndValue( + StandardSQLTypeName typeName, String... values) { + Field schema = + Field.newBuilder(typeName.name() + "_arr_column", typeName).setMode(Mode.REPEATED).build(); + + FieldValue arrayValues = + FieldValue.of( + Attribute.REPEATED, + FieldValueList.of( + Arrays.stream(values) + .map(value -> FieldValue.of(Attribute.PRIMITIVE, value)) + .collect(Collectors.toList()))); + + return Tuple.of(schema, arrayValues); + } + + public static Tuple, ArrayList> nestedResultSetToColumnLists( + ResultSet resultSet) throws SQLException { + ArrayList indexes = new ArrayList<>(); + ArrayList columnValues = new ArrayList<>(); + while (resultSet.next()) { + indexes.add(resultSet.getObject(1)); + columnValues.add((T) resultSet.getObject(2)); + } + return Tuple.of(indexes, columnValues); + } + + @SafeVarargs + public static Tuple> arrowStructOf( + Tuple... tuples) { + ArrayList fields = new ArrayList<>(); + JsonStringHashMap values = new JsonStringHashMap<>(); + + for (Tuple tuple : tuples) { + StandardSQLTypeName typeName = tuple.x(); + Object value = tuple.y(); + String name = typeName.name() + "_column"; + Field schema = Field.newBuilder(name, typeName).setMode(Mode.NULLABLE).build(); + fields.add(schema); + values.put(name, value); + } + return Tuple.of(FieldList.of(fields), values); + } + + public static Tuple> arrowArraySchemaAndValue( + StandardSQLTypeName typeName, T... values) { + Field schema = + Field.newBuilder(typeName.name() + "_arr_column", typeName).setMode(Mode.REPEATED).build(); + + JsonStringArrayList arrayValues = new JsonStringArrayList<>(); + arrayValues.addAll(Arrays.asList(values)); + return Tuple.of(schema, arrayValues); + } + + @SafeVarargs + public static JsonStringArrayList arrowArrayOf(T... values) { + JsonStringArrayList arrayValues = new JsonStringArrayList<>(); + arrayValues.addAll(Arrays.asList(values)); + return arrayValues; + } + + // struct of arrays + public static JsonStringHashMap toArrowStruct( + Iterable>> schemaAndValues) { + JsonStringHashMap struct = new JsonStringHashMap<>(); + for (Tuple> schemaAndValue : schemaAndValues) { + Field schema = schemaAndValue.x(); + JsonStringArrayList value = schemaAndValue.y(); + struct.put(schema.getName(), value); + } + return struct; + } + + public static class TestConnectionListener implements ConnectionEventListener { + private int connectionClosedCount = 0; + private int connectionErrorCount = 0; + + @Override + public void connectionClosed(ConnectionEvent arg0) { + connectionClosedCount++; + } + + @Override + public void connectionErrorOccurred(ConnectionEvent arg0) { + connectionErrorCount++; + } + + public int getConnectionClosedCount() { + return connectionClosedCount; + } + + public int getConnectionErrorCount() { + return connectionErrorCount; + } + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/URIBuilder.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/URIBuilder.java new file mode 100644 index 0000000000..ce34f42f54 --- /dev/null +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/utils/URIBuilder.java @@ -0,0 +1,34 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigquery.jdbc.utils; + +public class URIBuilder { + StringBuilder builder; + + public URIBuilder(String baseUri) { + builder = new StringBuilder(baseUri); + } + + public URIBuilder append(String key, Object value) { + builder.append(String.format("%s=%s;", key, value.toString())); + return this; + } + + public String toString() { + return builder.toString(); + } +} diff --git a/google-cloud-bigquery-jdbc/src/test/resources/fake.p12 b/google-cloud-bigquery-jdbc/src/test/resources/fake.p12 new file mode 100644 index 0000000000000000000000000000000000000000..d9e064411d4f7a6e831e96a468ebd3ec1c35abc3 GIT binary patch literal 5223 zcmbW5Ra6_?vd2RR0Sdw0T|y}d4#ll#ao6JRQXE1XT0FS5P^4&ar$BM5;98sy2u`sA z1rF!lv(C5f%e`mahds0QfA-AV{>`j`A;@fi7?>~w83c?AMJgjNAsE;g`3TZG5Q6j? zh9JFwA@I!qM+omZ2!W^iAS=NTScPD`e`Vo6!T{zYuw))Y37GxAGq4~qW0>gQS9}-` zi0sP`K@uDD_O;gu3Q`I}M!N@f1NA^4ClL^X35E~G`R|HATr2>L9*k>+RK~Ew1Ytly zMAq6F7bW*9y$WXH{!dVamLLRZENZxBb0*D8-}dawC$_zp6#Yg{-aoVxV!MMxM$U%c z4pLlU?MXg!d5k7pOQ7Eiqb<2V?j0(4bR;JcM73Ue0GFwx{Nd%730IkrQkUd|-FW=f z#xQC}chFzOd_Kd@jV()Mx`hm$?x!Fx4s}=yw6ma96$4;!LLPLktmRchOD5<0+PN+v)AhJSpuAMt|a_nxW79ftbY;>eNX zn@)qKf)*-+L30I>@Do*HEXCi3yXwB>N^V2Zo0TgJtVc2^x@Q)CQaJMsqe15Zp|tL^ z`o@;&bY8YPXhEJB*`aRF=#4QQ1uk`>QS1f(TMhJQ!&YkM+^Nr0hlBK50?j(ST2G}_ zMxxZaFPp4(%YW0&+9tjpfXv*giEgUg>$-}~RGCrOVV?-e_a@wCWw~XHM~NsZ|B5$v zT%$L4!}=p@0T#4Y@|fX4Wkx~pm>2d&&w5xVoU_~_zI1(BdYisTe^9j0Ga~9DWifnL zENSZi;gV%|f+>(GHe00or^sIbKj3X*rY&s%7Pss7=fboz-cpS;`V_Whdzd@?S9Gsr z@m-ya$8)%1gg;f4)ASSI8q_)we3t9r*bJNOtF8ln0TX5LJ$LD|yK&cU61|bmHTt!r!;RM5v*G1WyzKIiwxgjl9UUqF*o)Y+1#=hX9)-2im&@`?gzFlt@4e4YB*?<&0OXIYP*08WJE^cg z9K?H1VbG>Jo+yQ}b_J6qd`^tSc|(j0Z9biqFpI=Jaa2D(R{IMq&Sq6@h+SqgDrzsKuw4_U08$nk4!*%z)Td z4X6^sI{NS1%rOrq?ywo}2vAT;A z8EmDbIj3>-fNQ~c{*6mqGB^VR9l##o4R8Y30o(z$09QaDz!LD{!8<)z9~krBkICU= zAQC+%H#;V{h!9K+1{V<%;pZ24Aac(C3)2~X>Abt;2=rZqq@3P;(9pLJw4(nBrUiOh zw87C6*IM^+2~@un2)#7#D(lB!u(RdQ`aVJ25x!#kA7kGn*x(CjMVEninCHOpR8beXs6H?97B zE?hl9UOUdKEo8Z~?fmW=7rU*<G_jw-v9ghAxmqD^&I%7h%1<8wiK-L=?p%-vU)x|_2zCt)z;hr0Q6 z!1-tgsw@!ZrYk?)75|0=+2hqN1wXbH@W#M)xZBxD6$6D%?FLZ#Yf3BIPh~P684g*e ziTVsWyy8?K3~-Q+g%>*+j`tBA758 z6~mY|2`Z^iJYEKwI%;5;e^o*xT!9%&c1nh|LMIOCm`EzJcX?RLKwqHv*2vr`{hoEw z=8fjikgUyxZm^z1k#N0zWDub23A}CguZ~m7+mix0;*voggyq!sixdKjw?+4x@U7hu zWHW}?F$Wy@(4itbV?S@JAucc^$ z#juG-RdjQeT&1TzT5gKo@Ef;e-TqlFhe_N0jz$7GAYp^(?DOjq>w~D7*ZKqEu{Fme zID0ix$8@$tms`w%w>Rw}-*qgfVwwRbj2UNvs%$IrRa&F5joue_2XFiY_yrH$D zfnl=pH*`-~YChQ)VU2P+yxAZ9FhS;Yi@9~C+tP}`6+QZ%oHCiFQ&G4kXc(rl2IRA~ zqUUz(Dm*&yd8YzaUY_kumJ~kRw5gssm-v;}2GY*-Ey5H|?;y;qit}9268;h}|B13L zcSY;xQ;q@|t%X~?6zAz4*?REgiR>M&6`63E)aS}at-@rGl?Zfj6x zEcavAilKnPF%29NoD_Znqy@_JNmG{7(B-Yid#GJy}Y%isnOU1)~ehJUobI_lmVHLj7hJh06v=e>I z^pALr!oGd{0bxFCuA!hx4-HQdaQ2_O|zxaEB0~Uv^QGC18^29yN*!F zxE6_ZQQrwZJ;5WXkkHMX_mZ4x@~uP5zn|& zB>fPvi3!0_q=@FrOWSSXK%J6P-|_iUrmQDk8N++QEG87ISybOZ$D-e7GwSSa*&=g{ zZ@9_>TQ)%X^;_L6iYQfv4?ixx7^(lJ?x3#IbJ;nhpE;fhdd%g}E>Vpy^Udxg;WM}p zt_)-So4jOj3I;NO=YL_^{{hRs53qK5ID!8wp2he@`QZn1mpjjst2swA{5%KeR8NW=c06TFQ4c;1^g$tJ|K!NY>@euz9J$PrOW+@F9LxB zn4aSk_u$XCiv9G9n?*QjLgzwzItSXC$fhchiQ5_l@vmqjAzqTL16<3JWBU-^mG#8D z^5vbvPVOzHox1IsqV7Bq z5hP`(XOq6PUAJ1@f$U=N^@i&jIKEjW@8o`pZ=2t9sN#k7gs7KA>MPP8dPoBr8$3ge z_qV^E>q7igEI1<~&70a;E8pI6f2%?DqMAbo4n=qn5vaoyUlrkcMIM{_OP-XuNk|b( z7P_yoyA=tIvZ9J9;76tfGj9d_xj)G&atN+jWqn(^J|V&Y1~Y5`6rTp@J;Qb$UBca9 z*W)9{ch^i8b|ILvWT&a==lFwi+i?7yAyEFZ{W)X>?Akq(r9}nWKbbPB^IM!96_5+( z?kCtRG>j3?^4~_7`xxp^FY&3({blu@<;FbOu$c})DC@7h#%-`a;>{JBGJ|x8)_Zq-~2*}t(R9oyeiTDrSGox zWYDsHW2%e~ZO7ChYje-o@fzd1*fnl`0GM-&rX0b)2hDq7TkK4T<6ozI(dVFyg z8HEzNr57&OqcXkU7+aCX@Md_ajLsMhSQAVcuy_(kO;fmHU9Xjd_n@A5#Vq@j*LAuHg*8N4Ljn z=HmC%j~SJBJ(cZn#AVGePH`>?1D)kAH-HR%D7Oa=qwlC>_d&%`0QFV4XpKMXbvBQMBkTHnkl;Sb5tH*$r5N8>^F_^fHBb5ncB9~9ED9EOS zwF|v{Ih#n4WW-kz`W_V&X5biDOf5&X>QF<@gn`~*^@u9@OQb6 zo1ttiEJig*mWZfiH`z9Rr6$P5^ulbOkQjAbMbuC6afhy9i+KV^ommlogIb|cq4sO`0dwJ$z-1iT4FGnsr$obg{bYF&XUM;ipC9Z+T-$F14s zv=pys`*!@6@EX8utfEN6oc)S}ui3_Fu$kvBC@6DNzZa;k-${17-XHl^iLgL3L1WiB zvz3|6_}(+E=-_*MQYqzwbhb(?}i*0{vShjbq>0vfBQ-_}~O@WFPG9Rt8?XPJEZe9P!C zQ_LIHF-M|Hn7?0-> zTOWDw*8#;thAF9XUT0c5yCu3VKRh*B0NcXyFkOq|fqIm}RIr%%;$JMR`0>z9*{yr) zD%g#JVVDIju^9T)jfpXwV#)C6xS`9p&-w;MvKq?Wb<2OZt~D7_a#S5j>K%->T5O zdt7ny?YVz5gs9%bTT&<^)-6i(L{>YrbbNd0xMAyF;< zo(AcMD6iymo;{&+@rIIDOp#W!55v36njS6cAsMW+y}wFQVZ;xl^Absdr8JFVaAWyn zDure4#8gd(OvN4CUun9AT z1{?AkaDzA;!Ym=F#U(H~9`acOCF6XPOek210{FgG#wGZ-{6b}=2?M`XCssPbX4jZY zRn6r%w==C_=hL&l+vZR4nDbKH-($kd&73cedpNzhlJ2fS8e_u6uQ|#aEzM3bD zEn$tP>}1tz*DBIKf8PGxRb--OyHk(dF=v;;a$}WN&a9ku(gA}08-t5?CZ|W_qigQB7PaF zax3_yBS#`IwE`otk-@H3^~R#kjfVUe&xuUk_VCyYdEee^DdBQLns>^Yj!w!tai^Dg zXY;At_;kaIM%;$~&DheHIq;h_MNQh!5%)30F@rtPYcA*I^81^XY+KG~k?Gv!VU-vY zsYlu6Zqg-)wsyRhxw=d3QU>V&iSD}{<=-@IwRTr+m+ zZ2Tf5ag9kg`<3F)YsS^9^q*z$L_A_OOa8DbLu>liI<^J7T8^f!Uq5w?$a(e2z4^0l zv^&h&ykX<~`x&#n|K;2>DtOs)%59(M{rM_>tkITRwuQ2#OzpNmpLlKg3Ds|s0+X0u zOZ5o;{rxA)*LL~bKV0wc=7@#dy;mHlJe9j*wr1MN_9xdjF~y|eY0ZKj2B@A literal 0 HcmV?d00001 From 8bc43a055f3ca1e0bd0eec8d7edf0bd906374648 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 12 Jan 2026 14:12:12 -0500 Subject: [PATCH 2221/2268] test: Use unique table names in tests (#4053) * feat: Migrate to JUnit 5 and add parallel test execution * feat: Migrate tests to JUnit5 * chore: Add surefire-junit-platform dep for ITs * test: Enable parallel tests for JUnit5 * chore: Fix broken tests * chore: Upgrade existing integration tests to JUnit 5 syntax and features * chore: Upgrade ITNightlyBigQueryTest to JUnit 5 features and package-private * chore: Make the tests package-private * feat: migrate tests to JUnit 5 assertThrows and static imports * chore: Remove wildcard imports * chore: revert samples to use junit4 * chore: Address code comments * chore: Close connection after test * chore: Fix flaky tests * chore: Fix flaky tests * chore: Fix tests * chore: Disable cache for query stats * chore: Add unique id to each table * chore: Use unique test table names * chore: Remove parallel test execution * chore: Add comment for cache * chore: Fix broken test --------- Co-authored-by: AbgarSim --- .../cloud/bigquery/it/ITBigQueryTest.java | 146 ++++++++++-------- .../bigquery/it/ITNightlyBigQueryTest.java | 5 +- 2 files changed, 83 insertions(+), 68 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index fec7e55e05..76b358dae6 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -621,14 +621,16 @@ class ITBigQueryTest { private static final String EXTRACT_FILE = "extract.csv"; private static final String EXTRACT_MODEL_FILE = "extract_model.csv"; private static final String BUCKET = RemoteStorageHelper.generateBucketName(); - private static final TableId TABLE_ID = TableId.of(DATASET, "testing_table"); - private static final TableId TABLE_ID_DDL = TableId.of(DATASET, "ddl_testing_table"); - private static final TableId TABLE_ID_FASTQUERY = TableId.of(DATASET, "fastquery_testing_table"); - private static final TableId TABLE_ID_FASTQUERY_UK = - TableId.of(UK_DATASET, "fastquery_testing_table"); - private static final TableId TABLE_ID_LARGE = TableId.of(DATASET, "large_data_testing_table"); - private static final TableId TABLE_ID_FASTQUERY_BQ_RESULTSET = - TableId.of(DATASET, "fastquery_testing_bq_resultset"); + private static final TableId TABLE_ID = TableId.of(DATASET, generateTableName("testing_table")); + private static final TableId TABLE_ID_DDL = + TableId.of(DATASET, generateTableName("ddl_testing_table")); + private static final TableId TABLE_ID_FAST_QUERY = + TableId.of(DATASET, generateTableName("fast_query_testing_table")); + private static final TableId TABLE_ID_LARGE = + TableId.of(DATASET, generateTableName("large_data_testing_table")); + private static final TableId TABLE_ID_FAST_QUERY_BQ_RESULTSET = + TableId.of(DATASET, generateTableName("fast_query_testing_bq_resultset")); + private static final String CSV_CONTENT = "StringValue1\nStringValue2\n"; private static final String CSV_CONTENT_NULL = "String\0Value1\n"; private static final String CSV_CONTENT_FLEXIBLE_COLUMN = "name,&ersand\nrow_name,1"; @@ -1063,6 +1065,10 @@ public CompletableResultCode shutdown() { } } + private static String generateTableName(String prefix) { + return prefix + UUID.randomUUID().toString().substring(0, 8); + } + @BeforeAll static void beforeClass() throws InterruptedException, IOException { RemoteBigQueryHelper bigqueryHelper = RemoteBigQueryHelper.create(); @@ -1133,7 +1139,7 @@ static void beforeClass() throws InterruptedException, IOException { LoadJobConfiguration configurationFastQuery = LoadJobConfiguration.newBuilder( - TABLE_ID_FASTQUERY, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) + TABLE_ID_FAST_QUERY, "gs://" + BUCKET + "/" + JSON_LOAD_FILE, FormatOptions.json()) .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) .setSchema(TABLE_SCHEMA) .setLabels(labels) @@ -1144,7 +1150,7 @@ static void beforeClass() throws InterruptedException, IOException { LoadJobConfiguration configFastQueryBQResultset = LoadJobConfiguration.newBuilder( - TABLE_ID_FASTQUERY_BQ_RESULTSET, + TABLE_ID_FAST_QUERY_BQ_RESULTSET, "gs://" + BUCKET + "/" + JSON_LOAD_FILE_BQ_RESULTSET, FormatOptions.json()) .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) @@ -2681,7 +2687,7 @@ void testListTablesWithRangePartitioning() { @Test void testListPartitions() throws InterruptedException { - String tableName = "test_table_partitions_" + UUID.randomUUID().toString().substring(0, 8); + String tableName = generateTableName("test_table_partitions_"); Date date = Date.fromJavaUtilDate(new java.util.Date()); String partitionDate = date.toString().replaceAll("-", ""); TableId tableId = TableId.of(DATASET, tableName + "$" + partitionDate); @@ -3503,8 +3509,15 @@ void testLosslessTimestamp() throws InterruptedException { void testQuery() throws InterruptedException { String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); QueryJobConfiguration config = - QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); + QueryJobConfiguration.newBuilder(query) + // Disable the cache as query plans do not exist from cached results + // This will force generation of execution plan + .setUseQueryCache(false) + .setDefaultDataset(DatasetId.of(DATASET)) + .build(); Job job = bigquery.create(JobInfo.of(JobId.of(), config)); + job = job.waitFor(); + assertNotNull(job); TableResult result = job.getQueryResults(); assertNotNull(result.getJobId()); @@ -3527,6 +3540,7 @@ void testQuery() throws InterruptedException { } assertEquals(2, rowCount); + // Query Plan will exist for a completed job Job job2 = bigquery.getJob(job.getJobId()); JobStatistics.QueryStatistics statistics = job2.getStatistics(); assertNotNull(statistics.getQueryPlan()); @@ -3822,7 +3836,7 @@ void testConnectionImplDryRun() throws SQLException { String query = String.format( "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from %s where StringField = ? order by TimestampField", - TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable()); + TABLE_ID_FAST_QUERY_BQ_RESULTSET.getTable()); ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() .setDefaultDataset(DatasetId.of(DATASET)) @@ -3850,7 +3864,7 @@ void testConnectionImplDryRunNoQueryParameters() throws SQLException { + "TimestampField, FloatField, NumericField, TimeField, DateField, DateTimeField, " + "GeographyField, RecordField.BytesField, RecordField.BooleanField, " + "IntegerArrayField from %s order by TimestampField", - TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable()); + TABLE_ID_FAST_QUERY_BQ_RESULTSET.getTable()); ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() .setDefaultDataset(DatasetId.of(DATASET)) @@ -3933,7 +3947,7 @@ void testExecuteSelectSinglePageTableRow() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " - + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + TABLE_ID_FAST_QUERY_BQ_RESULTSET.getTable() + " order by TimestampField"; ConnectionSettings connectionSettings = ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build(); @@ -3997,7 +4011,7 @@ void testExecuteSelectSinglePageTableRowWithReadAPI() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " - + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + TABLE_ID_FAST_QUERY_BQ_RESULTSET.getTable() + " order by TimestampField"; ConnectionSettings connectionSettings = ConnectionSettings.newBuilder() @@ -4344,7 +4358,7 @@ void testExecuteSelectSinglePageTableRowColInd() throws SQLException { String query = "select StringField, BigNumericField, BooleanField, BytesField, IntegerField, TimestampField, FloatField, " + "NumericField, TimeField, DateField, DateTimeField , GeographyField, RecordField.BytesField, RecordField.BooleanField, IntegerArrayField from " - + TABLE_ID_FASTQUERY_BQ_RESULTSET.getTable() + + TABLE_ID_FAST_QUERY_BQ_RESULTSET.getTable() + " order by TimestampField"; /* Column Index mapping for ref: @@ -4543,7 +4557,7 @@ void testExecuteSelectArrayOfStruct() throws SQLException { @Test void testFastQueryMultipleRuns() throws InterruptedException { String query = - "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); + "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FAST_QUERY.getTable(); QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); @@ -4580,7 +4594,7 @@ void testFastQueryMultipleRuns() throws InterruptedException { @Test void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedException { String query = - "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); + "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FAST_QUERY.getTable(); QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); @@ -4613,7 +4627,7 @@ void testFastQuerySinglePageDuplicateRequestIds() throws InterruptedException { @Test void testFastSQLQuery() throws InterruptedException { String query = - "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); + "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FAST_QUERY.getTable(); QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(config); @@ -4642,27 +4656,27 @@ void testFastSQLQuery() throws InterruptedException { @Test void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { - String random_project_id = "RANDOM_PROJECT_" + UUID.randomUUID().toString().replace('-', '_'); - System.out.println(random_project_id); + String invalidProjectId = "RANDOM_PROJECT_" + UUID.randomUUID().toString().replace('-', '_'); String query = - "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable(); + "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FAST_QUERY.getTable(); // With incorrect projectID in jobid // The job will be created with the specified(incorrect) projectID // hence failing the operation - JobId jobIdWithProjectId = JobId.newBuilder().setProject(random_project_id).build(); + JobId jobIdWithProjectId = JobId.newBuilder().setProject(invalidProjectId).build(); QueryJobConfiguration configSelect = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(DATASET)).build(); try { bigquery.query(configSelect, jobIdWithProjectId); } catch (Exception exception) { // error message for non-existent project - assertTrue(exception.getMessage().contains("Cannot parse as CloudRegion")); + assertEquals("Cannot parse as CloudRegion.", exception.getMessage()); assertEquals(BigQueryException.class, exception.getClass()); } } @Test void testLocationFastSQLQueryWithJobId() throws InterruptedException { + TableId tableIdFastQueryUk = TableId.of(UK_DATASET, "fastquery_testing_table"); DatasetInfo infoUK = DatasetInfo.newBuilder(UK_DATASET) .setDescription(DESCRIPTION) @@ -4672,11 +4686,11 @@ void testLocationFastSQLQueryWithJobId() throws InterruptedException { bigquery.create(infoUK); TableDefinition tableDefinition = StandardTableDefinition.of(SIMPLE_SCHEMA); - TableInfo tableInfo = TableInfo.newBuilder(TABLE_ID_FASTQUERY_UK, tableDefinition).build(); + TableInfo tableInfo = TableInfo.newBuilder(tableIdFastQueryUk, tableDefinition).build(); bigquery.create(tableInfo); String insert = - "INSERT " + UK_DATASET + "." + TABLE_ID_FASTQUERY_UK.getTable() + " VALUES('Anna');"; + "INSERT " + UK_DATASET + "." + tableIdFastQueryUk.getTable() + " VALUES('Anna');"; QueryJobConfiguration config = QueryJobConfiguration.newBuilder(insert) @@ -4685,10 +4699,12 @@ void testLocationFastSQLQueryWithJobId() throws InterruptedException { TableResult result = bigquery.query(config); assertNotNull(result.getJobId()); assertEquals(SIMPLE_SCHEMA, result.getSchema()); - assertEquals(1, result.getTotalRows()); - assertNull(result.getNextPage()); - assertNull(result.getNextPageToken()); - assertFalse(result.hasNextPage()); + // Use `getNumDmlAffectedRows()` for DML operations + Job queryJob = bigquery.getJob(result.getJobId()); + queryJob = queryJob.waitFor(); + JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); + assertEquals(1L, statistics.getNumDmlAffectedRows().longValue()); + // Verify correctness of table content for (FieldValueList row : result.getValues()) { FieldValue stringCell = row.get(0); @@ -4698,7 +4714,7 @@ void testLocationFastSQLQueryWithJobId() throws InterruptedException { // With incorrect location in jobid // The job will be created with the specified(incorrect) location // hence failing the operation - String query = "SELECT StringField FROM " + TABLE_ID_FASTQUERY_UK.getTable(); + String query = "SELECT StringField FROM " + tableIdFastQueryUk.getTable(); JobId jobIdWithLocation = JobId.newBuilder().setLocation("us-west1").build(); QueryJobConfiguration configSelect = QueryJobConfiguration.newBuilder(query).setDefaultDataset(DatasetId.of(UK_DATASET)).build(); @@ -4757,7 +4773,7 @@ void testFastSQLQueryMultiPage() throws InterruptedException { @Test void testFastDMLQuery() throws InterruptedException { - String tableName = TABLE_ID_FASTQUERY.getTable(); + String tableName = TABLE_ID_FAST_QUERY.getTable(); String dmlQuery = String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); QueryJobConfiguration dmlConfig = QueryJobConfiguration.newBuilder(dmlQuery).build(); @@ -4812,8 +4828,7 @@ void testFastDDLQuery() throws InterruptedException { @Test void testFastQuerySlowDDL() throws InterruptedException { - String tableName = - "test_table_fast_query_ddl_slow_" + UUID.randomUUID().toString().substring(0, 8); + String tableName = generateTableName("test_table_fast_query_ddl_slow_"); // This query take more than 10s to run and should fall back on the old query path String slowDdlQuery = String.format( @@ -4846,7 +4861,7 @@ void testFastQuerySlowDDL() throws InterruptedException { @Test void testFastQueryHTTPException() throws InterruptedException { String queryInvalid = - "CREATE OR REPLACE SELECT * FROM UPDATE TABLE SET " + TABLE_ID_FASTQUERY.getTable(); + "CREATE OR REPLACE SELECT * FROM UPDATE TABLE SET " + TABLE_ID_FAST_QUERY.getTable(); QueryJobConfiguration configInvalidQuery = QueryJobConfiguration.newBuilder(queryInvalid) .setDefaultDataset(DatasetId.of(DATASET)) @@ -5063,7 +5078,7 @@ void testExecuteSelectSessionSupport() throws BigQuerySQLException { @Test void testDmlStatistics() throws InterruptedException { - String tableName = TABLE_ID_FASTQUERY.getTable(); + String tableName = TABLE_ID_FAST_QUERY.getTable(); // Run a DML statement to UPDATE 2 rows of data String dmlQuery = String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); @@ -5085,7 +5100,7 @@ void testDmlStatistics() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testTransactionInfo() throws InterruptedException { - String tableName = TABLE_ID_FASTQUERY.getTable(); + String tableName = TABLE_ID_FAST_QUERY.getTable(); String transaction = String.format( "BEGIN TRANSACTION;\n" @@ -5726,8 +5741,8 @@ void testListJobsWithCreationBounding() { @Test void testCreateAndGetJob() throws InterruptedException, TimeoutException { - String sourceTableName = "test_create_and_get_job_source_table"; - String destinationTableName = "test_create_and_get_job_destination_table"; + String sourceTableName = generateTableName("test_create_and_get_job_source_table"); + String destinationTableName = generateTableName("test_create_and_get_job_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5784,8 +5799,10 @@ void testCreateJobAndWaitForWithRetryOptions() throws InterruptedException, Time @Test void testCreateAndGetJobWithSelectedFields() throws InterruptedException, TimeoutException { - String sourceTableName = "test_create_and_get_job_with_selected_fields_source_table"; - String destinationTableName = "test_create_and_get_job_with_selected_fields_destination_table"; + String sourceTableName = + generateTableName("test_create_and_get_job_with_selected_fields_source_table"); + String destinationTableName = + generateTableName("test_create_and_get_job_with_selected_fields_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5832,8 +5849,8 @@ void testCreateAndGetJobWithSelectedFields() throws InterruptedException, Timeou @Test void testCopyJob() throws InterruptedException, TimeoutException { - String sourceTableName = "test_copy_job_source_table"; - String destinationTableName = "test_copy_job_destination_table"; + String sourceTableName = generateTableName("test_copy_job_source_table"); + String destinationTableName = generateTableName("test_copy_job_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5864,8 +5881,8 @@ void testCopyJob() throws InterruptedException, TimeoutException { @Test void testCopyJobStatistics() throws InterruptedException, TimeoutException { - String sourceTableName = "test_copy_job_statistics_source_table"; - String destinationTableName = "test_copy_job_statistics_destination_table"; + String sourceTableName = generateTableName("test_copy_job_statistics_source_table"); + String destinationTableName = generateTableName("test_copy_job_statistics_destination_table"); QueryJobConfiguration createTable = QueryJobConfiguration.newBuilder( @@ -5974,10 +5991,8 @@ void testSnapshotTableCopyJob() throws InterruptedException { @Test void testCopyJobWithLabelsAndExpTime() throws InterruptedException { String destExpiryTime = "2099-12-31T23:59:59.999999999Z"; - String sourceTableName = - "test_copy_job_source_table_label" + UUID.randomUUID().toString().substring(0, 8); - String destinationTableName = - "test_copy_job_destination_table_label" + UUID.randomUUID().toString().substring(0, 8); + String sourceTableName = generateTableName("test_copy_job_source_table_label"); + String destinationTableName = generateTableName("test_copy_job_destination_table_label"); Map labels = ImmutableMap.of("test_job_name", "test_copy_job"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); @@ -6006,7 +6021,7 @@ void testCopyJobWithLabelsAndExpTime() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJob() throws InterruptedException, TimeoutException { - String tableName = "test_query_job_table"; + String tableName = generateTableName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6052,7 +6067,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithConnectionProperties() throws InterruptedException { - String tableName = "test_query_job_table_connection_properties"; + String tableName = generateTableName("test_query_job_table_connection_properties"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6072,7 +6087,7 @@ void testQueryJobWithConnectionProperties() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithLabels() throws InterruptedException, TimeoutException { - String tableName = "test_query_job_table"; + String tableName = generateTableName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); Map labels = ImmutableMap.of("test-job-name", "test-query-job"); TableId destinationTable = TableId.of(DATASET, tableName); @@ -6095,11 +6110,9 @@ void testQueryJobWithLabels() throws InterruptedException, TimeoutException { @Test void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException { - String tableName = "test_query_job_table"; + String tableName = generateTableName("test_query_job_table"); String query = - "SELECT * FROM " - + TABLE_ID.getTable() - + " WHERE search(StringField, \"stringValue\")"; + "SELECT * FROM " + TABLE_ID.getTable() + " WHERE search(StringField, \"stringValue\")"; TableId destinationTable = TableId.of(DATASET, tableName); try { QueryJobConfiguration configuration = @@ -6125,7 +6138,7 @@ void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedExc /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithRangePartitioning() throws InterruptedException { - String tableName = "test_query_job_table_rangepartitioning"; + String tableName = generateTableName("test_query_job_table_rangepartitioning"); String query = "SELECT IntegerField, TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); @@ -6150,7 +6163,7 @@ void testQueryJobWithRangePartitioning() throws InterruptedException { @Test void testLoadJobWithRangePartitioning() throws InterruptedException { - String tableName = "test_load_job_table_rangepartitioning"; + String tableName = generateTableName("test_load_job_table_rangepartitioning"); TableId destinationTable = TableId.of(DATASET, tableName); try { LoadJobConfiguration configuration = @@ -6174,7 +6187,7 @@ void testLoadJobWithRangePartitioning() throws InterruptedException { @Test void testLoadJobWithDecimalTargetTypes() throws InterruptedException { - String tableName = "test_load_job_table_parquet_decimalTargetTypes"; + String tableName = generateTableName("test_load_job_table_parquet_decimalTargetTypes"); TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; try { @@ -6202,7 +6215,7 @@ void testLoadJobWithDecimalTargetTypes() throws InterruptedException { @Test void testExternalTableWithDecimalTargetTypes() throws InterruptedException { - String tableName = "test_create_external_table_parquet_decimalTargetTypes"; + String tableName = generateTableName("test_create_external_table_parquet_decimalTargetTypes"); TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; ExternalTableDefinition externalTableDefinition = @@ -6222,7 +6235,7 @@ void testExternalTableWithDecimalTargetTypes() throws InterruptedException { @Test void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { - String tableName = "test_query_job_table"; + String tableName = generateTableName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6240,7 +6253,7 @@ void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { @Test void testExtractJob() throws InterruptedException, TimeoutException { - String tableName = "test_export_job_table"; + String tableName = generateTableName("test_export_job_table"); TableId destinationTable = TableId.of(DATASET, tableName); Map labels = ImmutableMap.of("test-job-name", "test-load-extract-job"); LoadJobConfiguration configuration = @@ -6317,7 +6330,7 @@ void testExtractJobWithModel() throws InterruptedException { @Test void testExtractJobWithLabels() throws InterruptedException, TimeoutException { - String tableName = "test_export_job_table_label"; + String tableName = generateTableName("test_export_job_table_label"); Map labels = ImmutableMap.of("test_job_name", "test_export_job"); TableId destinationTable = TableId.of(DATASET, tableName); LoadJobConfiguration configuration = @@ -6343,7 +6356,7 @@ void testExtractJobWithLabels() throws InterruptedException, TimeoutException { @Test void testCancelJob() throws InterruptedException, TimeoutException { - String destinationTableName = "test_cancel_query_job_table"; + String destinationTableName = generateTableName("test_cancel_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, destinationTableName); QueryJobConfiguration configuration = @@ -6625,7 +6638,8 @@ void testWriteChannelPreserveAsciiControlCharacters() @Test void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { - String destinationTableName = "test_load_job_preserve_ascii_control_characters"; + String destinationTableName = + generateTableName("test_load_job_preserve_ascii_control_characters"); TableId destinationTable = TableId.of(DATASET, destinationTableName); try { diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java index 84e355f9e6..6418682038 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITNightlyBigQueryTest.java @@ -77,7 +77,8 @@ public class ITNightlyBigQueryTest { private static final Logger logger = Logger.getLogger(ITNightlyBigQueryTest.class.getName()); private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); - private static final String TABLE = "TEMP_RS_TEST_TABLE"; + private static final String TABLE = + "TEMP_RS_TEST_TABLE" + UUID.randomUUID().toString().substring(0, 8); private static final byte[] BYTES = "TestByteValue".getBytes(StandardCharsets.UTF_8); private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); // Script will populate NUM_BATCHES*REC_PER_BATCHES number of records (eg: 100*10000 = 1M) @@ -355,7 +356,7 @@ void testConnectionClose() throws SQLException { while (rs.next()) { ++cnt; if (cnt == 50000) { // interrupt at 50K - assertTrue(connection.close()); + break; } } assertTrue(LIMIT_RECS > cnt); From c241d5ebc681e4cad32db37c2f53c906ab0e2dd9 Mon Sep 17 00:00:00 2001 From: Abgar Simonean Date: Tue, 13 Jan 2026 18:21:04 +0200 Subject: [PATCH 2222/2268] feat:Add JUnit 5 and add parallel test execution (#4058) --- .../src/test/resources/junit-platform.properties | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 google-cloud-bigquery/src/test/resources/junit-platform.properties diff --git a/google-cloud-bigquery/src/test/resources/junit-platform.properties b/google-cloud-bigquery/src/test/resources/junit-platform.properties new file mode 100644 index 0000000000..3b9a816b45 --- /dev/null +++ b/google-cloud-bigquery/src/test/resources/junit-platform.properties @@ -0,0 +1,3 @@ +junit.jupiter.execution.parallel.enabled=true + +junit.jupiter.execution.parallel.mode.default=concurrent \ No newline at end of file From 99058eada1918263db0816123af88f946a874093 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Tue, 13 Jan 2026 16:00:20 -0500 Subject: [PATCH 2223/2268] chore: cleanup release-please config (#4013) * chore: cleanup release-please config - Remove redundant options already declared at the top level.\n- Remove bumpMinorPreMajor for repositories after the first major release. * chore: format release-please.yml --- .github/release-please.yml | 67 ++++++++++++-------------------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/.github/release-please.yml b/.github/release-please.yml index e78d84de07..412c1b796e 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,49 +1,24 @@ branches: - - branch: 1.127.12-sp - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-lts - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - branch: java7 - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.3.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.10.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.19.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.35.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.40.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.48.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.52.x - - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-backport - branch: 2.51.x - - branch: protobuf-4.x-rc - bumpMinorPreMajor: true - handleGHRelease: true - releaseType: java-yoshi - manifest: true -bumpMinorPreMajor: true + - branch: 1.127.12-sp + releaseType: java-lts + - branch: java7 + - branch: 2.3.x + releaseType: java-backport + - branch: 2.10.x + releaseType: java-backport + - branch: 2.19.x + releaseType: java-backport + - branch: 2.35.x + releaseType: java-backport + - branch: 2.40.x + releaseType: java-backport + - branch: 2.48.x + releaseType: java-backport + - branch: 2.52.x + releaseType: java-backport + - branch: 2.51.x + releaseType: java-backport + - branch: protobuf-4.x-rc + manifest: true handleGHRelease: true releaseType: java-yoshi From 176199f5d1a3e387558ada47747c3118b4182c77 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Jan 2026 19:22:38 +0000 Subject: [PATCH 2224/2268] chore(deps): update dependency com.google.cloud:sdk-platform-java-config to v3.55.1 (#4060) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 3c07fc2027..e9cacb9dc2 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.54.2 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.55.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 20c0ac4a52..a2798bba2c 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.55.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 3b7b14a650..1f804ecee9 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.55.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index a41d88c092..641a3fb1db 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.55.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 20c0ac4a52..a2798bba2c 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.55.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 3b7b14a650..1f804ecee9 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.55.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index a41d88c092..641a3fb1db 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.54.2" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.55.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 4cfd474143..52ea2c14be 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.54.2 + 3.55.1 diff --git a/pom.xml b/pom.xml index f99bb3f907..d689261713 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.54.2 + 3.55.1 From decd8e7bbc0f3550f2f27993d20581788bf7bcf7 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Thu, 15 Jan 2026 12:23:59 -0800 Subject: [PATCH 2225/2268] chore(main): update CODEOWNERS with JDBC ownership (#4063) --- .github/CODEOWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7892b1d67b..d5cda28465 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,3 +12,6 @@ samples/**/*.java @googleapis/cloud-java-team-teamsync @googleapis/java-sa # Generated snippets should not be owned by samples reviewers samples/snippets/generated/ @googleapis/cloud-java-team-teamsync @googleapis/yoshi-java + +# JDBC Driver +google-cloud-bigquery-jdbc/** @googleapis/bq-developer-tools @googleapis/cloud-java-team-teamsync From ea0cd5776ff6035d5fa66281cc8eac6ac41ef70b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 15 Jan 2026 20:49:40 +0000 Subject: [PATCH 2226/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.19.1 (#4036) * chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.20.0-rc1 * Update google-cloud-bigquerystorage-bom version --------- Co-authored-by: Diego Marquez --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d689261713..2929f8a9f5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.19.0 + 3.19.1 pom import From ae6f8bd516c8e73a6beccfe2833dbc0d70aaf4e0 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Thu, 15 Jan 2026 17:21:12 -0500 Subject: [PATCH 2227/2268] chore: Enable exponential backoff for retries in tests (#4059) * chore: Enable exponential backoff for retries in tests * chore: Clone table for DML query tests * chore: Use GCA retry settings code suggestion --- .../testing/RemoteBigQueryHelper.java | 36 +++--- .../cloud/bigquery/it/ITBigQueryTest.java | 109 +++++++++++++----- .../testing/RemoteBigQueryHelperTest.java | 13 +-- 3 files changed, 106 insertions(+), 52 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java index c32e1a0516..d195dc245e 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelper.java @@ -45,7 +45,7 @@ public class RemoteBigQueryHelper { private static final String MODEL_NAME_PREFIX = "model_"; private static final String ROUTINE_NAME_PREFIX = "routine_"; private final BigQueryOptions options; - private static final int connectTimeout = 60000; + private static final int CONNECT_TIMEOUT_IN_MS = 60000; private RemoteBigQueryHelper(BigQueryOptions options) { this.options = options; @@ -96,8 +96,8 @@ public static RemoteBigQueryHelper create(String projectId, InputStream keyStrea HttpTransportOptions transportOptions = BigQueryOptions.getDefaultHttpTransportOptions(); transportOptions = transportOptions.toBuilder() - .setConnectTimeout(connectTimeout) - .setReadTimeout(connectTimeout) + .setConnectTimeout(CONNECT_TIMEOUT_IN_MS) + .setReadTimeout(CONNECT_TIMEOUT_IN_MS) .build(); BigQueryOptions bigqueryOptions = BigQueryOptions.newBuilder() @@ -133,8 +133,8 @@ public static RemoteBigQueryHelper create(BigQueryOptions.Builder bigqueryOption HttpTransportOptions transportOptions = BigQueryOptions.getDefaultHttpTransportOptions(); transportOptions = transportOptions.toBuilder() - .setConnectTimeout(connectTimeout) - .setReadTimeout(connectTimeout) + .setConnectTimeout(CONNECT_TIMEOUT_IN_MS) + .setReadTimeout(CONNECT_TIMEOUT_IN_MS) .build(); BigQueryOptions.Builder builder = bigqueryOptionsBuilder @@ -143,21 +143,25 @@ public static RemoteBigQueryHelper create(BigQueryOptions.Builder bigqueryOption return new RemoteBigQueryHelper(builder.build()); } + // Opt to keep these settings a small as possible to minimize the total test time. + // These values can be adjusted per test case, but these serve as default values. private static RetrySettings retrySettings() { - double retryDelayMultiplier = 1.0; + double backoffMultiplier = 1.5; int maxAttempts = 10; - long initialRetryDelay = 250L; - long maxRetryDelay = 30000L; - long totalTimeOut = 120000L; + long initialRetryDelayMs = 100L; // 0.1s initial retry delay + long maxRetryDelayMs = 1000L; // 1s max retry delay between retry + long initialRpcTimeoutMs = 1000L; // 1s initial rpc duration + long maxRpcTimeoutMs = 2000L; // 2s max rpc duration + long totalTimeoutMs = 3000L; // 3s total timeout return RetrySettings.newBuilder() .setMaxAttempts(maxAttempts) - .setMaxRetryDelayDuration(Duration.ofMillis(maxRetryDelay)) - .setTotalTimeoutDuration(Duration.ofMillis(totalTimeOut)) - .setInitialRetryDelayDuration(Duration.ofMillis(initialRetryDelay)) - .setRetryDelayMultiplier(retryDelayMultiplier) - .setInitialRpcTimeoutDuration(Duration.ofMillis(totalTimeOut)) - .setRpcTimeoutMultiplier(retryDelayMultiplier) - .setMaxRpcTimeoutDuration(Duration.ofMillis(totalTimeOut)) + .setTotalTimeoutDuration(Duration.ofMillis(totalTimeoutMs)) + .setInitialRetryDelayDuration(Duration.ofMillis(initialRetryDelayMs)) + .setMaxRetryDelayDuration(Duration.ofMillis(maxRetryDelayMs)) + .setRetryDelayMultiplier(backoffMultiplier) + .setInitialRpcTimeoutDuration(Duration.ofMillis(initialRpcTimeoutMs)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(maxRpcTimeoutMs)) + .setRpcTimeoutMultiplier(backoffMultiplier) .build(); } diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 76b358dae6..d41ccc0e12 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -477,7 +477,7 @@ class ITBigQueryTest { Field.newBuilder("BooleanField", LegacySQLTypeName.BOOLEAN) .setDescription("BooleanDescription") .build(); - private static final Schema DDL_TABLE_SCHEMA = + private static final Schema SIMPLE_TABLE_SCHEMA = Schema.of(DDL_TIMESTAMP_FIELD_SCHEMA, DDL_STRING_FIELD_SCHEMA, DDL_BOOLEAN_FIELD_SCHEMA); private static final Schema LARGE_TABLE_SCHEMA = Schema.of( @@ -622,7 +622,7 @@ class ITBigQueryTest { private static final String EXTRACT_MODEL_FILE = "extract_model.csv"; private static final String BUCKET = RemoteStorageHelper.generateBucketName(); private static final TableId TABLE_ID = TableId.of(DATASET, generateTableName("testing_table")); - private static final TableId TABLE_ID_DDL = + private static final TableId TABLE_ID_SIMPLE = TableId.of(DATASET, generateTableName("ddl_testing_table")); private static final TableId TABLE_ID_FAST_QUERY = TableId.of(DATASET, generateTableName("fast_query_testing_table")); @@ -1163,9 +1163,11 @@ static void beforeClass() throws InterruptedException, IOException { LoadJobConfiguration configurationDDL = LoadJobConfiguration.newBuilder( - TABLE_ID_DDL, "gs://" + BUCKET + "/" + JSON_LOAD_FILE_SIMPLE, FormatOptions.json()) + TABLE_ID_SIMPLE, + "gs://" + BUCKET + "/" + JSON_LOAD_FILE_SIMPLE, + FormatOptions.json()) .setCreateDisposition(JobInfo.CreateDisposition.CREATE_IF_NEEDED) - .setSchema(DDL_TABLE_SCHEMA) + .setSchema(SIMPLE_TABLE_SCHEMA) .setLabels(labels) .build(); Job jobDDL = bigquery.create(JobInfo.of(configurationDDL)); @@ -4773,24 +4775,41 @@ void testFastSQLQueryMultiPage() throws InterruptedException { @Test void testFastDMLQuery() throws InterruptedException { - String tableName = TABLE_ID_FAST_QUERY.getTable(); + // The test runs an update query. Clone the table to ensure that this doesn't impact + // other tests. + String tableName = generateTableName("test_table_fast_query_dml"); + String tableNameFastQuery = TABLE_ID_SIMPLE.getTable(); + String ddlQuery = + String.format( + "CREATE OR REPLACE TABLE %s (" + + "TimestampField TIMESTAMP OPTIONS(description='TimestampDescription'), " + + "StringField STRING OPTIONS(description='StringDescription'), " + + "BooleanField BOOLEAN OPTIONS(description='BooleanDescription') " + + ") AS SELECT DISTINCT * FROM %s", + tableName, tableNameFastQuery); + QueryJobConfiguration ddlConfig = + QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); + TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); + String dmlQuery = String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); QueryJobConfiguration dmlConfig = QueryJobConfiguration.newBuilder(dmlQuery).build(); - TableResult result = bigquery.query(dmlConfig); - assertNotNull(result.getJobId()); - assertEquals(TABLE_SCHEMA, result.getSchema()); + TableResult resultAfterDML = bigquery.query(dmlConfig); + assertNotNull(resultAfterDML.getJobId()); + assertEquals(SIMPLE_TABLE_SCHEMA, resultAfterDML.getSchema()); // Using the job reference on the TableResult, lookup and verify DML statistics. - Job queryJob = bigquery.getJob(result.getJobId()); + Job queryJob = bigquery.getJob(resultAfterDML.getJobId()); + queryJob = queryJob.waitFor(); JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); - assertEquals(2L, statistics.getNumDmlAffectedRows().longValue()); - assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); + assertEquals(1L, statistics.getNumDmlAffectedRows().longValue()); + assertEquals(1L, statistics.getDmlStats().getUpdatedRowCount().longValue()); } @Test void testFastDDLQuery() throws InterruptedException { - String tableName = "test_table_fast_query_ddl"; - String tableNameFastQuery = TABLE_ID_DDL.getTable(); + String tableName = generateTableName("test_table_fast_query_ddl"); + String tableNameFastQuery = TABLE_ID_SIMPLE.getTable(); String ddlQuery = String.format( "CREATE OR REPLACE TABLE %s (" @@ -4803,7 +4822,7 @@ void testFastDDLQuery() throws InterruptedException { QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); TableResult result = bigquery.query(ddlConfig); assertNotNull(result.getJobId()); - assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, result.getSchema()); assertEquals(0, result.getTotalRows()); // Verify correctness of table content String sqlQuery = String.format("SELECT * FROM %s.%s", DATASET, tableName); @@ -5078,8 +5097,23 @@ void testExecuteSelectSessionSupport() throws BigQuerySQLException { @Test void testDmlStatistics() throws InterruptedException { - String tableName = TABLE_ID_FAST_QUERY.getTable(); - // Run a DML statement to UPDATE 2 rows of data + // This runs an update SQL query. Clone the table to ensure that this doesn't impact + // other tests. + String tableName = generateTableName("test_table_dml_stats"); + String tableNameSimple = TABLE_ID_SIMPLE.getTable(); + String ddlQuery = + String.format( + "CREATE OR REPLACE TABLE %s (" + + "TimestampField TIMESTAMP OPTIONS(description='TimestampDescription'), " + + "StringField STRING OPTIONS(description='StringDescription'), " + + "BooleanField BOOLEAN OPTIONS(description='BooleanDescription') " + + ") AS SELECT DISTINCT * FROM %s", + tableName, tableNameSimple); + QueryJobConfiguration ddlConfig = + QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); + TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); + String dmlQuery = String.format("UPDATE %s.%s SET StringField = 'hello' WHERE TRUE", DATASET, tableName); QueryJobConfiguration dmlConfig = QueryJobConfiguration.newBuilder(dmlQuery).build(); @@ -5087,20 +5121,37 @@ void testDmlStatistics() throws InterruptedException { remoteJob = remoteJob.waitFor(); assertNull(remoteJob.getStatus().getError()); - TableResult result = remoteJob.getQueryResults(); - assertNotNull(result.getJobId()); - assertEquals(TABLE_SCHEMA, result.getSchema()); + TableResult resultAfterUpdate = remoteJob.getQueryResults(); + assertNotNull(resultAfterUpdate.getJobId()); + assertEquals(SIMPLE_TABLE_SCHEMA, resultAfterUpdate.getSchema()); Job queryJob = bigquery.getJob(remoteJob.getJobId()); + queryJob = queryJob.waitFor(); JobStatistics.QueryStatistics statistics = queryJob.getStatistics(); - assertEquals(2L, statistics.getNumDmlAffectedRows().longValue()); - assertEquals(2L, statistics.getDmlStats().getUpdatedRowCount().longValue()); + assertEquals(1L, statistics.getNumDmlAffectedRows().longValue()); + assertEquals(1L, statistics.getDmlStats().getUpdatedRowCount().longValue()); } /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testTransactionInfo() throws InterruptedException { - String tableName = TABLE_ID_FAST_QUERY.getTable(); + // The transaction runs an update query. Clone the table to ensure that this doesn't impact + // other tests. + String tableName = generateTableName("test_table_transaction_info"); + String tableNameSimple = TABLE_ID_SIMPLE.getTable(); + String ddlQuery = + String.format( + "CREATE OR REPLACE TABLE %s (" + + "TimestampField TIMESTAMP OPTIONS(description='TimestampDescription'), " + + "StringField STRING OPTIONS(description='StringDescription'), " + + "BooleanField BOOLEAN OPTIONS(description='BooleanDescription') " + + ") AS SELECT DISTINCT * FROM %s", + tableName, tableNameSimple); + QueryJobConfiguration ddlConfig = + QueryJobConfiguration.newBuilder(ddlQuery).setDefaultDataset(DatasetId.of(DATASET)).build(); + TableResult result = bigquery.query(ddlConfig); + assertNotNull(result.getJobId()); + String transaction = String.format( "BEGIN TRANSACTION;\n" @@ -5913,7 +5964,7 @@ void testCopyJobStatistics() throws InterruptedException, TimeoutException { @Test void testSnapshotTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; - String ddlTableName = TABLE_ID_DDL.getTable(); + String ddlTableName = TABLE_ID_SIMPLE.getTable(); // this creates a snapshot table at specified snapshotTime String snapshotTableName = "test_snapshot_table"; // Create source table with some data in it @@ -5930,7 +5981,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { TableId sourceTableId = TableId.of(DATASET, sourceTableName); TableResult result = bigquery.query(ddlConfig); assertNotNull(result.getJobId()); - assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, result.getSchema()); Table remoteTable = bigquery.getTable(DATASET, sourceTableName); assertNotNull(remoteTable); @@ -5952,7 +6003,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { assertEquals(snapshotTableId.getDataset(), snapshotTable.getTableId().getDataset()); assertEquals(snapshotTableName, snapshotTable.getTableId().getTable()); assertTrue(snapshotTable.getDefinition() instanceof SnapshotTableDefinition); - assertEquals(DDL_TABLE_SCHEMA, snapshotTable.getDefinition().getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, snapshotTable.getDefinition().getSchema()); assertNotNull(((SnapshotTableDefinition) snapshotTable.getDefinition()).getSnapshotTime()); assertEquals( sourceTableName, @@ -5978,7 +6029,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { assertNotNull(restoredTable); assertEquals(restoredTableId.getDataset(), restoredTable.getTableId().getDataset()); assertEquals(restoredTableName, restoredTable.getTableId().getTable()); - assertEquals(DDL_TABLE_SCHEMA, restoredTable.getDefinition().getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, restoredTable.getDefinition().getSchema()); assertEquals(snapshotTable.getNumBytes(), restoredTable.getNumBytes()); assertEquals(snapshotTable.getNumRows(), restoredTable.getNumRows()); @@ -6857,7 +6908,7 @@ void testCreateExternalTableWithReferenceFileSchemaParquet() { @Test void testCloneTableCopyJob() throws InterruptedException { String sourceTableName = "test_copy_job_base_table"; - String ddlTableName = TABLE_ID_DDL.getTable(); + String ddlTableName = TABLE_ID_SIMPLE.getTable(); String cloneTableName = "test_clone_table"; // Create source table with some data in it String ddlQuery = @@ -6873,7 +6924,7 @@ void testCloneTableCopyJob() throws InterruptedException { TableId sourceTableId = TableId.of(DATASET, sourceTableName); TableResult result = bigquery.query(ddlConfig); assertNotNull(result.getJobId()); - assertEquals(DDL_TABLE_SCHEMA, result.getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, result.getSchema()); Table remoteTable = bigquery.getTable(DATASET, sourceTableName); assertNotNull(remoteTable); @@ -6897,7 +6948,7 @@ void testCloneTableCopyJob() throws InterruptedException { assertEquals(cloneTableName, cloneTable.getTableId().getTable()); assertEquals(TableDefinition.Type.TABLE, cloneTable.getDefinition().getType()); assertTrue(cloneTable.getDefinition() instanceof StandardTableDefinition); - assertEquals(DDL_TABLE_SCHEMA, cloneTable.getDefinition().getSchema()); + assertEquals(SIMPLE_TABLE_SCHEMA, cloneTable.getDefinition().getSchema()); assertTrue(cloneTable.getCloneDefinition() instanceof CloneDefinition); assertEquals(sourceTableName, cloneTable.getCloneDefinition().getBaseTableId().getTable()); assertNotNull(cloneTable.getCloneDefinition().getCloneTime()); diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java index 589f7ccda0..f66df17ab5 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/testing/RemoteBigQueryHelperTest.java @@ -26,14 +26,13 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.time.Duration; -import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -public class RemoteBigQueryHelperTest { +class RemoteBigQueryHelperTest { private static final String DATASET_NAME = "dataset-name"; private static final String PROJECT_ID = "project-id"; @@ -67,7 +66,7 @@ public class RemoteBigQueryHelperTest { private static final InputStream JSON_KEY_STREAM = new ByteArrayInputStream(JSON_KEY.getBytes()); @Test - public void testForceDelete() throws InterruptedException, ExecutionException { + void testForceDelete() { BigQuery bigqueryMock = Mockito.mock(BigQuery.class); Mockito.when(bigqueryMock.delete(DATASET_NAME, DatasetDeleteOption.deleteContents())) .thenReturn(true); @@ -76,15 +75,15 @@ public void testForceDelete() throws InterruptedException, ExecutionException { } @Test - public void testCreateFromStream() { + void testCreateFromStream() { RemoteBigQueryHelper helper = RemoteBigQueryHelper.create(PROJECT_ID, JSON_KEY_STREAM); BigQueryOptions options = helper.getOptions(); assertEquals(PROJECT_ID, options.getProjectId()); assertEquals(60000, ((HttpTransportOptions) options.getTransportOptions()).getConnectTimeout()); assertEquals(60000, ((HttpTransportOptions) options.getTransportOptions()).getReadTimeout()); assertEquals(10, options.getRetrySettings().getMaxAttempts()); - assertEquals(Duration.ofMillis(30000), options.getRetrySettings().getMaxRetryDelayDuration()); - assertEquals(Duration.ofMillis(120000), options.getRetrySettings().getTotalTimeoutDuration()); - assertEquals(Duration.ofMillis(250), options.getRetrySettings().getInitialRetryDelayDuration()); + assertEquals(Duration.ofMillis(1000), options.getRetrySettings().getMaxRetryDelayDuration()); + assertEquals(Duration.ofMillis(3000), options.getRetrySettings().getTotalTimeoutDuration()); + assertEquals(Duration.ofMillis(100), options.getRetrySettings().getInitialRetryDelayDuration()); } } From fab86281af519a8294f3385dccf9e17cbb56d21c Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Thu, 15 Jan 2026 18:35:29 -0800 Subject: [PATCH 2228/2268] chore(jdbc): moving helper scripts & simplify dependencies (#4062) --- .gitignore | 6 +- google-cloud-bigquery-jdbc/Dockerfile | 21 ++++ google-cloud-bigquery-jdbc/Makefile | 140 ++++++++++++++++++++++++++ google-cloud-bigquery-jdbc/pom.xml | 92 +---------------- 4 files changed, 169 insertions(+), 90 deletions(-) create mode 100644 google-cloud-bigquery-jdbc/Dockerfile create mode 100644 google-cloud-bigquery-jdbc/Makefile diff --git a/.gitignore b/.gitignore index c94c87d10b..d5bcd47b28 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,8 @@ __pycache__ SimpleBenchmarkApp/src/main/java/com/google/cloud/App.java .flattened-pom.xml # Local Test files -*ITLocalTest.java \ No newline at end of file +*ITLocalTest.java + +# JDBC-specific files +google-cloud-bigquery-jdbc/drivers/ +google-cloud-bigquery-jdbc/jacoco* \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/Dockerfile b/google-cloud-bigquery-jdbc/Dockerfile new file mode 100644 index 0000000000..f88cc5a4bc --- /dev/null +++ b/google-cloud-bigquery-jdbc/Dockerfile @@ -0,0 +1,21 @@ +FROM gcr.io/cloud-devrel-public-resources/java11 + +ENV JDBC_DOCKER_ENV=true +RUN apt-get update && apt-get install -y zip && rm -rf /var/lib/apt/lists/* + +RUN mkdir /tst +COPY ./pom.xml /src/pom.xml +COPY ./java.header /src/java.header +COPY ./license-checks.xml /src/license-checks.xml +COPY ./google-cloud-bigquery-jdbc/pom.xml /src/google-cloud-bigquery-jdbc/pom.xml + +COPY ./google-cloud-bigquery /src/google-cloud-bigquery +COPY ./google-cloud-bigquery-bom /src/google-cloud-bigquery-bom + + +WORKDIR /src +RUN mvn install -DskipTests + +WORKDIR /src/google-cloud-bigquery-jdbc + +ENTRYPOINT [] diff --git a/google-cloud-bigquery-jdbc/Makefile b/google-cloud-bigquery-jdbc/Makefile new file mode 100644 index 0000000000..f196596870 --- /dev/null +++ b/google-cloud-bigquery-jdbc/Makefile @@ -0,0 +1,140 @@ +CONTAINER_NAME=jdbc +PACKAGE_DESTINATION=$(PWD)/drivers +SRC="$(PWD)/.." +skipSurefire ?= true + +# no indendation for ifndef\endif due to their evaluation before execution +.check-env: | +ifndef GOOGLE_APPLICATION_CREDENTIALS + $(error GOOGLE_APPLICATION_CREDENTIALS is required to run tests) +endif + +install: + mvn clean install + +clean: + mvn clean + +lint: + mvn com.spotify.fmt:fmt-maven-plugin:format + +unittest: | + mvn -B -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dtest=$(test) \ + test + +# Important: By default, this command will skip unittests. +# To include unit tests, run: make integration-test skipSurefire=false +integration-test: .check-env + mvn -B -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -DskipSurefire=$(skipSurefire) \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dit.failIfNoSpecifiedTests=false \ + -Dit.test=$(test) \ + integration-test + +unit-test-coverage: + $(MAKE) unittest + mvn -B -ntp jacoco:report + BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout); \ + cd $$BUILD_DIR/site && zip -r $$OLDPWD/jacoco-unittests.zip jacoco && cd $$OLDPWD + +full-coverage: .check-env + $(MAKE) integration-test skipSurefire=false test=ITBigQueryJDBCTest,ITNightlyBigQueryTest + mvn -B -ntp jacoco:report + BUILD_DIR=$$(mvn -B -ntp help:evaluate -Dexpression=project.build.directory -q -DforceStdout); \ + cd $$BUILD_DIR/site && zip -r $$OLDPWD/jacoco-full.zip jacoco && cd $$OLDPWD + +package: + mvn clean package \ + -DincludeScope=runtime \ + -Dmaven.test.skip=true + mvn dependency:copy-dependencies \ + -DincludeScope=runtime + ${MAKE} generate-dependency-list + +package-all-dependencies: + mvn package \ + -DincludeScope=runtime \ + -Dmaven.test.skip=true \ + -P=release-all-dependencies + +package-all-dependencies-shaded: + mvn package \ + -DincludeScope=runtime \ + -Dmaven.test.skip=true \ + -P=release-all-dependencies,release-all-dependencies-shaded + +generate-dependency-list: + mvn -B dependency:list \ + -f pom.xml \ + -DincludeScope=runtime | grep :jar: | sed -E "s/^.* ([^: ]+):([^:]+):([^:]+):([^:]+).*/\1<\/groupId>\2<\/artifactId>\4<\/version><\/dependency>/g" > dependencies.txt + +# Commands for dockerized environments +.docker-run: | + docker run -it \ + -v $(GOOGLE_APPLICATION_CREDENTIALS):/auth/application_creds.json \ + -v "$(GOOGLE_APPLICATION_CREDENTIALS).p12":/auth/application_creds.p12 \ + -e "GOOGLE_APPLICATION_CREDENTIALS=/auth/application_creds.json" \ + -v $(SRC):/src \ + -e "SA_EMAIL=test_email" \ + -e "SA_SECRET=/auth/application_creds.json" \ + -e "SA_SECRET_P12=/auth/application_creds.p12" \ + $(CONTAINER_NAME) $(args) + +docker-build: + docker build -t $(CONTAINER_NAME) -f Dockerfile .. + +docker-session: + $(MAKE) .docker-run args="bash" + +docker-package-all-dependencies: docker-build + mkdir -p $(PACKAGE_DESTINATION) + docker run \ + -v $(SRC):/src \ + -v $(PACKAGE_DESTINATION):/pkg \ + $(CONTAINER_NAME) \ + sh -c "make package-all-dependencies && \ + cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*.jar /pkg && \ + rm -f /pkg/*tests.jar" + +docker-package-all-dependencies-shaded: docker-build + mkdir -p $(PACKAGE_DESTINATION) + docker run \ + -v $(SRC):/src \ + -v $(PACKAGE_DESTINATION):/pkg \ + $(CONTAINER_NAME) \ + sh -c "make package-all-dependencies-shaded && \ + cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*.jar /pkg && \ + rm -f /pkg/*tests.jar" + +docker-package: docker-build + mkdir -p $(PACKAGE_DESTINATION) + docker run \ + -v $(SRC):/src \ + -v $(PACKAGE_DESTINATION):/pkg \ + $(CONTAINER_NAME) \ + sh -c "make package && \ + mkdir -p /tmp/package && \ + cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*.jar /tmp/package && \ + rm -f /pkg/*tests.jar && \ + cp --no-preserve=ownership dependencies.txt /tmp/package && \ + rm dependencies.txt && \ + cp --no-preserve=ownership /mvn/test-target/dependency/*.jar /tmp/package && \ + zip -j -r /pkg/google-cloud-bigquery-jdbc-$$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout).zip /tmp/package" + +docker-unittest: | + $(MAKE) .docker-run args="make unittest test=$(test)" + +docker-integration-test: .check-env + $(MAKE) .docker-run args="make integration-test test=$(test) skipSurefire=$(skipSurefire)" + +docker-coverage: + $(MAKE) .docker-run args="make unit-test-coverage" + $(MAKE) .docker-run args="make full-coverage" \ No newline at end of file diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index a697ba1017..677437794b 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.1.0 + 0.1.0-SNAPSHOT jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -60,8 +60,8 @@ com.google.cloud - google-cloud-bigquery-jdbc-parent - 0.1.0 + google-cloud-bigquery-parent + 2.57.2-SNAPSHOT @@ -72,72 +72,6 @@ com.google.cloud google-cloud-bigquerystorage - - com.google.api - api-common - - - org.apache.arrow - arrow-vector - - - com.google.guava - guava - - - com.google.cloud - google-cloud-core - - - com.google.api - gax - - - com.google.auth - google-auth-library-oauth2-http - - - com.google.auth - google-auth-library-credentials - - - - - org.apache.arrow - arrow-memory-core - - - org.apache.arrow - arrow-memory-netty - - - com.google.protobuf - protobuf-java - - - com.google.api.grpc - proto-google-cloud-bigquerystorage-v1 - - - com.google.code.gson - gson - - - com.google.code.findbugs - jsr305 - - - org.apache.httpcomponents.core5 - httpcore5 - - - org.apache.httpcomponents.client5 - httpclient5 - - - com.google.http-client - google-http-client - com.google.http-client google-http-client-apache-v5 @@ -152,26 +86,6 @@ - - com.google.cloud - google-cloud-core-http - - - com.google.api - gax-grpc - - - io.grpc - grpc-api - - - io.grpc - grpc-netty-shaded - - - io.grpc - grpc-core - com.google.truth From a8aef5ab71c93229cfed87a22df47d60e9aa3de0 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Fri, 16 Jan 2026 13:31:19 -0500 Subject: [PATCH 2229/2268] chore: Fix flaky testListTablesWithPartitioning test (#4068) * chore: Fix flaky testListTablesWithPartitioning test * chore: Fix test comment * chore: Fix typo to partitionType --- .../cloud/bigquery/it/ITBigQueryTest.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index d41ccc0e12..68079ddcaf 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -219,7 +219,6 @@ class ITBigQueryTest { private static final byte[] BYTES = {0xD, 0xE, 0xA, 0xD}; private static final String BYTES_BASE64 = BaseEncoding.base64().encode(BYTES); - private static final Long EXPIRATION_MS = 86400000L; private static final Logger LOG = Logger.getLogger(ITBigQueryTest.class.getName()); private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String UK_DATASET = RemoteBigQueryHelper.generateDatasetName(); @@ -2626,12 +2625,13 @@ void testListTables() { @Test void testListTablesWithPartitioning() { + long expirationMs = 86400000L; + Type partitionType = Type.DAY; String tableName = "test_list_tables_partitioning"; - TimePartitioning timePartitioning = TimePartitioning.of(Type.DAY, EXPIRATION_MS); StandardTableDefinition tableDefinition = StandardTableDefinition.newBuilder() .setSchema(TABLE_SCHEMA) - .setTimePartitioning(timePartitioning) + .setTimePartitioning(TimePartitioning.of(partitionType, expirationMs)) .build(); TableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), tableDefinition); Table createdPartitioningTable = bigquery.create(tableInfo); @@ -2639,16 +2639,25 @@ void testListTablesWithPartitioning() { try { Page

  • tables = bigquery.listTables(DATASET); boolean found = false; - Iterator
    tableIterator = tables.getValues().iterator(); - while (tableIterator.hasNext() && !found) { - StandardTableDefinition standardTableDefinition = tableIterator.next().getDefinition(); - if (standardTableDefinition.getTimePartitioning() != null - && standardTableDefinition.getTimePartitioning().getType().equals(Type.DAY) - && standardTableDefinition - .getTimePartitioning() - .getExpirationMs() - .equals(EXPIRATION_MS)) { + for (Table table : tables.getValues()) { + // Look for the table that matches the newly partitioned table. Other tables in the + // dataset may not be partitioned or may be partitioned but may not be expiring + // (e.g. `null` expirationMs). + if (!table + .getTableId() + .getTable() + .equals(createdPartitioningTable.getTableId().getTable())) { + continue; + } + + StandardTableDefinition standardTableDefinition = table.getDefinition(); + TimePartitioning timePartitioning = standardTableDefinition.getTimePartitioning(); + assertNotNull(timePartitioning); + assertNotNull(timePartitioning.getExpirationMs()); + if (timePartitioning.getType().equals(partitionType) + && timePartitioning.getExpirationMs().equals(expirationMs)) { found = true; + break; } } assertTrue(found); From 2af2b2b769dbfa61068365e6cb7c4e0eea5fa530 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 10:55:41 -0500 Subject: [PATCH 2230/2268] chore(main): release 2.57.2 (#4044) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 2 +- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 8 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 469bc0b33d..f1ac8d1c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.57.2](https://github.com/googleapis/java-bigquery/compare/v2.57.1...v2.57.2) (2026-01-16) + + +### Bug Fixes + +* Gracefully handle thread interruption in ConnectionImpl to preve… ([#4047](https://github.com/googleapis/java-bigquery/issues/4047)) ([031deb0](https://github.com/googleapis/java-bigquery/commit/031deb00f153b47d37655b025fcef298a3db0e0b)) +* Job.isDone() uses Job.Status.State if available ([#4039](https://github.com/googleapis/java-bigquery/issues/4039)) ([fa0a12e](https://github.com/googleapis/java-bigquery/commit/fa0a12e3cf171abab528c318ba3f4260b69a5274)) + + +### Documentation + +* Add specific samples for creating and query timestamps ([#4051](https://github.com/googleapis/java-bigquery/issues/4051)) ([fac16a8](https://github.com/googleapis/java-bigquery/commit/fac16a8eb05a6e13e406feeb9761259cdbf8e674)) + ## [2.57.1](https://github.com/googleapis/java-bigquery/compare/v2.57.0...v2.57.1) (2025-12-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 41e1a2fcb3..2e0e6f6bab 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.2-SNAPSHOT + 2.57.2 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 52ea2c14be..7177694c62 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.2-SNAPSHOT + 2.57.2 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2-SNAPSHOT + 2.57.2 diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 677437794b..8f2c9d7b49 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -61,7 +61,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.2-SNAPSHOT + 2.57.2 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 174bb9cb36..6b4661fb60 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.2-SNAPSHOT + 2.57.2 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.2-SNAPSHOT + 2.57.2 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2929f8a9f5..cd13b20082 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.2-SNAPSHOT + 2.57.2 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2-SNAPSHOT + 2.57.2 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e10b51dc7d..f7ff76844c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2-SNAPSHOT + 2.57.2 diff --git a/versions.txt b/versions.txt index 507619351d..54f6252b10 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.1:2.57.2-SNAPSHOT \ No newline at end of file +google-cloud-bigquery:2.57.2:2.57.2 \ No newline at end of file From bd5835f130f3f27f357d234cc70bc27aa8393baa Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Tue, 20 Jan 2026 17:27:55 -0500 Subject: [PATCH 2231/2268] chore: Fix flaky range partition test (#4072) * chore: Fix flaky range partition test * chore: assert only on matching partition table * chore: Add logic to check if table is found * chore: create unique datasets for each test * chore: Remove unused OTHER_DATASET * chore: Add try-finally to ensure dataset is deleted --- .../cloud/bigquery/it/ITBigQueryTest.java | 138 ++++++++++-------- 1 file changed, 77 insertions(+), 61 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 68079ddcaf..e6f403c5d0 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -223,7 +223,6 @@ class ITBigQueryTest { private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String UK_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String DESCRIPTION = "Test dataset"; - private static final String OTHER_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String MODEL_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String ROUTINE_DATASET = RemoteBigQueryHelper.generateDatasetName(); private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId(); @@ -1190,7 +1189,6 @@ static void afterClass() throws Exception { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, DATASET); RemoteBigQueryHelper.forceDelete(bigquery, UK_DATASET); - RemoteBigQueryHelper.forceDelete(bigquery, OTHER_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, MODEL_DATASET); RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); } @@ -1347,67 +1345,76 @@ void testGetDatasetWithAccessPolicyVersion() throws IOException { @Test void testUpdateDataset() { + String datasetName = RemoteBigQueryHelper.generateDatasetName(); Dataset dataset = bigquery.create( - DatasetInfo.newBuilder(OTHER_DATASET) + DatasetInfo.newBuilder(datasetName) .setDescription("Some Description") .setLabels(Collections.singletonMap("a", "b")) .build()); - assertThat(dataset).isNotNull(); - assertThat(dataset.getDatasetId().getProject()).isEqualTo(bigquery.getOptions().getProjectId()); - assertThat(dataset.getDatasetId().getDataset()).isEqualTo(OTHER_DATASET); - assertThat(dataset.getDescription()).isEqualTo("Some Description"); - assertThat(dataset.getLabels()).containsExactly("a", "b"); - assertThat(dataset.getStorageBillingModel()).isNull(); - assertThat(dataset.getMaxTimeTravelHours()).isNull(); - - Map updateLabels = new HashMap<>(); - updateLabels.put("x", "y"); - updateLabels.put("a", null); - Dataset updatedDataset = - bigquery.update( - dataset.toBuilder() - .setDescription("Updated Description") - .setLabels(updateLabels) - .setStorageBillingModel("LOGICAL") - .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) - .build()); - assertThat(updatedDataset.getDescription()).isEqualTo("Updated Description"); - assertThat(updatedDataset.getLabels()).containsExactly("x", "y"); - assertThat(updatedDataset.getStorageBillingModel()).isEqualTo("LOGICAL"); - assertThat(updatedDataset.getMaxTimeTravelHours()).isEqualTo(MAX_TIME_TRAVEL_HOURS); - - updatedDataset = bigquery.update(updatedDataset.toBuilder().setLabels(null).build()); - assertThat(updatedDataset.getLabels()).isEmpty(); - assertThat(dataset.delete()).isTrue(); + try { + assertThat(dataset).isNotNull(); + assertThat(dataset.getDatasetId().getProject()) + .isEqualTo(bigquery.getOptions().getProjectId()); + assertThat(dataset.getDatasetId().getDataset()).isEqualTo(datasetName); + assertThat(dataset.getDescription()).isEqualTo("Some Description"); + assertThat(dataset.getLabels()).containsExactly("a", "b"); + assertThat(dataset.getStorageBillingModel()).isNull(); + assertThat(dataset.getMaxTimeTravelHours()).isNull(); + + Map updateLabels = new HashMap<>(); + updateLabels.put("x", "y"); + updateLabels.put("a", null); + Dataset updatedDataset = + bigquery.update( + dataset.toBuilder() + .setDescription("Updated Description") + .setLabels(updateLabels) + .setStorageBillingModel("LOGICAL") + .setMaxTimeTravelHours(MAX_TIME_TRAVEL_HOURS) + .build()); + assertThat(updatedDataset.getDescription()).isEqualTo("Updated Description"); + assertThat(updatedDataset.getLabels()).containsExactly("x", "y"); + assertThat(updatedDataset.getStorageBillingModel()).isEqualTo("LOGICAL"); + assertThat(updatedDataset.getMaxTimeTravelHours()).isEqualTo(MAX_TIME_TRAVEL_HOURS); + + updatedDataset = bigquery.update(updatedDataset.toBuilder().setLabels(null).build()); + assertThat(updatedDataset.getLabels()).isEmpty(); + } finally { + dataset.delete(); + } } @Test void testUpdateDatasetWithSelectedFields() { + String datasetName = RemoteBigQueryHelper.generateDatasetName(); Dataset dataset = bigquery.create( - DatasetInfo.newBuilder(OTHER_DATASET).setDescription("Some Description").build()); - assertNotNull(dataset); - assertEquals(bigquery.getOptions().getProjectId(), dataset.getDatasetId().getProject()); - assertEquals(OTHER_DATASET, dataset.getDatasetId().getDataset()); - assertEquals("Some Description", dataset.getDescription()); - Dataset updatedDataset = - bigquery.update( - dataset.toBuilder().setDescription("Updated Description").build(), - DatasetOption.fields(DatasetField.DESCRIPTION)); - assertEquals("Updated Description", updatedDataset.getDescription()); - assertNull(updatedDataset.getCreationTime()); - assertNull(updatedDataset.getDefaultTableLifetime()); - assertNull(updatedDataset.getAcl()); - assertNull(updatedDataset.getEtag()); - assertNull(updatedDataset.getFriendlyName()); - assertNull(updatedDataset.getGeneratedId()); - assertNull(updatedDataset.getLastModified()); - assertNull(updatedDataset.getLocation()); - assertNull(updatedDataset.getSelfLink()); - assertNull(updatedDataset.getStorageBillingModel()); - assertNull(updatedDataset.getMaxTimeTravelHours()); - assertTrue(dataset.delete()); + DatasetInfo.newBuilder(datasetName).setDescription("Some Description").build()); + try { + assertNotNull(dataset); + assertEquals(bigquery.getOptions().getProjectId(), dataset.getDatasetId().getProject()); + assertEquals(datasetName, dataset.getDatasetId().getDataset()); + assertEquals("Some Description", dataset.getDescription()); + Dataset updatedDataset = + bigquery.update( + dataset.toBuilder().setDescription("Updated Description").build(), + DatasetOption.fields(DatasetField.DESCRIPTION)); + assertEquals("Updated Description", updatedDataset.getDescription()); + assertNull(updatedDataset.getCreationTime()); + assertNull(updatedDataset.getDefaultTableLifetime()); + assertNull(updatedDataset.getAcl()); + assertNull(updatedDataset.getEtag()); + assertNull(updatedDataset.getFriendlyName()); + assertNull(updatedDataset.getGeneratedId()); + assertNull(updatedDataset.getLastModified()); + assertNull(updatedDataset.getLocation()); + assertNull(updatedDataset.getSelfLink()); + assertNull(updatedDataset.getStorageBillingModel()); + assertNull(updatedDataset.getMaxTimeTravelHours()); + } finally { + dataset.delete(); + } } @Test @@ -2680,17 +2687,26 @@ void testListTablesWithRangePartitioning() { try { Page
    tables = bigquery.listTables(DATASET); boolean found = false; - Iterator
    tableIterator = tables.getValues().iterator(); - while (tableIterator.hasNext() && !found) { - StandardTableDefinition standardTableDefinition = tableIterator.next().getDefinition(); - if (standardTableDefinition.getRangePartitioning() != null) { - assertEquals(RANGE_PARTITIONING, standardTableDefinition.getRangePartitioning()); - assertEquals(RANGE, standardTableDefinition.getRangePartitioning().getRange()); - assertEquals("IntegerField", standardTableDefinition.getRangePartitioning().getField()); - found = true; + for (Table table : tables.getValues()) { + // Look for the table that matches the newly partitioned table. Other tables in the + // dataset may not be partitioned and cannot match to them. + if (!table + .getTableId() + .getTable() + .equals(createdRangePartitioningTable.getTableId().getTable())) { + continue; } + + StandardTableDefinition standardTableDefinition = table.getDefinition(); + RangePartitioning rangePartitioning = standardTableDefinition.getRangePartitioning(); + assertNotNull(rangePartitioning); + assertEquals(RANGE_PARTITIONING, rangePartitioning); + assertEquals(RANGE, rangePartitioning.getRange()); + assertEquals("IntegerField", rangePartitioning.getField()); + found = true; + break; } - assertTrue(found); + assertTrue(found, "Created range partitioned table was not found in the dataset list."); } finally { createdRangePartitioningTable.delete(); } From e3eeb949a6a0de9f9652f98b835ea816b3836d70 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Wed, 21 Jan 2026 10:58:03 -0800 Subject: [PATCH 2232/2268] chore(jdbc): JDBC presubmit & nightly pipelines (#4066) --- .cloudbuild/jdbc_nightly.yaml | 46 +++++++++++++ .cloudbuild/jdbc_presubmit.yaml | 41 +++++++++++ .kokoro/build.sh | 33 ++++++++- google-cloud-bigquery-jdbc/pom.xml | 105 ++++++++++++++++++++++++++++- pom.xml | 2 +- versions.txt | 3 +- 6 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 .cloudbuild/jdbc_nightly.yaml create mode 100644 .cloudbuild/jdbc_presubmit.yaml diff --git a/.cloudbuild/jdbc_nightly.yaml b/.cloudbuild/jdbc_nightly.yaml new file mode 100644 index 0000000000..bd3dc2ce52 --- /dev/null +++ b/.cloudbuild/jdbc_nightly.yaml @@ -0,0 +1,46 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +options: + workerPool: 'projects/bigquery-devtools-drivers/locations/us-east1/workerPools/java-bigquery-jdbc-pool' + dynamic_substitutions: true + logging: CLOUD_LOGGING_ONLY + +timeout: 10000s +steps: +- name: 'gcr.io/cloud-devrel-public-resources/java11' + id: "IT Tests" + timeout: 10000s + entrypoint: 'bash' + args: ['.kokoro/build.sh'] + env: + - 'JOB_TYPE=jdbc-integration' + secretEnv: ['SA_EMAIL', 'KMS_RESOURCE_PATH', 'SA_SECRET'] +- name: 'gcr.io/cloud-devrel-public-resources/java11' + id: "IT Nightly Tests" + timeout: 10000s + entrypoint: 'bash' + args: ['.kokoro/build.sh'] + env: + - 'JOB_TYPE=jdbc-nightly-integration' + +availableSecrets: + secretManager: + - versionName: projects/$PROJECT_ID/secrets/jdbc-presubmit-sa-email/versions/latest + env: 'SA_EMAIL' + - versionName: projects/$PROJECT_ID/secrets/kms_resource_path/versions/latest + env: 'KMS_RESOURCE_PATH' + - versionName: projects/$PROJECT_ID/secrets/GoogleJDBCServiceAccountSecret/versions/latest + env: 'SA_SECRET' diff --git a/.cloudbuild/jdbc_presubmit.yaml b/.cloudbuild/jdbc_presubmit.yaml new file mode 100644 index 0000000000..c5896967ef --- /dev/null +++ b/.cloudbuild/jdbc_presubmit.yaml @@ -0,0 +1,41 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. +options: + workerPool: 'projects/bigquery-devtools-drivers/locations/us-east1/workerPools/java-bigquery-jdbc-pool' + dynamic_substitutions: true + logging: CLOUD_LOGGING_ONLY + +substitutions: + _JOB_TYPE: "jdbc-integration" + +timeout: 2000s +steps: +- name: 'gcr.io/cloud-devrel-public-resources/java11' + id: "IT Tests" + timeout: 2000s + entrypoint: 'bash' + args: ['.kokoro/build.sh'] + env: + - 'JOB_TYPE=${_JOB_TYPE}' + secretEnv: ['SA_EMAIL', 'KMS_RESOURCE_PATH', 'SA_SECRET'] +availableSecrets: + secretManager: + - versionName: projects/$PROJECT_ID/secrets/jdbc-presubmit-sa-email/versions/latest + env: 'SA_EMAIL' + - versionName: projects/$PROJECT_ID/secrets/kms_resource_path/versions/latest + env: 'KMS_RESOURCE_PATH' + - versionName: projects/$PROJECT_ID/secrets/GoogleJDBCServiceAccountSecret/versions/latest + env: 'SA_SECRET' diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 084b07b25b..9c1dfeeb3d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -61,6 +61,7 @@ javadoc) ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ + -pl "!google-cloud-bigquery-jdbc" \ -ntp \ -Penable-integration-tests \ -DtrimStackTrace=false \ @@ -70,9 +71,39 @@ integration) verify RETURN_CODE=$? ;; +jdbc-integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -pl "google-cloud-bigquery-jdbc" \ + -ntp \ + -Dtest=ITBigQueryJDBCTest \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +jdbc-nightly-integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -pl "google-cloud-bigquery-jdbc" \ + -ntp \ + -Dtest=ITNightlyBigQueryTest \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + -DargLine="-Xmx32g" \ + -e \ + verify + RETURN_CODE=$? + ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test + mvn -B ${INTEGRATION_TEST_ARGS} \ + -pl "!google-cloud-bigquery-jdbc" \ + -ntp \ + -Pnative \ + test RETURN_CODE=$? ;; samples) diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 8f2c9d7b49..74fc627e27 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.1.0-SNAPSHOT + 0.1.0 jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -55,6 +55,18 @@ jacoco-maven-plugin 0.8.13 + + org.apache.maven.plugins + maven-dependency-plugin + + + com.google.*:* + org.apache.arrow:* + org.apache.httpcomponents.*:* + io.grpc:* + + + @@ -86,6 +98,97 @@ + + + + com.google.api + api-common + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1 + + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.auth + google-auth-library-credentials + + + + com.google.cloud + google-cloud-core + + + com.google.cloud + google-cloud-core-http + + + + com.google.code.findbugs + jsr305 + + + com.google.code.gson + gson + + + + com.google.guava + guava + + + + com.google.protobuf + protobuf-java + + + com.google.http-client + google-http-client + + + + io.grpc + grpc-api + + + io.grpc + grpc-core + + + io.grpc + grpc-netty-shaded + + + + + org.apache.arrow + arrow-vector + + + org.apache.arrow + arrow-memory-core + + + org.apache.httpcomponents.client5 + httpclient5 + + + org.apache.httpcomponents.core5 + httpcore5 + + com.google.truth diff --git a/pom.xml b/pom.xml index cd13b20082..9821f1b683 100644 --- a/pom.xml +++ b/pom.xml @@ -153,6 +153,7 @@ google-cloud-bigquery google-cloud-bigquery-bom + google-cloud-bigquery-jdbc @@ -259,4 +260,3 @@ - diff --git a/versions.txt b/versions.txt index 54f6252b10..8f898d85ed 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.2:2.57.2 \ No newline at end of file +google-cloud-bigquery:2.57.2:2.57.2 +google-cloud-bigquery-jdbc:0.1.0:0.1.0 From 6b4081dd3b1d7b53a295acf0dc270aeb84100c55 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Wed, 21 Jan 2026 16:04:28 -0500 Subject: [PATCH 2233/2268] chore: Add IT for positional parameter on higher precision timestamp field (#4075) * chore: Add IT for positional parameter on higher precision timestamp field * chore: Fix gemini comments * chore: Fix typo --- .../bigquery/it/ITHighPrecisionTimestamp.java | 88 ++++++++++++------- 1 file changed, 54 insertions(+), 34 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java index 4942c30083..e4dc534f9e 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITHighPrecisionTimestamp.java @@ -15,6 +15,7 @@ */ package com.google.cloud.bigquery.it; +import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -51,14 +52,14 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -public class ITHighPrecisionTimestamp { +class ITHighPrecisionTimestamp { - public static final String TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME = - "test_high_precision_timestamp"; + private static final String TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME = + generateTempTableName("test_high_precision_timestamp"); private static BigQuery bigquery; private static final String DATASET = RemoteBigQueryHelper.generateDatasetName(); private static TableId defaultTableId; - public static final long TIMESTAMP_PICOSECOND_PRECISION = 12L; + private static final long TIMESTAMP_PICOSECOND_PRECISION = 12L; private static final Field TIMESTAMP_HIGH_PRECISION_FIELD_SCHEMA = Field.newBuilder("timestampHighPrecisionField", StandardSQLTypeName.TIMESTAMP) .setTimestampPrecision(TIMESTAMP_PICOSECOND_PRECISION) @@ -69,8 +70,12 @@ public class ITHighPrecisionTimestamp { private static final String TIMESTAMP2 = "1970-01-01T12:34:56.123456789123Z"; private static final String TIMESTAMP3 = "2000-01-01T12:34:56.123456789123Z"; + private static String generateTempTableName(String prefix) { + return String.format("%s_%s", prefix, UUID.randomUUID().toString().substring(0, 8)); + } + @BeforeAll - public static void beforeClass() { + static void beforeClass() { BigQueryOptions.Builder builder = BigQueryOptions.newBuilder() .setDataFormatOptions( @@ -111,21 +116,15 @@ public static void beforeClass() { } @AfterAll - public static void afterClass() { + static void afterClass() { if (bigquery != null) { bigquery.delete(defaultTableId); RemoteBigQueryHelper.forceDelete(bigquery, DATASET); } } - private static String generateTempTableName() { - return String.format( - "insert_temp_%s%s", - UUID.randomUUID().toString().substring(0, 6), TEST_HIGH_PRECISION_TIMESTAMP_TABLE_NAME); - } - @Test - public void query_highPrecisionTimestamp() throws InterruptedException { + void query_highPrecisionTimestamp() throws InterruptedException { String sql = String.format("SELECT timestampHighPrecisionField FROM %s;", defaultTableId.getTable()); QueryJobConfiguration queryJobConfiguration = @@ -141,16 +140,14 @@ public void query_highPrecisionTimestamp() throws InterruptedException { .map(x -> (String) x.get(0).getValue()) .collect(Collectors.toList()); assertEquals(expected.length, timestamps.size()); - for (int i = 0; i < timestamps.size(); i++) { - assertEquals(expected[i], timestamps.get(i)); - } + assertThat(timestamps).containsAtLeastElementsIn(expected); } @Test - public void insert_highPrecisionTimestamp_ISOValidFormat() { + void insert_highPrecisionTimestamp_ISOValidFormat() { StandardTableDefinition tableDefinition = StandardTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build(); - String tempTableName = generateTempTableName(); + String tempTableName = generateTempTableName("insert_temp"); TableId tableId = TableId.of(DATASET, tempTableName); Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); assertNotNull(createdTable); @@ -166,10 +163,10 @@ public void insert_highPrecisionTimestamp_ISOValidFormat() { } @Test - public void insert_highPrecisionTimestamp_invalidFormats() { + void insert_highPrecisionTimestamp_invalidFormats() { StandardTableDefinition tableDefinition = StandardTableDefinition.newBuilder().setSchema(TABLE_SCHEMA).build(); - String tempTable = generateTempTableName(); + String tempTable = generateTempTableName("insert_temp"); TableId tableId = TableId.of(DATASET, tempTable); Table createdTable = bigquery.create(TableInfo.of(tableId, tableDefinition)); assertNotNull(createdTable); @@ -207,7 +204,7 @@ public void insert_highPrecisionTimestamp_invalidFormats() { } @Test - public void queryNamedParameter_highPrecisionTimestamp() throws InterruptedException { + void queryNamedParameter_highPrecisionTimestamp() throws InterruptedException { String query = String.format( "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", @@ -219,6 +216,7 @@ public void queryNamedParameter_highPrecisionTimestamp() throws InterruptedExcep .setUseLegacySql(false) .addNamedParameter( "timestampParam", + // For named parameters, java-bigquery does not expect the 'T' QueryParameterValue.timestamp("2000-01-01 12:34:56.123456789123Z")) .build(); @@ -230,13 +228,38 @@ public void queryNamedParameter_highPrecisionTimestamp() throws InterruptedExcep .map(x -> (String) x.get(0).getValue()) .collect(Collectors.toList()); assertEquals(expected.length, timestamps.size()); - for (int i = 0; i < timestamps.size(); i++) { - assertEquals(expected[i], timestamps.get(i)); - } + assertThat(timestamps).containsAtLeastElementsIn(expected); + } + + @Test + void queryPositionalParameter_highPrecisionTimestamp() throws InterruptedException { + String query = + String.format( + "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(? AS TIMESTAMP(12))", + DATASET, defaultTableId.getTable()); + + QueryJobConfiguration queryConfig = + QueryJobConfiguration.newBuilder(query) + .setDefaultDataset(DATASET) + .setUseLegacySql(false) + .addPositionalParameter( + // For positional parameters, java-bigquery does not expect the 'T' + QueryParameterValue.timestamp("2000-01-01 12:34:56.123456789123Z")) + .build(); + + TableResult result = bigquery.query(queryConfig); + assertNotNull(result); + String[] expected = new String[] {TIMESTAMP1, TIMESTAMP3}; + List timestamps = + StreamSupport.stream(result.getValues().spliterator(), false) + .map(x -> (String) x.get(0).getValue()) + .collect(Collectors.toList()); + assertEquals(expected.length, timestamps.size()); + assertThat(timestamps).containsAtLeastElementsIn(expected); } @Test - public void queryNamedParameter_highPrecisionTimestamp_microsLong() throws InterruptedException { + void queryNamedParameter_highPrecisionTimestamp_microsLong() throws InterruptedException { String query = String.format( "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", @@ -263,14 +286,11 @@ public void queryNamedParameter_highPrecisionTimestamp_microsLong() throws Inter .map(x -> (String) x.get(0).getValue()) .collect(Collectors.toList()); assertEquals(expected.length, timestamps.size()); - for (int i = 0; i < timestamps.size(); i++) { - assertEquals(expected[i], timestamps.get(i)); - } + assertThat(timestamps).containsAtLeastElementsIn(expected); } @Test - public void queryNamedParameter_highPrecisionTimestamp_microsISOString() - throws InterruptedException { + void queryNamedParameter_highPrecisionTimestamp_microsISOString() throws InterruptedException { String query = String.format( "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= CAST(@timestampParam AS TIMESTAMP(12))", @@ -281,6 +301,7 @@ public void queryNamedParameter_highPrecisionTimestamp_microsISOString() .setDefaultDataset(DATASET) .setUseLegacySql(false) .addNamedParameter( + // For named parameters, java-bigquery does not expect the 'T' "timestampParam", QueryParameterValue.timestamp("2000-01-01 12:34:56.123456Z")) .build(); @@ -292,13 +313,11 @@ public void queryNamedParameter_highPrecisionTimestamp_microsISOString() .collect(Collectors.toList()); String[] expected = new String[] {TIMESTAMP1, TIMESTAMP3}; assertEquals(expected.length, timestamps.size()); - for (int i = 0; i < timestamps.size(); i++) { - assertEquals(expected[i], timestamps.get(i)); - } + assertThat(timestamps).containsAtLeastElementsIn(expected); } @Test - public void queryNamedParameter_highPrecisionTimestamp_noExplicitCastInQuery_fails() { + void queryNamedParameter_highPrecisionTimestamp_noExplicitCastInQuery_fails() { String query = String.format( "SELECT * FROM %s.%s WHERE timestampHighPrecisionField >= @timestampParam", @@ -309,6 +328,7 @@ public void queryNamedParameter_highPrecisionTimestamp_noExplicitCastInQuery_fai .setDefaultDataset(DATASET) .setUseLegacySql(false) .addNamedParameter( + // For named parameters, java-bigquery does not expect the 'T' "timestampParam", QueryParameterValue.timestamp("2000-01-01 12:34:56.123456789123")) .build(); From d83699bb92bc351afbbd29fb237be33552479dbd Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 23 Jan 2026 13:38:46 -0800 Subject: [PATCH 2234/2268] chore(jdbc): add nightly JAR build (#4076) --- .cloudbuild/jdbc_nightly.yaml | 7 ++ .kokoro/jdbc-release.sh | 41 +++++++ google-cloud-bigquery-jdbc/Makefile | 18 +--- google-cloud-bigquery-jdbc/pom.xml | 161 ++++++++++++---------------- 4 files changed, 120 insertions(+), 107 deletions(-) create mode 100755 .kokoro/jdbc-release.sh diff --git a/.cloudbuild/jdbc_nightly.yaml b/.cloudbuild/jdbc_nightly.yaml index bd3dc2ce52..5c7acd472b 100644 --- a/.cloudbuild/jdbc_nightly.yaml +++ b/.cloudbuild/jdbc_nightly.yaml @@ -35,6 +35,13 @@ steps: args: ['.kokoro/build.sh'] env: - 'JOB_TYPE=jdbc-nightly-integration' +- name: 'gcr.io/cloud-devrel-public-resources/java11' + id: "Nightly build" + timeout: 10000s + entrypoint: 'bash' + args: ['.kokoro/jdbc-release.sh'] + env: + - 'NIGHTLY_RELEASE_GCS_BUCKET=$_NIGHTLY_RELEASE_GCS_BUCKET' availableSecrets: secretManager: diff --git a/.kokoro/jdbc-release.sh b/.kokoro/jdbc-release.sh new file mode 100755 index 0000000000..01cb7b47b9 --- /dev/null +++ b/.kokoro/jdbc-release.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd "${DIR}/../google-cloud-bigquery-jdbc" + +FOLDER="$(pwd)/release" +DATE=$(date '+%Y-%m-%d') +COMMIT=$(git rev-parse --short HEAD) +PACKAGE="google-cloud-bigquery-jdbc" +VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) +BUCKET=${NIGHTLY_RELEASE_GCS_BUCKET} +NIGHTLY_BUILD_DESTINATION="${BUCKET}/nightly/${VERSION}/${DATE}" + +# All dependencies release +mkdir -p "${FOLDER}" +make docker-package PACKAGE_DESTINATION="${FOLDER}" +NAME=${PACKAGE}-${VERSION}-${COMMIT} + +gsutil cp -r "${FOLDER}/${PACKAGE}-${VERSION}.zip" "${NIGHTLY_BUILD_DESTINATION}/${NAME}.zip" +gsutil cp -r "${FOLDER}/${PACKAGE}-${VERSION}-all.jar" "${NIGHTLY_BUILD_DESTINATION}/${NAME}-all.jar" + +rm -rf "${FOLDER}" + +# # Update latest version +gsutil cp "${NIGHTLY_BUILD_DESTINATION}/${NAME}.zip" "${BUCKET}/${PACKAGE}-latest.zip" +gsutil cp "${NIGHTLY_BUILD_DESTINATION}/${NAME}-all.jar" "${BUCKET}/${PACKAGE}-latest-all.jar" diff --git a/google-cloud-bigquery-jdbc/Makefile b/google-cloud-bigquery-jdbc/Makefile index f196596870..61521770c7 100644 --- a/google-cloud-bigquery-jdbc/Makefile +++ b/google-cloud-bigquery-jdbc/Makefile @@ -59,18 +59,6 @@ package: -DincludeScope=runtime ${MAKE} generate-dependency-list -package-all-dependencies: - mvn package \ - -DincludeScope=runtime \ - -Dmaven.test.skip=true \ - -P=release-all-dependencies - -package-all-dependencies-shaded: - mvn package \ - -DincludeScope=runtime \ - -Dmaven.test.skip=true \ - -P=release-all-dependencies,release-all-dependencies-shaded - generate-dependency-list: mvn -B dependency:list \ -f pom.xml \ @@ -123,11 +111,13 @@ docker-package: docker-build sh -c "make package && \ mkdir -p /tmp/package && \ cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*.jar /tmp/package && \ - rm -f /pkg/*tests.jar && \ + rm -f /tmp/package/google-cloud-bigquery-jdbc-*-all.jar && \ + rm -f /tmp/package/*tests.jar && \ cp --no-preserve=ownership dependencies.txt /tmp/package && \ rm dependencies.txt && \ cp --no-preserve=ownership /mvn/test-target/dependency/*.jar /tmp/package && \ - zip -j -r /pkg/google-cloud-bigquery-jdbc-$$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout).zip /tmp/package" + zip -j -r /pkg/google-cloud-bigquery-jdbc-$$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout).zip /tmp/package && \ + cp --no-preserve=ownership /mvn/test-target/google-cloud-bigquery-jdbc-*-all.jar /pkg " docker-unittest: | $(MAKE) .docker-run args="make unittest test=$(test)" diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 74fc627e27..91b51a7d02 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -67,6 +67,74 @@ + + org.apache.maven.plugins + maven-shade-plugin + 3.5.2 + + + package + + shade + + + true + all + false + + + java.base/java.nio=ALL-UNNAMED + + + + + + + META-INF/io.netty.versions.properties + + + + + com + com.google.bqjdbc.shaded.com + + com.google.cloud.bigquery.* + com.google.cloud.bigquery.jdbc.* + + + + org + com.google.bqjdbc.shaded.org + + org.conscrypt.* + + + + io + com.google.bqjdbc.shaded.io + + + + + *:* + + META-INF/LICENSE* + META-INF/NOTICE* + META-INF/DEPENDENCIES + META-INF/proguard/*.pro + META-INF/maven/** + META-INF/*.MF + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + arrow-git.properties + + + + + + + @@ -236,99 +304,6 @@ - - - release-all-dependencies-shaded - - - - org.apache.maven.plugins - maven-shade-plugin - 3.5.2 - - - - - - com - shaded.bqjdbc.com - - com.google.cloud.bigquery.jdbc.* - - - - org - shaded.bqjdbc.org - - org.conscrypt.* - - - - io - shaded.bqjdbc.io - - - - - - - - - - - - release-all-dependencies - - - - org.apache.maven.plugins - maven-shade-plugin - 3.5.2 - - - package - - shade - - - false - - - java.base/java.nio=ALL-UNNAMED - - - - - - - META-INF/io.netty.versions.properties - - - - - *:* - - META-INF/LICENSE* - META-INF/NOTICE* - META-INF/DEPENDENCIES - META-INF/proguard/*.pro - META-INF/maven/** - META-INF/*.MF - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - arrow-git.properties - - - - - - - - - - - docker From 6efec30df0a55889d0c1a7e0814466b085974eec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:33:21 -0500 Subject: [PATCH 2235/2268] chore(main): release 2.57.3-SNAPSHOT (#4069) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 2e0e6f6bab..755e7ccdeb 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.2 + 2.57.3-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7177694c62..4aa8cde646 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.2 + 2.57.3-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2 + 2.57.3-SNAPSHOT diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 91b51a7d02..191b00922d 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.1.0 + 0.1.1-SNAPSHOT jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -141,7 +141,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.2 + 2.57.3-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 6b4661fb60..ae2f3cf5d7 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.2 + 2.57.3-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.2 + 2.57.3-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 9821f1b683..ade61d0cab 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.2 + 2.57.3-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2 + 2.57.3-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index f7ff76844c..a51dc38ef0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.2 + 2.57.3-SNAPSHOT diff --git a/versions.txt b/versions.txt index 8f898d85ed..84e55ba1d6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.2:2.57.2 -google-cloud-bigquery-jdbc:0.1.0:0.1.0 +google-cloud-bigquery:2.57.2:2.57.3-SNAPSHOT +google-cloud-bigquery-jdbc:0.1.0:0.1.1-SNAPSHOT From ed575f4149badfb3346f5f3657cf254ea268e0fe Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:48:10 -0500 Subject: [PATCH 2236/2268] feat: update shared config and bigquerystorage (#4081) * deps: update bigquerystorage * update shared config * update shared config --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index e9cacb9dc2..6ddac9eabe 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.55.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.56.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index a2798bba2c..e7c342ded5 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 1f804ecee9..6f5a9fce30 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 641a3fb1db..a76d6686a3 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index a2798bba2c..e7c342ded5 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 1f804ecee9..6f5a9fce30 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 641a3fb1db..a76d6686a3 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.55.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 4aa8cde646..7ce545d784 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.55.1 + 3.56.0 diff --git a/pom.xml b/pom.xml index ade61d0cab..2f7db5220d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.55.1 + 3.56.0 @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.19.1 + 3.20.0 pom import From 6ef476a22b15361b65eba6a0e881edd08efc8d6c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:15:38 -0500 Subject: [PATCH 2237/2268] chore(main): release 2.58.0 (#4083) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1ac8d1c60..d08db0a6a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.58.0](https://github.com/googleapis/java-bigquery/compare/v2.57.2...v2.58.0) (2026-01-26) + + +### Features + +* Update shared config and bigquerystorage ([#4081](https://github.com/googleapis/java-bigquery/issues/4081)) ([ed575f4](https://github.com/googleapis/java-bigquery/commit/ed575f4149badfb3346f5f3657cf254ea268e0fe)) + ## [2.57.2](https://github.com/googleapis/java-bigquery/compare/v2.57.1...v2.57.2) (2026-01-16) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 755e7ccdeb..4b47cf24fa 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.57.3-SNAPSHOT + 2.58.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 7ce545d784..43e36250ff 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.57.3-SNAPSHOT + 2.58.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.57.3-SNAPSHOT + 2.58.0 diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 191b00922d..2b26a6ed41 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.1.1-SNAPSHOT + 0.2.0 jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -141,7 +141,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.3-SNAPSHOT + 2.58.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index ae2f3cf5d7..4fd420c808 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.57.3-SNAPSHOT + 2.58.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.57.3-SNAPSHOT + 2.58.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2f7db5220d..2c9c287f54 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.57.3-SNAPSHOT + 2.58.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.57.3-SNAPSHOT + 2.58.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index a51dc38ef0..07d2580619 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.57.3-SNAPSHOT + 2.58.0 diff --git a/versions.txt b/versions.txt index 84e55ba1d6..88c1523e07 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.57.2:2.57.3-SNAPSHOT -google-cloud-bigquery-jdbc:0.1.0:0.1.1-SNAPSHOT +google-cloud-bigquery:2.58.0:2.58.0 +google-cloud-bigquery-jdbc:0.2.0:0.2.0 From 0a3d669660612e65fe6885f42389bcc84aa781bd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:45:10 -0500 Subject: [PATCH 2238/2268] chore(main): release 2.58.1-SNAPSHOT (#4084) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 4b47cf24fa..13dab9b73a 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.58.0 + 2.58.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 43e36250ff..77135f0fb6 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.58.0 + 2.58.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.58.0 + 2.58.1-SNAPSHOT diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 2b26a6ed41..e645c9bc83 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.2.0 + 0.2.1-SNAPSHOT jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -141,7 +141,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.58.0 + 2.58.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4fd420c808..b5ecad4d25 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.58.0 + 2.58.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.58.0 + 2.58.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 2c9c287f54..a3abc5b9e5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.58.0 + 2.58.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.58.0 + 2.58.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 07d2580619..4ec3ae6b9a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.58.0 + 2.58.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 88c1523e07..0facc566a0 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.58.0:2.58.0 -google-cloud-bigquery-jdbc:0.2.0:0.2.0 +google-cloud-bigquery:2.58.0:2.58.1-SNAPSHOT +google-cloud-bigquery-jdbc:0.2.0:0.2.1-SNAPSHOT From f5a4852cb66edc4cde8612d50744e947edd7770f Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 29 Jan 2026 16:05:30 -0500 Subject: [PATCH 2239/2268] chore: replace old java team with cloud-sdk-java-team (#4088) --- .github/CODEOWNERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d5cda28465..577a7c21ff 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,13 +5,13 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax # The @googleapis/api-bigquery is the default owner for changes in this repo -* @googleapis/cloud-java-team-teamsync @googleapis/api-bigquery +* @googleapis/cloud-sdk-java-team @googleapis/api-bigquery # The java-samples-reviewers team is the default owner for samples changes -samples/**/*.java @googleapis/cloud-java-team-teamsync @googleapis/java-samples-reviewers +samples/**/*.java @googleapis/cloud-sdk-java-team @googleapis/java-samples-reviewers # Generated snippets should not be owned by samples reviewers -samples/snippets/generated/ @googleapis/cloud-java-team-teamsync @googleapis/yoshi-java +samples/snippets/generated/ @googleapis/cloud-sdk-java-team # JDBC Driver -google-cloud-bigquery-jdbc/** @googleapis/bq-developer-tools @googleapis/cloud-java-team-teamsync +google-cloud-bigquery-jdbc/** @googleapis/bq-developer-tools @googleapis/cloud-sdk-java-team From 0c030d06fe43ee07d510c8f2532ecde7e9de3cde Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Mon, 2 Feb 2026 18:53:36 +0100 Subject: [PATCH 2240/2268] fix(jdbc): return null for invalid URLs in `connect()` to comply with JDBC spec (#4086) --- .../java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java | 3 +-- .../com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java index 2c7eba16cd..8d1dfb138b 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -165,8 +165,7 @@ public Connection connect(String url, Properties info) throws SQLException { this.toString())); return connection; } else { - throw new IllegalArgumentException( - "Invalid URL provided, must start with \"jdbc:bigquery:\""); + return null; } } catch (IOException e) { LOG.warning("Getting a warning: " + e.getMessage()); diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java index 125de54dfa..6a33c6144d 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java @@ -16,7 +16,6 @@ package com.google.cloud.bigquery.jdbc; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; import java.sql.Connection; import java.sql.DriverPropertyInfo; @@ -36,8 +35,8 @@ public void setUp() { } @Test - public void testInvalidURLDoesNotConnect() { - assertThrows(IllegalArgumentException.class, () -> bigQueryDriver.connect("badURL.com", null)); + public void testInvalidURLReturnsNull() throws SQLException { + assertThat(bigQueryDriver.connect("badURL.com", null)).isNull(); } @Test From 94f6690edf9c51ee71325379646b7d4da8ca855e Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Mon, 2 Feb 2026 19:06:06 +0100 Subject: [PATCH 2241/2268] chore: add readme for `google-cloud-bigquery-jdbc` (#4071) * chore: add readme for `google-cloud-bigquery-jdbc` * chore: address gemini review comments * lint: fix typos * chore: address pr comments and refine readme content * refactor: address PR review feedback * chore: update jar name gs location --------- Co-authored-by: Kirill Logachev --- google-cloud-bigquery-jdbc/README.MD | 291 +++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 google-cloud-bigquery-jdbc/README.MD diff --git a/google-cloud-bigquery-jdbc/README.MD b/google-cloud-bigquery-jdbc/README.MD new file mode 100644 index 0000000000..4c8fd93216 --- /dev/null +++ b/google-cloud-bigquery-jdbc/README.MD @@ -0,0 +1,291 @@ +# Google BigQuery JDBC Client for Java + +Java idiomatic client for [BigQuery JDBC][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + +```xml + + com.google.cloud + google-cloud-bigquery-jdbc + LATEST_VERSION + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-bigquery-jdbc:LATEST_VERSION' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-bigquery-jdbc" % "LATEST_VERSION" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired BigQuery JDBC APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the BigQuery JDBC API calls. + +## Developer Guide + +### Prerequisites + +You need to have either Java with Maven installed or Docker. You might want to install [`Make`](https://www.gnu.org/software/make/) to simplify running commands, otherwise please look into Makefile to check for specific configurations. + +### Setup + +`make install` primarily relies on `mvn install` command. All following commands are primarily applicable for the `google-cloud-bigquery-jdbc` project. +You can also use `make clean` to clean the project and `make lint` to format the code. + +### Running tests + +#### Unittests + +Run all unittests + +`make unittest` + +Run specific unittests + +`make unittest test=` + +Please reference [Maven documentation](https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html) for details about `` + +Example: `make unittest test=BigQueryArrowStructTest` + +#### Integration tests + +IMPORTANT: Running integration tests will skip unit tests by default. To include unit tests, run `make integration-test skipSurefire=false`. Primary focus of this command is to run specific set of tests without a lot of overhead. + +Set the following environment variables to run the integration tests: + +``` +# Default gcloud auth setup +export GOOGLE_APPLICATION_CREDENTIALS= + +# Test specfic envs +export SA_EMAIL=email@email.com +export SA_SECRET= +# Alternatively it can be json content: +export SA_SECRET=`cat ` +``` + +Run all integration tests (currently takes 15+ minutes, so this is discouraged). + +`make integration-test` + +Run specific integration test + +`make integration-test test=` + +Please reference [Maven documentation](https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html) for details about `` + +Example: `make integration-test test=ITBigQueryJDBCTest#testValidServiceAccountAuthenticationOAuthPvtKey` + +### Dockerized environment + +If you don't have Java or Maven, or if you want to test changes with a different Java version, you can leverage dockerized environment. + +One-time run commands are similar to local development make commands: + +``` +make docker-build +make docker-unittest +make docker-integration-test +``` + +Please note that running unit or integration tests within docker doesn't leverage maven cache because it is not persisted. +If you want to run multiple commands, you can start a session and treat this shell session as your local environment. + +``` +make docker-session +``` + +All Docker commands rely only on `GOOGLE_APPLICATION_CREDENTIALS` env being present, it will create rest of env vars as needed. + +### Packaging + +There are a few ways to package the Google JDBC Driver. The output of the packaging commands can be found in the `target` directory. + +`make package` or `make docker-package` will create both a thin jar and a zip file with all dependencies. +`make package-all-dependencies` or `make docker-package-all-dependencies` will create a single jar with all dependencies included. +`make package-all-dependencies-shaded` or `make docker-package-all-dependencies-shaded` will create a single shaded jar with all dependencies included. + +#### Thin jar + +The thin jar is created with `make package`. The thin jar is packaged as a zip file with its dependencies listed in a `dependencies.txt` file, compatible with `pom.xml`. + +#### All dependencies + +The jar with all dependencies is also created. This jar includes all dependencies and can be used as a standalone jar with tools like R-Studio. You can run `make package-all-dependencies` or `make docker-package-all-dependencies` to build only the jar with all dependencies. + +#### Shaded Jar +You can also build a shaded jar with all dependencies. This can be done by running `make package-all-dependencies-shaded` or `make docker-package-all-dependencies-shaded`. + +### Nightly builds + +The nightly build runs the full set of integration tests, including the `ITBigQueryJDBCTest` and `ITNightlyBigQueryTest` test suites. It also includes some long-running tests (takes 20+ minutes to complete). + +**Note:** These builds are intended for testing and development purposes only and are not recommended for production use. + +Nightly Integration Tests include a step to build a full and thin jars and upload them to Google Storage. + +They can be retrieved via following commands: + +``` +gsutil cp gs://bq_devtools_release_private/drivers/jdbc/google-cloud-bigquery-jdbc-latest-all.jar . +gsutil cp gs://bq_devtools_release_private/drivers/jdbc/google-cloud-bigquery-jdbc-latest.zip . +``` + +#### Performance tests + +Cloud Build Pipeline is uploading latest full jar to the internal location for perf tests once a week. + +### Code Coverage + +We're using [JaCoCo](https://www.eclemma.org/jacoco/) to track Code Coverage. `Makefile` has 2 separate set of commands for unittests and integration tests reports. + +You can run `make unit-test-coverage` to generate a coverage report for unit tests. The output will be in `jacoco-unittests.zip`. +You can run `make full-coverage` to generate a coverage report for both unit and integration tests. The output will be in `jacoco-full.zip`. + +You can also run `make docker-coverage` which will produce both results. You can find `jacoco-unittests.zip` and `jacoco-full.zip` files in the root with results. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the BigQuery JDBC [API enabled][enable-api]. + +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-bigquery-jdbc` library. See the [Quickstart](#quickstart) section +to add `google-cloud-bigquery-jdbc` as a dependency in your code. + +## About BigQuery JDBC + + +[BigQuery JDBC][product-docs] + +See the [BigQuery JDBC client library docs][javadocs] to learn how to +use this BigQuery JDBC Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/bigquery +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-bigquery/latest/history +[stability-image]: https://img.shields.io/badge/stability-unknown-red +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigquery-jdbc.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigquery-jdbc/0.0.0 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-bigquery/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-bigquery/blob/main/CODE_OF_CONDUCT.md +[license]: https://github.com/googleapis/java-bigquery/blob/main/LICENSE + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java From 0966b142029a6db26877857ab2b0f37c3a96d996 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Tue, 3 Feb 2026 08:12:43 -0800 Subject: [PATCH 2242/2268] chore(jdbc): shade bq sdk in jdbc 'all' package (#4092) --- google-cloud-bigquery-jdbc/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index e645c9bc83..aa2823f350 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -98,7 +98,6 @@ com com.google.bqjdbc.shaded.com - com.google.cloud.bigquery.* com.google.cloud.bigquery.jdbc.* From 1239a68d5b07bfa1fe2bbb678540896623bd6049 Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Wed, 4 Feb 2026 15:26:36 +0100 Subject: [PATCH 2243/2268] feat(jdbc): enable gRPC Keep-Alive for Storage Read API (#4093) * feat(jdbc): enable gRPC Keep-Alive for Storage Read API * test(jdbc): add unit test for gRPC Keep-Alive configuration * chore: fix dependency * fix: unit tests * fix: use `java.time.Duration` instead of `threetenbp` --- .../bigquery/jdbc/BigQueryConnection.java | 18 ++++++++++++-- .../bigquery/jdbc/BigQueryConnectionTest.java | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index e93938f258..188b3f9a84 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -18,6 +18,7 @@ import com.google.api.gax.core.CredentialsProvider; import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.FixedHeaderProvider; import com.google.api.gax.rpc.HeaderProvider; @@ -1053,10 +1054,23 @@ private BigQueryReadClient getBigQueryReadClientConnection() throws IOException if (this.universeDomain != null) { bigQueryReadSettings.setUniverseDomain(this.universeDomain); } - if (this.transportChannelProvider != null) { - bigQueryReadSettings.setTransportChannelProvider(this.transportChannelProvider); + TransportChannelProvider activeProvider = this.transportChannelProvider; + if (activeProvider == null) { + activeProvider = BigQueryReadSettings.defaultGrpcTransportProviderBuilder().build(); + } + + if (activeProvider instanceof InstantiatingGrpcChannelProvider) { + activeProvider = + ((InstantiatingGrpcChannelProvider) activeProvider) + .toBuilder() + .setKeepAliveTimeDuration(java.time.Duration.ofSeconds(10)) + .setKeepAliveTimeoutDuration(java.time.Duration.ofSeconds(5)) + .setKeepAliveWithoutCalls(true) + .build(); } + bigQueryReadSettings.setTransportChannelProvider(activeProvider); + return BigQueryReadClient.create(bigQueryReadSettings.build()); } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java index 22f98af07e..6df4724b2c 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -18,8 +18,11 @@ import static org.junit.Assert.*; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.HeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; import java.io.IOException; import java.io.InputStream; @@ -340,4 +343,25 @@ public void testMetaDataFetchThreadCountProperty() throws SQLException, IOExcept connectionCustom.getMetadataFetchThreadCount()); } } + + @Test + public void testBigQueryReadClientKeepAliveSettings() throws SQLException, IOException { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + BigQueryReadClient readClient = connection.getBigQueryReadClient(); + assertNotNull(readClient); + + TransportChannelProvider provider = readClient.getSettings().getTransportChannelProvider(); + assertTrue(provider instanceof InstantiatingGrpcChannelProvider); + + InstantiatingGrpcChannelProvider grpcProvider = (InstantiatingGrpcChannelProvider) provider; + assertEquals(java.time.Duration.ofSeconds(10), grpcProvider.getKeepAliveTimeDuration()); + assertEquals(java.time.Duration.ofSeconds(5), grpcProvider.getKeepAliveTimeoutDuration()); + assertTrue(grpcProvider.getKeepAliveWithoutCalls()); + } + } } From 6feeb50bc1f071b01c4fcfc943db7a9439b44e1f Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Thu, 5 Feb 2026 13:59:00 +0100 Subject: [PATCH 2244/2268] feat(jdbc): add `RequestReason` connection property (#4094) * feat(jdbc): add `RequestReason` connection property * test: add unit test for `RequestReason` connection property * Update google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * chore: use `HeaderProvider` instead of lambda * test: add unit test for verifying header in connection --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../cloud/bigquery/jdbc/BigQueryConnection.java | 14 +++++++++++++- .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 10 +++++++++- .../bigquery/jdbc/BigQueryConnectionTest.java | 17 +++++++++++++++++ .../jdbc/BigQueryJdbcUrlUtilityTest.java | 14 ++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 188b3f9a84..b89c568d15 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -131,6 +131,7 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { String sslTrustStorePassword; long maxBytesBilled; Map labels; + String requestReason; BigQueryConnection(String url) throws IOException { this.connectionUrl = url; @@ -347,6 +348,12 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { BigQueryJdbcUrlUtility.METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME, BigQueryJdbcUrlUtility.DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE, this.connectionClassName); + this.requestReason = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, + null, + this.connectionClassName); HEADER_PROVIDER = createHeaderProvider(); this.bigQuery = getBigQueryConnection(); @@ -383,7 +390,12 @@ HeaderProvider createHeaderProvider() { String partnerToken = buildPartnerToken(this.connectionUrl); String headerToken = DEFAULT_JDBC_TOKEN_VALUE + "/" + getLibraryVersion(this.getClass()) + partnerToken; - return FixedHeaderProvider.create("user-agent", headerToken); + Map headers = new java.util.HashMap<>(); + headers.put("user-agent", headerToken); + if (this.requestReason != null) { + headers.put("x-goog-request-reason", this.requestReason); + } + return FixedHeaderProvider.create(headers); } protected void addOpenStatements(Statement statement) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index 3b26f7be54..4d11810a22 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -160,6 +160,7 @@ final class BigQueryJdbcUrlUtility { OAUTH2_TOKEN_URI_PROPERTY_NAME, HTAPI_ENDPOINT_OVERRIDE_PROPERTY_NAME, STS_ENDPOINT_OVERRIDE_PROPERTY_NAME); + static final String REQUEST_REASON_PROPERTY_NAME = "RequestReason"; static final List BYOID_PROPERTIES = Arrays.asList( BYOID_AUDIENCE_URI_PROPERTY_NAME, @@ -249,7 +250,8 @@ final class BigQueryJdbcUrlUtility { BigQueryConnectionProperty.newBuilder() .setName(OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME) .setDescription( - "Comma separated list of service account emails in the impersonation chain.") + "Comma separated list of service account emails in the impersonation" + + " chain.") .build(), BigQueryConnectionProperty.newBuilder() .setName(OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME) @@ -569,6 +571,12 @@ final class BigQueryJdbcUrlUtility { .setDescription( "The password for accessing the Java TrustStore that is specified using" + " the property SSLTrustStore.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(REQUEST_REASON_PROPERTY_NAME) + .setDescription( + "Reason for the request, which is passed as the x-goog-request-reason" + + " header.") .build()))); private BigQueryJdbcUrlUtility() {} diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java index 6df4724b2c..1cc0ad7bb5 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -165,6 +165,23 @@ public void testHeaderProviderWithInvalidPartner() throws IOException, SQLExcept } } + @Test + public void testHeaderProviderWithRequestReason() throws IOException, SQLException { + String requestReason = "Ticket123"; + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=redactedToken;OAuthClientId=redactedToken;" + + "OAuthClientSecret=redactedToken;RequestReason=" + + requestReason; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + HeaderProvider headerProvider = connection.createHeaderProvider(); + java.util.Map headers = headerProvider.getHeaders(); + assertTrue(headers.containsKey("x-goog-request-reason")); + assertEquals(requestReason, headers.get("x-goog-request-reason")); + } + } + @Test public void testWriteAPIConnectionProperties() throws SQLException { // Test without connection properties. Defaults to default values. diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java index 86f087bf35..3cd0733a70 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -800,4 +800,18 @@ public void testParseLabelsEmpty() { Map labels = BigQueryJdbcUrlUtility.parseLabels(connection_uri, null); assertNull(labels); } + + @Test + public void testParseRequestReason() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=testProject;RequestReason=testingRequestReason;"; + String requestReason = + BigQueryJdbcUrlUtility.parseStringProperty( + url, + BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, + null, + "testParseRequestReason"); + assertEquals("testingRequestReason", requestReason); + } } From 77e0c350e7d8fb5d6491e5ed6f1edfd9fecc59c8 Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Thu, 5 Feb 2026 16:46:18 +0100 Subject: [PATCH 2245/2268] feat(jdbc): add `HttpTransportOptions` timeout configuration (#4089) * feat(jdbc): add HttpTransportOptions timeout configurations * chore: add unit tests for HttpTransportOptions timeout configurations * chore: address gemini pr review comments * chore: remove setting default value * fix: merge conflict --- .../bigquery/jdbc/BigQueryConnection.java | 24 ++++++++ .../jdbc/BigQueryJdbcProxyUtility.java | 34 ++++++++--- .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 12 ++++ .../jdbc/BigQueryJdbcProxyUtilityTest.java | 61 ++++++++++++++++--- .../jdbc/BigQueryJdbcUrlUtilityTest.java | 46 ++++++++++++++ 5 files changed, 161 insertions(+), 16 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index b89c568d15..4792c6fa34 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -131,6 +131,8 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { String sslTrustStorePassword; long maxBytesBilled; Map labels; + Integer httpConnectTimeout; + Integer httpReadTimeout; String requestReason; BigQueryConnection(String url) throws IOException { @@ -273,11 +275,25 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, null, this.connectionClassName); + this.httpConnectTimeout = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, + null, + this.connectionClassName); + this.httpReadTimeout = + BigQueryJdbcUrlUtility.parseIntProperty( + url, + BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, + null, + this.connectionClassName); this.httpTransportOptions = BigQueryJdbcProxyUtility.getHttpTransportOptions( proxyProperties, this.sslTrustStorePath, this.sslTrustStorePassword, + this.httpConnectTimeout, + this.httpReadTimeout, this.connectionClassName); this.transportChannelProvider = BigQueryJdbcProxyUtility.getTransportChannelProvider( @@ -736,6 +752,14 @@ String getSSLTrustStorePassword() { return sslTrustStorePassword; } + Integer getHttpConnectTimeout() { + return httpConnectTimeout; + } + + Integer getHttpReadTimeout() { + return httpReadTimeout; + } + @Override public boolean isValid(int timeout) throws SQLException { if (timeout < 0) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java index ebc5450b62..b630505f22 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java @@ -97,7 +97,8 @@ static Map parseProxyProperties(String URL, String callerClassNa (proxyHost == null && proxyPort != null) || (proxyHost != null && proxyPort == null); if (isMissingProxyHostOrPortWhenProxySet) { throw new IllegalArgumentException( - "Both ProxyHost and ProxyPort parameters need to be specified. No defaulting behavior occurs."); + "Both ProxyHost and ProxyPort parameters need to be specified. No defaulting behavior" + + " occurs."); } boolean isMissingProxyUidOrPwdWhenAuthSet = (proxyUid == null && proxyPwd != null) || (proxyUid != null && proxyPwd == null); @@ -117,18 +118,35 @@ static HttpTransportOptions getHttpTransportOptions( Map proxyProperties, String sslTrustStorePath, String sslTrustStorePassword, + Integer connectTimeout, + Integer readTimeout, String callerClassName) { LOG.finest("++enter++\t" + callerClassName); - if (!proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME) - && sslTrustStorePath == null) { + boolean hasProxyOrSsl = + proxyProperties.containsKey(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME) + || sslTrustStorePath != null; + boolean hasTimeoutConfig = connectTimeout != null || readTimeout != null; + + if (!hasProxyOrSsl && !hasTimeoutConfig) { return null; } - return HttpTransportOptions.newBuilder() - .setHttpTransportFactory( - getHttpTransportFactory( - proxyProperties, sslTrustStorePath, sslTrustStorePassword, callerClassName)) - .build(); + + HttpTransportOptions.Builder httpTransportOptionsBuilder = HttpTransportOptions.newBuilder(); + if (hasProxyOrSsl) { + httpTransportOptionsBuilder.setHttpTransportFactory( + getHttpTransportFactory( + proxyProperties, sslTrustStorePath, sslTrustStorePassword, callerClassName)); + } + + if (connectTimeout != null) { + httpTransportOptionsBuilder.setConnectTimeout(connectTimeout); + } + if (readTimeout != null) { + httpTransportOptionsBuilder.setReadTimeout(readTimeout); + } + + return httpTransportOptionsBuilder.build(); } private static HttpTransportFactory getHttpTransportFactory( diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index 4d11810a22..fccb5703d1 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -98,6 +98,8 @@ final class BigQueryJdbcUrlUtility { static final String PROXY_PORT_PROPERTY_NAME = "ProxyPort"; static final String PROXY_USER_ID_PROPERTY_NAME = "ProxyUid"; static final String PROXY_PASSWORD_PROPERTY_NAME = "ProxyPwd"; + static final String HTTP_CONNECT_TIMEOUT_PROPERTY_NAME = "HttpConnectTimeout"; + static final String HTTP_READ_TIMEOUT_PROPERTY_NAME = "HttpReadTimeout"; static final boolean DEFAULT_ENABLE_HTAPI_VALUE = false; static final boolean DEFAULT_ENABLE_SESSION_VALUE = false; static final int DEFAULT_LOG_LEVEL = 0; @@ -572,6 +574,16 @@ final class BigQueryJdbcUrlUtility { "The password for accessing the Java TrustStore that is specified using" + " the property SSLTrustStore.") .build(), + BigQueryConnectionProperty.newBuilder() + .setName(HTTP_CONNECT_TIMEOUT_PROPERTY_NAME) + .setDescription( + "The timeout (in milliseconds) for establishing a connection to the" + + " server.") + .build(), + BigQueryConnectionProperty.newBuilder() + .setName(HTTP_READ_TIMEOUT_PROPERTY_NAME) + .setDescription("The timeout (in milliseconds) when reading from the server.") + .build(), BigQueryConnectionProperty.newBuilder() .setName(REQUEST_REASON_PROPERTY_NAME) .setDescription( diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java index 203502cdac..a69cf68e0b 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtilityTest.java @@ -138,7 +138,8 @@ public void testGetHttpTransportOptionsWithAuthenticatedProxy() { Map proxyProperties = BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); HttpTransportOptions result = - BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + BigQueryJdbcProxyUtility.getHttpTransportOptions( + proxyProperties, null, null, null, null, "TestClass"); assertNotNull(result); } @@ -154,7 +155,8 @@ public void testGetHttpTransportOptionsWithNonAuthenticatedProxy() { Map proxyProperties = BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); HttpTransportOptions result = - BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + BigQueryJdbcProxyUtility.getHttpTransportOptions( + proxyProperties, null, null, null, null, "TestClass"); assertNotNull(result); } @@ -168,7 +170,8 @@ public void testGetHttpTransportOptionsWithNoProxySettingsReturnsNull() { Map proxyProperties = BigQueryJdbcProxyUtility.parseProxyProperties(connection_uri, null); HttpTransportOptions result = - BigQueryJdbcProxyUtility.getHttpTransportOptions(proxyProperties, null, null, null); + BigQueryJdbcProxyUtility.getHttpTransportOptions( + proxyProperties, null, null, null, null, "TestClass"); assertNull(result); } @@ -185,7 +188,7 @@ public void testGetHttpTransportOptions_withSslTrustStore_noPassword() throws Ex String trustStorePath = getTestResourcePath("test_truststore_nopass.jks"); HttpTransportOptions options = BigQueryJdbcProxyUtility.getHttpTransportOptions( - Collections.emptyMap(), trustStorePath, null, "TestClass"); + Collections.emptyMap(), trustStorePath, null, null, null, "TestClass"); assertNotNull(options); assertNotNull(options.getHttpTransportFactory()); } @@ -195,7 +198,12 @@ public void testGetHttpTransportOptions_withSslTrustStore_withCorrectPassword() String trustStorePath = getTestResourcePath("test_truststore_withpass.jks"); HttpTransportOptions options = BigQueryJdbcProxyUtility.getHttpTransportOptions( - Collections.emptyMap(), trustStorePath, "testpassword", "TestClass"); + Collections.emptyMap(), + trustStorePath, + "testpassword", + null, + null, + "TestClass"); assertNotNull(options); assertNotNull(options.getHttpTransportFactory()); } @@ -212,6 +220,8 @@ public void testGetHttpTransportOptions_withSslTrustStore_withIncorrectPassword( Collections.emptyMap(), trustStorePath, "wrongpassword", + null, + null, "TestClass")); assertThat(exception.getCause()).isInstanceOf(IOException.class); } @@ -224,7 +234,12 @@ public void testGetHttpTransportOptions_withInvalidSslTrustStorePath() { BigQueryJdbcRuntimeException.class, () -> BigQueryJdbcProxyUtility.getHttpTransportOptions( - Collections.emptyMap(), invalidPath, null, "TestClass")); + Collections.emptyMap(), + invalidPath, + null, + null, + null, + "TestClass")); assertThat(exception.getCause()).isInstanceOf(FileNotFoundException.class); } @@ -238,7 +253,7 @@ public void testGetHttpTransportOptions_withSslAndProxy() throws Exception { HttpTransportOptions options = BigQueryJdbcProxyUtility.getHttpTransportOptions( - proxyProperties, trustStorePath, null, "TestClass"); + proxyProperties, trustStorePath, null, null, null, "TestClass"); assertNotNull(options); assertNotNull(options.getHttpTransportFactory()); } @@ -287,7 +302,37 @@ public void testGetTransportChannelProvider_noProxyNoSsl_returnsNull() { public void testGetHttpTransportOptions_noProxyNoSsl_returnsNull() { HttpTransportOptions options = BigQueryJdbcProxyUtility.getHttpTransportOptions( - Collections.emptyMap(), null, null, "TestClass"); + Collections.emptyMap(), null, null, null, null, "TestClass"); assertNull(options); } + + @Test + public void testGetHttpTransportOptions_withTimeouts_returnsOptions() { + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), null, null, 10000, 20000, "TestClass"); + assertNotNull(options); + assertThat(options.getConnectTimeout()).isEqualTo(10000); + assertThat(options.getReadTimeout()).isEqualTo(20000); + } + + @Test + public void testGetHttpTransportOptions_withConnectTimeoutOnly_returnsOptions() { + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), null, null, 10000, null, "TestClass"); + assertNotNull(options); + assertThat(options.getConnectTimeout()).isEqualTo(10000); + // readTimeout defaults to HttpTransport's internal default, not asserted here. + } + + @Test + public void testGetHttpTransportOptions_withReadTimeoutOnly_returnsOptions() { + HttpTransportOptions options = + BigQueryJdbcProxyUtility.getHttpTransportOptions( + Collections.emptyMap(), null, null, null, 20000, "TestClass"); + assertNotNull(options); + assertThat(options.getReadTimeout()).isEqualTo(20000); + // connectTimeout defaults to HttpTransport's internal default, not asserted here. + } } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java index 3cd0733a70..b16d1a3983 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -801,6 +801,52 @@ public void testParseLabelsEmpty() { assertNull(labels); } + @Test + public void testParseHttpConnectTimeout() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "HttpConnectTimeout=10000"; + + Integer timeout = + BigQueryJdbcUrlUtility.parseIntProperty( + connection_uri, BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, null, null); + assertEquals(Integer.valueOf(10000), timeout); + } + + @Test + public void testParseHttpConnectTimeoutDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + Integer timeout = + BigQueryJdbcUrlUtility.parseIntProperty( + connection_uri, BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, null, null); + assertNull(timeout); + } + + @Test + public void testParseHttpReadTimeout() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" + + "HttpReadTimeout=20000"; + + Integer timeout = + BigQueryJdbcUrlUtility.parseIntProperty( + connection_uri, BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, null, null); + assertEquals(Integer.valueOf(20000), timeout); + } + + @Test + public void testParseHttpReadTimeoutDefault() { + String connection_uri = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; + + Integer timeout = + BigQueryJdbcUrlUtility.parseIntProperty( + connection_uri, BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, null, null); + assertNull(timeout); + } + @Test public void testParseRequestReason() { String url = From ad438dc626b69f3bddda47ccf6b7a97d9053c047 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 6 Feb 2026 12:27:03 -0800 Subject: [PATCH 2246/2268] fix(jdbc): avoid String.format in log calls (#4096) --- .../bigquery/jdbc/BigQueryArrowResultSet.java | 2 +- .../bigquery/jdbc/BigQueryBaseResultSet.java | 3 +- .../jdbc/BigQueryCallableStatement.java | 23 +- .../bigquery/jdbc/BigQueryConnection.java | 8 +- .../jdbc/BigQueryDatabaseMetaData.java | 332 +++++++----------- .../cloud/bigquery/jdbc/BigQueryDriver.java | 30 +- .../jdbc/BigQueryJdbcCustomLogger.java | 28 ++ .../jdbc/BigQueryJdbcOAuthUtility.java | 9 +- .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 24 +- .../bigquery/jdbc/BigQueryJsonResultSet.java | 2 +- .../jdbc/BigQueryParameterHandler.java | 19 +- .../jdbc/BigQueryPooledConnection.java | 3 +- .../jdbc/BigQueryPreparedStatement.java | 10 +- .../bigquery/jdbc/BigQueryStatement.java | 34 +- .../bigquery/jdbc/BigQueryThreadFactory.java | 2 +- .../bigquery/jdbc/BigQueryTypeCoercer.java | 2 +- .../jdbc/PooledConnectionListener.java | 4 +- 17 files changed, 237 insertions(+), 298 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java index 004dfb02b4..aeea6783dd 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java @@ -441,7 +441,7 @@ private String formatRangeElement(Object element, StandardSQLTypeName elementTyp @Override public void close() { - LOG.fine(String.format("Closing BigqueryArrowResultSet %s.", this)); + LOG.fine("Closing BigqueryArrowResultSet %s.", this); this.isClosed = true; if (ownedThread != null && !ownedThread.isInterrupted()) { // interrupt the producer thread when result set is closed diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java index 7367a81536..4ff4acad6b 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java @@ -103,8 +103,7 @@ public void close() { statement.close(); } } catch (SQLException ex) { - LOG.warning( - String.format("Exception during ResultState.close() operation: %s", ex.getMessage())); + LOG.warning("Exception during ResultState.close() operation: %s", ex.getMessage()); } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java index 041505c623..4de22e64e9 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryCallableStatement.java @@ -930,8 +930,7 @@ public URL getURL(String arg0) throws SQLException { @Override public void registerOutParameter(int paramIndex, int sqlType) throws SQLException { LOG.finest("++enter++"); - LOG.finest( - String.format("registerOutParameter: paramIndex %s, sqlType %s", paramIndex, sqlType)); + LOG.finest("registerOutParameter: paramIndex %s, sqlType %s", paramIndex, sqlType); checkClosed(); try { this.parameterHandler.setParameter( @@ -948,7 +947,7 @@ public void registerOutParameter(int paramIndex, int sqlType) throws SQLExceptio @Override public void registerOutParameter(String paramName, int sqlType) throws SQLException { LOG.finest("++enter++"); - LOG.finest(String.format("registerOutParameter: paramName %s, sqlType %s", paramName, sqlType)); + LOG.finest("registerOutParameter: paramName %s, sqlType %s", paramName, sqlType); checkClosed(); try { this.parameterHandler.setParameter( @@ -966,9 +965,7 @@ public void registerOutParameter(String paramName, int sqlType) throws SQLExcept public void registerOutParameter(int paramIndex, int sqlType, int scale) throws SQLException { LOG.finest("++enter++"); LOG.finest( - String.format( - "registerOutParameter: paramIndex %s, sqlType %s, scale %s", - paramIndex, sqlType, scale)); + "registerOutParameter: paramIndex %s, sqlType %s, scale %s", paramIndex, sqlType, scale); checkClosed(); if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { throw new IllegalArgumentException( @@ -991,9 +988,8 @@ public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException { LOG.finest("++enter++"); LOG.finest( - String.format( - "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", - paramIndex, sqlType, typeName)); + "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", + paramIndex, sqlType, typeName); // fully qualified sql typeName is not supported by the driver and hence ignored. registerOutParameter(paramIndex, sqlType); } @@ -1002,9 +998,7 @@ public void registerOutParameter(int paramIndex, int sqlType, String typeName) public void registerOutParameter(String paramName, int sqlType, int scale) throws SQLException { LOG.finest("++enter++"); LOG.finest( - String.format( - "registerOutParameter: paramIndex %s, sqlType %s, scale %s", - paramName, sqlType, scale)); + "registerOutParameter: paramIndex %s, sqlType %s, scale %s", paramName, sqlType, scale); checkClosed(); if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { throw new IllegalArgumentException( @@ -1027,9 +1021,8 @@ public void registerOutParameter(String paramName, int sqlType, String typeName) throws SQLException { LOG.finest("++enter++"); LOG.finest( - String.format( - "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", - paramName, sqlType, typeName)); + "registerOutParameter: paramIndex %s, sqlType %s, typeName %s", + paramName, sqlType, typeName); // fully qualified sql typeName is not supported by the driver and hence ignored. registerOutParameter(paramName, sqlType); } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 4792c6fa34..5c5d5bc84c 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -415,7 +415,7 @@ HeaderProvider createHeaderProvider() { } protected void addOpenStatements(Statement statement) { - LOG.finest(String.format("Statement %s added to Connection %s.", statement, this)); + LOG.finest("Statement %s added to Connection %s.", statement, this); this.openStatements.add(statement); } @@ -459,7 +459,7 @@ String getConnectionUrl() { public Statement createStatement() throws SQLException { checkClosed(); BigQueryStatement currentStatement = new BigQueryStatement(this); - LOG.fine(String.format("Statement %s created.", currentStatement)); + LOG.fine("Statement %s created.", currentStatement); addOpenStatements(currentStatement); return currentStatement; } @@ -518,7 +518,7 @@ public Statement createStatement( public PreparedStatement prepareStatement(String sql) throws SQLException { checkClosed(); PreparedStatement currentStatement = new BigQueryPreparedStatement(this, sql); - LOG.fine(String.format("Prepared Statement %s created.", currentStatement)); + LOG.fine("Prepared Statement %s created.", currentStatement); addOpenStatements(currentStatement); return currentStatement; } @@ -1175,7 +1175,7 @@ private void commitTransaction() { public CallableStatement prepareCall(String sql) throws SQLException { checkClosed(); CallableStatement currentStatement = new BigQueryCallableStatement(this, sql); - LOG.fine(String.format("Callable Statement %s created.", currentStatement)); + LOG.fine("Callable Statement %s created.", currentStatement); addOpenStatements(currentStatement); return currentStatement; } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java index 66917ea889..75c4559076 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java @@ -791,9 +791,8 @@ public ResultSet getProcedures( } LOG.info( - String.format( - "getProcedures called for catalog: %s, schemaPattern: %s, procedureNamePattern: %s", - catalog, schemaPattern, procedureNamePattern)); + "getProcedures called for catalog: %s, schemaPattern: %s, procedureNamePattern: %s", + catalog, schemaPattern, procedureNamePattern); final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); final Pattern procedureNameRegex = compileSqlLikePattern(procedureNamePattern); @@ -1036,9 +1035,8 @@ void processProcedureInfo( } catch (Exception e) { LOG.warning( - String.format( - "Error processing procedure info for %s: %s. Skipping this procedure.", - routineId, e.getMessage())); + "Error processing procedure info for %s: %s. Skipping this procedure.", + routineId, e.getMessage()); } } @@ -1077,10 +1075,9 @@ public ResultSet getProcedureColumns( } LOG.info( - String.format( - "getProcedureColumns called for catalog: %s, schemaPattern: %s, procedureNamePattern:" - + " %s, columnNamePattern: %s", - catalog, schemaPattern, procedureNamePattern, columnNamePattern)); + "getProcedureColumns called for catalog: %s, schemaPattern: %s, procedureNamePattern:" + + " %s, columnNamePattern: %s", + catalog, schemaPattern, procedureNamePattern, columnNamePattern); final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); final Pattern procedureNameRegex = compileSqlLikePattern(procedureNamePattern); @@ -1221,9 +1218,8 @@ public ResultSet getProcedureColumns( private List fetchMatchingDatasetsForProcedureColumns( String catalogParam, String schemaPattern, Pattern schemaRegex) throws InterruptedException { LOG.fine( - String.format( - "Fetching matching datasets for catalog '%s', schemaPattern '%s'", - catalogParam, schemaPattern)); + "Fetching matching datasets for catalog '%s', schemaPattern '%s'", + catalogParam, schemaPattern); List datasetsToScan = findMatchingBigQueryObjects( "Dataset", @@ -1235,9 +1231,8 @@ private List fetchMatchingDatasetsForProcedureColumns( schemaRegex, LOG); LOG.info( - String.format( - "Found %d datasets to scan for procedures in catalog '%s'.", - datasetsToScan.size(), catalogParam)); + "Found %d datasets to scan for procedures in catalog '%s'.", + datasetsToScan.size(), catalogParam); return datasetsToScan; } @@ -1251,9 +1246,8 @@ List listMatchingProcedureIdsFromDatasets( throws InterruptedException { logger.fine( - String.format( - "Listing matching procedure IDs from %d datasets for catalog '%s'.", - datasetsToScan.size(), catalogParam)); + "Listing matching procedure IDs from %d datasets for catalog '%s'.", + datasetsToScan.size(), catalogParam); final List>> listRoutineFutures = new ArrayList<>(); final List procedureIdsToGet = Collections.synchronizedList(new ArrayList<>()); @@ -1319,9 +1313,8 @@ List listMatchingProcedureIdsFromDatasets( } } logger.info( - String.format( - "Found %d procedure IDs to fetch details for in catalog '%s'.", - procedureIdsToGet.size(), catalogParam)); + "Found %d procedure IDs to fetch details for in catalog '%s'.", + procedureIdsToGet.size(), catalogParam); return procedureIdsToGet; } @@ -1330,8 +1323,7 @@ List fetchFullRoutineDetailsForIds( ExecutorService getRoutineDetailsExecutor, BigQueryJdbcCustomLogger logger) throws InterruptedException { - logger.fine( - String.format("Fetching full details for %d procedure IDs.", procedureIdsToGet.size())); + logger.fine("Fetching full details for %d procedure IDs.", procedureIdsToGet.size()); final List> getRoutineFutures = new ArrayList<>(); final List fullRoutines = Collections.synchronizedList(new ArrayList<>()); @@ -1375,8 +1367,7 @@ List fetchFullRoutineDetailsForIds( logger.warning("getRoutine detail task cancelled."); } } - logger.info( - String.format("Successfully fetched full details for %d routines.", fullRoutines.size())); + logger.info("Successfully fetched full details for %d routines.", fullRoutines.size()); return fullRoutines; } @@ -1389,8 +1380,7 @@ void submitProcedureArgumentProcessingJobs( List> outArgumentProcessingFutures, BigQueryJdbcCustomLogger logger) throws InterruptedException { - logger.fine( - String.format("Submitting argument processing jobs for %d routines.", fullRoutines.size())); + logger.fine("Submitting argument processing jobs for %d routines.", fullRoutines.size()); for (Routine fullRoutine : fullRoutines) { if (Thread.currentThread().isInterrupted()) { @@ -1495,10 +1485,9 @@ void processProcedureArguments( arguments = routine.getArguments(); } catch (Exception e) { LOG.warning( - String.format( - "Could not retrieve arguments list for procedure %s: %s. No arguments will be" - + " processed.", - routineId, e.getMessage())); + "Could not retrieve arguments list for procedure %s: %s. No arguments will be" + + " processed.", + routineId, e.getMessage()); return; } @@ -1527,10 +1516,9 @@ void processProcedureArguments( argName = arg.getName(); } catch (Exception listAccessException) { LOG.warning( - String.format( - "Exception during arguments.get(%d) for Proc: %s. Ordinal: %d. Message: %s." - + " Generating fallback row.", - i, routineId, ordinalPosition, listAccessException.getMessage())); + "Exception during arguments.get(%d) for Proc: %s. Ordinal: %d. Message: %s." + + " Generating fallback row.", + i, routineId, ordinalPosition, listAccessException.getMessage()); argName = "arg_retrieval_err_" + ordinalPosition; arg = null; } @@ -1568,20 +1556,18 @@ List createProcedureColumnRow( if (argument == null) { LOG.warning( - String.format( - "Proc: %s, Arg: %s (Pos %d) - RoutineArgument object is null. Defaulting type to" - + " VARCHAR.", - procedureName, columnName, ordinalPosition)); + "Proc: %s, Arg: %s (Pos %d) - RoutineArgument object is null. Defaulting type to" + + " VARCHAR.", + procedureName, columnName, ordinalPosition); typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); } else { try { StandardSQLDataType argumentDataType = argument.getDataType(); if (argumentDataType == null) { LOG.warning( - String.format( - "Proc: %s, Arg: %s (Pos %d) - argument.getDataType() returned null. Defaulting" - + " type to VARCHAR.", - procedureName, columnName, ordinalPosition)); + "Proc: %s, Arg: %s (Pos %d) - argument.getDataType() returned null. Defaulting" + + " type to VARCHAR.", + procedureName, columnName, ordinalPosition); typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); } else { typeInfo = @@ -1590,10 +1576,9 @@ List createProcedureColumnRow( } } catch (Exception e) { LOG.warning( - String.format( - "Proc: %s, Arg: %s (Pos %d) - Unexpected Exception during type processing." - + " Defaulting type to VARCHAR. Error: %s", - procedureName, columnName, ordinalPosition, e.getMessage())); + "Proc: %s, Arg: %s (Pos %d) - Unexpected Exception during type processing." + + " Defaulting type to VARCHAR. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage()); typeInfo = new ColumnTypeInfo(Types.VARCHAR, "VARCHAR", null, null, null); } } @@ -1604,9 +1589,8 @@ List createProcedureColumnRow( argumentModeStr = argument.getMode(); } catch (Exception e) { LOG.warning( - String.format( - "Proc: %s, Arg: %s (Pos %d) - Could not get argument mode. Error: %s", - procedureName, columnName, ordinalPosition, e.getMessage())); + "Proc: %s, Arg: %s (Pos %d) - Could not get argument mode. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage()); } } @@ -1672,10 +1656,9 @@ ColumnTypeInfo determineTypeInfoFromDataType( } } catch (Exception e) { LOG.warning( - String.format( - "Proc: %s, Arg: %s (Pos %d) - Caught an unexpected Exception during type" - + " determination. Defaulting type to VARCHAR. Error: %s", - procedureName, columnName, ordinalPosition, e.getMessage())); + "Proc: %s, Arg: %s (Pos %d) - Caught an unexpected Exception during type" + + " determination. Defaulting type to VARCHAR. Error: %s", + procedureName, columnName, ordinalPosition, e.getMessage()); } return defaultVarcharTypeInfo; } @@ -1733,9 +1716,8 @@ public ResultSet getTables( } LOG.info( - String.format( - "getTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s, types: %s", - effectiveCatalog, effectiveSchemaPattern, tableNamePattern, Arrays.toString(types))); + "getTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s, types: %s", + effectiveCatalog, effectiveSchemaPattern, tableNamePattern, Arrays.toString(types)); final Pattern schemaRegex = compileSqlLikePattern(effectiveSchemaPattern); final Pattern tableNameRegex = compileSqlLikePattern(tableNamePattern); @@ -1959,9 +1941,8 @@ void processTableInfo( if (requestedTypes != null && !requestedTypes.contains(bqTableType)) { LOG.finer( - String.format( - "Skipping table %s as its type '%s' is not in the requested types %s", - tableId, bqTableType, requestedTypes)); + "Skipping table %s as its type '%s' is not in the requested types %s", + tableId, bqTableType, requestedTypes); return; } @@ -1983,9 +1964,7 @@ void processTableInfo( LOG.fine("Processed and added table info row for: " + tableId); } catch (Exception e) { LOG.warning( - String.format( - "Error processing table info for %s: %s. Skipping this table.", - tableId, e.getMessage())); + "Error processing table info for %s: %s. Skipping this table.", tableId, e.getMessage()); } } @@ -2105,10 +2084,9 @@ public ResultSet getColumns( } LOG.info( - String.format( - "getColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," - + " columnNamePattern: %s", - effectiveCatalog, effectiveSchemaPattern, tableNamePattern, columnNamePattern)); + "getColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," + + " columnNamePattern: %s", + effectiveCatalog, effectiveSchemaPattern, tableNamePattern, columnNamePattern); Pattern schemaRegex = compileSqlLikePattern(effectiveSchemaPattern); Pattern tableNameRegex = compileSqlLikePattern(tableNamePattern); @@ -2257,9 +2235,8 @@ private void processTableColumns( || tableSchema.getFields() == null || tableSchema.getFields().isEmpty()) { LOG.warning( - String.format( - "Schema not found or fields are null for table %s (Type: %s). Skipping columns.", - tableId, definition.getType())); + "Schema not found or fields are null for table %s (Type: %s). Skipping columns.", + tableId, definition.getType()); return; } @@ -2284,12 +2261,10 @@ private void processTableColumns( LOG.fine("Finished processing columns for table: " + tableId); } catch (BigQueryException e) { LOG.warning( - String.format( - "BigQueryException processing table %s: %s (Code: %d)", - tableId, e.getMessage(), e.getCode())); + "BigQueryException processing table %s: %s (Code: %d)", + tableId, e.getMessage(), e.getCode()); } catch (Exception e) { - LOG.severe( - String.format("Unexpected error processing table %s: %s", tableId, e.getMessage())); + LOG.severe("Unexpected error processing table %s: %s", tableId, e.getMessage()); } } @@ -2511,10 +2486,9 @@ private Comparator defineGetColumnsComparator(FieldList resultSc public ResultSet getColumnPrivileges( String catalog, String schema, String table, String columnNamePattern) { LOG.info( - String.format( - "getColumnPrivileges called for catalog: %s, schema: %s, table: %s, columnNamePattern:" - + " %s. BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", - catalog, schema, table, columnNamePattern)); + "getColumnPrivileges called for catalog: %s, schema: %s, table: %s, columnNamePattern:" + + " %s. BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", + catalog, schema, table, columnNamePattern); final Schema resultSchema = defineGetColumnPrivilegesSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -2540,10 +2514,9 @@ Schema defineGetColumnPrivilegesSchema() { public ResultSet getTablePrivileges( String catalog, String schemaPattern, String tableNamePattern) { LOG.info( - String.format( - "getTablePrivileges called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " - + "BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", - catalog, schemaPattern, tableNamePattern)); + "getTablePrivileges called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " + + "BigQuery IAM model differs from SQL privileges; returning empty ResultSet.", + catalog, schemaPattern, tableNamePattern); final Schema resultSchema = defineGetTablePrivilegesSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -2562,11 +2535,10 @@ Schema defineGetTablePrivilegesSchema() { public ResultSet getBestRowIdentifier( String catalog, String schema, String table, int scope, boolean nullable) { LOG.info( - String.format( - "getBestRowIdentifier called for catalog: %s, schema: %s, table: %s, scope: %d," - + " nullable: %s. BigQuery does not support best row identifiers; returning empty" - + " ResultSet.", - catalog, schema, table, scope, nullable)); + "getBestRowIdentifier called for catalog: %s, schema: %s, table: %s, scope: %d," + + " nullable: %s. BigQuery does not support best row identifiers; returning empty" + + " ResultSet.", + catalog, schema, table, scope, nullable); final Schema resultSchema = defineGetBestRowIdentifierSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -2614,10 +2586,9 @@ Schema defineGetBestRowIdentifierSchema() { @Override public ResultSet getVersionColumns(String catalog, String schema, String table) { LOG.info( - String.format( - "getVersionColumns called for catalog: %s, schema: %s, table: %s. " - + "Automatic version columns not supported by BigQuery; returning empty ResultSet.", - catalog, schema, table)); + "getVersionColumns called for catalog: %s, schema: %s, table: %s. " + + "Automatic version columns not supported by BigQuery; returning empty ResultSet.", + catalog, schema, table); final Schema resultSchema = defineGetVersionColumnsSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3192,10 +3163,9 @@ Comparator defineGetTypeInfoComparator(FieldList schemaFields) { public ResultSet getIndexInfo( String catalog, String schema, String table, boolean unique, boolean approximate) { LOG.info( - String.format( - "getIndexInfo called for catalog: %s, schema: %s, table: %s, unique: %s, approximate:" - + " %s. Traditional indexes not supported by BigQuery; returning empty ResultSet.", - catalog, schema, table, unique, approximate)); + "getIndexInfo called for catalog: %s, schema: %s, table: %s, unique: %s, approximate:" + + " %s. Traditional indexes not supported by BigQuery; returning empty ResultSet.", + catalog, schema, table, unique, approximate); final Schema resultSchema = defineGetIndexInfoSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3324,13 +3294,9 @@ public boolean supportsBatchUpdates() { public ResultSet getUDTs( String catalog, String schemaPattern, String typeNamePattern, int[] types) { LOG.info( - String.format( - "getUDTs called for catalog: %s, schemaPattern: %s, typeNamePattern: %s, types: %s. " - + "Feature not supported by BigQuery; returning empty ResultSet.", - catalog, - schemaPattern, - typeNamePattern, - (types == null ? "null" : Arrays.toString(types)))); + "getUDTs called for catalog: %s, schemaPattern: %s, typeNamePattern: %s, types: %s. " + + "Feature not supported by BigQuery; returning empty ResultSet.", + catalog, schemaPattern, typeNamePattern, (types == null ? "null" : Arrays.toString(types))); final Schema resultSchema = defineGetUDTsSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3401,10 +3367,9 @@ public boolean supportsGetGeneratedKeys() { @Override public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) { LOG.info( - String.format( - "getSuperTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " - + "BigQuery does not support super tables; returning empty ResultSet.", - catalog, schemaPattern, tableNamePattern)); + "getSuperTables called for catalog: %s, schemaPattern: %s, tableNamePattern: %s. " + + "BigQuery does not support super tables; returning empty ResultSet.", + catalog, schemaPattern, tableNamePattern); final Schema resultSchema = defineGetSuperTablesSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3439,10 +3404,9 @@ Schema defineGetSuperTablesSchema() { @Override public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) { LOG.info( - String.format( - "getSuperTypes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s. BigQuery" - + " does not support user-defined type hierarchies; returning empty ResultSet.", - catalog, schemaPattern, typeNamePattern)); + "getSuperTypes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s. BigQuery" + + " does not support user-defined type hierarchies; returning empty ResultSet.", + catalog, schemaPattern, typeNamePattern); final Schema resultSchema = defineGetSuperTypesSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3486,11 +3450,10 @@ Schema defineGetSuperTypesSchema() { public ResultSet getAttributes( String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) { LOG.info( - String.format( - "getAttributes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s," - + " attributeNamePattern: %s. Feature not supported by BigQuery; returning empty" - + " ResultSet.", - catalog, schemaPattern, typeNamePattern, attributeNamePattern)); + "getAttributes called for catalog: %s, schemaPattern: %s, typeNamePattern: %s," + + " attributeNamePattern: %s. Feature not supported by BigQuery; returning empty" + + " ResultSet.", + catalog, schemaPattern, typeNamePattern, attributeNamePattern); final Schema resultSchema = defineGetAttributesSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -3652,9 +3615,7 @@ public ResultSet getSchemas(String catalog, String schemaPattern) { return new BigQueryJsonResultSet(); } - LOG.info( - String.format( - "getSchemas called for catalog: %s, schemaPattern: %s", catalog, schemaPattern)); + LOG.info("getSchemas called for catalog: %s, schemaPattern: %s", catalog, schemaPattern); final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); final Schema resultSchema = defineGetSchemasSchema(); @@ -3780,9 +3741,8 @@ void processSchemaInfo( LOG.finer("Processed and added schema info row for: " + datasetId); } catch (Exception e) { LOG.warning( - String.format( - "Error processing schema info for dataset %s: %s. Skipping this schema.", - datasetId, e.getMessage())); + "Error processing schema info for dataset %s: %s. Skipping this schema.", + datasetId, e.getMessage()); } } @@ -3901,9 +3861,8 @@ public ResultSet getFunctions(String catalog, String schemaPattern, String funct } LOG.info( - String.format( - "getFunctions called for catalog: %s, schemaPattern: %s, functionNamePattern: %s", - catalog, schemaPattern, functionNamePattern)); + "getFunctions called for catalog: %s, schemaPattern: %s, functionNamePattern: %s", + catalog, schemaPattern, functionNamePattern); final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); final Pattern functionNameRegex = compileSqlLikePattern(functionNamePattern); @@ -3954,9 +3913,8 @@ public ResultSet getFunctions(String catalog, String schemaPattern, String funct Callable> apiCallable = () -> { LOG.fine( - String.format( - "Fetching all routines for dataset: %s, pattern: %s", - currentDatasetId.getDataset(), functionNamePattern)); + "Fetching all routines for dataset: %s, pattern: %s", + currentDatasetId.getDataset(), functionNamePattern); return findMatchingBigQueryObjects( "Routine", () -> @@ -4113,9 +4071,8 @@ void processFunctionInfo( } catch (Exception e) { LOG.warning( - String.format( - "Error processing function info for %s: %s. Skipping this function.", - routineId, e.getMessage())); + "Error processing function info for %s: %s. Skipping this function.", + routineId, e.getMessage()); } } @@ -4154,10 +4111,9 @@ public ResultSet getFunctionColumns( } LOG.info( - String.format( - "getFunctionColumns called for catalog: %s, schemaPattern: %s, functionNamePattern: %s," - + " columnNamePattern: %s", - catalog, schemaPattern, functionNamePattern, columnNamePattern)); + "getFunctionColumns called for catalog: %s, schemaPattern: %s, functionNamePattern: %s," + + " columnNamePattern: %s", + catalog, schemaPattern, functionNamePattern, columnNamePattern); final Pattern schemaRegex = compileSqlLikePattern(schemaPattern); final Pattern functionNameRegex = compileSqlLikePattern(functionNamePattern); @@ -4384,9 +4340,8 @@ List listMatchingFunctionIdsFromDatasets( throws InterruptedException { logger.fine( - String.format( - "Listing matching function IDs from %d datasets for catalog '%s'.", - datasetsToScan.size(), catalogParam)); + "Listing matching function IDs from %d datasets for catalog '%s'.", + datasetsToScan.size(), catalogParam); final List>> listRoutineFutures = new ArrayList<>(); final List functionIdsToGet = Collections.synchronizedList(new ArrayList<>()); @@ -4458,9 +4413,8 @@ List listMatchingFunctionIdsFromDatasets( } } logger.info( - String.format( - "Found %d function IDs to fetch details for in catalog '%s'.", - functionIdsToGet.size(), catalogParam)); + "Found %d function IDs to fetch details for in catalog '%s'.", + functionIdsToGet.size(), catalogParam); return functionIdsToGet; } @@ -4473,9 +4427,7 @@ void submitFunctionParameterProcessingJobs( List> outParameterProcessingFutures, BigQueryJdbcCustomLogger logger) throws InterruptedException { - logger.fine( - String.format( - "Submitting parameter processing jobs for %d functions.", fullFunctions.size())); + logger.fine("Submitting parameter processing jobs for %d functions.", fullFunctions.size()); for (Routine fullFunction : fullFunctions) { if (Thread.currentThread().isInterrupted()) { @@ -4701,11 +4653,10 @@ Comparator defineGetFunctionColumnsComparator(FieldList resultSc public ResultSet getPseudoColumns( String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) { LOG.info( - String.format( - "getPseudoColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," - + " columnNamePattern: %s. Pseudo columns not supported by BigQuery; returning" - + " empty ResultSet.", - catalog, schemaPattern, tableNamePattern, columnNamePattern)); + "getPseudoColumns called for catalog: %s, schemaPattern: %s, tableNamePattern: %s," + + " columnNamePattern: %s. Pseudo columns not supported by BigQuery; returning" + + " empty ResultSet.", + catalog, schemaPattern, tableNamePattern, columnNamePattern); final Schema resultSchema = defineGetPseudoColumnsSchema(); final FieldList resultSchemaFields = resultSchema.getFields(); @@ -4824,34 +4775,29 @@ private Tuple determineEffectiveCatalogAndSchema( effectiveCatalog = defaultProjectFromConnection; effectiveSchemaPattern = defaultSchemaFromConnection; LOG.info( - String.format( - logPrefix + "Using default catalog '%s' and default dataset '%s'.", - effectiveCatalog, - effectiveSchemaPattern)); + logPrefix + "Using default catalog '%s' and default dataset '%s'.", + effectiveCatalog, + effectiveSchemaPattern); } else if (catalogIsNullOrEmptyOrWildcard) { effectiveCatalog = defaultProjectFromConnection; LOG.info( - String.format( - logPrefix - + "Using default catalog '%s' with user dataset '%s'. Default dataset '%s' ignored.", - effectiveCatalog, - effectiveSchemaPattern, - defaultSchemaFromConnection)); + logPrefix + + "Using default catalog '%s' with user dataset '%s'. Default dataset '%s' ignored.", + effectiveCatalog, + effectiveSchemaPattern, + defaultSchemaFromConnection); } else if (schemaPatternIsNullOrEmptyOrWildcard) { effectiveSchemaPattern = defaultSchemaFromConnection; LOG.info( - String.format( - logPrefix + "Using user catalog '%s' and default dataset '%s'.", - effectiveCatalog, - effectiveSchemaPattern)); + logPrefix + "Using user catalog '%s' and default dataset '%s'.", + effectiveCatalog, + effectiveSchemaPattern); } else { LOG.info( - String.format( - logPrefix - + "Using user catalog '%s' and schema '%s'. Default dataset '%s' ignored.", - effectiveCatalog, - effectiveSchemaPattern, - defaultSchemaFromConnection)); + logPrefix + "Using user catalog '%s' and schema '%s'. Default dataset '%s' ignored.", + effectiveCatalog, + effectiveSchemaPattern, + defaultSchemaFromConnection); } } return Tuple.of(effectiveCatalog, effectiveSchemaPattern); @@ -4914,24 +4860,22 @@ List findMatchingBigQueryObjects( Iterable objects; if (needsList) { logger.info( - String.format( - "Listing all %ss (pattern: %s)...", - objectTypeName, pattern == null ? "" : pattern)); + "Listing all %ss (pattern: %s)...", + objectTypeName, pattern == null ? "" : pattern); Page firstPage = listAllOperation.get(); objects = firstPage.iterateAll(); logger.fine( - String.format( - "Retrieved initial %s list, iterating & filtering if needed...", objectTypeName)); + "Retrieved initial %s list, iterating & filtering if needed...", objectTypeName); } else { - logger.info(String.format("Getting specific %s: '%s'", objectTypeName, pattern)); + logger.info("Getting specific %s: '%s'", objectTypeName, pattern); T specificObject = getSpecificOperation.apply(pattern); objects = (specificObject == null) ? Collections.emptyList() : Collections.singletonList(specificObject); if (specificObject == null) { - logger.info(String.format("Specific %s not found: '%s'", objectTypeName, pattern)); + logger.info("Specific %s not found: '%s'", objectTypeName, pattern); } } @@ -4956,21 +4900,19 @@ List findMatchingBigQueryObjects( } catch (BigQueryException e) { if (!needsList && e.getCode() == 404) { - logger.info(String.format("%s '%s' not found (API error 404).", objectTypeName, pattern)); + logger.info("%s '%s' not found (API error 404).", objectTypeName, pattern); } else { logger.warning( - String.format( - "BigQueryException finding %ss for pattern '%s': %s (Code: %d)", - objectTypeName, pattern, e.getMessage(), e.getCode())); + "BigQueryException finding %ss for pattern '%s': %s (Code: %d)", + objectTypeName, pattern, e.getMessage(), e.getCode()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); logger.warning("Interrupted while finding " + objectTypeName + "s."); } catch (Exception e) { logger.severe( - String.format( - "Unexpected exception finding %ss for pattern '%s': %s", - objectTypeName, pattern, e.getMessage())); + "Unexpected exception finding %ss for pattern '%s': %s", + objectTypeName, pattern, e.getMessage()); } return resultList; } @@ -5036,23 +4978,20 @@ void sortResults( BigQueryJdbcCustomLogger logger) { if (collectedResults == null || collectedResults.isEmpty()) { - logger.info(String.format("No results collected for %s, skipping sort.", operationName)); + logger.info("No results collected for %s, skipping sort.", operationName); return; } if (comparator == null) { - logger.info(String.format("No comparator provided for %s, skipping sort.", operationName)); + logger.info("No comparator provided for %s, skipping sort.", operationName); return; } - logger.info( - String.format( - "Sorting %d collected %s results...", collectedResults.size(), operationName)); + logger.info("Sorting %d collected %s results...", collectedResults.size(), operationName); try { collectedResults.sort(comparator); - logger.info(String.format("%s result sorting completed.", operationName)); + logger.info("%s result sorting completed.", operationName); } catch (Exception e) { - logger.severe( - String.format("Error during sorting %s results: %s", operationName, e.getMessage())); + logger.severe("Error during sorting %s results: %s", operationName, e.getMessage()); } } @@ -5174,7 +5113,7 @@ private Long getLongValueOrNull(FieldValueList fvl, int index) { } private void waitForTasksCompletion(List> taskFutures) { - LOG.info(String.format("Waiting for %d submitted tasks to complete...", taskFutures.size())); + LOG.info("Waiting for %d submitted tasks to complete...", taskFutures.size()); for (Future future : taskFutures) { try { if (!future.isCancelled()) { @@ -5184,9 +5123,8 @@ private void waitForTasksCompletion(List> taskFutures) { LOG.warning("A table processing task was cancelled."); } catch (ExecutionException e) { LOG.severe( - String.format( - "Error executing table processing task: %s", - (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()))); + "Error executing table processing task: %s", + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage())); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.warning( @@ -5203,7 +5141,7 @@ private void populateQueue( List collectedResults, BlockingQueue queue, FieldList resultSchemaFields) { - LOG.info(String.format("Populating queue with %d results...", collectedResults.size())); + LOG.info("Populating queue with %d results...", collectedResults.size()); try { for (FieldValueList sortedRow : collectedResults) { if (Thread.currentThread().isInterrupted()) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java index 8d1dfb138b..11199c372b 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -145,24 +145,24 @@ public Connection connect(String url, Properties info) throws SQLException { } BigQueryJdbcRootLogger.setLevel(logLevel, logPath); + // Logging starts from here. BigQueryConnection connection = new BigQueryConnection(connectionUri); LOG.info( - String.format( - "Driver info : { {Database Product Name : %s}, " - + "{Database Product Version : %s}, " - + "{Driver Name : %s}, " - + "{Driver Version : %s}, " - + "{LogLevel : %s}, " - + "{LogPath : %s}, " - + "{Driver Instance : %s} }", - connection.getMetaData().getDatabaseProductName(), - connection.getMetaData().getDatabaseProductVersion(), - connection.getMetaData().getDriverName(), - connection.getMetaData().getDriverVersion(), - logLevel, - logPath, - this.toString())); + "Driver info : { {Database Product Name : %s}, " + + "{Database Product Version : %s}, " + + "{Driver Name : %s}, " + + "{Driver Version : %s}, " + + "{LogLevel : %s}, " + + "{LogPath : %s}, " + + "{Driver Instance : %s} }", + connection.getMetaData().getDatabaseProductName(), + connection.getMetaData().getDatabaseProductVersion(), + connection.getMetaData().getDriverName(), + connection.getMetaData().getDriverVersion(), + logLevel, + logPath, + this.toString()); return connection; } else { return null; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java index 611b200ff6..9412b2fd79 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcCustomLogger.java @@ -29,4 +29,32 @@ protected BigQueryJdbcCustomLogger(String name, String resourceBundleName) { this(name, null); this.setParent(BigQueryJdbcRootLogger.getRootLogger()); } + + void finest(String format, Object... args) { + this.finest(() -> String.format(format, args)); + } + + void finer(String format, Object... args) { + this.finer(() -> String.format(format, args)); + } + + void fine(String format, Object... args) { + this.fine(() -> String.format(format, args)); + } + + void config(String format, Object... args) { + this.config(() -> String.format(format, args)); + } + + void info(String format, Object... args) { + this.info(() -> String.format(format, args)); + } + + void warning(String format, Object... args) { + this.warning(() -> String.format(format, args)); + } + + void severe(String format, Object... args) { + this.severe(() -> String.format(format, args)); + } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java index 5f486f1e58..dcf31a7fff 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java @@ -507,9 +507,7 @@ private static GoogleCredentials getGoogleUserAccountCredentials( return getCredentialsFromCode(userAuthorizer, code, callerClassName); } catch (IOException | URISyntaxException ex) { LOG.severe( - String.format( - "Failed to establish connection using User Account authentication: %s", - ex.getMessage())); + "Failed to establish connection using User Account authentication: %s", ex.getMessage()); throw new BigQueryJdbcRuntimeException(ex); } } @@ -594,9 +592,8 @@ private static GoogleCredentials getApplicationDefaultCredentials(String callerC principal = "external account"; } LOG.info( - String.format( - "Connection established. Auth Method: Application Default Credentials, Principal: %s.", - principal)); + "Connection established. Auth Method: Application Default Credentials, Principal: %s.", + principal); return credentials; } catch (IOException exception) { // TODO throw exception diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index fccb5703d1..50d0d33bb7 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -621,8 +621,7 @@ static String appendPropertiesToURL(String url, String callerClassName, Properti StringBuilder urlBuilder = new StringBuilder(url); for (Entry entry : properties.entrySet()) { if (entry.getValue() != null && !"".equals(entry.getValue())) { - LOG.info( - String.format("Appending %s with value %s to URL", entry.getKey(), entry.getValue())); + LOG.finest("Appending %s with value %s to URL", entry.getKey(), entry.getValue()); urlBuilder.append(";").append(entry.getKey()).append("=").append(entry.getValue()); } } @@ -727,9 +726,8 @@ static Integer parseIntProperty( return Integer.parseInt(parsedValue); } catch (NumberFormatException e) { LOG.severe( - String.format( - "Invalid integer value '%s' for property '%s'. Please provide a valid integer.", - parsedValue, propertyName)); + "Invalid integer value '%s' for property '%s'. Please provide a valid integer.", + parsedValue, propertyName); throw new IllegalArgumentException( String.format("Invalid integer value for property '%s': %s", propertyName, parsedValue), e); @@ -779,9 +777,7 @@ public static Level parseLogLevel(String logLevelString) { return Level.SEVERE; case 0: default: - LOG.info( - String.format( - "%s value not provided, defaulting to %s.", LOG_LEVEL_PROPERTY_NAME, Level.OFF)); + LOG.info("%s value not provided, defaulting to %s.", LOG_LEVEL_PROPERTY_NAME, Level.OFF); return Level.OFF; } } @@ -819,9 +815,8 @@ public static boolean parseJobCreationMode(String url, String callerClassName) { if (jobCreationMode == null) { LOG.fine( - String.format( - "%s value not provided, defaulting to %s. Caller: %s", - JOB_CREATION_MODE_PROPERTY_NAME, DEFAULT_JOB_CREATION_MODE, callerClassName)); + "%s value not provided, defaulting to %s. Caller: %s", + JOB_CREATION_MODE_PROPERTY_NAME, DEFAULT_JOB_CREATION_MODE, callerClassName); // Default Job creation mode is JOB_CREATION_OPTIONAL(2) // which translates to options.setQueryPreviewEnabled(true) return true; @@ -918,7 +913,7 @@ private static Map parsePropertiesMap( LOG.finest("++enter++\t" + callerClassName); String propertiesString = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); if (propertiesString == null || propertiesString.isEmpty()) { - LOG.fine(String.format("Unable to parse property name: %s from url: %s", propertyName, url)); + LOG.fine("Unable to parse property name: %s from url: %s", propertyName, url); return null; } Map propertiesMap = new HashMap<>(); @@ -930,9 +925,8 @@ private static Map parsePropertiesMap( propertiesMap.put(parts[0], parts[1]); } else { LOG.warning( - String.format( - "Invalid KeyValue pair: %s found in url: %s for property name: %s", - keyValuePair, url, propertyName)); + "Invalid KeyValue pair: %s found in url: %s for property name: %s", + keyValuePair, url, propertyName); } } return propertiesMap; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java index f9d7b11538..3773b99aa7 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java @@ -263,7 +263,7 @@ private FieldValue getObjectInternal(int columnIndex) throws SQLException { @Override public void close() { - LOG.fine(String.format("Closing BigqueryJsonResultSet %s.", this)); + LOG.fine("Closing BigqueryJsonResultSet %s.", this); this.isClosed = true; if (ownedThreads != null) { for (Thread ownedThread : ownedThreads) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java index 9644dd581d..5dbf731a0f 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryParameterHandler.java @@ -59,10 +59,9 @@ QueryJobConfiguration.Builder configureParameters( Object parameterValue = getParameter(i); StandardSQLTypeName sqlType = getSqlType(i); - LOG.info( - String.format( - "Parameter %s of type %s at index %s added to QueryJobConfiguration", - parameterValue, sqlType, i)); + LOG.finest( + "Parameter %s of type %s at index %s added to QueryJobConfiguration", + parameterValue, sqlType, i); jobConfigurationBuilder.addPositionalParameter( QueryParameterValue.of(parameterValue, sqlType)); } @@ -77,7 +76,7 @@ QueryJobConfiguration.Builder configureParameters( void setParameter(int parameterIndex, Object value, Class type) throws BigQueryJdbcSqlFeatureNotSupportedException { LOG.finest("++enter++"); - LOG.finest(String.format("setParameter called by : %s", type.getName())); + LOG.finest("setParameter called by : %s", type.getName()); checkValidIndex(parameterIndex); int arrayIndex = parameterIndex - 1; @@ -99,7 +98,7 @@ void setParameter(int parameterIndex, Object value, Class type) parameter.setParamType(BigQueryStatementParameterType.UNSPECIFIED); parameter.setScale(-1); - LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + LOG.finest("Parameter set { %s }", parameter.toString()); } private void checkValidIndex(int parameterIndex) { @@ -150,7 +149,7 @@ void setParameter( int scale) throws BigQueryJdbcSqlFeatureNotSupportedException { LOG.finest("++enter++"); - LOG.finest(String.format("setParameter called by : %s", type.getName())); + LOG.finest("setParameter called by : %s", type.getName()); if (paramName == null || paramName.isEmpty()) { throw new IllegalArgumentException("paramName cannot be null or empty"); } @@ -175,7 +174,7 @@ void setParameter( if (parameter.getIndex() == -1) { parametersList.add(parameter); } - LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + LOG.finest("Parameter set { %s }", parameter.toString()); } // set parameter by index and type @@ -187,7 +186,7 @@ void setParameter( int scale) throws BigQueryJdbcSqlFeatureNotSupportedException { LOG.finest("++enter++"); - LOG.finest(String.format("setParameter called by : %s", type.getName())); + LOG.finest("setParameter called by : %s", type.getName()); checkValidIndex(parameterIndex); int arrayIndex = parameterIndex - 1; if (parameterIndex >= this.highestIndex || this.parametersList.get(arrayIndex) == null) { @@ -208,7 +207,7 @@ void setParameter( parameter.setParamType(paramType); parameter.setScale(scale); - LOG.finest(String.format("Parameter set { %s }", parameter.toString())); + LOG.finest("Parameter set { %s }", parameter.toString()); } // Get Parameter by name diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java index ebb07dc11f..0bc012954f 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java @@ -134,8 +134,7 @@ public synchronized void fireConnectionError(SQLException e) { for (ConnectionEventListener listener : listeners) { listener.connectionErrorOccurred(event); } - LOG.finest( - String.format("Connection handle removed from the pool due to error: %s", e.getMessage())); + LOG.finest("Connection handle removed from the pool due to error: %s", e.getMessage()); // Listners no longer need to listen for this connection since it has been removed from the // pool. for (ConnectionEventListener listener : listeners) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java index 2410f6a58a..abead84b7b 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPreparedStatement.java @@ -404,9 +404,8 @@ private void setInsertMetadata(QueryStatistics statistics) throws SQLException { this.insertTableName = TableName.of(tableID.getProject(), tableID.getDataset(), tableID.getTable()); LOG.finest( - String.format( - "this.insertTableName : %s, this.insertSchema : %s", - this.insertTableName, this.insertSchema.toString())); + "this.insertTableName : %s, this.insertSchema : %s", + this.insertTableName, this.insertSchema.toString()); } QueryJobConfiguration getWriteBatchJobConfiguration( @@ -433,9 +432,8 @@ QueryJobConfiguration getStandardBatchJobConfiguration(String query) throws SQLE Object parameterValue = parameter.getValue(); StandardSQLTypeName sqlType = parameter.getSqlType(); LOG.finest( - String.format( - "Parameter %s of type %s at index %s added to QueryJobConfiguration", - parameterValue, sqlType, index++)); + "Parameter %s of type %s at index %s added to QueryJobConfiguration", + parameterValue, sqlType, index++); jobConfiguration.addPositionalParameter(QueryParameterValue.of(parameterValue, sqlType)); } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index 0da0868880..3fb2c2d589 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -325,9 +325,8 @@ SqlType getQueryType(QueryJobConfiguration jobConfiguration, StatementType state SqlType sqlType = BigQuerySqlTypeConverter.getSqlTypeFromStatementType(statementType); LOG.fine( - String.format( - "Query: %s, Statement Type: %s, SQL Type: %s", - jobConfiguration.getQuery(), statementType, sqlType)); + "Query: %s, Statement Type: %s, SQL Type: %s", + jobConfiguration.getQuery(), statementType, sqlType); return sqlType; } @@ -359,7 +358,7 @@ QueryStatistics getQueryStatistics(QueryJobConfiguration queryJobConfiguration) */ @Override public void close() throws SQLException { - LOG.fine(String.format("Closing Statement %s.", this)); + LOG.fine("Closing Statement %s.", this); if (isClosed()) { return; } @@ -369,7 +368,7 @@ public void close() throws SQLException { cancel(); // This attempts to cancel jobs and calls closeStatementResources() cancelSucceeded = true; } catch (SQLException e) { - LOG.warning(String.format("Failed to cancel statement during close().", e)); + LOG.warning("Failed to cancel statement during close().", e); } finally { if (!cancelSucceeded) { closeStatementResources(); @@ -425,7 +424,7 @@ public void setQueryTimeout(int seconds) { */ @Override public void cancel() throws SQLException { - LOG.finest(String.format("Statement %s cancelled", this)); + LOG.finest("Statement %s cancelled", this); synchronized (cancelLock) { this.isCanceled = true; for (JobId jobId : this.jobIds) { @@ -855,9 +854,8 @@ Thread populateArrowBufferedQueue( /** Executes SQL query using either fast query path or read API */ void processQueryResponse(String query, TableResult results) throws SQLException { LOG.finest( - String.format( - "API call completed{Query=%s, Parent Job ID=%s, Total rows=%s} ", - query, results.getJobId(), results.getTotalRows())); + "API call completed{Query=%s, Parent Job ID=%s, Total rows=%s} ", + query, results.getJobId(), results.getTotalRows()); JobId currentJobId = results.getJobId(); if (currentJobId == null) { LOG.fine("Standard API with Stateless query used."); @@ -905,7 +903,7 @@ private boolean meetsReadRatio(TableResult results) { BigQueryJsonResultSet processJsonResultSet(TableResult results) { String jobIdOrQueryId = results.getJobId() == null ? results.getQueryId() : results.getJobId().getJob(); - LOG.info(String.format("BigQuery Job %s completed. Fetching results.", jobIdOrQueryId)); + LOG.info("BigQuery Job %s completed. Fetching results.", jobIdOrQueryId); List threadList = new ArrayList(); Schema schema = results.getSchema(); @@ -1024,10 +1022,9 @@ Thread runNextPageTaskAsync( // thread rpcResponseQueue.put(Tuple.of(results, true)); LOG.fine( - String.format( - "Fetched %d results from the server in %d ms.", - querySettings.getMaxResultPerPage(), - (int) ((System.nanoTime() - startTime) / 1000000))); + "Fetched %d results from the server in %d ms.", + querySettings.getMaxResultPerPage(), + (int) ((System.nanoTime() - startTime) / 1000000)); } // this will stop the parseDataTask as well when the pagination // completes @@ -1100,9 +1097,8 @@ Thread parseAndPopulateRpcDataAsync( } } LOG.fine( - String.format( - "Processed %d results in %d ms.", - results, (int) ((System.nanoTime() - startTime) / 1000000))); + "Processed %d results in %d ms.", + results, (int) ((System.nanoTime() - startTime) / 1000000)); } try { // All the pages has been processed, put this marker @@ -1177,7 +1173,7 @@ private int getBufferSize() { /** Returns the destinationTable from jobId by calling `jobs.get` API */ TableId getDestinationTable(JobId jobId) { Job job = this.bigQuery.getJob(jobId); - LOG.finest(String.format("Destination Table retrieved from %s", job.getJobId())); + LOG.finest("Destination Table retrieved from %s", job.getJobId()); return ((QueryJobConfiguration) job.getConfiguration()).getDestinationTable(); } @@ -1230,7 +1226,7 @@ QueryJobConfiguration.Builder getJobConfig(String query) { private void checkIfDatasetExistElseCreate(String datasetName) { Dataset dataset = bigQuery.getDataset(DatasetId.of(datasetName)); if (dataset == null) { - LOG.info(String.format("Creating a hidden dataset: %s ", datasetName)); + LOG.info("Creating a hidden dataset: %s ", datasetName); DatasetInfo datasetInfo = DatasetInfo.newBuilder(datasetName) .setDefaultTableLifetime(this.querySettings.getDestinationDatasetExpirationTime()) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java index a5aa7a73a5..bba57d7311 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryThreadFactory.java @@ -38,7 +38,7 @@ public BigQueryThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(r, threadPrefix + (++threadSerialNum)); // non thread safe increment t.setDaemon(true); - LOG.finest(String.format("New thread %s created.", t.getName())); + LOG.finest("New thread %s created.", t.getName()); return t; } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java index d156c2d662..42640ddf28 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryTypeCoercer.java @@ -104,7 +104,7 @@ T coerceTo(Class targetClass, Object value) { return targetClass.cast(value); } BigQueryCoercion coercion = findCoercion(sourceClass, targetClass); - LOG.finest(() -> String.format("%s coercion for %s", coercion, value)); + LOG.finest("%s coercion for %s", coercion, value); // Value is null case & no explicit coercion if (sourceClass == Void.class && coercion == null) { return null; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java index c0f0820438..9f3b210443 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionListener.java @@ -118,9 +118,7 @@ public void connectionErrorOccurred(ConnectionEvent event) { (event.getSQLException() != null) ? event.getSQLException().getMessage() : "Connection error occured"; - LOG.finest( - String.format( - "Removed pooled connection from connection pool due to error: %s", errorMessage)); + LOG.finest("Removed pooled connection from connection pool. Error: %s", errorMessage); } @Override From 0250a7147c1432162767b26b311c10bd3d765dd9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Feb 2026 01:44:03 +0000 Subject: [PATCH 2247/2268] chore(deps): update dependency com.google.cloud:sdk-platform-java-config to v3.56.1 (#4095) Co-authored-by: Jin Seop Kim --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 6ddac9eabe..926e029bc3 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.56.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.56.1 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index e7c342ded5..76f65a94cd 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 6f5a9fce30..5ab0ec78ba 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.1" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index a76d6686a3..04d8c55891 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index e7c342ded5..76f65a94cd 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 6f5a9fce30..5ab0ec78ba 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.1" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index a76d6686a3..04d8c55891 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.1" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 77135f0fb6..e62d2e5e9e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.56.0 + 3.56.1 diff --git a/pom.xml b/pom.xml index a3abc5b9e5..f31306478e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.56.0 + 3.56.1 From 01a3d5e570488748e1a0e72d080e6feec94debed Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 12 Feb 2026 02:15:04 +0000 Subject: [PATCH 2248/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.21.0 (#4101) Merge pull request #4101 from googleapis/java-bigquery --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f31306478e..16900ce5f4 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.20.0 + 3.21.0 pom import From fa95522c3f99c2cb71e55433ea18e1f05da6d368 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 11:41:10 -0500 Subject: [PATCH 2249/2268] chore(main): release 2.59.0 (#4090) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Jin Seop Kim --- CHANGELOG.md | 15 +++++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 8 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d08db0a6a8..54217cb577 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.59.0](https://github.com/googleapis/java-bigquery/compare/v2.58.0...v2.59.0) (2026-02-12) + + +### Features + +* **jdbc:** Add `HttpTransportOptions` timeout configuration ([#4089](https://github.com/googleapis/java-bigquery/issues/4089)) ([77e0c35](https://github.com/googleapis/java-bigquery/commit/77e0c350e7d8fb5d6491e5ed6f1edfd9fecc59c8)) +* **jdbc:** Add `RequestReason` connection property ([#4094](https://github.com/googleapis/java-bigquery/issues/4094)) ([6feeb50](https://github.com/googleapis/java-bigquery/commit/6feeb50bc1f071b01c4fcfc943db7a9439b44e1f)) +* **jdbc:** Enable gRPC Keep-Alive for Storage Read API ([#4093](https://github.com/googleapis/java-bigquery/issues/4093)) ([1239a68](https://github.com/googleapis/java-bigquery/commit/1239a68d5b07bfa1fe2bbb678540896623bd6049)) + + +### Bug Fixes + +* **jdbc:** Avoid String.format in log calls ([#4096](https://github.com/googleapis/java-bigquery/issues/4096)) ([ad438dc](https://github.com/googleapis/java-bigquery/commit/ad438dc626b69f3bddda47ccf6b7a97d9053c047)) +* **jdbc:** Return null for invalid URLs in `connect()` to comply with JDBC spec ([#4086](https://github.com/googleapis/java-bigquery/issues/4086)) ([0c030d0](https://github.com/googleapis/java-bigquery/commit/0c030d06fe43ee07d510c8f2532ecde7e9de3cde)) + ## [2.58.0](https://github.com/googleapis/java-bigquery/compare/v2.57.2...v2.58.0) (2026-01-26) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 13dab9b73a..d4434289d3 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.58.1-SNAPSHOT + 2.59.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index e62d2e5e9e..8d806740f9 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.58.1-SNAPSHOT + 2.59.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.58.1-SNAPSHOT + 2.59.0 diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index aa2823f350..06d488887f 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.2.1-SNAPSHOT + 0.3.0 jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -140,7 +140,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.58.1-SNAPSHOT + 2.59.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index b5ecad4d25..a74654d1a8 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.58.1-SNAPSHOT + 2.59.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.58.1-SNAPSHOT + 2.59.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 16900ce5f4..d4fe5ad732 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.58.1-SNAPSHOT + 2.59.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.58.1-SNAPSHOT + 2.59.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 4ec3ae6b9a..51d9f7a61f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.58.1-SNAPSHOT + 2.59.0 diff --git a/versions.txt b/versions.txt index 0facc566a0..5b9f5b36e2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.58.0:2.58.1-SNAPSHOT -google-cloud-bigquery-jdbc:0.2.0:0.2.1-SNAPSHOT +google-cloud-bigquery:2.59.0:2.59.0 +google-cloud-bigquery-jdbc:0.3.0:0.3.0 From 0489b89f47bea8120282d5b61bfb206011f09ed4 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 19 Feb 2026 11:11:28 -0500 Subject: [PATCH 2250/2268] chore: replace api-bigquery and yoshi-java with updated names (#4109) b/478003109 --- .github/CODEOWNERS | 4 ++-- .github/sync-repo-settings.yaml | 4 ++-- .repo-metadata.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 577a7c21ff..3c7c97eea0 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,8 +4,8 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -# The @googleapis/api-bigquery is the default owner for changes in this repo -* @googleapis/cloud-sdk-java-team @googleapis/api-bigquery +# The @googleapis/bigquery-team is the default owner for changes in this repo +* @googleapis/cloud-sdk-java-team @googleapis/bigquery-team # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/cloud-sdk-java-team @googleapis/java-samples-reviewers diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 8a7fa3e302..20a9c3308f 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -163,9 +163,9 @@ branchProtectionRules: - javadoc - unmanaged_dependency_check permissionRules: - - team: api-bigquery + - team: bigquery-team permission: admin - - team: yoshi-java + - team: cloud-sdk-java-team permission: push - team: yoshi-admins permission: admin diff --git a/.repo-metadata.json b/.repo-metadata.json index 278b4ea8e9..bb8ab745c1 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -10,7 +10,7 @@ "repo": "googleapis/java-bigquery", "repo_short": "java-bigquery", "distribution_name": "com.google.cloud:google-cloud-bigquery", - "codeowner_team": "@googleapis/api-bigquery", + "codeowner_team": "@googleapis/bigquery-team", "api_id": "bigquery.googleapis.com", "library_type": "GAPIC_MANUAL", "requires_billing": true, From 4e0b4099f6b690ac89f041eb0ff6e18439647e27 Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 20 Feb 2026 14:19:24 -0800 Subject: [PATCH 2251/2268] fix: improve getErrorDescFromResponse() performance (#4110) --- .../bigquery/BigQueryRetryAlgorithm.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java index 7b168c12d1..140f2c6eba 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryRetryAlgorithm.java @@ -25,8 +25,8 @@ import com.google.api.gax.retrying.TimedAttemptSettings; import com.google.api.gax.retrying.TimedRetryAlgorithm; import com.google.api.gax.retrying.TimedRetryAlgorithmWithContext; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; +import com.google.api.services.bigquery.model.ErrorProto; +import com.google.api.services.bigquery.model.Job; import java.time.Duration; import java.util.Iterator; import java.util.UUID; @@ -222,21 +222,11 @@ private String getErrorDescFromResponse(ResponseT previousResponse) { following logic based on response body of jobs.insert method, so far the only known case where a response with status code 200 may contain an error message */ - try { - JsonObject responseJson = - JsonParser.parseString(previousResponse.toString()).getAsJsonObject(); - if (responseJson.has("status") && responseJson.getAsJsonObject("status").has("errorResult")) { - return responseJson - .getAsJsonObject("status") - .getAsJsonObject("errorResult") - .get("message") - .toString(); - } else { - return null; - } - } catch (Exception e) { - // exceptions here implies no error message present in response, returning null - return null; + if (previousResponse instanceof Job) { + Job job = (Job) previousResponse; + ErrorProto error = job.getStatus() != null ? job.getStatus().getErrorResult() : null; + return error != null ? error.getMessage() : null; } + return null; } } From 776caa19d5a4f54f35984a7d39375dd751d272cf Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Sat, 21 Feb 2026 04:51:34 +0100 Subject: [PATCH 2252/2268] feat(jdbc): add retry mechanism for storage api (#4100) * feat(jdbc): add retry mechanism for Arrow result streams * chore: fix logging and address gemini review comments * chore: remove extra log * fix: retry for specific exceptions * chore: address gemini feedback * chore: address pr review feedback * refactor: retry connection for arrow and json * chore: add fix for silent truncation * chore: remove redundant exception thrown * chore: change log levels * chore: remove retry from json api * fix: add exceptions throwing to not swallow errors * chore: refactor try-catch blocks by using `Uninterruptibles` --- .../jdbc/BigQueryArrowBatchWrapper.java | 21 +- .../bigquery/jdbc/BigQueryArrowResultSet.java | 4 + .../jdbc/BigQueryFieldValueListWrapper.java | 18 +- .../bigquery/jdbc/BigQueryJsonResultSet.java | 3 + .../bigquery/jdbc/BigQueryStatement.java | 236 +++++++++++------- 5 files changed, 187 insertions(+), 95 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java index 4d322ad977..99781ff16b 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowBatchWrapper.java @@ -31,24 +31,35 @@ class BigQueryArrowBatchWrapper { // Marks the end of the stream for the ResultSet private final boolean isLast; + private final Exception exception; + private BigQueryArrowBatchWrapper( - ArrowRecordBatch currentArrowBatch, JsonStringArrayList nestedRecords, boolean isLast) { + ArrowRecordBatch currentArrowBatch, + JsonStringArrayList nestedRecords, + boolean isLast, + Exception exception) { this.currentArrowBatch = currentArrowBatch; this.nestedRecords = nestedRecords; this.isLast = isLast; + this.exception = exception; } static BigQueryArrowBatchWrapper of(ArrowRecordBatch currentArrowBatch, boolean... isLast) { LOG.finest("++enter++"); boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; - return new BigQueryArrowBatchWrapper(currentArrowBatch, null, isLastFlag); + return new BigQueryArrowBatchWrapper(currentArrowBatch, null, isLastFlag, null); } static BigQueryArrowBatchWrapper getNestedFieldValueListWrapper( JsonStringArrayList nestedRecords, boolean... isLast) { LOG.finest("++enter++"); boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; - return new BigQueryArrowBatchWrapper(null, nestedRecords, isLastFlag); + return new BigQueryArrowBatchWrapper(null, nestedRecords, isLastFlag, null); + } + + static BigQueryArrowBatchWrapper ofError(Exception exception) { + LOG.finest("++enter++"); + return new BigQueryArrowBatchWrapper(null, null, true, exception); } ArrowRecordBatch getCurrentArrowBatch() { @@ -65,4 +76,8 @@ boolean isLast() { LOG.finest("++enter++"); return this.isLast; } + + Exception getException() { + return this.exception; + } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java index aeea6783dd..1d7d89e3f1 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java @@ -24,6 +24,7 @@ import com.google.cloud.bigquery.Schema; import com.google.cloud.bigquery.StandardSQLTypeName; import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import com.google.cloud.bigquery.storage.v1.ArrowRecordBatch; import com.google.cloud.bigquery.storage.v1.ArrowSchema; import java.io.IOException; @@ -236,6 +237,9 @@ public boolean next() throws SQLException { /* Start of iteration or we have exhausted the current batch */ // Advance the cursor. Potentially blocking operation. BigQueryArrowBatchWrapper batchWrapper = this.buffer.take(); + if (batchWrapper.getException() != null) { + throw new BigQueryJdbcRuntimeException(batchWrapper.getException()); + } if (batchWrapper.isLast()) { /* Marks the end of the records */ if (this.vectorSchemaRoot != null) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java index 9d8b1b2f77..39740e0217 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryFieldValueListWrapper.java @@ -39,28 +39,36 @@ class BigQueryFieldValueListWrapper { // This flag marks the end of the stream for the ResultSet private boolean isLast = false; + private final Exception exception; static BigQueryFieldValueListWrapper of( FieldList fieldList, FieldValueList fieldValueList, boolean... isLast) { boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; - return new BigQueryFieldValueListWrapper(fieldList, fieldValueList, null, isLastFlag); + return new BigQueryFieldValueListWrapper(fieldList, fieldValueList, null, isLastFlag, null); } static BigQueryFieldValueListWrapper getNestedFieldValueListWrapper( FieldList fieldList, List arrayFieldValueList, boolean... isLast) { boolean isLastFlag = isLast != null && isLast.length == 1 && isLast[0]; - return new BigQueryFieldValueListWrapper(fieldList, null, arrayFieldValueList, isLastFlag); + return new BigQueryFieldValueListWrapper( + fieldList, null, arrayFieldValueList, isLastFlag, null); + } + + static BigQueryFieldValueListWrapper ofError(Exception exception) { + return new BigQueryFieldValueListWrapper(null, null, null, true, exception); } private BigQueryFieldValueListWrapper( FieldList fieldList, FieldValueList fieldValueList, List arrayFieldValueList, - boolean isLast) { + boolean isLast, + Exception exception) { this.fieldList = fieldList; this.fieldValueList = fieldValueList; this.arrayFieldValueList = arrayFieldValueList; this.isLast = isLast; + this.exception = exception; } public FieldList getFieldList() { @@ -78,4 +86,8 @@ public List getArrayFieldValueList() { public boolean isLast() { return this.isLast; } + + public Exception getException() { + return this.exception; + } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java index 3773b99aa7..da2ade028e 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJsonResultSet.java @@ -159,6 +159,9 @@ public boolean next() throws SQLException { try { // Advance the cursor,Potentially blocking operation this.cursor = this.buffer.take(); + if (this.cursor.getException() != null) { + throw new BigQueryJdbcRuntimeException(this.cursor.getException()); + } this.rowCnt++; // Check for end of stream if (this.cursor.isLast()) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java index 3fb2c2d589..ca579d1d0c 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java @@ -56,6 +56,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterators; +import com.google.common.util.concurrent.Uninterruptibles; import java.lang.ref.ReferenceQueue; import java.sql.Connection; import java.sql.ResultSet; @@ -94,6 +95,8 @@ public class BigQueryStatement extends BigQueryNoOpsStatement { private static final String DEFAULT_DATASET_NAME = "_google_jdbc"; private static final String DEFAULT_TABLE_NAME = "temp_table_"; private static final String JDBC_JOB_PREFIX = "google-jdbc-"; + private static final int MAX_RETRY_COUNT = 5; + private static final long RETRY_DELAY_MS = 2000L; protected ResultSet currentResultSet; protected long currentUpdateCount = -1; protected List jobIds = new ArrayList<>(); @@ -808,41 +811,74 @@ Thread populateArrowBufferedQueue( Runnable arrowStreamProcessor = () -> { + long rowsRead = 0; + int retryCount = 0; try { // Use the first stream to perform reading. String streamName = readSession.getStreams(0).getName(); - ReadRowsRequest readRowsRequest = - ReadRowsRequest.newBuilder().setReadStream(streamName).build(); - // Process each block of rows as they arrive and decode using our simple row reader. - com.google.api.gax.rpc.ServerStream stream = - bqReadClient.readRowsCallable().call(readRowsRequest); - for (ReadRowsResponse response : stream) { - if (Thread.currentThread().isInterrupted() - || queryTaskExecutor.isShutdown()) { // do not process and shutdown + while (true) { + try { + ReadRowsRequest readRowsRequest = + ReadRowsRequest.newBuilder() + .setReadStream(streamName) + .setOffset(rowsRead) + .build(); + + // Process each block of rows as they arrive and decode using our simple row reader. + com.google.api.gax.rpc.ServerStream stream = + bqReadClient.readRowsCallable().call(readRowsRequest); + for (ReadRowsResponse response : stream) { + if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { + break; + } + + ArrowRecordBatch currentBatch = response.getArrowRecordBatch(); + Uninterruptibles.putUninterruptibly( + arrowBatchWrapperBlockingQueue, BigQueryArrowBatchWrapper.of(currentBatch)); + rowsRead += response.getRowCount(); + } break; + } catch (com.google.api.gax.rpc.ApiException e) { + if (e.getStatusCode().getCode() + == com.google.api.gax.rpc.StatusCode.Code.NOT_FOUND) { + LOG.warning("Read session expired or not found: %s", e.getMessage()); + enqueueError(arrowBatchWrapperBlockingQueue, e); + break; + } + if (retryCount >= MAX_RETRY_COUNT) { + LOG.log( + Level.SEVERE, + "\n" + + Thread.currentThread().getName() + + " Interrupted @ arrowStreamProcessor, max retries exceeded", + e); + enqueueError(arrowBatchWrapperBlockingQueue, e); + break; + } + retryCount++; + LOG.warning( + "Connection interrupted during arrow stream read, retrying. attempt: %d", + retryCount); + Thread.sleep(RETRY_DELAY_MS); } - - ArrowRecordBatch currentBatch = response.getArrowRecordBatch(); - arrowBatchWrapperBlockingQueue.put(BigQueryArrowBatchWrapper.of(currentBatch)); } - } catch (RuntimeException | InterruptedException e) { + } catch (InterruptedException e) { LOG.log( Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted @ arrowStreamProcessor", e); + enqueueError(arrowBatchWrapperBlockingQueue, e); + Thread.currentThread().interrupt(); + } catch (Exception e) { + LOG.log( + Level.WARNING, + "\n" + Thread.currentThread().getName() + " Error @ arrowStreamProcessor", + e); + enqueueError(arrowBatchWrapperBlockingQueue, e); } finally { // logic needed for graceful shutdown - // marking end of stream - try { - arrowBatchWrapperBlockingQueue.put( - BigQueryArrowBatchWrapper.of(null, true)); // mark the end of the stream - } catch (InterruptedException e) { - LOG.log( - Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted @ markLast", - e); - } + enqueueEndOfStream(arrowBatchWrapperBlockingQueue); } }; @@ -916,18 +952,21 @@ BigQueryJsonResultSet processJsonResultSet(TableResult results) { if (jobId != null) { // Thread to make rpc calls to fetch data from the server Thread nextPageWorker = - runNextPageTaskAsync(results, results.getNextPageToken(), jobId, rpcResponseQueue); + runNextPageTaskAsync( + results, + results.getNextPageToken(), + jobId, + rpcResponseQueue, + this.bigQueryFieldValueListWrapperBlockingQueue); threadList.add(nextPageWorker); } else { try { populateFirstPage(results, rpcResponseQueue); rpcResponseQueue.put(Tuple.of(null, false)); } catch (InterruptedException e) { - LOG.log( - Level.WARNING, - "\n" - + Thread.currentThread().getName() - + " Interrupted @ processJsonQueryResponseResults"); + LOG.warning( + "%s Interrupted @ processJsonQueryResponseResults: %s", + Thread.currentThread().getName(), e.getMessage()); } } @@ -964,9 +1003,9 @@ void populateFirstPage( // this is the first page which we have received. rpcResponseQueue.put(Tuple.of(result, true)); } catch (InterruptedException e) { - LOG.log( - Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted @ populateFirstPage"); + LOG.warning( + "%s Interrupted @ populateFirstPage: %s", + Thread.currentThread().getName(), e.getMessage()); } } @@ -983,7 +1022,8 @@ Thread runNextPageTaskAsync( TableResult result, String firstPageToken, JobId jobId, - BlockingQueue> rpcResponseQueue) { + BlockingQueue> rpcResponseQueue, + BlockingQueue bigQueryFieldValueListWrapperBlockingQueue) { LOG.finest("++enter++"); // parse and put the first page in the pageCache before the other pages are parsed from the RPC // calls @@ -992,45 +1032,46 @@ Thread runNextPageTaskAsync( // This thread makes the RPC calls and paginates Runnable nextPageTask = () -> { - // results.getPageToken(); - String pageToken = firstPageToken; + String currentPageToken = firstPageToken; + TableResult currentResults = result; TableId destinationTable = null; if (firstPageToken != null) { destinationTable = getDestinationTable(jobId); } + try { - // paginate for non null token - while (pageToken != null) { + while (currentPageToken != null) { // do not process further pages and shutdown if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { - LOG.log( - Level.WARNING, - "\n" - + Thread.currentThread().getName() - + " Interrupted @ runNextPageTaskAsync"); + LOG.warning( + "%s Interrupted @ runNextPageTaskAsync", Thread.currentThread().getName()); break; } + long startTime = System.nanoTime(); - TableResult results = + currentResults = this.bigQuery.listTableData( destinationTable, TableDataListOption.pageSize(querySettings.getMaxResultPerPage()), - TableDataListOption.pageToken(pageToken)); + TableDataListOption.pageToken(currentPageToken)); - pageToken = results.getNextPageToken(); + currentPageToken = currentResults.getNextPageToken(); // this will be parsed asynchronously without blocking the current // thread - rpcResponseQueue.put(Tuple.of(results, true)); + Uninterruptibles.putUninterruptibly(rpcResponseQueue, Tuple.of(currentResults, true)); LOG.fine( "Fetched %d results from the server in %d ms.", querySettings.getMaxResultPerPage(), (int) ((System.nanoTime() - startTime) / 1000000)); } + } catch (Exception ex) { + Uninterruptibles.putUninterruptibly( + bigQueryFieldValueListWrapperBlockingQueue, + BigQueryFieldValueListWrapper.ofError(new BigQueryJdbcRuntimeException(ex))); + } finally { // this will stop the parseDataTask as well when the pagination // completes - rpcResponseQueue.put(Tuple.of(null, false)); - } catch (Exception ex) { - throw new BigQueryJdbcRuntimeException(ex); + Uninterruptibles.putUninterruptibly(rpcResponseQueue, Tuple.of(null, false)); } // We cannot do queryTaskExecutor.shutdownNow() here as populate buffer method may not // have finished processing the records and even that will be interrupted @@ -1054,61 +1095,60 @@ Thread parseAndPopulateRpcDataAsync( Runnable populateBufferRunnable = () -> { // producer thread populating the buffer - Iterable fieldValueLists; - // as we have to process the first page - boolean hasRows = true; - while (hasRows) { - try { - Tuple nextPageTuple = rpcResponseQueue.take(); - if (nextPageTuple.x() != null) { - fieldValueLists = nextPageTuple.x().getValues(); - } else { - fieldValueLists = null; + try { + Iterable fieldValueLists; + // as we have to process the first page + boolean hasRows = true; + while (hasRows) { + try { + Tuple nextPageTuple = rpcResponseQueue.take(); + if (nextPageTuple.x() != null) { + fieldValueLists = nextPageTuple.x().getValues(); + } else { + fieldValueLists = null; + } + hasRows = nextPageTuple.y(); + + } catch (InterruptedException e) { + LOG.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); + // Thread might get interrupted while calling the Cancel method, which is + // expected, so logging this instead of throwing the exception back + break; } - hasRows = nextPageTuple.y(); - } catch (InterruptedException e) { - LOG.log(Level.WARNING, "\n" + Thread.currentThread().getName() + " Interrupted", e); - // Thread might get interrupted while calling the Cancel method, which is - // expected, so logging this instead of throwing the exception back - break; - } + if (Thread.currentThread().isInterrupted() + || queryTaskExecutor.isShutdown() + || fieldValueLists == null) { + // do not process further pages and shutdown (outerloop) + break; + } - if (Thread.currentThread().isInterrupted() - || queryTaskExecutor.isShutdown() - || fieldValueLists == null) { - // do not process further pages and shutdown (outerloop) - break; - } + long startTime = System.nanoTime(); + long results = 0; + for (FieldValueList fieldValueList : fieldValueLists) { - long startTime = System.nanoTime(); - long results = 0; - for (FieldValueList fieldValueList : fieldValueLists) { - try { if (Thread.currentThread().isInterrupted() || queryTaskExecutor.isShutdown()) { // do not process further pages and shutdown (inner loop) break; } - bigQueryFieldValueListWrapperBlockingQueue.put( + Uninterruptibles.putUninterruptibly( + bigQueryFieldValueListWrapperBlockingQueue, BigQueryFieldValueListWrapper.of(schema.getFields(), fieldValueList)); results += 1; - } catch (InterruptedException ex) { - throw new BigQueryJdbcRuntimeException(ex); } + LOG.fine( + "Processed %d results in %d ms.", + results, (int) ((System.nanoTime() - startTime) / 1000000)); } - LOG.fine( - "Processed %d results in %d ms.", - results, (int) ((System.nanoTime() - startTime) / 1000000)); - } - try { - // All the pages has been processed, put this marker - bigQueryFieldValueListWrapperBlockingQueue.put( - BigQueryFieldValueListWrapper.of(null, null, true)); - } catch (InterruptedException e) { + + } catch (Exception ex) { LOG.log( Level.WARNING, - "\n" + Thread.currentThread().getName() + " Interrupted @ populateBufferAsync", - e); + "\n" + Thread.currentThread().getName() + " Error @ populateBufferAsync", + ex); + enqueueBufferError(bigQueryFieldValueListWrapperBlockingQueue, ex); + } finally { + enqueueBufferEndOfStream(bigQueryFieldValueListWrapperBlockingQueue); } }; @@ -1515,4 +1555,22 @@ enum QueryDialectType { SQL, BIG_QUERY } + + private void enqueueError(BlockingQueue queue, Exception e) { + Uninterruptibles.putUninterruptibly( + queue, BigQueryArrowBatchWrapper.ofError(new BigQueryJdbcRuntimeException(e))); + } + + private void enqueueEndOfStream(BlockingQueue queue) { + Uninterruptibles.putUninterruptibly(queue, BigQueryArrowBatchWrapper.of(null, true)); + } + + private void enqueueBufferError(BlockingQueue queue, Exception e) { + Uninterruptibles.putUninterruptibly( + queue, BigQueryFieldValueListWrapper.ofError(new BigQueryJdbcRuntimeException(e))); + } + + private void enqueueBufferEndOfStream(BlockingQueue queue) { + Uninterruptibles.putUninterruptibly(queue, BigQueryFieldValueListWrapper.of(null, null, true)); + } } From e1d22aa3c007f0584414bf0af325c74c0e251975 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Tue, 24 Feb 2026 11:31:48 -0500 Subject: [PATCH 2253/2268] chore: replace old partner teams with new ones (Wave 2) (#4113) * chore: replace old partner teams with new ones (Wave 2) b/478003109 --- .github/CODEOWNERS | 2 +- .github/sync-repo-settings.yaml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3c7c97eea0..e3f21432d4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,4 +14,4 @@ samples/**/*.java @googleapis/cloud-sdk-java-team @googleapis/java-samples samples/snippets/generated/ @googleapis/cloud-sdk-java-team # JDBC Driver -google-cloud-bigquery-jdbc/** @googleapis/bq-developer-tools @googleapis/cloud-sdk-java-team +google-cloud-bigquery-jdbc/** @googleapis/bigquery-developer-tools-team @googleapis/cloud-sdk-java-team diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 20a9c3308f..3649bc8ac2 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -164,10 +164,6 @@ branchProtectionRules: - unmanaged_dependency_check permissionRules: - team: bigquery-team - permission: admin + permission: push - team: cloud-sdk-java-team permission: push - - team: yoshi-admins - permission: admin - - team: yoshi-java-admins - permission: admin From 895f7eff23e1b00649802823a57d1ff1cd5cd2ba Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:44:04 -0800 Subject: [PATCH 2254/2268] chore(main): release 2.59.1-SNAPSHOT (#4104) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d4434289d3..351050b355 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.59.0 + 2.59.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 8d806740f9..6e7afbe700 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.59.0 + 2.59.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.59.0 + 2.59.1-SNAPSHOT diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 06d488887f..0a905a4a22 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.3.0 + 0.3.1-SNAPSHOT jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -140,7 +140,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.59.0 + 2.59.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a74654d1a8..4f46c88fe5 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.59.0 + 2.59.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.59.0 + 2.59.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index d4fe5ad732..8303074cb8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.59.0 + 2.59.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.59.0 + 2.59.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 51d9f7a61f..3dd54fec02 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.59.0 + 2.59.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 5b9f5b36e2..acfa56a8e3 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.59.0:2.59.0 -google-cloud-bigquery-jdbc:0.3.0:0.3.0 +google-cloud-bigquery:2.59.0:2.59.1-SNAPSHOT +google-cloud-bigquery-jdbc:0.3.0:0.3.1-SNAPSHOT From 0b0c1ceb309a19d51f385264f2d4722b8b6339d7 Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Wed, 25 Feb 2026 16:35:12 +0100 Subject: [PATCH 2255/2268] feat(jdbc): enforce strict JDBC URL parsing and sync `DataSource` properties (#4107) * feat(jdbc): enforce strict JDBC URL parsing and validation * feat(jdbc): sync DataSource properties with BigQueryConnection * test: update tests for strict parsing * chore: fix failing tests * chore: throw original `BigQueryJdbcRuntimeException` * chore: add url encoding to appendProperties to prevent injection vulnerabilites * chore: refactor `parseAndRemovePartnerTokenProperty()` * fix: use "ProjectId" instead of "Project_Id" in tests * chore: add error message sanitization * chore: address pr feedback * fix: regex for partnerToken * chore: use `Joiner` and copy of map when setting properties --- .../cloud/bigquery/jdbc/BigQueryDriver.java | 6 + .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 152 +++++++++++++--- .../cloud/bigquery/jdbc/DataSource.java | 162 +++++++++++++++++- .../bigquery/jdbc/BigQueryDriverTest.java | 16 ++ .../bigquery/jdbc/BigQueryJdbcBaseTest.java | 2 +- .../jdbc/BigQueryJdbcUrlUtilityTest.java | 122 ++++++++++--- 6 files changed, 415 insertions(+), 45 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java index 11199c372b..68b00cb6c3 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -17,6 +17,7 @@ package com.google.cloud.bigquery.jdbc; import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import io.grpc.LoadBalancerRegistry; import io.grpc.internal.PickFirstLoadBalancerProvider; import java.io.IOException; @@ -123,6 +124,11 @@ public Connection connect(String url, Properties info) throws SQLException { // strip 'jdbc:' from the URL, add any extra properties String connectionUri = BigQueryJdbcUrlUtility.appendPropertiesToURL(url.substring(5), this.toString(), info); + try { + BigQueryJdbcUrlUtility.parseUrl(connectionUri); + } catch (BigQueryJdbcRuntimeException e) { + throw new BigQueryJdbcException(e.getMessage(), e); + } // LogLevel String logLevelStr = diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index 50d0d33bb7..5ffa6c254f 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -19,10 +19,16 @@ import com.google.api.client.util.escape.CharEscapers; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.common.collect.ImmutableList; +import com.google.common.net.UrlEscapers; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -39,6 +45,14 @@ */ final class BigQueryJdbcUrlUtility { + private static final Map> PARSE_CACHE = + Collections.synchronizedMap( + new LinkedHashMap>(50, 0.75f, true) { + protected boolean removeEldestEntry(Map.Entry> eldest) { + return size() > 50; // bound cache size + } + }); + // TODO: Add all Connection options static final String ALLOW_LARGE_RESULTS_PROPERTY_NAME = "AllowLargeResults"; static final String LARGE_RESULTS_TABLE_PROPERTY_NAME = "LargeResultTable"; @@ -122,6 +136,10 @@ final class BigQueryJdbcUrlUtility { static final String BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME = "BYOID_SubjectTokenType"; static final String BYOID_TOKEN_URI_PROPERTY_NAME = "BYOID_TokenUri"; static final String PARTNER_TOKEN_PROPERTY_NAME = "PartnerToken"; + private static final Pattern PARTNER_TOKEN_PATTERN = + Pattern.compile( + "(?:^|(?<=;))" + PARTNER_TOKEN_PROPERTY_NAME + "=\\s*((?:\\([^)]*\\)|[^;])*?)(?=(?:;|$))", + Pattern.CASE_INSENSITIVE); static final String METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME = "MetaDataFetchThreadCount"; static final int DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE = 32; static final String RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME = "Timeout"; @@ -591,6 +609,37 @@ final class BigQueryJdbcUrlUtility { + " header.") .build()))); + private static final List NETWORK_PROPERTIES = + ImmutableList.of( + PARTNER_TOKEN_PROPERTY_NAME, + ENDPOINT_OVERRIDES_PROPERTY_NAME, + PRIVATE_SERVICE_CONNECT_PROPERTY_NAME); + + private static final Map PROPERTY_NAME_MAP; + + static { + Map map = new HashMap<>(); + for (BigQueryConnectionProperty p : VALID_PROPERTIES) { + map.put(p.getName().toUpperCase(), p.getName()); + } + for (BigQueryConnectionProperty p : AUTH_PROPERTIES) { + map.put(p.getName().toUpperCase(), p.getName()); + } + for (BigQueryConnectionProperty p : PROXY_PROPERTIES) { + map.put(p.getName().toUpperCase(), p.getName()); + } + for (String p : OVERRIDE_PROPERTIES) { + map.put(p.toUpperCase(), p); + } + for (String p : BYOID_PROPERTIES) { + map.put(p.toUpperCase(), p); + } + for (String p : NETWORK_PROPERTIES) { + map.put(p.toUpperCase(), p); + } + PROPERTY_NAME_MAP = Collections.unmodifiableMap(map); + } + private BigQueryJdbcUrlUtility() {} /** @@ -601,12 +650,69 @@ private BigQueryJdbcUrlUtility() {} * @return The String value of the property, or the default value if the property is not found. */ static String parseUriProperty(String uri, String property) { - Pattern pattern = Pattern.compile(String.format("(?is)(?:;|\\?)%s=(.*?)(?:;|$)", property)); - Matcher matcher = pattern.matcher(uri); - if (matcher.find() && matcher.groupCount() == 1) { - return CharEscapers.decodeUriPath(matcher.group(1)); + Map map = parseUrl(uri); + if (PROPERTY_NAME_MAP.containsKey(property.toUpperCase())) { + return map.get(PROPERTY_NAME_MAP.get(property.toUpperCase())); } - return null; + return map.get(property); + } + + /** + * Parses the URL into a map of key-value pairs, validating that all keys are known properties. + * + * @param url The URL to parse. + * @return A map of property names to values. + * @throws BigQueryJdbcRuntimeException if an unknown property is found or the URL is malformed. + */ + static Map parseUrl(String url) { + return PARSE_CACHE.computeIfAbsent(url, BigQueryJdbcUrlUtility::parseUrlInternal); + } + + private static Map parseUrlInternal(String url) { + Map map = new HashMap<>(); + if (url == null) { + return map; + } + + String[] urlParts = url.split(";", 2); + if (urlParts.length < 2) { + return map; + } + + String urlToParse = urlParts[1]; + + // Parse PartnerToken separately as it contains ';' + Matcher matcher = PARTNER_TOKEN_PATTERN.matcher(urlToParse); + if (matcher.find()) { + String rawToken = matcher.group(1).trim(); + String token = + (rawToken.startsWith("(") && rawToken.endsWith(")")) + ? rawToken.substring(1, rawToken.length() - 1).trim() + : rawToken; + + if (token.toUpperCase().startsWith("GPN:")) { + map.put(PARTNER_TOKEN_PROPERTY_NAME, " (" + token + ")"); + } + urlToParse = matcher.replaceFirst(""); + } + + String[] parts = urlToParse.split(";"); + for (String part : parts) { + if (part.trim().isEmpty()) { + continue; + } + String[] kv = part.split("=", 2); + String key = kv[0].trim().toUpperCase(); + if (kv.length != 2 || !PROPERTY_NAME_MAP.containsKey(key)) { + String ref = (kv.length == 2) ? key : part; + String safeRef = ref.length() > 32 ? ref.substring(0, 32) + "..." : ref; + throw new BigQueryJdbcRuntimeException( + String.format("Wrong value or unknown setting: %s", safeRef)); + } + + map.put(PROPERTY_NAME_MAP.get(key), CharEscapers.decodeUriPath(kv[1])); + } + return Collections.unmodifiableMap(map); } /** @@ -622,7 +728,11 @@ static String appendPropertiesToURL(String url, String callerClassName, Properti for (Entry entry : properties.entrySet()) { if (entry.getValue() != null && !"".equals(entry.getValue())) { LOG.finest("Appending %s with value %s to URL", entry.getKey(), entry.getValue()); - urlBuilder.append(";").append(entry.getKey()).append("=").append(entry.getValue()); + String encodedValue = + UrlEscapers.urlFormParameterEscaper() + .escape((String) entry.getValue()) + .replace("+", "%20"); + urlBuilder.append(";").append(entry.getKey()).append("=").append(encodedValue); } } return urlBuilder.toString(); @@ -697,22 +807,17 @@ public static String parsePartnerTokenProperty(String url, String callerClassNam LOG.finest("++enter++\t" + callerClassName); // This property is expected to be set by partners only. For more details on exact format // supported, refer b/396086960 - String regex = - PARTNER_TOKEN_PROPERTY_NAME + "=\\s*\\(\\s*(GPN:[^;]*?)\\s*(?:;\\s*([^)]*?))?\\s*\\)"; - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(url); - + Matcher matcher = PARTNER_TOKEN_PATTERN.matcher(url); if (matcher.find()) { - String gpnPart = matcher.group(1); - String environmentPart = matcher.group(2); - StringBuilder partnerToken = new StringBuilder(" ("); - partnerToken.append(gpnPart); - if (environmentPart != null && !environmentPart.trim().isEmpty()) { - partnerToken.append("; "); - partnerToken.append(environmentPart); + String rawToken = matcher.group(1).trim(); + String token = + (rawToken.startsWith("(") && rawToken.endsWith(")")) + ? rawToken.substring(1, rawToken.length() - 1).trim() + : rawToken; + + if (token.toUpperCase().startsWith("GPN:")) { + return " (" + token + ")"; } - partnerToken.append(")"); - return partnerToken.toString(); } return null; } @@ -793,7 +898,12 @@ static Map parseOverrideProperties(String url, String callerClas Matcher matcher = pattern.matcher(url); String overridePropertiesString; if (matcher.find() && matcher.groupCount() >= 1) { - overridePropertiesString = matcher.group(2); + try { + overridePropertiesString = + URLDecoder.decode(matcher.group(2), StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new BigQueryJdbcRuntimeException(e); + } } else { return overrideProps; } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java index b1501890bd..6f4c9c5f6a 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java @@ -17,6 +17,8 @@ package com.google.cloud.bigquery.jdbc; import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableMap; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; @@ -78,6 +80,17 @@ public class DataSource implements javax.sql.DataSource { private Integer metadataFetchThreadCount; private String sslTrustStorePath; private String sslTrustStorePassword; + private Map labels; + private String requestReason; + private Integer timeout; + private Integer jobTimeout; + private Integer retryInitialDelay; + private Integer retryMaxDelay; + private Integer httpConnectTimeout; + private Integer httpReadTimeout; + private Long maximumBytesBilled; + private Integer swaActivationRowCount; + private Integer swaAppendRowCount; // Make sure the JDBC driver class is loaded. static { @@ -145,7 +158,7 @@ private Properties createProperties() { } if (this.queryProperties != null) { connectionProperties.setProperty( - BigQueryJdbcUrlUtility.QUERY_PROPERTIES_NAME, this.queryProperties.toString()); + BigQueryJdbcUrlUtility.QUERY_PROPERTIES_NAME, serializeMap(this.queryProperties)); } if (this.enableSession != null) { connectionProperties.setProperty( @@ -283,9 +296,66 @@ private Properties createProperties() { BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, String.valueOf(this.sslTrustStorePassword)); } + if (this.labels != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LABELS_PROPERTY_NAME, serializeMap(this.labels)); + } + if (this.requestReason != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, this.requestReason); + } + if (this.timeout != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME, String.valueOf(this.timeout)); + } + if (this.jobTimeout != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.JOB_TIMEOUT_PROPERTY_NAME, String.valueOf(this.jobTimeout)); + } + if (this.retryInitialDelay != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.RETRY_INITIAL_DELAY_PROPERTY_NAME, + String.valueOf(this.retryInitialDelay)); + } + if (this.retryMaxDelay != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.RETRY_MAX_DELAY_PROPERTY_NAME, String.valueOf(this.retryMaxDelay)); + } + if (this.httpConnectTimeout != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, + String.valueOf(this.httpConnectTimeout)); + } + if (this.httpReadTimeout != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, + String.valueOf(this.httpReadTimeout)); + } + if (this.maximumBytesBilled != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.MAX_BYTES_BILLED_PROPERTY_NAME, + String.valueOf(this.maximumBytesBilled)); + } + if (this.swaActivationRowCount != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME, + String.valueOf(this.swaActivationRowCount)); + } + if (this.swaAppendRowCount != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.SWA_APPEND_ROW_COUNT_PROPERTY_NAME, + String.valueOf(this.swaAppendRowCount)); + } return connectionProperties; } + private String serializeMap(Map map) { + if (map == null || map.isEmpty()) { + return ""; + } + return Joiner.on(",").withKeyValueSeparator("=").join(map); + } + @Override public Connection getConnection(String username, String password) throws SQLException { LOG.warning( @@ -376,7 +446,7 @@ public String getKmsKeyName() { } public void setQueryProperties(Map queryProperties) { - this.queryProperties = queryProperties; + this.queryProperties = queryProperties == null ? null : ImmutableMap.copyOf(queryProperties); } public Map getQueryProperties() { @@ -631,6 +701,94 @@ public void setSSLTrustStorePassword(String sslTrustStorePassword) { this.sslTrustStorePassword = sslTrustStorePassword; } + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels == null ? null : ImmutableMap.copyOf(labels); + } + + public String getRequestReason() { + return requestReason; + } + + public void setRequestReason(String requestReason) { + this.requestReason = requestReason; + } + + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public Integer getJobTimeout() { + return jobTimeout; + } + + public void setJobTimeout(Integer jobTimeout) { + this.jobTimeout = jobTimeout; + } + + public Integer getRetryInitialDelay() { + return retryInitialDelay; + } + + public void setRetryInitialDelay(Integer retryInitialDelay) { + this.retryInitialDelay = retryInitialDelay; + } + + public Integer getRetryMaxDelay() { + return retryMaxDelay; + } + + public void setRetryMaxDelay(Integer retryMaxDelay) { + this.retryMaxDelay = retryMaxDelay; + } + + public Integer getHttpConnectTimeout() { + return httpConnectTimeout; + } + + public void setHttpConnectTimeout(Integer httpConnectTimeout) { + this.httpConnectTimeout = httpConnectTimeout; + } + + public Integer getHttpReadTimeout() { + return httpReadTimeout; + } + + public void setHttpReadTimeout(Integer httpReadTimeout) { + this.httpReadTimeout = httpReadTimeout; + } + + public Long getMaximumBytesBilled() { + return maximumBytesBilled; + } + + public void setMaximumBytesBilled(Long maximumBytesBilled) { + this.maximumBytesBilled = maximumBytesBilled; + } + + public Integer getSwaActivationRowCount() { + return swaActivationRowCount; + } + + public void setSwaActivationRowCount(Integer swaActivationRowCount) { + this.swaActivationRowCount = swaActivationRowCount; + } + + public Integer getSwaAppendRowCount() { + return swaAppendRowCount; + } + + public void setSwaAppendRowCount(Integer swaAppendRowCount) { + this.swaAppendRowCount = swaAppendRowCount; + } + @Override public PrintWriter getLogWriter() { return null; diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java index 6a33c6144d..2d7664f5a0 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryDriverTest.java @@ -16,7 +16,10 @@ package com.google.cloud.bigquery.jdbc; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.fail; +import com.google.cloud.bigquery.exception.BigQueryJdbcException; +import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import java.sql.Connection; import java.sql.DriverPropertyInfo; import java.sql.SQLException; @@ -93,4 +96,17 @@ public void testGetParentLoggerReturnsLogger() { public void testJDBCCompliantReturnsFalse() { assertThat(bigQueryDriver.jdbcCompliant()).isFalse(); } + + @Test + public void testConnectWithInvalidUrlChainsException() { + try { + bigQueryDriver.connect( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;InvalidProperty=Value", + new Properties()); + fail("Expected SQLException"); + } catch (SQLException e) { + assertThat((Throwable) e).isInstanceOf(BigQueryJdbcException.class); + assertThat(e.getCause()).isInstanceOf(BigQueryJdbcRuntimeException.class); + } + } } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java index 616f3bab97..1ee627b8af 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcBaseTest.java @@ -51,7 +51,7 @@ protected static URIBuilder getBaseUri(int authType) { } protected static URIBuilder getBaseUri(int authType, String projectId) { - return getBaseUri(authType).append("PROJECT_ID", projectId); + return getBaseUri(authType).append("ProjectId", projectId); } protected static URIBuilder getUriOAuthServiceAccount() { diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java index b16d1a3983..830e515336 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -47,6 +47,30 @@ public void testParsePropertyWithNoDefault() { assertThat(result).isNull(); } + @Test + public void testParseUrlWithUnknownProperty_throwsException() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "UnknownProperty=SomeValue"; + + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseUriProperty(url, "ProjectId")); + } + + @Test + public void testParseUrlWithTypo_throwsException() { + String url = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;" + + "ProjeectId=TypoValue"; + + assertThrows( + BigQueryJdbcRuntimeException.class, + () -> BigQueryJdbcUrlUtility.parseUriProperty(url, "ProjectId")); + } + @Test public void testParsePropertyWithDefault() { String url = @@ -106,21 +130,36 @@ public void testConnectionPropertiesFromURI() { @Test public void testConnectionPropertiesFromURIMultiline() { String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;Multiline=value1\nvalue2\n;"; + "bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthPvtKey=value1\nvalue2\n;"; - assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "Multiline")) + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "OAuthPvtKey")) .isEqualTo("value1\nvalue2\n"); } @Test public void testConnectionPropertiesFromURIMultilineNoSemicolon() { String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;Multiline=value1\nvalue2"; + "bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthPvtKey=value1\nvalue2"; - assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "Multiline")) + assertThat(BigQueryJdbcUrlUtility.parseUriProperty(connection_uri, "OAuthPvtKey")) .isEqualTo("value1\nvalue2"); } + @Test + public void testParseUrl_longUnknownProperty_sanitized() { + String longKey = String.join("", Collections.nCopies(50, "a")); + String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + longKey + "=value"; + + BigQueryJdbcRuntimeException e = + assertThrows( + BigQueryJdbcRuntimeException.class, () -> BigQueryJdbcUrlUtility.parseUrl(url)); + + assertThat(e.getMessage()).contains("Wrong value or unknown setting: "); + assertThat(e.getMessage()).contains("..."); + assertThat(e.getMessage()).doesNotContain(longKey); + assertThat(e.getMessage().length()).isLessThan(100); + } + @Test public void testOverridePropertiesFromURICompatibility() { String connection_uri = @@ -436,7 +475,7 @@ public void testParsePartnerTokenProperty() { url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "PartnerToken= ( GPN: partner_name ; test_env ) ;"; - expected = " (GPN: partner_name; test_env)"; + expected = " (GPN: partner_name ; test_env)"; result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); assertThat(result).isEqualTo(expected); } @@ -641,19 +680,22 @@ public void testParseListenerPoolSizeInvalidLong() { public void testParseStringListProperty_NullOrEmpty() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;SomeProp="; + + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes="; List result = BigQueryJdbcUrlUtility.parseStringListProperty(url, "NonExistentProp", "TestClass"); assertEquals(Collections.emptyList(), result); - result = BigQueryJdbcUrlUtility.parseStringListProperty(url, "SomeProp", "TestClass"); + result = + BigQueryJdbcUrlUtility.parseStringListProperty( + url, "ServiceAccountImpersonationScopes", "TestClass"); assertEquals(Collections.emptyList(), result); String urlWithEmptyList = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=,,"; + + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=,,"; result = - BigQueryJdbcUrlUtility.parseStringListProperty(urlWithEmptyList, "ListProp", "TestClass"); + BigQueryJdbcUrlUtility.parseStringListProperty( + urlWithEmptyList, "ServiceAccountImpersonationScopes", "TestClass"); assertEquals(Collections.emptyList(), result); } @@ -661,9 +703,10 @@ public void testParseStringListProperty_NullOrEmpty() { public void testParseStringListProperty_SingleValue() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=project1"; + + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=project1"; List result = - BigQueryJdbcUrlUtility.parseStringListProperty(url, "ListProp", "TestClass"); + BigQueryJdbcUrlUtility.parseStringListProperty( + url, "ServiceAccountImpersonationScopes", "TestClass"); assertEquals(Collections.singletonList("project1"), result); } @@ -671,9 +714,10 @@ public void testParseStringListProperty_SingleValue() { public void testParseStringListProperty_MultipleValues() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ListProp=project1,project2,project3"; + + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=project1,project2,project3"; List result = - BigQueryJdbcUrlUtility.parseStringListProperty(url, "ListProp", "TestClass"); + BigQueryJdbcUrlUtility.parseStringListProperty( + url, "ServiceAccountImpersonationScopes", "TestClass"); assertEquals(Arrays.asList("project1", "project2", "project3"), result); } @@ -681,10 +725,11 @@ public void testParseStringListProperty_MultipleValues() { public void testParseIntProperty_ValidInteger() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;SomeIntProp=123"; + + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout=123"; Integer defaultValue = 0; Integer result = - BigQueryJdbcUrlUtility.parseIntProperty(url, "SomeIntProp", defaultValue, "TestClass"); + BigQueryJdbcUrlUtility.parseIntProperty( + url, "HttpConnectTimeout", defaultValue, "TestClass"); assertEquals(Integer.valueOf(123), result); } @@ -692,10 +737,11 @@ public void testParseIntProperty_ValidInteger() { public void testParseIntProperty_PropertyNotPresent() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;SomeIntProp=123"; + + "OAuthType=2;ProjectId=MyBigQueryProject;"; Integer defaultValue = 42; Integer result = - BigQueryJdbcUrlUtility.parseIntProperty(url, "MissingIntProp", defaultValue, "TestClass"); + BigQueryJdbcUrlUtility.parseIntProperty( + url, "HttpConnectTimeout", defaultValue, "TestClass"); assertEquals(defaultValue, result); } @@ -703,26 +749,26 @@ public void testParseIntProperty_PropertyNotPresent() { public void testParseIntProperty_InvalidIntegerValue() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;InvalidIntProp=abc"; + + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout=abc"; Integer defaultValue = 77; assertThrows( IllegalArgumentException.class, () -> BigQueryJdbcUrlUtility.parseIntProperty( - url, "InvalidIntProp", defaultValue, "TestClass")); + url, "HttpConnectTimeout", defaultValue, "TestClass")); } @Test public void testParseIntProperty_EmptyStringValue() { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;EmptyIntProp="; + + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout="; Integer defaultValue = 88; assertThrows( IllegalArgumentException.class, () -> BigQueryJdbcUrlUtility.parseIntProperty( - url, "EmptyIntProp", defaultValue, "TestClass")); + url, "HttpConnectTimeout", defaultValue, "TestClass")); } @Test @@ -860,4 +906,38 @@ public void testParseRequestReason() { "testParseRequestReason"); assertEquals("testingRequestReason", requestReason); } + + @Test + public void testAppendPropertiesToURL_propertyWithSemicolon_isEscaped() throws Exception { + String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"; + Properties properties = new Properties(); + String complexValue = "value;ExtraProperty=injection"; + properties.setProperty("ProjectId", complexValue); + + String updatedUrl = BigQueryJdbcUrlUtility.appendPropertiesToURL(url, null, properties); + + Map parsedProperties = BigQueryJdbcUrlUtility.parseUrl(updatedUrl); + + assertThat(parsedProperties.get("ProjectId")).isEqualTo(complexValue); + assertFalse(parsedProperties.containsKey("ExtraProperty")); + } + + @Test + public void testEndpointOverrides_viaProperties() throws Exception { + String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443"; + Properties props = new Properties(); + + String overrides = "OAUTH2=http://localhost:1234,BIGQUERY=http://localhost:9090"; + props.setProperty("EndpointOverrides", overrides); + + String updatedUrl = BigQueryJdbcUrlUtility.appendPropertiesToURL(url, null, props); + + Map parsedOverrides = + BigQueryJdbcUrlUtility.parseOverrideProperties(updatedUrl, null); + + assertThat(parsedOverrides).containsKey("OAUTH2"); + assertThat(parsedOverrides.get("OAUTH2")).isEqualTo("http://localhost:1234"); + assertThat(parsedOverrides).containsKey("BIGQUERY"); + assertThat(parsedOverrides.get("BIGQUERY")).isEqualTo("http://localhost:9090"); + } } From a43f5968c386dc35656b84c132afe7f85135354c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Feb 2026 20:48:23 +0000 Subject: [PATCH 2256/2268] chore(deps): update dependency com.google.cloud:sdk-platform-java-config to v3.57.0 (#4112) --- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/continuous/graalvm-native-a.cfg | 2 +- .kokoro/continuous/graalvm-native-b.cfg | 2 +- .kokoro/continuous/graalvm-native-c.cfg | 2 +- .kokoro/presubmit/graalvm-native-a.cfg | 2 +- .kokoro/presubmit/graalvm-native-b.cfg | 2 +- .kokoro/presubmit/graalvm-native-c.cfg | 2 +- google-cloud-bigquery-bom/pom.xml | 2 +- pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index 926e029bc3..72e66e858f 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,7 +17,7 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.56.1 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.57.0 with: # java-bigquery does not produce a BOM. Fortunately the root pom.xml # defines google-cloud-bigquery in dependencyManagement section. So diff --git a/.kokoro/continuous/graalvm-native-a.cfg b/.kokoro/continuous/graalvm-native-a.cfg index 76f65a94cd..ddde52219a 100644 --- a/.kokoro/continuous/graalvm-native-a.cfg +++ b/.kokoro/continuous/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.57.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-b.cfg b/.kokoro/continuous/graalvm-native-b.cfg index 5ab0ec78ba..b77a9ae767 100644 --- a/.kokoro/continuous/graalvm-native-b.cfg +++ b/.kokoro/continuous/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.57.0" } env_vars: { diff --git a/.kokoro/continuous/graalvm-native-c.cfg b/.kokoro/continuous/graalvm-native-c.cfg index 04d8c55891..70864f5274 100644 --- a/.kokoro/continuous/graalvm-native-c.cfg +++ b/.kokoro/continuous/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.57.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg index 76f65a94cd..ddde52219a 100644 --- a/.kokoro/presubmit/graalvm-native-a.cfg +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.57.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg index 5ab0ec78ba..b77a9ae767 100644 --- a/.kokoro/presubmit/graalvm-native-b.cfg +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.57.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg index 04d8c55891..70864f5274 100644 --- a/.kokoro/presubmit/graalvm-native-c.cfg +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.56.1" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.57.0" } env_vars: { diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 6e7afbe700..644a11724e 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.56.1 + 3.57.0 diff --git a/pom.xml b/pom.xml index 8303074cb8..215d138fa4 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.56.1 + 3.57.0 From 182b4c14b94ea7e92898687827b78f6254d2e75d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 26 Feb 2026 21:53:00 +0000 Subject: [PATCH 2257/2268] chore(deps): update dependency com.google.cloud:google-cloud-bigquerystorage-bom to v3.22.0 (#4117) Co-authored-by: Lawrence Qiu --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 215d138fa4..6bf34cb7c6 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ com.google.cloud google-cloud-bigquerystorage-bom - 3.21.0 + 3.22.0 pom import From 31715ffaf0a8305b8bf3a3a8ddccbc6140a71312 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 15:18:40 -0500 Subject: [PATCH 2258/2268] chore(main): release 2.60.0 (#4115) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 8 files changed, 25 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54217cb577..632a1ced71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.60.0](https://github.com/googleapis/java-bigquery/compare/v2.59.0...v2.60.0) (2026-02-26) + + +### Features + +* **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)) +* **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)) + + +### Bug Fixes + +* Improve getErrorDescFromResponse() performance ([#4110](https://github.com/googleapis/java-bigquery/issues/4110)) ([4e0b409](https://github.com/googleapis/java-bigquery/commit/4e0b4099f6b690ac89f041eb0ff6e18439647e27)) + ## [2.59.0](https://github.com/googleapis/java-bigquery/compare/v2.58.0...v2.59.0) (2026-02-12) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 351050b355..63eb10acdc 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.59.1-SNAPSHOT + 2.60.0 diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 644a11724e..6604005613 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.59.1-SNAPSHOT + 2.60.0 pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.59.1-SNAPSHOT + 2.60.0 diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 0a905a4a22..e833f850a2 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.3.1-SNAPSHOT + 0.4.0 jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -140,7 +140,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.59.1-SNAPSHOT + 2.60.0 diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index 4f46c88fe5..a9d24a64e3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.59.1-SNAPSHOT + 2.60.0 jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.59.1-SNAPSHOT + 2.60.0 google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 6bf34cb7c6..352e48fc28 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.59.1-SNAPSHOT + 2.60.0 BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.59.1-SNAPSHOT + 2.60.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3dd54fec02..74689fa86b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.59.1-SNAPSHOT + 2.60.0 diff --git a/versions.txt b/versions.txt index acfa56a8e3..7f3d971276 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.59.0:2.59.1-SNAPSHOT -google-cloud-bigquery-jdbc:0.3.0:0.3.1-SNAPSHOT +google-cloud-bigquery:2.60.0:2.60.0 +google-cloud-bigquery-jdbc:0.4.0:0.4.0 From 06737e7280cdb6f822c45b5fc4af899d4bc02cb4 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 2 Mar 2026 11:19:25 -0500 Subject: [PATCH 2259/2268] chore: Fix flaky testCreateAndUpdateTableWithPolicyTags test (#4122) --- .../java/com/google/cloud/bigquery/it/ITBigQueryTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e6f403c5d0..e908a98019 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -2082,8 +2082,12 @@ void testCreateAndUpdateTableWithPolicyTags() throws IOException { .setParent(String.format("projects/%s/locations/%s", PROJECT_ID, "us")) .setTaxonomy( Taxonomy.newBuilder() - // DisplayName must be unique across org - .setDisplayName(String.format("testing taxonomy %s", Instant.now().getNano())) + // DisplayName must be unique across org. Use UUID rather than time to ensure + // no collisions + // from parallel test invocations + .setDisplayName( + String.format( + "testing taxonomy %s", UUID.randomUUID().toString().substring(0, 8))) .setDescription("taxonomy created for integration tests") .addActivatedPolicyTypes(PolicyType.FINE_GRAINED_ACCESS_CONTROL) .build()) From a976a91eec10a1c3e2c1d882417493eaf8e4caff Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 2 Mar 2026 11:47:41 -0500 Subject: [PATCH 2260/2268] test: use generated table names to resolve flakiness in ITBigQueryTest (#4124) --- .../cloud/bigquery/it/ITBigQueryTest.java | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index e908a98019..806a59292b 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -5992,10 +5992,10 @@ void testCopyJobStatistics() throws InterruptedException, TimeoutException { @Test void testSnapshotTableCopyJob() throws InterruptedException { - String sourceTableName = "test_copy_job_base_table"; + String sourceTableName = generateTableName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); // this creates a snapshot table at specified snapshotTime - String snapshotTableName = "test_snapshot_table"; + String snapshotTableName = generateTableName("test_snapshot_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -6039,7 +6039,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { ((SnapshotTableDefinition) snapshotTable.getDefinition()).getBaseTableId().getTable()); // Restore base table to a new table - String restoredTableName = "test_restore_table"; + String restoredTableName = generateTableName("test_restore_table"); TableId restoredTableId = TableId.of(DATASET, restoredTableName); CopyJobConfiguration restoreConfiguration = CopyJobConfiguration.newBuilder(restoredTableId, snapshotTableId) @@ -6455,7 +6455,7 @@ void testCancelNonExistingJob() { @Test void testInsertFromFile() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table"; + String destinationTableName = generateTableName("test_insert_from_file_table"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6528,7 +6528,7 @@ void testInsertFromFile() throws InterruptedException, IOException, TimeoutExcep @Test void testInsertFromFileWithLabels() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table_with_labels"; + String destinationTableName = generateTableName("test_insert_from_file_table_with_labels"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6559,7 +6559,8 @@ void testInsertFromFileWithLabels() throws InterruptedException, IOException, Ti @Test void testInsertWithDecimalTargetTypes() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_insert_from_file_table_with_decimal_target_type"; + String destinationTableName = + generateTableName("test_insert_from_file_table_with_decimal_target_type"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6692,7 +6693,8 @@ void testLocation() throws Exception { @Test void testWriteChannelPreserveAsciiControlCharacters() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = "test_write_channel_preserve_ascii_control_characters"; + String destinationTableName = + generateTableName("test_write_channel_preserve_ascii_control_characters"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6740,7 +6742,7 @@ void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { @Test void testReferenceFileSchemaUriForAvro() { try { - String destinationTableName = "test_reference_file_schema_avro"; + String destinationTableName = generateTableName("test_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6799,7 +6801,7 @@ void testReferenceFileSchemaUriForAvro() { @Test void testReferenceFileSchemaUriForParquet() { try { - String destinationTableName = "test_reference_file_schema_parquet"; + String destinationTableName = generateTableName("test_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6856,7 +6858,8 @@ void testReferenceFileSchemaUriForParquet() { @Test void testCreateExternalTableWithReferenceFileSchemaAvro() { - String destinationTableName = "test_create_external_table_reference_file_schema_avro"; + String destinationTableName = + generateTableName("test_create_external_table_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6895,7 +6898,8 @@ void testCreateExternalTableWithReferenceFileSchemaAvro() { @Test void testCreateExternalTableWithReferenceFileSchemaParquet() { - String destinationTableName = "test_create_external_table_reference_file_schema_parquet"; + String destinationTableName = + generateTableName("test_create_external_table_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6936,9 +6940,9 @@ void testCreateExternalTableWithReferenceFileSchemaParquet() { @Test void testCloneTableCopyJob() throws InterruptedException { - String sourceTableName = "test_copy_job_base_table"; + String sourceTableName = generateTableName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); - String cloneTableName = "test_clone_table"; + String cloneTableName = generateTableName("test_clone_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -7514,7 +7518,7 @@ void testUniverseDomainWithMatchingDomain() { @Test void testExternalTableMetadataCachingNotEnable() throws InterruptedException { - String tableName = "test_metadata_cache_not_enable"; + String tableName = generateTableName("test_metadata_cache_not_enable"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.of( @@ -7557,7 +7561,7 @@ void testExternalTableMetadataCachingNotEnable() throws InterruptedException { void testExternalMetadataCacheModeFailForNonBiglake() { // Validate that MetadataCacheMode is passed to the backend. // TODO: Enhance this test after BigLake testing infrastructure is inplace. - String tableName = "test_metadata_cache_mode_fail_for_non_biglake"; + String tableName = generateTableName("test_metadata_cache_mode_fail_for_non_biglake"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.newBuilder( @@ -7582,7 +7586,7 @@ void testExternalMetadataCacheModeFailForNonBiglake() { @Test void testObjectTable() throws InterruptedException { - String tableName = "test_object_table"; + String tableName = generateTableName("test_object_table"); TableId tableId = TableId.of(DATASET, tableName); String sourceUri = "gs://" + BUCKET + "/" + JSON_LOAD_FILE; @@ -7653,7 +7657,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { // mapping. // Test v1 mapping. - String v1TableName = "flexible_column_name_data_testing_table_v1"; + String v1TableName = generateTableName("flexible_column_name_data_testing_table_v1"); TableId v1TableId = TableId.of(DATASET, v1TableName); try { LoadJobConfiguration loadJobConfigurationV1 = @@ -7678,7 +7682,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { } // Test v2 mapping. - String v2TableName = "flexible_column_name_data_testing_table_v2"; + String v2TableName = generateTableName("flexible_column_name_data_testing_table_v2"); TableId v2TableId = TableId.of(DATASET, v2TableName); try { LoadJobConfiguration loadJobConfigurationV2 = From 63d39a7f041db20304dde813ce0026990ebccf0c Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 2 Mar 2026 12:40:54 -0500 Subject: [PATCH 2261/2268] chore: Disable testRoutineRemoteUDF test (#4123) * chore: Disable testRoutineRemoteUDF test * chore: Add check for null connection * chore: Add check for null client --- .../cloud/bigquery/it/ITRemoteUDFTest.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java index 6598d08357..d3610b4fff 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITRemoteUDFTest.java @@ -41,6 +41,7 @@ import java.util.UUID; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; class ITRemoteUDFTest { @@ -81,13 +82,19 @@ static void afterClass() { if (bigquery != null) { RemoteBigQueryHelper.forceDelete(bigquery, ROUTINE_DATASET); } - // delete a connection - DeleteConnectionRequest request = - DeleteConnectionRequest.newBuilder().setName(connection.getName()).build(); - client.deleteConnection(request); - client.close(); + + // In JUnit, @BeforeEach only runs before a test is invoked. If a test never runs, + // then the logic inside @BeforeEach doesn't (e.g. connection was never created). + // This checks to ensure that connection was created before deleting. + if (client != null && connection != null) { + DeleteConnectionRequest request = + DeleteConnectionRequest.newBuilder().setName(connection.getName()).build(); + client.deleteConnection(request); + client.close(); + } } + @Disabled("https://github.com/googleapis/java-bigquery/issues/4103") @Test void testRoutineRemoteUDF() { String routineName = RemoteBigQueryHelper.generateRoutineName(); From b512e3a01562811302b75d07349344abab337722 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 2 Mar 2026 20:43:53 -0500 Subject: [PATCH 2262/2268] chore: Fix testProjectIDFastSQLQueryWithJobId invalid generated project id length (#4127) --- .../cloud/bigquery/it/ITBigQueryTest.java | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 806a59292b..6c5708a144 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -619,15 +619,15 @@ class ITBigQueryTest { private static final String EXTRACT_FILE = "extract.csv"; private static final String EXTRACT_MODEL_FILE = "extract_model.csv"; private static final String BUCKET = RemoteStorageHelper.generateBucketName(); - private static final TableId TABLE_ID = TableId.of(DATASET, generateTableName("testing_table")); + private static final TableId TABLE_ID = TableId.of(DATASET, generateRandomName("testing_table")); private static final TableId TABLE_ID_SIMPLE = - TableId.of(DATASET, generateTableName("ddl_testing_table")); + TableId.of(DATASET, generateRandomName("ddl_testing_table")); private static final TableId TABLE_ID_FAST_QUERY = - TableId.of(DATASET, generateTableName("fast_query_testing_table")); + TableId.of(DATASET, generateRandomName("fast_query_testing_table")); private static final TableId TABLE_ID_LARGE = - TableId.of(DATASET, generateTableName("large_data_testing_table")); + TableId.of(DATASET, generateRandomName("large_data_testing_table")); private static final TableId TABLE_ID_FAST_QUERY_BQ_RESULTSET = - TableId.of(DATASET, generateTableName("fast_query_testing_bq_resultset")); + TableId.of(DATASET, generateRandomName("fast_query_testing_bq_resultset")); private static final String CSV_CONTENT = "StringValue1\nStringValue2\n"; private static final String CSV_CONTENT_NULL = "String\0Value1\n"; @@ -1063,7 +1063,7 @@ public CompletableResultCode shutdown() { } } - private static String generateTableName(String prefix) { + private static String generateRandomName(String prefix) { return prefix + UUID.randomUUID().toString().substring(0, 8); } @@ -2718,7 +2718,7 @@ void testListTablesWithRangePartitioning() { @Test void testListPartitions() throws InterruptedException { - String tableName = generateTableName("test_table_partitions_"); + String tableName = generateRandomName("test_table_partitions_"); Date date = Date.fromJavaUtilDate(new java.util.Date()); String partitionDate = date.toString().replaceAll("-", ""); TableId tableId = TableId.of(DATASET, tableName + "$" + partitionDate); @@ -4686,8 +4686,8 @@ void testFastSQLQuery() throws InterruptedException { } @Test - void testProjectIDFastSQLQueryWithJobId() throws InterruptedException { - String invalidProjectId = "RANDOM_PROJECT_" + UUID.randomUUID().toString().replace('-', '_'); + void testProjectIDFastSQLQueryWithJobId() { + String invalidProjectId = generateRandomName("RANDOM_PROJECT_").replace('-', '_'); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FAST_QUERY.getTable(); // With incorrect projectID in jobid @@ -4806,7 +4806,7 @@ void testFastSQLQueryMultiPage() throws InterruptedException { void testFastDMLQuery() throws InterruptedException { // The test runs an update query. Clone the table to ensure that this doesn't impact // other tests. - String tableName = generateTableName("test_table_fast_query_dml"); + String tableName = generateRandomName("test_table_fast_query_dml"); String tableNameFastQuery = TABLE_ID_SIMPLE.getTable(); String ddlQuery = String.format( @@ -4837,7 +4837,7 @@ void testFastDMLQuery() throws InterruptedException { @Test void testFastDDLQuery() throws InterruptedException { - String tableName = generateTableName("test_table_fast_query_ddl"); + String tableName = generateRandomName("test_table_fast_query_ddl"); String tableNameFastQuery = TABLE_ID_SIMPLE.getTable(); String ddlQuery = String.format( @@ -4876,7 +4876,7 @@ void testFastDDLQuery() throws InterruptedException { @Test void testFastQuerySlowDDL() throws InterruptedException { - String tableName = generateTableName("test_table_fast_query_ddl_slow_"); + String tableName = generateRandomName("test_table_fast_query_ddl_slow_"); // This query take more than 10s to run and should fall back on the old query path String slowDdlQuery = String.format( @@ -5128,7 +5128,7 @@ void testExecuteSelectSessionSupport() throws BigQuerySQLException { void testDmlStatistics() throws InterruptedException { // This runs an update SQL query. Clone the table to ensure that this doesn't impact // other tests. - String tableName = generateTableName("test_table_dml_stats"); + String tableName = generateRandomName("test_table_dml_stats"); String tableNameSimple = TABLE_ID_SIMPLE.getTable(); String ddlQuery = String.format( @@ -5166,7 +5166,7 @@ void testDmlStatistics() throws InterruptedException { void testTransactionInfo() throws InterruptedException { // The transaction runs an update query. Clone the table to ensure that this doesn't impact // other tests. - String tableName = generateTableName("test_table_transaction_info"); + String tableName = generateRandomName("test_table_transaction_info"); String tableNameSimple = TABLE_ID_SIMPLE.getTable(); String ddlQuery = String.format( @@ -5821,8 +5821,8 @@ void testListJobsWithCreationBounding() { @Test void testCreateAndGetJob() throws InterruptedException, TimeoutException { - String sourceTableName = generateTableName("test_create_and_get_job_source_table"); - String destinationTableName = generateTableName("test_create_and_get_job_destination_table"); + String sourceTableName = generateRandomName("test_create_and_get_job_source_table"); + String destinationTableName = generateRandomName("test_create_and_get_job_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5880,9 +5880,9 @@ void testCreateJobAndWaitForWithRetryOptions() throws InterruptedException, Time @Test void testCreateAndGetJobWithSelectedFields() throws InterruptedException, TimeoutException { String sourceTableName = - generateTableName("test_create_and_get_job_with_selected_fields_source_table"); + generateRandomName("test_create_and_get_job_with_selected_fields_source_table"); String destinationTableName = - generateTableName("test_create_and_get_job_with_selected_fields_destination_table"); + generateRandomName("test_create_and_get_job_with_selected_fields_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5929,8 +5929,8 @@ void testCreateAndGetJobWithSelectedFields() throws InterruptedException, Timeou @Test void testCopyJob() throws InterruptedException, TimeoutException { - String sourceTableName = generateTableName("test_copy_job_source_table"); - String destinationTableName = generateTableName("test_copy_job_destination_table"); + String sourceTableName = generateRandomName("test_copy_job_source_table"); + String destinationTableName = generateRandomName("test_copy_job_destination_table"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); TableInfo tableInfo = TableInfo.of(sourceTable, tableDefinition); @@ -5961,8 +5961,8 @@ void testCopyJob() throws InterruptedException, TimeoutException { @Test void testCopyJobStatistics() throws InterruptedException, TimeoutException { - String sourceTableName = generateTableName("test_copy_job_statistics_source_table"); - String destinationTableName = generateTableName("test_copy_job_statistics_destination_table"); + String sourceTableName = generateRandomName("test_copy_job_statistics_source_table"); + String destinationTableName = generateRandomName("test_copy_job_statistics_destination_table"); QueryJobConfiguration createTable = QueryJobConfiguration.newBuilder( @@ -5992,10 +5992,10 @@ void testCopyJobStatistics() throws InterruptedException, TimeoutException { @Test void testSnapshotTableCopyJob() throws InterruptedException { - String sourceTableName = generateTableName("test_copy_job_base_table"); + String sourceTableName = generateRandomName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); // this creates a snapshot table at specified snapshotTime - String snapshotTableName = generateTableName("test_snapshot_table"); + String snapshotTableName = generateRandomName("test_snapshot_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -6039,7 +6039,7 @@ void testSnapshotTableCopyJob() throws InterruptedException { ((SnapshotTableDefinition) snapshotTable.getDefinition()).getBaseTableId().getTable()); // Restore base table to a new table - String restoredTableName = generateTableName("test_restore_table"); + String restoredTableName = generateRandomName("test_restore_table"); TableId restoredTableId = TableId.of(DATASET, restoredTableName); CopyJobConfiguration restoreConfiguration = CopyJobConfiguration.newBuilder(restoredTableId, snapshotTableId) @@ -6071,8 +6071,8 @@ void testSnapshotTableCopyJob() throws InterruptedException { @Test void testCopyJobWithLabelsAndExpTime() throws InterruptedException { String destExpiryTime = "2099-12-31T23:59:59.999999999Z"; - String sourceTableName = generateTableName("test_copy_job_source_table_label"); - String destinationTableName = generateTableName("test_copy_job_destination_table_label"); + String sourceTableName = generateRandomName("test_copy_job_source_table_label"); + String destinationTableName = generateRandomName("test_copy_job_destination_table_label"); Map labels = ImmutableMap.of("test_job_name", "test_copy_job"); TableId sourceTable = TableId.of(DATASET, sourceTableName); StandardTableDefinition tableDefinition = StandardTableDefinition.of(TABLE_SCHEMA); @@ -6101,7 +6101,7 @@ void testCopyJobWithLabelsAndExpTime() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test public void testQueryJob() throws InterruptedException, TimeoutException { - String tableName = generateTableName("test_query_job_table"); + String tableName = generateRandomName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6147,7 +6147,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithConnectionProperties() throws InterruptedException { - String tableName = generateTableName("test_query_job_table_connection_properties"); + String tableName = generateRandomName("test_query_job_table_connection_properties"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6167,7 +6167,7 @@ void testQueryJobWithConnectionProperties() throws InterruptedException { /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithLabels() throws InterruptedException, TimeoutException { - String tableName = generateTableName("test_query_job_table"); + String tableName = generateRandomName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); Map labels = ImmutableMap.of("test-job-name", "test-query-job"); TableId destinationTable = TableId.of(DATASET, tableName); @@ -6190,7 +6190,7 @@ void testQueryJobWithLabels() throws InterruptedException, TimeoutException { @Test void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedException { - String tableName = generateTableName("test_query_job_table"); + String tableName = generateRandomName("test_query_job_table"); String query = "SELECT * FROM " + TABLE_ID.getTable() + " WHERE search(StringField, \"stringValue\")"; TableId destinationTable = TableId.of(DATASET, tableName); @@ -6218,7 +6218,7 @@ void testQueryJobWithSearchReturnsSearchStatisticsUnused() throws InterruptedExc /* TODO(prasmish): replicate the entire test case for executeSelect */ @Test void testQueryJobWithRangePartitioning() throws InterruptedException { - String tableName = generateTableName("test_query_job_table_rangepartitioning"); + String tableName = generateRandomName("test_query_job_table_rangepartitioning"); String query = "SELECT IntegerField, TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); @@ -6243,7 +6243,7 @@ void testQueryJobWithRangePartitioning() throws InterruptedException { @Test void testLoadJobWithRangePartitioning() throws InterruptedException { - String tableName = generateTableName("test_load_job_table_rangepartitioning"); + String tableName = generateRandomName("test_load_job_table_rangepartitioning"); TableId destinationTable = TableId.of(DATASET, tableName); try { LoadJobConfiguration configuration = @@ -6267,7 +6267,7 @@ void testLoadJobWithRangePartitioning() throws InterruptedException { @Test void testLoadJobWithDecimalTargetTypes() throws InterruptedException { - String tableName = generateTableName("test_load_job_table_parquet_decimalTargetTypes"); + String tableName = generateRandomName("test_load_job_table_parquet_decimalTargetTypes"); TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; try { @@ -6295,7 +6295,7 @@ void testLoadJobWithDecimalTargetTypes() throws InterruptedException { @Test void testExternalTableWithDecimalTargetTypes() throws InterruptedException { - String tableName = generateTableName("test_create_external_table_parquet_decimalTargetTypes"); + String tableName = generateRandomName("test_create_external_table_parquet_decimalTargetTypes"); TableId destinationTable = TableId.of(DATASET, tableName); String sourceUri = "gs://" + CLOUD_SAMPLES_DATA + "/bigquery/numeric/numeric_38_12.parquet"; ExternalTableDefinition externalTableDefinition = @@ -6315,7 +6315,7 @@ void testExternalTableWithDecimalTargetTypes() throws InterruptedException { @Test void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { - String tableName = generateTableName("test_query_job_table"); + String tableName = generateRandomName("test_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, tableName); QueryJobConfiguration configuration = @@ -6333,7 +6333,7 @@ void testQueryJobWithDryRun() throws InterruptedException, TimeoutException { @Test void testExtractJob() throws InterruptedException, TimeoutException { - String tableName = generateTableName("test_export_job_table"); + String tableName = generateRandomName("test_export_job_table"); TableId destinationTable = TableId.of(DATASET, tableName); Map labels = ImmutableMap.of("test-job-name", "test-load-extract-job"); LoadJobConfiguration configuration = @@ -6410,7 +6410,7 @@ void testExtractJobWithModel() throws InterruptedException { @Test void testExtractJobWithLabels() throws InterruptedException, TimeoutException { - String tableName = generateTableName("test_export_job_table_label"); + String tableName = generateRandomName("test_export_job_table_label"); Map labels = ImmutableMap.of("test_job_name", "test_export_job"); TableId destinationTable = TableId.of(DATASET, tableName); LoadJobConfiguration configuration = @@ -6436,7 +6436,7 @@ void testExtractJobWithLabels() throws InterruptedException, TimeoutException { @Test void testCancelJob() throws InterruptedException, TimeoutException { - String destinationTableName = generateTableName("test_cancel_query_job_table"); + String destinationTableName = generateRandomName("test_cancel_query_job_table"); String query = "SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID.getTable(); TableId destinationTable = TableId.of(DATASET, destinationTableName); QueryJobConfiguration configuration = @@ -6455,7 +6455,7 @@ void testCancelNonExistingJob() { @Test void testInsertFromFile() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = generateTableName("test_insert_from_file_table"); + String destinationTableName = generateRandomName("test_insert_from_file_table"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6528,7 +6528,7 @@ void testInsertFromFile() throws InterruptedException, IOException, TimeoutExcep @Test void testInsertFromFileWithLabels() throws InterruptedException, IOException, TimeoutException { - String destinationTableName = generateTableName("test_insert_from_file_table_with_labels"); + String destinationTableName = generateRandomName("test_insert_from_file_table_with_labels"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6560,7 +6560,7 @@ void testInsertFromFileWithLabels() throws InterruptedException, IOException, Ti void testInsertWithDecimalTargetTypes() throws InterruptedException, IOException, TimeoutException { String destinationTableName = - generateTableName("test_insert_from_file_table_with_decimal_target_type"); + generateRandomName("test_insert_from_file_table_with_decimal_target_type"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6694,7 +6694,7 @@ void testLocation() throws Exception { void testWriteChannelPreserveAsciiControlCharacters() throws InterruptedException, IOException, TimeoutException { String destinationTableName = - generateTableName("test_write_channel_preserve_ascii_control_characters"); + generateRandomName("test_write_channel_preserve_ascii_control_characters"); TableId tableId = TableId.of(DATASET, destinationTableName); WriteChannelConfiguration configuration = WriteChannelConfiguration.newBuilder(tableId) @@ -6721,7 +6721,7 @@ void testWriteChannelPreserveAsciiControlCharacters() @Test void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { String destinationTableName = - generateTableName("test_load_job_preserve_ascii_control_characters"); + generateRandomName("test_load_job_preserve_ascii_control_characters"); TableId destinationTable = TableId.of(DATASET, destinationTableName); try { @@ -6742,7 +6742,7 @@ void testLoadJobPreserveAsciiControlCharacters() throws InterruptedException { @Test void testReferenceFileSchemaUriForAvro() { try { - String destinationTableName = generateTableName("test_reference_file_schema_avro"); + String destinationTableName = generateRandomName("test_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6801,7 +6801,7 @@ void testReferenceFileSchemaUriForAvro() { @Test void testReferenceFileSchemaUriForParquet() { try { - String destinationTableName = generateTableName("test_reference_file_schema_parquet"); + String destinationTableName = generateRandomName("test_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6859,7 +6859,7 @@ void testReferenceFileSchemaUriForParquet() { @Test void testCreateExternalTableWithReferenceFileSchemaAvro() { String destinationTableName = - generateTableName("test_create_external_table_reference_file_schema_avro"); + generateRandomName("test_create_external_table_reference_file_schema_avro"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6899,7 +6899,7 @@ void testCreateExternalTableWithReferenceFileSchemaAvro() { @Test void testCreateExternalTableWithReferenceFileSchemaParquet() { String destinationTableName = - generateTableName("test_create_external_table_reference_file_schema_parquet"); + generateRandomName("test_create_external_table_reference_file_schema_parquet"); TableId tableId = TableId.of(DATASET, destinationTableName); Schema expectedSchema = Schema.of( @@ -6940,9 +6940,9 @@ void testCreateExternalTableWithReferenceFileSchemaParquet() { @Test void testCloneTableCopyJob() throws InterruptedException { - String sourceTableName = generateTableName("test_copy_job_base_table"); + String sourceTableName = generateRandomName("test_copy_job_base_table"); String ddlTableName = TABLE_ID_SIMPLE.getTable(); - String cloneTableName = generateTableName("test_clone_table"); + String cloneTableName = generateRandomName("test_clone_table"); // Create source table with some data in it String ddlQuery = String.format( @@ -7518,7 +7518,7 @@ void testUniverseDomainWithMatchingDomain() { @Test void testExternalTableMetadataCachingNotEnable() throws InterruptedException { - String tableName = generateTableName("test_metadata_cache_not_enable"); + String tableName = generateRandomName("test_metadata_cache_not_enable"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.of( @@ -7561,7 +7561,7 @@ void testExternalTableMetadataCachingNotEnable() throws InterruptedException { void testExternalMetadataCacheModeFailForNonBiglake() { // Validate that MetadataCacheMode is passed to the backend. // TODO: Enhance this test after BigLake testing infrastructure is inplace. - String tableName = generateTableName("test_metadata_cache_mode_fail_for_non_biglake"); + String tableName = generateRandomName("test_metadata_cache_mode_fail_for_non_biglake"); TableId tableId = TableId.of(DATASET, tableName); ExternalTableDefinition externalTableDefinition = ExternalTableDefinition.newBuilder( @@ -7586,7 +7586,7 @@ void testExternalMetadataCacheModeFailForNonBiglake() { @Test void testObjectTable() throws InterruptedException { - String tableName = generateTableName("test_object_table"); + String tableName = generateRandomName("test_object_table"); TableId tableId = TableId.of(DATASET, tableName); String sourceUri = "gs://" + BUCKET + "/" + JSON_LOAD_FILE; @@ -7657,7 +7657,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { // mapping. // Test v1 mapping. - String v1TableName = generateTableName("flexible_column_name_data_testing_table_v1"); + String v1TableName = generateRandomName("flexible_column_name_data_testing_table_v1"); TableId v1TableId = TableId.of(DATASET, v1TableName); try { LoadJobConfiguration loadJobConfigurationV1 = @@ -7682,7 +7682,7 @@ void testLoadConfigurationFlexibleColumnName() throws InterruptedException { } // Test v2 mapping. - String v2TableName = generateTableName("flexible_column_name_data_testing_table_v2"); + String v2TableName = generateRandomName("flexible_column_name_data_testing_table_v2"); TableId v2TableId = TableId.of(DATASET, v2TableName); try { LoadJobConfiguration loadJobConfigurationV2 = From 09fe4fcc721ac17b67f223fbf7e5f2d34e54c115 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Mon, 2 Mar 2026 21:41:43 -0500 Subject: [PATCH 2263/2268] chore: Fix short query tests (#4125) * chore: Fix short query tests * chore: Use global otel instance for test * chore: Refactor to account for null and invalid server mappings * chore: Default to UNKNOWN enum * chore: Fix nullable annotations * chore: Update class comment * chore: Move test into the correct package * chore: Fix test issues --- .../google/cloud/bigquery/BigQueryImpl.java | 2 + .../cloud/bigquery/JobCreationReason.java | 80 +++++++++++++++++++ .../google/cloud/bigquery/TableResult.java | 6 ++ .../bigquery}/MetadataCacheStatsTest.java | 0 .../cloud/bigquery/it/ITBigQueryTest.java | 35 +++++--- 5 files changed, 112 insertions(+), 11 deletions(-) create mode 100644 google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobCreationReason.java rename google-cloud-bigquery/src/test/java/{ => com/google/cloud/bigquery}/MetadataCacheStatsTest.java (100%) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java index c057cdaca6..320daa03a2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java @@ -2015,6 +2015,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() getOptions().getDataFormatOptions().useInt64Timestamp()))) .setJobId(jobId) .setQueryId(results.getQueryId()) + .setJobCreationReason(JobCreationReason.fromPb(results.getJobCreationReason())) .build(); } // only 1 page of result @@ -2033,6 +2034,7 @@ public com.google.api.services.bigquery.model.QueryResponse call() .setJobId( results.getJobReference() != null ? JobId.fromPb(results.getJobReference()) : null) .setQueryId(results.getQueryId()) + .setJobCreationReason(JobCreationReason.fromPb(results.getJobCreationReason())) .build(); } diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobCreationReason.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobCreationReason.java new file mode 100644 index 0000000000..296c5cc049 --- /dev/null +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobCreationReason.java @@ -0,0 +1,80 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigquery; + +import javax.annotation.Nullable; + +/** + * Maps to JobCreationReason + * when used with {@link + * com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode#JOB_CREATION_OPTIONAL}. + * + *

    The code indicates the high level reason why a job was created. The default is `UNKNOWN` if + * there is no mapping found between the server response and the client library. + */ +public class JobCreationReason { + + public enum Code { + REQUESTED("REQUESTED"), + LONG_RUNNING("LONG_RUNNING"), + LARGE_RESULTS("LARGE_RESULTS"), + OTHER("OTHER"), + UNKNOWN("UNKNOWN"); + + private final String reason; + + Code(String reason) { + this.reason = reason; + } + + /** + * Maps the server code to BQ code. Returns {@link Code#UNKNOWN} if the mapping does not exist. + */ + static Code fromValue(@Nullable String reason) { + for (JobCreationReason.Code code : Code.values()) { + if (code.reason.equals(reason)) { + return code; + } + } + return UNKNOWN; + } + } + + @Nullable private final Code code; + + JobCreationReason(Code code) { + this.code = code; + } + + static JobCreationReason fromPb( + com.google.api.services.bigquery.model.JobCreationReason jobCreationReason) { + // JobCreationReason may be null if the JobCreationMode is specified to be Optional + // Note: JobCreationMode.Optional may also end up creating a job depending on the + // query complexity and other factors. + if (jobCreationReason == null) { + return null; + } + return new JobCreationReason(Code.fromValue(jobCreationReason.getCode())); + } + + /** + * @return JobCreationReason code or {@link Code#UNKNOWN} if mapping does not exist. + */ + public Code getCode() { + return code; + } +} diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index 42044596bd..a7aa6ba9de 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -47,6 +47,8 @@ public abstract static class Builder { public abstract TableResult.Builder setQueryId(String queryId); + public abstract TableResult.Builder setJobCreationReason(JobCreationReason jobCreationReason); + /** Creates a @code TableResult} object. */ public abstract TableResult build(); } @@ -76,6 +78,9 @@ public static Builder newBuilder() { @Nullable public abstract String getQueryId(); + @Nullable + public abstract JobCreationReason getJobCreationReason(); + @Override public boolean hasNextPage() { return getPageNoSchema().hasNextPage(); @@ -94,6 +99,7 @@ public TableResult getNextPage() { .setTotalRows(getTotalRows()) .setPageNoSchema(getPageNoSchema().getNextPage()) .setQueryId(getQueryId()) + .setJobCreationReason(getJobCreationReason()) .build(); } return null; diff --git a/google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MetadataCacheStatsTest.java similarity index 100% rename from google-cloud-bigquery/src/test/java/MetadataCacheStatsTest.java rename to google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/MetadataCacheStatsTest.java diff --git a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java index 6c5708a144..439e401d37 100644 --- a/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java +++ b/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java @@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -93,6 +94,7 @@ import com.google.cloud.bigquery.InsertAllResponse; import com.google.cloud.bigquery.Job; import com.google.cloud.bigquery.JobConfiguration; +import com.google.cloud.bigquery.JobCreationReason; import com.google.cloud.bigquery.JobId; import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.JobStatistics; @@ -7316,14 +7318,16 @@ void testTableResultJobIdAndQueryId() throws InterruptedException { String query = "SELECT 1 as one"; QueryJobConfiguration configStateless = QueryJobConfiguration.newBuilder(query).build(); TableResult result = bigQuery.query(configStateless); - // A stateless query should result in either a queryId (stateless success) or a jobId (fallback - // to a job). - // Exactly one of them should be non-null. - // Ideally Stateless query will return queryId but in some cases it would return jobId instead - // of queryId based on the query complexity or other factors (job timeout configs). - assertTrue( - (result.getJobId() != null) ^ (result.getQueryId() != null), - "Exactly one of jobId or queryId should be non-null"); + // This should trigger a stateless query due to the query simplicity. However, BQ's engine + // may configure this to be a job due a variety of factors. The QueryID is autopopulated and + // may also return a JobId if changed to a job. For the query above, the Job Creation Reason + // would always be `OTHER` as it is not request, a large result, or due to a timeout. + assertNotNull(result.getQueryId()); + if (result.getJobCreationReason() != null) { + assertNotNull(result.getJobId()); + assertEquals(result.getQueryId(), result.getJobId().getJob()); + assertEquals(JobCreationReason.Code.OTHER, result.getJobCreationReason().getCode()); + } // Test scenario 2 by failing stateless check by setting job timeout. QueryJobConfiguration configQueryWithJob = @@ -7416,9 +7420,18 @@ void testQueryWithTimeout() throws InterruptedException { // Stateless query returns TableResult QueryJobConfiguration config = QueryJobConfiguration.newBuilder(query).build(); Object result = bigQuery.queryWithTimeout(config, null, null); - assertTrue(result instanceof TableResult); - assertNull(((TableResult) result).getJobId()); - assertNotNull(((TableResult) result).getQueryId()); + assertInstanceOf(TableResult.class, result); + // This should trigger a stateless query due to the query simplicity. However, BQ's engine + // may configure this to be a job due a variety of factors. The QueryID is autopopulated and + // may also return a JobId if changed to a Job. For the query above, the Job Creation Reason + // would always be `OTHER` as it is not request, a large result, or due to a timeout. + TableResult tableResult = (TableResult) result; + assertNotNull(tableResult.getQueryId()); + if (tableResult.getJobCreationReason() != null) { + assertNotNull(tableResult.getJobId()); + assertEquals(tableResult.getQueryId(), tableResult.getJobId().getJob()); + assertEquals(JobCreationReason.Code.OTHER, tableResult.getJobCreationReason().getCode()); + } // Stateful query returns Job // Test scenario 2 to ensure job is created if JobCreationMode is set, but for a small query From 66addc3ce692311aae38980c89c61e8592106c83 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 15:11:35 -0800 Subject: [PATCH 2264/2268] chore(main): release 2.60.1-SNAPSHOT (#4121) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmark/pom.xml | 2 +- google-cloud-bigquery-bom/pom.xml | 4 ++-- google-cloud-bigquery-jdbc/pom.xml | 4 ++-- google-cloud-bigquery/pom.xml | 4 ++-- pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 63eb10acdc..0365138738 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -6,7 +6,7 @@ google-cloud-bigquery-parent com.google.cloud - 2.60.0 + 2.60.1-SNAPSHOT diff --git a/google-cloud-bigquery-bom/pom.xml b/google-cloud-bigquery-bom/pom.xml index 6604005613..a53be70f12 100644 --- a/google-cloud-bigquery-bom/pom.xml +++ b/google-cloud-bigquery-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-bom - 2.60.0 + 2.60.1-SNAPSHOT pom com.google.cloud @@ -54,7 +54,7 @@ com.google.cloud google-cloud-bigquery - 2.60.0 + 2.60.1-SNAPSHOT diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index e833f850a2..776a9bad27 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -20,7 +20,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery-jdbc - 0.4.0 + 0.4.1-SNAPSHOT jar BigQuery JDBC https://github.com/googleapis/java-bigquery-jdbc @@ -140,7 +140,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.60.0 + 2.60.1-SNAPSHOT diff --git a/google-cloud-bigquery/pom.xml b/google-cloud-bigquery/pom.xml index a9d24a64e3..88076302b3 100644 --- a/google-cloud-bigquery/pom.xml +++ b/google-cloud-bigquery/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigquery - 2.60.0 + 2.60.1-SNAPSHOT jar BigQuery https://github.com/googleapis/java-bigquery @@ -11,7 +11,7 @@ com.google.cloud google-cloud-bigquery-parent - 2.60.0 + 2.60.1-SNAPSHOT google-cloud-bigquery diff --git a/pom.xml b/pom.xml index 352e48fc28..5ee48cbd03 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-bigquery-parent pom - 2.60.0 + 2.60.1-SNAPSHOT BigQuery Parent https://github.com/googleapis/java-bigquery @@ -93,7 +93,7 @@ com.google.cloud google-cloud-bigquery - 2.60.0 + 2.60.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 74689fa86b..525e9c671f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -56,7 +56,7 @@ com.google.cloud google-cloud-bigquery - 2.60.0 + 2.60.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 7f3d971276..c52d24dc4e 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ # Format: # module:released-version:current-version -google-cloud-bigquery:2.60.0:2.60.0 -google-cloud-bigquery-jdbc:0.4.0:0.4.0 +google-cloud-bigquery:2.60.0:2.60.1-SNAPSHOT +google-cloud-bigquery-jdbc:0.4.0:0.4.1-SNAPSHOT From 0137e4b418ff9cefcbece1c6d9d8ef491a50819b Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 6 Mar 2026 13:33:06 -0800 Subject: [PATCH 2265/2268] fix(jdbc): various perf improvements (#4114) --- .../bigquery/jdbc/BigQueryConnection.java | 10 ++++-- .../jdbc/BigQueryConnectionProperty.java | 12 +++++++ .../jdbc/BigQueryJdbcOAuthUtility.java | 28 +++++++++------ .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 16 ++++++++- .../bigquery/jdbc/BigQueryConnectionTest.java | 35 +++++++++++++++++++ .../jdbc/BigQueryJdbcOAuthUtilityTest.java | 19 ++++------ 6 files changed, 94 insertions(+), 26 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 5c5d5bc84c..75d472de9e 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -32,6 +32,7 @@ import com.google.cloud.bigquery.Job; import com.google.cloud.bigquery.JobInfo; import com.google.cloud.bigquery.QueryJobConfiguration; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import com.google.cloud.bigquery.exception.BigQueryJdbcSqlFeatureNotSupportedException; @@ -159,10 +160,10 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { this.authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.connectionClassName); this.catalog = - BigQueryJdbcUrlUtility.parseStringProperty( + BigQueryJdbcUrlUtility.parseStringPropertyLazyDefault( url, BigQueryJdbcUrlUtility.PROJECT_ID_PROPERTY_NAME, - BigQueryOptions.getDefaultProjectId(), + () -> BigQueryOptions.getDefaultProjectId(), this.connectionClassName); this.universeDomain = BigQueryJdbcUrlUtility.parseStringProperty( @@ -1064,7 +1065,10 @@ private BigQuery getBigQueryConnection() { } BigQueryOptions options = bigQueryOptions.setHeaderProvider(HEADER_PROVIDER).build(); - options.setQueryPreviewEnabled(String.valueOf(this.useStatelessQueryMode)); + options.setDefaultJobCreationMode( + this.useStatelessQueryMode + ? JobCreationMode.JOB_CREATION_OPTIONAL + : JobCreationMode.JOB_CREATION_REQUIRED); return options.getService(); } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java index 17be15d866..3b94f2fef7 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionProperty.java @@ -17,12 +17,14 @@ package com.google.cloud.bigquery.jdbc; import java.util.List; +import java.util.function.Supplier; class BigQueryConnectionProperty { private final String name; private final String description; private final String defaultValue; + private final Supplier defaultValueSupplier; private final List validValues; public String getName() { @@ -34,6 +36,9 @@ public String getDescription() { } public String getDefaultValue() { + if (defaultValueSupplier != null) { + return defaultValueSupplier.get(); + } return defaultValue; } @@ -43,6 +48,7 @@ public List getValidValues() { BigQueryConnectionProperty(Builder builder) { this.name = builder.name; + this.defaultValueSupplier = builder.defaultValueSupplier; this.defaultValue = builder.defaultValue; this.description = builder.description; this.validValues = builder.validValues; @@ -79,6 +85,7 @@ static final class Builder { private String name; private String description; private String defaultValue; + private Supplier defaultValueSupplier = null; private List validValues; private Builder(BigQueryConnectionProperty bigQueryConnectionProperty) { @@ -105,6 +112,11 @@ Builder setDefaultValue(String defaultValue) { return this; } + Builder setLazyDefaultValue(Supplier defaultValueSupplier) { + this.defaultValueSupplier = defaultValueSupplier; + return this; + } + Builder setValidValues(List validValues) { this.validValues = validValues; return this; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java index dcf31a7fff..11d79ae4b8 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java @@ -38,6 +38,7 @@ import java.awt.Desktop; import java.io.BufferedReader; import java.io.ByteArrayInputStream; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -331,11 +332,11 @@ private static boolean isFileExists(String filename) { } } - private static boolean isJson(String value) { + private static boolean isJson(byte[] value) { try { // This is done this way to ensure strict Json parsing // https://github.com/google/gson/issues/1208#issuecomment-2120764686 - InputStream stream = new ByteArrayInputStream(value.getBytes()); + InputStream stream = new ByteArrayInputStream(value); InputStreamReader reader = new InputStreamReader(stream); JsonReader jsonReader = new JsonReader(reader); jsonReader.setStrictness(Strictness.STRICT); @@ -365,17 +366,24 @@ private static GoogleCredentials getGoogleServiceAccountCredentials( final String keyPath = pvtKeyPath != null ? pvtKeyPath : pvtKey; PrivateKey key = null; - InputStream stream = null; + byte[] keyBytes = pvtKey != null ? pvtKey.getBytes() : null; if (isFileExists(keyPath)) { - key = privateKeyFromP12File(keyPath, p12Password); - if (key == null) { - stream = Files.newInputStream(Paths.get(keyPath)); + try (InputStream stream = new FileInputStream(keyPath)) { + int bufferSize = 1024 * 1024; + byte[] buffer = new byte[bufferSize]; + stream.read(buffer, 0, bufferSize); + keyBytes = buffer; } - } else if (isJson(pvtKey)) { - stream = new ByteArrayInputStream(pvtKey.getBytes()); + } + + InputStream stream = null; + if (isJson(keyBytes)) { + stream = new ByteArrayInputStream(keyBytes); } else if (pvtKey != null) { key = privateKeyFromPkcs8(pvtKey); + } else if (keyBytes != null) { + key = privateKeyFromP12Bytes(keyBytes, p12Password); } if (stream != null) { @@ -703,9 +711,9 @@ private static GoogleCredentials getServiceAccountImpersonatedCredentials( impersonationLifetimeInt); } - static PrivateKey privateKeyFromP12File(String privateKeyFile, String password) { + static PrivateKey privateKeyFromP12Bytes(byte[] privateKey, String password) { try { - InputStream stream = Files.newInputStream(Paths.get(privateKeyFile)); + InputStream stream = new ByteArrayInputStream(privateKey); return SecurityUtils.loadPrivateKeyFromKeyStore( SecurityUtils.getPkcs12KeyStore(), stream, "notasecret", "privatekey", password); } catch (IOException | GeneralSecurityException e) { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index 5ffa6c254f..f240d3d11a 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -34,6 +34,7 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.Set; +import java.util.function.Supplier; import java.util.logging.Level; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -358,7 +359,7 @@ protected boolean removeEldestEntry(Map.Entry> eldes BigQueryConnectionProperty.newBuilder() .setName(PROJECT_ID_PROPERTY_NAME) .setDescription("A globally unique identifier for your project.") - .setDefaultValue(BigQueryOptions.getDefaultProjectId()) + .setLazyDefaultValue(() -> BigQueryOptions.getDefaultProjectId()) .build(), BigQueryConnectionProperty.newBuilder() .setName(LOG_PATH_PROPERTY_NAME) @@ -790,6 +791,19 @@ static String parseStringProperty( return defaultValue; } + static String parseStringPropertyLazyDefault( + String url, + String propertyName, + Supplier defaultValueSupplier, + String callerClassName) { + LOG.finest("++enter++\t" + callerClassName); + String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + if (parsedValue != null) { + return parsedValue; + } + return defaultValueSupplier.get(); + } + static List parseStringListProperty( String url, String propertyName, String callerClassName) { LOG.finest("++enter++\t" + callerClassName); diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java index 1cc0ad7bb5..4da6165b20 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -21,6 +21,8 @@ import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.cloud.bigquery.BigQuery; +import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode; import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.cloud.bigquery.storage.v1.BigQueryReadClient; import com.google.cloud.bigquery.storage.v1.BigQueryWriteClient; @@ -38,6 +40,9 @@ public class BigQueryConnectionTest { private static final String DEFAULT_VERSION = "0.0.0"; private static final String DEFAULT_JDBC_TOKEN_VALUE = "Google-BigQuery-JDBC-Driver"; + private static final String BASE_URL = + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;OAuthAccessToken=redacted;ProjectId=project;"; private String expectedVersion; @Before @@ -381,4 +386,34 @@ public void testBigQueryReadClientKeepAliveSettings() throws SQLException, IOExc assertTrue(grpcProvider.getKeepAliveWithoutCalls()); } } + + @Test + public void testBigQueryJobCreationMode_required() throws Exception { + String url = BASE_URL + "JobCreationMode=1;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + BigQuery bq = connection.getBigQuery(); + assertEquals( + bq.getOptions().getDefaultJobCreationMode(), JobCreationMode.JOB_CREATION_REQUIRED); + } + } + + @Test + public void testBigQueryJobCreationMode_optional() throws Exception { + String url = BASE_URL + "JobCreationMode=2;"; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + BigQuery bq = connection.getBigQuery(); + assertEquals( + bq.getOptions().getDefaultJobCreationMode(), JobCreationMode.JOB_CREATION_OPTIONAL); + } + } + + @Test + public void testBigQueryJobCreationMode_default() throws Exception { + String url = BASE_URL; + try (BigQueryConnection connection = new BigQueryConnection(url)) { + BigQuery bq = connection.getBigQuery(); + assertEquals( + bq.getOptions().getDefaultJobCreationMode(), JobCreationMode.JOB_CREATION_OPTIONAL); + } + } } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java index b7fc031621..5129a74961 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java @@ -32,6 +32,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.nio.file.Files; import java.nio.file.Paths; import java.security.PrivateKey; import java.util.Collections; @@ -472,12 +473,12 @@ public void testPrivateKeyFromPkcs8_wrong() { // keytool -genkey -alias privatekey -keyalg RSA -keysize 2048 -storepass notasecret \ // -keypass notasecret -storetype pkcs12 -keystore ./fake.p12 @Test - public void testPrivateKeyFromP12File() { + public void testPrivateKeyFromP12Bytes() { URL resource = BigQueryJdbcOAuthUtilityTest.class.getResource("/fake.p12"); try { PrivateKey pk = - BigQueryJdbcOAuthUtility.privateKeyFromP12File( - Paths.get(resource.toURI()).toAbsolutePath().toString(), "notasecret"); + BigQueryJdbcOAuthUtility.privateKeyFromP12Bytes( + Files.readAllBytes(Paths.get(resource.toURI())), "notasecret"); assertNotNull(pk); } catch (Exception e) { assertTrue(false); @@ -485,18 +486,12 @@ public void testPrivateKeyFromP12File() { } @Test - public void testPrivateKeyFromP12File_missing_file() { - PrivateKey pk = BigQueryJdbcOAuthUtility.privateKeyFromP12File("", ""); - assertNull(pk); - } - - @Test - public void testPrivateKeyFromP12File_wrong_password() { + public void testPrivateKeyFromP12Bytes_wrong_password() { URL resource = BigQueryJdbcOAuthUtilityTest.class.getResource("/fake.p12"); try { PrivateKey pk = - BigQueryJdbcOAuthUtility.privateKeyFromP12File( - Paths.get(resource.toURI()).toAbsolutePath().toString(), "fake"); + BigQueryJdbcOAuthUtility.privateKeyFromP12Bytes( + Files.readAllBytes(Paths.get(resource.toURI())), "fake"); assertNull(pk); } catch (Exception e) { assertTrue(false); From ecbf40203d2e981cf5b4087e4e01d6d177380d5c Mon Sep 17 00:00:00 2001 From: Kirill Logachev Date: Fri, 6 Mar 2026 14:15:17 -0800 Subject: [PATCH 2266/2268] chore(jdbc): add console logs during tests (#4130) --- google-cloud-bigquery-jdbc/pom.xml | 12 ++++++++++++ .../bigquery/jdbc/BigQueryJdbcRootLogger.java | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/google-cloud-bigquery-jdbc/pom.xml b/google-cloud-bigquery-jdbc/pom.xml index 776a9bad27..2f225b6d87 100644 --- a/google-cloud-bigquery-jdbc/pom.xml +++ b/google-cloud-bigquery-jdbc/pom.xml @@ -48,6 +48,18 @@ 3.5.2 ${skipSurefire} + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + true + diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java index ef963d87d3..a672344155 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcRootLogger.java @@ -43,6 +43,7 @@ class BigQueryJdbcRootLogger { private static final Logger logger = Logger.getLogger("com.google.cloud.bigquery"); private static final Logger storageLogger = Logger.getLogger("com.google.cloud.bigquery.storage"); + private static final boolean isTest = Boolean.getBoolean("JDBC_TESTS"); private static Handler fileHandler = null; private static Path currentLogPath = null; @@ -51,6 +52,12 @@ class BigQueryJdbcRootLogger { static { logger.setUseParentHandlers(false); storageLogger.setUseParentHandlers(true); + if (isTest) { + ConsoleHandler consoleHandler = new ConsoleHandler(); + consoleHandler.setLevel(Level.SEVERE); + consoleHandler.setFormatter(getFormatter()); + logger.addHandler(consoleHandler); + } } public static Formatter getFormatter() { @@ -111,13 +118,12 @@ private static void setHandler() throws IOException { // If File handler exists, use it. Else create new one. for (Handler h : logger.getHandlers()) { if (h instanceof ConsoleHandler) { - h.close(); - logger.removeHandler(h); - break; - } - if (h instanceof FileHandler) { + if (!isTest) { + h.close(); + logger.removeHandler(h); + } + } else if (h instanceof FileHandler) { fileHandler = h; - break; } } From d3b8bded8d1cce9777fa5b40d72c0d6f7b9637a7 Mon Sep 17 00:00:00 2001 From: Keshav Dandeva Date: Sat, 7 Mar 2026 00:22:28 +0100 Subject: [PATCH 2267/2268] feat(jdbc): centralize connection properties from `BigQueryConnection` and `DataSource` (#4116) --- .../bigquery/jdbc/BigQueryConnection.java | 286 ++----- .../jdbc/BigQueryDatabaseMetaData.java | 9 +- .../cloud/bigquery/jdbc/BigQueryDriver.java | 16 +- .../jdbc/BigQueryJdbcOAuthUtility.java | 155 ++-- .../jdbc/BigQueryJdbcProxyUtility.java | 25 +- .../bigquery/jdbc/BigQueryJdbcUrlUtility.java | 271 +------ .../jdbc/BigQueryPooledConnection.java | 8 +- .../cloud/bigquery/jdbc/DataSource.java | 547 ++++++++++++- .../jdbc/PooledConnectionDataSource.java | 7 +- .../bigquery/jdbc/BigQueryConnectionTest.java | 11 +- .../jdbc/BigQueryJdbcOAuthUtilityTest.java | 139 ++-- .../jdbc/BigQueryJdbcUrlUtilityTest.java | 741 +----------------- .../jdbc/BigQueryPooledConnectionTest.java | 2 + .../jdbc/PooledConnectionDataSourceTest.java | 29 +- .../jdbc/PooledConnectionListenerTest.java | 4 + .../bigquery/jdbc/it/ITBigQueryJDBCTest.java | 2 +- 16 files changed, 801 insertions(+), 1451 deletions(-) diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java index 75d472de9e..17471e2522 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java @@ -74,7 +74,7 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { String connectionClassName = this.toString(); private static final String DEFAULT_JDBC_TOKEN_VALUE = "Google-BigQuery-JDBC-Driver"; private static final String DEFAULT_VERSION = "0.0.0"; - private static HeaderProvider HEADER_PROVIDER; + private HeaderProvider headerProvider; BigQueryReadClient bigQueryReadClient = null; BigQueryWriteClient bigQueryWriteClient = null; BigQuery bigQuery; @@ -126,7 +126,7 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { int writeAPIActivationRowCount; int writeAPIAppendRowCount; int requestGoogleDriveScope; - List additionalProjects; + String additionalProjects; boolean filterTablesOnDefaultDataset; String sslTrustStorePath; String sslTrustStorePassword; @@ -135,57 +135,45 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { Integer httpConnectTimeout; Integer httpReadTimeout; String requestReason; + Long connectionPoolSize; + Long listenerPoolSize; + String partnerToken; BigQueryConnection(String url) throws IOException { + this(url, DataSource.fromUrl(url)); + } + + BigQueryConnection(String url, DataSource ds) throws IOException { this.connectionUrl = url; this.openStatements = ConcurrentHashMap.newKeySet(); this.autoCommit = true; this.sqlWarnings = new ArrayList<>(); this.transactionStarted = false; this.isClosed = false; - this.labels = BigQueryJdbcUrlUtility.parseLabels(url, connectionClassName); - this.maxBytesBilled = - BigQueryJdbcUrlUtility.parseMaximumBytesBilled(url, this.connectionClassName); - this.retryTimeoutInSeconds = - BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(url, this.connectionClassName); + + this.labels = ds.getLabels() != null ? ds.getLabels() : new java.util.HashMap<>(); + this.maxBytesBilled = ds.getMaximumBytesBilled(); + this.retryTimeoutInSeconds = ds.getTimeout(); this.retryTimeoutDuration = Duration.ofMillis(retryTimeoutInSeconds * 1000L); - this.retryInitialDelayInSeconds = - BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(url, this.connectionClassName); + this.retryInitialDelayInSeconds = ds.getRetryInitialDelay(); this.retryInitialDelayDuration = Duration.ofMillis(retryInitialDelayInSeconds * 1000L); - this.retryMaxDelayInSeconds = - BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(url, this.connectionClassName); + this.retryMaxDelayInSeconds = ds.getRetryMaxDelay(); this.retryMaxDelayDuration = Duration.ofMillis(retryMaxDelayInSeconds * 1000L); - this.jobTimeoutInSeconds = - BigQueryJdbcUrlUtility.parseJobTimeout(url, this.connectionClassName); + this.jobTimeoutInSeconds = ds.getJobTimeout(); this.authProperties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.connectionClassName); - this.catalog = - BigQueryJdbcUrlUtility.parseStringPropertyLazyDefault( - url, - BigQueryJdbcUrlUtility.PROJECT_ID_PROPERTY_NAME, - () -> BigQueryOptions.getDefaultProjectId(), - this.connectionClassName); - this.universeDomain = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_UNIVERSE_DOMAIN_VALUE, - this.connectionClassName); - this.overrideProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(url, this.connectionClassName); - if (universeDomain != null) { + BigQueryJdbcOAuthUtility.parseOAuthProperties(ds, this.connectionClassName); + this.catalog = ds.getProjectId(); + this.universeDomain = ds.getUniverseDomain(); + + this.overrideProperties = ds.getOverrideProperties(); + if (this.universeDomain != null) { this.overrideProperties.put( - BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, universeDomain); + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, this.universeDomain); } this.credentials = BigQueryJdbcOAuthUtility.getCredentials( authProperties, overrideProperties, this.connectionClassName); - String defaultDatasetString = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.DEFAULT_DATASET_PROPERTY_NAME, - null, - this.connectionClassName); + String defaultDatasetString = ds.getDefaultDataset(); if (defaultDatasetString == null || defaultDatasetString.trim().isEmpty()) { this.defaultDataset = null; } else { @@ -200,94 +188,27 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { + " projectId.datasetId"); } } - this.location = - BigQueryJdbcUrlUtility.parseStringProperty( - url, BigQueryJdbcUrlUtility.LOCATION_PROPERTY_NAME, null, this.connectionClassName); - this.enableHighThroughputAPI = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.ENABLE_HTAPI_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_ENABLE_HTAPI_VALUE, - this.connectionClassName); - this.highThroughputMinTableSize = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE, - this.connectionClassName); - this.highThroughputActivationRatio = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.HTAPI_ACTIVATION_RATIO_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE, - this.connectionClassName); - this.useQueryCache = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.USE_QUERY_CACHE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_USE_QUERY_CACHE, - this.connectionClassName); - this.useStatelessQueryMode = - BigQueryJdbcUrlUtility.parseJobCreationMode(url, this.connectionClassName); - this.queryDialect = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.QUERY_DIALECT_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_QUERY_DIALECT_VALUE, - this.connectionClassName); - this.allowLargeResults = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.ALLOW_LARGE_RESULTS_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_ALLOW_LARGE_RESULTS, - this.connectionClassName); - this.destinationTable = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.LARGE_RESULTS_TABLE_PROPERTY_NAME, - null, - this.connectionClassName); - this.destinationDataset = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.LARGE_RESULTS_DATASET_PROPERTY_NAME, - null, - this.connectionClassName); - this.destinationDatasetExpirationTime = - BigQueryJdbcUrlUtility.parseLongProperty( - url, - BigQueryJdbcUrlUtility.DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_DESTINATION_DATASET_EXPIRATION_TIME_VALUE, - this.connectionClassName); - this.kmsKeyName = - BigQueryJdbcUrlUtility.parseStringProperty( - url, BigQueryJdbcUrlUtility.KMS_KEY_NAME_PROPERTY_NAME, null, this.connectionClassName); + this.location = ds.getLocation(); + this.enableHighThroughputAPI = ds.getEnableHighThroughputAPI(); + this.highThroughputMinTableSize = ds.getHighThroughputMinTableSize(); + this.highThroughputActivationRatio = ds.getHighThroughputActivationRatio(); + this.useQueryCache = ds.getUseQueryCache(); + this.useStatelessQueryMode = ds.getUseStatelessQueryMode(); + + this.queryDialect = ds.getQueryDialect(); + this.allowLargeResults = ds.getAllowLargeResults(); + this.destinationTable = ds.getDestinationTable(); + this.destinationDataset = ds.getDestinationDataset(); + this.destinationDatasetExpirationTime = ds.getDestinationDatasetExpirationTime(); + this.kmsKeyName = ds.getKmsKeyName(); Map proxyProperties = - BigQueryJdbcProxyUtility.parseProxyProperties(url, this.connectionClassName); - this.sslTrustStorePath = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROPERTY_NAME, - null, - this.connectionClassName); - this.sslTrustStorePassword = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, - null, - this.connectionClassName); - this.httpConnectTimeout = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, - null, - this.connectionClassName); - this.httpReadTimeout = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, - null, - this.connectionClassName); + BigQueryJdbcProxyUtility.parseProxyProperties(ds, this.connectionClassName); + + this.sslTrustStorePath = ds.getSSLTrustStorePath(); + this.sslTrustStorePassword = ds.getSSLTrustStorePassword(); + this.httpConnectTimeout = ds.getHttpConnectTimeout(); + this.httpReadTimeout = ds.getHttpReadTimeout(); + this.httpTransportOptions = BigQueryJdbcProxyUtility.getHttpTransportOptions( proxyProperties, @@ -302,77 +223,27 @@ public class BigQueryConnection extends BigQueryNoOpsConnection { this.sslTrustStorePath, this.sslTrustStorePassword, this.connectionClassName); - this.enableSession = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.ENABLE_SESSION_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_ENABLE_SESSION_VALUE, - this.connectionClassName); - this.unsupportedHTAPIFallback = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_UNSUPPORTED_HTAPI_FALLBACK_VALUE, - this.connectionClassName); - this.maxResults = - BigQueryJdbcUrlUtility.parseLongProperty( - url, - BigQueryJdbcUrlUtility.MAX_RESULTS_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_MAX_RESULTS_VALUE, - this.connectionClassName); - Map queryPropertiesMap = - BigQueryJdbcUrlUtility.parseQueryProperties(url, this.connectionClassName); + this.enableSession = ds.getEnableSession(); + this.unsupportedHTAPIFallback = ds.getUnsupportedHTAPIFallback(); + this.maxResults = ds.getMaxResults(); + Map queryPropertiesMap = ds.getQueryProperties(); this.sessionInfoConnectionProperty = getSessionPropertyFromQueryProperties(queryPropertiesMap); this.queryProperties = convertMapToConnectionPropertiesList(queryPropertiesMap); - this.enableWriteAPI = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.ENABLE_WRITE_API_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_ENABLE_WRITE_API_VALUE, - this.connectionClassName); - this.writeAPIActivationRowCount = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_SWA_ACTIVATION_ROW_COUNT_VALUE, - this.connectionClassName); - this.writeAPIAppendRowCount = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.SWA_APPEND_ROW_COUNT_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_SWA_APPEND_ROW_COUNT_VALUE, - this.connectionClassName); - this.additionalProjects = - BigQueryJdbcUrlUtility.parseStringListProperty( - url, - BigQueryJdbcUrlUtility.ADDITIONAL_PROJECTS_PROPERTY_NAME, - this.connectionClassName); - this.filterTablesOnDefaultDataset = - BigQueryJdbcUrlUtility.parseBooleanProperty( - url, - BigQueryJdbcUrlUtility.FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_FILTER_TABLES_ON_DEFAULT_DATASET_VALUE, - this.connectionClassName); - this.requestGoogleDriveScope = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, - this.connectionClassName); - this.metadataFetchThreadCount = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE, - this.connectionClassName); - this.requestReason = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, - null, - this.connectionClassName); + this.enableWriteAPI = ds.getEnableWriteAPI(); + this.writeAPIActivationRowCount = ds.getSwaActivationRowCount(); + this.writeAPIAppendRowCount = ds.getSwaAppendRowCount(); - HEADER_PROVIDER = createHeaderProvider(); + this.additionalProjects = ds.getAdditionalProjects(); + + this.filterTablesOnDefaultDataset = ds.getFilterTablesOnDefaultDataset(); + this.requestGoogleDriveScope = ds.getRequestGoogleDriveScope(); + this.metadataFetchThreadCount = ds.getMetadataFetchThreadCount(); + this.requestReason = ds.getRequestReason(); + this.connectionPoolSize = ds.getConnectionPoolSize(); + this.listenerPoolSize = ds.getListenerPoolSize(); + this.partnerToken = ds.getPartnerToken(); + + this.headerProvider = createHeaderProvider(); this.bigQuery = getBigQueryConnection(); } @@ -394,19 +265,11 @@ String getLibraryVersion(Class libraryClass) { return version != null ? version : DEFAULT_VERSION; } - private String buildPartnerToken(String url) { - String partnerTokenString = - BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, this.connectionClassName); - if (partnerTokenString == null || partnerTokenString.isEmpty()) { - return ""; - } - return partnerTokenString; - } - HeaderProvider createHeaderProvider() { - String partnerToken = buildPartnerToken(this.connectionUrl); - String headerToken = - DEFAULT_JDBC_TOKEN_VALUE + "/" + getLibraryVersion(this.getClass()) + partnerToken; + String headerToken = DEFAULT_JDBC_TOKEN_VALUE + "/" + getLibraryVersion(this.getClass()); + if (this.partnerToken != null && !this.partnerToken.isEmpty()) { + headerToken += this.partnerToken; + } Map headers = new java.util.HashMap<>(); headers.put("user-agent", headerToken); if (this.requestReason != null) { @@ -713,7 +576,7 @@ int getHighThroughputMinTableSize() { return highThroughputMinTableSize; } - List getAdditionalProjects() { + String getAdditionalProjects() { return this.additionalProjects; } @@ -761,6 +624,14 @@ Integer getHttpReadTimeout() { return httpReadTimeout; } + Long getConnectionPoolSize() { + return connectionPoolSize; + } + + Long getListenerPoolSize() { + return listenerPoolSize; + } + @Override public boolean isValid(int timeout) throws SQLException { if (timeout < 0) { @@ -1064,17 +935,18 @@ private BigQuery getBigQueryConnection() { bigQueryOptions.setTransportOptions(this.httpTransportOptions); } - BigQueryOptions options = bigQueryOptions.setHeaderProvider(HEADER_PROVIDER).build(); + BigQueryOptions options = bigQueryOptions.setHeaderProvider(this.headerProvider).build(); options.setDefaultJobCreationMode( this.useStatelessQueryMode ? JobCreationMode.JOB_CREATION_OPTIONAL : JobCreationMode.JOB_CREATION_REQUIRED); + return options.getService(); } private BigQueryReadClient getBigQueryReadClientConnection() throws IOException { BigQueryReadSettings.Builder bigQueryReadSettings = - BigQueryReadSettings.newBuilder().setHeaderProvider(HEADER_PROVIDER); + BigQueryReadSettings.newBuilder().setHeaderProvider(this.headerProvider); if (getRetrySettings() != null) { bigQueryReadSettings.createReadSessionSettings().setRetrySettings(getRetrySettings()); } @@ -1116,7 +988,7 @@ private BigQueryReadClient getBigQueryReadClientConnection() throws IOException private BigQueryWriteClient getBigQueryWriteClientConnection() throws IOException { BigQueryWriteSettings.Builder bigQueryWriteSettings = - BigQueryWriteSettings.newBuilder().setHeaderProvider(HEADER_PROVIDER); + BigQueryWriteSettings.newBuilder().setHeaderProvider(this.headerProvider); if (getRetrySettings() != null) { bigQueryWriteSettings.createWriteStreamSettings().setRetrySettings(getRetrySettings()); } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java index 75c4559076..feca69ea12 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java @@ -5208,8 +5208,13 @@ private List getAccessibleCatalogNames() { accessibleCatalogs.add(primaryCatalog); } - List additionalProjects = this.connection.getAdditionalProjects(); - if (additionalProjects != null) { + String additionalProjectsStr = this.connection.getAdditionalProjects(); + if (additionalProjectsStr != null && !additionalProjectsStr.trim().isEmpty()) { + List additionalProjects = + com.google.common.base.Splitter.on(',') + .trimResults() + .omitEmptyStrings() + .splitToList(additionalProjectsStr); for (String project : additionalProjects) { if (project != null && !project.isEmpty()) { accessibleCatalogs.add(project); diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java index 68b00cb6c3..930fc42af2 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java @@ -130,19 +130,17 @@ public Connection connect(String url, Properties info) throws SQLException { throw new BigQueryJdbcException(e.getMessage(), e); } + DataSource ds = DataSource.fromUrl(connectionUri); + // LogLevel - String logLevelStr = - BigQueryJdbcUrlUtility.parseUriProperty( - connectionUri, BigQueryJdbcUrlUtility.LOG_LEVEL_PROPERTY_NAME); + String logLevelStr = ds.getLogLevel(); if (logLevelStr == null) { logLevelStr = System.getenv(BigQueryJdbcUrlUtility.LOG_LEVEL_ENV_VAR); } Level logLevel = BigQueryJdbcUrlUtility.parseLogLevel(logLevelStr); // LogPath - String logPath = - BigQueryJdbcUrlUtility.parseUriProperty( - connectionUri, BigQueryJdbcUrlUtility.LOG_PATH_PROPERTY_NAME); + String logPath = ds.getLogPath(); if (logPath == null) { logPath = System.getenv(BigQueryJdbcUrlUtility.LOG_PATH_ENV_VAR); } @@ -153,7 +151,7 @@ public Connection connect(String url, Properties info) throws SQLException { BigQueryJdbcRootLogger.setLevel(logLevel, logPath); // Logging starts from here. - BigQueryConnection connection = new BigQueryConnection(connectionUri); + BigQueryConnection connection = new BigQueryConnection(connectionUri, ds); LOG.info( "Driver info : { {Database Product Name : %s}, " + "{Database Product Version : %s}, " @@ -216,8 +214,10 @@ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) { driverProperty.description = prop.getDescription(); propertyInfoList.add(driverProperty); } + + DataSource ds = DataSource.fromUrl(connectionUri); Map oAuthProperties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.toString()); + BigQueryJdbcOAuthUtility.parseOAuthProperties(ds, this.toString()); for (Map.Entry authProperty : oAuthProperties.entrySet()) { propertyInfoList.add(new DriverPropertyInfo(authProperty.getKey(), authProperty.getValue())); } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java index 11d79ae4b8..f7be358dde 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java @@ -106,19 +106,13 @@ final class BigQueryJdbcOAuthUtility { * @param url The URL to parse. * @return A map of OAuth properties. */ - static Map parseOAuthProperties(String url, String callerClassName) { + static Map parseOAuthProperties(DataSource ds, String callerClassName) { LOG.finest("++enter++\t" + callerClassName); Map oauthProperties = new HashMap<>(); AuthType authType; try { - authType = - AuthType.fromValue( - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_TYPE_VALUE, - callerClassName)); + authType = AuthType.fromValue(ds.getOAuthType()); } catch (NumberFormatException exception) { throw new IllegalArgumentException(OAUTH_TYPE_ERROR_MESSAGE); } @@ -129,21 +123,10 @@ static Map parseOAuthProperties(String url, String callerClassNa // need: project id, OAuthServiceAcctEmail and OAuthPvtKey or OAuthPvtKeyPath that can be // .p12 or json. // TODO: validation if .p12 or json file can be in getPropertyInfo can be handy for user - String serviceAccountEmail = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME); - String serviceAccountPK = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME); - String serviceAccountPrivateKeyPath = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); - String p12Password = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_P12_PASSWORD_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_P12_PASSWORD_VALUE, - callerClassName); + String serviceAccountEmail = ds.getOAuthServiceAcctEmail(); + String serviceAccountPK = ds.getOAuthPvtKey(); + String serviceAccountPrivateKeyPath = ds.getOAuthPvtKeyPath(); + String p12Password = ds.getOAuthP12Password(); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME, serviceAccountEmail); @@ -158,48 +141,31 @@ static Map parseOAuthProperties(String url, String callerClassNa break; case GOOGLE_USER_ACCOUNT: oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); + BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, ds.getOAuthClientId()); oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); - int reqGoogleDriveScope = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, - callerClassName); + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, ds.getOAuthClientSecret()); + int reqGoogleDriveScope = ds.getRequestGoogleDriveScope(); oauthProperties.put( BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, String.valueOf(reqGoogleDriveScope)); LOG.fine("RequestGoogleDriveScope parsed."); break; case PRE_GENERATED_TOKEN: - String refreshToken = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME); + String refreshToken = ds.getOAuthRefreshToken(); if (refreshToken != null) { oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME, refreshToken); LOG.fine("OAuthRefreshToken provided."); oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME)); + BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, ds.getOAuthClientId()); LOG.fine("OAuthClientId provided."); oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME)); + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, ds.getOAuthClientSecret()); LOG.fine("OAuthClientSecret provided."); break; } oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME)); + BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME, ds.getOAuthAccessToken()); LOG.fine("OAuthAccessToken provided."); break; case APPLICATION_DEFAULT_CREDENTIALS: @@ -209,38 +175,52 @@ static Map parseOAuthProperties(String url, String callerClassNa case EXTERNAL_ACCOUNT_AUTH: // For External account authentication (OAuth Type 4) // need: project id, OAuthPvtKey or OAuthPvtKeyPath or BYOID_PROPERTIES - String pvtKey = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME); - String pvtKeyPath = - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME); + String pvtKey = ds.getOAuthPvtKey(); + String pvtKeyPath = ds.getOAuthPvtKeyPath(); if (pvtKey != null) { - oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME)); + oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, pvtKey); LOG.fine("OAuthPvtKey provided."); } else if (pvtKeyPath != null) { - oauthProperties.put( - BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseUriProperty( - url, BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME)); + oauthProperties.put(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, pvtKeyPath); LOG.fine("OAuthPvtKeyPath provided."); } else { - for (String property : BigQueryJdbcUrlUtility.BYOID_PROPERTIES) { - String value = - BigQueryJdbcUrlUtility.parseBYOIDProperty(url, property, callerClassName); - if (value != null) { - oauthProperties.put(property, value); - LOG.fine(property + " provided."); - } + if (ds.getByoidAudienceUri() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_AUDIENCE_URI_PROPERTY_NAME, ds.getByoidAudienceUri()); + } + if (ds.getByoidCredentialSource() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME, + ds.getByoidCredentialSource()); } - String universeDomainProp = BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME; - String universeDomain = BigQueryJdbcUrlUtility.parseUriProperty(url, universeDomainProp); + if (ds.getByoidPoolUserProject() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_POOL_USER_PROJECT_PROPERTY_NAME, + ds.getByoidPoolUserProject()); + } + if (ds.getByoidSAImpersonationUri() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME, + ds.getByoidSAImpersonationUri()); + } + if (ds.getByoidSubjectTokenType() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME, + ds.getByoidSubjectTokenType()); + } + if (ds.getByoidTokenUri() != null) { + oauthProperties.put( + BigQueryJdbcUrlUtility.BYOID_TOKEN_URI_PROPERTY_NAME, ds.getByoidTokenUri()); + } + + String universeDomain = ds.getUniverseDomain(); if (universeDomain != null) { - oauthProperties.put(universeDomainProp, universeDomain); - LOG.fine(universeDomainProp + " provided. Caller : " + callerClassName); + oauthProperties.put( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, universeDomain); + LOG.fine( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME + + " provided. Caller : " + + callerClassName); } } break; @@ -251,32 +231,20 @@ static Map parseOAuthProperties(String url, String callerClassNa || authType == AuthType.PRE_GENERATED_TOKEN) { oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_EMAIL_VALUE, - callerClassName)); + ds.getOAuthSAImpersonationEmail()); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_CHAIN_VALUE, - callerClassName)); + ds.getOAuthSAImpersonationChain()); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE, - callerClassName)); + ds.getOAuthSAImpersonationScopes() != null + ? ds.getOAuthSAImpersonationScopes() + : BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_SCOPES_VALUE); oauthProperties.put( BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE, - callerClassName)); + ds.getOAuthSAImpersonationTokenLifetime() != null + ? ds.getOAuthSAImpersonationTokenLifetime() + : BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_VALUE); } return oauthProperties; } @@ -437,7 +405,8 @@ static UserAuthorizer getUserAuthorizer( } } catch (NumberFormatException e) { LOG.severe( - "Invalid value for RequestGoogleDriveScope, defaulting to not request Drive scope. Caller: " + "Invalid value for RequestGoogleDriveScope, defaulting to not request Drive scope." + + " Caller: " + callerClassName); } } diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java index b630505f22..52eef2739d 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcProxyUtility.java @@ -61,34 +61,27 @@ final class BigQueryJdbcProxyUtility { private BigQueryJdbcProxyUtility() {} - static Map parseProxyProperties(String URL, String callerClassName) { + static Map parseProxyProperties(DataSource ds, String callerClassName) { LOG.finest("++enter++\t" + callerClassName); Map proxyProperties = new HashMap<>(); - String proxyHost = - BigQueryJdbcUrlUtility.parseUriProperty( - URL, BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME); + String proxyHost = ds.getProxyHost(); if (proxyHost != null) { proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, proxyHost); } - String proxyPort = - BigQueryJdbcUrlUtility.parseUriProperty( - URL, BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME); + String proxyPort = ds.getProxyPort(); if (proxyPort != null) { if (!Pattern.compile(validPortRegex).matcher(proxyPort).find()) { throw new IllegalArgumentException( - "Illegal port number provided %s. Please provide a valid port number."); + String.format( + "Illegal port number provided %s. Please provide a valid port number.", proxyPort)); } proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, proxyPort); } - String proxyUid = - BigQueryJdbcUrlUtility.parseUriProperty( - URL, BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME); + String proxyUid = ds.getProxyUid(); if (proxyUid != null) { proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME, proxyUid); } - String proxyPwd = - BigQueryJdbcUrlUtility.parseUriProperty( - URL, BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME); + String proxyPwd = ds.getProxyPwd(); if (proxyPwd != null) { proxyProperties.put(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME, proxyPwd); } @@ -114,6 +107,10 @@ static Map parseProxyProperties(String URL, String callerClassNa return proxyProperties; } + static Map parseProxyProperties(String URL, String callerClassName) { + return parseProxyProperties(DataSource.fromUrl(URL), callerClassName); + } + static HttpTransportOptions getHttpTransportOptions( Map proxyProperties, String sslTrustStorePath, diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java index f240d3d11a..5b89cf27ee 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtility.java @@ -19,11 +19,9 @@ import com.google.api.client.util.escape.CharEscapers; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; +import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.net.UrlEscapers; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -34,11 +32,9 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import java.util.function.Supplier; import java.util.logging.Level; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.stream.Collectors; /** * This class implements all the methods that parse Connection property values from the Connection @@ -135,7 +131,10 @@ protected boolean removeEldestEntry(Map.Entry> eldes static final String BYOID_POOL_USER_PROJECT_PROPERTY_NAME = "BYOID_PoolUserProject"; static final String BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME = "BYOID_SA_Impersonation_Uri"; static final String BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME = "BYOID_SubjectTokenType"; + static final String DEFAULT_BYOID_SUBJECT_TOKEN_TYPE_VALUE = + "urn:ietf:params:oauth:tokentype:id_token"; static final String BYOID_TOKEN_URI_PROPERTY_NAME = "BYOID_TokenUri"; + static final String DEFAULT_BYOID_TOKEN_URI_VALUE = "https://sts.googleapis.com/v1/token"; static final String PARTNER_TOKEN_PROPERTY_NAME = "PartnerToken"; private static final Pattern PARTNER_TOKEN_PATTERN = Pattern.compile( @@ -514,7 +513,7 @@ protected boolean removeEldestEntry(Map.Entry> eldes + " Corresponds\n" + " to the subject_token_type property in the external account" + " configuration file.") - .setDefaultValue("urn:ietf:params:oauth:tokentype:id_token") + .setDefaultValue(DEFAULT_BYOID_SUBJECT_TOKEN_TYPE_VALUE) .build(), BigQueryConnectionProperty.newBuilder() .setName(BYOID_TOKEN_URI_PROPERTY_NAME) @@ -524,7 +523,7 @@ protected boolean removeEldestEntry(Map.Entry> eldes + " tokens. Corresponds to the token_url property in the external" + " account\n" + " configuration file.") - .setDefaultValue("https://sts.googleapis.com/v1/token") + .setDefaultValue(DEFAULT_BYOID_TOKEN_URI_VALUE) .build(), BigQueryConnectionProperty.newBuilder() .setName(PARTNER_TOKEN_PROPERTY_NAME) @@ -711,7 +710,7 @@ private static Map parseUrlInternal(String url) { String.format("Wrong value or unknown setting: %s", safeRef)); } - map.put(PROPERTY_NAME_MAP.get(key), CharEscapers.decodeUriPath(kv[1])); + map.put(PROPERTY_NAME_MAP.get(key), CharEscapers.decodeUriPath(kv[1].replace("+", "%2B"))); } return Collections.unmodifiableMap(map); } @@ -772,109 +771,6 @@ static boolean convertIntToBoolean(String value, String propertyName) { } } - // todo just make it a map - static Map parseQueryProperties(String url, String callerClassName) { - return parsePropertiesMap(url, QUERY_PROPERTIES_NAME, callerClassName); - } - - static Map parseLabels(String url, String callerClassName) { - return parsePropertiesMap(url, LABELS_PROPERTY_NAME, callerClassName); - } - - static String parseStringProperty( - String url, String propertyName, String defaultValue, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); - if (parsedValue != null) { - return parsedValue; - } - return defaultValue; - } - - static String parseStringPropertyLazyDefault( - String url, - String propertyName, - Supplier defaultValueSupplier, - String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); - if (parsedValue != null) { - return parsedValue; - } - return defaultValueSupplier.get(); - } - - static List parseStringListProperty( - String url, String propertyName, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String rawValue = parseStringProperty(url, propertyName, null, callerClassName); - if (rawValue == null || rawValue.trim().isEmpty()) { - return Collections.emptyList(); - } - return Arrays.stream(rawValue.split(",")) - .map(String::trim) - .filter(s -> !s.isEmpty()) - .collect(Collectors.toList()); - } - - public static String parsePartnerTokenProperty(String url, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - // This property is expected to be set by partners only. For more details on exact format - // supported, refer b/396086960 - Matcher matcher = PARTNER_TOKEN_PATTERN.matcher(url); - if (matcher.find()) { - String rawToken = matcher.group(1).trim(); - String token = - (rawToken.startsWith("(") && rawToken.endsWith(")")) - ? rawToken.substring(1, rawToken.length() - 1).trim() - : rawToken; - - if (token.toUpperCase().startsWith("GPN:")) { - return " (" + token + ")"; - } - } - return null; - } - - static Integer parseIntProperty( - String url, String propertyName, Integer defaultValue, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); - if (parsedValue != null) { - try { - return Integer.parseInt(parsedValue); - } catch (NumberFormatException e) { - LOG.severe( - "Invalid integer value '%s' for property '%s'. Please provide a valid integer.", - parsedValue, propertyName); - throw new IllegalArgumentException( - String.format("Invalid integer value for property '%s': %s", propertyName, parsedValue), - e); - } - } - return defaultValue; - } - - static Long parseLongProperty( - String url, String propertyName, Long defaultValue, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); - if (parsedValue != null) { - return Long.parseLong(parsedValue); - } - return defaultValue; - } - - static Boolean parseBooleanProperty( - String url, String propertyName, Boolean defaultValue, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String parsedValue = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); - if (parsedValue != null) { - return convertIntToBoolean(parsedValue, propertyName); - } - return defaultValue; - } - public static Level parseLogLevel(String logLevelString) { int logLevel = logLevelString != null ? Integer.parseInt(logLevelString) : DEFAULT_LOG_LEVEL; switch (logLevel) { @@ -901,156 +797,21 @@ public static Level parseLogLevel(String logLevelString) { } } - static Map parseOverrideProperties(String url, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - Map overrideProps = new HashMap<>(); - Pattern pattern = - Pattern.compile( - String.format( - "(?is)(%s|%s)=([^;]+)", - ENDPOINT_OVERRIDES_PROPERTY_NAME, PRIVATE_SERVICE_CONNECT_PROPERTY_NAME)); - Matcher matcher = pattern.matcher(url); - String overridePropertiesString; - if (matcher.find() && matcher.groupCount() >= 1) { - try { - overridePropertiesString = - URLDecoder.decode(matcher.group(2), StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new BigQueryJdbcRuntimeException(e); - } - } else { - return overrideProps; - } - for (String property : OVERRIDE_PROPERTIES) { - Pattern propertyPattern = Pattern.compile(String.format("(?i)%s=(.*?)(?:[,;]|$)", property)); - Matcher propertyMatcher = propertyPattern.matcher(overridePropertiesString); - if (propertyMatcher.find() && propertyMatcher.groupCount() >= 1) { - overrideProps.put(property, propertyMatcher.group(1)); - } - } - return overrideProps; - } - - public static boolean parseJobCreationMode(String url, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - - String jobCreationMode = - BigQueryJdbcUrlUtility.parseUriProperty(url, JOB_CREATION_MODE_PROPERTY_NAME); - - if (jobCreationMode == null) { - LOG.fine( - "%s value not provided, defaulting to %s. Caller: %s", - JOB_CREATION_MODE_PROPERTY_NAME, DEFAULT_JOB_CREATION_MODE, callerClassName); - // Default Job creation mode is JOB_CREATION_OPTIONAL(2) - // which translates to options.setQueryPreviewEnabled(true) - return true; - } - if (jobCreationMode.equalsIgnoreCase("1")) { - return false; - } else if (jobCreationMode.equalsIgnoreCase("2")) { - return true; - } else { - throw new NumberFormatException( - String.format( - "Invalid value for %s. Use 1 for JOB_CREATION_REQUIRED and 2 for" - + " JOB_CREATION_OPTIONAL.", - JOB_CREATION_MODE_PROPERTY_NAME)); - } - } - - public static String parseBYOIDProperty(String url, String property, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - - String value = BigQueryJdbcUrlUtility.parseUriProperty(url, property); - String defaultValue = BigQueryJdbcUrlUtility.getConnectionPropertyDefaultValue(property); - if (value != null) { - return value; - } else if (defaultValue != null) { - return defaultValue; - } - return null; - } - - public static String getConnectionPropertyDefaultValue(String propertyName) { - // TODO: change how we store properties because this method has to go through all of them - for (BigQueryConnectionProperty property : VALID_PROPERTIES) { - if (property.getName().equals(propertyName)) { - return property.getDefaultValue(); - } - } - return null; - } - - public static long parseRetryTimeoutInSecs(String url, String callerClassName) { - return BigQueryJdbcUrlUtility.parseLongProperty( - url, - RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME, - DEFAULT_RETRY_TIMEOUT_IN_SECS_VALUE, - callerClassName); - } - - public static long parseJobTimeout(String url, String callerClassName) { - return parseLongProperty( - url, JOB_TIMEOUT_PROPERTY_NAME, DEFAULT_JOB_TIMEOUT_VALUE, callerClassName); - } - - public static long parseRetryInitialDelayInSecs(String url, String callerClassName) { - return BigQueryJdbcUrlUtility.parseLongProperty( - url, RETRY_INITIAL_DELAY_PROPERTY_NAME, DEFAULT_RETRY_INITIAL_DELAY_VALUE, callerClassName); - } - - public static long parseRetryMaxDelayInSecs(String url, String callerClassName) { - return BigQueryJdbcUrlUtility.parseLongProperty( - url, RETRY_MAX_DELAY_PROPERTY_NAME, DEFAULT_RETRY_MAX_DELAY_VALUE, callerClassName); - } - - // Convenience Helper Methods - public static long parseConnectionPoolSize(String url, String callerClassName) { - if (url == null || url.isEmpty()) { - throw new BigQueryJdbcRuntimeException("Connection url is empty"); - } - return parseLongProperty( - url, - CONNECTION_POOL_SIZE_PROPERTY_NAME, - DEFAULT_CONNECTION_POOL_SIZE_VALUE, - callerClassName); - } - - public static long parseListenerPoolSize(String url, String callerClassName) { - if (url == null || url.isEmpty()) { - throw new BigQueryJdbcRuntimeException("Connection url is empty"); - } - return parseLongProperty( - url, LISTENER_POOL_SIZE_PROPERTY_NAME, DEFAULT_LISTENER_POOL_SIZE_VALUE, callerClassName); - } - - public static long parseMaximumBytesBilled(String url, String callerClassName) { - if (url == null || url.isEmpty()) { - throw new BigQueryJdbcRuntimeException("Connection url is empty"); - } - return parseLongProperty( - url, MAX_BYTES_BILLED_PROPERTY_NAME, DEFAULT_MAX_BYTES_BILLED_VALUE, callerClassName); - } - - private static Map parsePropertiesMap( - String url, String propertyName, String callerClassName) { - LOG.finest("++enter++\t" + callerClassName); - String propertiesString = BigQueryJdbcUrlUtility.parseUriProperty(url, propertyName); + static Map parsePropertiesMapFromValue( + String propertiesString, String propertyName, String context) { if (propertiesString == null || propertiesString.isEmpty()) { - LOG.fine("Unable to parse property name: %s from url: %s", propertyName, url); + LOG.fine("Unable to parse property name: %s from context: %s", propertyName, context); return null; } Map propertiesMap = new HashMap<>(); - String[] keyValuePairs = propertiesString.split(","); - - for (String keyValuePair : keyValuePairs) { - String[] parts = keyValuePair.split("="); - if (parts.length == 2) { - propertiesMap.put(parts[0], parts[1]); + for (String keyValuePair : Splitter.on(",").split(propertiesString)) { + List parts = Splitter.on("=").limit(2).splitToList(keyValuePair); + if (parts.size() == 2) { + propertiesMap.put(parts.get(0), parts.get(1)); } else { LOG.warning( - "Invalid KeyValue pair: %s found in url: %s for property name: %s", - keyValuePair, url, propertyName); + "Invalid KeyValue pair: %s found in context: %s for property name: %s", + keyValuePair, context, propertyName); } } return propertiesMap; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java index 0bc012954f..f3f5e22865 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnection.java @@ -36,14 +36,10 @@ class BigQueryPooledConnection implements PooledConnection { private Long listenerPoolSize = 10L; private LinkedBlockingDeque listeners; - BigQueryPooledConnection(Connection bqConnection) { + BigQueryPooledConnection(BigQueryConnection bqConnection) { this.bqConnection = bqConnection; this.id = UUID.randomUUID().toString(); - String connectionUrl = ((BigQueryConnection) bqConnection).getConnectionUrl(); - if (connectionUrl != null && !connectionUrl.isEmpty()) { - this.listenerPoolSize = - BigQueryJdbcUrlUtility.parseListenerPoolSize(connectionUrl, this.toString()); - } + this.listenerPoolSize = bqConnection.getListenerPoolSize(); if (getListenerPoolSize() > 0L) { listeners = new LinkedBlockingDeque<>(getListenerPoolSize().intValue()); } else { diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java index 6f4c9c5f6a..681595f8b0 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java @@ -19,13 +19,17 @@ import com.google.cloud.bigquery.exception.BigQueryJdbcException; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Map; import java.util.Properties; +import java.util.function.BiConsumer; import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * BigQuery JDBC implementation of {@link javax.sql.DataSource} @@ -38,6 +42,8 @@ public class DataSource implements javax.sql.DataSource { private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString()); private String URL; + static final ImmutableSet VALID_JOB_CREATION_MODES = ImmutableSet.of(1, 2); + private String projectId; private String defaultDataset; private String location; @@ -91,6 +97,22 @@ public class DataSource implements javax.sql.DataSource { private Long maximumBytesBilled; private Integer swaActivationRowCount; private Integer swaAppendRowCount; + private String oAuthP12Password; + private String oAuthSAImpersonationEmail; + private String oAuthSAImpersonationChain; + private String oAuthSAImpersonationScopes; + private String oAuthSAImpersonationTokenLifetime; + private String oAuth2TokenUri; + private String byoidAudienceUri; + private String byoidCredentialSource; + private String byoidPoolUserProject; + private String byoidSAImpersonationUri; + private String byoidSubjectTokenType; + private String byoidTokenUri; + private String endpointOverrides; + private String privateServiceConnect; + private Long connectionPoolSize; + private Long listenerPoolSize; // Make sure the JDBC driver class is loaded. static { @@ -102,6 +124,244 @@ public class DataSource implements javax.sql.DataSource { } } + private static final Map> PROPERTY_SETTERS = + ImmutableMap.>builder() + .put(BigQueryJdbcUrlUtility.PROJECT_ID_PROPERTY_NAME, DataSource::setProjectId) + .put(BigQueryJdbcUrlUtility.DEFAULT_DATASET_PROPERTY_NAME, DataSource::setDefaultDataset) + .put(BigQueryJdbcUrlUtility.LOCATION_PROPERTY_NAME, DataSource::setLocation) + .put( + BigQueryJdbcUrlUtility.ENABLE_HTAPI_PROPERTY_NAME, + (ds, val) -> + ds.setEnableHighThroughputAPI( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.ENABLE_HTAPI_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME, + (ds, val) -> + ds.setUnsupportedHTAPIFallback( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.UNSUPPORTED_HTAPI_FALLBACK_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.HTAPI_MIN_TABLE_SIZE_PROPERTY_NAME, + (ds, val) -> ds.setHighThroughputMinTableSize(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.HTAPI_ACTIVATION_RATIO_PROPERTY_NAME, + (ds, val) -> ds.setHighThroughputActivationRatio(Integer.parseInt(val))) + .put(BigQueryJdbcUrlUtility.KMS_KEY_NAME_PROPERTY_NAME, DataSource::setKmsKeyName) + .put( + BigQueryJdbcUrlUtility.QUERY_PROPERTIES_NAME, + (ds, val) -> + ds.setQueryProperties( + BigQueryJdbcUrlUtility.parsePropertiesMapFromValue( + val, BigQueryJdbcUrlUtility.QUERY_PROPERTIES_NAME, "DataSource"))) + .put( + BigQueryJdbcUrlUtility.ENABLE_SESSION_PROPERTY_NAME, + (ds, val) -> + ds.setEnableSession( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.ENABLE_SESSION_PROPERTY_NAME))) + .put(BigQueryJdbcUrlUtility.LOG_LEVEL_PROPERTY_NAME, DataSource::setLogLevel) + .put(BigQueryJdbcUrlUtility.LOG_PATH_PROPERTY_NAME, DataSource::setLogPath) + .put( + BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME, + (ds, val) -> ds.setOAuthType(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME, + DataSource::setOAuthServiceAcctEmail) + .put( + BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME, + DataSource::setOAuthPvtKeyPath) + .put(BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PROPERTY_NAME, DataSource::setOAuthPvtKey) + .put( + BigQueryJdbcUrlUtility.OAUTH_ACCESS_TOKEN_PROPERTY_NAME, + DataSource::setOAuthAccessToken) + .put( + BigQueryJdbcUrlUtility.OAUTH_REFRESH_TOKEN_PROPERTY_NAME, + DataSource::setOAuthRefreshToken) + .put( + BigQueryJdbcUrlUtility.USE_QUERY_CACHE_PROPERTY_NAME, + (ds, val) -> + ds.setUseQueryCache( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.USE_QUERY_CACHE_PROPERTY_NAME))) + .put(BigQueryJdbcUrlUtility.QUERY_DIALECT_PROPERTY_NAME, DataSource::setQueryDialect) + .put( + BigQueryJdbcUrlUtility.ALLOW_LARGE_RESULTS_PROPERTY_NAME, + (ds, val) -> + ds.setAllowLargeResults( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.ALLOW_LARGE_RESULTS_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.LARGE_RESULTS_TABLE_PROPERTY_NAME, + DataSource::setDestinationTable) + .put( + BigQueryJdbcUrlUtility.LARGE_RESULTS_DATASET_PROPERTY_NAME, + DataSource::setDestinationDataset) + .put( + BigQueryJdbcUrlUtility.DESTINATION_DATASET_EXPIRATION_TIME_PROPERTY_NAME, + (ds, val) -> ds.setDestinationDatasetExpirationTime(Long.parseLong(val))) + .put( + BigQueryJdbcUrlUtility.UNIVERSE_DOMAIN_OVERRIDE_PROPERTY_NAME, + DataSource::setUniverseDomain) + .put(BigQueryJdbcUrlUtility.PROXY_HOST_PROPERTY_NAME, DataSource::setProxyHost) + .put(BigQueryJdbcUrlUtility.PROXY_PORT_PROPERTY_NAME, DataSource::setProxyPort) + .put(BigQueryJdbcUrlUtility.PROXY_USER_ID_PROPERTY_NAME, DataSource::setProxyUid) + .put(BigQueryJdbcUrlUtility.PROXY_PASSWORD_PROPERTY_NAME, DataSource::setProxyPwd) + .put(BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, DataSource::setOAuthClientId) + .put( + BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, + DataSource::setOAuthClientSecret) + .put( + BigQueryJdbcUrlUtility.JOB_CREATION_MODE_PROPERTY_NAME, + (ds, val) -> ds.setJobCreationMode(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.MAX_RESULTS_PROPERTY_NAME, + (ds, val) -> ds.setMaxResults(Long.parseLong(val))) + .put(BigQueryJdbcUrlUtility.PARTNER_TOKEN_PROPERTY_NAME, DataSource::setPartnerToken) + .put( + BigQueryJdbcUrlUtility.ENABLE_WRITE_API_PROPERTY_NAME, + (ds, val) -> + ds.setEnableWriteAPI( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, BigQueryJdbcUrlUtility.ENABLE_WRITE_API_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.ADDITIONAL_PROJECTS_PROPERTY_NAME, + DataSource::setAdditionalProjects) + .put( + BigQueryJdbcUrlUtility.FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME, + (ds, val) -> + ds.setFilterTablesOnDefaultDataset( + BigQueryJdbcUrlUtility.convertIntToBoolean( + val, + BigQueryJdbcUrlUtility.FILTER_TABLES_ON_DEFAULT_DATASET_PROPERTY_NAME))) + .put( + BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, + (ds, val) -> ds.setRequestGoogleDriveScope(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.METADATA_FETCH_THREAD_COUNT_PROPERTY_NAME, + (ds, val) -> ds.setMetadataFetchThreadCount(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROPERTY_NAME, + DataSource::setSSLTrustStorePath) + .put( + BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PWD_PROPERTY_NAME, + DataSource::setSSLTrustStorePassword) + .put( + BigQueryJdbcUrlUtility.LABELS_PROPERTY_NAME, + (ds, val) -> + ds.setLabels( + BigQueryJdbcUrlUtility.parsePropertiesMapFromValue( + val, BigQueryJdbcUrlUtility.LABELS_PROPERTY_NAME, "DataSource"))) + .put(BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, DataSource::setRequestReason) + .put( + BigQueryJdbcUrlUtility.RETRY_TIMEOUT_IN_SECS_PROPERTY_NAME, + (ds, val) -> ds.setTimeout(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.JOB_TIMEOUT_PROPERTY_NAME, + (ds, val) -> ds.setJobTimeout(Integer.valueOf(val))) + .put( + BigQueryJdbcUrlUtility.RETRY_INITIAL_DELAY_PROPERTY_NAME, + (ds, val) -> ds.setRetryInitialDelay(Integer.valueOf(val))) + .put( + BigQueryJdbcUrlUtility.RETRY_MAX_DELAY_PROPERTY_NAME, + (ds, val) -> ds.setRetryMaxDelay(Integer.valueOf(val))) + .put( + BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, + (ds, val) -> ds.setHttpConnectTimeout(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, + (ds, val) -> ds.setHttpReadTimeout(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.OAUTH_P12_PASSWORD_PROPERTY_NAME, + DataSource::setOAuthP12Password) + .put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME, + DataSource::setOAuthSAImpersonationEmail) + .put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME, + DataSource::setOAuthSAImpersonationChain) + .put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME, + DataSource::setOAuthSAImpersonationScopes) + .put( + BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_TOKEN_LIFETIME_PROPERTY_NAME, + DataSource::setOAuthSAImpersonationTokenLifetime) + .put(BigQueryJdbcUrlUtility.OAUTH2_TOKEN_URI_PROPERTY_NAME, DataSource::setOAuth2TokenUri) + .put( + BigQueryJdbcUrlUtility.BYOID_AUDIENCE_URI_PROPERTY_NAME, + DataSource::setByoidAudienceUri) + .put( + BigQueryJdbcUrlUtility.BYOID_CREDENTIAL_SOURCE_PROPERTY_NAME, + DataSource::setByoidCredentialSource) + .put( + BigQueryJdbcUrlUtility.BYOID_POOL_USER_PROJECT_PROPERTY_NAME, + DataSource::setByoidPoolUserProject) + .put( + BigQueryJdbcUrlUtility.BYOID_SA_IMPERSONATION_URI_PROPERTY_NAME, + DataSource::setByoidSAImpersonationUri) + .put( + BigQueryJdbcUrlUtility.BYOID_SUBJECT_TOKEN_TYPE_PROPERTY_NAME, + DataSource::setByoidSubjectTokenType) + .put(BigQueryJdbcUrlUtility.BYOID_TOKEN_URI_PROPERTY_NAME, DataSource::setByoidTokenUri) + .put( + BigQueryJdbcUrlUtility.ENDPOINT_OVERRIDES_PROPERTY_NAME, + DataSource::setEndpointOverrides) + .put( + BigQueryJdbcUrlUtility.PRIVATE_SERVICE_CONNECT_PROPERTY_NAME, + DataSource::setPrivateServiceConnect) + .put( + BigQueryJdbcUrlUtility.MAX_BYTES_BILLED_PROPERTY_NAME, + (ds, val) -> ds.setMaximumBytesBilled(Long.parseLong(val))) + .put( + BigQueryJdbcUrlUtility.SWA_ACTIVATION_ROW_COUNT_PROPERTY_NAME, + (ds, val) -> ds.setSwaActivationRowCount(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.SWA_APPEND_ROW_COUNT_PROPERTY_NAME, + (ds, val) -> ds.setSwaAppendRowCount(Integer.parseInt(val))) + .put( + BigQueryJdbcUrlUtility.CONNECTION_POOL_SIZE_PROPERTY_NAME, + (ds, val) -> ds.setConnectionPoolSize(Long.parseLong(val))) + .put( + BigQueryJdbcUrlUtility.LISTENER_POOL_SIZE_PROPERTY_NAME, + (ds, val) -> ds.setListenerPoolSize(Long.parseLong(val))) + .build(); + + public static DataSource fromUrl(String url) { + DataSource dataSource = new DataSource(); + dataSource.setURL(url); + Map properties = BigQueryJdbcUrlUtility.parseUrl(url); + for (Map.Entry entry : properties.entrySet()) { + BiConsumer setter = PROPERTY_SETTERS.get(entry.getKey()); + if (setter != null) { + setter.accept(dataSource, entry.getValue()); + } + } + return dataSource; + } + + public Map getOverrideProperties() { + String overridePropertiesString = null; + if (endpointOverrides != null && !endpointOverrides.isEmpty()) { + overridePropertiesString = endpointOverrides; + } else if (privateServiceConnect != null && !privateServiceConnect.isEmpty()) { + overridePropertiesString = privateServiceConnect; + } + + Map overrideProps = new java.util.HashMap<>(); + if (overridePropertiesString == null || overridePropertiesString.isEmpty()) { + return overrideProps; + } + + for (String property : BigQueryJdbcUrlUtility.OVERRIDE_PROPERTIES) { + Pattern propertyPattern = Pattern.compile(String.format("(?i)%s=(.*?)(?:[,;]|$)", property)); + Matcher propertyMatcher = propertyPattern.matcher(overridePropertiesString); + if (propertyMatcher.find() && propertyMatcher.groupCount() >= 1) { + overrideProps.put(property, propertyMatcher.group(1)); + } + } + return overrideProps; + } + /** An implementation of DataSource must include a public no-arg constructor. */ public DataSource() {} @@ -346,6 +606,16 @@ private Properties createProperties() { BigQueryJdbcUrlUtility.SWA_APPEND_ROW_COUNT_PROPERTY_NAME, String.valueOf(this.swaAppendRowCount)); } + if (this.connectionPoolSize != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.CONNECTION_POOL_SIZE_PROPERTY_NAME, + String.valueOf(this.connectionPoolSize)); + } + if (this.listenerPoolSize != null) { + connectionProperties.setProperty( + BigQueryJdbcUrlUtility.LISTENER_POOL_SIZE_PROPERTY_NAME, + String.valueOf(this.listenerPoolSize)); + } return connectionProperties; } @@ -372,13 +642,25 @@ public void setURL(String URL) { } public String getProjectId() { - return projectId; + return projectId != null + ? projectId + : com.google.cloud.bigquery.BigQueryOptions.getDefaultProjectId(); } public void setProjectId(String projectId) { this.projectId = projectId; } + public void setMaxResults(Long maxResults) { + this.maxResults = maxResults; + } + + public Long getMaxResults() { + return this.maxResults != null + ? this.maxResults + : (Long) BigQueryJdbcUrlUtility.DEFAULT_MAX_RESULTS_VALUE; + } + public String getDefaultDataset() { return defaultDataset; } @@ -413,20 +695,46 @@ public void setPartnerToken(String partnerToken) { this.partnerToken = partnerToken; } - public boolean getEnableHighThroughputAPI() { - return enableHighThroughputAPI; + public Boolean getEnableHighThroughputAPI() { + return enableHighThroughputAPI != null + ? enableHighThroughputAPI + : BigQueryJdbcUrlUtility.DEFAULT_ENABLE_HTAPI_VALUE; } public void setEnableHighThroughputAPI(Boolean enableHighThroughputAPI) { this.enableHighThroughputAPI = enableHighThroughputAPI; } - public int getHighThroughputMinTableSize() { - return highThroughputMinTableSize; + public Integer getHighThroughputMinTableSize() { + return highThroughputMinTableSize != null + ? highThroughputMinTableSize + : (Integer) BigQueryJdbcUrlUtility.DEFAULT_HTAPI_MIN_TABLE_SIZE_VALUE; + } + + public Integer getHighThroughputActivationRatio() { + return highThroughputActivationRatio != null + ? highThroughputActivationRatio + : (Integer) BigQueryJdbcUrlUtility.DEFAULT_HTAPI_ACTIVATION_RATIO_VALUE; + } + + public Long getConnectionPoolSize() { + return connectionPoolSize != null + ? connectionPoolSize + : BigQueryJdbcUrlUtility.DEFAULT_CONNECTION_POOL_SIZE_VALUE; + } + + public void setConnectionPoolSize(Long connectionPoolSize) { + this.connectionPoolSize = connectionPoolSize; + } + + public Long getListenerPoolSize() { + return listenerPoolSize != null + ? listenerPoolSize + : BigQueryJdbcUrlUtility.DEFAULT_LISTENER_POOL_SIZE_VALUE; } - public int getHighThroughputActivationRatio() { - return highThroughputActivationRatio; + public void setListenerPoolSize(Long listenerPoolSize) { + this.listenerPoolSize = listenerPoolSize; } public void setHighThroughputMinTableSize(Integer highThroughputMinTableSize) { @@ -457,12 +765,16 @@ public void setUnsupportedHTAPIFallback(Boolean unsupportedHTAPIFallback) { this.unsupportedHTAPIFallback = unsupportedHTAPIFallback; } - public boolean getUnsupportedHTAPIFallback() { - return this.unsupportedHTAPIFallback; + public Boolean getUnsupportedHTAPIFallback() { + return this.unsupportedHTAPIFallback != null + ? this.unsupportedHTAPIFallback + : BigQueryJdbcUrlUtility.DEFAULT_UNSUPPORTED_HTAPI_FALLBACK_VALUE; } - public boolean getEnableSession() { - return enableSession; + public Boolean getEnableSession() { + return enableSession != null + ? enableSession + : BigQueryJdbcUrlUtility.DEFAULT_ENABLE_SESSION_VALUE; } public void setEnableSession(Boolean enableSession) { @@ -486,7 +798,9 @@ public void setLogPath(String logPath) { } public String getUniverseDomain() { - return universeDomain; + return universeDomain != null + ? universeDomain + : BigQueryJdbcUrlUtility.DEFAULT_UNIVERSE_DOMAIN_VALUE; } public void setUniverseDomain(String universeDomain) { @@ -525,8 +839,8 @@ public void setProxyPwd(String proxyPwd) { this.proxyPwd = proxyPwd; } - public int getOAuthType() { - return oAuthType; + public Integer getOAuthType() { + return oAuthType != null ? oAuthType : BigQueryJdbcUrlUtility.DEFAULT_OAUTH_TYPE_VALUE; } public void setOAuthType(Integer oAuthType) { @@ -574,15 +888,17 @@ public void setOAuthRefreshToken(String oAuthRefreshToken) { } public Boolean getUseQueryCache() { - return useQueryCache; + return useQueryCache != null ? useQueryCache : BigQueryJdbcUrlUtility.DEFAULT_USE_QUERY_CACHE; } public String getQueryDialect() { - return queryDialect; + return queryDialect != null ? queryDialect : BigQueryJdbcUrlUtility.DEFAULT_QUERY_DIALECT_VALUE; } public Boolean getAllowLargeResults() { - return allowLargeResults; + return allowLargeResults != null + ? allowLargeResults + : BigQueryJdbcUrlUtility.DEFAULT_ALLOW_LARGE_RESULTS; } public String getDestinationTable() { @@ -594,7 +910,9 @@ public String getDestinationDataset() { } public Long getDestinationDatasetExpirationTime() { - return destinationDatasetExpirationTime; + return destinationDatasetExpirationTime != null + ? destinationDatasetExpirationTime + : (Long) BigQueryJdbcUrlUtility.DEFAULT_DESTINATION_DATASET_EXPIRATION_TIME_VALUE; } public void setUseQueryCache(Boolean useQueryCache) { @@ -638,15 +956,30 @@ public void setOAuthClientSecret(String oAuthClientSecret) { } public Integer getJobCreationMode() { - return jobCreationMode; + return jobCreationMode != null + ? jobCreationMode + : (Integer) BigQueryJdbcUrlUtility.DEFAULT_JOB_CREATION_MODE; + } + + public Boolean getUseStatelessQueryMode() { + return getJobCreationMode() == 2; } public void setJobCreationMode(Integer jobCreationMode) { + if (jobCreationMode != null && !VALID_JOB_CREATION_MODES.contains(jobCreationMode)) { + throw new IllegalArgumentException( + String.format( + "Invalid value for %s. Use 1 for JOB_CREATION_REQUIRED and 2 for" + + " JOB_CREATION_OPTIONAL.", + BigQueryJdbcUrlUtility.JOB_CREATION_MODE_PROPERTY_NAME)); + } this.jobCreationMode = jobCreationMode; } public Boolean getEnableWriteAPI() { - return enableWriteAPI; + return enableWriteAPI != null + ? enableWriteAPI + : BigQueryJdbcUrlUtility.DEFAULT_ENABLE_WRITE_API_VALUE; } public void setEnableWriteAPI(Boolean enableWriteAPI) { @@ -662,7 +995,9 @@ public void setAdditionalProjects(String additionalProjects) { } public Boolean getFilterTablesOnDefaultDataset() { - return filterTablesOnDefaultDataset; + return filterTablesOnDefaultDataset != null + ? filterTablesOnDefaultDataset + : BigQueryJdbcUrlUtility.DEFAULT_FILTER_TABLES_ON_DEFAULT_DATASET_VALUE; } public void setFilterTablesOnDefaultDataset(Boolean filterTablesOnDefaultDataset) { @@ -670,7 +1005,9 @@ public void setFilterTablesOnDefaultDataset(Boolean filterTablesOnDefaultDataset } public Integer getRequestGoogleDriveScope() { - return requestGoogleDriveScope; + return requestGoogleDriveScope != null + ? requestGoogleDriveScope + : BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE; } public void setRequestGoogleDriveScope(Integer requestGoogleDriveScope) { @@ -678,7 +1015,9 @@ public void setRequestGoogleDriveScope(Integer requestGoogleDriveScope) { } public Integer getMetadataFetchThreadCount() { - return metadataFetchThreadCount; + return metadataFetchThreadCount != null + ? metadataFetchThreadCount + : BigQueryJdbcUrlUtility.DEFAULT_METADATA_FETCH_THREAD_COUNT_VALUE; } public void setMetadataFetchThreadCount(Integer metadataFetchThreadCount) { @@ -718,37 +1057,43 @@ public void setRequestReason(String requestReason) { } public Integer getTimeout() { - return timeout; + return timeout != null + ? timeout + : (int) BigQueryJdbcUrlUtility.DEFAULT_RETRY_TIMEOUT_IN_SECS_VALUE; } - public void setTimeout(Integer timeout) { - this.timeout = timeout; + public Integer getJobTimeout() { + return jobTimeout != null ? jobTimeout : (int) BigQueryJdbcUrlUtility.DEFAULT_JOB_TIMEOUT_VALUE; } - public Integer getJobTimeout() { - return jobTimeout; + public Integer getRetryInitialDelay() { + return retryInitialDelay != null + ? retryInitialDelay + : (int) BigQueryJdbcUrlUtility.DEFAULT_RETRY_INITIAL_DELAY_VALUE; } - public void setJobTimeout(Integer jobTimeout) { - this.jobTimeout = jobTimeout; + public Integer getRetryMaxDelay() { + return retryMaxDelay != null + ? retryMaxDelay + : (int) BigQueryJdbcUrlUtility.DEFAULT_RETRY_MAX_DELAY_VALUE; } - public Integer getRetryInitialDelay() { - return retryInitialDelay; + public void setJobTimeout(Integer jobTimeout) { + this.jobTimeout = jobTimeout; } public void setRetryInitialDelay(Integer retryInitialDelay) { this.retryInitialDelay = retryInitialDelay; } - public Integer getRetryMaxDelay() { - return retryMaxDelay; - } - public void setRetryMaxDelay(Integer retryMaxDelay) { this.retryMaxDelay = retryMaxDelay; } + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + public Integer getHttpConnectTimeout() { return httpConnectTimeout; } @@ -766,7 +1111,9 @@ public void setHttpReadTimeout(Integer httpReadTimeout) { } public Long getMaximumBytesBilled() { - return maximumBytesBilled; + return maximumBytesBilled != null + ? maximumBytesBilled + : BigQueryJdbcUrlUtility.DEFAULT_MAX_BYTES_BILLED_VALUE; } public void setMaximumBytesBilled(Long maximumBytesBilled) { @@ -774,7 +1121,9 @@ public void setMaximumBytesBilled(Long maximumBytesBilled) { } public Integer getSwaActivationRowCount() { - return swaActivationRowCount; + return swaActivationRowCount != null + ? swaActivationRowCount + : BigQueryJdbcUrlUtility.DEFAULT_SWA_ACTIVATION_ROW_COUNT_VALUE; } public void setSwaActivationRowCount(Integer swaActivationRowCount) { @@ -782,13 +1131,133 @@ public void setSwaActivationRowCount(Integer swaActivationRowCount) { } public Integer getSwaAppendRowCount() { - return swaAppendRowCount; + return swaAppendRowCount != null + ? swaAppendRowCount + : BigQueryJdbcUrlUtility.DEFAULT_SWA_APPEND_ROW_COUNT_VALUE; } public void setSwaAppendRowCount(Integer swaAppendRowCount) { this.swaAppendRowCount = swaAppendRowCount; } + public String getOAuthP12Password() { + return oAuthP12Password != null + ? oAuthP12Password + : BigQueryJdbcUrlUtility.DEFAULT_OAUTH_P12_PASSWORD_VALUE; + } + + public void setOAuthP12Password(String oAuthP12Password) { + this.oAuthP12Password = oAuthP12Password; + } + + public String getOAuthSAImpersonationEmail() { + return oAuthSAImpersonationEmail; + } + + public void setOAuthSAImpersonationEmail(String oAuthSAImpersonationEmail) { + this.oAuthSAImpersonationEmail = oAuthSAImpersonationEmail; + } + + public String getOAuthSAImpersonationChain() { + return oAuthSAImpersonationChain; + } + + public void setOAuthSAImpersonationChain(String oAuthSAImpersonationChain) { + this.oAuthSAImpersonationChain = oAuthSAImpersonationChain; + } + + public String getOAuthSAImpersonationScopes() { + return oAuthSAImpersonationScopes; + } + + public void setOAuthSAImpersonationScopes(String oAuthSAImpersonationScopes) { + this.oAuthSAImpersonationScopes = oAuthSAImpersonationScopes; + } + + public String getOAuthSAImpersonationTokenLifetime() { + return oAuthSAImpersonationTokenLifetime; + } + + public void setOAuthSAImpersonationTokenLifetime(String oAuthSAImpersonationTokenLifetime) { + this.oAuthSAImpersonationTokenLifetime = oAuthSAImpersonationTokenLifetime; + } + + public String getOAuth2TokenUri() { + return oAuth2TokenUri; + } + + public void setOAuth2TokenUri(String oAuth2TokenUri) { + this.oAuth2TokenUri = oAuth2TokenUri; + } + + public String getByoidAudienceUri() { + return byoidAudienceUri; + } + + public void setByoidAudienceUri(String byoidAudienceUri) { + this.byoidAudienceUri = byoidAudienceUri; + } + + public String getByoidCredentialSource() { + return byoidCredentialSource; + } + + public void setByoidCredentialSource(String byoidCredentialSource) { + this.byoidCredentialSource = byoidCredentialSource; + } + + public String getByoidPoolUserProject() { + return byoidPoolUserProject; + } + + public void setByoidPoolUserProject(String byoidPoolUserProject) { + this.byoidPoolUserProject = byoidPoolUserProject; + } + + public String getByoidSAImpersonationUri() { + return byoidSAImpersonationUri; + } + + public void setByoidSAImpersonationUri(String byoidSAImpersonationUri) { + this.byoidSAImpersonationUri = byoidSAImpersonationUri; + } + + public String getByoidSubjectTokenType() { + return byoidSubjectTokenType != null + ? byoidSubjectTokenType + : BigQueryJdbcUrlUtility.DEFAULT_BYOID_SUBJECT_TOKEN_TYPE_VALUE; + } + + public void setByoidSubjectTokenType(String byoidSubjectTokenType) { + this.byoidSubjectTokenType = byoidSubjectTokenType; + } + + public String getByoidTokenUri() { + return byoidTokenUri != null + ? byoidTokenUri + : BigQueryJdbcUrlUtility.DEFAULT_BYOID_TOKEN_URI_VALUE; + } + + public void setByoidTokenUri(String byoidTokenUri) { + this.byoidTokenUri = byoidTokenUri; + } + + public String getEndpointOverrides() { + return endpointOverrides; + } + + public void setEndpointOverrides(String endpointOverrides) { + this.endpointOverrides = endpointOverrides; + } + + public String getPrivateServiceConnect() { + return privateServiceConnect; + } + + public void setPrivateServiceConnect(String privateServiceConnect) { + this.privateServiceConnect = privateServiceConnect; + } + @Override public PrintWriter getLogWriter() { return null; diff --git a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java index 412e4ca9ee..66a957a06f 100644 --- a/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java +++ b/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSource.java @@ -40,13 +40,12 @@ public PooledConnection getPooledConnection() throws SQLException { throw new BigQueryJdbcRuntimeException( "Cannot get pooled connection: unable to get underlying physical connection"); } - String connectionURl = ((BigQueryConnection) bqConnection).getConnectionUrl(); - Long connectionPoolSize = - BigQueryJdbcUrlUtility.parseConnectionPoolSize(connectionURl, this.toString()); + Long connectionPoolSize = ((BigQueryConnection) bqConnection).getConnectionPoolSize(); if (connectionPoolManager == null) { connectionPoolManager = new PooledConnectionListener(connectionPoolSize); } - BigQueryPooledConnection bqPooledConnection = new BigQueryPooledConnection(bqConnection); + BigQueryPooledConnection bqPooledConnection = + new BigQueryPooledConnection((BigQueryConnection) bqConnection); bqPooledConnection.addConnectionEventListener(connectionPoolManager); return bqPooledConnection; } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java index 4da6165b20..0927271add 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryConnectionTest.java @@ -29,9 +29,6 @@ import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; import java.util.Properties; import org.junit.Before; import org.junit.Test; @@ -248,9 +245,9 @@ public void testAdditionalProjects() throws IOException, BigQueryJdbcException { + "OAuthClientSecret=redactedToken;" + "AdditionalProjects=projA,projB"; try (BigQueryConnection conn1 = new BigQueryConnection(url1)) { - List additionalProjects1 = conn1.getAdditionalProjects(); + String additionalProjects1 = conn1.getAdditionalProjects(); assertNotNull(additionalProjects1); - assertEquals(Arrays.asList("projA", "projB"), additionalProjects1); + assertEquals("projA,projB", additionalProjects1); } catch (SQLException | IOException e) { throw new BigQueryJdbcException(e); } @@ -261,9 +258,9 @@ public void testAdditionalProjects() throws IOException, BigQueryJdbcException { + "OAuthClientSecret=redactedToken;" + "AdditionalProjects=projX"; try (BigQueryConnection conn2 = new BigQueryConnection(url2)) { - List additionalProjects2 = conn2.getAdditionalProjects(); + String additionalProjects2 = conn2.getAdditionalProjects(); assertNotNull(additionalProjects2); - assertEquals(Collections.singletonList("projX"), additionalProjects2); + assertEquals("projX", additionalProjects2); } catch (SQLException | IOException e) { throw new BigQueryJdbcException(e); } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java index 5129a74961..958a5e99ea 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtilityTest.java @@ -50,13 +50,26 @@ public class BigQueryJdbcOAuthUtilityTest extends BigQueryJdbcBaseTest { + USER_AUTH_PORT + "&scope=https://www.googleapis.com/auth/bigquery&state=test_state&access_type=offline&prompt=consent&login_hint=test_user&include_granted_scopes=true"; + @Test + public void testParseOAuthPropsWithSpecialChars() { + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties( + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyProject;OAuthType=0;OAuthServiceAcctEmail=dummy@email.com;" + + "OAuthPvtKey=Key+With+Plus;"), + null); + assertEquals("Key+With+Plus", result.get("OAuthPvtKey")); + } + @Test public void testParseOAuthPropsForAuthType0KeyfileOnly() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "ProjectId=MyBigQueryProject;OAuthType=0;" - + "OAuthPvtKeyPath=C:\\SecureFiles\\ServiceKeyFile.p12;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=0;" + + "OAuthPvtKeyPath=C:\\SecureFiles\\ServiceKeyFile.p12;"), null); assertThat(result.get("OAuthType")).isEqualTo("GOOGLE_SERVICE_ACCOUNT"); @@ -67,10 +80,11 @@ public void testParseOAuthPropsForAuthType0KeyfileOnly() { public void testParseOAuthPropsForAuthType0ViaEmail() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "ProjectId=MyBigQueryProject;OAuthType=0;" - + "OAuthServiceAcctEmail=dummytest@dummytest.iam.gserviceaccount.com;" - + "OAuthPvtKey=RedactedKey;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=0;" + + "OAuthServiceAcctEmail=dummytest@dummytest.iam.gserviceaccount.com;" + + "OAuthPvtKey=RedactedKey;"), null); assertThat(result.get("OAuthType")).isEqualTo("GOOGLE_SERVICE_ACCOUNT"); @@ -90,9 +104,9 @@ public void testInvalidTokenUriForAuthType0() { + ";" + "EndpointOverrides=OAuth2=brokenuri{};"; Map oauthProperties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + BigQueryJdbcOAuthUtility.parseOAuthProperties(DataSource.fromUrl(connectionString), null); Map overrideProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + DataSource.fromUrl(connectionString).getOverrideProperties(); try { BigQueryJdbcOAuthUtility.getCredentials(oauthProperties, overrideProperties, null); @@ -106,9 +120,10 @@ public void testInvalidTokenUriForAuthType0() { public void testParseOAuthPropsForAuthType2() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;" - + "OAuthAccessToken=RedactedToken;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;"), null); assertThat(result.get("OAuthType")).isEqualTo("PRE_GENERATED_TOKEN"); @@ -119,8 +134,9 @@ public void testParseOAuthPropsForAuthType2() { public void testParseOAuthPropsForAuthType3() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=3;ProjectId=MyBigQueryProject;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=MyBigQueryProject;"), null); assertThat(result.get("OAuthType")).isEqualTo("APPLICATION_DEFAULT_CREDENTIALS"); @@ -130,8 +146,9 @@ public void testParseOAuthPropsForAuthType3() { public void testParseOAuthPropsForDefaultAuthType() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "ProjectId=MyBigQueryProject;OAuthType=3", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "ProjectId=MyBigQueryProject;OAuthType=3"), null); assertThat(result.get("OAuthType")).isEqualTo("APPLICATION_DEFAULT_CREDENTIALS"); @@ -141,9 +158,10 @@ public void testParseOAuthPropsForDefaultAuthType() { public void testGetCredentialsForPreGeneratedToken() { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;" - + "OAuthAccessToken=RedactedToken;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;"), null); GoogleCredentials credentials = @@ -155,10 +173,11 @@ public void testGetCredentialsForPreGeneratedToken() { public void testGetCredentialsForPreGeneratedTokenTPC() throws IOException { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;" - + "OAuthAccessToken=RedactedToken;" - + "universeDomain=testDomain;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;" + + "OAuthAccessToken=RedactedToken;" + + "universeDomain=testDomain;"), null); Map stringStringMap = new HashMap<>(); stringStringMap.put( @@ -175,8 +194,9 @@ public void testGetCredentialsForPreGeneratedTokenTPC() throws IOException { public void testGetCredentialsForApplicationDefault() { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=3;ProjectId=MyBigQueryProject;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=3;ProjectId=MyBigQueryProject;"), null); GoogleCredentials credentials = @@ -188,9 +208,10 @@ public void testGetCredentialsForApplicationDefault() { public void testParseOAuthPropsForUserAuth() { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=1;ProjectId=MyBigQueryProject;" - + "OAuthClientId=client;OAuthClientSecret=secret;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=1;ProjectId=MyBigQueryProject;" + + "OAuthClientId=client;OAuthClientSecret=secret;"), null); assertThat(authProperties.get("OAuthType")).isEqualTo("GOOGLE_USER_ACCOUNT"); @@ -234,9 +255,9 @@ public void testGenerateUserAuthURLOverrideOauthEndpoint() { + overrideTokenSeverURI + ";"; Map authProperties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + BigQueryJdbcOAuthUtility.parseOAuthProperties(DataSource.fromUrl(connectionString), null); Map overrideProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + DataSource.fromUrl(connectionString).getOverrideProperties(); UserAuthorizer userAuthorizer = BigQueryJdbcOAuthUtility.getUserAuthorizer( @@ -252,9 +273,10 @@ public void testGenerateUserAuthURLOverrideOauthEndpoint() { public void testParseOAuthPropsForRefreshToken() { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;OAuthRefreshToken=token;" - + "OAuthClientId=client;OAuthClientSecret=secret;", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + + "OAuthType=2;ProjectId=MyBigQueryProject;OAuthRefreshToken=token;" + + "OAuthClientId=client;OAuthClientSecret=secret;"), null); assertThat(authProperties.get("OAuthType")).isEqualTo("PRE_GENERATED_TOKEN"); @@ -274,9 +296,9 @@ public void testParseOverridePropsForRefreshTokenAuth() { + "EndpointOverrides=Oauth2=https://oauth2-private.p.googleapis.com/token;"; Map authProperties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionString, null); + BigQueryJdbcOAuthUtility.parseOAuthProperties(DataSource.fromUrl(connectionString), null); Map overrideProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connectionString, null); + DataSource.fromUrl(connectionString).getOverrideProperties(); UserCredentials userCredentials = BigQueryJdbcOAuthUtility.getPreGeneratedRefreshTokenCredentials( @@ -294,14 +316,15 @@ public void testParseOverridePropsForRefreshTokenAuth() { public void testParseBYOIDProps() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:433;OAuthType=4;" - + "ProjectId=MyBigQueryProject;" - + "BYOID_AudienceUri=//iam.googleapis.com/locations/global/workforcePools/pool-id/providers/provider-id;" - + "BYOID_PoolUserProject=workforceProjectNumber;" - + "BYOID_CredentialSource={\"file\": \"C:\\\\Token.txt\"};" - + "BYOID_SA_Impersonation_Uri=testSA;" - + "BYOID_SubjectTokenType=urn:ietf:params:oauth:tokentype:jwt;" - + "BYOID_TokenUri=https://testuri.com/v1/token", + DataSource.fromUrl( + "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:433;OAuthType=4;" + + "ProjectId=MyBigQueryProject;" + + "BYOID_AudienceUri=//iam.googleapis.com/locations/global/workforcePools/pool-id/providers/provider-id;" + + "BYOID_PoolUserProject=workforceProjectNumber;" + + "BYOID_CredentialSource={\"file\": \"C:\\\\Token.txt\"};" + + "BYOID_SA_Impersonation_Uri=testSA;" + + "BYOID_SubjectTokenType=urn:ietf:params:oauth:tokentype:jwt;" + + "BYOID_TokenUri=https://testuri.com/v1/token"), null); assertThat(result.get("BYOID_AudienceUri")) @@ -322,7 +345,8 @@ public void testParseOAuthProperties_UserAccount_RequestDriveScopeEnabled() { + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" + "RequestGoogleDriveScope=1;"; Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + BigQueryJdbcOAuthUtility.parseOAuthProperties( + DataSource.fromUrl(url), this.getClass().getName()); assertEquals( String.valueOf(BigQueryJdbcOAuthUtility.AuthType.GOOGLE_USER_ACCOUNT), properties.get(BigQueryJdbcUrlUtility.OAUTH_TYPE_PROPERTY_NAME)); @@ -342,7 +366,8 @@ public void testParseOAuthProperties_UserAccount_RequestDriveScopeDisabled() { + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;" + "RequestGoogleDriveScope=0;"; Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + BigQueryJdbcOAuthUtility.parseOAuthProperties( + DataSource.fromUrl(url), this.getClass().getName()); assertEquals( "0", properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); } @@ -353,7 +378,8 @@ public void testParseOAuthProperties_UserAccount_RequestDriveScopeDefault() { "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "OAuthType=1;OAuthClientId=redactedClientId;OAuthClientSecret=redactedClientSecret;"; Map properties = - BigQueryJdbcOAuthUtility.parseOAuthProperties(url, this.getClass().getName()); + BigQueryJdbcOAuthUtility.parseOAuthProperties( + DataSource.fromUrl(url), this.getClass().getName()); assertEquals( String.valueOf(BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE), properties.get(BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME)); @@ -412,7 +438,8 @@ public void testParseUserImpersonationDefault() { getUriOAuthServiceAccount() .append("ServiceAccountImpersonationEmail", "impersonated") .toString(); - Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties(connectionUri, ""); + Map result = + BigQueryJdbcOAuthUtility.parseOAuthProperties(DataSource.fromUrl(connectionUri), ""); assertEquals( "impersonated", result.get(BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME)); @@ -428,11 +455,12 @@ public void testParseUserImpersonationDefault() { public void testParseUserImpersonationNonDefault() { Map result = BigQueryJdbcOAuthUtility.parseOAuthProperties( - getUriOAuthServiceAccount() - .append("ServiceAccountImpersonationEmail", "impersonated") - .append("ServiceAccountImpersonationScopes", "scopes") - .append("ServiceAccountImpersonationTokenLifetime", 300) - .toString(), + DataSource.fromUrl( + getUriOAuthServiceAccount() + .append("ServiceAccountImpersonationEmail", "impersonated") + .append("ServiceAccountImpersonationScopes", "scopes") + .append("ServiceAccountImpersonationTokenLifetime", 300) + .toString()), ""); assertEquals( "impersonated", @@ -448,9 +476,10 @@ public void testParseUserImpersonationNonDefault() { public void testGetServiceAccountImpersonatedCredentials() { Map authProperties = BigQueryJdbcOAuthUtility.parseOAuthProperties( - getUriOAuthServiceAccount() - .append("ServiceAccountImpersonationEmail", "impersonated") - .toString(), + DataSource.fromUrl( + getUriOAuthServiceAccount() + .append("ServiceAccountImpersonationEmail", "impersonated") + .toString()), ""); GoogleCredentials credentials = BigQueryJdbcOAuthUtility.getCredentials(authProperties, Collections.EMPTY_MAP, null); diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java index 830e515336..9b65719cbc 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcUrlUtilityTest.java @@ -17,19 +17,12 @@ package com.google.cloud.bigquery.jdbc; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThrows; -import static org.junit.Assert.assertTrue; import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; -import com.google.common.collect.Maps; -import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Properties; import org.junit.Test; @@ -160,281 +153,6 @@ public void testParseUrl_longUnknownProperty_sanitized() { assertThat(e.getMessage().length()).isLessThan(100); } - @Test - public void testOverridePropertiesFromURICompatibility() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;PrivateServiceConnectUris=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - } - - @Test - public void testOverridePropertiesDoesNotAffectOriginalParsersAtEnd() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," - + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;PROJECTID=testProject;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - assertThat(parsedPSCProperties.get("OAUTH2")) - .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); - } - - @Test - public void testOverridePropertiesDoesNotParseOutsideOfPrivateServiceConnectUris() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;" - // Hard to see but semicolon ends it here. - + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;PROJECTID=testProject;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - assertThat(parsedPSCProperties.get("OAUTH2")).isNull(); - } - - @Test - public void testOverridePropertiesDoesNotParserPropertiesInMiddle() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PrivateServiceConnectUris=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com,OAUTHTYPE=2," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," - + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - assertThat(parsedPSCProperties.get("OAUTH2")) - .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); - } - - @Test - public void testOverridePropertyBeforeProceedingOverrideParameterDoesNotParse() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com;" - + "PrivateServiceConnectUris=" - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," - + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertNull(parsedPSCProperties.get("BIGQUERY")); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - assertThat(parsedPSCProperties.get("OAUTH2")) - .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); - } - - @Test - public void testOverridePropertiesFromURIGoogleExperience() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;EndpointOverrides=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - } - - @Test - public void testAllOverridePropertiesFromURIGoogleExperience() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;EndpointOverrides=" - + "BIGQUERY=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443," - + "OAUTH2=https://oauth2-myprivateserver.p.googleapis.com," - + "STS=https://sts-myprivateserver.p.googleapis.com;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - assertThat(parsedPSCProperties.get("OAUTH2")) - .isEqualTo("https://oauth2-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("STS")) - .isEqualTo("https://sts-myprivateserver.p.googleapis.com"); - } - - @Test - public void testCaseSensitivityOverridePropertiesFromURI() { - String connection_uri = - "bigquery://https://www.googleapis.com/bigquery/v2:443;PROJECTID=testProject;endpointOverrides=" - + "bigQuery=https://bigquery-myprivateserver.p.googleapis.com," - + "READ_API=https://bigquerystorage-myprivateserver.p.googleapis.com:443;"; - - Map parsedPSCProperties = - BigQueryJdbcUrlUtility.parseOverrideProperties(connection_uri, null); - - assertThat(parsedPSCProperties.get("BIGQUERY")) - .isEqualTo("https://bigquery-myprivateserver.p.googleapis.com"); - assertThat(parsedPSCProperties.get("READ_API")) - .isEqualTo("https://bigquerystorage-myprivateserver.p.googleapis.com:443"); - } - - @Test - public void testParseJobCreationModeDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; - - boolean jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); - assertTrue(jobCreationMode); - } - - @Test - public void testParseJobCreationMode() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobCreationMode=1"; - - boolean jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); - assertFalse(jobCreationMode); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobCreationMode=2"; - - jobCreationMode = BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null); - assertTrue(jobCreationMode); - } - - @Test - public void testParseJobCreationModeInvalidInteger() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobCreationMode=25"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null)); - } - - @Test - public void testParseJobCreationModeInvalidString() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobCreationMode=JOB_CREATION_OPTIONAL"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseJobCreationMode(connection_uri, null)); - } - - @Test - public void testGetConnectionPropertyDefaultValue() { - assertEquals( - BigQueryJdbcUrlUtility.getConnectionPropertyDefaultValue("BYOID_TokenUri"), - "https://sts.googleapis.com/v1/token"); - } - - @Test - public void testParseRetryTimeoutInSecs() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "Timeout=10"; - - long retryTimeoutInSeconds = - BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); - assertEquals(10, retryTimeoutInSeconds); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "Timeout=20"; - - retryTimeoutInSeconds = BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); - assertEquals(20, retryTimeoutInSeconds); - } - - @Test - public void testParseRetryTimeoutInSecsDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long retryTimeoutInSeconds = - BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null); - assertEquals(0, retryTimeoutInSeconds); - } - - @Test - public void testParseRetryTimeoutSecondsInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "Timeout=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseRetryTimeoutInSecs(connection_uri, null)); - } - - public void testParseJobTimeout() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobTimeout=10"; - - long jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); - assertEquals(10, jobTimeout); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobTimeout=20"; - - jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); - assertEquals(20, jobTimeout); - } - - @Test - public void testParseJobTimeoutDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long jobTimeout = BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null); - assertEquals(0L, jobTimeout); - } - - @Test - public void testParseJobTimeoutInvalid() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "JobTimeout=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseJobTimeout(connection_uri, null)); - } - @Test public void testParsePartnerTokenProperty() { // Case with partner name and environment @@ -442,8 +160,7 @@ public void testParsePartnerTokenProperty() { "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "PartnerToken=(GPN:partner_company; dev);ProjectId=MyBigQueryProject;"; String expected = " (GPN:partner_company; dev)"; - String result = - BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + String result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertThat(result).isEqualTo(expected); // Case with only partner name @@ -451,24 +168,24 @@ public void testParsePartnerTokenProperty() { "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "PartnerToken=(GPN:another_partner);ProjectId=MyBigQueryProject;"; expected = " (GPN:another_partner)"; - result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertThat(result).isEqualTo(expected); // Case when PartnerToken property is not present url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "ProjectId=MyBigQueryProject;"; - result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertNull(result); // Case when PartnerToken property is present but empty url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PartnerToken=();"; - result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertNull(result); // Case when PartnerToken property is present but without partner name url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;PartnerToken=(env);"; - result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertNull(result); // Case with extra spaces around the values @@ -476,437 +193,10 @@ public void testParsePartnerTokenProperty() { "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" + "PartnerToken= ( GPN: partner_name ; test_env ) ;"; expected = " (GPN: partner_name ; test_env)"; - result = BigQueryJdbcUrlUtility.parsePartnerTokenProperty(url, "testParsePartnerTokenProperty"); + result = BigQueryJdbcUrlUtility.parseUriProperty(url, "PartnerToken"); assertThat(result).isEqualTo(expected); } - public void testParseRetryInitialDelayInSecs() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryInitialDelay=10"; - - long retryInitialDelaySeconds = - BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); - assertEquals(10, retryInitialDelaySeconds); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryInitialDelay=20"; - - retryInitialDelaySeconds = - BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); - assertEquals(20, retryInitialDelaySeconds); - } - - @Test - public void testParseRetryInitialDelayInSecsDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long retryInitialDelaySeconds = - BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null); - assertEquals(0, retryInitialDelaySeconds); - } - - @Test - public void testParseRetryInitialDelaySecondsInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryInitialDelay=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseRetryInitialDelayInSecs(connection_uri, null)); - } - - @Test - public void testParseRetryMaxDelayInSecs() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryMaxDelay=10"; - - long retryMaxDelaySeconds = - BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); - assertEquals(10, retryMaxDelaySeconds); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryMaxDelay=20"; - - retryMaxDelaySeconds = BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); - assertEquals(20, retryMaxDelaySeconds); - } - - @Test - public void testParseRetryMaxDelayInSecsDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long retryMaxDelaySeconds = - BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null); - assertEquals(0, retryMaxDelaySeconds); - } - - @Test - public void testParseRetryMaxDelaySecondsInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "RetryMaxDelay=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseRetryMaxDelayInSecs(connection_uri, null)); - } - - @Test - public void testParseRequestGoogleDriveScope_Default() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; - Integer value = - BigQueryJdbcUrlUtility.parseIntProperty( - url, - BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME, - BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE, - this.getClass().getName()); - assertEquals( - Integer.valueOf(BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE), value); - } - - // Connection Pool Size - - @Test - public void testParseConnectionPoolSize() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ConnectionPoolSize=10"; - long connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); - assertEquals(10, connectionPoolSize); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ConnectionPoolSize=20"; - - connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); - assertEquals(20, connectionPoolSize); - } - - @Test - public void testParseConnectionPoolSizeDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long connectionPoolSize = BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null); - assertEquals(10, connectionPoolSize); - } - - @Test - public void testParseConnectionPoolSizeDefaultNullConnectionUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize(null, null)); - } - - @Test - public void testParseConnectionPoolSizeDefaultEmptyConnectionUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize("", null)); - } - - @Test - public void testParseConnectionPoolSizeInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ConnectionPoolSize=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseConnectionPoolSize(connection_uri, null)); - } - - // Listener Pool Size - - @Test - public void testParseListenerPoolSize() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ListenerPoolSize=10"; - long listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); - assertEquals(10, listenerPoolSize); - - connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ListenerPoolSize=20"; - - listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); - assertEquals(20, listenerPoolSize); - } - - @Test - public void testParseListenerPoolSizeDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long listenerPoolSize = BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null); - assertEquals(10, listenerPoolSize); - } - - @Test - public void testParseListenerPoolSizeDefaultNullConnectionUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseListenerPoolSize(null, null)); - } - - @Test - public void testParseListenerPoolSizeDefaultEmptyConnectionUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseListenerPoolSize("", null)); - } - - @Test - public void testParseListenerPoolSizeInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ListenerPoolSize=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseListenerPoolSize(connection_uri, null)); - } - - @Test - public void testParseStringListProperty_NullOrEmpty() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes="; - List result = - BigQueryJdbcUrlUtility.parseStringListProperty(url, "NonExistentProp", "TestClass"); - assertEquals(Collections.emptyList(), result); - - result = - BigQueryJdbcUrlUtility.parseStringListProperty( - url, "ServiceAccountImpersonationScopes", "TestClass"); - assertEquals(Collections.emptyList(), result); - - String urlWithEmptyList = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=,,"; - result = - BigQueryJdbcUrlUtility.parseStringListProperty( - urlWithEmptyList, "ServiceAccountImpersonationScopes", "TestClass"); - assertEquals(Collections.emptyList(), result); - } - - @Test - public void testParseStringListProperty_SingleValue() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=project1"; - List result = - BigQueryJdbcUrlUtility.parseStringListProperty( - url, "ServiceAccountImpersonationScopes", "TestClass"); - assertEquals(Collections.singletonList("project1"), result); - } - - @Test - public void testParseStringListProperty_MultipleValues() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;ServiceAccountImpersonationScopes=project1,project2,project3"; - List result = - BigQueryJdbcUrlUtility.parseStringListProperty( - url, "ServiceAccountImpersonationScopes", "TestClass"); - assertEquals(Arrays.asList("project1", "project2", "project3"), result); - } - - @Test - public void testParseIntProperty_ValidInteger() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout=123"; - Integer defaultValue = 0; - Integer result = - BigQueryJdbcUrlUtility.parseIntProperty( - url, "HttpConnectTimeout", defaultValue, "TestClass"); - assertEquals(Integer.valueOf(123), result); - } - - @Test - public void testParseIntProperty_PropertyNotPresent() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;"; - Integer defaultValue = 42; - Integer result = - BigQueryJdbcUrlUtility.parseIntProperty( - url, "HttpConnectTimeout", defaultValue, "TestClass"); - assertEquals(defaultValue, result); - } - - @Test - public void testParseIntProperty_InvalidIntegerValue() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout=abc"; - Integer defaultValue = 77; - assertThrows( - IllegalArgumentException.class, - () -> - BigQueryJdbcUrlUtility.parseIntProperty( - url, "HttpConnectTimeout", defaultValue, "TestClass")); - } - - @Test - public void testParseIntProperty_EmptyStringValue() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=2;ProjectId=MyBigQueryProject;HttpConnectTimeout="; - Integer defaultValue = 88; - assertThrows( - IllegalArgumentException.class, - () -> - BigQueryJdbcUrlUtility.parseIntProperty( - url, "HttpConnectTimeout", defaultValue, "TestClass")); - } - - @Test - public void testParseMaxBytesBilled() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "MaximumBytesBilled=10000"; - - long maxBytesBilled = BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null); - assertEquals(10000, maxBytesBilled); - } - - @Test - public void testParseMaxBytesBilledDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - long maxBytesBilled = BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null); - assertEquals(0, maxBytesBilled); - } - - @Test - public void testParseMaxBytesBilledNullUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled(null, null)); - } - - @Test - public void testParseMaxBytesBilledEmptyUrl() { - assertThrows( - BigQueryJdbcRuntimeException.class, - () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled("", null)); - } - - @Test - public void testParseMaxBytesBilledInvalidLong() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "MaximumBytesBilled=invalid"; - - assertThrows( - NumberFormatException.class, - () -> BigQueryJdbcUrlUtility.parseMaximumBytesBilled(connection_uri, null)); - } - - @Test - public void testParseLabels() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "Labels=k1=v1,k2=v2,k3=v3;"; - - Map labels = BigQueryJdbcUrlUtility.parseLabels(connection_uri, null); - assertNotNull(labels); - assertFalse(labels.isEmpty()); - assertEquals(3, labels.size()); - - Map expected = - new HashMap() { - { - put("k1", "v1"); - put("k2", "v2"); - put("k3", "v3"); - } - }; - - assertTrue(Maps.difference(expected, labels).areEqual()); - } - - @Test - public void testParseLabelsEmpty() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;"; - - Map labels = BigQueryJdbcUrlUtility.parseLabels(connection_uri, null); - assertNull(labels); - } - - @Test - public void testParseHttpConnectTimeout() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "HttpConnectTimeout=10000"; - - Integer timeout = - BigQueryJdbcUrlUtility.parseIntProperty( - connection_uri, BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, null, null); - assertEquals(Integer.valueOf(10000), timeout); - } - - @Test - public void testParseHttpConnectTimeoutDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - Integer timeout = - BigQueryJdbcUrlUtility.parseIntProperty( - connection_uri, BigQueryJdbcUrlUtility.HTTP_CONNECT_TIMEOUT_PROPERTY_NAME, null, null); - assertNull(timeout); - } - - @Test - public void testParseHttpReadTimeout() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "HttpReadTimeout=20000"; - - Integer timeout = - BigQueryJdbcUrlUtility.parseIntProperty( - connection_uri, BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, null, null); - assertEquals(Integer.valueOf(20000), timeout); - } - - @Test - public void testParseHttpReadTimeoutDefault() { - String connection_uri = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject"; - - Integer timeout = - BigQueryJdbcUrlUtility.parseIntProperty( - connection_uri, BigQueryJdbcUrlUtility.HTTP_READ_TIMEOUT_PROPERTY_NAME, null, null); - assertNull(timeout); - } - - @Test - public void testParseRequestReason() { - String url = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;" - + "OAuthType=3;ProjectId=testProject;RequestReason=testingRequestReason;"; - String requestReason = - BigQueryJdbcUrlUtility.parseStringProperty( - url, - BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME, - null, - "testParseRequestReason"); - assertEquals("testingRequestReason", requestReason); - } - @Test public void testAppendPropertiesToURL_propertyWithSemicolon_isEscaped() throws Exception { String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"; @@ -921,23 +211,4 @@ public void testAppendPropertiesToURL_propertyWithSemicolon_isEscaped() throws E assertThat(parsedProperties.get("ProjectId")).isEqualTo(complexValue); assertFalse(parsedProperties.containsKey("ExtraProperty")); } - - @Test - public void testEndpointOverrides_viaProperties() throws Exception { - String url = "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443"; - Properties props = new Properties(); - - String overrides = "OAUTH2=http://localhost:1234,BIGQUERY=http://localhost:9090"; - props.setProperty("EndpointOverrides", overrides); - - String updatedUrl = BigQueryJdbcUrlUtility.appendPropertiesToURL(url, null, props); - - Map parsedOverrides = - BigQueryJdbcUrlUtility.parseOverrideProperties(updatedUrl, null); - - assertThat(parsedOverrides).containsKey("OAUTH2"); - assertThat(parsedOverrides.get("OAUTH2")).isEqualTo("http://localhost:1234"); - assertThat(parsedOverrides).containsKey("BIGQUERY"); - assertThat(parsedOverrides.get("BIGQUERY")).isEqualTo("http://localhost:9090"); - } } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java index ee9d63beb9..a394e53d0d 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/BigQueryPooledConnectionTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import java.io.IOException; @@ -35,6 +36,7 @@ public class BigQueryPooledConnectionTest { @Before public void setUp() throws IOException, SQLException { bigQueryConnection = mock(BigQueryConnection.class); + doReturn(LISTENER_POOL_SIZE).when(bigQueryConnection).getListenerPoolSize(); } @Test diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java index bacfdae1da..e3ef8a27f6 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionDataSourceTest.java @@ -18,12 +18,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException; import java.sql.SQLException; import javax.sql.PooledConnection; import org.junit.Test; @@ -41,9 +39,13 @@ public void testGetPooledConnection() throws SQLException { BigQueryConnection bqConnection = mock(BigQueryConnection.class); doReturn(connectionUrl).when(bqConnection).getConnectionUrl(); + doReturn(LISTENER_POOL_SIZE).when(bqConnection).getListenerPoolSize(); + doReturn(CONNECTION_POOL_SIZE).when(bqConnection).getConnectionPoolSize(); PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); pooledDataSource.setConnection(bqConnection); + pooledDataSource.setListenerPoolSize(LISTENER_POOL_SIZE); + pooledDataSource.setConnectionPoolSize(CONNECTION_POOL_SIZE); PooledConnection pooledConnection = pooledDataSource.getPooledConnection(); assertNotNull(pooledConnection); @@ -54,27 +56,4 @@ public void testGetPooledConnection() throws SQLException { assertEquals( CONNECTION_POOL_SIZE, pooledDataSource.getConnectionPoolManager().getConnectionPoolSize()); } - - @Test - public void testGetPooledConnectionNoConnectionURl() throws SQLException { - BigQueryConnection bqConnection = mock(BigQueryConnection.class); - PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); - pooledDataSource.setConnection(bqConnection); - - assertThrows(BigQueryJdbcRuntimeException.class, () -> pooledDataSource.getPooledConnection()); - } - - @Test - public void testGetPooledConnectionFailInvalidConnectionURl() { - String connectionUrl = - "jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;OAuthType=3;ProjectId=testProject;" - + "ListenerPoolSize=invalid"; - BigQueryConnection bqConnection = mock(BigQueryConnection.class); - doReturn(connectionUrl).when(bqConnection).getConnectionUrl(); - - PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource(); - pooledDataSource.setConnection(bqConnection); - - assertThrows(NumberFormatException.class, () -> pooledDataSource.getPooledConnection()); - } } diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java index d200709c43..2d1553f655 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/PooledConnectionListenerTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import java.io.IOException; @@ -37,6 +38,9 @@ public class PooledConnectionListenerTest { @Before public void setUp() throws IOException, SQLException { bigQueryConnection = mock(BigQueryConnection.class); + // Stub the listener pool size + doReturn(LISTENER_POOL_SIZE).when(bigQueryConnection).getListenerPoolSize(); + doReturn(CONNECTION_POOL_SIZE).when(bigQueryConnection).getConnectionPoolSize(); } @Test diff --git a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java index 411a488714..22f5c1c763 100644 --- a/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java +++ b/google-cloud-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java @@ -1508,7 +1508,7 @@ public void testDataSourceOAuthPvtKeyPath() throws SQLException, IOException { ds.setURL("jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;"); ds.setOAuthType(0); ds.setOAuthPvtKeyPath(tempFile.toPath().toString()); - assertEquals(0, ds.getOAuthType()); + assertEquals(0, ds.getOAuthType().intValue()); assertEquals(tempFile.toPath().toString(), ds.getOAuthPvtKeyPath()); } From a1327bbbe310474c7ce8071729dbb91b501e1c47 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 23 Mar 2026 11:56:39 -0700 Subject: [PATCH 2268/2268] docs: redirect users to google-cloud-java (#4136) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0d2e002bd3..297a8826ec 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**_THIS REPOSITORY IS DEPRECATED. ALL OF ITS CONTENT AND HISTORY HAS BEEN MOVED TO [GOOGLE-CLOUD-JAVA](https://github.com/googleapis/google-cloud-java/tree/main/java-bigquery)_** + # Google Cloud BigQuery Client for Java Java idiomatic client for [Cloud BigQuery][product-docs].